@kenyaemr/esm-care-panel-app 5.4.2-pre.2699 → 5.4.2-pre.2710
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +4 -4
- package/dist/{489.js → 324.js} +1 -1
- package/dist/324.js.map +1 -0
- package/dist/kenyaemr-esm-care-panel-app.js +3 -3
- package/dist/kenyaemr-esm-care-panel-app.js.buildmanifest.json +27 -27
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/care-programs/care-program.resource.ts +0 -153
- package/src/care-programs/care-programs.component.tsx +39 -20
- package/src/care-programs/useCareProgramForms.ts +20 -0
- package/src/config-schema.ts +322 -0
- package/dist/489.js.map +0 -1
package/dist/main.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* {
|
|
11
11
|
overscroll-behavior: contain;
|
|
12
12
|
}
|
|
13
|
-
}`.trim(),document.head.prepend(r);let a=t=>{if(2!==t.touches.length&&!n){if(!e||e===document.documentElement||e===document.body)return void t.preventDefault();e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&t.preventDefault()}},o=e=>{let n=e.target,t=e.relatedTarget;if(t&&lb(t))t.focus({preventScroll:!0}),lD(t,lb(n));else if(!t){var r;let e=null==(r=n.parentElement)?void 0:r.closest("[tabindex]");null==e||e.focus({preventScroll:!0})}},i=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(e){let n=null!=document.activeElement&&lb(document.activeElement);i.call(this,{...e,preventScroll:!0}),e&&e.preventScroll||lD(this,n)};let s=eB(lx(document,"touchstart",t,{passive:!1,capture:!0}),lx(document,"touchmove",a,{passive:!1,capture:!0}),lx(document,"blur",o,!0));return()=>{s(),r.remove(),HTMLElement.prototype.focus=i}}function lE(e,n,t){let r=e.style[n];return e.style[n]=t,()=>{e.style[n]=r}}function lx(e,n,t,r){return e.addEventListener(n,t,r),()=>{e.removeEventListener(n,t,r)}}function lD(e,n){n||!lv?lS(e):lv.addEventListener("resize",()=>lS(e),{once:!0})}function lS(e){let n=document.scrollingElement||document.documentElement,t=e;for(;t&&t!==n;){let e=ag(t);if(e!==document.documentElement&&e!==document.body&&e!==t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(r.top<n.top||r.bottom>n.top+t.clientHeight){let t=n.bottom;lv&&(t=Math.min(t,lv.offsetTop+lv.height));let a=r.top-n.top-((t-n.top)/2-r.height/2);e.scrollTo({top:Math.max(0,Math.min(e.scrollHeight-e.clientHeight,e.scrollTop+a)),behavior:"smooth"})}}t=e.parentElement}}function lz(e,n){let{triggerRef:t,popoverRef:r,groupRef:a,isNonModal:o,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:s,...l}=e,c="SubmenuTrigger"===l.trigger,{overlayProps:u,underlayProps:d}=lA({isOpen:n.isOpen,onClose:n.close,shouldCloseOnBlur:!0,isDismissable:!o||c,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:s},null!=a?a:r),{overlayProps:p,arrowProps:f,placement:h,triggerAnchorPoint:m}=lp({...l,targetRef:t,overlayRef:r,isOpen:n.isOpen,onClose:o&&!c?n.close:null});return l$({isDisabled:o||!n.isOpen}),(0,g.useEffect)(()=>{if(n.isOpen&&r.current){var e,t;return o?sV(null!=(e=null==a?void 0:a.current)?e:r.current):sG([null!=(t=null==a?void 0:a.current)?t:r.current],{shouldUseInert:!0})}},[o,n.isOpen,r,a]),{popoverProps:eq(u,p),arrowProps:f,underlayProps:d,placement:h,triggerAnchorPoint:m}}var lB={},lM={},lT={},lO={},lN={},lP={},lI={},lF={},lR={},lH={},lL={},lj={},lq={},lG={},lV={},lU={},lW={},lK={},lZ={},lY={},lJ={},lX={},lQ={},l0={},l1={},l2={},l3={},l4={},l5={},l6={},l8={},l7={},l9={},ce={},cn={};function ct(e){return e&&e.__esModule?e.default:e}function cr(e){let{onDismiss:n,...t}=e,r=r9(t,rq(ct(cn),"@react-aria/overlays").format("dismiss")),a=()=>{n&&n()};return g.createElement(ao,null,g.createElement("button",{...r,tabIndex:-1,onClick:a,style:{width:1,height:1}}))}function ca(e,n=!0){let[t,r]=(0,g.useState)(!0),a=t&&n;return eM(()=>{if(a&&e.current&&"getAnimations"in e.current)for(let n of e.current.getAnimations())n instanceof CSSTransition&&n.cancel()},[e,a]),ci(e,a,(0,g.useCallback)(()=>r(!1),[])),a}function co(e,n){let[t,r]=(0,g.useState)(n?"open":"closed");switch(t){case"open":n||r("exiting");break;case"closed":case"exiting":n&&r("open")}let a="exiting"===t;return ci(e,a,(0,g.useCallback)(()=>{r(e=>"exiting"===e?"closed":e)},[])),a}function ci(e,n,t){eM(()=>{if(n&&e.current){if(!("getAnimations"in e.current))return void t();let n=e.current.getAnimations();if(0===n.length)return void t();let r=!1;return Promise.all(n.map(e=>e.finished)).then(()=>{r||(0,n9.flushSync)(()=>{t()})}).catch(()=>{}),()=>{r=!0}}},[e,n,t])}function cs(e){let[n,t]=aD(e.isOpen,e.defaultOpen||!1,e.onOpenChange),r=(0,g.useCallback)(()=>{t(!0)},[t]),a=(0,g.useCallback)(()=>{t(!1)},[t]),o=(0,g.useCallback)(()=>{t(!n)},[t,n]);return{isOpen:n,setOpen:t,open:r,close:a,toggle:o}}cn={"ar-AE":lB={dismiss:`\u{62A}\u{62C}\u{627}\u{647}\u{644}`},"bg-BG":lM={dismiss:`\u{41E}\u{442}\u{445}\u{432}\u{44A}\u{440}\u{43B}\u{44F}\u{43D}\u{435}`},"cs-CZ":lT={dismiss:"Odstranit"},"da-DK":lO={dismiss:"Luk"},"de-DE":lN={dismiss:`Schlie\xdfen`},"el-GR":lP={dismiss:`\u{391}\u{3C0}\u{3CC}\u{3C1}\u{3C1}\u{3B9}\u{3C8}\u{3B7}`},"en-US":lI={dismiss:"Dismiss"},"es-ES":lF={dismiss:"Descartar"},"et-EE":lR={dismiss:`L\xf5peta`},"fi-FI":lH={dismiss:`Hylk\xe4\xe4`},"fr-FR":lL={dismiss:"Rejeter"},"he-IL":lj={dismiss:`\u{5D4}\u{5EA}\u{5E2}\u{5DC}\u{5DD}`},"hr-HR":lq={dismiss:"Odbaci"},"hu-HU":lG={dismiss:`Elutas\xedt\xe1s`},"it-IT":lV={dismiss:"Ignora"},"ja-JP":lU={dismiss:`\u{9589}\u{3058}\u{308B}`},"ko-KR":lW={dismiss:`\u{BB34}\u{C2DC}`},"lt-LT":lK={dismiss:"Atmesti"},"lv-LV":lZ={dismiss:`Ner\u{101}d\u{12B}t`},"nb-NO":lY={dismiss:"Lukk"},"nl-NL":lJ={dismiss:"Negeren"},"pl-PL":lX={dismiss:"Zignoruj"},"pt-BR":lQ={dismiss:"Descartar"},"pt-PT":l0={dismiss:"Dispensar"},"ro-RO":l1={dismiss:"Revocare"},"ru-RU":l2={dismiss:`\u{41F}\u{440}\u{43E}\u{43F}\u{443}\u{441}\u{442}\u{438}\u{442}\u{44C}`},"sk-SK":l3={dismiss:`Zru\u{161}i\u{165}`},"sl-SI":l4={dismiss:"Opusti"},"sr-SP":l5={dismiss:"Odbaci"},"sv-SE":l6={dismiss:"Avvisa"},"tr-TR":l8={dismiss:"Kapat"},"uk-UA":l7={dismiss:`\u{421}\u{43A}\u{430}\u{441}\u{443}\u{432}\u{430}\u{442}\u{438}`},"zh-CN":l9={dismiss:`\u{53D6}\u{6D88}`},"zh-TW":ce={dismiss:`\u{95DC}\u{9589}`}};let cl=(0,g.createContext)(null),cc=(0,g.createContext)(null),cu=(0,g.forwardRef)(function(e,n){[e,n]=eK(e,n,cl);let t=(0,g.useContext)(sx),r=cs(e),a=null==e.isOpen&&null==e.defaultOpen&&t?t:r,o=co(n,a.isOpen)||e.isExiting||!1,i=t0(),{direction:s}=ex();if(i){let n=e.children;return"function"==typeof n&&(n=n({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),g.createElement(g.Fragment,null,n)}return!a||a.isOpen||o?g.createElement(cd,{...e,triggerRef:e.triggerRef,state:a,popoverRef:n,isExiting:o,dir:s}):null});function cd({state:e,isExiting:n,UNSTABLE_portalContainer:t,clearContexts:r,...a}){var o,i;let s=(0,g.useRef)(null),l=(0,g.useRef)(null),c=(0,g.useContext)(cc),u=c&&"SubmenuTrigger"===a.trigger,{popoverProps:d,underlayProps:p,arrowProps:f,placement:h,triggerAnchorPoint:m}=lz({...a,offset:null!=(o=a.offset)?o:8,arrowRef:s,groupRef:u?c:l},e),A=a.popoverRef,y=ca(A,!!h)||a.isEntering||!1,b=eU({...a,defaultClassName:"react-aria-Popover",values:{trigger:a.trigger||null,placement:h,isEntering:y,isExiting:n}}),v=!a.isNonModal||"SubmenuTrigger"===a.trigger,[C,$]=(0,g.useState)(!1);eM(()=>{A.current&&$(v&&!A.current.querySelector("[role=dialog]"))},[A,v]),(0,g.useEffect)(()=>{C&&"SubmenuTrigger"!==a.trigger&&A.current&&!A.current.contains(document.activeElement)&&tP(A.current)},[C,A,a.trigger]);let w=(0,g.useMemo)(()=>{let e=b.children;if(r)for(let n of r)e=g.createElement(n.Provider,{value:null},e);return e},[b.children,r]),k={...d.style,"--trigger-anchor-point":m?`${m.x}px ${m.y}px`:void 0,...b.style},E=g.createElement("div",{...eq(e9(a,{global:!0}),d),...b,role:C?"dialog":void 0,tabIndex:C?-1:void 0,"aria-label":a["aria-label"],"aria-labelledby":a["aria-labelledby"],ref:A,slot:a.slot||void 0,style:k,dir:a.dir,"data-trigger":a.trigger,"data-placement":h,"data-entering":y||void 0,"data-exiting":n||void 0},!a.isNonModal&&g.createElement(cr,{onDismiss:e.close}),g.createElement(sH.Provider,{value:{...f,placement:h,ref:s}},w),g.createElement(cr,{onDismiss:e.close}));return u?g.createElement(s$,{...a,shouldContainFocus:C,isExiting:n,portalContainer:null!=(i=null!=t?t:null==c?void 0:c.current)?i:void 0},E):g.createElement(s$,{...a,shouldContainFocus:C,isExiting:n,portalContainer:t},!a.isNonModal&&e.isOpen&&g.createElement("div",{"data-testid":"underlay",...p,style:{position:"fixed",inset:0}}),g.createElement("div",{ref:l,style:{display:"contents"}},g.createElement(cc.Provider,{value:l},E)))}function cp(e){return e&&e.__esModule?e.default:e}function cf(e,n,t){let r=eF(),a=eF(),o=eF(),i=rq(cp(ok),"@react-aria/datepicker"),{isInvalid:s,validationErrors:l,validationDetails:c}=n.displayValidation,{labelProps:u,fieldProps:d,descriptionProps:p,errorMessageProps:f}=o6({...e,labelElementType:"span",isInvalid:s,errorMessage:e.errorMessage||l}),h=o2(n,t),m=d["aria-labelledby"]||d.id,{locale:A}=ex(),y=n.formatValue(A,{month:"long"}),b=ad(y?i.format("selectedDateDescription",{date:y}):""),v=[b["aria-describedby"],d["aria-describedby"]].filter(Boolean).join(" ")||void 0,C=e9(e),$=(0,g.useMemo)(()=>oJ(t),[t]),w=(0,g.useRef)(!1),{focusWithinProps:k}=tG({...e,isDisabled:n.isOpen,onBlurWithin:n=>{let t=document.getElementById(a);if(!(null==t?void 0:t.contains(n.relatedTarget))){var r,o;w.current=!1,null==(r=e.onBlur)||r.call(e,n),null==(o=e.onFocusChange)||o.call(e,!1)}},onFocusWithin:n=>{if(!w.current){var t,r;w.current=!0,null==(t=e.onFocus)||t.call(e,n),null==(r=e.onFocusChange)||r.call(e,!0)}}});return{groupProps:eq(C,h,d,b,k,{role:"group","aria-disabled":e.isDisabled||null,"aria-labelledby":m,"aria-describedby":v,onKeyDown(t){!n.isOpen&&e.onKeyDown&&e.onKeyDown(t)},onKeyUp(t){!n.isOpen&&e.onKeyUp&&e.onKeyUp(t)}}),labelProps:{...u,onClick:()=>{$.focusFirst()}},fieldProps:{...d,id:o,[ia]:"presentation","aria-describedby":v,value:n.value,defaultValue:n.defaultValue,onChange:n.setValue,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,granularity:e.granularity,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior,[iK]:n,autoFocus:e.autoFocus,name:e.name,form:e.form},descriptionProps:p,errorMessageProps:f,buttonProps:{...b,id:r,"aria-haspopup":"dialog","aria-label":i.format("calendar"),"aria-labelledby":`${r} ${m}`,"aria-describedby":v,"aria-expanded":n.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>n.setOpen(!0)},dialogProps:{id:a,"aria-labelledby":`${r} ${m}`},calendarProps:{autoFocus:!0,value:n.dateValue,onChange:n.setDateValue,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,defaultFocusedValue:n.dateValue?void 0:e.placeholderValue,isInvalid:n.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(n.displayValidation):e.errorMessage||n.displayValidation.validationErrors.join(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:s,validationErrors:l,validationDetails:c}}function c_(e){return e&&e.__esModule?e.default:e}function ch(e,n,t){var r,a,o,i,s,l,c;let u=rq(c_(ok),"@react-aria/datepicker"),{isInvalid:d,validationErrors:p,validationDetails:f}=n.displayValidation,{labelProps:h,fieldProps:m,descriptionProps:A,errorMessageProps:y}=o6({...e,labelElementType:"span",isInvalid:d,errorMessage:e.errorMessage||p}),b=m["aria-labelledby"]||m.id,{locale:v}=ex(),C=n.formatValue(v,{month:"long"}),$=ad(C?u.format("selectedRangeDescription",{startDate:C.start,endDate:C.end}):""),w={"aria-label":u.format("startDate"),"aria-labelledby":b},k={"aria-label":u.format("endDate"),"aria-labelledby":b},E=eF(),x=eF(),D=o2(n,t),S=[$["aria-describedby"],m["aria-describedby"]].filter(Boolean).join(" ")||void 0,z=(0,g.useMemo)(()=>oJ(t,{accept:e=>e.id!==E}),[t,E]),B={[io]:z,[ia]:"presentation","aria-describedby":S,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,granularity:e.granularity,shouldForceLeadingZeros:e.shouldForceLeadingZeros,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior},M=e9(e),T=(0,g.useRef)(!1),{focusWithinProps:O}=tG({...e,isDisabled:n.isOpen,onBlurWithin:n=>{let t=document.getElementById(x);if(!(null==t?void 0:t.contains(n.relatedTarget))){var r,a;T.current=!1,null==(r=e.onBlur)||r.call(e,n),null==(a=e.onFocusChange)||a.call(e,!1)}},onFocusWithin:n=>{if(!T.current){var t,r;T.current=!0,null==(t=e.onFocus)||t.call(e,n),null==(r=e.onFocusChange)||r.call(e,!0)}}}),N=(0,g.useRef)(iU),P=(0,g.useRef)(iU);return{groupProps:eq(M,D,m,$,O,{role:"group","aria-disabled":e.isDisabled||null,"aria-describedby":S,onKeyDown(t){!n.isOpen&&e.onKeyDown&&e.onKeyDown(t)},onKeyUp(t){!n.isOpen&&e.onKeyUp&&e.onKeyUp(t)}}),labelProps:{...h,onClick:()=>{z.focusFirst()}},buttonProps:{...$,id:E,"aria-haspopup":"dialog","aria-label":u.format("calendar"),"aria-labelledby":`${E} ${b}`,"aria-describedby":S,"aria-expanded":n.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>n.setOpen(!0)},dialogProps:{id:x,"aria-labelledby":`${E} ${b}`},startFieldProps:{...w,...B,value:null!=(l=null==(r=n.value)?void 0:r.start)?l:null,defaultValue:null==(a=n.defaultValue)?void 0:a.start,onChange:e=>n.setDateTime("start",e),autoFocus:e.autoFocus,name:e.startName,form:e.form,[iK]:{realtimeValidation:n.realtimeValidation,displayValidation:n.displayValidation,updateValidation(e){N.current=e,n.updateValidation(i1(e,P.current))},resetValidation:n.resetValidation,commitValidation:n.commitValidation}},endFieldProps:{...k,...B,value:null!=(c=null==(o=n.value)?void 0:o.end)?c:null,defaultValue:null==(i=n.defaultValue)?void 0:i.end,onChange:e=>n.setDateTime("end",e),name:e.endName,form:e.form,[iK]:{realtimeValidation:n.realtimeValidation,displayValidation:n.displayValidation,updateValidation(e){P.current=e,n.updateValidation(i1(N.current,e))},resetValidation:n.resetValidation,commitValidation:n.commitValidation}},descriptionProps:A,errorMessageProps:y,calendarProps:{autoFocus:!0,value:(null==(s=n.dateRange)?void 0:s.start)&&n.dateRange.end?n.dateRange:null,onChange:n.setDateRange,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,allowsNonContiguousRanges:e.allowsNonContiguousRanges,defaultFocusedValue:n.dateRange?void 0:e.placeholderValue,isInvalid:n.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(n.displayValidation):e.errorMessage||n.displayValidation.validationErrors.join(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:d,validationErrors:p,validationDetails:f}}function cm(e){var n,t;let r=cs(e),[a,o]=aD(e.value,e.defaultValue||null,e.onChange),[i]=(0,g.useState)(a),s=a||e.placeholderValue||null,[l,c]=st(s,e.granularity),u=null!=a?a.toDate(null!=c?c:"UTC"):null,d="hour"===l||"minute"===l||"second"===l,p=null==(n=e.shouldCloseOnSelect)||n,[f,h]=(0,g.useState)(null),[m,A]=(0,g.useState)(null);if(a&&(f=a,"hour"in a&&(m=a)),s&&!(l in s))throw Error("Invalid granularity "+l+" for value "+s.toString());let y=(null==a?void 0:a.calendar.identifier)==="gregory"&&"BC"===a.era,b=(0,g.useMemo)(()=>({granularity:l,timeZone:c,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:y}),[l,e.hourCycle,e.shouldForceLeadingZeros,c,e.hideTimeZone,y]),{minValue:v,maxValue:C,isDateUnavailable:$}=e,w=(0,g.useMemo)(()=>i4(a,v,C,$,b),[a,v,C,$,b]),k=iZ({...e,value:a,builtinValidation:w}),E=k.displayValidation.isInvalid,x=e.validationState||(E?"invalid":null),D=(e,n)=>{o("timeZone"in n?n.set((0,ee.gw)(e)):(0,ee.tR)(e,n)),h(null),A(null),k.commitValidation()},S=n=>{let t="function"==typeof p?p():p;d?m||t?D(n,m||i9(e.defaultValue||e.placeholderValue)):h(n):(o(n),k.commitValidation()),t&&r.setOpen(!1)},z=e=>{f&&e?D(f,e):A(e)};return{...k,value:a,defaultValue:null!=(t=e.defaultValue)?t:i,setValue:o,dateValue:f,timeValue:m,setDateValue:S,setTimeValue:z,granularity:l,hasTime:d,...r,setOpen(n){!n&&!a&&f&&d&&D(f,m||i9(e.defaultValue||e.placeholderValue)),r.setOpen(n)},validationState:x,isInvalid:E,formatValue:(e,n)=>u?new rV(e,i7(n,b)).format(u):"",getDateFormatter:(e,n)=>new rV(e,i7({},{...b,...n}))}}function cg(e){var n,t,r,a;let o=cs(e),[i,s]=aD(e.value,e.defaultValue||null,e.onChange),[l]=(0,g.useState)(i),[c,u]=(0,g.useState)(()=>i||{start:null,end:null});null==i&&c.start&&c.end&&u(c={start:null,end:null});let d=i||c,p=e=>{u(d=e||{start:null,end:null}),cA(d)?s(d):s(null)},[f,h]=st((null==d?void 0:d.start)||(null==d?void 0:d.end)||e.placeholderValue||null,e.granularity),m="hour"===f||"minute"===f||"second"===f,A=null==(r=e.shouldCloseOnSelect)||r,[y,b]=(0,g.useState)(null),[v,C]=(0,g.useState)(null);d&&cA(d)&&(y=d,"hour"in d.start&&(v=d));let $=(e,n)=>{p({start:"timeZone"in n.start?n.start.set((0,ee.gw)(e.start)):(0,ee.tR)(e.start,n.start),end:"timeZone"in n.end?n.end.set((0,ee.gw)(e.end)):(0,ee.tR)(e.end,n.end)}),b(null),C(null),M.commitValidation()},w=n=>{let t="function"==typeof A?A():A;m?cA(n)&&(t||(null==v?void 0:v.start)&&(null==v?void 0:v.end))?$(n,{start:(null==v?void 0:v.start)||i9(e.placeholderValue),end:(null==v?void 0:v.end)||i9(e.placeholderValue)}):b(n):cA(n)?(p(n),M.commitValidation()):b(n),t&&o.setOpen(!1)},k=e=>{cA(y)&&cA(e)?$(y,e):C(e)},E=(null==d||null==(n=d.start)?void 0:n.calendar.identifier)==="gregory"&&"BC"===d.start.era||(null==d||null==(t=d.end)?void 0:t.calendar.identifier)==="gregory"&&"BC"===d.end.era,x=(0,g.useMemo)(()=>({granularity:f,timeZone:h,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:E}),[f,e.hourCycle,e.shouldForceLeadingZeros,h,e.hideTimeZone,E]),{minValue:D,maxValue:S,isDateUnavailable:z}=e,B=(0,g.useMemo)(()=>i5(d,D,S,z,x),[d,D,S,z,x]),M=iZ({...e,value:i,name:(0,g.useMemo)(()=>[e.startName,e.endName].filter(e=>null!=e),[e.startName,e.endName]),builtinValidation:B}),T=M.displayValidation.isInvalid,O=e.validationState||(T?"invalid":null);return{...M,value:d,defaultValue:null!=(a=e.defaultValue)?a:l,setValue:p,dateRange:y,timeRange:v,granularity:f,hasTime:m,setDate(e,n){var t,r;"start"===e?w({start:n,end:null!=(t=null==y?void 0:y.end)?t:null}):w({start:null!=(r=null==y?void 0:y.start)?r:null,end:n})},setTime(e,n){var t,r;"start"===e?k({start:n,end:null!=(t=null==v?void 0:v.end)?t:null}):k({start:null!=(r=null==v?void 0:v.start)?r:null,end:n})},setDateTime(e,n){var t,r;"start"===e?p({start:n,end:null!=(t=null==d?void 0:d.end)?t:null}):p({start:null!=(r=null==d?void 0:d.start)?r:null,end:n})},setDateRange:w,setTimeRange:k,...o,setOpen(n){!n&&!((null==d?void 0:d.start)&&(null==d?void 0:d.end))&&cA(y)&&m&&$(y,{start:(null==v?void 0:v.start)||i9(e.placeholderValue),end:(null==v?void 0:v.end)||i9(e.placeholderValue)}),o.setOpen(n)},validationState:O,isInvalid:T,formatValue(n,t){let r;if(!d||!d.start||!d.end)return null;let a="timeZone"in d.start?d.start.timeZone:void 0,o=e.granularity||(d.start&&"minute"in d.start?"minute":"day"),i="timeZone"in d.end?d.end.timeZone:void 0,s=e.granularity||(d.end&&"minute"in d.end?"minute":"day"),l=i7(t,{granularity:o,timeZone:a,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,showEra:"gregory"===d.start.calendar.identifier&&"BC"===d.start.era||"gregory"===d.end.calendar.identifier&&"BC"===d.end.era}),c=d.start.toDate(a||"UTC"),u=d.end.toDate(i||"UTC"),p=new rV(n,l);if(a===i&&o===s&&0!==d.start.compare(d.end)){try{let e=p.formatRangeToParts(c,u),n=-1;for(let t=0;t<e.length;t++){let r=e[t];if("shared"===r.source&&"literal"===r.type)n=t;else if("endRange"===r.source)break}let t="",r="";for(let a=0;a<e.length;a++)a<n?t+=e[a].value:a>n&&(r+=e[a].value);return{start:t,end:r}}catch{}r=p}else r=new rV(n,i7(t,{granularity:s,timeZone:i,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle}));return{start:p.format(c),end:r.format(u)}},getDateFormatter:(e,n)=>new rV(e,i7({},{...x,...n}))}}function cA(e){return(null==e?void 0:e.start)!=null&&null!=e.end}let cy=(0,g.createContext)(null),cb=(0,g.createContext)(null),cv=(0,g.createContext)(null),cC=(0,g.createContext)(null),c$=[aY,t1,sF,t5],cw=(0,g.forwardRef)(function(e,n){var t,r;[e,n]=eK(e,n,cy);let{validationBehavior:a}=eW(sM)||{},o=null!=(r=null!=(t=e.validationBehavior)?t:a)?r:"native",i=cm({...e,validationBehavior:o}),s=(0,g.useRef)(null),[l,c]=eZ(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:u,labelProps:d,fieldProps:p,buttonProps:f,dialogProps:h,calendarProps:m,descriptionProps:A,errorMessageProps:y,...b}=cf({...eY(e),label:c,validationBehavior:o},i,s),[v,C]=(0,g.useState)(null),$=(0,g.useCallback)(()=>{s.current&&C(s.current.offsetWidth+"px")},[]);lu({ref:s,onResize:$});let{focusProps:w,isFocused:k,isFocusVisible:E}=tV({within:!0}),x=eU({...e,values:{state:i,isFocusWithin:k,isFocusVisible:E,isDisabled:e.isDisabled||!1,isInvalid:i.isInvalid,isOpen:i.isOpen,isReadOnly:e.isReadOnly||!1},defaultClassName:"react-aria-DatePicker"}),D=e9(e,{global:!0});return delete D.id,g.createElement(eV,{values:[[cv,i],[aY,{...u,ref:s,isInvalid:i.isInvalid}],[sf,p],[t1,{...f,isPressed:i.isOpen}],[sF,{...d,ref:l,elementType:"span"}],[aN,m],[sx,i],[cl,{trigger:"DatePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":v},clearContexts:c$}],[sE,h],[t5,{slots:{description:A,errorMessage:y}}],[sS,b]]},g.createElement("div",{...eq(D,x,w),ref:n,slot:e.slot||void 0,"data-focus-within":k||void 0,"data-invalid":i.isInvalid||void 0,"data-focus-visible":E||void 0,"data-disabled":e.isDisabled||void 0,"data-readonly":e.isReadOnly||void 0,"data-open":i.isOpen||void 0}),g.createElement(sI,{autoComplete:e.autoComplete,name:e.name,isDisabled:e.isDisabled,state:i}))}),ck=(0,g.forwardRef)(function(e,n){var t,r;[e,n]=eK(e,n,cb);let{validationBehavior:a}=eW(sM)||{},o=null!=(r=null!=(t=e.validationBehavior)?t:a)?r:"native",i=cg({...e,validationBehavior:o}),s=(0,g.useRef)(null),[l,c]=eZ(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:u,labelProps:d,startFieldProps:p,endFieldProps:f,buttonProps:h,dialogProps:m,calendarProps:A,descriptionProps:y,errorMessageProps:b,...v}=ch({...eY(e),label:c,validationBehavior:o},i,s),[C,$]=(0,g.useState)(null),w=(0,g.useCallback)(()=>{s.current&&$(s.current.offsetWidth+"px")},[]);lu({ref:s,onResize:w});let{focusProps:k,isFocused:E,isFocusVisible:x}=tV({within:!0}),D=eU({...e,values:{state:i,isFocusWithin:E,isFocusVisible:x,isDisabled:e.isDisabled||!1,isInvalid:i.isInvalid,isOpen:i.isOpen,isReadOnly:e.isReadOnly||!1},defaultClassName:"react-aria-DateRangePicker"}),S=e9(e,{global:!0});return delete S.id,g.createElement(eV,{values:[[cC,i],[aY,{...u,ref:s,isInvalid:i.isInvalid}],[t1,{...h,isPressed:i.isOpen}],[sF,{...d,ref:l,elementType:"span"}],[aP,A],[sx,i],[cl,{trigger:"DateRangePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":C},clearContexts:c$}],[sE,m],[sf,{slots:{start:p,end:f}}],[t5,{slots:{description:y,errorMessage:b}}],[sS,v]]},g.createElement("div",{...eq(S,D,k),ref:n,slot:e.slot||void 0,"data-focus-within":E||void 0,"data-invalid":i.isInvalid||void 0,"data-focus-visible":x||void 0,"data-disabled":e.isDisabled||void 0,"data-readonly":e.isReadOnly||void 0,"data-open":i.isOpen||void 0}))});var cE=t(42729),cx=t(22613),cD=t(48753),cS={};cS.styleTagTransform=T(),cS.setAttributes=S(),cS.insert=x().bind(null,"head"),cS.domAPI=k(),cS.insertStyleElement=B(),$()(cD.A,cS);let cz=cD.A&&cD.A.locals?cD.A.locals:void 0;function cB(e,n){if(null==e)return{};var t,r,a=cM(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function cM(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}var cT=["omrs-icon-activity","omrs-icon-add","omrs-icon-arrow-down","omrs-icon-arrow-left","omrs-icon-arrow-right","omrs-icon-arrow-up","omrs-icon-baby","omrs-icon-calendar-heat-map","omrs-icon-calendar","omrs-icon-caret-down","omrs-icon-caret-left","omrs-icon-caret-right","omrs-icon-caret-up","omrs-icon-chart-average","omrs-icon-checkmark-filled","omrs-icon-checkmark-outline","omrs-icon-chemistry","omrs-icon-chevron-down","omrs-icon-chevron-left","omrs-icon-chevron-right","omrs-icon-chevron-up","omrs-icon-close","omrs-icon-close-filled","omrs-icon-close-outline","omrs-icon-document","omrs-icon-document-attachment","omrs-icon-download","omrs-icon-drug-order","omrs-icon-edit","omrs-icon-event-schedule","omrs-icon-events","omrs-icon-gender-female","omrs-icon-gender-male","omrs-icon-gender-other","omrs-icon-gender-unknown","omrs-icon-generic-order-type","omrs-icon-group","omrs-icon-group-access","omrs-icon-hospital-bed","omrs-icon-image-medical","omrs-icon-information","omrs-icon-information-filled","omrs-icon-information-square","omrs-icon-inventory-management","omrs-icon-lab-order","omrs-icon-list-checked","omrs-icon-location","omrs-icon-material-order","omrs-icon-maximize","omrs-icon-medication","omrs-icon-message-queue","omrs-icon-microscope","omrs-icon-money","omrs-icon-mother","omrs-icon-movement","omrs-icon-overflow-menu--horizontal","omrs-icon-overflow-menu--vertical","omrs-icon-password","omrs-icon-pedestrian-family","omrs-icon-pen","omrs-icon-printer","omrs-icon-procedure-order","omrs-icon-programs","omrs-icon-renew","omrs-icon-referral-order","omrs-icon-report","omrs-icon-reset","omrs-icon-save","omrs-icon-search","omrs-icon-settings","omrs-icon-shopping-cart","omrs-icon-shopping-cart--arrow-down","omrs-icon-sticky-note-add","omrs-icon-switcher","omrs-icon-syringe","omrs-icon-table-of-contents","omrs-icon-table","omrs-icon-time","omrs-icon-tools","omrs-icon-translate","omrs-icon-trash-can","omrs-icon-tree-view--alt","omrs-icon-user-avatar","omrs-icon-user-follow","omrs-icon-user-xray","omrs-icon-user","omrs-icon-view-off","omrs-icon-view","omrs-icon-warning"],cO=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-activity",iconProps:e})})),cN=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-add",iconProps:e})})),cP=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-arrow-down",iconProps:e})})),cI=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-arrow-left",iconProps:e})})),cF=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-arrow-right",iconProps:e})})),cR=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-arrow-up",iconProps:e})})),cH=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-baby",iconProps:e})})),cL=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-calendar-heat-map",iconProps:e})})),cj=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-calendar",iconProps:e})})),cq=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-caret-down",iconProps:e})})),cG=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-caret-left",iconProps:e})})),cV=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-caret-right",iconProps:e})})),cU=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-caret-up",iconProps:e})})),cW=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-chart-average",iconProps:e})})),cK=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-checkmark-filled",iconProps:e})})),cZ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-checkmark-outline",iconProps:e})})),cY=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-chemistry",iconProps:e})})),cJ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-chevron-down",iconProps:e})})),cX=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-chevron-left",iconProps:e})})),cQ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-chevron-right",iconProps:e})})),c0=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-chevron-up",iconProps:e})})),c1=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-close",iconProps:e})})),c2=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-close-filled",iconProps:e})})),c3=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-close-outline",iconProps:e})})),c4=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-document",iconProps:e})})),c5=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-document-attachment",iconProps:e})})),c6=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-download",iconProps:e})})),c8=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-drug-order",iconProps:e})})),c7=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-edit",iconProps:e})})),c9=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-event-schedule",iconProps:e})})),ue=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-events",iconProps:e})})),un=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-gender-female",iconProps:e})})),ut=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-gender-male",iconProps:e})})),ur=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-gender-other",iconProps:e})})),ua=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-gender-unknown",iconProps:e})})),uo=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-generic-order-type",iconProps:e})})),ui=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-group",iconProps:e})})),us=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-group-access",iconProps:e})})),ul=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-hospital-bed",iconProps:e})})),uc=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-image-medical",iconProps:e})})),uu=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-information",iconProps:e})})),ud=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-information-filled",iconProps:e})})),up=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-information-square",iconProps:e})})),uf=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-inventory-management",iconProps:e})})),u_=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-lab-order",iconProps:e})})),uh=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-list-checked",iconProps:e})})),um=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-location",iconProps:e})})),ug=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-material-order",iconProps:e})})),uA=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-maximize",iconProps:e})})),uy=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-medication",iconProps:e})})),ub=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-message-queue",iconProps:e})})),uv=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-microscope",iconProps:e})})),uC=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-money",iconProps:e})})),u$=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-mother",iconProps:e})})),uw=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-movement",iconProps:e})})),uk=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),uE=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),ux=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-password",iconProps:e})})),uD=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-pedestrian-family",iconProps:e})})),uS=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-pen",iconProps:e})})),uz=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-printer",iconProps:e})})),uB=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-procedure-order",iconProps:e})})),uM=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-programs",iconProps:e})})),uT=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-referral-order",iconProps:e})})),uO=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-renew",iconProps:e})})),uN=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-report",iconProps:e})})),uP=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-reset",iconProps:e})})),uI=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-save",iconProps:e})})),uF=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-search",iconProps:e})})),uR=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-settings",iconProps:e})})),uH=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-switcher",iconProps:e})})),uL=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-shopping-cart",iconProps:e})})),uj=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-shopping-cart--arrow-down",iconProps:e})})),uq=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-sticky-note-add",iconProps:e})})),uG=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-syringe",iconProps:e})})),uV=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-table-of-contents",iconProps:e})})),uU=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-table",iconProps:e})})),uW=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-time",iconProps:e})})),uK=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-tools",iconProps:e})})),uZ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-translate",iconProps:e})})),uY=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-trash-can",iconProps:e})})),uJ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-tree-view--alt",iconProps:e})})),uX=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-user-avatar",iconProps:e})})),uQ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-user-follow",iconProps:e})})),u0=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-user-xray",iconProps:e})})),u1=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-user",iconProps:e})})),u2=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-view-off",iconProps:e})})),u3=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-view",iconProps:e})})),u4=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-warning",iconProps:e})})),u5=u4,u6=c5,u8=uh,u7=uc,u9=uj,de=(0,g.memo)((0,g.forwardRef)(function(e,n){var t=e.icon,r=e.fallback,a=cB(e,["icon","fallback"]),o=(0,g.useRef)(document.getElementById(t));return(0,g.useEffect)(function(){var e=document.getElementById("omrs-svgs-container"),n=new MutationObserver(function(e){var n=!0,r=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var l=i.value;"childList"===l.type&&(o.current=document.getElementById(t))}}catch(e){r=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw a}}});return e&&n.observe(e,{childList:!0}),function(){return n.disconnect()}},[t]),A().createElement(v.fS,{value:o.current,fallback:r},A().createElement(dn,{ref:n,icon:t,iconProps:a}))})),dn=(0,g.memo)((0,g.forwardRef)(function(e,n){var t=e.icon,r=Object.assign({},{fill:"currentColor",size:20},e.iconProps),a=r.className,o=r.fill,i=r.size;(i<=0||i>72)&&(console.error("Invalid size '".concat(i,"' specified for ").concat(t,". Defaulting to 20.")),i=20);var s=(0,g.useRef)(null);return(0,g.useImperativeHandle)(n,function(){return s.current}),(0,g.useEffect)(function(){s.current&&"currentColor"!==o&&s.current.style.setProperty("--omrs-icon-fill",o)},[]),A().createElement("svg",{ref:s,className:b()("omrs-icon",cz.icon,a),height:i,width:i,viewBox:"0 0 16 16"},A().createElement("use",{href:"#".concat(t)}))})),dt=t(23464),dr=t.n(dt);function da(e,n){return null!=n&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?!!n[Symbol.hasInstance](e):e instanceof n}function di(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e)return t?e:void 0;if("string"==typeof e&&!e)return t?null:void 0;if(da(e,iq.ng)||da(e,iq._l)||da(e,iq.Ip))return n?(0,ee.yP)(e,n):e;var r=dr()(e).toDate(),a=new iq.ng(r.getFullYear(),r.getMonth()+1,r.getDate());return n?(0,ee.yP)(a,n):a}function ds(e){if(e)return e.toDate((0,en.Xj)())}var dl=(0,g.createContext)(null),dc=function(){return(0,g.useContext)(dl)},du={},dd={},dp={},df={},d_={},dh={},dm={},dg={},dA={},dy={},db={},dv={},dC={},d$={},dw={},dk={},dE={},dx={},dD={},dS={},dz={},dB={},dM={},dT={},dO={},dN={},dP={},dI={},dF={},dR={},dH={},dL={},dj={},dq={},dG={};function dV(e,n){let{onScroll:t,isDisabled:r}=e,a=(0,g.useCallback)(e=>{!e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),t&&t({deltaX:e.deltaX,deltaY:e.deltaY}))},[t]);ai(n,"wheel",r?void 0:a)}function dU(e,n){var t;let{inputElementType:r="input",isDisabled:a=!1,isRequired:o=!1,isReadOnly:i=!1,type:s="text",validationBehavior:l="aria"}=e,[c,u]=aD(e.value,e.defaultValue||"",e.onChange),{focusableProps:d}=tj(e,n),p=iZ({...e,value:c}),{isInvalid:f,validationErrors:h,validationDetails:m}=p.displayValidation,{labelProps:A,fieldProps:y,descriptionProps:b,errorMessageProps:v}=o6({...e,isInvalid:f,errorMessage:e.errorMessage||h}),C=e9(e,{labelable:!0}),$={type:s,pattern:e.pattern},[w]=(0,g.useState)(c);return o4(n,null!=(t=e.defaultValue)?t:w,u),o8(e,p,n),(0,g.useEffect)(()=>{if(n.current instanceof nn(n.current).HTMLTextAreaElement){let e=n.current;Object.defineProperty(e,"defaultValue",{get:()=>e.value,set:()=>{},configurable:!0})}},[n]),{labelProps:A,inputProps:eq(C,"input"===r?$:void 0,{disabled:a,readOnly:i,required:o&&"native"===l,"aria-required":o&&"aria"===l||void 0,"aria-invalid":f||void 0,"aria-errormessage":e["aria-errormessage"],"aria-activedescendant":e["aria-activedescendant"],"aria-autocomplete":e["aria-autocomplete"],"aria-haspopup":e["aria-haspopup"],"aria-controls":e["aria-controls"],value:c,onChange:e=>u(e.target.value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,form:e.form,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(g.version,10)>=17?"enterKeyHint":"enterkeyhint"]:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...d,...y}),descriptionProps:b,errorMessageProps:v,isInvalid:f,validationErrors:h,validationDetails:m}}function dW(){return"undefined"!=typeof window&&window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges}function dK(e,n,t){let r=eO(e=>{let r=t.current;if(!r)return;let a=null;switch(e.inputType){case"historyUndo":case"historyRedo":case"insertLineBreak":return;case"deleteContent":case"deleteByCut":case"deleteByDrag":a=r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteContentForward":a=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd+1):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteContentBackward":a=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart-1)+r.value.slice(r.selectionStart):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":a=r.value.slice(r.selectionStart);break;default:null!=e.data&&(a=r.value.slice(0,r.selectionStart)+e.data+r.value.slice(r.selectionEnd))}null!=a&&n.validate(a)||e.preventDefault()});(0,g.useEffect)(()=>{if(!dW()||!t.current)return;let e=t.current;return e.addEventListener("beforeinput",r,!1),()=>{e.removeEventListener("beforeinput",r,!1)}},[t,r]);let a=dW()?null:e=>{let t=e.target.value.slice(0,e.target.selectionStart)+e.data+e.target.value.slice(e.target.selectionEnd);n.validate(t)||e.preventDefault()},{labelProps:o,inputProps:i,descriptionProps:s,errorMessageProps:l,...c}=dU(e,t),u=(0,g.useRef)(null);return{inputProps:eq(i,{onBeforeInput:a,onCompositionStart(){let{value:e,selectionStart:n,selectionEnd:r}=t.current;u.current={value:e,selectionStart:n,selectionEnd:r}},onCompositionEnd(){if(t.current&&!n.validate(t.current.value)){let{value:e,selectionStart:r,selectionEnd:a}=u.current;t.current.value=e,t.current.setSelectionRange(r,a),n.setInputValue(e)}}}),labelProps:o,descriptionProps:s,errorMessageProps:l,...c}}dG={"ar-AE":du={decrease:e=>`\u{62E}\u{641}\u{636} ${e.fieldLabel}`,increase:e=>`\u{632}\u{64A}\u{627}\u{62F}\u{629} ${e.fieldLabel}`,numberField:`\u{62D}\u{642}\u{644} \u{631}\u{642}\u{645}\u{64A}`},"bg-BG":dd={decrease:e=>`\u{41D}\u{430}\u{43C}\u{430}\u{43B}\u{44F}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{441}\u{438}\u{43B}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,numberField:`\u{41D}\u{43E}\u{43C}\u{435}\u{440} \u{43D}\u{430} \u{43F}\u{43E}\u{43B}\u{435}\u{442}\u{43E}`},"cs-CZ":dp={decrease:e=>`Sn\xed\u{17E}it ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}it ${e.fieldLabel}`,numberField:`\u{10C}\xedseln\xe9 pole`},"da-DK":df={decrease:e=>`Reducer ${e.fieldLabel}`,increase:e=>`\xd8g ${e.fieldLabel}`,numberField:"Talfelt"},"de-DE":d_={decrease:e=>`${e.fieldLabel} verringern`,increase:e=>`${e.fieldLabel} erh\xf6hen`,numberField:"Nummernfeld"},"el-GR":dh={decrease:e=>`\u{39C}\u{3B5}\u{3AF}\u{3C9}\u{3C3}\u{3B7} ${e.fieldLabel}`,increase:e=>`\u{391}\u{3CD}\u{3BE}\u{3B7}\u{3C3}\u{3B7} ${e.fieldLabel}`,numberField:`\u{3A0}\u{3B5}\u{3B4}\u{3AF}\u{3BF} \u{3B1}\u{3C1}\u{3B9}\u{3B8}\u{3BC}\u{3BF}\u{3CD}`},"en-US":dm={decrease:e=>`Decrease ${e.fieldLabel}`,increase:e=>`Increase ${e.fieldLabel}`,numberField:"Number field"},"es-ES":dg={decrease:e=>`Reducir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo de n\xfamero`},"et-EE":dA={decrease:e=>`V\xe4henda ${e.fieldLabel}`,increase:e=>`Suurenda ${e.fieldLabel}`,numberField:`Numbri v\xe4li`},"fi-FI":dy={decrease:e=>`V\xe4henn\xe4 ${e.fieldLabel}`,increase:e=>`Lis\xe4\xe4 ${e.fieldLabel}`,numberField:`Numerokentt\xe4`},"fr-FR":db={decrease:e=>`Diminuer ${e.fieldLabel}`,increase:e=>`Augmenter ${e.fieldLabel}`,numberField:"Champ de nombre"},"he-IL":dv={decrease:e=>`\u{5D4}\u{5E7}\u{5D8}\u{5DF} ${e.fieldLabel}`,increase:e=>`\u{5D4}\u{5D2}\u{5D3}\u{5DC} ${e.fieldLabel}`,numberField:`\u{5E9}\u{5D3}\u{5D4} \u{5DE}\u{5E1}\u{5E4}\u{5E8}`},"hr-HR":dC={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"hu-HU":d$={decrease:e=>`${e.fieldLabel} cs\xf6kkent\xe9se`,increase:e=>`${e.fieldLabel} n\xf6vel\xe9se`,numberField:`Sz\xe1mmez\u{151}`},"it-IT":dw={decrease:e=>`Riduci ${e.fieldLabel}`,increase:e=>`Aumenta ${e.fieldLabel}`,numberField:"Campo numero"},"ja-JP":dk={decrease:e=>`${e.fieldLabel}\u{3092}\u{7E2E}\u{5C0F}`,increase:e=>`${e.fieldLabel}\u{3092}\u{62E1}\u{5927}`,numberField:`\u{6570}\u{5024}\u{30D5}\u{30A3}\u{30FC}\u{30EB}\u{30C9}`},"ko-KR":dE={decrease:e=>`${e.fieldLabel} \u{AC10}\u{C18C}`,increase:e=>`${e.fieldLabel} \u{C99D}\u{AC00}`,numberField:`\u{BC88}\u{D638} \u{D544}\u{B4DC}`},"lt-LT":dx={decrease:e=>`Suma\u{17E}inti ${e.fieldLabel}`,increase:e=>`Padidinti ${e.fieldLabel}`,numberField:"Numerio laukas"},"lv-LV":dD={decrease:e=>`Samazin\u{101}\u{161}ana ${e.fieldLabel}`,increase:e=>`Palielin\u{101}\u{161}ana ${e.fieldLabel}`,numberField:`Skait\u{13C}u lauks`},"nb-NO":dS={decrease:e=>`Reduser ${e.fieldLabel}`,increase:e=>`\xd8k ${e.fieldLabel}`,numberField:"Tallfelt"},"nl-NL":dz={decrease:e=>`${e.fieldLabel} verlagen`,increase:e=>`${e.fieldLabel} verhogen`,numberField:"Getalveld"},"pl-PL":dB={decrease:e=>`Zmniejsz ${e.fieldLabel}`,increase:e=>`Zwi\u{119}ksz ${e.fieldLabel}`,numberField:"Pole numeru"},"pt-BR":dM={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo de n\xfamero`},"pt-PT":dT={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo num\xe9rico`},"ro-RO":dO={decrease:e=>`Sc\u{103}dere ${e.fieldLabel}`,increase:e=>`Cre\u{219}tere ${e.fieldLabel}`,numberField:`C\xe2mp numeric`},"ru-RU":dN={decrease:e=>`\u{423}\u{43C}\u{435}\u{43D}\u{44C}\u{448}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{432}\u{435}\u{43B}\u{438}\u{447}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,numberField:`\u{427}\u{438}\u{441}\u{43B}\u{43E}\u{432}\u{43E}\u{435} \u{43F}\u{43E}\u{43B}\u{435}`},"sk-SK":dP={decrease:e=>`Zn\xed\u{17E}i\u{165} ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}i\u{165} ${e.fieldLabel}`,numberField:`\u{10C}\xedseln\xe9 pole`},"sl-SI":dI={decrease:e=>`Upadati ${e.fieldLabel}`,increase:e=>`Pove\u{10D}ajte ${e.fieldLabel}`,numberField:`\u{160}tevil\u{10D}no polje`},"sr-SP":dF={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"sv-SE":dR={decrease:e=>`Minska ${e.fieldLabel}`,increase:e=>`\xd6ka ${e.fieldLabel}`,numberField:`Nummerf\xe4lt`},"tr-TR":dH={decrease:e=>`${e.fieldLabel} azalt`,increase:e=>`${e.fieldLabel} artt\u{131}r`,numberField:`Say\u{131} alan\u{131}`},"uk-UA":dL={decrease:e=>`\u{417}\u{43C}\u{435}\u{43D}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,increase:e=>`\u{417}\u{431}\u{456}\u{43B}\u{44C}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,numberField:`\u{41F}\u{43E}\u{43B}\u{435} \u{43D}\u{43E}\u{43C}\u{435}\u{440}\u{430}`},"zh-CN":dj={decrease:e=>`\u{964D}\u{4F4E} ${e.fieldLabel}`,increase:e=>`\u{63D0}\u{9AD8} ${e.fieldLabel}`,numberField:`\u{6570}\u{5B57}\u{5B57}\u{6BB5}`},"zh-TW":dq={decrease:e=>`\u{7E2E}\u{5C0F} ${e.fieldLabel}`,increase:e=>`\u{653E}\u{5927} ${e.fieldLabel}`,numberField:`\u{6578}\u{5B57}\u{6B04}\u{4F4D}`}};var dZ=t(93092);function dY(e={}){let{locale:n}=ex();return(0,g.useMemo)(()=>new(0,dZ.K)(n,e),[n,e])}var dJ={},dX={},dQ={},d0={},d1={},d2={},d3={},d4={},d5={},d6={},d8={},d7={},d9={},pe={},pn={},pt={},pr={},pa={},po={},pi={},ps={},pl={},pc={},pu={},pd={},pp={},pf={},p_={},ph={},pm={},pg={},pA={},py={},pb={},pv={};function pC(e){return e&&e.__esModule?e.default:e}function p$(e){let n=(0,g.useRef)(void 0),{value:t,textValue:r,minValue:a,maxValue:o,isDisabled:i,isReadOnly:s,isRequired:l,onIncrement:c,onIncrementPage:u,onDecrement:d,onDecrementPage:p,onDecrementToMin:f,onIncrementToMax:h}=e,m=rq(pC(pv),"@react-aria/spinbutton"),A=()=>clearTimeout(n.current);(0,g.useEffect)(()=>()=>A(),[]);let y=e=>{if(!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&!s&&!e.nativeEvent.isComposing)switch(e.key){case"PageUp":if(u){e.preventDefault(),null==u||u();break}case"ArrowUp":case"Up":c&&(e.preventDefault(),null==c||c());break;case"PageDown":if(p){e.preventDefault(),null==p||p();break}case"ArrowDown":case"Down":d&&(e.preventDefault(),null==d||d());break;case"Home":f&&(e.preventDefault(),null==f||f());break;case"End":h&&(e.preventDefault(),null==h||h())}},b=(0,g.useRef)(!1),v=()=>{b.current=!0},C=()=>{b.current=!1},$=""===r?m.format("Empty"):(r||`${t}`).replace("-","−");(0,g.useEffect)(()=>{b.current&&(e1("assertive"),e0($,"assertive"))},[$]);let w=eO(e=>{A(),null==c||c(),n.current=window.setTimeout(()=>{(void 0===o||isNaN(o)||void 0===t||isNaN(t)||t<o)&&w(60)},e)}),k=eO(e=>{A(),null==d||d(),n.current=window.setTimeout(()=>{(void 0===a||isNaN(a)||void 0===t||isNaN(t)||t>a)&&k(60)},e)}),E=e=>{e.preventDefault()},{addGlobalListener:x,removeAllGlobalListeners:D}=nQ();return{spinButtonProps:{role:"spinbutton","aria-valuenow":void 0===t||isNaN(t)?void 0:t,"aria-valuetext":$,"aria-valuemin":a,"aria-valuemax":o,"aria-disabled":i||void 0,"aria-readonly":s||void 0,"aria-required":l||void 0,onKeyDown:y,onFocus:v,onBlur:C},incrementButtonProps:{onPressStart:()=>{w(400),x(window,"contextmenu",E)},onPressEnd:()=>{A(),D()},onFocus:v,onBlur:C},decrementButtonProps:{onPressStart:()=>{k(400),x(window,"contextmenu",E)},onPressEnd:()=>{A(),D()},onFocus:v,onBlur:C}}}function pw(e){return e&&e.__esModule?e.default:e}function pk(e,n,t){var r;let a,{id:o,decrementAriaLabel:i,incrementAriaLabel:s,isDisabled:l,isReadOnly:c,isRequired:u,minValue:d,maxValue:p,autoFocus:f,label:h,formatOptions:m,onBlur:A=()=>{},onFocus:y,onFocusChange:b,onKeyDown:v,onKeyUp:C,description:$,errorMessage:w,isWheelDisabled:k,...E}=e,{increment:x,incrementToMax:D,decrement:S,decrementToMin:z,numberValue:B,inputValue:M,commit:T,commitValidation:O}=n,N=rq(pw(dG),"@react-aria/numberfield"),P=eF(o),{focusProps:I}=tI({onBlur(){T()}}),F=dY(m),R=(0,g.useMemo)(()=>F.resolvedOptions(),[F]),H=dY({...m,currencySign:void 0}),L=(0,g.useMemo)(()=>isNaN(B)?"":H.format(B),[H,B]),{spinButtonProps:j,incrementButtonProps:q,decrementButtonProps:G}=p$({isDisabled:l,isReadOnly:c,isRequired:u,maxValue:p,minValue:d,onIncrement:x,onIncrementToMax:D,onDecrement:S,onDecrementToMin:z,value:B,textValue:L}),[V,U]=(0,g.useState)(!1),{focusWithinProps:W}=tG({isDisabled:l,onFocusWithinChange:U});dV({onScroll:(0,g.useCallback)(e=>{!(Math.abs(e.deltaY)<=Math.abs(e.deltaX))&&(e.deltaY>0?x():e.deltaY<0&&S())},[S,x]),isDisabled:k||l||c||!V},t);let K=(null!=(r=R.maximumFractionDigits)?r:0)>0,Z=void 0===n.minValue||isNaN(n.minValue)||n.minValue<0,Y="numeric";nD()?Z?Y="text":K&&(Y="decimal"):nT()&&(Z?Y="numeric":K&&(Y="decimal"));let J=e=>{n.validate(e)&&n.setInputValue(e)},X=e9(e),Q=(0,g.useCallback)(e=>{e.nativeEvent.isComposing||("Enter"===e.key?(T(),O()):e.continuePropagation())},[T,O]),{isInvalid:ee,validationErrors:en,validationDetails:et}=n.displayValidation,{labelProps:er,inputProps:ea,descriptionProps:eo,errorMessageProps:ei}=dK({...E,...X,name:void 0,form:void 0,label:h,autoFocus:f,isDisabled:l,isReadOnly:c,isRequired:u,validate:void 0,[iK]:n,value:M,defaultValue:"!",autoComplete:"off","aria-label":e["aria-label"]||void 0,"aria-labelledby":e["aria-labelledby"]||void 0,id:P,type:"text",inputMode:Y,onChange:J,onBlur:A,onFocus:y,onFocusChange:b,onKeyDown:(0,g.useMemo)(()=>eB(Q,v),[Q,v]),onKeyUp:C,description:$,errorMessage:w},n,t);o4(t,n.defaultNumberValue,n.setNumberValue);let es=eq(j,I,ea,{role:null,"aria-roledescription":nz()?null:N.format("numberField"),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false"});"native"===e.validationBehavior&&(es["aria-required"]=void 0);let el=e=>{var n;document.activeElement!==t.current&&("mouse"===e.pointerType?null==(n=t.current)||n.focus():e.target.focus())},ec=e["aria-label"]||("string"==typeof e.label?e.label:"");ec||(a=null!=e.label?er.id:e["aria-labelledby"]);let eu=eF(),ed=eF(),ep=eq(q,{"aria-label":s||N.format("increase",{fieldLabel:ec}).trim(),id:a&&!s?eu:null,"aria-labelledby":a&&!s?`${eu} ${a}`:null,"aria-controls":P,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!n.canIncrement,onPressStart:el}),ef=eq(G,{"aria-label":i||N.format("decrease",{fieldLabel:ec}).trim(),id:a&&!i?ed:null,"aria-labelledby":a&&!i?`${ed} ${a}`:null,"aria-controls":P,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!n.canDecrement,onPressStart:el});return{groupProps:{...W,role:"group","aria-disabled":l,"aria-invalid":ee?"true":void 0},labelProps:er,inputProps:es,incrementButtonProps:ep,decrementButtonProps:ef,errorMessageProps:ei,descriptionProps:eo,isInvalid:ee,validationErrors:en,validationDetails:et}}pv={"ar-AE":dJ={Empty:`\u{641}\u{627}\u{631}\u{63A}`},"bg-BG":dX={Empty:`\u{418}\u{437}\u{43F}\u{440}\u{430}\u{437}\u{43D}\u{438}`},"cs-CZ":dQ={Empty:`Pr\xe1zdn\xe9`},"da-DK":d0={Empty:"Tom"},"de-DE":d1={Empty:"Leer"},"el-GR":d2={Empty:`\u{386}\u{3B4}\u{3B5}\u{3B9}\u{3BF}`},"en-US":d3={Empty:"Empty"},"es-ES":d4={Empty:`Vac\xedo`},"et-EE":d5={Empty:`T\xfchjenda`},"fi-FI":d6={Empty:`Tyhj\xe4`},"fr-FR":d8={Empty:"Vide"},"he-IL":d7={Empty:`\u{5E8}\u{5D9}\u{5E7}`},"hr-HR":d9={Empty:"Prazno"},"hu-HU":pe={Empty:`\xdcres`},"it-IT":pn={Empty:"Vuoto"},"ja-JP":pt={Empty:`\u{7A7A}`},"ko-KR":pr={Empty:`\u{BE44}\u{C5B4} \u{C788}\u{C74C}`},"lt-LT":pa={Empty:`Tu\u{161}\u{10D}ias`},"lv-LV":po={Empty:`Tuk\u{161}s`},"nb-NO":pi={Empty:"Tom"},"nl-NL":ps={Empty:"Leeg"},"pl-PL":pl={Empty:"Pusty"},"pt-BR":pc={Empty:"Vazio"},"pt-PT":pu={Empty:"Vazio"},"ro-RO":pd={Empty:"Gol"},"ru-RU":pp={Empty:`\u{41D}\u{435} \u{437}\u{430}\u{43F}\u{43E}\u{43B}\u{43D}\u{435}\u{43D}\u{43E}`},"sk-SK":pf={Empty:`Pr\xe1zdne`},"sl-SI":p_={Empty:"Prazen"},"sr-SP":ph={Empty:"Prazno"},"sv-SE":pm={Empty:"Tomt"},"tr-TR":pg={Empty:`Bo\u{15F}`},"uk-UA":pA={Empty:`\u{41F}\u{443}\u{441}\u{442}\u{43E}`},"zh-CN":py={Empty:`\u{7A7A}`},"zh-TW":pb={Empty:`\u{7A7A}\u{767D}`}};var pE=t(95899);function px(e){let{minValue:n,maxValue:t,step:r,formatOptions:a,value:o,defaultValue:i=NaN,onChange:s,locale:l,isDisabled:c,isReadOnly:u}=e;null===o&&(o=NaN),void 0===o||isNaN(o)||(o=void 0===r||isNaN(r)?sU(o,n,t):sK(o,n,t,r)),isNaN(i)||(i=void 0===r||isNaN(r)?sU(i,n,t):sK(i,n,t,r));let[d,p]=aD(o,isNaN(i)?NaN:i,s),[f]=(0,g.useState)(d),[h,m]=(0,g.useState)(()=>isNaN(d)?"":new(0,dZ.K)(l,a).format(d)),A=(0,g.useMemo)(()=>new(0,pE.d)(l,a),[l,a]),y=(0,g.useMemo)(()=>A.getNumberingSystem(h),[A,h]),b=(0,g.useMemo)(()=>new(0,dZ.K)(l,{...a,numberingSystem:y}),[l,a,y]),v=(0,g.useMemo)(()=>b.resolvedOptions(),[b]),C=(0,g.useCallback)(e=>isNaN(e)||null===e?"":b.format(e),[b]),$=iZ({...e,value:d}),w=void 0===r||isNaN(r)?1:r;"percent"===v.style&&(void 0===r||isNaN(r))&&(w=.01);let[k,E]=(0,g.useState)(d),[x,D]=(0,g.useState)(l),[S,z]=(0,g.useState)(a);Object.is(d,k)&&l===x&&a===S||(m(C(d)),E(d),D(l),z(a));let B=(0,g.useMemo)(()=>A.parse(h),[A,h]),M=()=>{let e;if(!h.length){p(NaN),m(void 0===o?"":C(d));return}isNaN(B)?m(C(d)):(e=void 0===r||isNaN(r)?sU(B,n,t):sK(B,n,t,r),p(e=A.parse(C(e))),m(C(void 0===o?e:d)),$.commitValidation())},T=(e,r=0)=>{let a=B;if(isNaN(a))return sK(isNaN(r)?0:r,n,t,w);{let r=sK(a,n,t,w);return"+"===e&&r>a||"-"===e&&r<a?r:sK(pD(e,a,w),n,t,w)}},O=()=>{let e=T("+",n);e===d&&m(C(e)),p(e),$.commitValidation()},N=()=>{let e=T("-",t);e===d&&m(C(e)),p(e),$.commitValidation()},P=()=>{null!=t&&(p(sK(t,n,t,w)),$.commitValidation())},I=()=>{null!=n&&(p(n),$.commitValidation())},F=(0,g.useMemo)(()=>!c&&!u&&(isNaN(B)||void 0===t||isNaN(t)||sK(B,n,t,w)>B||pD("+",B,w)<=t),[c,u,n,t,w,B]),R=(0,g.useMemo)(()=>!c&&!u&&(isNaN(B)||void 0===n||isNaN(n)||sK(B,n,t,w)<B||pD("-",B,w)>=n),[c,u,n,t,w,B]),H=e=>A.isValidPartialNumber(e,n,t);return{...$,validate:H,increment:O,incrementToMax:P,decrement:N,decrementToMin:I,canIncrement:F,canDecrement:R,minValue:n,maxValue:t,numberValue:B,defaultNumberValue:isNaN(i)?f:i,setNumberValue:p,setInputValue:m,inputValue:h,commit:M}}function pD(e,n,t){let r="+"===e?n+t:n-t;if(n%1!=0||t%1!=0){let a=n.toString().split("."),o=t.toString().split("."),i=Math.pow(10,Math.max(a[1]&&a[1].length||0,o[1]&&o[1].length||0));n=Math.round(n*i),t=Math.round(t*i),r=("+"===e?n+t:n-t)/i}return r}let pS=(0,g.createContext)(null),pz=(0,g.createContext)(null),pB=(0,g.forwardRef)(function(e,n){var t,r;[e,n]=eK(e,n,pS);let{validationBehavior:a}=eW(sM)||{},o=null!=(r=null!=(t=e.validationBehavior)?t:a)?r:"native",{locale:i}=ex(),s=px({...e,locale:i,validationBehavior:o}),l=(0,g.useRef)(null),[c,u]=eZ(!e["aria-label"]&&!e["aria-labelledby"]),{labelProps:d,groupProps:p,inputProps:f,incrementButtonProps:h,decrementButtonProps:m,descriptionProps:A,errorMessageProps:y,...b}=pk({...eY(e),label:u,validationBehavior:o},s,l),v=eU({...e,values:{state:s,isDisabled:e.isDisabled||!1,isInvalid:b.isInvalid||!1,isRequired:e.isRequired||!1},defaultClassName:"react-aria-NumberField"}),C=e9(e,{global:!0});return delete C.id,g.createElement(eV,{values:[[pz,s],[aY,p],[aX,{...f,ref:l}],[sF,{...d,ref:c}],[t1,{slots:{increment:h,decrement:m}}],[t5,{slots:{description:A,errorMessage:y}}],[sS,b]]},g.createElement("div",{...C,...v,ref:n,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-required":e.isRequired||void 0,"data-invalid":b.isInvalid||void 0}),e.name&&g.createElement("input",{type:"hidden",name:e.name,form:e.form,value:isNaN(s.numberValue)?"":s.numberValue,disabled:e.isDisabled||void 0}))});function pM(e,n){return parseInt((0,cx.Yq)(e,{calendar:n.calendar,locale:n.baseName,day:!1,month:!1,noToday:!0,numberingSystem:"latn"}))}var pT=(0,g.forwardRef)(function(e,n){var t=e.className,r=(0,g.useContext)(aI),a=(0,g.useContext)(aF),o=null!=r?r:a,i=dc(),s=(0,en.Xj)(),l=(0,cx.Yq)(o.visibleRange.start.toDate(s),{calendar:i.calendar,locale:i.baseName,day:!1,year:!1,noToday:!0}),c=pM(o.visibleRange.start.toDate(s),i),u=o.maxValue?pM(o.maxValue.toDate(s),i):void 0,d=o.minValue?pM(o.minValue.toDate(s),i):void 0,p=(0,g.useCallback)(function(e){o.setFocusedDate(o.focusedDate.cycle("year",e-o.focusedDate.year))},[]);return o&&A().createElement("span",{ref:n,className:t},A().createElement("span",null,l),A().createElement(pB,{formatOptions:{useGrouping:!1},maxValue:u,minValue:d,onChange:p,value:c},A().createElement(a0,null),A().createElement(aJ,null,A().createElement(t2,{slot:"increment"},A().createElement(cU,{size:8})),A().createElement(t2,{slot:"decrement"},A().createElement(cq,{size:8})))))});function pO(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function pN(e){if(Array.isArray(e))return e}function pP(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function pI(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function pF(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pR(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){pP(e,n,t[n])})}return e}function pH(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function pL(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function pj(e,n){return pN(e)||pI(e,n)||pq(e,n)||pF()}function pq(e,n){if(e){if("string"==typeof e)return pO(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return pO(e,n)}}var pG=(0,g.forwardRef)(function(e,n){var t=(0,g.useContext)(cv),r=pj(eK({slot:e.slot},n,sf),2),a=r[0],o=r[1],i=ex().locale,s=sl(pL(pR({},a),{locale:i,createCalendar:Q.d})),l=(0,g.useRef)(null),c=ii(pL(pR({},a),{inputRef:l}),s,o),u=c.fieldProps,d=c.inputProps,p=(0,g.useCallback)(function(){s.isDisabled||t.toggle()},[]);return A().createElement(eV,{values:[[s_,s],[aX,pL(pR({},d),{ref:l})],[aY,pL(pR({},u),{ref:o,isInvalid:s.isInvalid})]]},A().createElement(aJ,pL(pR({},e),{id:e.id,ref:n,slot:e.slot||void 0,className:e.className,isDisabled:s.isDisabled,isInvalid:s.isInvalid,onClick:p}),s.segments.map(function(n,t){return(0,g.cloneElement)(e.children(n),{key:t})})),A().createElement(a0,null))});function pV(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function pU(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){pV(e,n,t[n])})}return e}var pW=(0,g.forwardRef)(function(e,n){return(0,g.useContext)(cv).isInvalid?A().createElement(u4,pU({ref:n,size:16},e)):A().createElement(cj,pU({ref:n,size:16},e))});function pK(e){return e&&e.__esModule?e.default:e}function pZ(){let{locale:e}=ex(),n=rj(pK(ok),"@react-aria/datepicker");return(0,g.useMemo)(()=>{try{return new Intl.DisplayNames(e,{type:"dateTimeField"})}catch{return new pY(e,n)}},[e,n])}class pY{of(e){return this.dictionary.getStringForLocale(e,this.locale)}constructor(e,n){this.locale=e,this.dictionary=n}}let pJ=new Map;function pX(e){let{locale:n}=ex(),t=n+(e?Object.entries(e).sort((e,n)=>e[0]<n[0]?-1:1).join():"");if(pJ.has(t))return pJ.get(t);let r=new Intl.Collator(n,e);return pJ.set(t,r),r}function pQ(e){let n=pX({usage:"search",...e}),t=(0,g.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===n.compare(e.slice(0,t.length),t)),[n]),r=(0,g.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===n.compare(e.slice(-t.length),t)),[n]),a=(0,g.useCallback)((e,t)=>{if(0===t.length)return!0;e=e.normalize("NFC");let r=0,a=(t=t.normalize("NFC")).length;for(;r+a<=e.length;r++){let o=e.slice(r,r+a);if(0===n.compare(t,o))return!0}return!1},[n]);return(0,g.useMemo)(()=>({startsWith:t,endsWith:r,contains:a}),[t,r,a])}function p0(e,n,t){let r=(0,g.useRef)(""),{locale:a,direction:o}=ex(),i=pZ(),{ariaLabel:s,ariaLabelledBy:l,ariaDescribedBy:c,focusManager:u}=ir.get(n),d=e.isPlaceholder?"":e.text,p=(0,g.useMemo)(()=>n.dateFormatter.resolvedOptions(),[n.dateFormatter]),f=r0({month:"long",timeZone:p.timeZone}),h=r0({hour:"numeric",hour12:p.hour12,timeZone:p.timeZone});if("month"!==e.type||e.isPlaceholder)"hour"!==e.type||e.isPlaceholder||(d=h.format(n.dateValue));else{let e=f.format(n.dateValue);d=e!==d?`${d} \u{2013} ${e}`:e}let{spinButtonProps:m}=p$({value:e.value,textValue:d,minValue:e.minValue,maxValue:e.maxValue,isDisabled:n.isDisabled,isReadOnly:n.isReadOnly||!e.isEditable,isRequired:n.isRequired,onIncrement:()=>{r.current="",n.increment(e.type)},onDecrement:()=>{r.current="",n.decrement(e.type)},onIncrementPage:()=>{r.current="",n.incrementPage(e.type)},onDecrementPage:()=>{r.current="",n.decrementPage(e.type)},onIncrementToMax:()=>{r.current="",void 0!==e.maxValue&&n.setSegment(e.type,e.maxValue)},onDecrementToMin:()=>{r.current="",void 0!==e.minValue&&n.setSegment(e.type,e.minValue)}}),A=(0,g.useMemo)(()=>new(0,pE.d)(a,{maximumFractionDigits:0}),[a]),y=()=>{if(e.text===e.placeholder&&u.focusPrevious(),!A.isValidPartialNumber(e.text)||n.isReadOnly||e.isPlaceholder)"dayPeriod"===e.type&&n.clearSegment(e.type);else{let t=e.text.slice(0,-1),a=A.parse(t);0===(t=0===a?"":t).length||0===a?n.clearSegment(e.type):n.setSegment(e.type,a),r.current=t}},b=e=>{if("a"===e.key&&(nx()?e.metaKey:e.ctrlKey)&&e.preventDefault(),!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey)switch(e.key){case"Backspace":case"Delete":e.preventDefault(),e.stopPropagation(),y()}},{startsWith:v}=pQ({sensitivity:"base"}),C=r0({hour:"numeric",hour12:!0}),$=(0,g.useMemo)(()=>{let e=new Date;return e.setHours(0),C.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[C]),w=(0,g.useMemo)(()=>{let e=new Date;return e.setHours(12),C.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[C]),k=r0({year:"numeric",era:"narrow",timeZone:"UTC"}),E=(0,g.useMemo)(()=>{if("era"!==e.type)return[];let t=(0,ee.yP)(new(0,iq.ng)(1,1,1),n.calendar),r=n.calendar.getEras().map(e=>{let n=t.set({year:1,month:1,day:1,era:e}).toDate("UTC");return{era:e,formatted:k.formatToParts(n).find(e=>"era"===e.type).value}}),a=p1(r.map(e=>e.formatted));if(a)for(let e of r)e.formatted=e.formatted.slice(a);return r},[k,n.calendar,e.type]),x=t=>{if(n.isDisabled||n.isReadOnly)return;let a=r.current+t;switch(e.type){case"dayPeriod":if(v($,t))n.setSegment("dayPeriod",0);else if(v(w,t))n.setSegment("dayPeriod",12);else break;u.focusNext();break;case"era":{let e=E.find(e=>v(e.formatted,t));e&&(n.setSegment("era",e.era),u.focusNext());break}case"day":case"hour":case"minute":case"second":case"month":case"year":{if(!A.isValidPartialNumber(a))return;let o=A.parse(a),i=o,s=0===e.minValue;if("hour"===e.type&&n.dateFormatter.resolvedOptions().hour12){switch(n.dateFormatter.resolvedOptions().hourCycle){case"h11":o>11&&(i=A.parse(t));break;case"h12":s=!1,o>12&&(i=A.parse(t))}void 0!==e.value&&e.value>=12&&o>1&&(o+=12)}else void 0!==e.maxValue&&o>e.maxValue&&(i=A.parse(t));if(isNaN(o))return;let l=0!==i||s;l&&n.setSegment(e.type,i),void 0!==e.maxValue&&(Number(o+"0")>e.maxValue||a.length>=String(e.maxValue).length)?(r.current="",l&&u.focusNext()):r.current=a}}},D=()=>{r.current="",t.current&&am(t.current,{containingElement:ag(t.current)});let e=window.getSelection();null==e||e.collapse(t.current)};ai((0,g.useRef)("undefined"!=typeof document?document:null),"selectionchange",()=>{var e;let n=window.getSelection();(null==n?void 0:n.anchorNode)&&(null==(e=t.current)?void 0:e.contains(null==n?void 0:n.anchorNode))&&n.collapse(t.current)});let S=(0,g.useRef)("");ai(t,"beforeinput",r=>{if(t.current)switch(r.preventDefault(),r.inputType){case"deleteContentBackward":case"deleteContentForward":A.isValidPartialNumber(e.text)&&!n.isReadOnly&&y();break;case"insertCompositionText":S.current=t.current.textContent,t.current.textContent=t.current.textContent;break;default:null!=r.data&&x(r.data)}}),ai(t,"input",e=>{let{inputType:n,data:r}=e;"insertCompositionText"===n&&(t.current&&(t.current.textContent=S.current),null!=r&&(v($,r)||v(w,r))&&x(r))}),eM(()=>{let e=t.current;return()=>{document.activeElement===e&&(u.focusPrevious()||u.focusNext())}},[t,u]);let z=nz()||"timeZoneName"===e.type?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{};e===(0,g.useMemo)(()=>n.segments.find(e=>e.isEditable),[n.segments])||n.isInvalid||(c=void 0);let B=eF(),M=!n.isDisabled&&!n.isReadOnly&&e.isEditable,T="literal"===e.type?"":i.of(e.type),O=r9({"aria-label":`${T}${s?`, ${s}`:""}${l?", ":""}`,"aria-labelledby":l});if("literal"===e.type)return{segmentProps:{"aria-hidden":!0}};let N={caretColor:"transparent"};if("rtl"===o){N.unicodeBidi="embed";let n=p[e.type];("numeric"===n||"2-digit"===n)&&(N.direction="ltr")}return{segmentProps:eq(m,O,{id:B,...z,"aria-invalid":n.isInvalid?"true":void 0,"aria-describedby":c,"aria-readonly":n.isReadOnly||!e.isEditable?"true":void 0,"data-placeholder":e.isPlaceholder||void 0,contentEditable:M,suppressContentEditableWarning:M,spellCheck:M?"false":void 0,autoCorrect:M?"off":void 0,[parseInt(g.version,10)>=17?"enterKeyHint":"enterkeyhint"]:M?"next":void 0,inputMode:n.isDisabled||"dayPeriod"===e.type||"era"===e.type||!M?void 0:"numeric",tabIndex:n.isDisabled?void 0:0,onKeyDown:b,onFocus:D,style:N,onPointerDown(e){e.stopPropagation()},onMouseDown(e){e.stopPropagation()}})}}function p1(e){e.sort();let n=e[0],t=e[e.length-1];for(let e=0;e<n.length;e++)if(n[e]!==t[e])return e;return 0}function p2(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function p3(e){if(Array.isArray(e))return e}function p4(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function p5(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function p6(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p8(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){p4(e,n,t[n])})}return e}function p7(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function p9(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p7(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function fe(e,n){if(e){if("string"==typeof e)return p2(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p2(e,n)}}function fn(e){var n=e.className,t=e.style,r=e.children,a=e.defaultClassName,o=void 0===a?void 0:a,i=e.defaultChildren,s=void 0===i?void 0:i,l=e.defaultStyle,c=e.values;return(0,g.useMemo)(function(){var e,a,i;return e="function"==typeof n?n(p9(p8({},c),{defaultClassName:o})):n,a="function"==typeof t?t(p9(p8({},c),{defaultStyle:l||{}})):t,i="function"==typeof r?r(p9(p8({},c),{defaultChildren:s})):null==r?s:r,{className:null!=e?e:o,style:a||l?p8({},l,a):void 0,children:null!=i?i:s,"data-rac":""}},[n,t,r,o,s,l,c])}function ft(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function fr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){ft(e,n,t[n])})}return e}function fa(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function fo(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fa(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function fi(e,n){if(null==e)return{};var t,r,a=fs(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function fs(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}var fl=(0,g.forwardRef)(function(e,n){var t=e.segment,r=fi(e,["segment"]),a=(0,g.useContext)(s_),o=eD(n),i=p0(t,a,o).segmentProps,s=tV(),l=s.focusProps,c=s.isFocused,u=s.isFocusVisible,d=tJ(fo(fr({},r),{isDisabled:a.isDisabled||"literal"===t.type})),p=d.hoverProps,f=d.isHovered,h=fn(fo(fr({},r),{values:fo(fr({},t),{isReadOnly:!t.isEditable,isInvalid:a.isInvalid,isDisabled:a.isDisabled,isHovered:f,isFocused:c,isFocusVisible:u}),defaultChildren:t.text})),m=(0,g.useCallback)(function(e){e.stopPropagation()},[]);return A().createElement("span",fo(fr({},eq(e9(r),i,l,p),h),{ref:o,style:i.style,"data-placeholder":t.isPlaceholder||void 0,"data-invalid":a.isInvalid||void 0,"data-readonly":!t.isEditable||void 0,"data-disabled":a.isDisabled||void 0,"data-type":t.type,"data-hovered":f||void 0,"data-focused":c||void 0,"data-focus-visible":u||void 0,onClick:m}))}),fc=t(31339),fu={};fu.styleTagTransform=T(),fu.setAttributes=S(),fu.insert=x().bind(null,"head"),fu.domAPI=k(),fu.insertStyleElement=B(),$()(fc.A,fu);let fd=fc.A&&fc.A.locals?fc.A.locals:void 0;function fp(e){var n=e.children,t=e.isRangePicker,r=void 0!==t&&t,a=(0,g.useContext)(cv),o=(0,g.useContext)(cC),i=r?o:a,s=(0,K.useOnClickOutside)(function(){return null==i?void 0:i.close()});return A().createElement(sD,{className:fd.dialog,ref:s},n)}function ff(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function f_(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){ff(e,n,t[n])})}return e}function fh(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function fm(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function fg(e,n){if(null==e)return{};var t,r,a=fA(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function fA(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}var fy={short:!1,size:"md"};function fb(e){return A().createElement(eE,e)}var fv=(0,g.forwardRef)(function(e,n){var t,r=Object.assign({},fy,e),a=r.className,o=r.defaultValue,i=r.isDisabled,s=r.invalid,l=r.invalidText,c=r.isInvalid,u=r.label,d=r.labelText,p=r.light,f=r.maxDate,h=r.minDate,m=r.onChange,y=r.onChangeRaw,C=r.short,$=r.size,w=r.value,k=fg(r,["className","defaultValue","isDisabled","invalid","invalidText","isInvalid","label","labelText","light","maxDate","minDate","onChange","onChangeRaw","short","size","value"]),E=(0,v.UK)({externalModuleName:"@openmrs/esm-styleguide"}).preferredDateLocale,x=(0,g.useId)(),D=!!(null!=d?d:u),S=(0,g.useMemo)(function(){var e=(0,cE.J)();return E[e]&&(e=E[e]),e},[window.i18next.language]),z=(0,g.useMemo)(function(){var e=(0,cx.a7)(S);return void 0!==e?(0,Q.d)(e):void 0},[S]),B=(0,g.useMemo)(function(){return new Intl.Locale(S,{calendar:null==z?void 0:z.identifier})},[S,z]),M=(0,g.useMemo)(function(){return di(o,z)},[o]),T=(0,g.useMemo)(function(){return di(w,z,!0)},[w]),O=(0,g.useMemo)(function(){return di(f,z)},[f]),N=(0,g.useMemo)(function(){return di(h,z)},[h]),P=(0,g.useMemo)(function(){return null!=s?s:c},[s,c]),I=z?(0,ee.yP)((0,en.Ec)((0,en.Xj)()),z):(0,en.Ec)((0,en.Xj)()),F=(0,g.useMemo)(function(){return y&&m&&console.error("An OpenmrsDatePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),y||function(e){return null==m?void 0:m(ds(e))}},[y,m]);return A().createElement(fb,{locale:B.toString()},A().createElement("div",{className:b()("cds--form-item",a)},A().createElement(eV,{values:[[dl,B]]},A().createElement(cw,fm(f_({className:b()("cds--date-picker","cds--date-picker--single",(ff(t={},"cds--date-picker--short",C),ff(t,"cds--date-picker--light",p),t)),defaultValue:M,isDisabled:i,isInvalid:P,maxValue:O,minValue:N,value:T,shouldForceLeadingZeros:"en"===B.language||void 0},k),{onChange:F}),A().createElement("div",{className:"cds--date-picker-container"},D&&A().createElement(sR,{className:b()("cds--label",{"cds--label--disabled":i}),htmlFor:x},null!=d?d:u),A().createElement(aJ,{className:fd.inputGroup},A().createElement(pG,{id:D?x:void 0,ref:n,className:b()("cds--date-picker-input__wrapper",fd.inputWrapper,ff({},fd.inputWrapperMd,"md"===$||!$||0===$.length))},function(e){return"era"!==e.type?A().createElement(fl,{className:fd.inputSegment,segment:e}):A().createElement(A().Fragment,null)}),A().createElement(t2,{className:b()(fd.flatButton,fd.flatButtonMd)},A().createElement(pW,null))),P&&l&&A().createElement(sz,{className:fd.invalidText},l)),A().createElement(cu,{className:fd.popover,placement:"bottom start",offset:1,isNonModal:!0},A().createElement(fp,null,A().createElement(aR,null,A().createElement("header",{className:fd.header},A().createElement(t2,{className:b()(fd.flatButton,fd.flatButtonMd),slot:"previous"},A().createElement(cX,{size:16})),A().createElement(pT,{className:fd.monthYear}),A().createElement(t2,{className:b()(fd.flatButton,fd.flatButtonMd),slot:"next"},A().createElement(cQ,{size:16}))),A().createElement(aj,{className:fd.calendarGrid},function(e){return A().createElement(aZ,{key:e.toString(),className:b()("cds--date-picker__day",ff({},fd.today,0===I.compare(e))),date:e})}))))))))}),fC=t(43999),f$={};f$.styleTagTransform=T(),f$.setAttributes=S(),f$.insert=x().bind(null,"head"),f$.domAPI=k(),f$.insertStyleElement=B(),$()(fC.A,f$);let fw=fC.A&&fC.A.locals?fC.A.locals:void 0;function fk(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function fE(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){fk(e,n,t[n])})}return e}var fx=(0,g.forwardRef)(function(e,n){return(0,g.useContext)(cC).isInvalid?A().createElement(u4,fE({ref:n,size:16},e)):A().createElement(cj,fE({ref:n,size:16},e))});function fD(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function fS(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){fD(e,n,t[n])})}return e}function fz(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function fB(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function fM(e,n){if(null==e)return{};var t,r,a=fT(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function fT(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}var fO=(0,g.forwardRef)(function(e,n){var t=e.className,r=e.defaultValue,a=e.invalid,o=e.invalidText,i=e.isDisabled,s=e.isInvalid,l=e.label,c=e.labelText,u=e.light,d=e.maxDate,p=e.minDate,f=e.onChange,h=e.onChangeRaw,m=e.value,y=fM(e,["className","defaultValue","invalid","invalidText","isDisabled","isInvalid","label","labelText","light","maxDate","minDate","onChange","onChangeRaw","value"]),C=(0,v.UK)({externalModuleName:"@openmrs/esm-styleguide"}).preferredDateLocale,$=(0,g.useId)(),w=!!(null!=c?c:l),k=(0,g.useMemo)(function(){var e=(0,cE.J)();return C[e]&&(e=C[e]),e},[window.i18next.language]),E=(0,g.useMemo)(function(){var e=(0,cx.a7)(k);return void 0!==e?(0,Q.d)(e):void 0},[k]),x=(0,g.useMemo)(function(){return new Intl.Locale(k,{calendar:null==E?void 0:E.identifier})},[k,E]),D=(0,g.useMemo)(function(){if(m)return{start:di(m[0],E,!0),end:di(m[1],E,!0)}},[m]),S=(0,g.useMemo)(function(){if(r)return{start:di(r[0],E,!0),end:di(r[1],E,!0)}},[r]),z=(0,g.useMemo)(function(){return di(p,E,!0)},[p]),B=(0,g.useMemo)(function(){return di(d,E,!0)},[d]),M=(0,g.useMemo)(function(){return null!=a?a:s},[a,s]),T=E?(0,ee.yP)((0,en.Ec)((0,en.Xj)()),E):(0,en.Ec)((0,en.Xj)()),O=(0,g.useMemo)(function(){return h&&f&&console.error("An OpenmrsDateRangePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),h||function(e){return null==f?void 0:f([ds(e.start),ds(e.end)])}},[h,f]);return A().createElement(fb,{locale:x.toString()},A().createElement("div",{className:b()("cds--form-item",t)},A().createElement(eV,{values:[[dl,x]]},A().createElement(ck,fB(fS({id:w?$:void 0,className:b()("cds--date-picker",{"cds--date-picker--light":u,"cds--date-picker--disabled":i}),isInvalid:M,shouldForceLeadingZeros:"en"===x.language||void 0,maxValue:B,minValue:z,value:D,defaultValue:S,ref:n,isDisabled:i},y),{onChange:O}),A().createElement("div",{className:"cds--date-picker-container"},w&&A().createElement(sR,{className:b()("cds--label",{"cds--label--disabled":i}),htmlFor:$},null!=c?c:l),A().createElement(aJ,{className:fw.inputGroup},A().createElement("div",{className:fw.inputsWrapper},A().createElement(sm,{className:b()("cds--date-picker-input__wrapper",fw.startInput,fw.dateInputWrapper),slot:"start"},function(e){return A().createElement(fl,{className:fw.inputSegment,segment:e})}),A().createElement("div",{className:fw.separator},A().createElement("span",{"aria-hidden":"true","data-readonly":!0},"–")),A().createElement(sm,{className:b()("cds--date-picker-input__wrapper",fw.endInput,fw.dateInputWrapper),slot:"end"},function(e){return A().createElement(fl,{className:fw.inputSegment,segment:e})})),A().createElement(t2,{className:b()(fw.flatButton,fw.flatButtonMd)},A().createElement(fx,null))),M&&o&&A().createElement(sz,{className:fw.invalidText},o),A().createElement(cu,{className:fw.popover,placement:"bottom start",offset:1,isNonModal:!0},A().createElement(fp,{isRangePicker:!0},A().createElement(aH,{minValue:z,maxValue:B,className:"cds--date-picker__calendar"},A().createElement("header",{className:fw.header},A().createElement(t2,{className:b()(fw.flatButton,fw.flatButtonMd),slot:"previous"},A().createElement(cX,{size:16})),A().createElement(pT,{className:fw.monthYear}),A().createElement(t2,{className:b()(fw.flatButton,fw.flatButtonMd),slot:"next"},A().createElement(cQ,{size:16}))),A().createElement(aj,{className:fw.calendarGrid},function(e){return A().createElement(aZ,{key:e.toString(),className:b()("cds--date-picker__day",fD({},fw.today,0===T.compare(e))),date:e})})))))))))}),fN=t(70438),fP=function(e){var n=e.diagnoses,t=(0,v.UK)({externalModuleName:"@openmrs/esm-styleguide"}).diagnosisTags;return A().createElement(A().Fragment,null,n.map(function(e){var n=e.rank,r=e.uuid,a=e.display,o=t[1===n?"primaryColor":"secondaryColor"];return A().createElement(fN.Tag,{key:r,type:o},a)}))},fI=t(61836),fF=t(71065),fR={};fR.styleTagTransform=T(),fR.setAttributes=S(),fR.insert=x().bind(null,"head"),fR.domAPI=k(),fR.insertStyleElement=B(),$()(fF.A,fR);let fH=fF.A&&fF.A.locals?fF.A.locals:void 0;var fL=function(e){var n,t,r=e.error,a=e.headerTitle,o="tablet"===(0,v.qv)();return A().createElement(fN.Layer,null,A().createElement(fN.Tile,{className:fH.tile},A().createElement("div",{className:o?fH.tabletHeading:fH.desktopHeading},A().createElement("h4",null,a)),A().createElement("p",{className:fH.errorMessage},(0,fI.V)("error","Error")," ","".concat(null==r||null==(n=r.response)?void 0:n.status,": "),null==r||null==(t=r.response)?void 0:t.statusText),A().createElement("p",{className:fH.errorCopy},(0,fI.V)("errorCopy"))))},fj=t(71981),fq={};fq.styleTagTransform=T(),fq.setAttributes=S(),fq.insert=x().bind(null,"head"),fq.domAPI=k(),fq.insertStyleElement=B(),$()(fj.A,fq);let fG=fj.A&&fj.A.locals?fj.A.locals:void 0;function fV(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function fU(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){fV(e,n,t[n])})}return e}var fW=A().forwardRef(function(e,n){var t,r=(0,v.TA)(),a=r.slotName,o=r.basePath,i=r.componentContext,s=null!=(t=window.location)?t:{pathname:""},l=(0,v.CX)(null!=a?a:"");return e.isChildOfHeader&&a&&l.length>0?A().createElement(fN.SideNav,fU({ref:n,expanded:!0,"aria-label":"Left navigation",className:fG.leftNav},e),A().createElement(v.W3,{name:"global-nav-menu-slot"}),a?A().createElement(v.fS,{value:i,fallback:A().createElement(v.W3,{name:a,state:{basePath:o,currentPath:s}})},A().createElement(v.zq.Provider,{value:i},A().createElement(v.W3,{name:a,state:{basePath:o,currentPath:s}}))):null):A().createElement(A().Fragment,null)}),fK=t(36142),fZ=t.n(fK),fY=t(97744),fJ=t.n(fY),fX=t(70937),fQ=t(60482),f0=function(e){var n=e.notification,t=n.description,r=n.action,a=n.kind,o=n.critical,i=n.title,s=n.onAction;return A().createElement(fN.ActionableNotification,{actionButtonLabel:r,kind:a||"info",lowContrast:o,subtitle:t,title:i||"",inline:!0,onActionButtonClick:s})};function f1(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function f2(e){if(Array.isArray(e))return e}function f3(e){if(Array.isArray(e))return f1(e)}function f4(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function f5(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function f6(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f8(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f7(e,n){return f2(e)||f5(e,n)||_e(e,n)||f6()}function f9(e){return f3(e)||f4(e)||_e(e)||f8()}function _e(e,n){if(e){if("string"==typeof e)return f1(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return f1(e,n)}}let _n=function(e){var n=e.subject,t=f7((0,g.useState)([]),2),r=t[0],a=t[1];return(0,g.useEffect)(function(){var e=n.subscribe(function(e){return a(function(n){return f9(n.filter(function(n){return n.description!==e.description||n.action!==e.action||n.kind!==e.kind||n.title!==e.title})).concat([e])})});return function(){return e.unsubscribe()}},[n]),A().createElement(A().Fragment,null,r.map(function(e){return A().createElement(f0,{key:e.id,notification:e})}))};function _t(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function _r(e){if(Array.isArray(e))return e}function _a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function _o(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function _i(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){_a(e,n,t[n])})}return e}function _l(e,n){if(null==e)return{};var t,r,a=_c(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function _c(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}function _u(e,n){return _r(e)||_o(e,n)||_d(e,n)||_i()}function _d(e,n){if(e){if("string"==typeof e)return _t(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _t(e,n)}}var _p=function(e){var n=e.notification,t=n.actionButtonLabel,r=n.onActionButtonClick,a=void 0===r?function(){}:r,o=n.subtitle,i=n.kind,s=n.title,l=n.critical,c=n.progressActionLabel,u=(n.id,_l(n,["actionButtonLabel","onActionButtonClick","subtitle","kind","title","critical","progressActionLabel","id"])),d=_u((0,g.useState)(t),2),p=d[0],f=d[1],h=function(){a(),c&&f(c)};return A().createElement(fN.ActionableNotification,_s({kind:i||"info",actionButtonLabel:p,ariaLabel:"Closes actionable notification",onActionButtonClick:h,statusIconDescription:"Actionable notification",subtitle:o,title:s,lowContrast:l,inline:!0},u))};function _f(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function __(e){if(Array.isArray(e))return e}function _h(e){if(Array.isArray(e))return _f(e)}function _m(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _g(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function _A(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _y(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _b(e,n){return __(e)||_g(e,n)||_C(e,n)||_A()}function _v(e){return _h(e)||_m(e)||_C(e)||_y()}function _C(e,n){if(e){if("string"==typeof e)return _f(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _f(e,n)}}let _$=function(e){var n=e.subject,t=_b((0,g.useState)([]),2),r=t[0],a=t[1];return(0,g.useEffect)(function(){var e=n.subscribe(function(e){return a(function(n){return _v(n.filter(function(n){return n.subtitle!==e.subtitle||n.actionButtonLabel!==e.actionButtonLabel||n.onActionButtonClick!==e.onActionButtonClick||n.kind!==e.kind||n.title!==e.title})).concat([e])})});return function(){return e.unsubscribe()}},[n]),A().createElement(A().Fragment,null,r.map(function(e){return A().createElement(_p,{key:e.id,notification:e})}))};var _w=t(62926),_k=t(4004),_E=t(17820),_x=t(36820),_D=t(55259),_S=t(75323),_z=t(24956),_B=t(43148),_M="[object Map]",_T="[object Set]",_O=Object.prototype.hasOwnProperty;let _N=function(e){if(null==e)return!0;if((0,_D.A)(e)&&((0,_x.A)(e)||"string"==typeof e||"function"==typeof e.splice||(0,_S.A)(e)||(0,_B.A)(e)||(0,_E.A)(e)))return!e.length;var n=(0,_k.A)(e);if(n==_M||n==_T)return!e.size;if((0,_z.A)(e))return!(0,_w.A)(e).length;for(var t in e)if(_O.call(e,t))return!1;return!0};var _P=t(25873);function _I(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function _F(e,n){return null!=n&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?!!n[Symbol.hasInstance](e):e instanceof n}function _R(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){_I(e,n,t[n])})}return e}function _H(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function _L(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_H(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function _j(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}var _q=new fQ.B7,_G=0,_V=new fQ.B7,_U=0;function _W(e){e&&(0,_P.createRoot)(e).render(A().createElement(_n,{subject:_q}))}function _K(e){return"string"==typeof e?e.trim().length>0:(void 0===e?"undefined":_j(e))==="object"&&(_F(e,Error)||!_N(e))}function _Z(e){e&&_K(e.description)?(_F(e.description,Error)&&(e.description=e.description.toLocaleString()),setTimeout(function(){_q.next(_L(_R({},e),{id:_G++}))},0)):console.error("showNotification must be called with an object having a 'description' property that is a non-empty string or object")}function _Y(e){e&&(0,_P.createRoot)(e).render(A().createElement(_$,{subject:_V}))}function _J(e){return"string"==typeof e?e.trim().length>0:(void 0===e?"undefined":_j(e))==="object"&&!_N(e)}function _X(e){e&&_J(e.actionButtonLabel)?setTimeout(function(){_V.next(_L(_R({},e),{id:_U++}))},0):console.error("showActionableNotification must be called with an actionButtonLabel that is a non-empty string")}function _Q(e){var n=e?"/ws/fhir2/R4/Location?_id=".concat(e):null,t=fZ()(n,fX.lo,{shouldRetryOnError:function(e){var n;return null!=e&&null!=(n=e.response)&&!!n.status&&e.response.status>=500}}),r=t.data,a=t.error,o=t.isLoading;return(0,g.useMemo)(function(){var e;return{location:(null==r||null==(e=r.data)?void 0:e.entry)?r.data.entry[0]:null,error:n?a:null,isLoading:!!n&&o}},[r,o,a,n])}function _0(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=(0,V.useTranslation)().t,a=(0,v.d7)(t);function o(t,r){if(r){var o,i,s=null==(i=r.data)||null==(o=i.link)?void 0:o.find(function(e){return"next"===e.relation});if(!s)return null;var l=new URL(s.url);return l.origin===window.location.origin?s.url:new URL("".concat(l.pathname).concat(l.search?"?".concat(l.search):""),window.location.origin).toString()}var c="".concat(fX.IU,"/Location?"),u=new URLSearchParams;return u.append("_summary","data"),n&&u.append("_count",""+n),t&&u.append("_getpagesoffset",""+t*n),e&&u.append("_tag",e),"string"==typeof a&&""!=a&&u.append("name:contains",a),c+u.toString()}var i=fJ()(o,fX.lo),s=i.data,l=i.isLoading,c=i.isValidating,u=i.setSize,d=i.error;return d&&_Z({title:r("errorLoadingLoginLocations","Error loading login locations"),kind:"error",critical:!0,description:null==d?void 0:d.message}),(0,g.useMemo)(function(){var e,n,t,r,a;return{locations:(null==s?void 0:s.length)?null==s?void 0:s.flatMap(function(e){var n,t;return null!=(t=null==e||null==(n=e.data)?void 0:n.entry)?t:[]}):[],isLoading:l,totalResults:null==s||null==(n=s[0])||null==(e=n.data)?void 0:e.total,hasMore:null!=s&&!!s.length&&(null==s||null==(a=s[s.length-1])||null==(r=a.data)||null==(t=r.link)?void 0:t.some(function(e){return"next"===e.relation})),loadingNewData:c,setPage:u}},[l,s,c,u])}var _1=t(65309),_2={};_2.styleTagTransform=T(),_2.setAttributes=S(),_2.insert=x().bind(null,"head"),_2.domAPI=k(),_2.insertStyleElement=B(),$()(_1.A,_2);let _3=_1.A&&_1.A.locals?_1.A.locals:void 0;function _4(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function _5(e){if(Array.isArray(e))return e}function _6(e){if(Array.isArray(e))return _4(e)}function _8(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _7(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function _9(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function he(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function hn(e,n){return _5(e)||_7(e,n)||hr(e,n)||_9()}function ht(e){return _6(e)||_8(e)||hr(e)||he()}function hr(e,n){if(e){if("string"==typeof e)return _4(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _4(e,n)}}var ha=function(e){var n=e.selectedLocationUuid,t=e.defaultLocationUuid,r=e.locationTag,a=e.locationsPerRequest,o=void 0===a?50:a,i=e.onChange,s=(0,V.useTranslation)().t,l=hn((0,g.useState)(""),2),c=l[0],u=l[1],d=_Q(t).location,p=_0(r,o,c),f=p.locations,h=p.isLoading,m=p.hasMore,y=p.loadingNewData,b=p.setPage,v=(0,g.useMemo)(function(){return d&&!c?[d].concat(ht(null==f?void 0:f.filter(function(e){return e.resource.id!==t}))):f},[d,f]),C=function(e){i(),u(e)},$=(0,g.useCallback)(function(){y||!m||b(function(e){return e+1})},[y,m,b]),w=(0,K.useOnVisible)($),k=m?v.length-o/2:-1;return A().createElement("div",null,A().createElement(fN.Search,{labelText:s("searchForLocation","Search for a location"),id:"search-1",placeholder:s("searchForLocation","Search for a location"),onChange:function(e){return C(e.target.value)},size:"lg"}),A().createElement("div",{className:_3.searchResults},h?A().createElement("div",{className:_3.loadingContainer},A().createElement(fN.RadioButtonSkeleton,{className:_3.radioButtonSkeleton,role:"progressbar"}),A().createElement(fN.RadioButtonSkeleton,{className:_3.radioButtonSkeleton,role:"progressbar"}),A().createElement(fN.RadioButtonSkeleton,{className:_3.radioButtonSkeleton,role:"progressbar"}),A().createElement(fN.RadioButtonSkeleton,{className:_3.radioButtonSkeleton,role:"progressbar"}),A().createElement(fN.RadioButtonSkeleton,{className:_3.radioButtonSkeleton,role:"progressbar"})):A().createElement(A().Fragment,null,A().createElement("div",{className:_3.locationResultsContainer},(null==v?void 0:v.length)>0?A().createElement(fN.RadioButtonGroup,{name:"loginLocations",onChange:function(e){i(null==e?void 0:e.toString())},orientation:"vertical",valueSelected:n},v.map(function(e,n){return A().createElement(fN.RadioButton,{className:_3.locationRadioButton,key:e.resource.id,id:e.resource.id,name:e.resource.name,labelText:A().createElement("span",{ref:n==k?w:null},e.resource.name),value:e.resource.id})})):A().createElement("div",{className:_3.emptyState},A().createElement("p",{className:_3.locationNotFound},s("noResultsToDisplay","No results to display")))),y&&A().createElement("div",{className:_3.loadingIcon},A().createElement(fN.InlineLoading,{description:s("loading","Loading")})))))},ho=t(22956),hi=t(467),hs=t(96893),hl=t(64201);function hc(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function hu(e){if(Array.isArray(e))return e}function hd(e){if(Array.isArray(e))return hc(e)}function hp(e,n,t,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){t(e);return}s.done?n(l):Promise.resolve(l).then(r,a)}function hf(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function i(e){hp(o,r,a,i,s,"next",e)}function s(e){hp(o,r,a,i,s,"throw",e)}i(void 0)})}}function h_(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function hh(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function hm(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function hg(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function hA(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function hy(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){h_(e,n,t[n])})}return e}function hb(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function hv(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hb(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function hC(e,n){return hu(e)||hm(e,n)||hw(e,n)||hg()}function h$(e){return hd(e)||hh(e)||hw(e)||hA()}function hw(e,n){if(e){if("string"==typeof e)return hc(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return hc(e,n)}}function hk(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(n){return l([e,n])}}function l(s){if(t)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],r=0}finally{t=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}var hE=(0,hi.Zd)("modalState",{modalContainer:null,modalStack:[]});function hx(e){var n=e.size,t=document.createElement("div");return t.className="cds--modal-container cds--modal-container--".concat(n),t.setAttribute("role","dialog"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-modal","true"),t}var hD=0;function hS(e,n){return hf(function(e,n){var t,r,a,o,i,s=arguments;return hk(this,function(l){switch(l.label){case 0:if(t=s.length>2&&void 0!==s[2]?s[2]:{},r=(0,hs.Fg)(n),a=null,!e)return[3,2];if(!r)throw Error("No modal named '".concat(n,"' has been registered."));return[4,(0,r.load)()];case 1:return o=l.sent(),i=hD++,a=(0,ho.xL)(hv(hy({},o),{name:"".concat(n,"-").concat(i)}),hv(hy({},t),{domElement:e})),[3,3];case 2:(0,hl.N)("Failed to launch modal. Please notify your administrator. Modal name: ".concat(n)),l.label=3;case 3:return[2,a]}})}).apply(this,arguments)}var hz=window.getComputedStyle(document.body).overflow;function hB(e){var n=e.modalStack,t=e.modalContainer;t&&(n.length?(t.style.visibility||(addEventListener("keydown",hN),document.body.style.overflow="hidden",t.style.visibility="unset"),n.forEach(function(e,r){switch(e.state){case"NEW":var a,o,i,s,l,c=hx({size:null!=(l=null==(s=e.props)?void 0:s.size)?l:"md"});e.container=c,hS(c,e.modalName,e.props).then(function(n){e.parcel=n,e.state="MOUNTED",t.prepend(c),c.style.visibility="unset"});break;case"MOUNTED":e.container&&(e.container.style.visibility=r?"hidden":"unset");break;case"TO_BE_DELETED":e.onClose(),null==(o=e.parcel)||null==(a=o.unmount)||a.call(o),null==(i=e.container)||i.remove(),setTimeout(function(){hE.setState({modalContainer:t,modalStack:n.filter(function(n){return n!==e})})},0)}})):(t.style.removeProperty("visibility"),document.body.style.overflow=hz,removeEventListener("keydown",hN)))}function hM(e){var n=hE.getState(),t=[e].concat(h$(n.modalStack));hE.setState(hv(hy({},n),{modalStack:t}))}function hT(e){var n=hE.getState(),t=n.modalStack.map(function(n){return n===e?hv(hy({},n),{state:"TO_BE_DELETED"}):n});hE.setState(hv(hy({},n),{modalStack:t}))}function hO(){var e=hC(hE.getState().modalStack,1)[0];e&&hT(e)}function hN(e){"Escape"===e.key&&hO()}function hP(e){hE.subscribe(hB),hE.setState(hv(hy({},hE.getState()),{modalContainer:e}))}function hI(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=function(){var e=hE.getState().modalStack.find(function(e){return e.onClose===t});e&&hT(e)};return(0,hs.Fg)(e)?hM({state:"NEW",onClose:t,modalName:e,props:hy({close:r},n)}):(0,hl.N)('Failed to launch modal. Please notify your administrator. Modal name: "'.concat(e,'"')),r}var hF=t(94285),hR={};hR.styleTagTransform=T(),hR.setAttributes=S(),hR.insert=x().bind(null,"head"),hR.domAPI=k(),hR.insertStyleElement=B(),$()(hF.A,hR);let hH=hF.A&&hF.A.locals?hF.A.locals:void 0;function hL(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function hj(e){if(Array.isArray(e))return e}function hq(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function hG(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function hV(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function hU(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){hq(e,n,t[n])})}return e}function hW(e,n){if(null==e)return{};var t,r,a=hK(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function hK(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}function hZ(e,n){return hj(e)||hG(e,n)||hY(e,n)||hV()}function hY(e,n){if(e){if("string"==typeof e)return hL(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return hL(e,n)}}var hJ=function(e){return"children"in e},hX=function(e){if(hJ(e)){var n=e.children,t=e.className,r=hW(e,["children","className"]);return A().createElement("div",hU({className:b()(hH.pageHeader,t)},r),n)}var a=e.title,o=e.illustration,i=e.className,s=hW(e,["title","illustration","className"]);return A().createElement("div",hU({className:b()(hH.pageHeader,i)},s),A().createElement(hQ,{title:a,illustration:o}))},hQ=function(e){var n=e.title,t=e.illustration,r=e.className,a=hZ((0,g.useState)(null),2),o=a[0],i=a[1];return(0,g.useEffect)(function(){(0,p.zj)("@openmrs/esm-styleguide").then(function(e){i(e)})},[]),A().createElement("div",{className:b()(hH.pageHeaderContent,r)},t,A().createElement("div",{className:hH.pageLabels},(null==o?void 0:o.implementationName)&&A().createElement("p",null,(0,fI.V)(o.implementationName)),A().createElement("p",{className:hH.pageName},n)))},h0=t(67943),h1=t(40785),h2=t(85195),h3={};h3.styleTagTransform=T(),h3.setAttributes=S(),h3.insert=x().bind(null,"head"),h3.domAPI=k(),h3.insertStyleElement=B(),$()(h2.A,h3);let h4=h2.A&&h2.A.locals?h2.A.locals:void 0;function h5(e){var n=e.showIdentifierLabel,t=e.type,r=e.value;return A().createElement("span",{className:h4.primaryIdentifier},A().createElement(fN.Tag,{className:h4.tag,type:"gray"},n&&(null==t?void 0:t.text)&&A().createElement("span",{className:h4.label},t.text,": "),A().createElement("span",{className:h4.value},r)))}function h6(e){var n=e.showIdentifierLabel,t=e.type,r=e.value;return A().createElement(fN.FormLabel,{className:h4.secondaryIdentifier,id:"patient-banner-identifier-".concat(r)},n&&A().createElement("span",{className:h4.label},null==t?void 0:t.text,": "),A().createElement("span",{className:h4.value},r))}function h8(e){var n,t=e.identifiers,r=e.showIdentifierLabel,a=(0,v.UK)().excludePatientIdentifierCodeTypes,o=(0,v.wJ)().primaryIdentifierCode,i=null!=(n=null==t?void 0:t.filter(function(e){var n,t,r,o=null==(r=e.type)||null==(t=r.coding)||null==(n=t[0])?void 0:n.code;return o&&!(null==a?void 0:a.uuids.includes(o))}))?n:[];return A().createElement(A().Fragment,null,(null==i?void 0:i.length)?i.map(function(e,n){var t,a,s=e.value,l=e.type;return A().createElement(A().Fragment,{key:s},A().createElement("span",{className:h4.identifier},(null==l||null==(a=l.coding)||null==(t=a[0])?void 0:t.code)===o?A().createElement(h5,{showIdentifierLabel:r,type:l,value:s}):A().createElement(h6,{showIdentifierLabel:r,type:l,value:s})),n<i.length-1&&A().createElement("span",{className:h4.separator},"\xb7"))}):"")}let h7=h8;var h9={Female:un,Male:ut,Other:ur,Unknown:ua},me=function(e){var n=h9[e.gender];return n?A().createElement(n,{fill:"#525252"}):null},mn={male:"Male",female:"Female",other:"Other",unknown:"Unknown"},mt=function(e){var n,t=e.toLowerCase(),r=null!=(n=mn[t])?n:"Unknown";return{displayText:(0,fI.V)(t,e),iconKey:r}};function mr(e){var n=e.patient,t=e.renderedFrom,r=(0,h0.Vp)(n),a=(null==n?void 0:n.gender)&&mt(n.gender),o=(0,g.useMemo)(function(){return{patientUuid:n.id,patient:n,renderedFrom:t}},[n.id,n,t]);return A().createElement("div",{className:h4.patientInfo},A().createElement("div",{className:b()(h4.row,h4.patientNameRow)},A().createElement("div",{className:h4.flexRow},A().createElement("span",{className:h4.patientName},r),a&&A().createElement("div",{className:h4.gender},A().createElement(me,{gender:a.iconKey}),A().createElement("span",null,a.displayText)),A().createElement(v.W3,{className:h4.tagsSlot,name:"patient-banner-tags-slot",state:o}))),A().createElement("div",{className:h4.demographics},n.birthDate&&A().createElement(A().Fragment,null,A().createElement("span",null,(0,h1.K)(n.birthDate)),A().createElement("span",{className:h4.separator},"\xb7"),A().createElement("span",null,(0,cx.LW)(n.birthDate,{time:!1})),A().createElement("span",{className:h4.separator},"\xb7")),A().createElement(h7,{identifiers:n.identifier,showIdentifierLabel:!0}),A().createElement(v.W3,{className:h4.extensionSlot,name:"patient-banner-bottom-slot",state:o})))}var ma=t(18282),mo=t(25447),mi={};mi.styleTagTransform=T(),mi.setAttributes=S(),mi.insert=x().bind(null,"head"),mi.domAPI=k(),mi.insertStyleElement=B(),$()(mo.A,mi);let ms=mo.A&&mo.A.locals?mo.A.locals:void 0;function ml(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function mc(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){ml(e,n,t[n])})}return e}function mu(e){var n=e.patient,t=e.patientUuid,r=e.actionsSlotName,a=e.additionalActionsSlotState,o=(0,v.br)(r).extensions,i=(0,g.useMemo)(function(){return mc({patientUuid:t,patient:n},a)},[t,a]);return A().createElement(A().Fragment,null,o.length>0?A().createElement("div",{className:ms.overflowMenuContainer},A().createElement(G,{menuTitle:A().createElement(A().Fragment,null,A().createElement("span",{className:ms.actionsButtonText},(0,fI.V)("actions","Actions"))," ",A().createElement(ma.CH,{size:16,style:{marginLeft:"0.5rem",fill:"#78A9FF"}}))},A().createElement(v.W3,{name:"patient-actions-slot",key:"patient-actions-slot",state:i}))):null)}var md=function(e){var n=e.toast,t=e.closeToast,r=n.description,a=n.kind,o=n.critical,i=n.title,s=n.actionButtonLabel,l=n.onActionButtonClick,c=void 0===l?function(){}:l,u=(0,g.useCallback)(function(){c(),t()},[t,c]);return A().createElement("div",null,A().createElement(fN.ActionableNotification,{actionButtonLabel:s,kind:a||"info",lowContrast:o,subtitle:r,title:i||"",onActionButtonClick:u,onClose:t}))};function mp(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function mf(e){if(Array.isArray(e))return e}function m_(e){if(Array.isArray(e))return mp(e)}function mh(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function mm(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function mg(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function mA(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function my(e,n){return mf(e)||mm(e,n)||mv(e,n)||mg()}function mb(e){return m_(e)||mh(e)||mv(e)||mA()}function mv(e,n){if(e){if("string"==typeof e)return mp(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return mp(e,n)}}let mC=function(e){var n=e.subject,t=my((0,g.useState)([]),2),r=t[0],a=t[1],o=(0,g.useCallback)(function(e){a(function(n){return n.filter(function(n){return n!==e})})},[]);return(0,g.useEffect)(function(){var e=n.subscribe(function(e){return a(function(n){return mb(n.filter(function(n){return n.description!==e.description||n.kind!==e.kind||n.title!==e.title||n.actionButtonLabel!==e.actionButtonLabel||n.onActionButtonClick!==e.onActionButtonClick})).concat([e])})});return function(){return e.unsubscribe()}},[n]),A().createElement(A().Fragment,null,r.map(function(e){return A().createElement(md,{key:e.id,toast:e,closeToast:function(){return o(e)}})}))};function m$(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function mw(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){m$(e,n,t[n])})}return e}function mk(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function mE(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function mx(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}var mD=new fQ.B7,mS=0;function mz(e){e&&(0,_P.createRoot)(e).render(A().createElement(mC,{subject:mD}))}function mB(e){return"string"==typeof e?e.trim().length>0:(void 0===e?"undefined":mx(e))==="object"&&!_N(e)}function mM(e){e&&mB(e.description)?setTimeout(function(){mD.next(mE(mw({},e),{id:mS++}))},0):console.error("showToast must be called with an object having a 'description' property that is a non-empty string or object")}var mT=t(17744);function mO(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function mN(e){if(Array.isArray(e))return mO(e)}function mP(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function mI(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function mF(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function mR(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){mP(e,n,t[n])})}return e}function mH(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function mL(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function mj(e){return mN(e)||mI(e)||mq(e)||mF()}function mq(e,n){if(e){if("string"==typeof e)return mO(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return mO(e,n)}}function mG(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n)return!0;var t=mX(e);return!t||!t()}function mV(e,n){var t,r=m5(),a=null==(t=r.getState())?void 0:t.workspaceGroup,o=null==a?void 0:a.name;if(o&&e===o){var i=o?function(e){return e.currentWorkspaceGroup===o}:function(){return!0};m7(function(){var t=gr(e);t&&(t.setState({},!0),t.subscribe(function(){})()),"function"==typeof(null==a?void 0:a.cleanup)&&a.cleanup(),r.setState(function(e){return mL(mR({},e),{workspaceGroup:void 0})}),"function"==typeof n&&n()},i)}}function mU(e,n){var t,r=(0,hs.Q_)(e),a=n.state,o=n.onWorkspaceGroupLaunch,i=n.workspaceGroupCleanup,s=n.workspaceToLaunch,l=m5();if(l.getState().openWorkspaces.length){var c=l.getState().workspaceGroup;c?mV(null==c?void 0:c.name,function(){mU(e,n)}):m7(function(){mU(e,n)})}else l.setState(function(n){return mL(mR({},n),{workspaceGroup:{name:e,members:r.members,cleanup:i}})}),gr(e,a),null==o||o(),s&&mK(s.name,null!=(t=s.additionalProps)?t:{})}function mW(e,n){var t,r=n.name,a=n.additionalProps;(0,hs.Xb)(r);var o=function(){m1(e.name,{ignoreChanges:!0,onWorkspaceClose:function(){return mK(r,a)},closeWorkspaceGroup:!1})};mG(e.name)?o():ge("closing-workspace-launching-new-workspace",o,null!=(t=e.title)?t:e.name)}function mK(e,n){var t,r,a=m5(),o=(0,hs.Xb)(e),i=a.getState().workspaceGroup;if(i&&!(null==(t=i.members)?void 0:t.includes(e)))return void mV(i.name,function(){mK(e,n)});var s=null==(r=a.getState().workspaceGroup)?void 0:r.name,l=mL(mR({},o),{title:gn(o,n),closeWorkspace:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return m1(e,n)},closeWorkspaceWithSavedChanges:function(n){return m1(e,mR({ignoreChanges:!0},n))},promptBeforeClosing:function(n){return mJ(e,n)},setTitle:function(n,t){l.title=n,l.titleNode=t,a.setState(function(n){var t=n.openWorkspaces.map(function(n){return n.name===e?l:n});return mL(mR({},n),{openWorkspaces:t})})},currentWorkspaceGroup:s,additionalProps:null!=n?n:{}});function c(e,n){a.setState(function(t){var r=[e].concat(mj(null!=n?n:t.openWorkspaces)),a=m8(e);return mL(mR({},t),{openWorkspaces:r,workspaceWindowState:a})})}s&&gr(s,n);var u=a.getState().openWorkspaces,d=u.findIndex(function(n){return n.name===e}),p=d>=0,f=u.find(function(e){return e.type==l.type});if(0===u.length)c(l);else if(u[0].canHide||0===d)if(p){var h=u[d];h.title===gn(h,h.additionalProps)&&(h.title=gn(l,l.additionalProps)),h.additionalProps=l.additionalProps;var m=u.filter(function(n){return n.name!=e});c(u[d],m)}else f?(c(f,a.getState().openWorkspaces.filter(function(e){return e.type!=l.type})),mW(f,{name:e,additionalProps:n})):c(l);else mW(u[0],{name:e,additionalProps:n})}function mZ(e){var n=e.targetUrl,t=e.contextKey,r=e.workspaceName,a=e.additionalProps;m2(t),mK(r,a),(0,mT.oo)({to:n})}var mY={};function mJ(e,n){mY[e]=n}function mX(e){return mY[e]}function mQ(){var e=m5(),n=e.getState();e.setState(mL(mR({},n),{prompt:null}))}var m0={ignoreChanges:!1,onWorkspaceClose:function(){},closeWorkspaceGroup:!0};function m1(e){var n,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=mR({},m0,t);var r=m5(),a=function(){var n,a,o=r.getState();o.openWorkspaces.find(function(n){return n.name===e});var i=o.openWorkspaces.filter(function(n){return n.name!=e}),s=null==(n=r.getState().workspaceGroup)?void 0:n.name;s&&t.closeWorkspaceGroup&&mV(s),mJ(e,function(){return!1}),r.setState(function(e){return mL(mR({},e),{prompt:null,openWorkspaces:i,workspaceWindowState:m8(null==i?void 0:i[0])})}),null==t||null==(a=t.onWorkspaceClose)||a.call(t)};return mG(e,null==t?void 0:t.ignoreChanges)?(a(),!0):(ge("closing-workspace",a,null!=(n=(0,hs.Xb)(e).title)?n:e),!1)}function m2(e){var n=m5();n.getState().context!=e&&n.setState({context:e,openWorkspaces:[],prompt:null})}var m3={context:"",openWorkspaces:[],prompt:null,workspaceWindowState:"normal",workspaceGroup:void 0},m4=(0,hi.Zd)("workspace",m3);function m5(){return m4}function m6(e){var n=m5(),t=n.getState();n.setState(mL(mR({},t),{workspaceWindowState:e}))}function m8(e){var n;return null!=(n=null==e?void 0:e.preferredWindowSize)?n:"normal"}function m7(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},t=m5().getState().openWorkspaces.filter(n).every(function(e){return mG(e.name)}),r=function(){gt(),null==e||e()};t?r():ge("closing-all-workspaces",r)}function m9(){var e=(0,v.Pj)(m4),n=e.workspaceWindowState,t=e.openWorkspaces,r=e.prompt,a=e.workspaceGroup;return(0,g.useMemo)(function(){return{active:t.length>0,prompt:r,workspaceWindowState:n,workspaces:t,workspaceGroup:a}},[t,n,r,a])}function ge(e){var n,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=m5();switch(e){case"closing-workspace":n={title:(0,fI.V)("unsavedChangesTitleText","Unsaved changes"),body:(0,fI.V)("unsavedChangesInOpenedWorkspace","You may have unsaved changes in the opened workspace. Do you want to discard these changes?"),onConfirm:function(){null==t||t()},confirmText:(0,fI.V)("discard","Discard")};break;case"closing-all-workspaces":var o=a.getState().openWorkspaces.filter(function(e){return!mG(e.name)}).map(function(e,n){var t=e.title;return"".concat(n+1,". ").concat(t)});n={title:(0,fI.V)("closingAllWorkspacesPromptTitle","You have unsaved changes"),body:(0,fI.V)("closingAllWorkspacesPromptBody","There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",{workspaceNames:o.join(",")}),onConfirm:function(){null==t||t()},confirmText:(0,fI.V)("closeAllOpenedWorkspaces","Discard changes in {{count}} workspaces",{count:o.length})};break;case"closing-workspace-launching-new-workspace":n={title:(0,fI.V)("unsavedChangesTitleText","Unsaved changes"),body:(0,fI.V)("unsavedChangesInWorkspace",'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',{workspaceName:r}),onConfirm:function(){a.setState(function(e){return mL(mR({},e),{prompt:null})}),null==t||t()},confirmText:(0,fI.V)("openAnyway","Open anyway")};break;default:console.error('Workspace system trying to open unknown prompt type "'.concat(e,'" in function "showWorkspacePrompts"')),null==t||t();return}a.setState(function(e){return mL(mR({},e),{prompt:n})})}function gn(e,n){var t;return null!=(t=null==n?void 0:n.workspaceTitle)?t:e.title}function gt(){m5().setState(m3)}function gr(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&"default"!==e){var t=(0,hi.jf)(e,{});return n&&t.setState(function(e){return mR({},e,n)}),t}}var ga=t(75230),go={};go.styleTagTransform=T(),go.setAttributes=S(),go.insert=x().bind(null,"head"),go.domAPI=k(),go.insertStyleElement=B(),$()(ga.A,go);let gi=ga.A&&ga.A.locals?ga.A.locals:void 0;function gs(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function gl(e){var n=e.getIcon,t=e.formOpenInTheBackground,r=e.tagContent;return A().createElement(A().Fragment,null,n({size:16}),t?A().createElement("span",{className:gi.interruptedTag},"!"):A().createElement("span",{className:gi.countTag},r))}var gc=function(e){var n,t=e.getIcon,r=e.label,a=e.iconDescription,o=e.handler,i=e.type,s=e.tagContent,l=(0,v.qv)(),c=m9(),u=c.workspaces,d=c.workspaceWindowState,p=null!=(n=null==u?void 0:u.findIndex(function(e){return e.type===i}))?n:-1,f="hidden"!==d&&0===p,h=p>0||0===p&&"hidden"===d;return"tablet"===l||"phone"===l?A().createElement(fN.Button,{className:b()(gi.container,gs({},gi.active,f)),iconDescription:a,kind:"ghost",onClick:o,role:"button",tabIndex:0,size:"md"},A().createElement("span",{className:gi.elementContainer},A().createElement(gl,{formOpenInTheBackground:h,getIcon:t,tagContent:s})),A().createElement("span",null,r)):A().createElement(fN.IconButton,{align:"left","aria-label":a,className:b()(gi.container,gs({},gi.active,f)),enterDelayMs:300,kind:"ghost",label:r,onClick:o,size:"md"},A().createElement("div",{className:gi.elementContainer},A().createElement(gl,{formOpenInTheBackground:h,getIcon:t,tagContent:s})))},gu=t(44970);let gd=A().forwardRef(function({children:e,size:n=16,...t},r){return 16===n||"16"===n||"16px"===n?A().createElement(gu.A,{width:n,height:n,ref:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",...t},s||(s=A().createElement("path",{d:"M2 9L2 10 5.3 10 1 14.3 1.7 15 6 10.7 6 14 7 14 7 9zM14 7L14 6 10.7 6 15 1.7 14.3 1 10 5.3 10 2 9 2 9 7z"})),e):A().createElement(gu.A,{width:n,height:n,ref:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...t},l||(l=A().createElement("path",{d:"M4 18L4 20 10.586 20 2 28.582 3.414 30 12 21.414 12 28 14 28 14 18 4 18zM30 3.416L28.592 2 20 10.586 20 4 18 4 18 14 28 14 28 12 21.414 12 30 3.416z"})),e)});var gp=t(54240),gf=t(68622),g_=t(1158),gh=/[\\^$.*+?()[\]{}|]/g,gm=RegExp(gh.source);let gg=function(e){return(e=(0,g_.A)(e))&&gm.test(e)?e.replace(gh,"\\$&"):e};var gA=t(3265),gy={};gy.styleTagTransform=T(),gy.setAttributes=S(),gy.insert=x().bind(null,"head"),gy.domAPI=k(),gy.insertStyleElement=B(),$()(gA.A,gy);let gb=gA.A&&gA.A.locals?gA.A.locals:void 0;function gv(e){var n,t,r=e.contextKey,a=(0,V.useTranslation)().t,o=m9().prompt;return(0,g.useEffect)(function(){new RegExp("/".concat(gg(r),"(/|$)")).test(window.location.pathname)||(0,hl.N)('WorkspaceContainer has provided an invalid context key: "'.concat(r,'". The context key must be part of the URL path, with no initial or trailing slash.'))},[]),(0,g.useEffect)(function(){return m2(r),function(){m2(null)}},[r]),(0,g.useEffect)(function(){var e=function(e){var n=e.detail,t=n.cancelNavigation,a=n.newUrl,o=new RegExp("/".concat(gg(r),"(/|$)")),i=new URL(a),s=o.test(i.pathname),l=m5().getState().openWorkspaces.every(function(e){return mG(e.name)});s||(l?gt():(null==t||t(),m7(function(){(0,mT.oo)({to:a})})))};return window.addEventListener("single-spa:before-routing-event",e),function(){window.removeEventListener("single-spa:before-routing-event",e)}},[]),null!=o?A().createElement(fN.ComposedModal,{open:!0,onClose:mQ},A().createElement(fN.ModalHeader,{title:o.title}),A().createElement(fN.ModalBody,null,A().createElement("p",{className:gb.messageBody},o.body)),A().createElement(fN.ModalFooter,null,A().createElement(fN.Button,{kind:"secondary",onClick:mQ},null!=(n=o.cancelText)?n:a("cancel","Cancel")),A().createElement(fN.Button,{kind:"danger",onClick:o.onConfirm},null!=(t=o.confirmText)?t:a("confirm","Confirm")))):null}var gC=t(6309);function g$(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function gw(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?g$(Object(t),!0).forEach(function(n){gE(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):g$(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function gk(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gE(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function gx(e){return(gx=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function gD(e,n){return(gD=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function gS(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gz(e,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw TypeError("Derived constructors may only return object or undefined");return gS(e)}function gB(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var t,r=gx(e);return t=n?Reflect.construct(r,arguments,gx(this).constructor):r.apply(this,arguments),gz(this,t)}}var gM=function(e){!function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&gD(e,n)}(o,g.Component);var n,t,r,a=gB(o);function o(e){var n;if(function(e,n){if(!(e instanceof n))throw TypeError("Cannot call a class as a function")}(this,o),gE(gS(n=a.call(this,e)),"handleRef",function(e){n.el=e}),gE(gS(n),"addThingToDo",function(e,t){n.state.hasError&&"unmount"!==e||(n.nextThingToDo=(n.nextThingToDo||Promise.resolve()).then(function(){if(!n.unmounted||"unmount"===e)return t.apply(void 0,arguments)}).catch(function(t){throw n.nextThingToDo=Promise.resolve(),n.setState({hasError:!0}),t&&t.message&&(t.message="During '".concat(e,"', parcel threw an error: ").concat(t.message)),n.props.handleError?n.props.handleError(t):setTimeout(function(){throw t}),t}))}),gE(gS(n),"getParcelProps",function(){var e=gw(gw({},n.props),{},{domElement:n.el});return delete e.mountParcel,delete e.config,delete e.wrapWith,delete e.wrapStyle,delete e.appendTo,delete e.handleError,delete e.parcelDidMount,e}),n.state={hasError:!1},!e.config)throw Error("single-spa-react's Parcel component requires the 'config' prop to either be a parcel config or a loading function that returns a promise. See https://github.com/single-spa/single-spa-react");return n}return n=o,t=[{key:"componentDidMount",value:function(){var e=this;this.unmounted=!1,this.addThingToDo("mount",function(){var n,t=e.props.mountParcel||e.mountParcel;if(!t)throw Error("\n <Parcel /> was not passed a mountParcel prop, nor is it rendered where mountParcel is within the React context.\n If you are using <Parcel /> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <Parcel /> as a mountParcel prop \n ");return e.el?n=e.el:(e.createdDomElement=n=document.createElement(e.props.wrapWith),Object.keys(e.props.wrapStyle).forEach(function(t){n.style[t]=e.props.wrapStyle[t]}),e.props.appendTo.appendChild(n)),e.parcel=t(e.props.config,gw({domElement:n},e.getParcelProps())),e.parcel.mountPromise.then(e.props.parcelDidMount),e.parcel.mountPromise})}},{key:"componentDidUpdate",value:function(){var e=this;this.addThingToDo("update",function(){if(e.parcel&&e.parcel.update)return e.parcel.update(e.getParcelProps())})}},{key:"componentWillUnmount",value:function(){var e=this;this.addThingToDo("unmount",function(){if(e.parcel&&"MOUNTED"===e.parcel.getStatus())return e.parcel.unmount()}),this.createdDomElement&&this.createdDomElement.parentNode.removeChild(this.createdDomElement),this.unmounted=!0}},{key:"render",value:function(){var e=this;if(this.props.appendTo)return gC.i&&gC.i.Consumer?g.createElement(gC.i.Consumer,null,function(n){return e.mountParcel=n?n.mountParcel:null,null}):null;var n=gC.i&&gC.i.Consumer?g.createElement(gC.i.Consumer,null,function(n){return e.mountParcel=n?n.mountParcel:null,null}):void 0;return g.createElement(this.props.wrapWith,{ref:this.handleRef,style:this.props.wrapStyle,className:this.props.wrapClassName},n)}}],gk(n.prototype,t),r&&gk(n,r),o}();gE(gM,"defaultProps",{wrapWith:"div",wrapStyle:{},parcelDidMount:function(){}});var gT=t(4784),gO={};gO.styleTagTransform=T(),gO.setAttributes=S(),gO.insert=x().bind(null,"head"),gO.domAPI=k(),gO.insertStyleElement=B(),$()(gT.A,gO);let gN=gT.A&&gT.A.locals?gT.A.locals:void 0;function gP(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function gI(e){if(Array.isArray(e))return e}function gF(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function gR(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function gH(e,n){return gI(e)||gF(e,n)||gL(e,n)||gR()}function gL(e,n){if(e){if("string"==typeof e)return gP(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return gP(e,n)}}function gj(e){var n=gH((0,g.useState)({}),2),t=n[0],r=n[1],a=gH((0,g.useState)(e),2),o=a[0],i=a[1];return(0,g.useEffect)(function(){o!==e&&i(e)},[e]),(0,g.useEffect)(function(){var e,n=gr(o);return n&&(r(n.getState()),e=n.subscribe(r)),function(){n&&(null==e||e())}},[o]),t}function gq(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function gG(e){if(Array.isArray(e))return e}function gV(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function gU(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function gW(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function gK(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){gV(e,n,t[n])})}return e}function gZ(e,n){return gG(e)||gU(e,n)||gY(e,n)||gW()}function gY(e,n){if(e){if("string"==typeof e)return gq(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return gq(e,n)}}function gJ(e){var n=e.workspace,t=e.additionalPropsFromPage,r=gZ((0,g.useState)(),2),a=r[0],o=r[1],i=gj(n.currentWorkspaceGroup);(0,g.useEffect)(function(){var e=!0;return n.load().then(function(n){e&&o(n)}),function(){e=!1}},[n]);var s=(0,g.useMemo)(function(){return n&&gK({closeWorkspace:n.closeWorkspace,closeWorkspaceWithSavedChanges:n.closeWorkspaceWithSavedChanges,promptBeforeClosing:n.promptBeforeClosing,setTitle:n.setTitle},t,i,n.additionalProps)},[n,t,i]);return a?A().createElement(gM,gK({key:n.name,config:a,mountParcel:ho.xL},s)):A().createElement(fN.InlineLoading,{className:gN.loader,description:"".concat((0,fI.V)("loading","Loading")," ...")})}var gX=t(7597),gQ={};gQ.styleTagTransform=T(),gQ.setAttributes=S(),gQ.insert=x().bind(null,"head"),gQ.domAPI=k(),gQ.insertStyleElement=B(),$()(gX.A,gQ);let g0=gX.A&&gX.A.locals?gX.A.locals:void 0;function g1(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function g2(e){if(Array.isArray(e))return e}function g3(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function g4(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function g5(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g6(e,n){return g2(e)||g4(e,n)||g8(e,n)||g5()}function g8(e,n){if(e){if("string"==typeof e)return g1(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g1(e,n)}}function g7(e){var n,t=e.isWithinWorkspace,r=e.name,a=e.actionMenuProps,o=void 0===a?{}:a,i=g6((0,g.useState)(!1),2),s=i[0],l=i[1],c=(0,g.useRef)(window.innerHeight),u=(0,g.useContext)(v.zq).featureName,d=(0,v.qv)();(0,g.useEffect)(function(){var e=function(){l(!(0,v.xl)(d)&&c.current>window.innerHeight),c.current!=window.innerHeight&&(c.current=window.innerHeight)};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[c]);var p="action-menu-".concat(r&&"default"!=r?r:u,"-items-slot");return A().createElement("aside",{className:b()(g0.sideRail,(g3(n={},g0.withinWorkspace,t),g3(n,g0.sideRailHidden,s),g3(n,g0.sideRailVisible,!s),n))},A().createElement("div",{className:g0.container},A().createElement(v.W3,{className:g0.chartExtensions,name:p,state:o})))}let g9=g7;function Ae(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function An(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){Ae(e,n,t[n])})}return e}function At(e){var n,t,r,a=e.contextKey,o=e.overlay,i=e.showSiderailAndBottomNav,s=e.additionalWorkspaceProps,l=e.actionMenuProps,c=(0,v.qv)(),u=m9(),d=u.workspaces,p=u.workspaceWindowState,f=u.workspaceGroup,h=null==f?void 0:f.name,m=d[0],y="hidden"===p||null==m,C="maximized"===p,$=null!=(n=null==m?void 0:m.width)?n:o?"wider":"narrow",w=(0,g.useMemo)(function(){return i||h&&!y},[h,y,i]);return(0,v.yJ)(!y&&!(0,v.xl)(c)),A().createElement(A().Fragment,null,A().createElement("div",{className:i?gN.workspaceContainerWithActionMenu:gN.workspaceContainerWithoutActionMenu},A().createElement("aside",{className:b()(o?gN.workspaceOverlayOuterContainer:gN.workspaceWindowSpacer,(Ae(t={},gN.hiddenRelative,y),Ae(t,gN.narrowWorkspace,"narrow"===$),Ae(t,gN.widerWorkspace,"wider"===$),Ae(t,gN.extraWideWorkspace,"extra-wide"===$),t))},A().createElement("div",{className:b()(gN.workspaceFixedContainer,(Ae(r={},gN.maximizedWindow,C),Ae(r,gN.hiddenFixed,y),r))},d.map(function(e,n){return A().createElement("div",{key:"workspace-container-".concat(e?e.name:"empty-".concat(n)),className:b()(gN.workspaceInnerContainer,Ae({},gN.hiddenExtraWorkspace,0!==n))},A().createElement(g.Suspense,{fallback:null},A().createElement(V.I18nextProvider,{i18n:window.i18next,defaultNS:e.moduleName},A().createElement(Ar,{workspaceInstance:e,additionalWorkspaceProps:s}))))}))),A().createElement(gv,{contextKey:a})),w&&A().createElement(g9,{name:h,isWithinWorkspace:!i,actionMenuProps:l}))}function Ar(e){var n,t=e.workspaceInstance,r=e.additionalWorkspaceProps,a=(0,V.useTranslation)().t,o=(0,v.qv)(),i=m9(),s=i.workspaceWindowState,l=i.workspaceGroup,c=null==l?void 0:l.name,u="maximized"===s;(0,g.useEffect)(function(){var e=a(t.title);e!==t.title&&t.setTitle(e)},[t.title,a,t.setTitle]);var d=(0,g.useContext)(v.zq).featureName,p=(0,g.useCallback)(function(){m6(u?"normal":"maximized")},[u]),f=(0,g.useMemo)(function(){return null!=t?t:{}},[t]),h=f.canHide,m=void 0!==h&&h,y=f.canMaximize,C=void 0!==y&&y,$=f.currentWorkspaceGroup,w=void 0===$?"":$,k=f.closeWorkspace,E=(0,g.useMemo)(function(){return An({},r,null==t?void 0:t.additionalProps)},[r,t]);return t&&A().createElement(A().Fragment,null,A().createElement(fN.Header,{"aria-label":(0,fI.V)("workspaceHeader","Workspace Header"),className:gN.header},!(0,v.xl)(o)&&!m&&A().createElement(fN.HeaderMenuButton,{"aria-label":(0,fI.V)("close","Close"),renderMenuIcon:A().createElement(cI,null),onClick:function(){return k()}}),A().createElement(fN.HeaderName,{prefix:""},null!=(n=t.titleNode)?n:a(t.title)),A().createElement("div",{className:gN.overlayHeaderSpacer}),A().createElement(fN.HeaderGlobalBar,{className:gN.headerButtons},A().createElement(v.W3,{name:"workspace-header-group-".concat(t.currentWorkspaceGroup,"-slot"),state:E}),A().createElement(v.W3,{name:"workspace-header-type-".concat(t.type,"-slot"),state:E}),A().createElement(v.W3,{name:"workspace-header-".concat(d,"-slot"),state:E}),(0,v.xl)(o)&&A().createElement(A().Fragment,null,(C||u)&&A().createElement(fN.HeaderGlobalAction,{"aria-label":u?(0,fI.V)("minimize","Minimize"):(0,fI.V)("maximize","Maximize"),onClick:p},u?A().createElement(gd,null):A().createElement(gp.hz,null)),m&&!c?A().createElement(fN.HeaderGlobalAction,{"aria-label":(0,fI.V)("hide","Hide"),onClick:function(){return m6("hidden")}},A().createElement(cF,null)):A().createElement(fN.HeaderGlobalAction,{"aria-label":(0,fI.V)("close","Close"),onClick:function(){return null==k?void 0:k()}},A().createElement(c1,null))),"tablet"===o&&m&&A().createElement(fN.HeaderGlobalAction,{"aria-label":(0,fI.V)("close","Close"),onClick:function(){return null==k?void 0:k()}},A().createElement(gf.d3,null)))),A().createElement("div",{className:b()(gN.workspaceContent,Ae({},gN.marginWorkspaceContent,!!w))},A().createElement(gJ,{key:t.name,workspace:t,additionalPropsFromPage:r})))}var Aa=t(19958),Ao={};Ao.styleTagTransform=T(),Ao.setAttributes=S(),Ao.insert=x().bind(null,"head"),Ao.domAPI=k(),Ao.insertStyleElement=B(),$()(Aa.A,Ao);let Ai=Aa.A&&Aa.A.locals?Aa.A.locals:void 0;function As(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function Al(e){if(Array.isArray(e))return e}function Ac(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Au(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function Ad(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ap(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){Ac(e,n,t[n])})}return e}function Af(e,n){if(null==e)return{};var t,r,a=A_(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function A_(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}function Ah(e,n){return Al(e)||Au(e,n)||Am(e,n)||Ad()}function Am(e,n){if(e){if("string"==typeof e)return As(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return As(e,n)}}var Ag=function(e){var n,t=e.snackbar,r=e.closeSnackbar,a=t.actionButtonLabel,o=void 0===a?"":a,i=t.kind,s=void 0===i?"success":i,l=t.onActionButtonClick,c=void 0===l?function(){}:l,u=t.isLowContrast,d=void 0===u?"error"!==s:u,p=t.progressActionLabel,f=t.subtitle,h=void 0===f?"":f,m=t.timeoutInMs,y=void 0===m?5e3:m,v=t.autoClose,C=void 0===v?"error"!==s:v,$=t.title,w=(t.id,Af(t,["actionButtonLabel","kind","onActionButtonClick","isLowContrast","progressActionLabel","subtitle","timeoutInMs","autoClose","title","id"])),k=Ah((0,g.useState)(o),2),E=k[0],x=k[1],D=Ah((0,g.useState)(!0),2),S=D[0],z=D[1],B=Ah((0,g.useState)(!1),2),M=B[0],T=B[1],O=(0,g.useCallback)(function(){setTimeout(r,250)},[r]),N=(0,g.useCallback)(function(){T(!0),O()},[O]),P=function(){c(),N(),p&&x(p)};return(0,g.useEffect)(function(){if(C){var e=setTimeout(N,y);return function(){return clearTimeout(e)}}},[y,C,N]),(0,g.useEffect)(function(){z(!1),window.setTimeout(function(){z(!0)},0)},[]),A().createElement(fN.ActionableNotification,Ap({actionButtonLabel:E,"aria-label":"Close snackbar",className:b()(Ai.slideIn,(Ac(n={},Ai.animated,S),Ac(n,Ai.slideOut,M),n)),inline:!0,kind:s,lowContrast:d,onActionButtonClick:P,onClose:O,statusIconDescription:"Snackbar notification",subtitle:h,title:$},w))};function AA(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function Ay(e){if(Array.isArray(e))return e}function Ab(e){if(Array.isArray(e))return AA(e)}function Av(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function AC(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function A$(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Aw(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ak(e,n){return Ay(e)||AC(e,n)||Ax(e,n)||A$()}function AE(e){return Ab(e)||Av(e)||Ax(e)||Aw()}function Ax(e,n){if(e){if("string"==typeof e)return AA(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return AA(e,n)}}let AD=function(e){var n=e.subject,t=Ak((0,g.useState)([]),2),r=t[0],a=t[1],o=(0,g.useCallback)(function(e){a(function(n){return n.filter(function(n){return n!==e})})},[]);return(0,g.useEffect)(function(){var e=n.subscribe(function(e){return a(function(n){return AE(n.filter(function(n){return n.subtitle!==e.subtitle||n.actionButtonLabel!==e.actionButtonLabel||n.onActionButtonClick!==e.onActionButtonClick||n.kind!==e.kind||n.title!==e.title})).concat([e])})});return function(){return e.unsubscribe()}},[n]),A().createElement(A().Fragment,null,r.map(function(e){return A().createElement(Ag,{key:e.id,snackbar:e,closeSnackbar:function(){return o(e)}})}))};function AS(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Az(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){AS(e,n,t[n])})}return e}function AB(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function AM(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}var AT=new fQ.B7,AO=0;function AN(e){e&&(0,_P.createRoot)(e).render(A().createElement(AD,{subject:AT}))}function AP(e){return"string"==typeof e&&e.trim().length>0}function AI(e){e&&AP(e.title)?setTimeout(function(){AT.next(AM(Az({},e),{id:AO++}))},0):console.error("showSnackbar must be called with an object having a 'title' property that is a non-empty string")}var AF=function(e){var n=e.children;return"tablet"===(0,v.qv)()?A().createElement(fN.Layer,null,n):A().createElement(A().Fragment,null,n)},AR=t(25391);let AH="react-avatar/",AL="failing",Aj=function(){try{return"localStorage"in window&&window.localStorage}catch(e){return!1}}();class Aq{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cachePrefix:n=AH,sourceTTL:t=6048e5,sourceSize:r=20}=e;this.cachePrefix=n,this.sourceTTL=t,this.sourceSize=r}set(e,n){if(Aj){n=JSON.stringify(n);try{localStorage.setItem(this.cachePrefix+e,n)}catch(e){console.error(e)}}}get(e){if(!Aj)return null;let n=localStorage.getItem(this.cachePrefix+e);return n?JSON.parse(n):null}sourceFailed(e){let n=this.get(AL)||[];return(n=n.filter(n=>{let t=n.expires>0&&n.expires<Date.now(),r=n===e||n.url==e;return!t&&!r})).unshift({url:e,expires:Date.now()+this.sourceTTL}),n=n.slice(0,this.sourceSize-1),this.set(AL,n)}hasSourceFailedBefore(e){return(this.get(AL)||[]).some(n=>{let t=n.expires>0&&n.expires<Date.now();return(n===e||n.url==e)&&!t})}}let AG=new Aq;var AV=t(93442),AU=t(39067),AW=t.n(AU),AK=t(18946);let AZ=t.n(AK)()(),AY=["#A62A21","#7e3794","#0B51C1","#3A6024","#A81563","#B3003C"],AJ=/^([-+]?(?:\d+(?:\.\d+)?|\.\d+))([a-z]{2,4}|%)?$/;function AX(e,n){let t=[...e].map(e=>e.charCodeAt(0)),r=t.length,a=r%(n-1)+1,o=t.reduce((e,n)=>e+n)%n,i=t[0]%n;for(let e=0;e<r;e++)i=(a*i+o)%n;return i}function AQ(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:AY;if(!e)return"transparent";let t=AX(e,n.length);return n[t]}function A0(e){e=""+e;let[,n=0,t="px"]=AJ.exec(e)||[];return{value:parseFloat(n),str:n+t,unit:t}}function A1(e){return e=isNaN((e=A0(e)).value)?512:"px"===e.unit?e.value:512*(0!==e.value),AZ&&(e*=2),e}function A2(e,n){let{maxInitials:t}=n;return e.split(/\s/).map(e=>e.substring(0,1).toUpperCase()).filter(e=>!!e).slice(0,t).join("").toUpperCase()}let A3={};function A4(e,n){if(A3[n])return void A3[n].push(e);let t=A3[n]=[e];setTimeout(()=>{delete A3[n],t.forEach(e=>e())},n)}function A5(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];for(let e of n){if(e||""===e)return e;if(!1===e||null===e)return null}}function A6(e){return!0===e?"100%":!1!==e?e:void 0}let A8={cache:AG,colors:AY,initials:A2,avatarRedirectUrl:null},A7=Object.keys(A8),A9=A().createContext&&A().createContext(),ye=!A9,yn=ye?null:A9.Consumer,yt=A().forwardRef||(e=>e);class yr extends A().Component{_getContext(){let e={};return A7.forEach(n=>{void 0!==this.props[n]&&(e[n]=this.props[n])}),e}render(){let{children:e}=this.props;return ye?A().Children.only(e):A().createElement(A9.Provider,{value:this._getContext()},A().Children.only(e))}}(0,AV.A)(yr,"displayName","ConfigProvider"),(0,AV.A)(yr,"propTypes",{cache:AW().object,colors:AW().arrayOf(AW().string),initials:AW().func,avatarRedirectUrl:AW().string,children:AW().node});let ya=e=>{function n(n,t){if(ye){let r=t&&t.reactAvatar;return A().createElement(e,(0,AR.A)({},A8,r,n))}return A().createElement(yn,null,r=>A().createElement(e,(0,AR.A)({ref:t},A8,r,n)))}return n.contextTypes=yr.childContextTypes,yt(n)};ye&&(yr.childContextTypes={reactAvatar:AW().object},yr.prototype.getChildContext=function(){return{reactAvatar:this._getContext()}});class yo{constructor(){this.sourcePointer=0,this.active=!0,this.fetch=null}isActive(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.internal===this&&!!this.fetch&&!0===this.active}}function yi(e,n,t){let{cache:r}=n,a=new e(n);if(!a.isCompatible(n))return t();a.get(e=>{!(e&&e.src&&r.hasSourceFailedBefore(e.src))&&e?t(e):t()})}function ys(e){let{sources:n=[]}=e,t=n.reduce((e,n)=>Object.assign(e,n.propTypes),{});class r extends g.PureComponent{constructor(e){super(e),(0,AV.A)(this,"_createFetcher",e=>t=>{let{cache:r}=this.props;if(!e.isActive(this.state))return;t&&"error"===t.type&&r.sourceFailed(t.target.src);let a=e.sourcePointer;if(n.length===a)return;let o=n[a];e.sourcePointer++,yi(o,this.props,n=>{if(!n)return setTimeout(e.fetch,0);e.isActive(this.state)&&(n={src:null,value:null,color:null,...n},this.setState(t=>e.isActive(t)?n:{}))})}),(0,AV.A)(this,"fetch",()=>{let e=new yo;e.fetch=this._createFetcher(e),this.setState({internal:e},e.fetch)}),this.state={internal:null,src:null,value:null,color:e.color}}componentDidMount(){this.fetch()}componentDidUpdate(e){let n=!1;for(let r in t)n=n||e[r]!==this.props[r];n&&setTimeout(this.fetch,0)}componentWillUnmount(){this.state.internal&&(this.state.internal.active=!1)}render(){let{children:e,propertyName:n}=this.props,{src:t,value:r,color:a,sourceName:o,internal:i}=this.state,s={src:t,value:r,color:a,sourceName:o,onRenderFailed:()=>i&&i.fetch()};if("function"==typeof e)return e(s);let l=A().Children.only(e);return A().cloneElement(l,{[n]:s})}}return(0,AV.A)(r,"displayName","AvatarDataProvider"),(0,AV.A)(r,"propTypes",{...t,cache:AW().object,propertyName:AW().string}),(0,AV.A)(r,"defaultProps",{propertyName:"avatar"}),(0,AV.A)(r,"Cache",Aq),(0,AV.A)(r,"ConfigProvider",yr),Object.assign(ya(r),{ConfigProvider:yr,Cache:Aq})}class yl extends A().PureComponent{render(){let{className:e,unstyled:n,round:t,style:r,avatar:a,onClick:o,children:i}=this.props,{sourceName:s}=a,l=A0(this.props.size),c=n?null:{display:"inline-block",verticalAlign:"middle",width:l.str,height:l.str,borderRadius:A6(t),fontFamily:"Helvetica, Arial, sans-serif",...r},u=[e,"sb-avatar"];if(s){let e=s.toLowerCase().replace(/[^a-z0-9-]+/g,"-").replace(/^-+|-+$/g,"");u.push("sb-avatar--"+e)}return A().createElement("div",{className:u.join(" "),onClick:o,style:c},i)}}(0,AV.A)(yl,"propTypes",{className:AW().string,round:AW().oneOfType([AW().bool,AW().string]),style:AW().object,size:AW().oneOfType([AW().number,AW().string]),unstyled:AW().bool,avatar:AW().object,onClick:AW().func,children:AW().node});class yc extends A().PureComponent{render(){let{className:e,round:n,unstyled:t,alt:r,title:a,name:o,value:i,avatar:s}=this.props,l=A0(this.props.size),c=t?null:{maxWidth:"100%",width:l.str,height:l.str,borderRadius:A6(n)};return A().createElement(yl,this.props,A().createElement("img",{className:e+" sb-avatar__image",width:l.str,height:l.str,style:c,src:s.src,alt:A5(r,o||i),title:A5(a,o||i),onError:s.onRenderFailed}))}}(0,AV.A)(yc,"propTypes",{alt:AW().oneOfType([AW().string,AW().bool]),title:AW().oneOfType([AW().string,AW().bool]),name:AW().string,value:AW().string,avatar:AW().object,className:AW().string,unstyled:AW().bool,round:AW().oneOfType([AW().bool,AW().string,AW().number]),size:AW().oneOfType([AW().number,AW().string])}),(0,AV.A)(yc,"defaultProps",{className:"",round:!1,size:100,unstyled:!1});class yu extends A().PureComponent{constructor(){var e;super(...arguments),e=this,(0,AV.A)(this,"_scaleTextNode",function(n){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,{unstyled:r,textSizeRatio:a,textMarginRatio:o,avatar:i}=e.props;if(e._node=n,!n||!n.parentNode||r||i.src||!e._mounted)return;let s=n.parentNode,l=s.parentNode,{width:c,height:u}=s.getBoundingClientRect();if(0==c&&0==u){let r=Math.min(1.5*t,500);A4(()=>e._scaleTextNode(n,r),r);return}if(!l.style.fontSize){let e=u/a;l.style.fontSize="".concat(e,"px")}s.style.fontSize=null;let{width:d}=n.getBoundingClientRect();if(d<0)return;let p=c*(1-2*o);d>p&&(s.style.fontSize="calc(1em * ".concat(p/d,")"))})}componentDidMount(){this._mounted=!0,this._scaleTextNode(this._node)}componentWillUnmount(){this._mounted=!1}render(){let{className:e,round:n,unstyled:t,title:r,name:a,value:o,avatar:i}=this.props,s=A0(this.props.size),l=t?null:{width:s.str,height:s.str,lineHeight:"initial",textAlign:"center",color:this.props.fgColor,background:i.color,borderRadius:A6(n)},c=t?null:{display:"table",tableLayout:"fixed",width:"100%",height:"100%"},u=t?null:{display:"table-cell",verticalAlign:"middle",fontSize:"100%",whiteSpace:"nowrap"},d=[i.value,this.props.size].join("");return A().createElement(yl,this.props,A().createElement("div",{className:e+" sb-avatar__text",style:l,title:A5(r,a||o)},A().createElement("div",{style:c},A().createElement("span",{style:u},A().createElement("span",{ref:this._scaleTextNode,key:d},i.value)))))}}function yd(e){let n=ys(e);return Object.assign(ya(A().forwardRef((e,t)=>A().createElement(n,(0,AR.A)({},e,{propertyName:"avatar"}),n=>{let r=n.src?yc:yu;return A().createElement(r,(0,AR.A)({},e,{avatar:n,ref:t}))}))),{getRandomColor:AQ,ConfigProvider:yr,Cache:Aq})}(0,AV.A)(yu,"propTypes",{name:AW().string,value:AW().string,avatar:AW().object,title:AW().oneOfType([AW().string,AW().bool]),className:AW().string,unstyled:AW().bool,fgColor:AW().string,textSizeRatio:AW().number,textMarginRatio:AW().number,round:AW().oneOfType([AW().bool,AW().string,AW().number]),size:AW().oneOfType([AW().number,AW().string])}),(0,AV.A)(yu,"defaultProps",{className:"",fgColor:"#FFF",round:!1,size:100,textSizeRatio:3,textMarginRatio:.15,unstyled:!1});var yp=t(89150),yf=t.n(yp);class y_{constructor(e){(0,AV.A)(this,"props",null),(0,AV.A)(this,"isCompatible",()=>!!this.props.email||!!this.props.md5Email),(0,AV.A)(this,"get",e=>{let{props:n}=this,t=n.md5Email||yf()(n.email),r=A1(n.size),a="https://secure.gravatar.com/avatar/".concat(t,"?d=404");r&&(a+="&s=".concat(r)),e({sourceName:"gravatar",src:a})}),this.props=e}}(0,AV.A)(y_,"propTypes",{email:AW().string,md5Email:AW().string});class yh{constructor(e){(0,AV.A)(this,"props",null),(0,AV.A)(this,"isCompatible",()=>!!this.props.facebookId),(0,AV.A)(this,"get",e=>{let{facebookId:n}=this.props,t=A1(this.props.size),r="https://graph.facebook.com/".concat(n,"/picture");t&&(r+="?width=".concat(t,"&height=").concat(t)),e({sourceName:"facebook",src:r})}),this.props=e}}(0,AV.A)(yh,"propTypes",{facebookId:AW().string});class ym{constructor(e){(0,AV.A)(this,"props",null),(0,AV.A)(this,"isCompatible",()=>!!this.props.githubHandle),(0,AV.A)(this,"get",e=>{let{githubHandle:n}=this.props,t=A1(this.props.size),r="https://avatars.githubusercontent.com/".concat(n,"?v=4");t&&(r+="&s=".concat(t)),e({sourceName:"github",src:r})}),this.props=e}}(0,AV.A)(ym,"propTypes",{githubHandle:AW().string});class yg{constructor(e){(0,AV.A)(this,"props",null),(0,AV.A)(this,"isCompatible",()=>!!this.props.skypeId),(0,AV.A)(this,"get",e=>{let{skypeId:n}=this.props;e({sourceName:"skype",src:"https://api.skype.com/users/".concat(n,"/profile/avatar")})}),this.props=e}}(0,AV.A)(yg,"propTypes",{skypeId:AW().string});class yA{constructor(e){(0,AV.A)(this,"props",null),(0,AV.A)(this,"isCompatible",()=>!!(this.props.name||this.props.value||this.props.email)),(0,AV.A)(this,"get",e=>{let n=this.getValue();if(!n)return e(null);e({sourceName:"text",value:n,color:this.getColor()})}),this.props=e}getInitials(){let{name:e,initials:n}=this.props;return"string"==typeof n?n:"function"==typeof n?n(e,this.props):A2(e,this.props)}getValue(){return this.props.name?this.getInitials():this.props.value?this.props.value:null}getColor(){let{color:e,colors:n,name:t,email:r,value:a}=this.props,o=t||r||a;return e||AQ(o,n)}}(0,AV.A)(yA,"propTypes",{color:AW().string,name:AW().string,value:AW().string,email:AW().string,maxInitials:AW().number,initials:AW().oneOfType([AW().string,AW().func])});class yy{constructor(e){(0,AV.A)(this,"props",null),(0,AV.A)(this,"isCompatible",()=>!!this.props.src),(0,AV.A)(this,"get",e=>{e({sourceName:"src",src:this.props.src})}),this.props=e}}(0,AV.A)(yy,"propTypes",{src:AW().string});class yb{constructor(e){(0,AV.A)(this,"props",null),(0,AV.A)(this,"icon","✷"),(0,AV.A)(this,"isCompatible",()=>!0),(0,AV.A)(this,"get",e=>{let{color:n,colors:t}=this.props;e({sourceName:"icon",value:this.icon,color:n||AQ(this.icon,t)})}),this.props=e}}function yv(e,n){var t;return t=class{constructor(t){(0,AV.A)(this,"props",null),(0,AV.A)(this,"isCompatible",()=>!!this.props.avatarRedirectUrl&&!!this.props[n]),(0,AV.A)(this,"get",t=>{let{avatarRedirectUrl:r}=this.props,a=A1(this.props.size),o=r.replace(/\/*$/,"/"),i=this.props[n],s=a?"size=".concat(a):"",l="".concat(o).concat(e,"/").concat(i,"?").concat(s);t({sourceName:e,src:l})}),this.props=t}},(0,AV.A)(t,"propTypes",{[n]:AW().oneOfType([AW().string,AW().number])}),t}(0,AV.A)(yb,"propTypes",{color:AW().string});let yC=yv("twitter","twitterHandle"),y$=yv("vkontakte","vkontakteId"),yw=yv("instagram","instagramId"),yk=yd({sources:[yh,yv("google","googleId"),ym,yC,yw,y$,yg,y_,yy,yA,yb]});var yE=t(35570),yx=t.n(yE),yD=t(13624);function yS(e){var n,t,r,a=(0,v.UK)({externalModuleName:"@openmrs/esm-styleguide"}).patientPhotoConceptUuid,o=a?"".concat(fX.Jj,"/obs?patient=").concat(e,"&concept=").concat(a,"&v=full"):null,i=(0,yD.Ay)(e?o:null,fX.lo),s=i.data,l=i.error,c=i.isLoading,u=null==s||null==(n=s.data)?void 0:n.results[0];return{data:u?{dateTime:null==u?void 0:u.obsDatetime,imageSrc:null==u||null==(r=u.value)||null==(t=r.links)?void 0:t.uri}:null,error:l,isLoading:c}}let yz=function(e){var n=e.width,t=void 0===n?56:n,r=e.height,a=void 0===r?56:r,o=(0,V.useTranslation)().t;return A().createElement("svg",{"aria-label":o("patientPhotoPlaceholder","Patient photo placeholder"),width:t,height:a,fill:"none",xmlns:"http://www.w3.org/2000/svg"},A().createElement("path",{fill:"#ffffff",d:"M0 0h56v56H0z"}),A().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m36.75 20.134-.884-.884L19.25 35.866l.884.884 1.25-1.25H34.25a1.252 1.252 0 0 0 1.25-1.25V21.384l1.25-1.25Zm-2.5 14.116H22.634l4.87-4.87 1.487 1.486a1.25 1.25 0 0 0 1.768 0l.991-.991 2.5 2.498v1.877Zm0-3.645-1.616-1.616a1.25 1.25 0 0 0-1.768 0l-.991.991-1.486-1.486 5.861-5.86v7.971Zm-12.5 1.145v-1.875l3.125-3.123.858.859.885-.885-.86-.86a1.25 1.25 0 0 0-1.767 0l-2.241 2.242V21.75h10V20.5h-10c-.69 0-1.25.56-1.25 1.25v10h1.25Z",fill:"#8D8D8D"}))};var yB=t(27069),yM={};yM.styleTagTransform=T(),yM.setAttributes=S(),yM.insert=x().bind(null,"head"),yM.domAPI=k(),yM.insertStyleElement=B(),$()(yB.A,yM);let yT=yB.A&&yB.A.locals?yB.A.locals:void 0;function yO(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function yN(e){if(Array.isArray(e))return e}function yP(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function yI(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function yF(e,n){return yN(e)||yP(e,n)||yR(e,n)||yI()}function yR(e,n){if(e){if("string"==typeof e)return yO(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return yO(e,n)}}function yH(e){var n=e.patientUuid,t=e.patientName,r=(0,V.useTranslation)().t,a=yS(n),o=a.data,i=a.isLoading,s=yF((0,g.useState)(null),2),l=s[0],c=s[1],u=(0,g.useMemo)(function(){return yx().generate(n)},[n]);(0,g.useEffect)(function(){if(null==o?void 0:o.imageSrc){var e=new Image;e.onload=function(){return c(o.imageSrc)},e.onerror=function(){return c(null)},e.src=o.imageSrc}},[null==o?void 0:o.imageSrc]);var d=r("avatarAltText","Profile photo unavailable - grey placeholder image");return i?A().createElement(fN.SkeletonIcon,{className:yT.skeleton,"data-testid":"skeleton-icon"}):(null==o?void 0:o.imageSrc)&&!l?A().createElement(yz,null):A().createElement(yk,{alt:d,color:"rgba(0,0,0,0)",maxInitials:3,name:t,size:"56",src:null!=l?l:void 0,style:l?void 0:{backgroundImage:u.toDataUrl(),backgroundRepeat:"round"},textSizeRatio:2})}var yL=t(6293),yj={};yj.styleTagTransform=T(),yj.setAttributes=S(),yj.insert=x().bind(null,"head"),yj.domAPI=k(),yj.insertStyleElement=B(),$()(yL.A,yj);let yq=yL.A&&yL.A.locals?yL.A.locals:void 0;function yG(e,n){if(null==e)return{};var t,r,a=yV(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function yV(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}var yU=["omrs-pict-appointments","omrs-pict-assessment-1","omrs-pict-assessment-2","omrs-pict-blood-bank","omrs-pict-cardiology","omrs-pict-ct-scan","omrs-pict-dentistry","omrs-pict-emergency-department","omrs-pict-facility","omrs-pict-geriatrics","omrs-pict-gynaecology","omrs-pict-in-patient","omrs-pict-laboratory","omrs-pict-labs-2","omrs-pict-obstetrics","omrs-pict-patient-search","omrs-pict-patients","omrs-pict-payments-desk","omrs-pict-pharmacy","omrs-pict-pharmacy-2","omrs-pict-registration","omrs-pict-service-queues","omrs-pict-stock-management","omrs-pict-transfer","omrs-pict-triage","omrs-pict-x-ray"],yW=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-appointments",pictogramProps:e})})),yK=yW,yZ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-assessment-1",pictogramProps:e})})),yY=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-assessment-2",pictogramProps:e})})),yJ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-blood-bank",pictogramProps:e})})),yX=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-cardiology",pictogramProps:e})})),yQ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-ct-scan",pictogramProps:e})})),y0=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-dentistry",pictogramProps:e})})),y1=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-emergency-department",pictogramProps:e})})),y2=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-facility",pictogramProps:e})})),y3=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-geriatrics",pictogramProps:e})})),y4=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-gynaecology",pictogramProps:e})})),y5=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-in-patient",pictogramProps:e})})),y6=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-laboratory",pictogramProps:e})})),y8=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-labs-2",pictogramProps:e})})),y7=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-obstetrics",pictogramProps:e})})),y9=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-patient-search",pictogramProps:e})})),be=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-patients",pictogramProps:e})})),bn=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-payments-desk",pictogramProps:e})})),bt=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-pharmacy",pictogramProps:e})})),br=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-pharmacy-2",pictogramProps:e})})),ba=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-registration",pictogramProps:e})})),bo=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-service-queues",pictogramProps:e})})),bi=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-stock-management",pictogramProps:e})})),bs=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-transfer",pictogramProps:e})})),bl=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-triage",pictogramProps:e})})),bc=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-x-ray",pictogramProps:e})})),bu=y2,bd=be,bp=(0,g.memo)((0,g.forwardRef)(function(e,n){var t=e.pictogram,r=e.fallback,a=yG(e,["pictogram","fallback"]),o=(0,g.useRef)(document.getElementById(t));return(0,g.useEffect)(function(){var e=document.getElementById("omrs-svgs-container"),n=new MutationObserver(function(e){var n=!0,r=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var l=i.value;"childList"===l.type&&(o.current=document.getElementById(t))}}catch(e){r=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw a}}});return e&&n.observe(e,{childList:!0}),function(){return n.disconnect()}},[t]),A().createElement(v.fS,{value:o.current,fallback:r},A().createElement(bf,{ref:n,pictogram:t,pictogramProps:a}))})),bf=(0,g.memo)((0,g.forwardRef)(function(e,n){var t=e.pictogram,r=Object.assign({},{size:92},e.pictogramProps),a=r.className,o=r.size;return(o<=26||o>144)&&(console.error("Invalid size '".concat(o,"' specified for ").concat(t,". Defaulting to 92.")),o=92),A().createElement("svg",{ref:n,className:b()(yq.pictogram,a),height:o,width:o},A().createElement("use",{href:"#".concat(t)}))})),b_=t(98872),bh={};bh.styleTagTransform=T(),bh.setAttributes=S(),bh.insert=x().bind(null,"head"),bh.domAPI=k(),bh.insertStyleElement=B(),$()(b_.A,bh);let bm=b_.A&&b_.A.locals?b_.A.locals:void 0;var bg=t(99780);function bA(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function by(e){if(Array.isArray(e))return bA(e)}function bb(e,n,t,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){t(e);return}s.done?n(l):Promise.resolve(l).then(r,a)}function bv(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function i(e){bb(o,r,a,i,s,"next",e)}function s(e){bb(o,r,a,i,s,"throw",e)}i(void 0)})}}function bC(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function b$(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function bw(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function bk(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){bC(e,n,t[n])})}return e}function bE(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function bx(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function bD(e){return by(e)||b$(e)||bS(e)||bw()}function bS(e,n){if(e){if("string"==typeof e)return bA(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return bA(e,n)}}function bz(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(n){return l([e,n])}}function l(s){if(t)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],r=0}finally{t=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function bB(e,n){return bv(function(){var t;return bz(this,function(r){switch(r.label){case 0:if(!(t=hs.J_.getState().openedGroup))return[3,3];if(!(t.groupName!==e||!bO(t.props,n)))return[3,2];return[4,bN({reason:"CLOSE_WORKSPACE_GROUP",explicit:!1})];case 1:if(!r.sent())return[2,!1];return[3,3];case 2:return[2,!0];case 3:return hs.J_.setState(function(t){return bx(bk({},t),{openedGroup:{groupName:e,props:n},openedWindows:[]})}),[2,!0]}})})()}function bM(e){return bv(function(){var n,t,r,a;return bz(this,function(o){switch(o.label){case 0:if(t=(n=hs.J_.getState()).openedGroup,r=n.openedWindows,!t)return[3,4];if(!(r.length>0))return[3,3];if(a=e)return[3,2];return[4,bN({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})];case 1:a=o.sent(),o.label=2;case 2:if(!a)return[2,!1];o.label=3;case 3:return hs.J_.setState(function(e){return bx(bk({},e),{openedGroup:null,openedWindows:[]})}),[2,!0];case 4:return[2,!0]}})})()}function bT(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return bv(function(){var a,o,i,s,l,c,u,d,p,f,h,m,g,A,y,b,v,C,$;return bz(this,function(w){switch(w.label){case 0:if(!(a=hs.J_.getState()).registeredWorkspacesByName[e])throw Error("Unable to launch workspace ".concat(e,". Workspace is not registered"));if(!(o=(0,hs.Ml)(e)))throw Error("Unable to launch workspace ".concat(e,". Workspace is not registered to a workspace window"));if(i=a.openedGroup,s=o.name,!(l=(0,hs.o1)(s)))throw Error("Unable to launch workspace ".concat(e,". Workspace window ").concat(o.name," is not registered to a workspace group"));if(u=(c=(0,hs.YX)(e))>=0,!(i&&(i.groupName!==l.name||!bO(i.props,r))))return[3,2];return[4,bN({reason:"CLOSE_WORKSPACE_GROUP",explicit:!1})];case 1:if(w.sent())return hs.J_.setState(bx(bk({},a),{openedGroup:{groupName:l.name,props:r},openedWindows:[{windowName:s,openedWorkspaces:[bF(e,n)],props:t,maximized:!1,hidden:!1}]})),[2,!0];return[2,!1];case 2:if(!u)return[3,9];if(p=a.openedWindows[c],h=null!=(f=null==(d=a.openedGroup)?void 0:d.props)?f:{},m=p.openedWorkspaces,!bO(p.props,t))return[3,6];if(!((g=m.find(function(n){return n.workspaceName===e}))&&bO(g.props,n)))return[3,3];return(p.hidden||c!==a.openedWindows.length-1)&&hs.J_.setState(bP.restoreWindow(a,s)),[2,!0];case 3:return[4,bN({reason:"CLOSE_WORKSPACE",explicit:!1,windowName:s,workspaceName:e})];case 4:if(w.sent())return hs.J_.setState(bx(bk({},a),{openedGroup:{groupName:l.name,props:null!=(y=null==a||null==(A=a.openedGroup)?void 0:A.props)?y:h},openedWindows:bD(a.openedWindows.filter(function(e,n){return n!==c})).concat([{windowName:s,openedWorkspaces:[bF(e,n)],props:null!=(b=null==p?void 0:p.props)?b:t,maximized:!1,hidden:!1}])})),[2,!0];return[2,!1];case 5:return[3,8];case 6:return[4,bN({reason:"CLOSE_WINDOW",explicit:!1,windowName:s})];case 7:if(w.sent())return hs.J_.setState(bx(bk({},a),{openedGroup:{groupName:l.name,props:null!=h?h:null==a||null==(v=a.openedGroup)?void 0:v.props},openedWindows:bD(a.openedWindows.filter(function(e,n){return n!==c})).concat([{windowName:s,openedWorkspaces:[bF(e,n)],props:t,maximized:!1,hidden:!1}])})),[2,!0];return[2,!1];case 8:return[3,10];case 9:return hs.J_.setState(bx(bk({},a),{openedGroup:{groupName:l.name,props:null!=($=null!=r?r:null==a||null==(C=a.openedGroup)?void 0:C.props)?$:null},openedWindows:bD(a.openedWindows).concat([{windowName:s,openedWorkspaces:[bF(e,n)],props:t,maximized:!1,hidden:!1}])})),[2,!0];case 10:return[2]}})})()}function bO(e,n){return null==e||null==n||(0,W.b)(e,n)}function bN(e){function n(n,t){for(var r=[],a=n.openedWorkspaces.length-1;a>=0;a--){var o=n.openedWorkspaces[a];if((o.hasUnsavedChanges||!e.explicit)&&r.push(o),t&&o.workspaceName===t)break}return r}var t=hs.J_.getState(),r=t.openedWindows,a=t.workspaceTitleByWorkspaceName,o=[];switch(e.reason){case"CLOSE_WORKSPACE_GROUP":o=r.flatMap(function(e){return n(e)});break;case"CLOSE_WINDOW":var i=r.find(function(n){return n.windowName===e.windowName});if(!i)throw Error("Window ".concat(e.windowName," not found in opened windows."));o=n(i);break;case"CLOSE_WORKSPACE":var s=r.find(function(n){return n.windowName===e.windowName});if(!s)throw Error("Window ".concat(e.windowName," not found in opened windows."));o=n(s,e.workspaceName)}return 0===o.length?Promise.resolve(!0):new Promise(function(e){var n=hI("workspace2-close-prompt",{onConfirm:function(){n(),e(!0)},onCancel:function(){n(),e(!1)},affectedWorkspaceTitles:o.map(function(e){return a[e.workspaceName]})})})}var bP={setWindowMaximized:function(e,n,t){var r=e.openedWindows.findIndex(function(e){return e.windowName===n}),a=bD(e.openedWindows),o=bx(bk({},a[r]),{maximized:t});return a[r]=o,bx(bk({},e),{openedWindows:a})},hideWindow:function(e,n){var t=e.openedWindows.findIndex(function(e){return e.windowName===n}),r=bD(e.openedWindows),a=bx(bk({},r[t]),{hidden:!0});return r[t]=a,bx(bk({},e),{openedWindows:r})},restoreWindow:function(e,n){var t=e.openedWindows.findIndex(function(e){return e.windowName===n}),r=bx(bk({},e.openedWindows[t]),{hidden:!1}),a=bD(e.openedWindows.filter(function(e,n){return n!==t})).concat([r]);return bx(bk({},e),{openedWindows:a})},closeWorkspace:function(e,n){var t=(0,hs.YX)(n);if(t<0)return e;var r=bk({},e.openedWindows[t]),a=r.openedWorkspaces.findIndex(function(e){return e.workspaceName===n}),o=bD(e.openedWindows);return r.openedWorkspaces=r.openedWorkspaces.slice(0,a),0===r.openedWorkspaces.length?o.splice(t,1):o[t]=r,bx(bk({},e),{openedWindows:o})},openChildWorkspace:function(e,n,t,r){var a=e.registeredWorkspacesByName[t];if(!a)throw Error('No workspace named "'.concat(t,'" registered'));var o=e.registeredWorkspacesByName[n];if(!o)throw Error('No workspace named "'.concat(n,'" registered'));if(o.window!==a.window)throw Error("Child workspace ".concat(t," does not belong to the same workspace window as parent workspace ").concat(n));var i=e.openedWindows.findIndex(function(e){return e.windowName===a.window});if(-1==i)throw Error("Cannot open child workspace ".concat(t," as window ").concat(a.window," is not opened"));var s=e.openedWindows[i].openedWorkspaces;if(s[s.length-1].workspaceName!==n)throw Error("Cannot open child workspace ".concat(t," from parent workspace ").concat(n," as the parent is not the most recently opened workspace within the workspace window"));return{openedWindows:e.openedWindows.map(function(e,n){return n==i?bx(bk({},e),{openedWorkspaces:bD(e.openedWorkspaces).concat([bF(t,r)])}):e})}},setHasUnsavedChanges:function(e,n,t){var r=(0,hs.YX)(n);if(r<0)return e;var a=bk({},e.openedWindows[r]),o=a.openedWorkspaces.findIndex(function(e){return e.workspaceName===n});if(o<0)return e;a.openedWorkspaces[o]=bx(bk({},a.openedWorkspaces[o]),{hasUnsavedChanges:t});var i=bD(e.openedWindows);return i[r]=a,bx(bk({},e),{openedWindows:i})},setWorkspaceTitle:function(e,n,t){var r=bk({},e.workspaceTitleByWorkspaceName);return null===t?delete r[n]:r[n]=t,bx(bk({},e),{workspaceTitleByWorkspaceName:r})}};function bI(){return(0,v.mQ)(hs.J_,bP)}function bF(e,n){return{workspaceName:e,props:null!=n?n:{},hasUnsavedChanges:!1,uuid:(0,bg.A)()}}function bR(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var bH=function(e){var n,t,r,a,o=e.title,i=e.children,s=e.hasUnsavedChanges,l=(0,v.qv)(),c=bI(),u=c.setWindowMaximized,d=c.hideWindow,p=c.closeWorkspace,f=c.setHasUnsavedChanges,h=c.openedWindows,m=c.openedGroup,y=c.registeredGroupsByName,C=c.registeredWindowsByName,$=c.registeredWorkspacesByName,w=c.workspaceTitleByWorkspaceName,k=c.setWorkspaceTitle,E=(0,g.useContext)(gC.i),x=E.workspaceName,D=E.isRootWorkspace,S=E.isLeafWorkspace,z=(0,hs.YX)(x),B=h[z],M=null==B?void 0:B.openedWorkspaces.find(function(e){return e.workspaceName===x});if((0,g.useEffect)(function(){(null==M?void 0:M.hasUnsavedChanges)!=s&&f(x,null!=s&&s)},[M,s]),(0,g.useEffect)(function(){w[x]!==o&&k(x,o)},[M,o]),z<0||null==m||null==M)return null;if(!y[m.groupName])throw Error("Cannot find registered workspace group ".concat(m.groupName));var T=$[x].window,O=C[T];if(!O)throw Error("Cannot find registered workspace window ".concat(T));var N=O.canHide,P=O.canMaximize,I=B.maximized,F=null!=(n=null==O?void 0:O.width)?n:"narrow";return A().createElement("div",{className:b()(bm.workspaceOuterContainer,(bR(t={},bm.narrowWorkspace,"narrow"===F),bR(t,bm.widerWorkspace,"wider"===F),bR(t,bm.extraWideWorkspace,"extra-wide"===F),t))},A().createElement("div",{className:b()(bm.workspaceSpacer,bR({},bm.hidden,B.hidden))}),A().createElement("div",{className:b()(bm.workspaceMiddleContainer,(bR(r={},bm.maximized,I),bR(r,bm.hidden,B.hidden),r))},A().createElement("div",{className:b()(bm.workspaceInnerContainer,(bR(a={},bm.maximized,I),bR(a,bm.hidden,B.hidden),bR(a,bm.isRootWorkspace,D),a))},S&&A().createElement(A().Fragment,null,A().createElement(fN.Header,{"aria-label":(0,fI.V)("workspaceHeader"),className:bm.header},!(0,v.xl)(l)&&!N&&A().createElement(fN.HeaderMenuButton,{"aria-label":(0,fI.V)("close"),renderMenuIcon:A().createElement(cI,null),onClick:function(){return p(x)}}),A().createElement(fN.HeaderName,{prefix:""},o),A().createElement("div",{className:bm.overlayHeaderSpacer}),A().createElement(fN.HeaderGlobalBar,{className:bm.headerButtons},(0,v.xl)(l)&&A().createElement(A().Fragment,null,(P||I)&&A().createElement(fN.HeaderGlobalAction,{"aria-label":I?(0,fI.V)("minimize"):(0,fI.V)("maximize"),onClick:function(){return u(T,!I)}},I?A().createElement(gd,null):A().createElement(gp.hz,null)),N?A().createElement(fN.HeaderGlobalAction,{"aria-label":(0,fI.V)("hide"),onClick:function(){return d(T)}},A().createElement(cF,null)):A().createElement(fN.HeaderGlobalAction,{"aria-label":(0,fI.V)("close"),onClick:function(){return p(x)}},A().createElement(c1,null))),"tablet"===l&&N&&A().createElement(fN.HeaderGlobalAction,{"aria-label":(0,fI.V)("close"),onClick:function(){return p(x)}},A().createElement(gf.d3,null)))),A().createElement("div",{className:b()(bm.workspaceContent)},i)))))},bL=t(64429),bj={};bj.styleTagTransform=T(),bj.setAttributes=S(),bj.insert=x().bind(null,"head"),bj.domAPI=k(),bj.insertStyleElement=B(),$()(bL.A,bj);let bq=bL.A&&bL.A.locals?bL.A.locals:void 0;function bG(e,n,t,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){t(e);return}s.done?n(l):Promise.resolve(l).then(r,a)}function bV(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function i(e){bG(o,r,a,i,s,"next",e)}function s(e){bG(o,r,a,i,s,"throw",e)}i(void 0)})}}function bU(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function bW(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(n){return l([e,n])}}function l(s){if(t)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],r=0}finally{t=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function bK(e){var n=e.getIcon,t=e.isWindowHidden,r=e.tagContent;return A().createElement(A().Fragment,null,n({size:16}),t?A().createElement("span",{className:bq.interruptedTag},"!"):A().createElement("span",{className:bq.countTag},r))}var bZ=function(e){var n,t,r=e.icon,a=e.label,o=e.tagContent,i=e.workspaceToLaunch,s=e.onBeforeWorkspaceLaunch,l=(0,v.qv)(),c=bI(),u=c.openedWindows,d=c.restoreWindow,p=(0,g.useContext)(gC.i).windowName,f=u.find(function(e){return e.windowName===p}),h=null!=f,m=null!=(n=null==f?void 0:f.hidden)&&n,y=bY(u,f),C=function(){return bV(function(){var e,n;return bW(this,function(t){switch(t.label){case 0:if(!h)return[3,1];return y||d(f.windowName),[3,3];case 1:return[4,null==(e=null==s?void 0:s())||e];case 2:t.sent()&&(n=i.workspaceName,bT(n,i.workspaceProps,i.windowProps)),t.label=3;case 3:return[2]}})})()};return"tablet"===l||"phone"===l?A().createElement(fN.Button,{className:b()(bq.container,bU({},bq.active,h)),iconDescription:a,kind:"ghost",onClick:C,role:"button",tabIndex:0,size:"md"},A().createElement("span",{className:bq.elementContainer},A().createElement(bK,{isWindowHidden:m,getIcon:r,tagContent:o})),A().createElement("span",null,a)):A().createElement(fN.IconButton,{align:"left","aria-label":a,className:b()(bq.container,(bU(t={},bq.active,h),bU(t,bq.focused,y),t)),enterDelayMs:300,kind:"ghost",label:a,onClick:C,size:"md"},A().createElement("div",{className:bq.elementContainer},A().createElement(bK,{isWindowHidden:m,getIcon:r,tagContent:o})))};function bY(e,n){for(var t=e.length-1;t>=0;t--){var r=e[t];if(!r.hidden)return r.windowName===(null==n?void 0:n.windowName)}return!1}function bJ(e){var n=e.showContactDetails,t=e.toggleContactDetails,r=e.className;return A().createElement(fN.Button,{className:r,iconDescription:"Toggle contact details",kind:"ghost",onClick:t,renderIcon:n?c0:cJ},n?(0,fI.V)("showLess","Show less"):(0,fI.V)("showMore","Show more"))}var bX="custom:(uuid,display,identifiers:(identifier,uuid,preferred,location:(uuid,name),identifierType:(uuid,name,format,formatDescription,validator)),person:(uuid,display,gender,birthdate,dead,age,deathDate,birthdateEstimated,causeOfDeath,preferredName:(uuid,preferred,givenName,middleName,familyName),attributes,preferredAddress:(uuid,preferred,address1,address2,cityVillage,longitude,stateProvince,latitude,country,postalCode,countyDistrict,address3,address4,address5,address6,address7)))",bQ=function(e){var n,t=fZ()("".concat(fX.Jj,"/patient/").concat(e,"?v=").concat(bX),fX.lo),r=t.data,a=t.error;return{isLoading:t.isLoading,attributes:null!=(n=null==r?void 0:r.data.person.attributes)?n:[],error:a}},b0=function(e){var n=(0,v.UK)({externalModuleName:"@openmrs/esm-patient-banner-app"}).contactAttributeTypes,t=void 0===n?[]:n,r=bQ(e),a=r.attributes,o=r.error,i=r.isLoading;return{contactAttributes:(0,g.useMemo)(function(){return a.filter(function(e){var n=e.attributeType;return null==t?void 0:t.some(function(e){return n.uuid===e})})},[a,t]),isLoading:i,error:o}};function b1(e){var n,t="custom:(uuid,patient:ref,cohort:(uuid,name,startDate,endDate))",r=e?"".concat(fX.Jj,"/cohortm/cohortmember?patient=").concat(e,"&v=").concat(t):null,a=(0,yD.Ay)(r,fX.lo),o=a.data,i=a.isLoading,s=null==o||null==(n=o.data)?void 0:n.results.map(function(e){return{uuid:e.cohort.uuid,name:e.cohort.name,startDate:e.cohort.startDate,endDate:e.cohort.endDate}});return(0,g.useMemo)(function(){return{cohorts:s,isLoading:i}},[i,s])}var b2="custom:(display,uuid,personA:(age,display,birthdate,uuid),personB:(age,display,birthdate,uuid),relationshipType:(uuid,display,description,aIsToB,bIsToA))";function b3(e){var n,t,r="".concat(fX.Jj,"/relationship?v=").concat(b2,"&person=").concat(e),a=(0,yD.Ay)(e?r:null,fX.lo),o=a.data,i=a.error,s=a.isLoading,l=a.isValidating,c=(null==o||null==(t=o.data)||null==(n=t.results)?void 0:n.length)?b4(e,o.data.results):null;return{data:o?c:null,error:i,isLoading:s,isValidating:l}}function b4(e,n){var t=[],r=!0,a=!1,o=void 0;try{for(var i,s=n[Symbol.iterator]();!(r=(i=s.next()).done);r=!0){var l=i.value;e===l.personA.uuid?t.push({uuid:"".concat(l.uuid),display:l.personB.display,relativeAge:l.personB.age,relativeUuid:l.personB.uuid,relationshipType:l.relationshipType.bIsToA}):t.push({uuid:"".concat(l.uuid),display:l.personA.display,relativeAge:l.personA.age,relativeUuid:l.personA.uuid,relationshipType:l.relationshipType.aIsToB})}}catch(e){a=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return t}var b5=t(64197),b6={};b6.styleTagTransform=T(),b6.setAttributes=S(),b6.insert=x().bind(null,"head"),b6.domAPI=k(),b6.insertStyleElement=B(),$()(b5.A,b6);let b8=b5.A&&b5.A.locals?b5.A.locals:void 0;function b7(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function b9(e){if(Array.isArray(e))return e}function ve(e){if(Array.isArray(e))return b7(e)}function vn(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function vt(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function vr(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function va(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function vo(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function vi(e,n){return b9(e)||vr(e,n)||vl(e,n)||va()}function vs(e){return ve(e)||vt(e)||vl(e)||vo()}function vl(e,n){if(e){if("string"==typeof e)return b7(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return b7(e,n)}}var vc=function(e){var n,t=b1(e.patientUuid),r=t.cohorts,a=void 0===r?[]:r,o=t.isLoading;return A().createElement(A().Fragment,null,A().createElement("p",{className:b8.heading},(0,fI.V)("patientLists","Patient Lists")," (",null!=(n=null==a?void 0:a.length)?n:0,")"),o?A().createElement(fN.InlineLoading,{description:"".concat((0,fI.V)("loading","Loading")," ..."),role:"progressbar"}):A().createElement("ul",null,function(){if((null==a?void 0:a.length)>0){var e=a.sort(function(e,n){return(0,cx._U)(null==e?void 0:e.startDate).getTime()-(0,cx._U)(null==n?void 0:n.startDate).getTime()}).slice(0,3);return null==e?void 0:e.map(function(e){return A().createElement("li",{key:e.uuid},A().createElement(v.i_,{to:"".concat(window.spaBase,"/home/patient-lists/").concat(e.uuid),key:e.uuid},e.name))})}return A().createElement("li",null,"--")}(),a.length>3&&A().createElement("li",{className:b8.link},A().createElement(v.i_,{to:"".concat(window.spaBase,"/home/patient-lists")},(0,fI.V)("seeMoreLists","See {{count}} more lists",{count:(null==a?void 0:a.length)-3})))))},vu=function(e){var n,t=e.patientId,r=(0,v.tQ)(t),a=r.patient,o=r.isLoading,i=null==a||null==(n=a.address)?void 0:n.find(function(e){return"home"===e.use}),s=function(e){return e.split("#")[1]};return o?A().createElement(fN.InlineLoading,{description:"".concat((0,fI.V)("loading","Loading")," ..."),role:"progressbar"}):A().createElement(A().Fragment,null,A().createElement("p",{className:b8.heading},(0,fI.V)("address","Address")),A().createElement("ul",null,i?Object.entries(i).filter(function(e){var n=vi(e,1)[0];return"id"!==n&&"use"!==n}).map(function(e){var n,t,r,a=vi(e,2),o=a[0],l=a[1];return"extension"===o?null==(r=i.extension)||null==(t=r[0])||null==(n=t.extension)?void 0:n.map(function(e,n){return A().createElement("li",{key:"address-".concat(o,"-").concat(n)},(0,fI.V)(s(e.url),s(e.url)),": ",e.valueString)}):A().createElement("li",{key:"address-".concat(o)},(0,fI.V)(o,o),": ",l)}):A().createElement("li",null,"--")))},vd=function(e){var n=b0(e.patientUuid),t=n.isLoading,r=n.contactAttributes,a=(0,g.useMemo)(function(){return r?vs(null==r?void 0:r.map(function(e){return[e.attributeType.display?(0,fI.V)(e.attributeType.display,e.attributeType.display):"",e.value]})):[]},[r]);return A().createElement(A().Fragment,null,A().createElement("p",{className:b8.heading},(0,fI.V)("contactDetails","Contact Details")),t?A().createElement(fN.InlineLoading,{description:"".concat((0,fI.V)("loading","Loading")," ..."),role:"progressbar"}):A().createElement("ul",null,a.length?a.map(function(e,n){var t=vi(e,2),r=t[0],a=t[1];return A().createElement("li",{key:"".concat(r,"-").concat(a,"-").concat(n)},r,": ",a)}):A().createElement("li",null,"--")))},vp=function(e){var n=b3(e.patientId),t=n.data,r=n.isLoading;return A().createElement(A().Fragment,null,A().createElement("p",{className:b8.heading},(0,fI.V)("relationships","Relationships")),r?A().createElement(fN.InlineLoading,{description:"".concat((0,fI.V)("loading","Loading")," ..."),role:"progressbar"}):A().createElement("ul",null,t&&t.length>0?A().createElement(A().Fragment,null,t.map(function(e){return A().createElement("li",{key:e.uuid,className:b8.relationship},A().createElement("div",null,A().createElement(v.i_,{to:"".concat(window.spaBase,"/patient/").concat(e.relativeUuid,"/chart")},e.display)),A().createElement("div",null,e.relationshipType),A().createElement("div",null,"".concat(e.relativeAge?e.relativeAge:"--"," ").concat(e.relativeAge?1===e.relativeAge?"yr":"yrs":"")))})):A().createElement("li",null,"--")))};function vf(e){var n=e.patientId,t=e.deceased;return A().createElement("div",{className:b()(b8.contactDetails,vn({},b8.deceased,t))},A().createElement("div",{className:b8.row},A().createElement("div",{className:b8.col},A().createElement(vu,{patientId:n})),A().createElement("div",{className:b8.col},A().createElement(vd,{patientUuid:n}))),A().createElement("div",{className:b8.row},A().createElement("div",{className:b8.col},A().createElement(vp,{patientId:n})),A().createElement("div",{className:b8.col},A().createElement(vc,{patientUuid:n}))))}function v_(e){var n=document.querySelector("template#loading-spinner");if(n){var t=n.content.cloneNode(!0),r=Array.prototype.map.call(t.childNodes,function(e){return e});return e.appendChild(t),function(){return r.forEach(function(e){return e.remove()})}}return function(){}}var vh=t(20186),vm=t(15626),vg={};vg.styleTagTransform=T(),vg.setAttributes=S(),vg.insert=x().bind(null,"head"),vg.domAPI=k(),vg.insertStyleElement=B(),$()(vm.A,vg);let vA=vm.A&&vm.A.locals?vm.A.locals:void 0;function vy(e){var n=e.workspaceGroup,t=bI().registeredWindowsByName,r=n.groupName,a=n.props,o=Object.values(t).filter(function(e){return e.group===r&&void 0!==e.icon}).sort(function(e,n){var t,r;return(null!=(t=e.order)?t:Number.MAX_VALUE)-(null!=(r=n.order)?r:Number.MAX_VALUE)});return 0===o.length?null:A().createElement("aside",{className:vA.sideRail},A().createElement("div",{className:vA.container},o.map(function(e){return A().createElement(gM,{key:e.icon,config:function(){return(0,vh.o)(e.moduleName,e.icon)},mountParcel:ho.xL,windowName:e.name,groupProps:a})})))}function vb(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function vv(e){if(Array.isArray(e))return e}function vC(e,n,t,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){t(e);return}s.done?n(l):Promise.resolve(l).then(r,a)}function v$(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function i(e){vC(o,r,a,i,s,"next",e)}function s(e){vC(o,r,a,i,s,"throw",e)}i(void 0)})}}function vw(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function vk(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function vE(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function vx(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){vw(e,n,t[n])})}return e}function vD(e,n){return vv(e)||vk(e,n)||vS(e,n)||vE()}function vS(e,n){if(e){if("string"==typeof e)return vb(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return vb(e,n)}}function vz(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(n){return l([e,n])}}function l(s){if(t)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],r=0}finally{t=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}var vB=function(e){var n=e.lifeCycle,t=e.openedWorkspace,r=e.openedWindow,a=e.isRootWorkspace,o=e.isLeafWorkspace,i=bI(),s=i.openedGroup,l=i.closeWorkspace,c=i.openChildWorkspace,u=(0,g.useMemo)(function(){var e;return t&&{closeWorkspace:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return v$(function(){var n,a,o,i,s,c;return vz(this,function(u){switch(u.label){case 0:if(a=void 0!==(n=e.closeWindow)&&n,i=void 0!==(o=e.discardUnsavedChanges)&&o,!a)return[3,3];if(s=i)return[3,2];return[4,bN({reason:"CLOSE_WINDOW",explicit:!0,windowName:r.windowName})];case 1:s=u.sent(),u.label=2;case 2:if(s)return l(r.openedWorkspaces[0].workspaceName),[2,!0];return[2,!1];case 3:if(c=i)return[3,5];return[4,bN({reason:"CLOSE_WORKSPACE",explicit:!0,windowName:r.windowName,workspaceName:t.workspaceName})];case 4:c=u.sent(),u.label=5;case 5:if(c)return l(t.workspaceName),[2,!0];return[2,!1];case 6:return[2]}})})()},launchChildWorkspace:function(e,n){c(t.workspaceName,e,null!=n?n:{})},workspaceName:t.workspaceName,workspaceProps:t.props,windowProps:r.props,groupProps:null!=(e=null==s?void 0:s.props)?e:null,isRootWorkspace:a,isLeafWorkspace:o}},[t,l,s,r]);return n?A().createElement(gM,vx({key:t.workspaceName,config:n,mountParcel:ho.xL},u)):A().createElement(fN.InlineLoading,{description:"".concat((0,fI.V)("loading")," ...")})};let vM=function(e){var n=e.openedWindow,t=n.openedWorkspaces,r=vD((0,g.useState)(),2),a=r[0],o=r[1],i=hs.J_.getState().registeredWorkspacesByName;return(0,g.useEffect)(function(){Promise.all(t.map(function(e){var n=i[e.workspaceName],t=n.moduleName,r=n.component;return(0,vh.o)(t,r)})).then(o)},[t]),A().createElement(A().Fragment,null,t.map(function(e,r){return A().createElement(vB,{key:e.uuid,openedWorkspace:e,openedWindow:n,lifeCycle:null==a?void 0:a[r],isRootWorkspace:0===r,isLeafWorkspace:r===t.length-1})}))};var vT=t(950),vO={};vO.styleTagTransform=T(),vO.setAttributes=S(),vO.insert=x().bind(null,"head"),vO.domAPI=k(),vO.insertStyleElement=B(),$()(vT.A,vO);let vN=vT.A&&vT.A.locals?vT.A.locals:void 0;function vP(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function vI(e){e&&(0,_P.createRoot)(e).render(A().createElement(vF,null))}function vF(){var e=bI(),n=e.openedGroup,t=e.openedWindows,r=e.registeredGroupsByName;if(!n)return null;var a=r[n.groupName];return A().createElement("div",{className:b()(vN.workspaceWindowsAndMenuContainer,vP({},vN.overlay,a.overlay))},A().createElement("div",{className:vN.workspaceWindowsContainer},t.map(function(e){return A().createElement(vM,{key:e.windowName,openedWindow:e})})),A().createElement(vy,{workspaceGroup:n}))}},49448:function(e,n,t){"use strict";var r=t(42722);r.Type.UUID,r.Type.String,r.Type.Array;var a={slot:"patient-chart-care-panel-dashboard-slot",columns:1,title:"Care panel",path:"Care panel"},o=t(91043),i=t(35400),s=t.n(i),l=t(58088),c=t(70438),u=t(72591),d=t.n(u),p=t(1740),f=t.n(p),h=t(88128),m=t.n(h),g=t(30855),A=t.n(g),y=t(93051),b=t.n(y),v=t(73656),C=t.n(v),$=t(23252),w={};w.styleTagTransform=C(),w.setAttributes=A(),w.insert=m().bind(null,"head"),w.domAPI=f(),w.insertStyleElement=b(),d()($.A,w);let k=$.A&&$.A.locals?$.A.locals:void 0;var E=t(13624),x=t(87809),D=t.n(x),S=function(e){var n,t,a="/ws/rest/v1/kenyaemr/patientHistoricalEnrollment?patientUuid=".concat(e),o=(0,E.Ay)(a,r.openmrsFetch),i=o.data,s=o.isValidating;return{error:o.error,isLoading:o.isLoading,enrollments:null!=(t=D()(null!=(n=null==i?void 0:i.data)?n:[],"programName"))?t:[],isValidating:s}},z=t(35674),B={};B.styleTagTransform=C(),B.setAttributes=A(),B.insert=m().bind(null,"head"),B.domAPI=f(),B.insertStyleElement=b(),d()(z.A,B);let M=z.A&&z.A.locals?z.A.locals:void 0;var T=function(e){var n="/ws/rest/v1/kenyaemr/currentProgramDetails?patientUuid=".concat(e),t=(0,E.Ay)(n,r.openmrsFetch),a=t.data,o=(t.mutate,t.error),i=t.isLoading;return{data:(null==a?void 0:a.data)?null==a?void 0:a.data:null,isError:o,isLoading:i}},O=function(e){return e.HIV="HIV",e.TB="TB",e.TPT="TPT",e.MCH_MOTHER="MCH - Mother Services",e.MCH_CHILD="MCH - Child Services",e.MCHMOTHER="mchMother",e.MCHCHILD="mchChild",e}({}),N=function(e){return e.HIV="ARV",e.TB="TB",e}({}),P=function(e){return e.RegimenLineConcept="163104AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.reasonCodedConcept="1252AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.reasonNonCodedConcept="5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.standardRegimenConcept="1193AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.nonStandardRegimenConcept="1088AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.arvCategoryConcept="1255AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.tbCategoryConcept="1268AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.changeRegimenConcept="1259AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.stopRegimenConcept="1260AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.startOrRestartConcept="1256AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.regimenForm="da687480-e197-11e8-9f32-f2801f1b9fd1",e.regimenEncounterType="7dffc392-13e7-11e9-ab14-d663bd873d93",e.dateDrugStoppedCon="1191AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e}({}),I=t(27438),F={};F.styleTagTransform=C(),F.setAttributes=A(),F.insert=m().bind(null,"head"),F.domAPI=f(),F.insertStyleElement=b(),d()(I.A,F);let R=I.A&&I.A.locals?I.A.locals:void 0,H=function(e){var n=e.category,t=e.patientUuid,a=e.onRegimen,o=e.lastRegimenEncounter,i=(0,l.useTranslation)().t;return s().createElement(c.Link,{className:R.linkName,onClick:function(){return(0,r.launchWorkspace)("patient-regimen-workspace",{category:N[n],patientUuid:t,onRegimen:a,lastRegimenEncounter:o})}},i("editRegimen","Edit"))};var L=function(e,n){var t,a,o="/ws/rest/v1/kenyaemr/lastRegimenEncounter?patientUuid=".concat(n,"&category=").concat(e),i=(0,E.Ay)(o,r.openmrsFetch),s=i.data,l=(i.mutate,i.error),c=i.isLoading;return{regimenEncounter:(null==s||null==(t=s.data)?void 0:t.results)?null==s||null==(a=s.data)?void 0:a.results:"",isLoading:c,error:l}};function j(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function q(e){if(Array.isArray(e))return e}function G(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function V(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function U(e,n){return q(e)||G(e,n)||W(e,n)||V()}function W(e,n){if(e){if("string"==typeof e)return j(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return j(e,n)}}let K=function(e){var n,t=e.patientUuid,a=e.programName,o=T(t),i=o.data,u=o.isError,d=o.isLoading,p=(0,l.useTranslation)().t,f=L(N[a],t).regimenEncounter,h="tablet"==(0,r.useLayoutType)();return d?s().createElement(c.StructuredListSkeleton,null):u?s().createElement("span",null,p("errorProgramSummary","Error loading HIV summary")):(null==(n=Object.keys(null!=i?i:{}))?void 0:n.length)!==0&&Object.keys(null!=i?i:{}).length>0?s().createElement(s().Fragment,null,Object.entries(i).map(function(e){var n,o,l,u,d,m,g,A,y,b,v,C,$,w,k,E,x,D,S,z,B,T,N,P,I,F,R,L,j,q,G,V,W,K,Z,Y,J,X,Q,ee,en,et,er,ea,eo,ei,es,el,ec,eu,ed,ep,ef,e_,eh,em,eg,eA,ey,eb,ev,eC,e$,ew,ek,eE,ex,eD,eS,ez,eB,eM,eT,eO,eN=U(e,2),eP=eN[0];return eN[1],eP==O.HIV&&a==O.HIV?s().createElement(c.Tile,null,s().createElement("div",{className:M.card},s().createElement("div",{className:h?M.tabletHeading:M.desktopHeading},s().createElement("h4",{className:M.title}," ",p("currentStatus","Current status"))),s().createElement("div",{className:M.container},s().createElement("div",{className:M.content},s().createElement("p",null,p("lastViralLoad","Last viral load")),s().createElement("p",null," ",s().createElement("span",{className:M.value},(null==i||null==(n=i.HIV)?void 0:n.ldlValue)?null==i||null==(o=i.HIV)?void 0:o.ldlValue:"--"),(null==i||null==(l=i.HIV)?void 0:l.ldlDate)?s().createElement("span",null,"(",(0,r.formatDate)(new Date(null==i||null==(u=i.HIV)?void 0:u.ldlDate)),")"):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("lastCd4Count","Last CD4 count")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(d=i.HIV)?void 0:d.cd4)?null==i||null==(m=i.HIV)?void 0:m.cd4:"--"),(null==i||null==(g=i.HIV)?void 0:g.cd4Date)?s().createElement("span",null," (",(0,r.formatDate)(new Date(null==i||null==(A=i.HIV)?void 0:A.cd4Date)),") "):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("CD4Percentage","CD4 percentage")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(y=i.HIV)?void 0:y.cd4Percent)?null==i||null==(b=i.HIV)?void 0:b.cd4Percent:"--"),(null==i||null==(v=i.HIV)?void 0:v.cd4PercentDate)?s().createElement("span",null,"(",(0,r.formatDate)(new Date(null==i||null==(C=i.HIV)?void 0:C.cd4PercentDate)),") "):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("lastWhoStage","Last WHO stage")),s().createElement("p",null,s().createElement("span",{className:M.value},p("whoStage","WHO STAGE")," ",(null==i||null==($=i.HIV)?void 0:$.whoStage)?null==i||null==(w=i.HIV)?void 0:w.whoStage:"--"),(null==i||null==(k=i.HIV)?void 0:k.whoStageDate)?s().createElement("span",null," (",(0,r.formatDate)(new Date(null==i||null==(E=i.HIV)?void 0:E.whoStageDate)),") "):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("regimen","Regimen")),s().createElement("p",{className:M.value},(null==i||null==(D=i.HIV)||null==(x=D.lastEncDetails)?void 0:x.regimenShortDisplay)?null==i||null==(z=i.HIV)||null==(S=z.lastEncDetails)?void 0:S.regimenShortDisplay:p("neverOnArvRegimen","Never on ARVs"),s().createElement("span",null,s().createElement(H,{patientUuid:t,category:a,onRegimen:(null==i||null==(T=i.HIV)||null==(B=T.lastEncDetails)?void 0:B.regimenShortDisplay)?null==i||null==(P=i.HIV)||null==(N=P.lastEncDetails)?void 0:N.regimenShortDisplay:"",lastRegimenEncounter:f})))),s().createElement("div",{className:M.content},s().createElement("p",null,p("regimenStartDate"," Date started regimen")),s().createElement("p",{className:M.value},(null==i||null==(F=i.HIV)||null==(I=F.lastEncDetails)?void 0:I.startDate)?(0,r.formatDate)(new Date(null==i||null==(L=i.HIV)||null==(R=L.lastEncDetails)?void 0:R.startDate)):"--"))))):eP==O.TB&&a==O.TB?s().createElement(c.Tile,null,s().createElement("div",{className:M.card},s().createElement("div",{className:h?M.tabletHeading:M.desktopHeading},s().createElement("h4",{className:M.title}," ",p("currentStatus","Current status"))),s().createElement("div",{className:M.container},s().createElement("div",{className:M.content},s().createElement("p",null,p("treatmentNumber:","Treatment number")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(j=i.TB)?void 0:j.tbTreatmentNumber)?null==i||null==(q=i.TB)?void 0:q.tbTreatmentNumber:"--"))),s().createElement("div",{className:M.content},s().createElement("p",null,p("diseaseClassification","Disease classification")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(G=i.TB)?void 0:G.tbDiseaseClassification)?null==i||null==(V=i.TB)?void 0:V.tbDiseaseClassification:"--"),(null==i||null==(W=i.TB)?void 0:W.tbDiseaseClassificationDate)?s().createElement("span",null," (",(0,r.formatDate)(new Date(null==i||null==(K=i.TB)?void 0:K.tbDiseaseClassificationDate.toString())),") "):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("patientClassification","Patient classification")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(Z=i.TB)?void 0:Z.tbPatientClassification)?null==i||null==(Y=i.TB)?void 0:Y.tbPatientClassification:"--"))),s().createElement("div",{className:M.content},s().createElement("p",null,p("regimen","Regimen")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(J=i.TB)?void 0:J.lastTbEncounter)?null==i||null==(Q=i.TB)||null==(X=Q.lastTbEncounter)?void 0:X.regimenShortDisplay:p("neverOnTbRegimen","Never on TB regimen")),s().createElement(H,{patientUuid:t,category:a,onRegimen:(null==i||null==(ee=i.TB)?void 0:ee.lastTbEncounter)?null==i||null==(et=i.TB)||null==(en=et.lastTbEncounter)?void 0:en.regimenShortDisplay:"",lastRegimenEncounter:f}))),s().createElement("div",{className:M.content},s().createElement("p",null,p("regimenStartDate"," Date started regimen")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(ea=i.TB)||null==(er=ea.lastTbEncounter)?void 0:er.startDate)?(0,r.formatDate)(new Date(null==i||null==(ei=i.TB)||null==(eo=ei.lastTbEncounter)?void 0:eo.startDate)):"--")))))):eP==O.MCHMOTHER&&a==O.MCHMOTHER?s().createElement(c.Tile,null,s().createElement("div",{className:M.card},s().createElement("div",{className:h?M.tabletHeading:M.desktopHeading},s().createElement("h4",{className:M.title}," ",p("currentStatus","Current status"))),s().createElement("div",{className:M.container},s().createElement("div",{className:M.content},s().createElement("p",null,p("hivStatus:","HIV status")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(es=i.mchMother)?void 0:es.hivStatus)?null==i||null==(el=i.mchMother)?void 0:el.hivStatus:"--"),(null==i||null==(ec=i.mchMother)?void 0:ec.hivStatusDate)?s().createElement("span",null,"(",(0,r.formatDate)(new Date(null==i||null==(eu=i.mchMother)?void 0:eu.hivStatusDate)),")"):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("onART","On ART")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(ed=i.mchMother)?void 0:ed.onHaart)?null==i||null==(ep=i.mchMother)?void 0:ep.onHaart:"--"),(null==i||null==(ef=i.mchMother)?void 0:ef.onHaartDate)?s().createElement("span",null," (",(0,r.formatDate)(new Date(null==i||null==(e_=i.mchMother)?void 0:e_.onHaartDate)),") "):""))))):eP==O.MCHCHILD&&a==O.MCHCHILD?s().createElement(c.Tile,null,s().createElement("div",{className:M.card},s().createElement("div",{className:h?M.tabletHeading:M.desktopHeading},s().createElement("h4",{className:M.title}," ",p("currentStatus","Current status"))),s().createElement("div",{className:M.container},s().createElement("div",{className:M.content},s().createElement("p",null,p("currentProphylaxisUsed:","Current prophylaxis used")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(eh=i.mchChild)?void 0:eh.currentProphylaxisUsed)?null==i||null==(em=i.mchChild)?void 0:em.currentProphylaxisUsed:"--"),(null==i||null==(eg=i.mchChild)?void 0:eg.currentProphylaxisUsedDate)?s().createElement("span",null,(0,r.formatDate)(new Date(null==i||null==(eA=i.mchChild)?void 0:eA.currentProphylaxisUsedDate))):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("currentFeedingOption","Current feeding option")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(ey=i.mchChild)?void 0:ey.currentFeedingOption)?null==i||null==(eb=i.mchChild)?void 0:eb.currentFeedingOption:"--"),(null==i||null==(ev=i.mchChild)?void 0:ev.currentFeedingOptionDate)?s().createElement("span",null," ",(0,r.formatDate)(new Date(null==i||null==(eC=i.mchChild)?void 0:eC.currentFeedingOptionDate))," "):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("milestonesAttained","Milestones Attained")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(e$=i.mchChild)?void 0:e$.milestonesAttained)?null==i||null==(ew=i.mchChild)?void 0:ew.milestonesAttained:"--"),(null==i||null==(ek=i.mchChild)?void 0:ek.milestonesAttainedDate)?s().createElement("span",null,(0,r.formatDate)(new Date(null==i||null==(eE=i.mchChild)?void 0:eE.milestonesAttainedDate))," "):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("heiOutcome","HEI Outcome")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(ex=i.mchChild)?void 0:ex.heiOutcome)?null==i||null==(eD=i.mchChild)?void 0:eD.heiOutcome:"--"),(null==i||null==(eS=i.mchChild)?void 0:eS.heiOutcomeDate)?s().createElement("span",null," (",(0,r.formatDate)(new Date(null==i||null==(ez=i.mchChild)?void 0:ez.heiOutcomeDate)),") "):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("hivStatus","HIV Status")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(eB=i.mchChild)?void 0:eB.hivStatus)?null==i||null==(eM=i.mchChild)?void 0:eM.hivStatus:"--"),(null==i||null==(eT=i.mchChild)?void 0:eT.hivStatusDate)?s().createElement("span",null," (",(0,r.formatDate)(new Date(null==i||null==(eO=i.mchChild)?void 0:eO.hivStatusDate)),") "):""))))):null})):void 0};var Z=t(30374),Y={};Y.styleTagTransform=C(),Y.setAttributes=A(),Y.insert=m().bind(null,"head"),Y.domAPI=f(),Y.insertStyleElement=b(),d()(Z.A,Y);let J=Z.A&&Z.A.locals?Z.A.locals:void 0;var X=t(3514),Q=t.n(X),ee=t(23464),en=t.n(ee),et=t(56622),er=t.n(et),ea=t(22695),eo=function(e){var n="/ws/rest/v1/kenyaemr/heiOutcomeEncounter?patientUuid=".concat(e),t=(0,E.Ay)(n,r.openmrsFetch),a=t.data,o=(t.mutate,t.error),i=t.isLoading;return{heiOutcome:(null==a?void 0:a.data)?null==a?void 0:a.data:{},isLoading:i,error:o}};function ei(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function es(e){if(Array.isArray(e))return e}function el(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function ec(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function eu(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ed(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){el(e,n,t[n])})}return e}function ep(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function ef(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ep(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function e_(e,n){return es(e)||ec(e,n)||eh(e,n)||eu()}function eh(e,n){if(e){if("string"==typeof e)return ei(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ei(e,n)}}var em={dateEnrolled:"Enrolled on",dateCompleted:"Date Completed"},eg={HIV:{dateEnrolled:"Enrolled on",whoStage:"WHO Stage",entryPoint:"Entry Point",reason:"Reason for discontinuation"},TB:ef(ed({},em),{startDate:"Date started regimen",regimenShortName:"Regimen"}),TPT:ef(ed({},em),{tptDrugName:"Regimen",tptDrugStartDate:"Date started regimen",tptIndication:"Indication for TPT"}),"MCH - Mother Services":ef(ed({},em),{lmp:"LMP",eddLmp:"EDD",gravida:"Gravida",parity:"Parity",gestationInWeeks:"Gestation in weeks"}),"MCH - Child Services":ef(ed({},em),{entryPoint:"Entry Point"}),mchMother:{},mchChild:{},VMMC:ed({},em)};let eA=function(e){var n,t=e.enrollments,a=void 0===t?[]:t,u=e.programName,d=(0,l.useTranslation)().t,p=(0,r.useVisit)((0,o.cH)()).currentVisit,f=eo(null==p||null==(n=p.patient)?void 0:n.uuid).heiOutcome,h=er()(a,"dateEnrolled","desc"),m=(0,i.useMemo)(function(){var e;return Object.entries(null!=(e=eg[u])?e:ed({},em)).map(function(e){var n=e_(e,2);return{key:n[0],header:n[1]}})},[u]),g=(0,i.useMemo)(function(){return null==h?void 0:h.map(function(e){var n,t=null!=(n=null==e?void 0:e.firstEncounter)?n:{},r=null==e?void 0:e.enrollmentEncounterUuid;return ef(ed({id:"".concat(e.enrollmentUuid)},e,t),{changeReasons:Array.isArray(null==t?void 0:t.changeReasons)?t.changeReasons.join(", "):"",enrollmentEncounterUuid:r})})},[h]),A=function(){["".concat(r.restBaseUrl,"/kenyaemr/patientHistoricalEnrollment?patientUuid="),"".concat(r.restBaseUrl,"/kenyaemr/patientCurrentEnrollment?patientUuid="),"".concat(r.restBaseUrl,"/kenyaemr/eligiblePrograms?patientUuid=")].forEach(function(e){(0,ea.j)(function(n){return"string"==typeof n&&n.startsWith(e)},void 0,{revalidate:!0})})},y=function(e){var n,t,a;(0,r.launchWorkspace)("patient-form-entry-workspace",{workspaceTitle:null==e?void 0:e.discontinuationFormName,mutateForm:A,formInfo:{encounterUuid:"",visitTypeUuid:null!=(t=null==p||null==(n=p.visitType)?void 0:n.uuid)?t:"",visitUuid:null!=(a=null==p?void 0:p.uuid)?a:"",formUuid:null==e?void 0:e.discontinuationFormUuid,additionalProps:{enrollmentDetails:{dateEnrolled:new Date(e.dateEnrolled),uuid:e.enrollmentUuid}}}})},b=function(){var e,n,t;(0,r.launchWorkspace)("patient-form-entry-workspace",{workspaceTitle:"HEI Outcome",mutateForm:function(){(0,ea.j)(function(e){return!0},void 0,{revalidate:!0})},formInfo:{encounterUuid:"",visitTypeUuid:null!=(n=null==p||null==(e=p.visitType)?void 0:e.uuid)?n:"",visitUuid:null!=(t=null==p?void 0:p.uuid)?t:"",formUuid:"d823f1ef-0973-44ee-b113-7090dc23257b",additionalProps:{}}})},v=function(e){var n,t,a;(0,r.launchWorkspace)("patient-form-entry-workspace",{workspaceTitle:null==e?void 0:e.enrollmentFormName,mutateForm:function(){(0,ea.j)(function(e){return"string"==typeof e&&e.startsWith("/ws/rest/v1/kenyaemr/patientHistoricalEnrollment?patientUuid=")},void 0,{revalidate:!0})},formInfo:{encounterUuid:null==e?void 0:e.enrollmentEncounterUuid,formUuid:null==e?void 0:e.enrollmentFormUuid,visitTypeUuid:null!=(t=null==p||null==(n=p.visitType)?void 0:n.uuid)?t:"",visitUuid:null!=(a=null==p?void 0:p.uuid)?a:"",additionalProps:{enrollmentDetails:{dateEnrolled:new Date(e.dateEnrolled),uuid:e.enrollmentUuid}}}})};return(null==h?void 0:h.length)===0?null:s().createElement(c.Tile,{className:J.whiteBackground},s().createElement("div",{className:J.tileWrapper},s().createElement(c.DataTable,{size:"sm",useZebraStyles:!0,rows:g,headers:m},function(e){var n=e.rows,t=e.headers,a=e.getHeaderProps,o=e.getRowProps,i=e.getTableProps;return s().createElement(c.TableContainer,{title:d("EnrollmentDetails","Enrollment History"),description:""},s().createElement(c.Table,ef(ed({},i()),{"aria-label":""}),s().createElement(c.TableHead,null,s().createElement(c.TableRow,null,t.map(function(e){return s().createElement(c.TableHeader,ed({key:e.key},a({header:e})),e.header)}),s().createElement(c.TableHeader,null))),s().createElement(c.TableBody,null,n.map(function(e,n){var t,a,i;return s().createElement(c.TableRow,ed({key:e.id},o({row:e})),e.cells.map(function(e){return s().createElement(c.TableCell,{key:e.id},Q()(e.value)?"--":en()(e.value).isValid()?(0,r.formatDate)(new Date(e.value)):e.value)}),s().createElement(c.TableCell,{className:"cds--table-column-menu"},Q()(null==(t=h[n])?void 0:t.dateCompleted)&&s().createElement(c.OverflowMenu,{size:"sm",flipped:!0},s().createElement(c.OverflowMenuItem,{hasDivider:!0,itemText:d("edit","Edit"),onClick:function(){return v(h[n])}}),(null==f?void 0:f.heiNumber)&&!(null==f?void 0:f.heiOutcomeEncounterUuid)&&(null==(a=h[n])?void 0:a.programName)==="MCH - Child Services"&&s().createElement(c.OverflowMenuItem,{hasDivider:!0,itemText:d("heiOutcome","Hei Outcome"),onClick:b}),s().createElement(c.OverflowMenuItem,{isDelete:!0,hasDivider:!0,disabled:(null==f?void 0:f.heiNumber)&&!(null==f?void 0:f.heiOutcomeEncounterUuid)&&(null==(i=h[n])?void 0:i.programName)==="MCH - Child Services",itemText:d("discontinue","Discontinue"),onClick:function(){return y(h[n])}}))))}))))})))};var ey=t(98611),eb={};eb.styleTagTransform=C(),eb.setAttributes=A(),eb.insert=m().bind(null,"head"),eb.domAPI=f(),eb.insertStyleElement=b(),d()(ey.A,eb);let ev=ey.A&&ey.A.locals?ey.A.locals:void 0;var eC=function(e,n){var t,a,o="/ws/rest/v1/kenyaemr/regimenHistory?patientUuid=".concat(e,"&category=").concat(n),i=(0,E.Ay)(o,r.openmrsFetch),s=i.data,l=(i.mutate,i.error),c=i.isLoading;return{regimen:(null==s||null==(t=s.data)?void 0:t.results)?null==s||null==(a=s.data)?void 0:a.results:[],isLoading:c,error:l}};let e$=function(e){var n=e.patientUuid,t=e.category,a=(0,l.useTranslation)().t,o="tablet"==(0,r.useLayoutType)(),i=eC(n,N[t]),u=i.regimen,d=i.isLoading,p=i.error;if(d)return s().createElement(c.StructuredListSkeleton,null);if(p)return s().createElement("span",null,a("errorRegimenHistory","Error loading regimen history"));if((null==u?void 0:u.length)!==0&&(null==u?void 0:u.length)){var f=function(){return u.filter(function(e){return null==e?void 0:e.startDate}).map(function(e,n){return s().createElement(c.StructuredListRow,{key:"row-".concat(n),className:ev.structuredList},s().createElement(c.StructuredListCell,null,(null==e?void 0:e.startDate)?(0,r.formatDate)((0,r.parseDate)(null==e?void 0:e.startDate),{mode:"wide"}):""),s().createElement(c.StructuredListCell,null,(null==e?void 0:e.endDate)?(0,r.formatDate)((0,r.parseDate)(null==e?void 0:e.endDate),{mode:"wide"}):""),s().createElement(c.StructuredListCell,null,(null==e?void 0:e.regimenShortDisplay)?null==e?void 0:e.regimenShortDisplay:"——"),s().createElement(c.StructuredListCell,null,(null==e?void 0:e.regimenLine)?null==e?void 0:e.regimenLine:"——"),s().createElement(c.StructuredListCell,null,(null==e?void 0:e.changeReasons)?null==e?void 0:e.changeReasons.slice(1,-1):"——"),s().createElement(c.StructuredListCell,null))})};return s().createElement("section",null,s().createElement(c.Tile,{className:ev.whiteBackground},s().createElement("div",{className:o?ev.tabletHeading:ev.desktopHeading},s().createElement("h4",{className:ev.title},a("regimenHistory","Regimen History"))),s().createElement("div",{className:ev.structuredListBody},s().createElement(c.StructuredListWrapper,null,s().createElement(c.StructuredListHead,null,s().createElement(c.StructuredListRow,{head:!0},s().createElement(c.StructuredListCell,{head:!0},a("start","Start")),s().createElement(c.StructuredListCell,{head:!0},a("end","End")),s().createElement(c.StructuredListCell,{head:!0},a("regimen","Regimen")),s().createElement(c.StructuredListCell,{head:!0},a("regimenLine","Regimen line")),s().createElement(c.StructuredListCell,{head:!0},a("changeReason","Change reason")))),s().createElement(c.StructuredListBody,{className:ev.structuredListBody},f())))))}};var ew=t(47289),ek=t.n(ew),eE=t(40074),ex=t.n(eE);function eD(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function eS(e){if(Array.isArray(e))return e}function ez(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function eB(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function eM(e,n){return eS(e)||ez(e,n)||eT(e,n)||eB()}function eT(e,n){if(e){if("string"==typeof e)return eD(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eD(e,n)}}let eO=function(e){var n=e.patientUuid,t=e.formEntrySub,a=(0,l.useTranslation)().t,u=S(n),d=u.isLoading,p=u.error,f=u.enrollments;u.isValidating;var h=ex()(Object.keys(f||{})),m=eM((0,i.useState)({index:0}),2),g=m[0],A=m[1],y=(0,i.useMemo)(function(){return d?[]:f[(null==g?void 0:g.name)||ek()(h)]},[f,d,null==g?void 0:g.name,h]);return d?s().createElement("div",{className:k.widgetCard},s().createElement(c.StructuredListSkeleton,null)):p?s().createElement(r.ErrorState,{error:p,headerTitle:a("carePanelError","Care panel")}):0===Object.keys(f).length?s().createElement(s().Fragment,null,s().createElement(o.pp,{displayText:a("carePanel","care panel"),headerTitle:a("carePanel","Care panel")})):s().createElement("div",{className:k.widgetCard},s().createElement(o.aR,{title:a("carePanel","Care Panel")},s().createElement("div",{className:k.contextSwitcherContainer},s().createElement(c.ContentSwitcher,{size:"md",selectedIndex:null==g?void 0:g.index,onChange:function(e){return A(e)}},null==h?void 0:h.map(function(e){return s().createElement(c.Switch,{key:e,name:e,text:e})})))),s().createElement("div",{style:{width:"100%",minHeight:"20rem"}},s().createElement(K,{patientUuid:n,programName:h[null==g?void 0:g.index]}),s().createElement(e$,{patientUuid:n,category:h[null==g?void 0:g.index]}),s().createElement(eA,{patientUuid:n,programName:h[null==g?void 0:g.index],enrollments:y,formEntrySub:t})))};var eN=t(60529),eP=t(1899),eI=t(56005),eF=t.n(eI),eR=function(e){var n="/ws/rest/v1/kenyaemr/eligiblePrograms?patientUuid=".concat(e),t=(0,E.Ay)(n,r.openmrsFetch),a=t.data,o=t.error,s=t.isLoading,l=t.isValidating,c=t.mutate;return{eligibleCarePrograms:(0,i.useMemo)(function(){var e,n;return null!=(n=null==a||null==(e=a.data)?void 0:e.filter(function(e){return"active"!==e.enrollmentStatus}))?n:[]},[a]),activeCarePrograms:(0,i.useMemo)(function(){var e,n;return null!=(n=null==a||null==(e=a.data)?void 0:e.filter(function(e){return"active"!==e.enrollmentStatus}))?n:[]},[a]),error:o,isLoading:s,isValidating:l,mutateEligiblePrograms:c}},eH=t(50574),eL=[{programName:"PNC",programUuid:"286598d5-1886-4f0d-9e5f-fa5473399cee",forms:[{formName:"MCH Postnatal Visit Form",formUuId:"72aa78e0-ee4b-47c3-9073-26f3b9ecc4a7"},{formName:"PNC Services Discontinuation",formUuId:"30db888b-d6d3-47fb-b0c9-dbdf10a57ff5"}]},{programName:"ANC",programUuid:"72635673-0613-4259-916e-e0d5d5ef8f66",forms:[{formName:"ANC Follow Up form",formUuId:"6fb1a39b-0a57-4239-afd7-a5490d281cb9"},{formName:"MCH Antenatal Visit",formUuId:"e8f98494-af35-4bb8-9fc7-c409c8fed843"},{formName:"Antenatal Care (ANC) Discontinuation",formUuId:"38885518-c71a-4661-8edf-3db67707e1d1"}]},{programName:"MCH - Child Services",programUuid:"c2ecdf11-97cd-432a-a971-cfd9bd296b83",forms:[{formName:"Child welfare clinic form",formUuId:"755b59e6-acbb-4853-abaf-be302039f902"},{formName:"MCH Postnatal Visit Form",formUuId:"72aa78e0-ee4b-47c3-9073-26f3b9ecc4a7"},{formName:"Child Welfare Services Discontinuation",formUuId:"1dd02c43-904b-4206-8378-7b1a8414c326"}]},{programName:"Nutrition",programUuid:"504f179b-4a13-4790-9ecd-ca4963448af8",forms:[{formName:"Nutrition form",formUuId:"b8357314-0f6a-4fc9-a5b7-339f47095d62"},{formName:"Nutrition Services Discontinuation",formUuId:"0648a046-f404-4246-806f-c9ee78232d6d"}]},{programName:"Family Planning",programUuid:"191269d2-9973-4958-9936-f687ed771050",forms:[{formName:"Family Planning Form",formUuId:"a52c57d4-110f-4879-82ae-907b0d90add6"},{formName:"Family Planning Discontinuation",formUuId:"efc782ea-9a16-4791-824a-18be7417eda4"}]},{programName:"TB",programUuid:"9f144a34-3a4a-44a9-8486-6b7af6cc64f6",forms:[{formName:"TB Enrollment",formUuId:"89994550-9939-40f3-afa6-173bce445c79"},{formName:"TB FollowUp",formUuId:"2daabb77-7ad6-4952-864b-8d23e109c69d"},{formName:"TB Discontinuation",formUuId:"4b296dd0-f6be-4007-9eb8-d0fd4e94fb3a"}]},{programName:"Violence screening",programUuid:"e41c3d74-37c7-4001-9f19-ef9e35224b70",forms:[{formName:"Violence enrollment",formUuId:"9ba1d4aa-57d7-48f9-a635-a23508e8136c"},{formName:"Violence Screening",formUuId:"03767614-1384-4ce3-aea9-27e2f4e67d01"},{formName:"Violence Reporting Form",formUuId:"10cd2ca0-8d25-4876-b97c-b568a912957e"},{formName:"Violence Consent Form",formUuId:"d720a8b3-52cc-41e2-9a75-3fd0d67744e5"},{formName:"Sexual Violence post rape care 363A",formUuId:"c46aa4fd-8a5a-4675-90a7-a6f2119f61d8"},{formName:"Sexual Violence PRC Psychological Assessment 363B",formUuId:"9d21275a-7657-433a-b305-a736423cc496"},{formName:"Physical and Emotional Violence Form",formUuId:"a0943862-f0fe-483d-9f11-44f62abae063"},{formName:"Violence Trauma Counselling",formUuId:"e983d758-5adf-4917-8172-0f4be4d8116a"},{formName:"Violence Community Linkage Form",formUuId:"f760e38c-3d2f-4a5d-aa3d-e9682576efa8"},{formName:"Violence Legal Form",formUuId:"d0c36426-4503-4236-ab5d-39bff77f2b50"},{formName:"Violence Perpetrator Details",formUuId:"f37d7e0e-95e8-430d-96a3-8e22664f74d6"},{formName:"PEP FOLLOWUP Form",formUuId:"155ccbe2-a33f-4a58-8ce6-57a7372071ee"},{formName:"Violence Discontinuation Form",formUuId:"8fed3d06-f8a1-4cb8-b853-cd93394bab79"}]},{programName:"TPT",programUuid:"335517a1-04bc-438b-9843-1ba49fb7fcd9",forms:[{formName:"TPT Initiation",formUuId:"61ea2a72-b0f9-47cf-ae86-443f88656acc"},{formName:"TPT FollowUp",formUuId:"9d0e4be8-ab72-4394-8df7-b509b9d45179"},{formName:"TPT Outcome/Discontinuation",formUuId:"5bdd3b65-8b7b-46a0-9f7b-dfe764143848"}]},{programName:"PrEP",programUuid:"214cad1c-bb62-4d8e-b927-810a046daf62",forms:[{formName:"PrEP Initial Form",formUuId:"1bfb09fc-56d7-4108-bd59-b2765fd312b8"},{formName:"PrEP INITIATION",formUuId:"d5ca78be-654e-4d23-836e-a934739be555"},{formName:"PrEP Follow Up",formUuId:"ee3e2017-52c0-4a54-99ab-ebb542fb8984"},{formName:"PrEP Monthly Refill Form",formUuId:"291c03c8-a216-11e9-a2a3-2a2ae2dbcce4"}]},{programName:"NCD",programUuid:"ffee43c4-9ccd-4e55-8a70-93194e7fafc6",forms:[{formName:"NCD Initial Form",formUuId:"c4994dd7-f2b6-4c28-bdc7-8b1d9d2a6a97"},{formName:"NCD Follow Up",formUuId:"3e1057da-f130-44d9-b2bb-53e039b953c6"},{formName:"NCD Discontinuation",formUuId:"63182d28-a23f-4d14-b48e-38077bbd8ed2"}]},{programName:"KVP",programUuid:"7447305a-18a7-11e9-ab14-d663bd873d93",forms:[{formName:"KVP Contact Form",formUuId:"185dec84-df6f-4fc7-a370-15aa8be531ec"},{formName:"KVP Clinical Enrollment",formUuId:"c7f47cea-207b-11e9-ab14-d663bd873d93"},{formName:"KVP Clinical Encounter form",formUuId:"92e041ac-9686-11e9-bc42-526af7764f64"},{formName:"KVP Client Discontinuation",formUuId:"1f76643e-2495-11e9-ab14-d663bd873d93"}]},{programName:"HIV Program",programUuid:"dfdc6d40-2f2f-463d-ba90-cc97350441a8",forms:[{formName:"HIV Enrollment",formUuId:"e4b506c1-7379-42b6-a374-284469cba8da"},{formName:"ART Readyness",formUuId:"782a4263-3ac9-4ce8-b316-534571233f12"},{formName:"HIV Green Card",formUuId:"22c68f86-bbf0-49ba-b2d1-23fa7ccf0259"},{formName:"HIV Discontinuation",formUuId:"e3237ede-fa70-451f-9e6c-0908bc39f8b9"}]},{programName:"Medical Assited therapy",programUuid:"4b898e20-9b2d-11ee-b9d1-0242ac120002",forms:[{formName:"MAT Initial Registration Form",formUuId:"9a9cadd7-fba1-4a24-94aa-43edfbecf8d9"},{formName:"MAT Clinical Encounter Form",formUuId:"5ed937a0-0933-41c3-b638-63d8a4779845"},{formName:"MAT Psycho-social Intake & Follow-up Form",formUuId:"cfd2109b-63b3-43de-8bb3-682e80c5a965"},{formName:"MAT Psychiatric Intake and Follow up Form",formUuId:"fdea46a1-9423-4ef9-b780-93b32b48a528"},{formName:"MAT Transit/Referral Form",formUuId:"b9495048-eceb-4dd2-bfba-330dc4900ee9"},{formName:"MAT Cessation Form",formUuId:"fa58cbc1-91c8-4920-813b-fde7fd69533b"},{formName:"MAT Discontinuation Form",formUuId:"38d6e116-b96c-4916-a821-b4dc83e2041d"}]}],ej=function(e){var n=eL.find(function(n){return n.programUuid===e});return n?n.forms:[]},eq=function(e){var n,t,a="custom:(uuid,display,program,dateEnrolled,dateCompleted,location:(uuid,display),states:(startDate,endDate,voided,state:(uuid,concept:(display))))",o="".concat(r.restBaseUrl,"/programenrollment?patient=").concat(e,"&v=").concat(a),i=(0,E.Ay)(o,r.openmrsFetch),s=i.data,l=i.error,c=i.isLoading,u=i.mutate;return{isLoading:c,error:l,enrollments:null!=(t=null==s||null==(n=s.data)?void 0:n.results)?t:[],mutate:u}},eG=function(e){var n="custom:(uuid,display,name,allWorkflows,concept:(uuid,display))",t="".concat(r.restBaseUrl,"/program/").concat(e,"?v=").concat(n),a=(0,E.Ay)(t,r.openmrsFetch),o=a.data,i=a.error,s=a.isLoading,l=a.mutate;return{isLoading:s,error:i,program:null==o?void 0:o.data,mutate:l}},eV=eH.Ay.object({dateEnrolled:eH.Ay.date({coerce:!0}),dateCompleted:eH.Ay.date({coerce:!0}).optional(),location:eH.Ay.string().nonempty()});function eU(e,n,t,a){var o=t.dateEnrolled,i=t.dateCompleted,s=t.location;return(0,r.openmrsFetch)("".concat(r.restBaseUrl,"/programenrollment"),{method:"POST",headers:{"Content-Type":"application/json"},body:{program:e,patient:n,dateEnrolled:o,dateCompleted:i,location:s},signal:a.signal})}function eW(e,n,t){var a=n.dateEnrolled,o=n.dateCompleted,i=n.location;return(0,r.openmrsFetch)("".concat(r.restBaseUrl,"/programenrollment/").concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:{dateEnrolled:a,dateCompleted:o,location:i},signal:t.signal})}var eK=function(e,n){var t=(0,r.showModal)("program-delete-confirmation-modal",{closeDeleteModal:function(){return t()},programEnrollmentId:e,patientUuid:n,size:"sm"})},eZ=function(e,n,t,a){(0,r.launchWorkspace)("mch-program-form-workspace",{enrollment:t,patientUuid:n,programUuid:e,onSubmitSuccess:a})},eY=t(6070),eJ={};eJ.styleTagTransform=C(),eJ.setAttributes=A(),eJ.insert=m().bind(null,"head"),eJ.domAPI=f(),eJ.insertStyleElement=b(),d()(eY.A,eJ);let eX=eY.A&&eY.A.locals?eY.A.locals:void 0;function eQ(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function e0(e){if(Array.isArray(e))return eQ(e)}function e1(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function e2(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e3(e){return e0(e)||e1(e)||e4(e)||e2()}function e4(e,n){if(e){if("string"==typeof e)return eQ(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eQ(e,n)}}let e5=function(e){var n=e.patientUuid,t=(0,l.useTranslation)().t,a=(0,r.useVisit)(n).currentVisit,u=eR(n),d=u.eligibleCarePrograms,p=u.isLoading,f=u.isValidating,h=u.error,m=u.mutateEligiblePrograms,g=eq(n),A=g.enrollments,y=(g.isLoading,g.error,g.mutate),b="tablet"===(0,r.useLayoutType)(),v=(0,i.useCallback)(function(){m(),(0,ea.j)(function(e){return"string"==typeof e&&e.startsWith("".concat(r.restBaseUrl,"/kenyaemr/patientHistoricalEnrollment?patientUuid="))},void 0,{revalidate:!0}),(0,ea.j)(function(e){return"string"==typeof e&&e.startsWith("".concat(r.restBaseUrl,"/programenrollment?patient=").concat(n))},void 0,{revalidate:!0})},[m,n]);(0,i.useCallback)(function(e){var n,t="active"===e.enrollmentStatus,i=t?e.discontinuationFormUuid:e.enrollmentFormUuid,s=t?"".concat(e.display," Discontinuation form"):"".concat(e.display," Enrollment form");a?(0,r.launchWorkspace)("patient-form-entry-workspace",{workspaceTitle:s,mutateForm:function(){v()},formInfo:{encounterUuid:"",formUuid:i,additionalProps:{enrollmenrDetails:null!=(n=e.enrollmentDetails)?n:{}}}}):(0,o.ri)()},[a,v]);var C=(0,i.useMemo)(function(){return e3(A.map(function(e){var i=ej(e.program.uuid);return{id:e.program.uuid,programName:e.program.name,status:s().createElement("div",{className:eX.careProgramButtonContainer},s().createElement(c.Tag,{type:"green"},"Enrolled"),s().createElement(c.OverflowMenu,{"aria-label":"overflow-menu",flipped:!0},i.map(function(e){return s().createElement(c.OverflowMenuItem,{key:e.formUuId,itemText:e.formName,onClick:function(){a?(0,r.launchWorkspace)("patient-form-entry-workspace",{workspaceTitle:e.formName,mutateForm:function(){y(),m()},formInfo:{encounterUuid:"",formUuid:e.formUuId}}):(0,o.ri)()}})}),s().createElement(c.OverflowMenuItem,{itemText:t("edit","Edit"),onClick:function(){return eZ(e.program.uuid,n,e,function(){return y()})}}),s().createElement(c.OverflowMenuItem,{itemText:t("delete","Delete"),onClick:function(){return eK(e.uuid,n)}})))}})).concat(e3(d.map(function(e){var t;return{id:"".concat(e.uuid),programName:e.display,status:s().createElement("div",{className:eX.careProgramButtonContainer},s().createElement("span",null,eF()("".concat(e.enrollmentStatus," ").concat((null==(t=e.enrollmentDetails)?void 0:t.dateEnrolled)&&"active"===e.enrollmentStatus?"Since (".concat((0,r.formatDate)(new Date(e.enrollmentDetails.dateEnrolled)),")"):""))),s().createElement(c.Button,{size:"sm",className:"cds--btn--sm cds--layout--size-sm",kind:"active"==e.enrollmentStatus?"danger--ghost":"ghost",iconDescription:"Dismiss",onClick:function(){return eZ(e.uuid,n,void 0,function(){y(),m()})},renderIcon:"active"==e.enrollmentStatus?eN.bm:eP.pT},"active"==e.enrollmentStatus?"Discontinue":"Enroll"))}})))},[A,d,t,a,y,n,m]),$=[{key:"programName",header:"Program name"},{key:"status",header:"Status"}];return p?s().createElement(c.DataTableSkeleton,{headers:$,"aria-label":t("loading","Loading...")}):h?s().createElement(o.W5,{headerTitle:t("errorCarePrograms","Care programs"),error:h}):0===d.length?s().createElement(o.pp,{headerTitle:t("careProgram","Care program"),displayText:t("careProgram","care program")}):s().createElement(c.Tile,{className:eX.container},s().createElement(o.aR,{title:t("carePrograms","Care Programs")},f&&s().createElement(c.InlineLoading,{status:"active",iconDescription:t("validating","Loading"),description:t("validating","Validating data...")})),s().createElement(c.DataTable,{size:b?"lg":"sm",useZebraStyles:!0,rows:C,headers:$},function(e){var n=e.rows,t=e.headers,r=e.getTableProps,a=e.getHeaderProps,o=e.getRowProps;return s().createElement(c.TableContainer,null,s().createElement(c.Table,r(),s().createElement(c.TableHead,null,s().createElement(c.TableRow,null,t.map(function(e){return s().createElement(c.TableHeader,a({header:e}),e.header)}))),s().createElement(c.TableBody,null,n.map(function(e){return s().createElement(c.TableRow,o({row:e}),e.cells.map(function(e){return s().createElement(c.TableCell,{key:e.id},e.value)}))}))))}))};function e6(e){var n=new AbortController;return(0,r.openmrsFetch)("/ws/rest/v1/encounter",{headers:{"Content-Type":"application/json"},method:"POST",body:e,signal:n.signal})}function e8(e,n){var t=new AbortController;return(0,r.openmrsFetch)("/ws/rest/v1/encounter/".concat(n),{headers:{"Content-Type":"application/json"},method:"POST",body:e,signal:t.signal})}function e7(e){var n=new AbortController;return(0,r.openmrsFetch)("/ws/rest/v1/encounter/".concat(e),{headers:{"Content-Type":"application/json"},method:"DELETE",signal:n.signal})}function e9(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function ne(e){if(Array.isArray(e))return e}function nn(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function nt(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nr(e,n){return ne(e)||nn(e,n)||na(e,n)||nt()}function na(e,n){if(e){if("string"==typeof e)return e9(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return e9(e,n)}}let no=function(e){var n=e.closeCancelModal,t=e.regimenEncounterUuid,a=e.patientUuid,o=e.category,u=e.closeWorkspace,d=(0,l.useTranslation)().t,p=nr((0,i.useState)(!1),2),f=p[0],h=p[1],m=(0,i.useCallback)(function(e){e.preventDefault(),h(!0),e7(t).then(function(e){204===e.status&&(n(),(0,r.showSnackbar)({title:d("regimenDeleted","Regimen deleted"),subtitle:d("regimenDeletedSuccessfully","Regimen deleted successfully"),kind:"success",timeoutInMs:3500,isLowContrast:!0}),(0,ea.j)("/ws/rest/v1/kenyaemr/regimenHistory?patientUuid=".concat(a,"&category=").concat(o)),(0,ea.j)("/ws/rest/v1/kenyaemr/currentProgramDetails?patientUuid=".concat(a)),(0,ea.j)("/ws/rest/v1/kenyaemr/patientSummary?patientUuid=".concat(a)),(0,ea.j)("/ws/rest/v1/kenyaemr/lastRegimenEncounter?patientUuid=".concat(a,"&category=").concat(o)),null==u||u())}).catch(function(e){(0,r.showNotification)({title:d("regimenDeletedError","Error deleting regimen"),kind:"error",critical:!0,description:null==e?void 0:e.message})})},[d,t,n,o,a,u]);return s().createElement("div",null,s().createElement(c.ModalHeader,{closeModal:n,title:d("deleteRegimen","Delete Regimen")}),s().createElement(c.ModalBody,null,s().createElement("p",null,d("deleteRegimenModalConfirmationText","Are you sure you want to delete regimen?"))),s().createElement(c.ModalFooter,null,s().createElement(c.Button,{kind:"secondary",onClick:n},d("discard","Discard")),s().createElement(c.Button,{kind:"danger",onClick:m,disabled:f},d("deleteRegimen","Delete Regimen"))))};var ni=function(){var e,n,t="/ws/rest/v1/kenyaemr/standardRegimen",a=(0,E.Ay)(t,r.openmrsFetch),o=a.data,i=(a.mutate,a.error),s=a.isLoading;return{standardRegimen:(null==o||null==(e=o.data)?void 0:e.results)?null==o||null==(n=o.data)?void 0:n.results:[],isLoading:s,error:i}};function ns(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function nl(e){if(Array.isArray(e))return ns(e)}function nc(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function nu(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nd(e){return nl(e)||nc(e)||np(e)||nu()}function np(e,n){if(e){if("string"==typeof e)return ns(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ns(e,n)}}function nf(e,n,t){t(n_(n,e)?function(n){return n.map(function(n){return n.concept===e.concept?e:n})}:function(n){return nd(n).concat([e])})}var n_=function(e,n){return e.some(function(e){return e.concept===n.concept})};function nh(e,n){if(!(null==e?void 0:e.length))return[];var t=n>14?"Adult":"Child";return e.filter(function(e){var n=e.regimenline;return null==n?void 0:n.includes(t)})}function nm(e,n){if(!e)return 0;var t=new Date(e);if(isNaN(t.getTime()))return 0;var r=n.getFullYear()-t.getFullYear(),a=n.getMonth()-t.getMonth();return(a<0||0===a&&n.getDate()<t.getDate())&&r--,r}function ng(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function nA(e){if(Array.isArray(e))return e}function ny(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function nb(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nv(e,n){return nA(e)||ny(e,n)||nC(e,n)||nb()}function nC(e,n){if(e){if("string"==typeof e)return ng(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ng(e,n)}}let n$=function(e){var n=e.category,t=e.setStandardRegimen,a=e.setStandardRegimenLine,o=e.selectedRegimenType,u=e.visitDate,d=e.errors,p=(0,l.useTranslation)().t,f=ni(),h=f.standardRegimen;f.isLoading,f.error;var m=nv((0,i.useState)(""),2),g=m[0],A=m[1],y=nv((0,i.useState)(""),2),b=y[0],v=y[1],C=nv((0,i.useState)([]),2),$=C[0],w=C[1],k=h.find(function(e){return e.categoryCode===n}),E=(0,r.usePatient)().patient,x=nm(null==E?void 0:E.birthDate,u),D=nh(null==k?void 0:k.category,x);(0,i.useEffect)(function(){var e=null==k?void 0:k.category.find(function(e){return e.regimenLineValue===g});e?w(e.regimen):w([])},[g,h,k]);var S=function(e){A(e.target.value),a(e.target.value),v("")},z=function(e){v(e.target.value),t(e.target.value)};return s().createElement("div",null,s().createElement(s().Fragment,null,"standardUuid"===o?s().createElement(c.Select,{id:"regimenLine",invalid:!!(null==d?void 0:d.standardRegimenLine),invalidText:null==d?void 0:d.standardRegimenLine,labelText:p("selectRegimenLine","Select Regimen Line"),className:R.inputContainer,value:g,onChange:S},g&&"--"!=g?null:s().createElement(c.SelectItem,{text:p("selectRegimenLine","Select Regimen Line"),value:""}),null==D?void 0:D.map(function(e){return s().createElement(c.SelectItem,{key:e.regimenline,text:e.regimenline,value:e.regimenLineValue},e.regimenline)})):null,g&&s().createElement(c.Select,{id:"regimen",invalid:!!(null==d?void 0:d.standardRegimen),invalidText:null==d?void 0:d.standardRegimen,labelText:p("selectRegimen","Select Regimen"),className:R.inputContainer,value:b,onChange:z},b&&"--"!=b?null:s().createElement(c.SelectItem,{text:p("selectRegimen","Select Regimen"),value:""}),null==$?void 0:$.map(function(e){return s().createElement(c.SelectItem,{key:e.conceptRef,text:e.name,value:e.conceptRef},e.name)}))))};var nw=function(){var e,n,t="/ws/rest/v1/kenyaemr/regimenReason",a=(0,E.Ay)(t,r.openmrsFetch),o=a.data,i=(a.mutate,a.error),s=a.isLoading;return{regimenReason:(null==o||null==(e=o.data)?void 0:e.results)?null==o||null==(n=o.data)?void 0:n.results:[],isLoading:s,error:i}};function nk(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function nE(e){if(Array.isArray(e))return e}function nx(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function nD(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nS(e,n){return nE(e)||nx(e,n)||nz(e,n)||nD()}function nz(e,n){if(e){if("string"==typeof e)return nk(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return nk(e,n)}}let nB=function(e){var n=e.category,t=e.setRegimenReason,r=e.errors,a=(0,l.useTranslation)().t,o=nw(),u=o.regimenReason;o.isLoading,o.error;var d=nS((0,i.useState)(""),2),p=d[0],f=d[1],h=u.find(function(e){return e.category===n}),m=function(e){f(e.target.value),t(e.target.value)};return s().createElement("div",null,s().createElement(s().Fragment,null,s().createElement(c.Select,{id:"regimenReason",invalid:!!(null==r?void 0:r.regimenReason),invalidText:null==r?void 0:r.regimenReason,labelText:a("selectReason","Select Reason"),className:R.inputContainer,value:p,onChange:m},p&&"--"!=p?null:s().createElement(c.SelectItem,{text:a("selectReason","Select Reason"),value:""}),null==h?void 0:h.reason.map(function(e){return s().createElement(c.SelectItem,{key:e.label,text:e.label,value:e.value},e.label)}))))};var nM=function(){var e,n,t="/ws/rest/v1/kenyaemr/arvDrugs",a=(0,E.Ay)(t,r.openmrsFetch),o=a.data,i=(a.mutate,a.error),s=a.isLoading;return{nonStandardRegimen:(null==o||null==(e=o.data)?void 0:e.results)?null==o||null==(n=o.data)?void 0:n.results:[],isLoading:s,error:i}};function nT(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function nO(e){if(Array.isArray(e))return e}function nN(e){if(Array.isArray(e))return nT(e)}function nP(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function nI(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function nF(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nR(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nH(e,n){return nO(e)||nI(e,n)||nj(e,n)||nF()}function nL(e){return nN(e)||nP(e)||nj(e)||nR()}function nj(e,n){if(e){if("string"==typeof e)return nT(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return nT(e,n)}}let nq=function(e){e.category;var n=e.selectedRegimenType,t=e.setNonStandardRegimens,a=e.setStandardRegimenLine,o=e.visitDate,u=e.errors,d=(0,l.useTranslation)().t,p=ni().standardRegimen,f=nM(),h=f.nonStandardRegimen;f.isLoading,f.error;var m=nH((0,i.useState)(""),2),g=m[0],A=m[1],y=p.find(function(e){return"ARV"===e.categoryCode}),b=nH((0,i.useState)([,,,,,].fill("")),2),v=b[0],C=b[1],$=nH((0,i.useState)([]),2),w=$[0],k=$[1],E=(0,r.usePatient)().patient,x=nm(null==E?void 0:E.birthDate,o),D=nh(null==y?void 0:y.category,x),S=function(e){A(e.target.value),a(e.target.value)},z=function(e,n){var t=nL(v);t[e]=n,C(t)};return(0,i.useEffect)(function(){k(function(){return v.map(function(e){var n=h.find(function(n){return n.uuid===e});return n?{value:n.uuid,concept:P.nonStandardRegimenConcept}:null}).filter(function(e){return e})}())},[v,h]),(0,i.useEffect)(function(){g&&t(w)},[g,w,t]),s().createElement("div",null,s().createElement(s().Fragment,null,"nonStandardUuid"===n?s().createElement(c.Select,{id:"regimenLine",invalid:!!(null==u?void 0:u.standardRegimenLine),invalidText:null==u?void 0:u.standardRegimenLine,labelText:d("selectRegimenLine","Select Regimen Line"),className:R.inputContainer,value:g,onChange:S},g&&"--"!=g?null:s().createElement(c.SelectItem,{text:d("selectRegimenLine","Select Regimen Line"),value:""}),null==D?void 0:D.map(function(e){return s().createElement(c.SelectItem,{key:e.regimenline,text:e.regimenline,value:e.regimenLineValue},e.regimenline)})):null,g&&s().createElement("div",null,(null==u?void 0:u.nonStandardRegimens)&&s().createElement("div",{className:R.errorText},u.nonStandardRegimens),null==v?void 0:v.map(function(e,n){var t=h.filter(function(n){return!v.includes(n.uuid)||n.uuid===e});return s().createElement(c.Select,{key:n,id:"regimen-".concat(n),labelText:"Select Drug ".concat(n+1),className:R.inputContainer,value:e,onChange:function(e){return z(n,e.target.value)}},s().createElement(c.SelectItem,{text:"Select Drug ".concat(n+1),value:""}),t.map(function(e){return s().createElement(c.SelectItem,{key:e.name,text:e.name,value:e.uuid},e.name)}))}))))};var nG=t(57078);function nV(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function nU(e){if(Array.isArray(e))return e}function nW(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function nK(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nZ(e,n){return nU(e)||nW(e,n)||nY(e,n)||nK()}function nY(e,n){if(e){if("string"==typeof e)return nV(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return nV(e,n)}}var nJ=nG.Ik({regimenEvent:nG.Yj().min(1,{message:"Please select a regimen event"}),visitDate:nG.p6({required_error:"Please select a visit date"})}),nX=nG.Ik({standardRegimenLine:nG.Yj().min(1,{message:"Please select a regimen line"}),standardRegimen:nG.Yj().min(1,{message:"Please select a regimen"})}),nQ=nG.Ik({selectedRegimenType:nG.Yj().min(1,"Please select a regimen type")}),n0=nG.Ik({regimenReason:nG.Yj().min(1,{message:"Please provide a reason for regimen change/stop"})}),n1=nG.Ik({standardRegimenLine:nG.Yj().min(1,{message:"Please select a regimen line"}),nonStandardRegimens:nG.YO(nG.Yj()).min(1,{message:"Please select at least one drug regimen"})}),n2=function(e,n){var t=nJ;return e===P.stopRegimenConcept?t=t.merge(n0):e===P.changeRegimenConcept?(t=t.merge(n0).merge(nQ),"standardUuid"===n?t=t.merge(nX):"nonStandardUuid"===n&&(t=t.merge(n1))):e===P.startOrRestartConcept&&(t=t.merge(nQ),"standardUuid"===n?t=t.merge(nX):"nonStandardUuid"===n&&(t=t.merge(n1))),t};let n3=function(e){var n,t,a=e.patientUuid,o=e.category,u=e.onRegimen,d=e.lastRegimenEncounter,p=e.closeWorkspace,f=(0,l.useTranslation)().t,h=nZ((0,i.useState)({}),2),m=h[0],g=h[1],A="tablet"===(0,r.useLayoutType)(),y=(0,r.useSession)(),b=(0,r.useConfig)(),v=L(o,a),C=v.regimenEncounter;v.isLoading,v.error;var $=nZ((0,i.useState)(!1),2),w=$[0],k=$[1],E=nZ((0,i.useState)(new Date),2),x=E[0],D=E[1],S=nZ((0,i.useState)(""),2),z=S[0],B=S[1],M=nZ((0,i.useState)(""),2),T=M[0],O=M[1],N=nZ((0,i.useState)(""),2),I=N[0],F=N[1],H=nZ((0,i.useState)([]),2),j=H[0],q=H[1],G=nZ((0,i.useState)(""),2),V=G[0],U=G[1],W=nZ((0,i.useState)(""),2),K=W[0],Z=W[1],Y=nZ((0,i.useState)([]),2),J=Y[0],X=Y[1],Q=nZ((0,i.useState)([]),2),ee=Q[0],et=Q[1];(0,i.useEffect)(function(){var e={concept:P.RegimenLineConcept,value:I},n={concept:P.standardRegimenConcept,value:T},t={concept:P.reasonCodedConcept,value:V},a={concept:P.dateDrugStoppedCon,value:(0,r.toDateObjectStrict)((0,r.toOmrsIsoString)(new Date(en()(x).year(),en()(x).month(),en()(x).date())))},i={concept:"ARV"===o?P.arvCategoryConcept:P.tbCategoryConcept,value:z};I&&z!==P.stopRegimenConcept&&nf(e,J,X),T&&z!==P.stopRegimenConcept&&nf(n,J,X),V&&(z===P.stopRegimenConcept||z===P.changeRegimenConcept)&&nf(t,ee,et),x&&(z===P.stopRegimenConcept||z===P.changeRegimenConcept)&&nf(a,ee,et),z&&o&&(z===P.stopRegimenConcept?nf(i,ee,et):nf(i,J,X))},[I,V,T,o,z,x,J,ee]),(0,i.useEffect)(function(){"nonStandardUuid"===K&&j.length>0&&z!==P.stopRegimenConcept&&X(function(e){var n=new Map;return e.forEach(function(e){n.set(e.value,e)}),j.forEach(function(e){n.set(e.value,e)}),Array.from(n.values())})},[K,j,z]);var er=(0,i.useCallback)(function(){var e={regimenEvent:z,selectedRegimenType:K,standardRegimenLine:I,standardRegimen:T,regimenReason:V,visitDate:x,nonStandardRegimens:j.map(function(e){return e.value})};try{return n2(z,K).parse(e),g({}),!0}catch(e){return g(e.errors.reduce(function(e,n){return e[n.path[0]]=n.message,e},{})),!1}},[z,K,I,T,V,x,j]),eo=(0,i.useCallback)(function(e){if(e.preventDefault(),er()){k(!0);var n,t,i={encounterDatetime:(0,r.toDateObjectStrict)((0,r.toOmrsIsoString)(new Date(en()(x).year(),en()(x).month(),en()(x).date()))),patient:a,encounterType:P.regimenEncounterType,location:null==y||null==(n=y.sessionLocation)?void 0:n.uuid,encounterProviders:[{provider:null==y||null==(t=y.currentProvider)?void 0:t.uuid,encounterRole:b.regimenObs.encounterProviderRoleUuid}],form:P.regimenForm,obs:J},s={obs:ee};C.uuid&&(e8(s,C.uuid),p()),J.length>0?e6(i).then(function(e){201===e.status&&((0,r.showSnackbar)({title:f("regimenUpdated","Regimen updated"),subtitle:f("regimenUpdatedSuccessfully","Regimen updated successfully"),kind:"success",timeoutInMs:3500,isLowContrast:!0}),k(!1),(0,ea.j)("/ws/rest/v1/kenyaemr/currentProgramDetails?patientUuid=".concat(a)),(0,ea.j)("/ws/rest/v1/kenyaemr/patientSummary?patientUuid=".concat(a)),(0,ea.j)("/ws/rest/v1/kenyaemr/regimenHistory?patientUuid=".concat(a,"&category=").concat(o)),(0,ea.j)("/ws/rest/v1/kenyaemr/lastRegimenEncounter?patientUuid=".concat(a,"&category=").concat(o)),p())},function(e){(0,r.showNotification)({title:f("regimenError","Error updating regimen"),kind:"error",critical:!0,description:null==e?void 0:e.message}),k(!1)}):k(!1)}},[er,x,a,null==y||null==(n=y.sessionLocation)?void 0:n.uuid,null==y||null==(t=y.currentProvider)?void 0:t.uuid,b.regimenObs.encounterProviderRoleUuid,J,ee,C.uuid,p,f,o]),ei=function(){var e=(0,r.showModal)("delete-regimen-confirmation-dialog",{closeCancelModal:function(){return e()},regimenEncounterUuid:C.uuid,patientUuid:a,category:o,closeWorkspace:p})},es=(0,i.useMemo)(function(){return s().createElement(c.DatePicker,{dateFormat:"d/m/Y",datePickerType:"single",maxDate:new Date().toISOString(),onChange:function(e){return D(nZ(e,1)[0])},value:x},s().createElement(c.DatePickerInput,{id:"regimenDateInput",labelText:f("date","Date"),placeholder:"dd/mm/yyyy",style:{width:"100%"},invalid:!!m.visitDate,invalidText:m.visitDate}))},[x,f,m.visitDate]);return s().createElement(c.Form,{className:R.form,onSubmit:eo},s().createElement("div",null,s().createElement(c.Stack,{gap:8,className:R.container},s().createElement("h4",{className:R.regimenTitle},"Current Regimen: ",u),s().createElement("section",{className:R.section},s().createElement("div",{className:R.sectionTitle},f("regimenEvent","Regimen event")),s().createElement(c.RadioButtonGroup,{className:R.radioButtonWrapper,name:"regimenEvent",onChange:function(e){return B(e)}},s().createElement(c.RadioButton,{key:"start-regimen",labelText:f("startRegimen","Start"),value:P.startOrRestartConcept,disabled:!!d.uuid}),s().createElement(c.RadioButton,{key:"restart-regimen",labelText:f("restartRegimen","Restart"),value:P.startOrRestartConcept,disabled:!d.endDate&&"STOP ALL"!==d.event}),s().createElement(c.RadioButton,{key:"change-regimen",labelText:f("changeRegimen","Change"),value:P.changeRegimenConcept,disabled:!d.startDate||"STOP ALL"===d.event}),s().createElement(c.RadioButton,{key:"stop-regimen",labelText:f("stopRegimen","Stop"),value:P.stopRegimenConcept,disabled:!!d.endDate||!d.uuid&&!d.endDate}),s().createElement(c.RadioButton,{key:"undo-regimen",labelText:f("undoRegimen","Undo"),value:"undo",disabled:!d.uuid,onClick:ei})),m.regimenEvent&&s().createElement("div",{className:R.errorText},m.regimenEvent),z?s().createElement(s().Fragment,null,"undo"!==z&&es,z&&z!==P.stopRegimenConcept&&"undo"!==z?s().createElement(s().Fragment,null,s().createElement(c.RadioButtonGroup,{className:R.radioButtonWrapper,name:"regimenType",onChange:function(e){return Z(e)}},s().createElement(c.RadioButton,{key:"standardUuid",labelText:"Use standard regimen",value:"standardUuid"}),s().createElement(c.RadioButton,{key:"nonStandardUuid",labelText:"Use non standard regimen",value:"nonStandardUuid",disabled:"ARV"!==o})),m.selectedRegimenType&&s().createElement("div",{className:R.errorText},m.selectedRegimenType),"standardUuid"===K?s().createElement(n$,{category:o,setStandardRegimen:O,setStandardRegimenLine:F,selectedRegimenType:K,visitDate:x,errors:m}):s().createElement(nq,{category:o,setNonStandardRegimens:q,setStandardRegimenLine:F,selectedRegimenType:K,visitDate:x,errors:m})):null,(z===P.stopRegimenConcept||z===P.changeRegimenConcept&&K)&&s().createElement(nB,{category:o,setRegimenReason:U,errors:m})):null))),s().createElement(c.ButtonSet,{className:A?R.tablet:R.desktop},s().createElement(c.Button,{className:R.button,kind:"secondary",onClick:p},f("discard","Discard")),s().createElement(c.Button,{className:R.button,disabled:w,kind:"primary",type:"submit"},f("save","Save"))))};var n4=t(96228),n5=t(85848);let n6=function(e){var n,t,a="custom:(uuid,program:(name,uuid))",o="/ws/rest/v1/programenrollment?v=".concat(a,"&patient=").concat(e),i=(0,r.useConfig)(),s=(0,E.Ay)(o,r.openmrsFetch),l=s.data;return{error:s.error,isLoading:s.isLoading,isPositive:void 0!==(null!=(t=null==l||null==(n=l.data)?void 0:n.results)?t:[]).find(function(e){return e.program.uuid===i.hivProgramUuid})}};var n8=t(9994);t(45511);let n7=function(e){var n="".concat(r.restBaseUrl,"/keml/patientiitscore?patientUuid=").concat(e),t=(0,E.Ay)(n,r.openmrsFetch),a=t.data,o=t.error;return{isLoading:t.isLoading,error:o,riskScore:(0,i.useMemo)(function(){return null==a?void 0:a.data},[a])}};var n9=t(78306),te={};te.styleTagTransform=C(),te.setAttributes=A(),te.insert=m().bind(null,"head"),te.domAPI=f(),te.insertStyleElement=b(),d()(n9.A,te);let tn=n9.A&&n9.A.locals?n9.A.locals:void 0;var tt=[{evaluationDate:"2023-01-12T00:00:00.000Z",riskScore:0,description:"Low Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2023-04-10T00:00:00.000Z",riskScore:0,description:"Low Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2023-07-06T00:00:00.000Z",riskScore:3,description:"Medium Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2023-10-13T00:00:00.000Z",riskScore:3,description:"Medium Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2023-11-23T00:00:00.000Z",riskScore:3,description:"Medium Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2023-12-17T00:00:00.000Z",riskScore:3,description:"Medium Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2024-01-17T00:00:00.000Z",riskScore:3,description:"Medium Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2024-04-09T00:00:00.000Z",riskScore:11,description:"High Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2024-07-07T00:00:00.000Z",riskScore:11,description:"High Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"}];let tr=function(e){var n,t,r=n7(e.patientUuid),a=(r.isLoading,r.error,r.riskScore),o=(0,l.useTranslation)().t,i={title:"KenyaHMIS ML Model",legend:{enabled:!1},axes:{bottom:{title:"Evaluation Time",mapsTo:"evaluationDate",scaleType:n8.Wh.LABELS},left:{mapsTo:"riskScore",title:"Risk Score (%)",percentage:!0,scaleType:n8.Wh.LINEAR,includeZero:!0}},curve:"curveMonotoneX",height:"400px",tooltip:{enabled:!0,valueFormatter:function(e,n){if("Risk Score (%)"===n){var t,r;return"".concat(e," (").concat(null!=(r=null==(t=tt.find(function(n){return"".concat(n.riskScore)==="".concat(e)}))?void 0:t.description)?r:"",")")}return"".concat(e)}}};return s().createElement("div",{className:tn.riskScoreCard},s().createElement("span",{className:tn.sectionHeader},o("iitRiskScoreTrend","IIT Risk Score Trend")),s().createElement("center",null,s().createElement("strong",null,o("latestRiskScore","Latest risk score"),": "),"".concat(null==a?void 0:a.riskScore," (").concat(null==a?void 0:a.description,")")),s().createElement("div",{style:{padding:"1rem"}},s().createElement(n8.bl,{data:(null==a?void 0:a.riskScore)&&!(null==a?void 0:a.riskScore.includes("-"))?[{evaluationDate:a.evaluationDate,riskScore:Number(null==a||null==(t=a.riskScore)||null==(n=t.split("%")[0])?void 0:n.trim()),description:null==a?void 0:a.description,riskFactors:null==a?void 0:a.riskFactors}]:[],options:i})))},ta=function(e){var n,t=n7(e.patientUuid),a=t.riskScore,o=t.error,i=t.isLoading,u=(0,l.useTranslation)().t;if(i)return s().createElement("div",{className:tn.riskScoreCard},s().createElement(c.Row,{style:{display:"flex"}},s().createElement(c.Column,{lg:4,md:4,sm:4,className:tn.riskScoreCardItem},s().createElement(c.SkeletonText,null),s().createElement(c.SkeletonText,null)),s().createElement(c.Column,{lg:4,md:4,sm:4,className:tn.riskScoreCardItem},s().createElement(c.SkeletonText,null),s().createElement(c.SkeletonText,null))),s().createElement(c.Row,{style:{display:"flex"}},s().createElement(c.Column,{lg:4,md:4,sm:4,className:tn.riskScoreCardItem},s().createElement(c.SkeletonText,null),s().createElement(c.SkeletonText,null)),s().createElement(c.Column,{lg:12,md:12,sm:12,className:tn.riskScoreCardItem},s().createElement(c.SkeletonText,null),s().createElement(c.SkeletonText,null))));var d=(null==a?void 0:a.evaluationDate)&&en()(a.evaluationDate).isValid()?(0,r.formatDate)((0,r.parseDate)(null==a?void 0:a.evaluationDate)):"--";return o?s().createElement(r.ErrorState,{error:o,headerTitle:u("iitRiscScore","IIT Risk Score")}):s().createElement("div",{className:tn.riskScoreCard},s().createElement("span",{className:tn.sectionHeader},u("iitRiskscore","IIT Risk Score")),s().createElement(c.Row,{style:{display:"flex"}},s().createElement(c.Column,{lg:4,md:4,sm:4,className:tn.riskScoreCardItem},s().createElement("strong",null,u("riskScore","Risk Score"),":"),s().createElement("p",null,"".concat(null!=(n=null==a?void 0:a.riskScore)?n:0))),s().createElement(c.Column,{lg:4,md:4,sm:4,className:tn.riskScoreCardItem},s().createElement("strong",null,u("evaluationDate","Evaluation Date"),":"),s().createElement("p",null,d))),s().createElement(c.Row,{style:{display:"flex"}},s().createElement(c.Column,{lg:4,md:4,sm:4,className:tn.riskScoreCardItem},s().createElement("strong",null,u("description","Description"),":"),s().createElement("p",null,null==a?void 0:a.description)),s().createElement(c.Column,{lg:12,md:12,sm:12,className:tn.riskScoreCardItem},s().createElement("strong",null,u("riskFactors","Risk Factors"),":"),s().createElement("p",null,null==a?void 0:a.riskFactors))))};var to=t(65120),ti={};ti.styleTagTransform=C(),ti.setAttributes=A(),ti.insert=m().bind(null,"head"),ti.domAPI=f(),ti.insertStyleElement=b(),d()(to.A,ti);let ts=to.A&&to.A.locals?to.A.locals:void 0,tl=function(e){var n=e.patientUuid,t=n6(n),a=t.error,i=(t.isLoading,t.isPositive),c=(0,l.useTranslation)().t,u=c("machineLearning","Machine Learning");return a?s().createElement(r.ErrorState,{error:a,headerTitle:u}):s().createElement("div",{className:ts.machineLearning},!i&&s().createElement(o.pp,{headerTitle:u,displayText:c("mlPredictions","machine learning predictions")}),i&&s().createElement(ta,{patientUuid:n}),i&&s().createElement(tr,{patientUuid:n}))};var tc=t(53338),tu={};tu.styleTagTransform=C(),tu.setAttributes=A(),tu.insert=m().bind(null,"head"),tu.domAPI=f(),tu.insertStyleElement=b(),d()(tc.A,tu);let td=tc.A&&tc.A.locals?tc.A.locals:void 0,tp=function(e){var n=e.formEntrySub,t=e.patientUuid,r=(0,l.useTranslation)().t;return s().createElement(c.Layer,{className:td.container},s().createElement(c.Tile,null,s().createElement("div",{className:td.desktopHeading},s().createElement("h4",null,r("careProgramsEnrollement","Care panel")))),s().createElement("div",{className:td.tabs},s().createElement(c.Tabs,null,s().createElement(c.TabList,{contained:!0,activation:"manual","aria-label":"List of care panels"},s().createElement(c.Tab,{renderIcon:n4.xh},r("panelSummary","Panel summary")),s().createElement(c.Tab,{renderIcon:eN.m6},r("enrollments","Program enrollment")),s().createElement(c.Tab,{renderIcon:n5.j0},r("machineLearning","Machine Learning"))),s().createElement(c.TabPanels,null,s().createElement(c.TabPanel,null,s().createElement(eO,{patientUuid:t,formEntrySub:n})),s().createElement(c.TabPanel,null,s().createElement(e5,{patientUuid:t})),s().createElement(c.TabPanel,null,s().createElement(tl,{patientUuid:t}))))))};var tf=function(e){var n="/ws/rest/v1/kenyaemr/patientSummary?patientUuid=".concat(e),t=(0,E.Ay)(n,r.openmrsFetch),a=t.data,o=(t.mutate,t.error),i=t.isLoading;return{data:(null==a?void 0:a.data)?null==a?void 0:a.data:null,error:o,isLoading:i}},t_=t(45203),th={};th.styleTagTransform=C(),th.setAttributes=A(),th.insert=m().bind(null,"head"),th.domAPI=f(),th.insertStyleElement=b(),d()(t_.A,th);let tm=t_.A&&t_.A.locals?t_.A.locals:void 0;var tg=t(31246),tA={};tA.styleTagTransform=C(),tA.setAttributes=A(),tA.insert=m().bind(null,"head"),tA.domAPI=f(),tA.insertStyleElement=b(),d()(tg.A,tA);let ty=tg.A&&tg.A.locals?tg.A.locals:void 0,tb=function(e){var n=e.items,t=(0,l.useTranslation)().t,a=function(e){if(e.isDate)return e.value?(0,r.formatDate)(new Date(e.value),{noToday:!0}):"--";if(e.isGender)switch(e.value){case"F":return"Female";case"M":return"Male";default:return"Unknown"}return e.isNone?"N/A"===e.value||""===e.value?"None":e.value:e.value||"--"};return s().createElement("div",{className:ty.container},n.map(function(e,n){return s().createElement("div",{key:"".concat(e.label,"-").concat(n),className:ty.content},s().createElement("p",{className:ty.label},t(e.label,e.label)),s().createElement("p",null,s().createElement("span",{className:ty.value},a(e))))}))};function tv(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function tC(e){if(Array.isArray(e))return tv(e)}function t$(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function tw(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function tk(e){return tC(e)||t$(e)||tE(e)||tw()}function tE(e,n){if(e){if("string"==typeof e)return tv(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return tv(e,n)}}function tx(e){return e?e.replace(/\b\w/g,function(e){return e.toUpperCase()}):""}let tD=function(e){var n,t,a,o,i,c,u,d,p,f,h,m,g,A,y,b,v,C=e.data,$=(0,l.useTranslation)().t,w=(0,r.useSession)();return s().createElement(s().Fragment,null,s().createElement(tb,{items:[{label:$("reportDate","Report Date"),value:null==C?void 0:C.reportDate,isDate:!0},{label:$("clinicName","Clinic Name"),value:null==C?void 0:C.clinicName},{label:$("mflCode","MFL Code"),value:null==C?void 0:C.mflCode}]}),s().createElement(tb,{items:[{label:$("uniquePatientIdentifier","Unique Patient Identifier"),value:null==C?void 0:C.uniquePatientIdentifier},{label:$("nationalUniquePatientIdentifier","National Unique Patient Identifier"),value:null==C?void 0:C.nationalUniquePatientIdentifier},{label:$("patientName","Patient Name"),value:tx(null==C?void 0:C.patientName)}]}),s().createElement(tb,{items:[{label:$("birthDate","Birth Date"),value:null==C?void 0:C.birthDate,isDate:!0},{label:$("age","Age"),value:null==C?void 0:C.age},{label:$("gender","Gender"),value:null==C?void 0:C.gender,isGender:!0}]}),s().createElement(tb,{items:[{label:$("maritalStatus","Marital Status"),value:null==C?void 0:C.maritalStatus}]}),s().createElement("div",{className:ty.divider}),s().createElement(tb,{items:[{label:$("dateConfirmedPositive","Date Confirmed Positive"),value:null==C?void 0:C.dateConfirmedHIVPositive,isDate:!0},{label:$("firstCD4","First CD4"),value:null==C?void 0:C.firstCd4},{label:$("dateFirstCD4","Date First CD4"),value:null==C?void 0:C.firstCd4Date,isNone:!0}]}),s().createElement(tb,{items:[{label:$("dateEnrolledToCare","Date Enrolled to Care"),value:null==C?void 0:C.dateEnrolledIntoCare,isDate:!0},{label:$("whoAtEnrollment","WHO at Enrollment"),value:null==C?void 0:C.whoStagingAtEnrollment},{label:$("transferInDate","Transfer In Date"),value:null==C?void 0:C.transferInDate,isNone:!0}]}),s().createElement(tb,{items:[{label:$("entryPoint","Entry Point"),value:null==C?void 0:C.patientEntryPoint},{label:$("dateOfEntryPoint","Date of Entry Point"),value:null==C?void 0:C.patientEntryPointDate,isDate:!0},{label:$("facilityTransferredFrom","Facility Transferred From"),value:null==C?void 0:C.transferInFacility}]}),s().createElement("div",{className:ty.divider}),s().createElement(tb,{items:[{label:$("weight","Weight"),value:null==C?void 0:C.weight},{label:$("height","Height"),value:null==C?void 0:C.height},{label:$("bmi","BMI"),value:null==C?void 0:C.bmi}]}),s().createElement(tb,{items:[{label:$("bloodPressure","Blood Pressure"),value:(null==C?void 0:C.bloodPressure)&&(null==C?void 0:C.bpDiastolic)?"".concat(null==C?void 0:C.bloodPressure,"/").concat(null==C?void 0:C.bpDiastolic):null},{label:$("oxygenSaturation","Oxygen Saturation"),value:null==C?void 0:C.oxygenSaturation},{label:$("respiratoryRate","Respiratory Rate"),value:null==C?void 0:C.respiratoryRate}]}),s().createElement(tb,{items:[{label:$("pulseRate","Pulse Rate"),value:null==C?void 0:C.pulseRate},{label:$("familyProtection","Family Protection"),value:null==C?void 0:C.familyProtection},{label:$("tbScreeningOutcome","TB Screening Outcome"),value:null==C?void 0:C.tbScreeningOutcome}]}),s().createElement(tb,{items:[{label:"chronicDisease",value:null==C?void 0:C.chronicDisease},{label:"ioHistory",value:null==C?void 0:C.iosResults},{label:"stiScreeningOutcome",value:null==C?void 0:C.stiScreeningOutcome}]}),s().createElement(tb,{items:tk((null==C?void 0:C.gender)==="F"?[{label:$("caxcScreeningOutcome","CAXC Screening Outcome"),value:null==C?void 0:C.caxcScreeningOutcome}]:[]).concat([{label:$("dateEnrolledInTb","Date Enrolled in TB"),value:null==C?void 0:C.dateEnrolledInTb,isNone:!0},{label:$("dateCompletedInTb","Date Completed in TB"),value:null==C?void 0:C.dateCompletedInTb,isNone:!0}],tk((null==C?void 0:C.gender)==="F"?[{label:$("lmp","LMP"),value:null==C?void 0:C.lmp,isDate:!0}]:[]))}),s().createElement("div",{className:ty.divider}),s().createElement(tb,{items:[{label:$("treatmentSupporterName","Treatment Supporter Name"),value:tx(null==C?void 0:C.nameOfTreatmentSupporter)},{label:$("treatmentSupporterRelationship","Treatment Supporter Relationship"),value:null==C?void 0:C.relationshipToTreatmentSupporter},{label:$("treatmentSupporterContact","Treatment Supporter Contact"),value:null==C?void 0:C.contactOfTreatmentSupporter}]}),s().createElement("div",{className:ty.divider}),s().createElement(tb,{items:[{label:$("drugAllergies","Drug Allergies"),value:null==C?void 0:C.allergies}]}),s().createElement("div",{className:ty.divider}),s().createElement(tb,{items:[{label:$("previousART","Previous ART"),value:null==C?void 0:C.previousArtStatus},{label:$("dateStartedART","Date Started ART"),value:null==C?void 0:C.dateStartedArt,isDate:!0},{label:$("clinicalStageART","Clinical Stage ART"),value:null==C?void 0:C.whoStageAtArtStart}]}),s().createElement(tb,{items:[{label:$("purposeDrugs","Purpose Drugs"),value:null==C?void 0:C.purposeDrugs},{label:$("purposeDate","Purpose Date"),value:null==C?void 0:C.purposeDate,isDate:!0},{label:$("cd4AtArtStart","CD4 at ART Start"),value:null==C?void 0:C.cd4AtArtStart}]}),s().createElement(tb,{items:[{label:$("initialRegimen","Initial Regimen"),value:null==C||null==(n=C.firstRegimen)?void 0:n.regimenShortDisplay},{label:$("initialRegimenDate","Initial Regimen Date"),value:null==C||null==(t=C.firstRegimen)?void 0:t.startDate},{label:$("currentArtRegimen","Current ART Regimen"),value:null==C||null==(a=C.currentArtRegimen)?void 0:a.regimenShortDisplay},{label:$("currentArtRegimenDate","Current ART Regimen Date"),value:null==C||null==(o=C.currentArtRegimen)?void 0:o.startDate,isDate:!0}]}),s().createElement("div",{className:ty.divider}),s().createElement(tb,{items:[{label:$("artInterruptionReason","ART Interruption Reason"),value:"--"},{label:$("substitutionWithin1stLineRegimen","Substitution Within 1st Line Regimen"),value:"--"},{label:$("switchTo2ndLineRegimen","Switch to 2nd Line Regimen"),value:"--"}]}),s().createElement(tb,{items:[{label:$("dapsone","Dapsone"),value:null==C?void 0:C.dapsone},{label:$("tpt","TPT"),value:(null==C||null==(c=C.clinicsEnrolled)||null==(i=c.toLowerCase().split(",").map(function(e){return e.trim()}))?void 0:i.includes("tpt"))?"Yes":"No"},{label:$("clinicsEnrolled","Clinics Enrolled"),value:null==C?void 0:C.clinicsEnrolled}]}),s().createElement(tb,{items:[{label:$("transferOutDate","Transfer Out Date"),value:null==C?void 0:C.transferOutDate,isNone:!0},{label:$("transferOutFacility","Transfer Out Facility"),value:null==C?void 0:C.transferOutFacility},{label:$("deathDate","Death Date"),value:null==C?void 0:C.deathDate,isNone:!0}]}),s().createElement(tb,{items:[{label:$("mostRecentCD4","Most Recent CD4"),value:null==C?void 0:C.mostRecentCd4},{label:$("mostRecentVL","Most Recent VL"),value:null==C?void 0:C.viralLoadValue},{label:$("nextAppointmentDate","Next Appointment Date"),value:null==C?void 0:C.nextAppointmentDate,isDate:!0}]}),s().createElement("div",{className:ty.container},s().createElement("div",{className:ty.content},s().createElement("p",{className:ty.label},$("viralLoadTrends","Viral load trends")),(null==C||null==(d=C.allVlResults)||null==(u=d.value)?void 0:u.length)>0?null==C||null==(f=C.allVlResults)||null==(p=f.value)?void 0:p.map(function(e,n){return s().createElement("div",{key:"vl-".concat(n)},s().createElement("span",{className:ty.value}," ",e.vl," "),(null==e?void 0:e.vlDate)==="N/A"||(null==e?void 0:e.vlDate)===""?s().createElement("span",null,"None"):s().createElement("span",null,"(",(null==e?void 0:e.vlDate)?null==e?void 0:e.vlDate:"--",")"),s().createElement("br",null))}):"--"),s().createElement("div",{className:ty.content},s().createElement("p",{className:ty.label},$("cd4Trends","CD4 Trends")),(null==C||null==(h=C.allCd4CountResults)?void 0:h.length)>0?null==C||null==(m=C.allCd4CountResults)?void 0:m.map(function(e,n){return s().createElement("div",{key:"cd4Trend-".concat(null==e?void 0:e.cd4Count,"-").concat(n)},s().createElement("span",{className:ty.value},null==e?void 0:e.cd4Count),(null==e?void 0:e.cd4Count)==="N/A"||(null==e?void 0:e.cd4Count)===""?s().createElement("span",null,"None"):s().createElement("span",null,"( ",(null==e?void 0:e.cd4CountDate)?null==e?void 0:e.cd4CountDate:"--",")"),s().createElement("br",null))}):"--")),s().createElement("div",{className:ty.divider}),s().createElement(tb,{items:[{label:$("clinicalNotes","Clinical Notes"),value:null!=(v=null==C?void 0:C.clinicalNotes)?v:"--"},{label:$("clinicianName","Clinician Name"),value:null==w||null==(A=w.user)||null==(g=A.person)?void 0:g.display},{label:$("clinicianSignature","Clinician Signature"),value:null==w||null==(b=w.user)||null==(y=b.person)?void 0:y.display}]}))},tS=s().forwardRef(function(e,n){var t=e.data,a=(0,r.useConfig)().logo;return s().createElement("div",{ref:n,className:tm.printPage},(null==a?void 0:a.src)&&s().createElement("img",{src:a.src,alt:a.alt||"Logo",width:110,height:40}),s().createElement("div",{className:tm.bodyContainer},s().createElement("div",{className:tm.card},s().createElement(tD,{data:t}))))});var tz=t(95795);function tB(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function tM(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){tB(e,n,t[n])})}return e}let tT=function(e){var n=e.onPrint,t=e.printMode,a=(0,l.useTranslation)().t,o="tablet"==(0,r.useLayoutType)();return s().createElement("div",{className:o?ty.tabletHeading:ty.desktopHeading},s().createElement("h4",{className:ty.title},a("patientSummary","Patient summary")),!1===t&&s().createElement(c.Button,{size:"sm",className:ty.btnShow,onClick:n,kind:"tertiary",renderIcon:function(e){return s().createElement(tz.xj,tM({size:16},e))},iconDescription:a("print","Print")},a("print","Print")))};function tO(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function tN(e){if(Array.isArray(e))return e}function tP(e,n,t,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){t(e);return}s.done?n(l):Promise.resolve(l).then(r,a)}function tI(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function i(e){tP(o,r,a,i,s,"next",e)}function s(e){tP(o,r,a,i,s,"throw",e)}i(void 0)})}}function tF(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function tR(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function tH(e,n){return tN(e)||tF(e,n)||tL(e,n)||tR()}function tL(e,n){if(e){if("string"==typeof e)return tO(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return tO(e,n)}}function tj(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(n){return l([e,n])}}function l(s){if(t)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],r=0}finally{t=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}let tq=function(e){var n=e.patientUuid,t=(0,l.useTranslation)().t,r=tf(n),a=r.data,o=r.error,u=r.isLoading,d=(0,i.useRef)(null),p=tH((0,i.useState)(!1),2),f=p[0],h=p[1],m=(0,i.useCallback)(function(){return tI(function(){var e,n;return tj(this,function(t){try{d.current&&(e=window.open("","_blank"))&&(n=d.current.innerHTML,e.document.documentElement.innerHTML=n,e.focus(),e.print(),e.close())}catch(e){console.error("Print error:",e),window.print()}return[2]})})()},[]),g=function(){h(!0)};return((0,i.useEffect)(function(){f&&d.current&&setTimeout(function(){m(),h(!1)},100)},[f,m]),u)?s().createElement(c.StructuredListSkeleton,null):o?s().createElement("span",null,t("errorPatientSummary","Error loading patient summary")):a&&0!==Object.keys(a).length?s().createElement(s().Fragment,null,f&&s().createElement("div",{style:{position:"absolute",left:"-9999px"}},s().createElement(tS,{ref:d,data:a})),s().createElement("div",{className:ty.bodyContainer},s().createElement("div",{className:ty.card},s().createElement(tT,{onPrint:g,printMode:!1}),s().createElement(tD,{data:a})))):s().createElement("span",null,t("noPatientSummary","No patient summary available"))};var tG=function(e){var n=new URLSearchParams({code:(0,r.useConfig)().dispensingVitalsConcepts.map(function(e){return e.uuid}).join(","),"subject:Patient":e,_summary:"data",_sort:"-date",_count:"1"}),t="".concat(r.fhirBaseUrl,"/Observation?").concat(n.toString()),a=(0,E.Ay)(t,r.openmrsFetch),o=a.data,s=a.error,l=a.isLoading,c=a.mutate;return{vitals:(0,i.useMemo)(function(){var e,n;return(null!=(n=null==o||null==(e=o.data)?void 0:e.entry)?n:[]).map(function(e){var n,t,a,o,i,s,l;return{display:null==e||null==(t=e.resource)||null==(n=t.code)?void 0:n.text,uuid:null==e||null==(a=e.resource)?void 0:a.id,value:null==e||null==(i=e.resource)||null==(o=i.valueQuantity)?void 0:o.value,dateRecoded:(null==e||null==(s=e.resource)?void 0:s.issued)?(0,r.parseDate)(null==e||null==(l=e.resource)?void 0:l.issued):void 0}})},[o]),isLoading:l,mutate:c,error:s}},tV=t(4929),tU={};tU.styleTagTransform=C(),tU.setAttributes=A(),tU.insert=m().bind(null,"head"),tU.domAPI=f(),tU.insertStyleElement=b(),d()(tV.A,tU);let tW=tV.A&&tV.A.locals?tV.A.locals:void 0,tK=function(e){var n=tG(e.patientUuid),t=n.vitals,r=n.error;return n.isLoading||r||!t.length?null:s().createElement(c.Tile,{className:tW.container},t.map(function(e){return s().createElement("div",null,s().createElement("strong",null,null==e?void 0:e.display,": "),s().createElement("span",null,null==e?void 0:e.value))}))};var tZ=t(68622),tY=function(e){return s().createElement(tZ.Jc,e)};function tJ(){var e=(0,l.useTranslation)().t,n=function(){(0,r.launchWorkspace)("patient-care-discharge-workspace")};return s().createElement(r.ActionMenuButton,{getIcon:tY,label:e("discharge","Discharge"),iconDescription:e("discharge","Discharge"),handler:n,type:"ward-patient-discharge"})}var tX=t(74064),tQ=t(78855);function t0(e,n,t,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){t(e);return}s.done?n(l):Promise.resolve(l).then(r,a)}function t1(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function i(e){t0(o,r,a,i,s,"next",e)}function s(e){t0(o,r,a,i,s,"throw",e)}i(void 0)})}}function t2(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(n){return l([e,n])}}function l(s){if(t)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],r=0}finally{t=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}let t3=function(e){var n,t=e.patientUuid,a=e.programUuid,o=e.enrollment,i=e.closeWorkspace,u=e.onSubmitSuccess,d=function(){var e,n,t,r,a;return!(null==o||null==(e=o.location)?void 0:e.uuid)&&(null==p||null==(n=p.sessionLocation)?void 0:n.uuid)?null==p||null==(r=p.sessionLocation)?void 0:r.uuid:null!=(a=null==o||null==(t=o.location)?void 0:t.uuid)?a:null},p=(0,r.useSession)(),f=(0,l.useTranslation)().t,h=eG(a),m=h.isLoading,g=h.error,A=h.program,y=(0,tX.mN)({resolver:(0,tQ.u)(eV),values:{dateEnrolled:new Date,location:null!=(n=d())?n:"",dateCompleted:(null==o?void 0:o.dateCompleted)?new Date(o.dateCompleted):void 0}}),b=function(e){return t1(function(){var n,a;return t2(this,function(s){switch(s.label){case 0:n=new AbortController,s.label=1;case 1:if(s.trys.push([1,6,,7]),!o)return[3,3];return[4,eW(o.uuid,e,n)];case 2:return s.sent(),[3,5];case 3:return[4,eU(A,t,e,n)];case 4:s.sent(),s.label=5;case 5:return(0,r.showSnackbar)({kind:"success",title:"Success",subtitle:f("programEnrollmentSuccessful","Program enrollment successful")}),i(),null==u||u(),[3,7];case 6:return a=s.sent(),(0,r.showSnackbar)({kind:"error",title:"Error",subtitle:null==a?void 0:a.message}),console.error(a),[3,7];case 7:return[2]}})})()};return m?s().createElement(c.InlineLoading,null):g?s().createElement(r.ErrorState,{headerTitle:f("error","Error"),error:g}):s().createElement("form",{className:eX.form,onSubmit:y.handleSubmit(b)},s().createElement(c.Stack,{gap:4,className:eX.grid},s().createElement(c.Column,null,s().createElement(c.TextInput,{readOnly:!0,value:null==A?void 0:A.name,title:f("program","Program"),id:"program",labelText:f("program","Program")})),s().createElement(c.Column,null,s().createElement(tX.xI,{control:y.control,name:"dateEnrolled",render:function(e){var n=e.field,t=e.fieldState.error;return s().createElement(c.DatePicker,{className:eX.datePickerInput,dateFormat:"d/m/Y",datePickerType:"single",value:n.value,onChange:function(e){var t;return n.onChange(null!=(t=null==e?void 0:e[0])?t:void 0)},invalid:!!(null==t?void 0:t.message),invalidText:null==t?void 0:t.message},s().createElement(c.DatePickerInput,{id:"startdate-input",invalid:!!(null==t?void 0:t.message),invalidText:null==t?void 0:t.message,placeholder:"mm/dd/yyyy",labelText:f("startDate","Start Date"),size:"lg"}))}})),s().createElement(c.Column,null,s().createElement(tX.xI,{control:y.control,name:"dateCompleted",render:function(e){var n=e.field,t=e.fieldState.error;return s().createElement(c.DatePicker,{className:eX.datePickerInput,dateFormat:"d/m/Y",value:n.value,datePickerType:"single",onChange:function(e){var t;return n.onChange(null!=(t=null==e?void 0:e[0])?t:void 0)},invalid:!!(null==t?void 0:t.message),invalidText:null==t?void 0:t.message},s().createElement(c.DatePickerInput,{id:"endDate",invalid:!!(null==t?void 0:t.message),invalidText:null==t?void 0:t.message,placeholder:"mm/dd/yyyy",labelText:f("endDate","End Date"),size:"lg"}))}})),s().createElement(c.Column,null,s().createElement(tX.xI,{control:y.control,name:"location",render:function(e){var n,t=e.field,a=t.value,o=t.onChange;return e.fieldState.error,s().createElement(s().Fragment,null,s().createElement(c.FormLabel,{className:"".concat(eX.locationLabel," cds--label")},f("enrollmentLocation","Enrollment location")),s().createElement(r.LocationPicker,{selectedLocationUuid:a,defaultLocationUuid:null==p||null==(n=p.sessionLocation)?void 0:n.uuid,locationTag:"Login Location",onChange:function(e){return o(e)}}))}}))),s().createElement(c.ButtonSet,{className:eX.buttonSet},s().createElement(c.Button,{className:eX.button,kind:"secondary",onClick:function(){return i()}},f("discard","Discard")),s().createElement(c.Button,{className:eX.button,kind:"primary",type:"submit",disabled:y.formState.isSubmitting},f("submit","Submit"))))};function t4(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function t5(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){t4(e,n,t[n])})}return e}function t6(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function t8(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}var t7="@kenyaemr/esm-care-panel-app",t9={featureName:"patient-care-panels",moduleName:t7};t(31437),(0,r.getSyncLifecycle)(tp,t9),(0,r.getSyncLifecycle)(no,t9),(0,r.getSyncLifecycle)(eO,t9),(0,r.getSyncLifecycle)(e5,{moduleName:"patient-care-programs",featureName:"care-programs"}),(0,r.getSyncLifecycle)((0,o.bo)(t8(t5({},a),{icon:"omrs-icon-document",moduleName:t7})),t9),(0,r.getSyncLifecycle)(tq,t9),(0,r.getSyncLifecycle)(n3,t9),(0,r.getSyncLifecycle)(tK,t9),(0,r.getSyncLifecycle)(tJ,t9),(0,r.getAsyncLifecycle)(function(){return t.e("121").then(t.bind(t,68528))},t9),(0,r.getSyncLifecycle)(t3,t9)},53841:function(e,n,t){"use strict";var r=t(51623),a=t.n(r);function o(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function i(e){if(Array.isArray(e))return e}function s(e){if(Array.isArray(e))return o(e)}function l(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function c(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function u(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(e,n){return i(e)||c(e,n)||m(e,n)||u()}function f(e){return s(e)||l(e)||m(e)||d()}function h(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function m(e,n){if(e){if("string"==typeof e)return o(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o(e,n)}}var g=[],A={},y="@kenyaemr/esm-care-panel-app",b="version-first";if((t.initializeSharingData||t.initializeExposesData)&&t.federation){var v,C,$,w,k,E,x,D,S,z,B,M,T=function(e,n,t){e&&e[n]&&(e[n]=t)},O=function(e,n,t){var r,a,o,i,s,l,c,u=t();Array.isArray(u)?(null!=(i=(a=e)[o=n])||(a[o]=[]),(r=e[n]).push.apply(r,f(u))):(void 0===u?"undefined":h(u))==="object"&&null!==u&&(null!=(c=(s=e)[l=n])||(s[l]={}),Object.assign(e[n],u))},N=function(e,n,t){var r,a,o;null!=(o=(r=e)[a=n])||(r[a]=t())},P=null!=(D=null==(v=t.remotesLoadingData)?void 0:v.chunkMapping)?D:{},I=null!=(S=null==(C=t.remotesLoadingData)?void 0:C.moduleIdToRemoteDataMapping)?S:{},F=null!=(z=null==($=t.initializeSharingData)?void 0:$.scopeToSharingDataMapping)?z:{},R=null!=(B=null==(w=t.consumesLoadingData)?void 0:w.chunkMapping)?B:{},H=null!=(M=null==(k=t.consumesLoadingData)?void 0:k.moduleIdToConsumeDataMapping)?M:{},L={},j=[],q={},G=null==(E=t.initializeExposesData)?void 0:E.shareScope;for(var V in a())t.federation[V]=a()[V];N(t.federation,"consumesLoadingModuleToHandlerMapping",function(){var e={},n=!0,t=!1,r=void 0;try{for(var a,o=Object.entries(H)[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var i=p(a.value,2),s=i[0],l=i[1];e[s]={getter:l.fallback,shareInfo:{shareConfig:{fixedDependencies:!1,requiredVersion:l.requiredVersion,strictVersion:l.strictVersion,singleton:l.singleton,eager:l.eager},scope:[l.shareScope]},shareKey:l.shareKey}}}catch(e){t=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(t)throw r}}return e}),N(t.federation,"initOptions",function(){return{}}),N(t.federation.initOptions,"name",function(){return y}),N(t.federation.initOptions,"shareStrategy",function(){return b}),N(t.federation.initOptions,"shared",function(){var e={},n=!0,t=!1,r=void 0;try{for(var a,o=Object.entries(F)[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var i=p(a.value,2),s=i[0],l=i[1],c=!0,u=!1,d=void 0;try{for(var f,m=l[Symbol.iterator]();!(c=(f=m.next()).done);c=!0){var g=f.value;if((void 0===g?"undefined":h(g))==="object"&&null!==g){var A=g.name,y=g.version,b=g.factory,v=g.eager,C=g.singleton,$=g.requiredVersion,w=g.strictVersion,k={},E=function(e){return void 0!==e};E(C)&&(k.singleton=C),E($)&&(k.requiredVersion=$),E(v)&&(k.eager=v),E(w)&&(k.strictVersion=w);var x={version:y,scope:[s],shareConfig:k,get:b};e[A]?e[A].push(x):e[A]=[x]}}}catch(e){u=!0,d=e}finally{try{c||null==m.return||m.return()}finally{if(u)throw d}}}}catch(e){t=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(t)throw r}}return e}),O(t.federation.initOptions,"remotes",function(){return Object.values(A).flat().filter(function(e){return"script"===e.externalType})}),O(t.federation.initOptions,"plugins",function(){return g}),N(t.federation,"bundlerRuntimeOptions",function(){return{}}),N(t.federation.bundlerRuntimeOptions,"remotes",function(){return{}}),N(t.federation.bundlerRuntimeOptions.remotes,"chunkMapping",function(){return P}),N(t.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",function(){var e={},n=!0,t=!1,r=void 0;try{for(var a,o=Object.entries(I)[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var i=p(a.value,2),s=i[0],l=i[1];e[s]=[l.shareScope,l.name,l.externalModuleId,l.remoteName]}}catch(e){t=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(t)throw r}}return e}),N(t.federation.bundlerRuntimeOptions.remotes,"webpackRequire",function(){return t}),O(t.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",function(){var e={},n=!0,t=!1,r=void 0;try{for(var a,o=Object.entries(I)[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var i=p(a.value,2),s=i[0],l=A[i[1].remoteName];l&&(e[s]=l)}}catch(e){t=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(t)throw r}}return e}),T(t,"S",t.federation.bundlerRuntime.S),t.federation.attachShareScopeMap&&t.federation.attachShareScopeMap(t),T(t.f,"remotes",function(e,n){return t.federation.bundlerRuntime.remotes({chunkId:e,promises:n,chunkMapping:P,idToExternalAndNameMapping:t.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:t.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:t})}),T(t.f,"consumes",function(e,n){return t.federation.bundlerRuntime.consumes({chunkId:e,promises:n,chunkMapping:R,moduleToHandlerMapping:t.federation.consumesLoadingModuleToHandlerMapping,installedModules:L,webpackRequire:t})}),T(t,"I",function(e,n){return t.federation.bundlerRuntime.I({shareScopeName:e,initScope:n,initPromises:j,initTokens:q,webpackRequire:t})}),T(t,"initContainer",function(e,n,r){return t.federation.bundlerRuntime.initContainerEntry({shareScope:e,initScope:n,remoteEntryInitOptions:r,shareScopeKey:G,webpackRequire:t})}),T(t,"getContainer",function(e,n){var r=t.initializeExposesData.moduleMap;return t.R=n,n=Object.prototype.hasOwnProperty.call(r,e)?r[e]():Promise.resolve().then(function(){throw Error('Module "'+e+'" does not exist in container.')}),t.R=void 0,n}),t.federation.instance=t.federation.runtime.init(t.federation.initOptions),(null==(x=t.consumesLoadingData)?void 0:x.initialConsumes)&&t.federation.bundlerRuntime.installInitialConsumes({webpackRequire:t,installedModules:L,initialConsumes:t.consumesLoadingData.initialConsumes,moduleToHandlerMapping:t.federation.consumesLoadingModuleToHandlerMapping})}},93296:function(e,n,t){"use strict";var r=t(35400);function a(e,n){return e===n&&(0!==e||1/e==1/n)||e!=e&&n!=n}var o="function"==typeof Object.is?Object.is:a,i=r.useState,s=r.useEffect,l=r.useLayoutEffect,c=r.useDebugValue;function u(e,n){var t=n(),r=i({inst:{value:t,getSnapshot:n}}),a=r[0].inst,o=r[1];return l(function(){a.value=t,a.getSnapshot=n,d(a)&&o({inst:a})},[e,t,n]),s(function(){return d(a)&&o({inst:a}),e(function(){d(a)&&o({inst:a})})},[e]),c(t),t}function d(e){var n=e.getSnapshot;e=e.value;try{var t=n();return!o(e,t)}catch(e){return!0}}function p(e,n){return n()}var f="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?p:u;n.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:f},58139:function(e,n,t){"use strict";e.exports=t(93296)},99780:function(e,n,t){"use strict";let r;t.d(n,{A:()=>c});let a="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),o=new Uint8Array(16);function i(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}let s=[];for(let e=0;e<256;++e)s.push((e+256).toString(16).slice(1));function l(e,n=0){return s[e[n+0]]+s[e[n+1]]+s[e[n+2]]+s[e[n+3]]+"-"+s[e[n+4]]+s[e[n+5]]+"-"+s[e[n+6]]+s[e[n+7]]+"-"+s[e[n+8]]+s[e[n+9]]+"-"+s[e[n+10]]+s[e[n+11]]+s[e[n+12]]+s[e[n+13]]+s[e[n+14]]+s[e[n+15]]}let c=function(e,n,t){if(a&&!n&&!e)return a();let r=(e=e||{}).random||(e.rng||i)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,n){t=t||0;for(let e=0;e<16;++e)n[t+e]=r[e];return n}return l(r)}},31437:function(e,n,t){var r={"./en.json":["41066","127"],"./sw.json":["23987","40"],"./am.json":["82735","916"]};function a(e){if(!t.o(r,e))return Promise.resolve().then(function(){var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n});var n=r[e],a=n[0];return t.e(n[1]).then(function(){return t(a)})}a.keys=()=>Object.keys(r),a.id=31437,e.exports=a},94106:function(e,n,t){"use strict";var r=t(44054),a=t(16742),o=t(63767);let i="[ Federation Runtime ]",s=a.createLogger(i);function l(e,n){e||c(n)}function c(e){if(e instanceof Error)throw e.message.startsWith(i)||(e.message=`${i}: ${e.message}`),e;throw Error(`${i}: ${e}`)}function u(e){e instanceof Error&&(e.message.startsWith(i)||(e.message=`${i}: ${e.message}`)),s.warn(e)}function d(e,n){return -1===e.findIndex(e=>e===n)&&e.push(n),e}function p(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function f(e){return void 0!==e.entry}function h(e){return!e.entry.includes(".json")}async function m(e,n){try{return await e()}catch(e){n||u(e);return}}function g(e){return e&&"object"==typeof e}let A=Object.prototype.toString;function y(e){return"[object Object]"===A.call(e)}function b(e,n){let t=/^(https?:)?\/\//i;return e.replace(t,"").replace(/\/$/,"")===n.replace(t,"").replace(/\/$/,"")}function v(e){return Array.isArray(e)?e:[e]}function C(e){let n={url:"",type:"global",globalName:""};return a.isBrowserEnv()||a.isReactNativeEnv()?"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:n:"ssrRemoteEntry"in e?{url:e.ssrRemoteEntry||n.url,type:e.ssrRemoteEntryType||n.type,globalName:e.globalName}:n}let $=(e,n)=>{let t;return t=e.endsWith("/")?e.slice(0,-1):e,n.startsWith(".")&&(n=n.slice(1)),t+=n},w="object"==typeof globalThis?globalThis:window,k=(()=>{try{return document.defaultView}catch(e){return w}})(),E=k;function x(e,n,t){Object.defineProperty(e,n,{value:t,configurable:!1,writable:!0})}function D(e,n){return Object.hasOwnProperty.call(e,n)}D(w,"__GLOBAL_LOADING_REMOTE_ENTRY__")||x(w,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});let S=w.__GLOBAL_LOADING_REMOTE_ENTRY__;function z(e){var n,t,r,a,o,i,s,l,c,u,d,p;D(e,"__VMOK__")&&!D(e,"__FEDERATION__")&&x(e,"__FEDERATION__",e.__VMOK__),D(e,"__FEDERATION__")||(x(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),x(e,"__VMOK__",e.__FEDERATION__)),null!=(s=(n=e.__FEDERATION__).__GLOBAL_PLUGIN__)||(n.__GLOBAL_PLUGIN__=[]),null!=(l=(t=e.__FEDERATION__).__INSTANCES__)||(t.__INSTANCES__=[]),null!=(c=(r=e.__FEDERATION__).moduleInfo)||(r.moduleInfo={}),null!=(u=(a=e.__FEDERATION__).__SHARE__)||(a.__SHARE__={}),null!=(d=(o=e.__FEDERATION__).__MANIFEST_LOADING__)||(o.__MANIFEST_LOADING__={}),null!=(p=(i=e.__FEDERATION__).__PRELOADED_MAP__)||(i.__PRELOADED_MAP__=new Map)}function B(){w.__FEDERATION__.__GLOBAL_PLUGIN__=[],w.__FEDERATION__.__INSTANCES__=[],w.__FEDERATION__.moduleInfo={},w.__FEDERATION__.__SHARE__={},w.__FEDERATION__.__MANIFEST_LOADING__={},Object.keys(S).forEach(e=>{delete S[e]})}function M(e){w.__FEDERATION__.__INSTANCES__.push(e)}function T(){return w.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function O(e,n=a.isDebugMode()){n&&(w.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,w.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.18.0")}function N(e,n){if("string"==typeof n){if(e[n])return{value:e[n],key:n};for(let t of Object.keys(e)){let[r,a]=t.split(":"),o=`${r}:${n}`,i=e[o];if(i)return{value:i,key:o}}return{value:void 0,key:n}}throw Error("key must be string")}z(w),z(k);let P=()=>k.__FEDERATION__.moduleInfo,I=(e,n)=>{let t=N(n,p(e)).value;if(t&&!t.version&&"version"in e&&e.version&&(t.version=e.version),t)return t;if("version"in e&&e.version){let{version:n}=e,t=p(r._object_without_properties_loose(e,["version"])),a=N(k.__FEDERATION__.moduleInfo,t).value;if((null==a?void 0:a.version)===n)return a}},F=e=>I(e,k.__FEDERATION__.moduleInfo),R=(e,n)=>{let t=p(e);return k.__FEDERATION__.moduleInfo[t]=n,k.__FEDERATION__.moduleInfo},H=e=>(k.__FEDERATION__.moduleInfo=r._extends({},k.__FEDERATION__.moduleInfo,e),()=>{for(let n of Object.keys(e))delete k.__FEDERATION__.moduleInfo[n]}),L=(e,n)=>{let t=n||`__FEDERATION_${e}:custom__`,r=w[t];return{remoteEntryKey:t,entryExports:r}},j=e=>{let{__GLOBAL_PLUGIN__:n}=k.__FEDERATION__;e.forEach(e=>{-1===n.findIndex(n=>n.name===e.name)?n.push(e):u(`The plugin ${e.name} has been registered.`)})},q=()=>k.__FEDERATION__.__GLOBAL_PLUGIN__,G=e=>w.__FEDERATION__.__PRELOADED_MAP__.get(e),V=e=>w.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),U="default",W="global",K="[0-9A-Za-z-]+",Z=`(?:\\+(${K}(?:\\.${K})*))`,Y="0|[1-9]\\d*",J="[0-9]+",X="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Q=`(?:${J}|${X})`,ee=`(?:-?(${Q}(?:\\.${Q})*))`,en=`(?:${Y}|${X})`,et=`(?:-(${en}(?:\\.${en})*))`,er=`${Y}|x|X|\\*`,ea=`[v=\\s]*(${er})(?:\\.(${er})(?:\\.(${er})(?:${et})?${Z}?)?)?`,eo=`^\\s*(${ea})\\s+-\\s+(${ea})\\s*$`,ei=`(${J})\\.(${J})\\.(${J})`,es=`[v=\\s]*${ei}${ee}?${Z}?`,el="((?:<|>)?=?)",ec=`(\\s*)${el}\\s*(${es}|${ea})`,eu="(?:~>?)",ed=`(\\s*)${eu}\\s+`,ep="(?:\\^)",ef=`(\\s*)${ep}\\s+`,e_="(<|>)?=?\\s*\\*",eh=`^${ep}${ea}$`,em=`(${Y})\\.(${Y})\\.(${Y})`,eg=`v?${em}${et}?${Z}?`,eA=`^${eu}${ea}$`,ey=`^${el}\\s*${ea}$`,eb=`^${el}\\s*(${eg})$|^$`,ev="^\\s*>=\\s*0.0.0\\s*$";function eC(e){return new RegExp(e)}function e$(e){return!e||"x"===e.toLowerCase()||"*"===e}function ew(...e){return n=>e.reduce((e,n)=>n(e),n)}function ek(e){return e.match(eC(eb))}function eE(e,n,t,r){let a=`${e}.${n}.${t}`;return r?`${a}-${r}`:a}function ex(e){return e.replace(eC(eo),(e,n,t,r,a,o,i,s,l,c,u,d)=>(n=e$(t)?"":e$(r)?`>=${t}.0.0`:e$(a)?`>=${t}.${r}.0`:`>=${n}`,s=e$(l)?"":e$(c)?`<${Number(l)+1}.0.0-0`:e$(u)?`<${l}.${Number(c)+1}.0-0`:d?`<=${l}.${c}.${u}-${d}`:`<=${s}`,`${n} ${s}`.trim()))}function eD(e){return e.replace(eC(ec),"$1$2$3")}function eS(e){return e.replace(eC(ed),"$1~")}function ez(e){return e.replace(eC(ef),"$1^")}function eB(e){return e.trim().split(/\s+/).map(e=>e.replace(eC(eh),(e,n,t,r,a)=>{if(e$(n))return"";if(e$(t))return`>=${n}.0.0 <${Number(n)+1}.0.0-0`;if(e$(r))if("0"===n)return`>=${n}.${t}.0 <${n}.${Number(t)+1}.0-0`;else return`>=${n}.${t}.0 <${Number(n)+1}.0.0-0`;if(a)if("0"!==n)return`>=${n}.${t}.${r}-${a} <${Number(n)+1}.0.0-0`;else if("0"===t)return`>=${n}.${t}.${r}-${a} <${n}.${t}.${Number(r)+1}-0`;else return`>=${n}.${t}.${r}-${a} <${n}.${Number(t)+1}.0-0`;if("0"===n)if("0"===t)return`>=${n}.${t}.${r} <${n}.${t}.${Number(r)+1}-0`;else return`>=${n}.${t}.${r} <${n}.${Number(t)+1}.0-0`;return`>=${n}.${t}.${r} <${Number(n)+1}.0.0-0`})).join(" ")}function eM(e){return e.trim().split(/\s+/).map(e=>e.replace(eC(eA),(e,n,t,r,a)=>e$(n)?"":e$(t)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:e$(r)?`>=${n}.${t}.0 <${n}.${Number(t)+1}.0-0`:a?`>=${n}.${t}.${r}-${a} <${n}.${Number(t)+1}.0-0`:`>=${n}.${t}.${r} <${n}.${Number(t)+1}.0-0`)).join(" ")}function eT(e){return e.split(/\s+/).map(e=>e.trim().replace(eC(ey),(e,n,t,r,a,o)=>{let i=e$(t),s=i||e$(r),l=s||e$(a);if("="===n&&l&&(n=""),o="",i)if(">"===n||"<"===n)return"<0.0.0-0";else return"*";return n&&l?(s&&(r=0),a=0,">"===n?(n=">=",s?(t=Number(t)+1,r=0):r=Number(r)+1,a=0):"<="===n&&(n="<",s?t=Number(t)+1:r=Number(r)+1),"<"===n&&(o="-0"),`${n+t}.${r}.${a}${o}`):s?`>=${t}.0.0${o} <${Number(t)+1}.0.0-0`:l?`>=${t}.${r}.0${o} <${t}.${Number(r)+1}.0-0`:e})).join(" ")}function eO(e){return e.trim().replace(eC(e_),"")}function eN(e){return e.trim().replace(eC(ev),"")}function eP(e,n){return(e=Number(e)||e)>(n=Number(n)||n)?1:e===n?0:-1}function eI(e,n){let{preRelease:t}=e,{preRelease:r}=n;if(void 0===t&&r)return 1;if(t&&void 0===r)return -1;if(void 0===t&&void 0===r)return 0;for(let e=0,n=t.length;e<=n;e++){let n=t[e],a=r[e];if(n!==a){if(void 0===n&&void 0===a)return 0;if(!n)return 1;if(!a)return -1;return eP(n,a)}}return 0}function eF(e,n){return eP(e.major,n.major)||eP(e.minor,n.minor)||eP(e.patch,n.patch)||eI(e,n)}function eR(e,n){return e.version===n.version}function eH(e,n){switch(e.operator){case"":case"=":return eR(e,n);case">":return 0>eF(e,n);case">=":return eR(e,n)||0>eF(e,n);case"<":return eF(e,n)>0;case"<=":return eR(e,n)||eF(e,n)>0;case void 0:return!0;default:return!1}}function eL(e){return ew(eB,eM,eT,eO)(e)}function ej(e){return ew(ex,eD,eS,ez)(e.trim()).split(/\s+/).join(" ")}function eq(e,n){if(!e)return!1;let t=ek(e);if(!t)return!1;let[,r,,a,o,i,s]=t,l={operator:r,version:eE(a,o,i,s),major:a,minor:o,patch:i,preRelease:null==s?void 0:s.split(".")};for(let e of n.split("||")){let n=e.trim();if(!n||"*"===n||"x"===n)return!0;try{let e=ej(n);if(!e.trim())return!0;let t=e.split(" ").map(e=>eL(e)).join(" ");if(!t.trim())return!0;let r=t.split(/\s+/).map(e=>eN(e)).filter(Boolean);if(0===r.length)continue;let a=!0;for(let e of r){let n=ek(e);if(!n){a=!1;break}let[,t,,r,o,i,s]=n,c={operator:t,version:eE(r,o,i,s),major:r,minor:o,patch:i,preRelease:null==s?void 0:s.split(".")};if(!eH(c,l)){a=!1;break}}if(a)return!0}catch(e){console.error(`[semver] Error processing range part "${n}":`,e);continue}}return!1}function eG(e,n,t,a){var o,i,s;let l;return l="get"in e?e.get:"lib"in e?()=>Promise.resolve(e.lib):()=>Promise.resolve(()=>{throw Error(`Can not get shared '${t}'!`)}),r._extends({deps:[],useIn:[],from:n,loading:null},e,{shareConfig:r._extends({requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1},e.shareConfig),get:l,loaded:null!=e&&!!e.loaded||"lib"in e||void 0,version:null!=(o=e.version)?o:"0",scope:Array.isArray(e.scope)?e.scope:[null!=(i=e.scope)?i:"default"],strategy:(null!=(s=e.strategy)?s:a)||"version-first"})}function eV(e,n){let t=n.shared||{},a=n.name,o=Object.keys(t).reduce((e,r)=>{let o=v(t[r]);return e[r]=e[r]||[],o.forEach(t=>{e[r].push(eG(t,a,r,n.shareStrategy))}),e},{}),i=r._extends({},e.shared);return Object.keys(o).forEach(e=>{i[e]?o[e].forEach(n=>{i[e].find(e=>e.version===n.version)||i[e].push(n)}):i[e]=o[e]}),{shared:i,shareInfos:o}}function eU(e,n){let t=e=>{if(!Number.isNaN(Number(e))){let n=e.split("."),t=e;for(let e=0;e<3-n.length;e++)t+=".0";return t}return e};return!!eq(t(e),`<=${t(n)}`)}let eW=(e,n)=>{let t=n||function(e,n){return eU(e,n)};return Object.keys(e).reduce((e,n)=>!e||t(e,n)||"0"===e?n:e,0)},eK=e=>!!e.loaded||"function"==typeof e.lib,eZ=e=>!!e.loading;function eY(e,n,t){let r=e[n][t],a=function(e,n){return!eK(r[e])&&eU(e,n)};return eW(e[n][t],a)}function eJ(e,n,t){let r=e[n][t],a=function(e,n){let t=e=>eK(e)||eZ(e);if(t(r[n]))if(t(r[e]))return!!eU(e,n);else return!0;return!t(r[e])&&eU(e,n)};return eW(e[n][t],a)}function eX(e){return"loaded-first"===e?eJ:eY}function eQ(e,n,t,r){if(!e)return;let{shareConfig:a,scope:o=U,strategy:i}=t;for(let s of Array.isArray(o)?o:[o])if(a&&e[s]&&e[s][n]){let{requiredVersion:o}=a,l=eX(i)(e,s,n),d=()=>{if(a.singleton){if("string"==typeof o&&!eq(l,o)){let r=`Version ${l} from ${l&&e[s][n][l].from} of shared singleton module ${n} does not satisfy the requirement of ${t.from} which needs ${o})`;a.strictVersion?c(r):u(r)}return e[s][n][l]}if(!1===o||"*"===o||eq(l,o))return e[s][n][l];for(let[t,r]of Object.entries(e[s][n]))if(eq(t,o))return r},p={shareScopeMap:e,scope:s,pkgName:n,version:l,GlobalFederation:E.__FEDERATION__,resolver:d};return(r.emit(p)||p).resolver()}}function e0(){return E.__FEDERATION__.__SHARE__}function e1(e){var n;let{pkgName:t,extraOptions:r,shareInfos:a}=e,o=e=>{if(!e)return;let n={};e.forEach(e=>{n[e.version]=e});let t=function(e,t){return!eK(n[e])&&eU(e,t)},r=eW(n,t);return n[r]};return Object.assign({},(null!=(n=null==r?void 0:r.resolver)?n:o)(a[t]),null==r?void 0:r.customShareInfo)}function e2(){return"undefined"!=typeof FEDERATION_BUILD_IDENTIFIER?FEDERATION_BUILD_IDENTIFIER:""}function e3(e,n){for(let t of e){let e=n.startsWith(t.name),r=n.replace(t.name,"");if(e){if(r.startsWith("/"))return{pkgNameOrAlias:t.name,expose:r=`.${r}`,remote:t};else if(""===r)return{pkgNameOrAlias:t.name,expose:".",remote:t}}let a=t.alias&&n.startsWith(t.alias),o=t.alias&&n.replace(t.alias,"");if(t.alias&&a){if(o&&o.startsWith("/"))return{pkgNameOrAlias:t.alias,expose:o=`.${o}`,remote:t};else if(""===o)return{pkgNameOrAlias:t.alias,expose:".",remote:t}}}}function e4(e,n){for(let t of e)if(n===t.name||t.alias&&n===t.alias)return t}function e5(e,n){let t=q(),r=[n.hooks,n.remoteHandler.hooks,n.sharedHandler.hooks,n.snapshotHandler.hooks,n.loaderHook,n.bridgeHook];return t.length>0&&t.forEach(n=>{(null==e?void 0:e.find(e=>e.name!==n.name))&&e.push(n)}),e&&e.length>0&&e.forEach(e=>{r.forEach(t=>{t.applyPlugin(e,n)})}),e}let e6=".then(callbacks[0]).catch(callbacks[1])";async function e8({entry:e,remoteEntryExports:n}){return new Promise((t,r)=>{try{n?t(n):"undefined"!=typeof FEDERATION_ALLOW_NEW_FUNCTION?Function("callbacks",`import("${e}")${e6}`)([t,r]):import(e).then(t).catch(r)}catch(e){r(e)}})}async function e7({entry:e,remoteEntryExports:n}){return new Promise((t,r)=>{try{n?t(n):Function("callbacks",`System.import("${e}")${e6}`)([t,r])}catch(e){r(e)}})}function e9(e,n,t){let{remoteEntryKey:r,entryExports:a}=L(e,n);return l(a,o.getShortErrorMsg(o.RUNTIME_001,o.runtimeDescMap,{remoteName:e,remoteEntryUrl:t,remoteEntryKey:r})),a}async function ne({name:e,globalName:n,entry:t,loaderHook:r}){let{entryExports:i}=L(e,n);return i||a.loadScript(t,{attrs:{},createScriptHook:(e,n)=>{let t=r.lifecycle.createScript.emit({url:e,attrs:n});if(t&&(t instanceof HTMLScriptElement||"script"in t||"timeout"in t))return t}}).then(()=>e9(e,n,t)).catch(n=>{throw l(void 0,o.getShortErrorMsg(o.RUNTIME_008,o.runtimeDescMap,{remoteName:e,resourceUrl:t})),n})}async function nn({remoteInfo:e,remoteEntryExports:n,loaderHook:t}){let{entry:r,entryGlobalName:a,name:o,type:i}=e;switch(i){case"esm":case"module":return e8({entry:r,remoteEntryExports:n});case"system":return e7({entry:r,remoteEntryExports:n});default:return ne({entry:r,globalName:a,name:o,loaderHook:t})}}async function nt({remoteInfo:e,loaderHook:n}){let{entry:t,entryGlobalName:r,name:o,type:i}=e,{entryExports:s}=L(o,r);return s||a.loadScriptNode(t,{attrs:{name:o,globalName:r,type:i},loaderHook:{createScriptHook:(e,t={})=>{let r=n.lifecycle.createScript.emit({url:e,attrs:t});if(r&&"url"in r)return r}}}).then(()=>e9(o,r,t)).catch(e=>{throw e})}function nr(e){let{entry:n,name:t}=e;return a.composeKeyWithSeparator(t,n)}async function na({origin:e,remoteEntryExports:n,remoteInfo:t}){let r=nr(t);if(n)return n;if(!S[r]){let o=e.remoteHandler.hooks.lifecycle.loadEntry,i=e.loaderHook;S[r]=o.emit({loaderHook:i,remoteInfo:t,remoteEntryExports:n}).then(e=>e||(("undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:a.isBrowserEnv())?nn({remoteInfo:t,remoteEntryExports:n,loaderHook:i}):nt({remoteInfo:t,loaderHook:i})))}return S[r]}function no(e){return r._extends({},e,{entry:"entry"in e?e.entry:"",type:e.type||W,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||U})}function ni(e){return r._extends({resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1},e)}function ns(e,n){return n.map(n=>{let t=e4(e,n.nameOrAlias);return l(t,`Unable to preload ${n.nameOrAlias} as it is not included in ${!t&&a.safeToString({remoteInfo:t,remotes:e})}`),{remote:t,preloadConfig:ni(n)}})}function nl(e){return e?e.map(e=>"."===e?e:e.startsWith("./")?e.replace("./",""):e):[]}function nc(e,n,t,r=!0){let{cssAssets:o,jsAssetsWithoutEntry:i,entryAssets:s}=t;if(n.options.inBrowser){if(s.forEach(t=>{let{moduleInfo:r}=t,a=n.moduleCache.get(e.name);a?na({origin:n,remoteInfo:r,remoteEntryExports:a.remoteEntryExports}):na({origin:n,remoteInfo:r,remoteEntryExports:void 0})}),r){let e={rel:"preload",as:"style"};o.forEach(t=>{let{link:r,needAttach:o}=a.createLink({url:t,cb:()=>{},attrs:e,createLinkHook:(e,t)=>{let r=n.loaderHook.lifecycle.createLink.emit({url:e,attrs:t});if(r instanceof HTMLLinkElement)return r}});o&&document.head.appendChild(r)})}else{let e={rel:"stylesheet",type:"text/css"};o.forEach(t=>{let{link:r,needAttach:o}=a.createLink({url:t,cb:()=>{},attrs:e,createLinkHook:(e,t)=>{let r=n.loaderHook.lifecycle.createLink.emit({url:e,attrs:t});if(r instanceof HTMLLinkElement)return r},needDeleteLink:!1});o&&document.head.appendChild(r)})}if(r){let e={rel:"preload",as:"script"};i.forEach(t=>{let{link:r,needAttach:o}=a.createLink({url:t,cb:()=>{},attrs:e,createLinkHook:(e,t)=>{let r=n.loaderHook.lifecycle.createLink.emit({url:e,attrs:t});if(r instanceof HTMLLinkElement)return r}});o&&document.head.appendChild(r)})}else{let t={fetchpriority:"high",type:(null==e?void 0:e.type)==="module"?"module":"text/javascript"};i.forEach(e=>{let{script:r,needAttach:o}=a.createScript({url:e,cb:()=>{},attrs:t,createScriptHook:(e,t)=>{let r=n.loaderHook.lifecycle.createScript.emit({url:e,attrs:t});if(r instanceof HTMLScriptElement)return r},needDeleteScript:!0});o&&document.head.appendChild(r)})}}}var nu={global:{Global:E,nativeGlobal:k,resetFederationGlobalInfo:B,setGlobalFederationInstance:M,getGlobalFederationConstructor:T,setGlobalFederationConstructor:O,getInfoWithoutType:N,getGlobalSnapshot:P,getTargetSnapshotInfoByModuleInfo:I,getGlobalSnapshotInfoByModuleInfo:F,setGlobalSnapshotInfoByModuleInfo:R,addGlobalSnapshot:H,getRemoteEntryExports:L,registerGlobalPlugins:j,getGlobalHostPlugins:q,getPreloaded:G,setPreloaded:V},share:{getRegisteredShare:eQ,getGlobalShareScope:e0},utils:{matchRemoteWithNameAndExpose:e3,preloadAssets:nc,getRemoteInfo:no}};let nd=class{async getEntry(){let e;if(this.remoteEntryExports)return this.remoteEntryExports;try{e=await na({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports})}catch(t){let n=nr(this.remoteInfo);e=await this.host.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:na,origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,globalLoading:S,uniqueKey:n})}return l(e,`remoteEntryExports is undefined
|
|
13
|
+
}`.trim(),document.head.prepend(r);let a=t=>{if(2!==t.touches.length&&!n){if(!e||e===document.documentElement||e===document.body)return void t.preventDefault();e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&t.preventDefault()}},o=e=>{let n=e.target,t=e.relatedTarget;if(t&&lb(t))t.focus({preventScroll:!0}),lD(t,lb(n));else if(!t){var r;let e=null==(r=n.parentElement)?void 0:r.closest("[tabindex]");null==e||e.focus({preventScroll:!0})}},i=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(e){let n=null!=document.activeElement&&lb(document.activeElement);i.call(this,{...e,preventScroll:!0}),e&&e.preventScroll||lD(this,n)};let s=eB(lx(document,"touchstart",t,{passive:!1,capture:!0}),lx(document,"touchmove",a,{passive:!1,capture:!0}),lx(document,"blur",o,!0));return()=>{s(),r.remove(),HTMLElement.prototype.focus=i}}function lE(e,n,t){let r=e.style[n];return e.style[n]=t,()=>{e.style[n]=r}}function lx(e,n,t,r){return e.addEventListener(n,t,r),()=>{e.removeEventListener(n,t,r)}}function lD(e,n){n||!lv?lS(e):lv.addEventListener("resize",()=>lS(e),{once:!0})}function lS(e){let n=document.scrollingElement||document.documentElement,t=e;for(;t&&t!==n;){let e=ag(t);if(e!==document.documentElement&&e!==document.body&&e!==t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(r.top<n.top||r.bottom>n.top+t.clientHeight){let t=n.bottom;lv&&(t=Math.min(t,lv.offsetTop+lv.height));let a=r.top-n.top-((t-n.top)/2-r.height/2);e.scrollTo({top:Math.max(0,Math.min(e.scrollHeight-e.clientHeight,e.scrollTop+a)),behavior:"smooth"})}}t=e.parentElement}}function lz(e,n){let{triggerRef:t,popoverRef:r,groupRef:a,isNonModal:o,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:s,...l}=e,c="SubmenuTrigger"===l.trigger,{overlayProps:u,underlayProps:d}=lA({isOpen:n.isOpen,onClose:n.close,shouldCloseOnBlur:!0,isDismissable:!o||c,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:s},null!=a?a:r),{overlayProps:p,arrowProps:f,placement:h,triggerAnchorPoint:m}=lp({...l,targetRef:t,overlayRef:r,isOpen:n.isOpen,onClose:o&&!c?n.close:null});return l$({isDisabled:o||!n.isOpen}),(0,g.useEffect)(()=>{if(n.isOpen&&r.current){var e,t;return o?sV(null!=(e=null==a?void 0:a.current)?e:r.current):sG([null!=(t=null==a?void 0:a.current)?t:r.current],{shouldUseInert:!0})}},[o,n.isOpen,r,a]),{popoverProps:eq(u,p),arrowProps:f,underlayProps:d,placement:h,triggerAnchorPoint:m}}var lB={},lM={},lT={},lO={},lN={},lP={},lI={},lF={},lR={},lH={},lL={},lj={},lq={},lG={},lV={},lU={},lW={},lK={},lZ={},lY={},lJ={},lX={},lQ={},l0={},l1={},l2={},l3={},l4={},l5={},l6={},l8={},l7={},l9={},ce={},cn={};function ct(e){return e&&e.__esModule?e.default:e}function cr(e){let{onDismiss:n,...t}=e,r=r9(t,rq(ct(cn),"@react-aria/overlays").format("dismiss")),a=()=>{n&&n()};return g.createElement(ao,null,g.createElement("button",{...r,tabIndex:-1,onClick:a,style:{width:1,height:1}}))}function ca(e,n=!0){let[t,r]=(0,g.useState)(!0),a=t&&n;return eM(()=>{if(a&&e.current&&"getAnimations"in e.current)for(let n of e.current.getAnimations())n instanceof CSSTransition&&n.cancel()},[e,a]),ci(e,a,(0,g.useCallback)(()=>r(!1),[])),a}function co(e,n){let[t,r]=(0,g.useState)(n?"open":"closed");switch(t){case"open":n||r("exiting");break;case"closed":case"exiting":n&&r("open")}let a="exiting"===t;return ci(e,a,(0,g.useCallback)(()=>{r(e=>"exiting"===e?"closed":e)},[])),a}function ci(e,n,t){eM(()=>{if(n&&e.current){if(!("getAnimations"in e.current))return void t();let n=e.current.getAnimations();if(0===n.length)return void t();let r=!1;return Promise.all(n.map(e=>e.finished)).then(()=>{r||(0,n9.flushSync)(()=>{t()})}).catch(()=>{}),()=>{r=!0}}},[e,n,t])}function cs(e){let[n,t]=aD(e.isOpen,e.defaultOpen||!1,e.onOpenChange),r=(0,g.useCallback)(()=>{t(!0)},[t]),a=(0,g.useCallback)(()=>{t(!1)},[t]),o=(0,g.useCallback)(()=>{t(!n)},[t,n]);return{isOpen:n,setOpen:t,open:r,close:a,toggle:o}}cn={"ar-AE":lB={dismiss:`\u{62A}\u{62C}\u{627}\u{647}\u{644}`},"bg-BG":lM={dismiss:`\u{41E}\u{442}\u{445}\u{432}\u{44A}\u{440}\u{43B}\u{44F}\u{43D}\u{435}`},"cs-CZ":lT={dismiss:"Odstranit"},"da-DK":lO={dismiss:"Luk"},"de-DE":lN={dismiss:`Schlie\xdfen`},"el-GR":lP={dismiss:`\u{391}\u{3C0}\u{3CC}\u{3C1}\u{3C1}\u{3B9}\u{3C8}\u{3B7}`},"en-US":lI={dismiss:"Dismiss"},"es-ES":lF={dismiss:"Descartar"},"et-EE":lR={dismiss:`L\xf5peta`},"fi-FI":lH={dismiss:`Hylk\xe4\xe4`},"fr-FR":lL={dismiss:"Rejeter"},"he-IL":lj={dismiss:`\u{5D4}\u{5EA}\u{5E2}\u{5DC}\u{5DD}`},"hr-HR":lq={dismiss:"Odbaci"},"hu-HU":lG={dismiss:`Elutas\xedt\xe1s`},"it-IT":lV={dismiss:"Ignora"},"ja-JP":lU={dismiss:`\u{9589}\u{3058}\u{308B}`},"ko-KR":lW={dismiss:`\u{BB34}\u{C2DC}`},"lt-LT":lK={dismiss:"Atmesti"},"lv-LV":lZ={dismiss:`Ner\u{101}d\u{12B}t`},"nb-NO":lY={dismiss:"Lukk"},"nl-NL":lJ={dismiss:"Negeren"},"pl-PL":lX={dismiss:"Zignoruj"},"pt-BR":lQ={dismiss:"Descartar"},"pt-PT":l0={dismiss:"Dispensar"},"ro-RO":l1={dismiss:"Revocare"},"ru-RU":l2={dismiss:`\u{41F}\u{440}\u{43E}\u{43F}\u{443}\u{441}\u{442}\u{438}\u{442}\u{44C}`},"sk-SK":l3={dismiss:`Zru\u{161}i\u{165}`},"sl-SI":l4={dismiss:"Opusti"},"sr-SP":l5={dismiss:"Odbaci"},"sv-SE":l6={dismiss:"Avvisa"},"tr-TR":l8={dismiss:"Kapat"},"uk-UA":l7={dismiss:`\u{421}\u{43A}\u{430}\u{441}\u{443}\u{432}\u{430}\u{442}\u{438}`},"zh-CN":l9={dismiss:`\u{53D6}\u{6D88}`},"zh-TW":ce={dismiss:`\u{95DC}\u{9589}`}};let cl=(0,g.createContext)(null),cc=(0,g.createContext)(null),cu=(0,g.forwardRef)(function(e,n){[e,n]=eK(e,n,cl);let t=(0,g.useContext)(sx),r=cs(e),a=null==e.isOpen&&null==e.defaultOpen&&t?t:r,o=co(n,a.isOpen)||e.isExiting||!1,i=t0(),{direction:s}=ex();if(i){let n=e.children;return"function"==typeof n&&(n=n({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),g.createElement(g.Fragment,null,n)}return!a||a.isOpen||o?g.createElement(cd,{...e,triggerRef:e.triggerRef,state:a,popoverRef:n,isExiting:o,dir:s}):null});function cd({state:e,isExiting:n,UNSTABLE_portalContainer:t,clearContexts:r,...a}){var o,i;let s=(0,g.useRef)(null),l=(0,g.useRef)(null),c=(0,g.useContext)(cc),u=c&&"SubmenuTrigger"===a.trigger,{popoverProps:d,underlayProps:p,arrowProps:f,placement:h,triggerAnchorPoint:m}=lz({...a,offset:null!=(o=a.offset)?o:8,arrowRef:s,groupRef:u?c:l},e),A=a.popoverRef,y=ca(A,!!h)||a.isEntering||!1,b=eU({...a,defaultClassName:"react-aria-Popover",values:{trigger:a.trigger||null,placement:h,isEntering:y,isExiting:n}}),v=!a.isNonModal||"SubmenuTrigger"===a.trigger,[C,$]=(0,g.useState)(!1);eM(()=>{A.current&&$(v&&!A.current.querySelector("[role=dialog]"))},[A,v]),(0,g.useEffect)(()=>{C&&"SubmenuTrigger"!==a.trigger&&A.current&&!A.current.contains(document.activeElement)&&tP(A.current)},[C,A,a.trigger]);let w=(0,g.useMemo)(()=>{let e=b.children;if(r)for(let n of r)e=g.createElement(n.Provider,{value:null},e);return e},[b.children,r]),k={...d.style,"--trigger-anchor-point":m?`${m.x}px ${m.y}px`:void 0,...b.style},E=g.createElement("div",{...eq(e9(a,{global:!0}),d),...b,role:C?"dialog":void 0,tabIndex:C?-1:void 0,"aria-label":a["aria-label"],"aria-labelledby":a["aria-labelledby"],ref:A,slot:a.slot||void 0,style:k,dir:a.dir,"data-trigger":a.trigger,"data-placement":h,"data-entering":y||void 0,"data-exiting":n||void 0},!a.isNonModal&&g.createElement(cr,{onDismiss:e.close}),g.createElement(sH.Provider,{value:{...f,placement:h,ref:s}},w),g.createElement(cr,{onDismiss:e.close}));return u?g.createElement(s$,{...a,shouldContainFocus:C,isExiting:n,portalContainer:null!=(i=null!=t?t:null==c?void 0:c.current)?i:void 0},E):g.createElement(s$,{...a,shouldContainFocus:C,isExiting:n,portalContainer:t},!a.isNonModal&&e.isOpen&&g.createElement("div",{"data-testid":"underlay",...p,style:{position:"fixed",inset:0}}),g.createElement("div",{ref:l,style:{display:"contents"}},g.createElement(cc.Provider,{value:l},E)))}function cp(e){return e&&e.__esModule?e.default:e}function cf(e,n,t){let r=eF(),a=eF(),o=eF(),i=rq(cp(ok),"@react-aria/datepicker"),{isInvalid:s,validationErrors:l,validationDetails:c}=n.displayValidation,{labelProps:u,fieldProps:d,descriptionProps:p,errorMessageProps:f}=o6({...e,labelElementType:"span",isInvalid:s,errorMessage:e.errorMessage||l}),h=o2(n,t),m=d["aria-labelledby"]||d.id,{locale:A}=ex(),y=n.formatValue(A,{month:"long"}),b=ad(y?i.format("selectedDateDescription",{date:y}):""),v=[b["aria-describedby"],d["aria-describedby"]].filter(Boolean).join(" ")||void 0,C=e9(e),$=(0,g.useMemo)(()=>oJ(t),[t]),w=(0,g.useRef)(!1),{focusWithinProps:k}=tG({...e,isDisabled:n.isOpen,onBlurWithin:n=>{let t=document.getElementById(a);if(!(null==t?void 0:t.contains(n.relatedTarget))){var r,o;w.current=!1,null==(r=e.onBlur)||r.call(e,n),null==(o=e.onFocusChange)||o.call(e,!1)}},onFocusWithin:n=>{if(!w.current){var t,r;w.current=!0,null==(t=e.onFocus)||t.call(e,n),null==(r=e.onFocusChange)||r.call(e,!0)}}});return{groupProps:eq(C,h,d,b,k,{role:"group","aria-disabled":e.isDisabled||null,"aria-labelledby":m,"aria-describedby":v,onKeyDown(t){!n.isOpen&&e.onKeyDown&&e.onKeyDown(t)},onKeyUp(t){!n.isOpen&&e.onKeyUp&&e.onKeyUp(t)}}),labelProps:{...u,onClick:()=>{$.focusFirst()}},fieldProps:{...d,id:o,[ia]:"presentation","aria-describedby":v,value:n.value,defaultValue:n.defaultValue,onChange:n.setValue,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,granularity:e.granularity,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior,[iK]:n,autoFocus:e.autoFocus,name:e.name,form:e.form},descriptionProps:p,errorMessageProps:f,buttonProps:{...b,id:r,"aria-haspopup":"dialog","aria-label":i.format("calendar"),"aria-labelledby":`${r} ${m}`,"aria-describedby":v,"aria-expanded":n.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>n.setOpen(!0)},dialogProps:{id:a,"aria-labelledby":`${r} ${m}`},calendarProps:{autoFocus:!0,value:n.dateValue,onChange:n.setDateValue,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,defaultFocusedValue:n.dateValue?void 0:e.placeholderValue,isInvalid:n.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(n.displayValidation):e.errorMessage||n.displayValidation.validationErrors.join(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:s,validationErrors:l,validationDetails:c}}function c_(e){return e&&e.__esModule?e.default:e}function ch(e,n,t){var r,a,o,i,s,l,c;let u=rq(c_(ok),"@react-aria/datepicker"),{isInvalid:d,validationErrors:p,validationDetails:f}=n.displayValidation,{labelProps:h,fieldProps:m,descriptionProps:A,errorMessageProps:y}=o6({...e,labelElementType:"span",isInvalid:d,errorMessage:e.errorMessage||p}),b=m["aria-labelledby"]||m.id,{locale:v}=ex(),C=n.formatValue(v,{month:"long"}),$=ad(C?u.format("selectedRangeDescription",{startDate:C.start,endDate:C.end}):""),w={"aria-label":u.format("startDate"),"aria-labelledby":b},k={"aria-label":u.format("endDate"),"aria-labelledby":b},E=eF(),x=eF(),D=o2(n,t),S=[$["aria-describedby"],m["aria-describedby"]].filter(Boolean).join(" ")||void 0,z=(0,g.useMemo)(()=>oJ(t,{accept:e=>e.id!==E}),[t,E]),B={[io]:z,[ia]:"presentation","aria-describedby":S,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,granularity:e.granularity,shouldForceLeadingZeros:e.shouldForceLeadingZeros,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior},M=e9(e),T=(0,g.useRef)(!1),{focusWithinProps:O}=tG({...e,isDisabled:n.isOpen,onBlurWithin:n=>{let t=document.getElementById(x);if(!(null==t?void 0:t.contains(n.relatedTarget))){var r,a;T.current=!1,null==(r=e.onBlur)||r.call(e,n),null==(a=e.onFocusChange)||a.call(e,!1)}},onFocusWithin:n=>{if(!T.current){var t,r;T.current=!0,null==(t=e.onFocus)||t.call(e,n),null==(r=e.onFocusChange)||r.call(e,!0)}}}),N=(0,g.useRef)(iU),P=(0,g.useRef)(iU);return{groupProps:eq(M,D,m,$,O,{role:"group","aria-disabled":e.isDisabled||null,"aria-describedby":S,onKeyDown(t){!n.isOpen&&e.onKeyDown&&e.onKeyDown(t)},onKeyUp(t){!n.isOpen&&e.onKeyUp&&e.onKeyUp(t)}}),labelProps:{...h,onClick:()=>{z.focusFirst()}},buttonProps:{...$,id:E,"aria-haspopup":"dialog","aria-label":u.format("calendar"),"aria-labelledby":`${E} ${b}`,"aria-describedby":S,"aria-expanded":n.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>n.setOpen(!0)},dialogProps:{id:x,"aria-labelledby":`${E} ${b}`},startFieldProps:{...w,...B,value:null!=(l=null==(r=n.value)?void 0:r.start)?l:null,defaultValue:null==(a=n.defaultValue)?void 0:a.start,onChange:e=>n.setDateTime("start",e),autoFocus:e.autoFocus,name:e.startName,form:e.form,[iK]:{realtimeValidation:n.realtimeValidation,displayValidation:n.displayValidation,updateValidation(e){N.current=e,n.updateValidation(i1(e,P.current))},resetValidation:n.resetValidation,commitValidation:n.commitValidation}},endFieldProps:{...k,...B,value:null!=(c=null==(o=n.value)?void 0:o.end)?c:null,defaultValue:null==(i=n.defaultValue)?void 0:i.end,onChange:e=>n.setDateTime("end",e),name:e.endName,form:e.form,[iK]:{realtimeValidation:n.realtimeValidation,displayValidation:n.displayValidation,updateValidation(e){P.current=e,n.updateValidation(i1(N.current,e))},resetValidation:n.resetValidation,commitValidation:n.commitValidation}},descriptionProps:A,errorMessageProps:y,calendarProps:{autoFocus:!0,value:(null==(s=n.dateRange)?void 0:s.start)&&n.dateRange.end?n.dateRange:null,onChange:n.setDateRange,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,allowsNonContiguousRanges:e.allowsNonContiguousRanges,defaultFocusedValue:n.dateRange?void 0:e.placeholderValue,isInvalid:n.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(n.displayValidation):e.errorMessage||n.displayValidation.validationErrors.join(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:d,validationErrors:p,validationDetails:f}}function cm(e){var n,t;let r=cs(e),[a,o]=aD(e.value,e.defaultValue||null,e.onChange),[i]=(0,g.useState)(a),s=a||e.placeholderValue||null,[l,c]=st(s,e.granularity),u=null!=a?a.toDate(null!=c?c:"UTC"):null,d="hour"===l||"minute"===l||"second"===l,p=null==(n=e.shouldCloseOnSelect)||n,[f,h]=(0,g.useState)(null),[m,A]=(0,g.useState)(null);if(a&&(f=a,"hour"in a&&(m=a)),s&&!(l in s))throw Error("Invalid granularity "+l+" for value "+s.toString());let y=(null==a?void 0:a.calendar.identifier)==="gregory"&&"BC"===a.era,b=(0,g.useMemo)(()=>({granularity:l,timeZone:c,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:y}),[l,e.hourCycle,e.shouldForceLeadingZeros,c,e.hideTimeZone,y]),{minValue:v,maxValue:C,isDateUnavailable:$}=e,w=(0,g.useMemo)(()=>i4(a,v,C,$,b),[a,v,C,$,b]),k=iZ({...e,value:a,builtinValidation:w}),E=k.displayValidation.isInvalid,x=e.validationState||(E?"invalid":null),D=(e,n)=>{o("timeZone"in n?n.set((0,ee.gw)(e)):(0,ee.tR)(e,n)),h(null),A(null),k.commitValidation()},S=n=>{let t="function"==typeof p?p():p;d?m||t?D(n,m||i9(e.defaultValue||e.placeholderValue)):h(n):(o(n),k.commitValidation()),t&&r.setOpen(!1)},z=e=>{f&&e?D(f,e):A(e)};return{...k,value:a,defaultValue:null!=(t=e.defaultValue)?t:i,setValue:o,dateValue:f,timeValue:m,setDateValue:S,setTimeValue:z,granularity:l,hasTime:d,...r,setOpen(n){!n&&!a&&f&&d&&D(f,m||i9(e.defaultValue||e.placeholderValue)),r.setOpen(n)},validationState:x,isInvalid:E,formatValue:(e,n)=>u?new rV(e,i7(n,b)).format(u):"",getDateFormatter:(e,n)=>new rV(e,i7({},{...b,...n}))}}function cg(e){var n,t,r,a;let o=cs(e),[i,s]=aD(e.value,e.defaultValue||null,e.onChange),[l]=(0,g.useState)(i),[c,u]=(0,g.useState)(()=>i||{start:null,end:null});null==i&&c.start&&c.end&&u(c={start:null,end:null});let d=i||c,p=e=>{u(d=e||{start:null,end:null}),cA(d)?s(d):s(null)},[f,h]=st((null==d?void 0:d.start)||(null==d?void 0:d.end)||e.placeholderValue||null,e.granularity),m="hour"===f||"minute"===f||"second"===f,A=null==(r=e.shouldCloseOnSelect)||r,[y,b]=(0,g.useState)(null),[v,C]=(0,g.useState)(null);d&&cA(d)&&(y=d,"hour"in d.start&&(v=d));let $=(e,n)=>{p({start:"timeZone"in n.start?n.start.set((0,ee.gw)(e.start)):(0,ee.tR)(e.start,n.start),end:"timeZone"in n.end?n.end.set((0,ee.gw)(e.end)):(0,ee.tR)(e.end,n.end)}),b(null),C(null),M.commitValidation()},w=n=>{let t="function"==typeof A?A():A;m?cA(n)&&(t||(null==v?void 0:v.start)&&(null==v?void 0:v.end))?$(n,{start:(null==v?void 0:v.start)||i9(e.placeholderValue),end:(null==v?void 0:v.end)||i9(e.placeholderValue)}):b(n):cA(n)?(p(n),M.commitValidation()):b(n),t&&o.setOpen(!1)},k=e=>{cA(y)&&cA(e)?$(y,e):C(e)},E=(null==d||null==(n=d.start)?void 0:n.calendar.identifier)==="gregory"&&"BC"===d.start.era||(null==d||null==(t=d.end)?void 0:t.calendar.identifier)==="gregory"&&"BC"===d.end.era,x=(0,g.useMemo)(()=>({granularity:f,timeZone:h,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:E}),[f,e.hourCycle,e.shouldForceLeadingZeros,h,e.hideTimeZone,E]),{minValue:D,maxValue:S,isDateUnavailable:z}=e,B=(0,g.useMemo)(()=>i5(d,D,S,z,x),[d,D,S,z,x]),M=iZ({...e,value:i,name:(0,g.useMemo)(()=>[e.startName,e.endName].filter(e=>null!=e),[e.startName,e.endName]),builtinValidation:B}),T=M.displayValidation.isInvalid,O=e.validationState||(T?"invalid":null);return{...M,value:d,defaultValue:null!=(a=e.defaultValue)?a:l,setValue:p,dateRange:y,timeRange:v,granularity:f,hasTime:m,setDate(e,n){var t,r;"start"===e?w({start:n,end:null!=(t=null==y?void 0:y.end)?t:null}):w({start:null!=(r=null==y?void 0:y.start)?r:null,end:n})},setTime(e,n){var t,r;"start"===e?k({start:n,end:null!=(t=null==v?void 0:v.end)?t:null}):k({start:null!=(r=null==v?void 0:v.start)?r:null,end:n})},setDateTime(e,n){var t,r;"start"===e?p({start:n,end:null!=(t=null==d?void 0:d.end)?t:null}):p({start:null!=(r=null==d?void 0:d.start)?r:null,end:n})},setDateRange:w,setTimeRange:k,...o,setOpen(n){!n&&!((null==d?void 0:d.start)&&(null==d?void 0:d.end))&&cA(y)&&m&&$(y,{start:(null==v?void 0:v.start)||i9(e.placeholderValue),end:(null==v?void 0:v.end)||i9(e.placeholderValue)}),o.setOpen(n)},validationState:O,isInvalid:T,formatValue(n,t){let r;if(!d||!d.start||!d.end)return null;let a="timeZone"in d.start?d.start.timeZone:void 0,o=e.granularity||(d.start&&"minute"in d.start?"minute":"day"),i="timeZone"in d.end?d.end.timeZone:void 0,s=e.granularity||(d.end&&"minute"in d.end?"minute":"day"),l=i7(t,{granularity:o,timeZone:a,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,showEra:"gregory"===d.start.calendar.identifier&&"BC"===d.start.era||"gregory"===d.end.calendar.identifier&&"BC"===d.end.era}),c=d.start.toDate(a||"UTC"),u=d.end.toDate(i||"UTC"),p=new rV(n,l);if(a===i&&o===s&&0!==d.start.compare(d.end)){try{let e=p.formatRangeToParts(c,u),n=-1;for(let t=0;t<e.length;t++){let r=e[t];if("shared"===r.source&&"literal"===r.type)n=t;else if("endRange"===r.source)break}let t="",r="";for(let a=0;a<e.length;a++)a<n?t+=e[a].value:a>n&&(r+=e[a].value);return{start:t,end:r}}catch{}r=p}else r=new rV(n,i7(t,{granularity:s,timeZone:i,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle}));return{start:p.format(c),end:r.format(u)}},getDateFormatter:(e,n)=>new rV(e,i7({},{...x,...n}))}}function cA(e){return(null==e?void 0:e.start)!=null&&null!=e.end}let cy=(0,g.createContext)(null),cb=(0,g.createContext)(null),cv=(0,g.createContext)(null),cC=(0,g.createContext)(null),c$=[aY,t1,sF,t5],cw=(0,g.forwardRef)(function(e,n){var t,r;[e,n]=eK(e,n,cy);let{validationBehavior:a}=eW(sM)||{},o=null!=(r=null!=(t=e.validationBehavior)?t:a)?r:"native",i=cm({...e,validationBehavior:o}),s=(0,g.useRef)(null),[l,c]=eZ(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:u,labelProps:d,fieldProps:p,buttonProps:f,dialogProps:h,calendarProps:m,descriptionProps:A,errorMessageProps:y,...b}=cf({...eY(e),label:c,validationBehavior:o},i,s),[v,C]=(0,g.useState)(null),$=(0,g.useCallback)(()=>{s.current&&C(s.current.offsetWidth+"px")},[]);lu({ref:s,onResize:$});let{focusProps:w,isFocused:k,isFocusVisible:E}=tV({within:!0}),x=eU({...e,values:{state:i,isFocusWithin:k,isFocusVisible:E,isDisabled:e.isDisabled||!1,isInvalid:i.isInvalid,isOpen:i.isOpen,isReadOnly:e.isReadOnly||!1},defaultClassName:"react-aria-DatePicker"}),D=e9(e,{global:!0});return delete D.id,g.createElement(eV,{values:[[cv,i],[aY,{...u,ref:s,isInvalid:i.isInvalid}],[sf,p],[t1,{...f,isPressed:i.isOpen}],[sF,{...d,ref:l,elementType:"span"}],[aN,m],[sx,i],[cl,{trigger:"DatePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":v},clearContexts:c$}],[sE,h],[t5,{slots:{description:A,errorMessage:y}}],[sS,b]]},g.createElement("div",{...eq(D,x,w),ref:n,slot:e.slot||void 0,"data-focus-within":k||void 0,"data-invalid":i.isInvalid||void 0,"data-focus-visible":E||void 0,"data-disabled":e.isDisabled||void 0,"data-readonly":e.isReadOnly||void 0,"data-open":i.isOpen||void 0}),g.createElement(sI,{autoComplete:e.autoComplete,name:e.name,isDisabled:e.isDisabled,state:i}))}),ck=(0,g.forwardRef)(function(e,n){var t,r;[e,n]=eK(e,n,cb);let{validationBehavior:a}=eW(sM)||{},o=null!=(r=null!=(t=e.validationBehavior)?t:a)?r:"native",i=cg({...e,validationBehavior:o}),s=(0,g.useRef)(null),[l,c]=eZ(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:u,labelProps:d,startFieldProps:p,endFieldProps:f,buttonProps:h,dialogProps:m,calendarProps:A,descriptionProps:y,errorMessageProps:b,...v}=ch({...eY(e),label:c,validationBehavior:o},i,s),[C,$]=(0,g.useState)(null),w=(0,g.useCallback)(()=>{s.current&&$(s.current.offsetWidth+"px")},[]);lu({ref:s,onResize:w});let{focusProps:k,isFocused:E,isFocusVisible:x}=tV({within:!0}),D=eU({...e,values:{state:i,isFocusWithin:E,isFocusVisible:x,isDisabled:e.isDisabled||!1,isInvalid:i.isInvalid,isOpen:i.isOpen,isReadOnly:e.isReadOnly||!1},defaultClassName:"react-aria-DateRangePicker"}),S=e9(e,{global:!0});return delete S.id,g.createElement(eV,{values:[[cC,i],[aY,{...u,ref:s,isInvalid:i.isInvalid}],[t1,{...h,isPressed:i.isOpen}],[sF,{...d,ref:l,elementType:"span"}],[aP,A],[sx,i],[cl,{trigger:"DateRangePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":C},clearContexts:c$}],[sE,m],[sf,{slots:{start:p,end:f}}],[t5,{slots:{description:y,errorMessage:b}}],[sS,v]]},g.createElement("div",{...eq(S,D,k),ref:n,slot:e.slot||void 0,"data-focus-within":E||void 0,"data-invalid":i.isInvalid||void 0,"data-focus-visible":x||void 0,"data-disabled":e.isDisabled||void 0,"data-readonly":e.isReadOnly||void 0,"data-open":i.isOpen||void 0}))});var cE=t(42729),cx=t(22613),cD=t(48753),cS={};cS.styleTagTransform=T(),cS.setAttributes=S(),cS.insert=x().bind(null,"head"),cS.domAPI=k(),cS.insertStyleElement=B(),$()(cD.A,cS);let cz=cD.A&&cD.A.locals?cD.A.locals:void 0;function cB(e,n){if(null==e)return{};var t,r,a=cM(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function cM(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}var cT=["omrs-icon-activity","omrs-icon-add","omrs-icon-arrow-down","omrs-icon-arrow-left","omrs-icon-arrow-right","omrs-icon-arrow-up","omrs-icon-baby","omrs-icon-calendar-heat-map","omrs-icon-calendar","omrs-icon-caret-down","omrs-icon-caret-left","omrs-icon-caret-right","omrs-icon-caret-up","omrs-icon-chart-average","omrs-icon-checkmark-filled","omrs-icon-checkmark-outline","omrs-icon-chemistry","omrs-icon-chevron-down","omrs-icon-chevron-left","omrs-icon-chevron-right","omrs-icon-chevron-up","omrs-icon-close","omrs-icon-close-filled","omrs-icon-close-outline","omrs-icon-document","omrs-icon-document-attachment","omrs-icon-download","omrs-icon-drug-order","omrs-icon-edit","omrs-icon-event-schedule","omrs-icon-events","omrs-icon-gender-female","omrs-icon-gender-male","omrs-icon-gender-other","omrs-icon-gender-unknown","omrs-icon-generic-order-type","omrs-icon-group","omrs-icon-group-access","omrs-icon-hospital-bed","omrs-icon-image-medical","omrs-icon-information","omrs-icon-information-filled","omrs-icon-information-square","omrs-icon-inventory-management","omrs-icon-lab-order","omrs-icon-list-checked","omrs-icon-location","omrs-icon-material-order","omrs-icon-maximize","omrs-icon-medication","omrs-icon-message-queue","omrs-icon-microscope","omrs-icon-money","omrs-icon-mother","omrs-icon-movement","omrs-icon-overflow-menu--horizontal","omrs-icon-overflow-menu--vertical","omrs-icon-password","omrs-icon-pedestrian-family","omrs-icon-pen","omrs-icon-printer","omrs-icon-procedure-order","omrs-icon-programs","omrs-icon-renew","omrs-icon-referral-order","omrs-icon-report","omrs-icon-reset","omrs-icon-save","omrs-icon-search","omrs-icon-settings","omrs-icon-shopping-cart","omrs-icon-shopping-cart--arrow-down","omrs-icon-sticky-note-add","omrs-icon-switcher","omrs-icon-syringe","omrs-icon-table-of-contents","omrs-icon-table","omrs-icon-time","omrs-icon-tools","omrs-icon-translate","omrs-icon-trash-can","omrs-icon-tree-view--alt","omrs-icon-user-avatar","omrs-icon-user-follow","omrs-icon-user-xray","omrs-icon-user","omrs-icon-view-off","omrs-icon-view","omrs-icon-warning"],cO=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-activity",iconProps:e})})),cN=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-add",iconProps:e})})),cP=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-arrow-down",iconProps:e})})),cI=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-arrow-left",iconProps:e})})),cF=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-arrow-right",iconProps:e})})),cR=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-arrow-up",iconProps:e})})),cH=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-baby",iconProps:e})})),cL=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-calendar-heat-map",iconProps:e})})),cj=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-calendar",iconProps:e})})),cq=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-caret-down",iconProps:e})})),cG=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-caret-left",iconProps:e})})),cV=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-caret-right",iconProps:e})})),cU=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-caret-up",iconProps:e})})),cW=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-chart-average",iconProps:e})})),cK=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-checkmark-filled",iconProps:e})})),cZ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-checkmark-outline",iconProps:e})})),cY=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-chemistry",iconProps:e})})),cJ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-chevron-down",iconProps:e})})),cX=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-chevron-left",iconProps:e})})),cQ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-chevron-right",iconProps:e})})),c0=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-chevron-up",iconProps:e})})),c1=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-close",iconProps:e})})),c2=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-close-filled",iconProps:e})})),c3=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-close-outline",iconProps:e})})),c4=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-document",iconProps:e})})),c5=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-document-attachment",iconProps:e})})),c6=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-download",iconProps:e})})),c8=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-drug-order",iconProps:e})})),c7=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-edit",iconProps:e})})),c9=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-event-schedule",iconProps:e})})),ue=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-events",iconProps:e})})),un=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-gender-female",iconProps:e})})),ut=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-gender-male",iconProps:e})})),ur=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-gender-other",iconProps:e})})),ua=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-gender-unknown",iconProps:e})})),uo=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-generic-order-type",iconProps:e})})),ui=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-group",iconProps:e})})),us=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-group-access",iconProps:e})})),ul=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-hospital-bed",iconProps:e})})),uc=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-image-medical",iconProps:e})})),uu=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-information",iconProps:e})})),ud=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-information-filled",iconProps:e})})),up=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-information-square",iconProps:e})})),uf=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-inventory-management",iconProps:e})})),u_=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-lab-order",iconProps:e})})),uh=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-list-checked",iconProps:e})})),um=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-location",iconProps:e})})),ug=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-material-order",iconProps:e})})),uA=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-maximize",iconProps:e})})),uy=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-medication",iconProps:e})})),ub=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-message-queue",iconProps:e})})),uv=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-microscope",iconProps:e})})),uC=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-money",iconProps:e})})),u$=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-mother",iconProps:e})})),uw=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-movement",iconProps:e})})),uk=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),uE=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),ux=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-password",iconProps:e})})),uD=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-pedestrian-family",iconProps:e})})),uS=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-pen",iconProps:e})})),uz=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-printer",iconProps:e})})),uB=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-procedure-order",iconProps:e})})),uM=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-programs",iconProps:e})})),uT=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-referral-order",iconProps:e})})),uO=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-renew",iconProps:e})})),uN=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-report",iconProps:e})})),uP=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-reset",iconProps:e})})),uI=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-save",iconProps:e})})),uF=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-search",iconProps:e})})),uR=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-settings",iconProps:e})})),uH=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-switcher",iconProps:e})})),uL=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-shopping-cart",iconProps:e})})),uj=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-shopping-cart--arrow-down",iconProps:e})})),uq=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-sticky-note-add",iconProps:e})})),uG=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-syringe",iconProps:e})})),uV=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-table-of-contents",iconProps:e})})),uU=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-table",iconProps:e})})),uW=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-time",iconProps:e})})),uK=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-tools",iconProps:e})})),uZ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-translate",iconProps:e})})),uY=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-trash-can",iconProps:e})})),uJ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-tree-view--alt",iconProps:e})})),uX=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-user-avatar",iconProps:e})})),uQ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-user-follow",iconProps:e})})),u0=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-user-xray",iconProps:e})})),u1=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-user",iconProps:e})})),u2=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-view-off",iconProps:e})})),u3=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-view",iconProps:e})})),u4=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(dn,{ref:n,icon:"omrs-icon-warning",iconProps:e})})),u5=u4,u6=c5,u8=uh,u7=uc,u9=uj,de=(0,g.memo)((0,g.forwardRef)(function(e,n){var t=e.icon,r=e.fallback,a=cB(e,["icon","fallback"]),o=(0,g.useRef)(document.getElementById(t));return(0,g.useEffect)(function(){var e=document.getElementById("omrs-svgs-container"),n=new MutationObserver(function(e){var n=!0,r=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var l=i.value;"childList"===l.type&&(o.current=document.getElementById(t))}}catch(e){r=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw a}}});return e&&n.observe(e,{childList:!0}),function(){return n.disconnect()}},[t]),A().createElement(v.fS,{value:o.current,fallback:r},A().createElement(dn,{ref:n,icon:t,iconProps:a}))})),dn=(0,g.memo)((0,g.forwardRef)(function(e,n){var t=e.icon,r=Object.assign({},{fill:"currentColor",size:20},e.iconProps),a=r.className,o=r.fill,i=r.size;(i<=0||i>72)&&(console.error("Invalid size '".concat(i,"' specified for ").concat(t,". Defaulting to 20.")),i=20);var s=(0,g.useRef)(null);return(0,g.useImperativeHandle)(n,function(){return s.current}),(0,g.useEffect)(function(){s.current&&"currentColor"!==o&&s.current.style.setProperty("--omrs-icon-fill",o)},[]),A().createElement("svg",{ref:s,className:b()("omrs-icon",cz.icon,a),height:i,width:i,viewBox:"0 0 16 16"},A().createElement("use",{href:"#".concat(t)}))})),dt=t(23464),dr=t.n(dt);function da(e,n){return null!=n&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?!!n[Symbol.hasInstance](e):e instanceof n}function di(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e)return t?e:void 0;if("string"==typeof e&&!e)return t?null:void 0;if(da(e,iq.ng)||da(e,iq._l)||da(e,iq.Ip))return n?(0,ee.yP)(e,n):e;var r=dr()(e).toDate(),a=new iq.ng(r.getFullYear(),r.getMonth()+1,r.getDate());return n?(0,ee.yP)(a,n):a}function ds(e){if(e)return e.toDate((0,en.Xj)())}var dl=(0,g.createContext)(null),dc=function(){return(0,g.useContext)(dl)},du={},dd={},dp={},df={},d_={},dh={},dm={},dg={},dA={},dy={},db={},dv={},dC={},d$={},dw={},dk={},dE={},dx={},dD={},dS={},dz={},dB={},dM={},dT={},dO={},dN={},dP={},dI={},dF={},dR={},dH={},dL={},dj={},dq={},dG={};function dV(e,n){let{onScroll:t,isDisabled:r}=e,a=(0,g.useCallback)(e=>{!e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),t&&t({deltaX:e.deltaX,deltaY:e.deltaY}))},[t]);ai(n,"wheel",r?void 0:a)}function dU(e,n){var t;let{inputElementType:r="input",isDisabled:a=!1,isRequired:o=!1,isReadOnly:i=!1,type:s="text",validationBehavior:l="aria"}=e,[c,u]=aD(e.value,e.defaultValue||"",e.onChange),{focusableProps:d}=tj(e,n),p=iZ({...e,value:c}),{isInvalid:f,validationErrors:h,validationDetails:m}=p.displayValidation,{labelProps:A,fieldProps:y,descriptionProps:b,errorMessageProps:v}=o6({...e,isInvalid:f,errorMessage:e.errorMessage||h}),C=e9(e,{labelable:!0}),$={type:s,pattern:e.pattern},[w]=(0,g.useState)(c);return o4(n,null!=(t=e.defaultValue)?t:w,u),o8(e,p,n),(0,g.useEffect)(()=>{if(n.current instanceof nn(n.current).HTMLTextAreaElement){let e=n.current;Object.defineProperty(e,"defaultValue",{get:()=>e.value,set:()=>{},configurable:!0})}},[n]),{labelProps:A,inputProps:eq(C,"input"===r?$:void 0,{disabled:a,readOnly:i,required:o&&"native"===l,"aria-required":o&&"aria"===l||void 0,"aria-invalid":f||void 0,"aria-errormessage":e["aria-errormessage"],"aria-activedescendant":e["aria-activedescendant"],"aria-autocomplete":e["aria-autocomplete"],"aria-haspopup":e["aria-haspopup"],"aria-controls":e["aria-controls"],value:c,onChange:e=>u(e.target.value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,form:e.form,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(g.version,10)>=17?"enterKeyHint":"enterkeyhint"]:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...d,...y}),descriptionProps:b,errorMessageProps:v,isInvalid:f,validationErrors:h,validationDetails:m}}function dW(){return"undefined"!=typeof window&&window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges}function dK(e,n,t){let r=eO(e=>{let r=t.current;if(!r)return;let a=null;switch(e.inputType){case"historyUndo":case"historyRedo":case"insertLineBreak":return;case"deleteContent":case"deleteByCut":case"deleteByDrag":a=r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteContentForward":a=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd+1):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteContentBackward":a=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart-1)+r.value.slice(r.selectionStart):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":a=r.value.slice(r.selectionStart);break;default:null!=e.data&&(a=r.value.slice(0,r.selectionStart)+e.data+r.value.slice(r.selectionEnd))}null!=a&&n.validate(a)||e.preventDefault()});(0,g.useEffect)(()=>{if(!dW()||!t.current)return;let e=t.current;return e.addEventListener("beforeinput",r,!1),()=>{e.removeEventListener("beforeinput",r,!1)}},[t,r]);let a=dW()?null:e=>{let t=e.target.value.slice(0,e.target.selectionStart)+e.data+e.target.value.slice(e.target.selectionEnd);n.validate(t)||e.preventDefault()},{labelProps:o,inputProps:i,descriptionProps:s,errorMessageProps:l,...c}=dU(e,t),u=(0,g.useRef)(null);return{inputProps:eq(i,{onBeforeInput:a,onCompositionStart(){let{value:e,selectionStart:n,selectionEnd:r}=t.current;u.current={value:e,selectionStart:n,selectionEnd:r}},onCompositionEnd(){if(t.current&&!n.validate(t.current.value)){let{value:e,selectionStart:r,selectionEnd:a}=u.current;t.current.value=e,t.current.setSelectionRange(r,a),n.setInputValue(e)}}}),labelProps:o,descriptionProps:s,errorMessageProps:l,...c}}dG={"ar-AE":du={decrease:e=>`\u{62E}\u{641}\u{636} ${e.fieldLabel}`,increase:e=>`\u{632}\u{64A}\u{627}\u{62F}\u{629} ${e.fieldLabel}`,numberField:`\u{62D}\u{642}\u{644} \u{631}\u{642}\u{645}\u{64A}`},"bg-BG":dd={decrease:e=>`\u{41D}\u{430}\u{43C}\u{430}\u{43B}\u{44F}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{441}\u{438}\u{43B}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,numberField:`\u{41D}\u{43E}\u{43C}\u{435}\u{440} \u{43D}\u{430} \u{43F}\u{43E}\u{43B}\u{435}\u{442}\u{43E}`},"cs-CZ":dp={decrease:e=>`Sn\xed\u{17E}it ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}it ${e.fieldLabel}`,numberField:`\u{10C}\xedseln\xe9 pole`},"da-DK":df={decrease:e=>`Reducer ${e.fieldLabel}`,increase:e=>`\xd8g ${e.fieldLabel}`,numberField:"Talfelt"},"de-DE":d_={decrease:e=>`${e.fieldLabel} verringern`,increase:e=>`${e.fieldLabel} erh\xf6hen`,numberField:"Nummernfeld"},"el-GR":dh={decrease:e=>`\u{39C}\u{3B5}\u{3AF}\u{3C9}\u{3C3}\u{3B7} ${e.fieldLabel}`,increase:e=>`\u{391}\u{3CD}\u{3BE}\u{3B7}\u{3C3}\u{3B7} ${e.fieldLabel}`,numberField:`\u{3A0}\u{3B5}\u{3B4}\u{3AF}\u{3BF} \u{3B1}\u{3C1}\u{3B9}\u{3B8}\u{3BC}\u{3BF}\u{3CD}`},"en-US":dm={decrease:e=>`Decrease ${e.fieldLabel}`,increase:e=>`Increase ${e.fieldLabel}`,numberField:"Number field"},"es-ES":dg={decrease:e=>`Reducir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo de n\xfamero`},"et-EE":dA={decrease:e=>`V\xe4henda ${e.fieldLabel}`,increase:e=>`Suurenda ${e.fieldLabel}`,numberField:`Numbri v\xe4li`},"fi-FI":dy={decrease:e=>`V\xe4henn\xe4 ${e.fieldLabel}`,increase:e=>`Lis\xe4\xe4 ${e.fieldLabel}`,numberField:`Numerokentt\xe4`},"fr-FR":db={decrease:e=>`Diminuer ${e.fieldLabel}`,increase:e=>`Augmenter ${e.fieldLabel}`,numberField:"Champ de nombre"},"he-IL":dv={decrease:e=>`\u{5D4}\u{5E7}\u{5D8}\u{5DF} ${e.fieldLabel}`,increase:e=>`\u{5D4}\u{5D2}\u{5D3}\u{5DC} ${e.fieldLabel}`,numberField:`\u{5E9}\u{5D3}\u{5D4} \u{5DE}\u{5E1}\u{5E4}\u{5E8}`},"hr-HR":dC={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"hu-HU":d$={decrease:e=>`${e.fieldLabel} cs\xf6kkent\xe9se`,increase:e=>`${e.fieldLabel} n\xf6vel\xe9se`,numberField:`Sz\xe1mmez\u{151}`},"it-IT":dw={decrease:e=>`Riduci ${e.fieldLabel}`,increase:e=>`Aumenta ${e.fieldLabel}`,numberField:"Campo numero"},"ja-JP":dk={decrease:e=>`${e.fieldLabel}\u{3092}\u{7E2E}\u{5C0F}`,increase:e=>`${e.fieldLabel}\u{3092}\u{62E1}\u{5927}`,numberField:`\u{6570}\u{5024}\u{30D5}\u{30A3}\u{30FC}\u{30EB}\u{30C9}`},"ko-KR":dE={decrease:e=>`${e.fieldLabel} \u{AC10}\u{C18C}`,increase:e=>`${e.fieldLabel} \u{C99D}\u{AC00}`,numberField:`\u{BC88}\u{D638} \u{D544}\u{B4DC}`},"lt-LT":dx={decrease:e=>`Suma\u{17E}inti ${e.fieldLabel}`,increase:e=>`Padidinti ${e.fieldLabel}`,numberField:"Numerio laukas"},"lv-LV":dD={decrease:e=>`Samazin\u{101}\u{161}ana ${e.fieldLabel}`,increase:e=>`Palielin\u{101}\u{161}ana ${e.fieldLabel}`,numberField:`Skait\u{13C}u lauks`},"nb-NO":dS={decrease:e=>`Reduser ${e.fieldLabel}`,increase:e=>`\xd8k ${e.fieldLabel}`,numberField:"Tallfelt"},"nl-NL":dz={decrease:e=>`${e.fieldLabel} verlagen`,increase:e=>`${e.fieldLabel} verhogen`,numberField:"Getalveld"},"pl-PL":dB={decrease:e=>`Zmniejsz ${e.fieldLabel}`,increase:e=>`Zwi\u{119}ksz ${e.fieldLabel}`,numberField:"Pole numeru"},"pt-BR":dM={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo de n\xfamero`},"pt-PT":dT={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo num\xe9rico`},"ro-RO":dO={decrease:e=>`Sc\u{103}dere ${e.fieldLabel}`,increase:e=>`Cre\u{219}tere ${e.fieldLabel}`,numberField:`C\xe2mp numeric`},"ru-RU":dN={decrease:e=>`\u{423}\u{43C}\u{435}\u{43D}\u{44C}\u{448}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{432}\u{435}\u{43B}\u{438}\u{447}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,numberField:`\u{427}\u{438}\u{441}\u{43B}\u{43E}\u{432}\u{43E}\u{435} \u{43F}\u{43E}\u{43B}\u{435}`},"sk-SK":dP={decrease:e=>`Zn\xed\u{17E}i\u{165} ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}i\u{165} ${e.fieldLabel}`,numberField:`\u{10C}\xedseln\xe9 pole`},"sl-SI":dI={decrease:e=>`Upadati ${e.fieldLabel}`,increase:e=>`Pove\u{10D}ajte ${e.fieldLabel}`,numberField:`\u{160}tevil\u{10D}no polje`},"sr-SP":dF={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"sv-SE":dR={decrease:e=>`Minska ${e.fieldLabel}`,increase:e=>`\xd6ka ${e.fieldLabel}`,numberField:`Nummerf\xe4lt`},"tr-TR":dH={decrease:e=>`${e.fieldLabel} azalt`,increase:e=>`${e.fieldLabel} artt\u{131}r`,numberField:`Say\u{131} alan\u{131}`},"uk-UA":dL={decrease:e=>`\u{417}\u{43C}\u{435}\u{43D}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,increase:e=>`\u{417}\u{431}\u{456}\u{43B}\u{44C}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,numberField:`\u{41F}\u{43E}\u{43B}\u{435} \u{43D}\u{43E}\u{43C}\u{435}\u{440}\u{430}`},"zh-CN":dj={decrease:e=>`\u{964D}\u{4F4E} ${e.fieldLabel}`,increase:e=>`\u{63D0}\u{9AD8} ${e.fieldLabel}`,numberField:`\u{6570}\u{5B57}\u{5B57}\u{6BB5}`},"zh-TW":dq={decrease:e=>`\u{7E2E}\u{5C0F} ${e.fieldLabel}`,increase:e=>`\u{653E}\u{5927} ${e.fieldLabel}`,numberField:`\u{6578}\u{5B57}\u{6B04}\u{4F4D}`}};var dZ=t(93092);function dY(e={}){let{locale:n}=ex();return(0,g.useMemo)(()=>new(0,dZ.K)(n,e),[n,e])}var dJ={},dX={},dQ={},d0={},d1={},d2={},d3={},d4={},d5={},d6={},d8={},d7={},d9={},pe={},pn={},pt={},pr={},pa={},po={},pi={},ps={},pl={},pc={},pu={},pd={},pp={},pf={},p_={},ph={},pm={},pg={},pA={},py={},pb={},pv={};function pC(e){return e&&e.__esModule?e.default:e}function p$(e){let n=(0,g.useRef)(void 0),{value:t,textValue:r,minValue:a,maxValue:o,isDisabled:i,isReadOnly:s,isRequired:l,onIncrement:c,onIncrementPage:u,onDecrement:d,onDecrementPage:p,onDecrementToMin:f,onIncrementToMax:h}=e,m=rq(pC(pv),"@react-aria/spinbutton"),A=()=>clearTimeout(n.current);(0,g.useEffect)(()=>()=>A(),[]);let y=e=>{if(!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&!s&&!e.nativeEvent.isComposing)switch(e.key){case"PageUp":if(u){e.preventDefault(),null==u||u();break}case"ArrowUp":case"Up":c&&(e.preventDefault(),null==c||c());break;case"PageDown":if(p){e.preventDefault(),null==p||p();break}case"ArrowDown":case"Down":d&&(e.preventDefault(),null==d||d());break;case"Home":f&&(e.preventDefault(),null==f||f());break;case"End":h&&(e.preventDefault(),null==h||h())}},b=(0,g.useRef)(!1),v=()=>{b.current=!0},C=()=>{b.current=!1},$=""===r?m.format("Empty"):(r||`${t}`).replace("-","−");(0,g.useEffect)(()=>{b.current&&(e1("assertive"),e0($,"assertive"))},[$]);let w=eO(e=>{A(),null==c||c(),n.current=window.setTimeout(()=>{(void 0===o||isNaN(o)||void 0===t||isNaN(t)||t<o)&&w(60)},e)}),k=eO(e=>{A(),null==d||d(),n.current=window.setTimeout(()=>{(void 0===a||isNaN(a)||void 0===t||isNaN(t)||t>a)&&k(60)},e)}),E=e=>{e.preventDefault()},{addGlobalListener:x,removeAllGlobalListeners:D}=nQ();return{spinButtonProps:{role:"spinbutton","aria-valuenow":void 0===t||isNaN(t)?void 0:t,"aria-valuetext":$,"aria-valuemin":a,"aria-valuemax":o,"aria-disabled":i||void 0,"aria-readonly":s||void 0,"aria-required":l||void 0,onKeyDown:y,onFocus:v,onBlur:C},incrementButtonProps:{onPressStart:()=>{w(400),x(window,"contextmenu",E)},onPressEnd:()=>{A(),D()},onFocus:v,onBlur:C},decrementButtonProps:{onPressStart:()=>{k(400),x(window,"contextmenu",E)},onPressEnd:()=>{A(),D()},onFocus:v,onBlur:C}}}function pw(e){return e&&e.__esModule?e.default:e}function pk(e,n,t){var r;let a,{id:o,decrementAriaLabel:i,incrementAriaLabel:s,isDisabled:l,isReadOnly:c,isRequired:u,minValue:d,maxValue:p,autoFocus:f,label:h,formatOptions:m,onBlur:A=()=>{},onFocus:y,onFocusChange:b,onKeyDown:v,onKeyUp:C,description:$,errorMessage:w,isWheelDisabled:k,...E}=e,{increment:x,incrementToMax:D,decrement:S,decrementToMin:z,numberValue:B,inputValue:M,commit:T,commitValidation:O}=n,N=rq(pw(dG),"@react-aria/numberfield"),P=eF(o),{focusProps:I}=tI({onBlur(){T()}}),F=dY(m),R=(0,g.useMemo)(()=>F.resolvedOptions(),[F]),H=dY({...m,currencySign:void 0}),L=(0,g.useMemo)(()=>isNaN(B)?"":H.format(B),[H,B]),{spinButtonProps:j,incrementButtonProps:q,decrementButtonProps:G}=p$({isDisabled:l,isReadOnly:c,isRequired:u,maxValue:p,minValue:d,onIncrement:x,onIncrementToMax:D,onDecrement:S,onDecrementToMin:z,value:B,textValue:L}),[V,U]=(0,g.useState)(!1),{focusWithinProps:W}=tG({isDisabled:l,onFocusWithinChange:U});dV({onScroll:(0,g.useCallback)(e=>{!(Math.abs(e.deltaY)<=Math.abs(e.deltaX))&&(e.deltaY>0?x():e.deltaY<0&&S())},[S,x]),isDisabled:k||l||c||!V},t);let K=(null!=(r=R.maximumFractionDigits)?r:0)>0,Z=void 0===n.minValue||isNaN(n.minValue)||n.minValue<0,Y="numeric";nD()?Z?Y="text":K&&(Y="decimal"):nT()&&(Z?Y="numeric":K&&(Y="decimal"));let J=e=>{n.validate(e)&&n.setInputValue(e)},X=e9(e),Q=(0,g.useCallback)(e=>{e.nativeEvent.isComposing||("Enter"===e.key?(T(),O()):e.continuePropagation())},[T,O]),{isInvalid:ee,validationErrors:en,validationDetails:et}=n.displayValidation,{labelProps:er,inputProps:ea,descriptionProps:eo,errorMessageProps:ei}=dK({...E,...X,name:void 0,form:void 0,label:h,autoFocus:f,isDisabled:l,isReadOnly:c,isRequired:u,validate:void 0,[iK]:n,value:M,defaultValue:"!",autoComplete:"off","aria-label":e["aria-label"]||void 0,"aria-labelledby":e["aria-labelledby"]||void 0,id:P,type:"text",inputMode:Y,onChange:J,onBlur:A,onFocus:y,onFocusChange:b,onKeyDown:(0,g.useMemo)(()=>eB(Q,v),[Q,v]),onKeyUp:C,description:$,errorMessage:w},n,t);o4(t,n.defaultNumberValue,n.setNumberValue);let es=eq(j,I,ea,{role:null,"aria-roledescription":nz()?null:N.format("numberField"),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false"});"native"===e.validationBehavior&&(es["aria-required"]=void 0);let el=e=>{var n;document.activeElement!==t.current&&("mouse"===e.pointerType?null==(n=t.current)||n.focus():e.target.focus())},ec=e["aria-label"]||("string"==typeof e.label?e.label:"");ec||(a=null!=e.label?er.id:e["aria-labelledby"]);let eu=eF(),ed=eF(),ep=eq(q,{"aria-label":s||N.format("increase",{fieldLabel:ec}).trim(),id:a&&!s?eu:null,"aria-labelledby":a&&!s?`${eu} ${a}`:null,"aria-controls":P,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!n.canIncrement,onPressStart:el}),ef=eq(G,{"aria-label":i||N.format("decrease",{fieldLabel:ec}).trim(),id:a&&!i?ed:null,"aria-labelledby":a&&!i?`${ed} ${a}`:null,"aria-controls":P,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!n.canDecrement,onPressStart:el});return{groupProps:{...W,role:"group","aria-disabled":l,"aria-invalid":ee?"true":void 0},labelProps:er,inputProps:es,incrementButtonProps:ep,decrementButtonProps:ef,errorMessageProps:ei,descriptionProps:eo,isInvalid:ee,validationErrors:en,validationDetails:et}}pv={"ar-AE":dJ={Empty:`\u{641}\u{627}\u{631}\u{63A}`},"bg-BG":dX={Empty:`\u{418}\u{437}\u{43F}\u{440}\u{430}\u{437}\u{43D}\u{438}`},"cs-CZ":dQ={Empty:`Pr\xe1zdn\xe9`},"da-DK":d0={Empty:"Tom"},"de-DE":d1={Empty:"Leer"},"el-GR":d2={Empty:`\u{386}\u{3B4}\u{3B5}\u{3B9}\u{3BF}`},"en-US":d3={Empty:"Empty"},"es-ES":d4={Empty:`Vac\xedo`},"et-EE":d5={Empty:`T\xfchjenda`},"fi-FI":d6={Empty:`Tyhj\xe4`},"fr-FR":d8={Empty:"Vide"},"he-IL":d7={Empty:`\u{5E8}\u{5D9}\u{5E7}`},"hr-HR":d9={Empty:"Prazno"},"hu-HU":pe={Empty:`\xdcres`},"it-IT":pn={Empty:"Vuoto"},"ja-JP":pt={Empty:`\u{7A7A}`},"ko-KR":pr={Empty:`\u{BE44}\u{C5B4} \u{C788}\u{C74C}`},"lt-LT":pa={Empty:`Tu\u{161}\u{10D}ias`},"lv-LV":po={Empty:`Tuk\u{161}s`},"nb-NO":pi={Empty:"Tom"},"nl-NL":ps={Empty:"Leeg"},"pl-PL":pl={Empty:"Pusty"},"pt-BR":pc={Empty:"Vazio"},"pt-PT":pu={Empty:"Vazio"},"ro-RO":pd={Empty:"Gol"},"ru-RU":pp={Empty:`\u{41D}\u{435} \u{437}\u{430}\u{43F}\u{43E}\u{43B}\u{43D}\u{435}\u{43D}\u{43E}`},"sk-SK":pf={Empty:`Pr\xe1zdne`},"sl-SI":p_={Empty:"Prazen"},"sr-SP":ph={Empty:"Prazno"},"sv-SE":pm={Empty:"Tomt"},"tr-TR":pg={Empty:`Bo\u{15F}`},"uk-UA":pA={Empty:`\u{41F}\u{443}\u{441}\u{442}\u{43E}`},"zh-CN":py={Empty:`\u{7A7A}`},"zh-TW":pb={Empty:`\u{7A7A}\u{767D}`}};var pE=t(95899);function px(e){let{minValue:n,maxValue:t,step:r,formatOptions:a,value:o,defaultValue:i=NaN,onChange:s,locale:l,isDisabled:c,isReadOnly:u}=e;null===o&&(o=NaN),void 0===o||isNaN(o)||(o=void 0===r||isNaN(r)?sU(o,n,t):sK(o,n,t,r)),isNaN(i)||(i=void 0===r||isNaN(r)?sU(i,n,t):sK(i,n,t,r));let[d,p]=aD(o,isNaN(i)?NaN:i,s),[f]=(0,g.useState)(d),[h,m]=(0,g.useState)(()=>isNaN(d)?"":new(0,dZ.K)(l,a).format(d)),A=(0,g.useMemo)(()=>new(0,pE.d)(l,a),[l,a]),y=(0,g.useMemo)(()=>A.getNumberingSystem(h),[A,h]),b=(0,g.useMemo)(()=>new(0,dZ.K)(l,{...a,numberingSystem:y}),[l,a,y]),v=(0,g.useMemo)(()=>b.resolvedOptions(),[b]),C=(0,g.useCallback)(e=>isNaN(e)||null===e?"":b.format(e),[b]),$=iZ({...e,value:d}),w=void 0===r||isNaN(r)?1:r;"percent"===v.style&&(void 0===r||isNaN(r))&&(w=.01);let[k,E]=(0,g.useState)(d),[x,D]=(0,g.useState)(l),[S,z]=(0,g.useState)(a);Object.is(d,k)&&l===x&&a===S||(m(C(d)),E(d),D(l),z(a));let B=(0,g.useMemo)(()=>A.parse(h),[A,h]),M=()=>{let e;if(!h.length){p(NaN),m(void 0===o?"":C(d));return}isNaN(B)?m(C(d)):(e=void 0===r||isNaN(r)?sU(B,n,t):sK(B,n,t,r),p(e=A.parse(C(e))),m(C(void 0===o?e:d)),$.commitValidation())},T=(e,r=0)=>{let a=B;if(isNaN(a))return sK(isNaN(r)?0:r,n,t,w);{let r=sK(a,n,t,w);return"+"===e&&r>a||"-"===e&&r<a?r:sK(pD(e,a,w),n,t,w)}},O=()=>{let e=T("+",n);e===d&&m(C(e)),p(e),$.commitValidation()},N=()=>{let e=T("-",t);e===d&&m(C(e)),p(e),$.commitValidation()},P=()=>{null!=t&&(p(sK(t,n,t,w)),$.commitValidation())},I=()=>{null!=n&&(p(n),$.commitValidation())},F=(0,g.useMemo)(()=>!c&&!u&&(isNaN(B)||void 0===t||isNaN(t)||sK(B,n,t,w)>B||pD("+",B,w)<=t),[c,u,n,t,w,B]),R=(0,g.useMemo)(()=>!c&&!u&&(isNaN(B)||void 0===n||isNaN(n)||sK(B,n,t,w)<B||pD("-",B,w)>=n),[c,u,n,t,w,B]),H=e=>A.isValidPartialNumber(e,n,t);return{...$,validate:H,increment:O,incrementToMax:P,decrement:N,decrementToMin:I,canIncrement:F,canDecrement:R,minValue:n,maxValue:t,numberValue:B,defaultNumberValue:isNaN(i)?f:i,setNumberValue:p,setInputValue:m,inputValue:h,commit:M}}function pD(e,n,t){let r="+"===e?n+t:n-t;if(n%1!=0||t%1!=0){let a=n.toString().split("."),o=t.toString().split("."),i=Math.pow(10,Math.max(a[1]&&a[1].length||0,o[1]&&o[1].length||0));n=Math.round(n*i),t=Math.round(t*i),r=("+"===e?n+t:n-t)/i}return r}let pS=(0,g.createContext)(null),pz=(0,g.createContext)(null),pB=(0,g.forwardRef)(function(e,n){var t,r;[e,n]=eK(e,n,pS);let{validationBehavior:a}=eW(sM)||{},o=null!=(r=null!=(t=e.validationBehavior)?t:a)?r:"native",{locale:i}=ex(),s=px({...e,locale:i,validationBehavior:o}),l=(0,g.useRef)(null),[c,u]=eZ(!e["aria-label"]&&!e["aria-labelledby"]),{labelProps:d,groupProps:p,inputProps:f,incrementButtonProps:h,decrementButtonProps:m,descriptionProps:A,errorMessageProps:y,...b}=pk({...eY(e),label:u,validationBehavior:o},s,l),v=eU({...e,values:{state:s,isDisabled:e.isDisabled||!1,isInvalid:b.isInvalid||!1,isRequired:e.isRequired||!1},defaultClassName:"react-aria-NumberField"}),C=e9(e,{global:!0});return delete C.id,g.createElement(eV,{values:[[pz,s],[aY,p],[aX,{...f,ref:l}],[sF,{...d,ref:c}],[t1,{slots:{increment:h,decrement:m}}],[t5,{slots:{description:A,errorMessage:y}}],[sS,b]]},g.createElement("div",{...C,...v,ref:n,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-required":e.isRequired||void 0,"data-invalid":b.isInvalid||void 0}),e.name&&g.createElement("input",{type:"hidden",name:e.name,form:e.form,value:isNaN(s.numberValue)?"":s.numberValue,disabled:e.isDisabled||void 0}))});function pM(e,n){return parseInt((0,cx.Yq)(e,{calendar:n.calendar,locale:n.baseName,day:!1,month:!1,noToday:!0,numberingSystem:"latn"}))}var pT=(0,g.forwardRef)(function(e,n){var t=e.className,r=(0,g.useContext)(aI),a=(0,g.useContext)(aF),o=null!=r?r:a,i=dc(),s=(0,en.Xj)(),l=(0,cx.Yq)(o.visibleRange.start.toDate(s),{calendar:i.calendar,locale:i.baseName,day:!1,year:!1,noToday:!0}),c=pM(o.visibleRange.start.toDate(s),i),u=o.maxValue?pM(o.maxValue.toDate(s),i):void 0,d=o.minValue?pM(o.minValue.toDate(s),i):void 0,p=(0,g.useCallback)(function(e){o.setFocusedDate(o.focusedDate.cycle("year",e-o.focusedDate.year))},[]);return o&&A().createElement("span",{ref:n,className:t},A().createElement("span",null,l),A().createElement(pB,{formatOptions:{useGrouping:!1},maxValue:u,minValue:d,onChange:p,value:c},A().createElement(a0,null),A().createElement(aJ,null,A().createElement(t2,{slot:"increment"},A().createElement(cU,{size:8})),A().createElement(t2,{slot:"decrement"},A().createElement(cq,{size:8})))))});function pO(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function pN(e){if(Array.isArray(e))return e}function pP(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function pI(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function pF(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pR(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){pP(e,n,t[n])})}return e}function pH(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function pL(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function pj(e,n){return pN(e)||pI(e,n)||pq(e,n)||pF()}function pq(e,n){if(e){if("string"==typeof e)return pO(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return pO(e,n)}}var pG=(0,g.forwardRef)(function(e,n){var t=(0,g.useContext)(cv),r=pj(eK({slot:e.slot},n,sf),2),a=r[0],o=r[1],i=ex().locale,s=sl(pL(pR({},a),{locale:i,createCalendar:Q.d})),l=(0,g.useRef)(null),c=ii(pL(pR({},a),{inputRef:l}),s,o),u=c.fieldProps,d=c.inputProps,p=(0,g.useCallback)(function(){s.isDisabled||t.toggle()},[]);return A().createElement(eV,{values:[[s_,s],[aX,pL(pR({},d),{ref:l})],[aY,pL(pR({},u),{ref:o,isInvalid:s.isInvalid})]]},A().createElement(aJ,pL(pR({},e),{id:e.id,ref:n,slot:e.slot||void 0,className:e.className,isDisabled:s.isDisabled,isInvalid:s.isInvalid,onClick:p}),s.segments.map(function(n,t){return(0,g.cloneElement)(e.children(n),{key:t})})),A().createElement(a0,null))});function pV(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function pU(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){pV(e,n,t[n])})}return e}var pW=(0,g.forwardRef)(function(e,n){return(0,g.useContext)(cv).isInvalid?A().createElement(u4,pU({ref:n,size:16},e)):A().createElement(cj,pU({ref:n,size:16},e))});function pK(e){return e&&e.__esModule?e.default:e}function pZ(){let{locale:e}=ex(),n=rj(pK(ok),"@react-aria/datepicker");return(0,g.useMemo)(()=>{try{return new Intl.DisplayNames(e,{type:"dateTimeField"})}catch{return new pY(e,n)}},[e,n])}class pY{of(e){return this.dictionary.getStringForLocale(e,this.locale)}constructor(e,n){this.locale=e,this.dictionary=n}}let pJ=new Map;function pX(e){let{locale:n}=ex(),t=n+(e?Object.entries(e).sort((e,n)=>e[0]<n[0]?-1:1).join():"");if(pJ.has(t))return pJ.get(t);let r=new Intl.Collator(n,e);return pJ.set(t,r),r}function pQ(e){let n=pX({usage:"search",...e}),t=(0,g.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===n.compare(e.slice(0,t.length),t)),[n]),r=(0,g.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===n.compare(e.slice(-t.length),t)),[n]),a=(0,g.useCallback)((e,t)=>{if(0===t.length)return!0;e=e.normalize("NFC");let r=0,a=(t=t.normalize("NFC")).length;for(;r+a<=e.length;r++){let o=e.slice(r,r+a);if(0===n.compare(t,o))return!0}return!1},[n]);return(0,g.useMemo)(()=>({startsWith:t,endsWith:r,contains:a}),[t,r,a])}function p0(e,n,t){let r=(0,g.useRef)(""),{locale:a,direction:o}=ex(),i=pZ(),{ariaLabel:s,ariaLabelledBy:l,ariaDescribedBy:c,focusManager:u}=ir.get(n),d=e.isPlaceholder?"":e.text,p=(0,g.useMemo)(()=>n.dateFormatter.resolvedOptions(),[n.dateFormatter]),f=r0({month:"long",timeZone:p.timeZone}),h=r0({hour:"numeric",hour12:p.hour12,timeZone:p.timeZone});if("month"!==e.type||e.isPlaceholder)"hour"!==e.type||e.isPlaceholder||(d=h.format(n.dateValue));else{let e=f.format(n.dateValue);d=e!==d?`${d} \u{2013} ${e}`:e}let{spinButtonProps:m}=p$({value:e.value,textValue:d,minValue:e.minValue,maxValue:e.maxValue,isDisabled:n.isDisabled,isReadOnly:n.isReadOnly||!e.isEditable,isRequired:n.isRequired,onIncrement:()=>{r.current="",n.increment(e.type)},onDecrement:()=>{r.current="",n.decrement(e.type)},onIncrementPage:()=>{r.current="",n.incrementPage(e.type)},onDecrementPage:()=>{r.current="",n.decrementPage(e.type)},onIncrementToMax:()=>{r.current="",void 0!==e.maxValue&&n.setSegment(e.type,e.maxValue)},onDecrementToMin:()=>{r.current="",void 0!==e.minValue&&n.setSegment(e.type,e.minValue)}}),A=(0,g.useMemo)(()=>new(0,pE.d)(a,{maximumFractionDigits:0}),[a]),y=()=>{if(e.text===e.placeholder&&u.focusPrevious(),!A.isValidPartialNumber(e.text)||n.isReadOnly||e.isPlaceholder)"dayPeriod"===e.type&&n.clearSegment(e.type);else{let t=e.text.slice(0,-1),a=A.parse(t);0===(t=0===a?"":t).length||0===a?n.clearSegment(e.type):n.setSegment(e.type,a),r.current=t}},b=e=>{if("a"===e.key&&(nx()?e.metaKey:e.ctrlKey)&&e.preventDefault(),!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey)switch(e.key){case"Backspace":case"Delete":e.preventDefault(),e.stopPropagation(),y()}},{startsWith:v}=pQ({sensitivity:"base"}),C=r0({hour:"numeric",hour12:!0}),$=(0,g.useMemo)(()=>{let e=new Date;return e.setHours(0),C.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[C]),w=(0,g.useMemo)(()=>{let e=new Date;return e.setHours(12),C.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[C]),k=r0({year:"numeric",era:"narrow",timeZone:"UTC"}),E=(0,g.useMemo)(()=>{if("era"!==e.type)return[];let t=(0,ee.yP)(new(0,iq.ng)(1,1,1),n.calendar),r=n.calendar.getEras().map(e=>{let n=t.set({year:1,month:1,day:1,era:e}).toDate("UTC");return{era:e,formatted:k.formatToParts(n).find(e=>"era"===e.type).value}}),a=p1(r.map(e=>e.formatted));if(a)for(let e of r)e.formatted=e.formatted.slice(a);return r},[k,n.calendar,e.type]),x=t=>{if(n.isDisabled||n.isReadOnly)return;let a=r.current+t;switch(e.type){case"dayPeriod":if(v($,t))n.setSegment("dayPeriod",0);else if(v(w,t))n.setSegment("dayPeriod",12);else break;u.focusNext();break;case"era":{let e=E.find(e=>v(e.formatted,t));e&&(n.setSegment("era",e.era),u.focusNext());break}case"day":case"hour":case"minute":case"second":case"month":case"year":{if(!A.isValidPartialNumber(a))return;let o=A.parse(a),i=o,s=0===e.minValue;if("hour"===e.type&&n.dateFormatter.resolvedOptions().hour12){switch(n.dateFormatter.resolvedOptions().hourCycle){case"h11":o>11&&(i=A.parse(t));break;case"h12":s=!1,o>12&&(i=A.parse(t))}void 0!==e.value&&e.value>=12&&o>1&&(o+=12)}else void 0!==e.maxValue&&o>e.maxValue&&(i=A.parse(t));if(isNaN(o))return;let l=0!==i||s;l&&n.setSegment(e.type,i),void 0!==e.maxValue&&(Number(o+"0")>e.maxValue||a.length>=String(e.maxValue).length)?(r.current="",l&&u.focusNext()):r.current=a}}},D=()=>{r.current="",t.current&&am(t.current,{containingElement:ag(t.current)});let e=window.getSelection();null==e||e.collapse(t.current)};ai((0,g.useRef)("undefined"!=typeof document?document:null),"selectionchange",()=>{var e;let n=window.getSelection();(null==n?void 0:n.anchorNode)&&(null==(e=t.current)?void 0:e.contains(null==n?void 0:n.anchorNode))&&n.collapse(t.current)});let S=(0,g.useRef)("");ai(t,"beforeinput",r=>{if(t.current)switch(r.preventDefault(),r.inputType){case"deleteContentBackward":case"deleteContentForward":A.isValidPartialNumber(e.text)&&!n.isReadOnly&&y();break;case"insertCompositionText":S.current=t.current.textContent,t.current.textContent=t.current.textContent;break;default:null!=r.data&&x(r.data)}}),ai(t,"input",e=>{let{inputType:n,data:r}=e;"insertCompositionText"===n&&(t.current&&(t.current.textContent=S.current),null!=r&&(v($,r)||v(w,r))&&x(r))}),eM(()=>{let e=t.current;return()=>{document.activeElement===e&&(u.focusPrevious()||u.focusNext())}},[t,u]);let z=nz()||"timeZoneName"===e.type?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{};e===(0,g.useMemo)(()=>n.segments.find(e=>e.isEditable),[n.segments])||n.isInvalid||(c=void 0);let B=eF(),M=!n.isDisabled&&!n.isReadOnly&&e.isEditable,T="literal"===e.type?"":i.of(e.type),O=r9({"aria-label":`${T}${s?`, ${s}`:""}${l?", ":""}`,"aria-labelledby":l});if("literal"===e.type)return{segmentProps:{"aria-hidden":!0}};let N={caretColor:"transparent"};if("rtl"===o){N.unicodeBidi="embed";let n=p[e.type];("numeric"===n||"2-digit"===n)&&(N.direction="ltr")}return{segmentProps:eq(m,O,{id:B,...z,"aria-invalid":n.isInvalid?"true":void 0,"aria-describedby":c,"aria-readonly":n.isReadOnly||!e.isEditable?"true":void 0,"data-placeholder":e.isPlaceholder||void 0,contentEditable:M,suppressContentEditableWarning:M,spellCheck:M?"false":void 0,autoCorrect:M?"off":void 0,[parseInt(g.version,10)>=17?"enterKeyHint":"enterkeyhint"]:M?"next":void 0,inputMode:n.isDisabled||"dayPeriod"===e.type||"era"===e.type||!M?void 0:"numeric",tabIndex:n.isDisabled?void 0:0,onKeyDown:b,onFocus:D,style:N,onPointerDown(e){e.stopPropagation()},onMouseDown(e){e.stopPropagation()}})}}function p1(e){e.sort();let n=e[0],t=e[e.length-1];for(let e=0;e<n.length;e++)if(n[e]!==t[e])return e;return 0}function p2(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function p3(e){if(Array.isArray(e))return e}function p4(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function p5(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function p6(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p8(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){p4(e,n,t[n])})}return e}function p7(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function p9(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p7(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function fe(e,n){if(e){if("string"==typeof e)return p2(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p2(e,n)}}function fn(e){var n=e.className,t=e.style,r=e.children,a=e.defaultClassName,o=void 0===a?void 0:a,i=e.defaultChildren,s=void 0===i?void 0:i,l=e.defaultStyle,c=e.values;return(0,g.useMemo)(function(){var e,a,i;return e="function"==typeof n?n(p9(p8({},c),{defaultClassName:o})):n,a="function"==typeof t?t(p9(p8({},c),{defaultStyle:l||{}})):t,i="function"==typeof r?r(p9(p8({},c),{defaultChildren:s})):null==r?s:r,{className:null!=e?e:o,style:a||l?p8({},l,a):void 0,children:null!=i?i:s,"data-rac":""}},[n,t,r,o,s,l,c])}function ft(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function fr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){ft(e,n,t[n])})}return e}function fa(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function fo(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fa(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function fi(e,n){if(null==e)return{};var t,r,a=fs(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function fs(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}var fl=(0,g.forwardRef)(function(e,n){var t=e.segment,r=fi(e,["segment"]),a=(0,g.useContext)(s_),o=eD(n),i=p0(t,a,o).segmentProps,s=tV(),l=s.focusProps,c=s.isFocused,u=s.isFocusVisible,d=tJ(fo(fr({},r),{isDisabled:a.isDisabled||"literal"===t.type})),p=d.hoverProps,f=d.isHovered,h=fn(fo(fr({},r),{values:fo(fr({},t),{isReadOnly:!t.isEditable,isInvalid:a.isInvalid,isDisabled:a.isDisabled,isHovered:f,isFocused:c,isFocusVisible:u}),defaultChildren:t.text})),m=(0,g.useCallback)(function(e){e.stopPropagation()},[]);return A().createElement("span",fo(fr({},eq(e9(r),i,l,p),h),{ref:o,style:i.style,"data-placeholder":t.isPlaceholder||void 0,"data-invalid":a.isInvalid||void 0,"data-readonly":!t.isEditable||void 0,"data-disabled":a.isDisabled||void 0,"data-type":t.type,"data-hovered":f||void 0,"data-focused":c||void 0,"data-focus-visible":u||void 0,onClick:m}))}),fc=t(31339),fu={};fu.styleTagTransform=T(),fu.setAttributes=S(),fu.insert=x().bind(null,"head"),fu.domAPI=k(),fu.insertStyleElement=B(),$()(fc.A,fu);let fd=fc.A&&fc.A.locals?fc.A.locals:void 0;function fp(e){var n=e.children,t=e.isRangePicker,r=void 0!==t&&t,a=(0,g.useContext)(cv),o=(0,g.useContext)(cC),i=r?o:a,s=(0,K.useOnClickOutside)(function(){return null==i?void 0:i.close()});return A().createElement(sD,{className:fd.dialog,ref:s},n)}function ff(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function f_(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){ff(e,n,t[n])})}return e}function fh(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function fm(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function fg(e,n){if(null==e)return{};var t,r,a=fA(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function fA(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}var fy={short:!1,size:"md"};function fb(e){return A().createElement(eE,e)}var fv=(0,g.forwardRef)(function(e,n){var t,r=Object.assign({},fy,e),a=r.className,o=r.defaultValue,i=r.isDisabled,s=r.invalid,l=r.invalidText,c=r.isInvalid,u=r.label,d=r.labelText,p=r.light,f=r.maxDate,h=r.minDate,m=r.onChange,y=r.onChangeRaw,C=r.short,$=r.size,w=r.value,k=fg(r,["className","defaultValue","isDisabled","invalid","invalidText","isInvalid","label","labelText","light","maxDate","minDate","onChange","onChangeRaw","short","size","value"]),E=(0,v.UK)({externalModuleName:"@openmrs/esm-styleguide"}).preferredDateLocale,x=(0,g.useId)(),D=!!(null!=d?d:u),S=(0,g.useMemo)(function(){var e=(0,cE.J)();return E[e]&&(e=E[e]),e},[window.i18next.language]),z=(0,g.useMemo)(function(){var e=(0,cx.a7)(S);return void 0!==e?(0,Q.d)(e):void 0},[S]),B=(0,g.useMemo)(function(){return new Intl.Locale(S,{calendar:null==z?void 0:z.identifier})},[S,z]),M=(0,g.useMemo)(function(){return di(o,z)},[o]),T=(0,g.useMemo)(function(){return di(w,z,!0)},[w]),O=(0,g.useMemo)(function(){return di(f,z)},[f]),N=(0,g.useMemo)(function(){return di(h,z)},[h]),P=(0,g.useMemo)(function(){return null!=s?s:c},[s,c]),I=z?(0,ee.yP)((0,en.Ec)((0,en.Xj)()),z):(0,en.Ec)((0,en.Xj)()),F=(0,g.useMemo)(function(){return y&&m&&console.error("An OpenmrsDatePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),y||function(e){return null==m?void 0:m(ds(e))}},[y,m]);return A().createElement(fb,{locale:B.toString()},A().createElement("div",{className:b()("cds--form-item",a)},A().createElement(eV,{values:[[dl,B]]},A().createElement(cw,fm(f_({className:b()("cds--date-picker","cds--date-picker--single",(ff(t={},"cds--date-picker--short",C),ff(t,"cds--date-picker--light",p),t)),defaultValue:M,isDisabled:i,isInvalid:P,maxValue:O,minValue:N,value:T,shouldForceLeadingZeros:"en"===B.language||void 0},k),{onChange:F}),A().createElement("div",{className:"cds--date-picker-container"},D&&A().createElement(sR,{className:b()("cds--label",{"cds--label--disabled":i}),htmlFor:x},null!=d?d:u),A().createElement(aJ,{className:fd.inputGroup},A().createElement(pG,{id:D?x:void 0,ref:n,className:b()("cds--date-picker-input__wrapper",fd.inputWrapper,ff({},fd.inputWrapperMd,"md"===$||!$||0===$.length))},function(e){return"era"!==e.type?A().createElement(fl,{className:fd.inputSegment,segment:e}):A().createElement(A().Fragment,null)}),A().createElement(t2,{className:b()(fd.flatButton,fd.flatButtonMd)},A().createElement(pW,null))),P&&l&&A().createElement(sz,{className:fd.invalidText},l)),A().createElement(cu,{className:fd.popover,placement:"bottom start",offset:1,isNonModal:!0},A().createElement(fp,null,A().createElement(aR,null,A().createElement("header",{className:fd.header},A().createElement(t2,{className:b()(fd.flatButton,fd.flatButtonMd),slot:"previous"},A().createElement(cX,{size:16})),A().createElement(pT,{className:fd.monthYear}),A().createElement(t2,{className:b()(fd.flatButton,fd.flatButtonMd),slot:"next"},A().createElement(cQ,{size:16}))),A().createElement(aj,{className:fd.calendarGrid},function(e){return A().createElement(aZ,{key:e.toString(),className:b()("cds--date-picker__day",ff({},fd.today,0===I.compare(e))),date:e})}))))))))}),fC=t(43999),f$={};f$.styleTagTransform=T(),f$.setAttributes=S(),f$.insert=x().bind(null,"head"),f$.domAPI=k(),f$.insertStyleElement=B(),$()(fC.A,f$);let fw=fC.A&&fC.A.locals?fC.A.locals:void 0;function fk(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function fE(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){fk(e,n,t[n])})}return e}var fx=(0,g.forwardRef)(function(e,n){return(0,g.useContext)(cC).isInvalid?A().createElement(u4,fE({ref:n,size:16},e)):A().createElement(cj,fE({ref:n,size:16},e))});function fD(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function fS(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){fD(e,n,t[n])})}return e}function fz(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function fB(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function fM(e,n){if(null==e)return{};var t,r,a=fT(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function fT(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}var fO=(0,g.forwardRef)(function(e,n){var t=e.className,r=e.defaultValue,a=e.invalid,o=e.invalidText,i=e.isDisabled,s=e.isInvalid,l=e.label,c=e.labelText,u=e.light,d=e.maxDate,p=e.minDate,f=e.onChange,h=e.onChangeRaw,m=e.value,y=fM(e,["className","defaultValue","invalid","invalidText","isDisabled","isInvalid","label","labelText","light","maxDate","minDate","onChange","onChangeRaw","value"]),C=(0,v.UK)({externalModuleName:"@openmrs/esm-styleguide"}).preferredDateLocale,$=(0,g.useId)(),w=!!(null!=c?c:l),k=(0,g.useMemo)(function(){var e=(0,cE.J)();return C[e]&&(e=C[e]),e},[window.i18next.language]),E=(0,g.useMemo)(function(){var e=(0,cx.a7)(k);return void 0!==e?(0,Q.d)(e):void 0},[k]),x=(0,g.useMemo)(function(){return new Intl.Locale(k,{calendar:null==E?void 0:E.identifier})},[k,E]),D=(0,g.useMemo)(function(){if(m)return{start:di(m[0],E,!0),end:di(m[1],E,!0)}},[m]),S=(0,g.useMemo)(function(){if(r)return{start:di(r[0],E,!0),end:di(r[1],E,!0)}},[r]),z=(0,g.useMemo)(function(){return di(p,E,!0)},[p]),B=(0,g.useMemo)(function(){return di(d,E,!0)},[d]),M=(0,g.useMemo)(function(){return null!=a?a:s},[a,s]),T=E?(0,ee.yP)((0,en.Ec)((0,en.Xj)()),E):(0,en.Ec)((0,en.Xj)()),O=(0,g.useMemo)(function(){return h&&f&&console.error("An OpenmrsDateRangePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),h||function(e){return null==f?void 0:f([ds(e.start),ds(e.end)])}},[h,f]);return A().createElement(fb,{locale:x.toString()},A().createElement("div",{className:b()("cds--form-item",t)},A().createElement(eV,{values:[[dl,x]]},A().createElement(ck,fB(fS({id:w?$:void 0,className:b()("cds--date-picker",{"cds--date-picker--light":u,"cds--date-picker--disabled":i}),isInvalid:M,shouldForceLeadingZeros:"en"===x.language||void 0,maxValue:B,minValue:z,value:D,defaultValue:S,ref:n,isDisabled:i},y),{onChange:O}),A().createElement("div",{className:"cds--date-picker-container"},w&&A().createElement(sR,{className:b()("cds--label",{"cds--label--disabled":i}),htmlFor:$},null!=c?c:l),A().createElement(aJ,{className:fw.inputGroup},A().createElement("div",{className:fw.inputsWrapper},A().createElement(sm,{className:b()("cds--date-picker-input__wrapper",fw.startInput,fw.dateInputWrapper),slot:"start"},function(e){return A().createElement(fl,{className:fw.inputSegment,segment:e})}),A().createElement("div",{className:fw.separator},A().createElement("span",{"aria-hidden":"true","data-readonly":!0},"–")),A().createElement(sm,{className:b()("cds--date-picker-input__wrapper",fw.endInput,fw.dateInputWrapper),slot:"end"},function(e){return A().createElement(fl,{className:fw.inputSegment,segment:e})})),A().createElement(t2,{className:b()(fw.flatButton,fw.flatButtonMd)},A().createElement(fx,null))),M&&o&&A().createElement(sz,{className:fw.invalidText},o),A().createElement(cu,{className:fw.popover,placement:"bottom start",offset:1,isNonModal:!0},A().createElement(fp,{isRangePicker:!0},A().createElement(aH,{minValue:z,maxValue:B,className:"cds--date-picker__calendar"},A().createElement("header",{className:fw.header},A().createElement(t2,{className:b()(fw.flatButton,fw.flatButtonMd),slot:"previous"},A().createElement(cX,{size:16})),A().createElement(pT,{className:fw.monthYear}),A().createElement(t2,{className:b()(fw.flatButton,fw.flatButtonMd),slot:"next"},A().createElement(cQ,{size:16}))),A().createElement(aj,{className:fw.calendarGrid},function(e){return A().createElement(aZ,{key:e.toString(),className:b()("cds--date-picker__day",fD({},fw.today,0===T.compare(e))),date:e})})))))))))}),fN=t(70438),fP=function(e){var n=e.diagnoses,t=(0,v.UK)({externalModuleName:"@openmrs/esm-styleguide"}).diagnosisTags;return A().createElement(A().Fragment,null,n.map(function(e){var n=e.rank,r=e.uuid,a=e.display,o=t[1===n?"primaryColor":"secondaryColor"];return A().createElement(fN.Tag,{key:r,type:o},a)}))},fI=t(61836),fF=t(71065),fR={};fR.styleTagTransform=T(),fR.setAttributes=S(),fR.insert=x().bind(null,"head"),fR.domAPI=k(),fR.insertStyleElement=B(),$()(fF.A,fR);let fH=fF.A&&fF.A.locals?fF.A.locals:void 0;var fL=function(e){var n,t,r=e.error,a=e.headerTitle,o="tablet"===(0,v.qv)();return A().createElement(fN.Layer,null,A().createElement(fN.Tile,{className:fH.tile},A().createElement("div",{className:o?fH.tabletHeading:fH.desktopHeading},A().createElement("h4",null,a)),A().createElement("p",{className:fH.errorMessage},(0,fI.V)("error","Error")," ","".concat(null==r||null==(n=r.response)?void 0:n.status,": "),null==r||null==(t=r.response)?void 0:t.statusText),A().createElement("p",{className:fH.errorCopy},(0,fI.V)("errorCopy"))))},fj=t(71981),fq={};fq.styleTagTransform=T(),fq.setAttributes=S(),fq.insert=x().bind(null,"head"),fq.domAPI=k(),fq.insertStyleElement=B(),$()(fj.A,fq);let fG=fj.A&&fj.A.locals?fj.A.locals:void 0;function fV(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function fU(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){fV(e,n,t[n])})}return e}var fW=A().forwardRef(function(e,n){var t,r=(0,v.TA)(),a=r.slotName,o=r.basePath,i=r.componentContext,s=null!=(t=window.location)?t:{pathname:""},l=(0,v.CX)(null!=a?a:"");return e.isChildOfHeader&&a&&l.length>0?A().createElement(fN.SideNav,fU({ref:n,expanded:!0,"aria-label":"Left navigation",className:fG.leftNav},e),A().createElement(v.W3,{name:"global-nav-menu-slot"}),a?A().createElement(v.fS,{value:i,fallback:A().createElement(v.W3,{name:a,state:{basePath:o,currentPath:s}})},A().createElement(v.zq.Provider,{value:i},A().createElement(v.W3,{name:a,state:{basePath:o,currentPath:s}}))):null):A().createElement(A().Fragment,null)}),fK=t(36142),fZ=t.n(fK),fY=t(97744),fJ=t.n(fY),fX=t(70937),fQ=t(60482),f0=function(e){var n=e.notification,t=n.description,r=n.action,a=n.kind,o=n.critical,i=n.title,s=n.onAction;return A().createElement(fN.ActionableNotification,{actionButtonLabel:r,kind:a||"info",lowContrast:o,subtitle:t,title:i||"",inline:!0,onActionButtonClick:s})};function f1(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function f2(e){if(Array.isArray(e))return e}function f3(e){if(Array.isArray(e))return f1(e)}function f4(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function f5(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function f6(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f8(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f7(e,n){return f2(e)||f5(e,n)||_e(e,n)||f6()}function f9(e){return f3(e)||f4(e)||_e(e)||f8()}function _e(e,n){if(e){if("string"==typeof e)return f1(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return f1(e,n)}}let _n=function(e){var n=e.subject,t=f7((0,g.useState)([]),2),r=t[0],a=t[1];return(0,g.useEffect)(function(){var e=n.subscribe(function(e){return a(function(n){return f9(n.filter(function(n){return n.description!==e.description||n.action!==e.action||n.kind!==e.kind||n.title!==e.title})).concat([e])})});return function(){return e.unsubscribe()}},[n]),A().createElement(A().Fragment,null,r.map(function(e){return A().createElement(f0,{key:e.id,notification:e})}))};function _t(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function _r(e){if(Array.isArray(e))return e}function _a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function _o(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function _i(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){_a(e,n,t[n])})}return e}function _l(e,n){if(null==e)return{};var t,r,a=_c(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function _c(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}function _u(e,n){return _r(e)||_o(e,n)||_d(e,n)||_i()}function _d(e,n){if(e){if("string"==typeof e)return _t(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _t(e,n)}}var _p=function(e){var n=e.notification,t=n.actionButtonLabel,r=n.onActionButtonClick,a=void 0===r?function(){}:r,o=n.subtitle,i=n.kind,s=n.title,l=n.critical,c=n.progressActionLabel,u=(n.id,_l(n,["actionButtonLabel","onActionButtonClick","subtitle","kind","title","critical","progressActionLabel","id"])),d=_u((0,g.useState)(t),2),p=d[0],f=d[1],h=function(){a(),c&&f(c)};return A().createElement(fN.ActionableNotification,_s({kind:i||"info",actionButtonLabel:p,ariaLabel:"Closes actionable notification",onActionButtonClick:h,statusIconDescription:"Actionable notification",subtitle:o,title:s,lowContrast:l,inline:!0},u))};function _f(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function __(e){if(Array.isArray(e))return e}function _h(e){if(Array.isArray(e))return _f(e)}function _m(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _g(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function _A(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _y(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _b(e,n){return __(e)||_g(e,n)||_C(e,n)||_A()}function _v(e){return _h(e)||_m(e)||_C(e)||_y()}function _C(e,n){if(e){if("string"==typeof e)return _f(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _f(e,n)}}let _$=function(e){var n=e.subject,t=_b((0,g.useState)([]),2),r=t[0],a=t[1];return(0,g.useEffect)(function(){var e=n.subscribe(function(e){return a(function(n){return _v(n.filter(function(n){return n.subtitle!==e.subtitle||n.actionButtonLabel!==e.actionButtonLabel||n.onActionButtonClick!==e.onActionButtonClick||n.kind!==e.kind||n.title!==e.title})).concat([e])})});return function(){return e.unsubscribe()}},[n]),A().createElement(A().Fragment,null,r.map(function(e){return A().createElement(_p,{key:e.id,notification:e})}))};var _w=t(62926),_k=t(4004),_E=t(17820),_x=t(36820),_D=t(55259),_S=t(75323),_z=t(24956),_B=t(43148),_M="[object Map]",_T="[object Set]",_O=Object.prototype.hasOwnProperty;let _N=function(e){if(null==e)return!0;if((0,_D.A)(e)&&((0,_x.A)(e)||"string"==typeof e||"function"==typeof e.splice||(0,_S.A)(e)||(0,_B.A)(e)||(0,_E.A)(e)))return!e.length;var n=(0,_k.A)(e);if(n==_M||n==_T)return!e.size;if((0,_z.A)(e))return!(0,_w.A)(e).length;for(var t in e)if(_O.call(e,t))return!1;return!0};var _P=t(25873);function _I(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function _F(e,n){return null!=n&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?!!n[Symbol.hasInstance](e):e instanceof n}function _R(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){_I(e,n,t[n])})}return e}function _H(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function _L(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_H(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function _j(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}var _q=new fQ.B7,_G=0,_V=new fQ.B7,_U=0;function _W(e){e&&(0,_P.createRoot)(e).render(A().createElement(_n,{subject:_q}))}function _K(e){return"string"==typeof e?e.trim().length>0:(void 0===e?"undefined":_j(e))==="object"&&(_F(e,Error)||!_N(e))}function _Z(e){e&&_K(e.description)?(_F(e.description,Error)&&(e.description=e.description.toLocaleString()),setTimeout(function(){_q.next(_L(_R({},e),{id:_G++}))},0)):console.error("showNotification must be called with an object having a 'description' property that is a non-empty string or object")}function _Y(e){e&&(0,_P.createRoot)(e).render(A().createElement(_$,{subject:_V}))}function _J(e){return"string"==typeof e?e.trim().length>0:(void 0===e?"undefined":_j(e))==="object"&&!_N(e)}function _X(e){e&&_J(e.actionButtonLabel)?setTimeout(function(){_V.next(_L(_R({},e),{id:_U++}))},0):console.error("showActionableNotification must be called with an actionButtonLabel that is a non-empty string")}function _Q(e){var n=e?"/ws/fhir2/R4/Location?_id=".concat(e):null,t=fZ()(n,fX.lo,{shouldRetryOnError:function(e){var n;return null!=e&&null!=(n=e.response)&&!!n.status&&e.response.status>=500}}),r=t.data,a=t.error,o=t.isLoading;return(0,g.useMemo)(function(){var e;return{location:(null==r||null==(e=r.data)?void 0:e.entry)?r.data.entry[0]:null,error:n?a:null,isLoading:!!n&&o}},[r,o,a,n])}function _0(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=(0,V.useTranslation)().t,a=(0,v.d7)(t);function o(t,r){if(r){var o,i,s=null==(i=r.data)||null==(o=i.link)?void 0:o.find(function(e){return"next"===e.relation});if(!s)return null;var l=new URL(s.url);return l.origin===window.location.origin?s.url:new URL("".concat(l.pathname).concat(l.search?"?".concat(l.search):""),window.location.origin).toString()}var c="".concat(fX.IU,"/Location?"),u=new URLSearchParams;return u.append("_summary","data"),n&&u.append("_count",""+n),t&&u.append("_getpagesoffset",""+t*n),e&&u.append("_tag",e),"string"==typeof a&&""!=a&&u.append("name:contains",a),c+u.toString()}var i=fJ()(o,fX.lo),s=i.data,l=i.isLoading,c=i.isValidating,u=i.setSize,d=i.error;return d&&_Z({title:r("errorLoadingLoginLocations","Error loading login locations"),kind:"error",critical:!0,description:null==d?void 0:d.message}),(0,g.useMemo)(function(){var e,n,t,r,a;return{locations:(null==s?void 0:s.length)?null==s?void 0:s.flatMap(function(e){var n,t;return null!=(t=null==e||null==(n=e.data)?void 0:n.entry)?t:[]}):[],isLoading:l,totalResults:null==s||null==(n=s[0])||null==(e=n.data)?void 0:e.total,hasMore:null!=s&&!!s.length&&(null==s||null==(a=s[s.length-1])||null==(r=a.data)||null==(t=r.link)?void 0:t.some(function(e){return"next"===e.relation})),loadingNewData:c,setPage:u}},[l,s,c,u])}var _1=t(65309),_2={};_2.styleTagTransform=T(),_2.setAttributes=S(),_2.insert=x().bind(null,"head"),_2.domAPI=k(),_2.insertStyleElement=B(),$()(_1.A,_2);let _3=_1.A&&_1.A.locals?_1.A.locals:void 0;function _4(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function _5(e){if(Array.isArray(e))return e}function _6(e){if(Array.isArray(e))return _4(e)}function _8(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _7(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function _9(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function he(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function hn(e,n){return _5(e)||_7(e,n)||hr(e,n)||_9()}function ht(e){return _6(e)||_8(e)||hr(e)||he()}function hr(e,n){if(e){if("string"==typeof e)return _4(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _4(e,n)}}var ha=function(e){var n=e.selectedLocationUuid,t=e.defaultLocationUuid,r=e.locationTag,a=e.locationsPerRequest,o=void 0===a?50:a,i=e.onChange,s=(0,V.useTranslation)().t,l=hn((0,g.useState)(""),2),c=l[0],u=l[1],d=_Q(t).location,p=_0(r,o,c),f=p.locations,h=p.isLoading,m=p.hasMore,y=p.loadingNewData,b=p.setPage,v=(0,g.useMemo)(function(){return d&&!c?[d].concat(ht(null==f?void 0:f.filter(function(e){return e.resource.id!==t}))):f},[d,f]),C=function(e){i(),u(e)},$=(0,g.useCallback)(function(){y||!m||b(function(e){return e+1})},[y,m,b]),w=(0,K.useOnVisible)($),k=m?v.length-o/2:-1;return A().createElement("div",null,A().createElement(fN.Search,{labelText:s("searchForLocation","Search for a location"),id:"search-1",placeholder:s("searchForLocation","Search for a location"),onChange:function(e){return C(e.target.value)},size:"lg"}),A().createElement("div",{className:_3.searchResults},h?A().createElement("div",{className:_3.loadingContainer},A().createElement(fN.RadioButtonSkeleton,{className:_3.radioButtonSkeleton,role:"progressbar"}),A().createElement(fN.RadioButtonSkeleton,{className:_3.radioButtonSkeleton,role:"progressbar"}),A().createElement(fN.RadioButtonSkeleton,{className:_3.radioButtonSkeleton,role:"progressbar"}),A().createElement(fN.RadioButtonSkeleton,{className:_3.radioButtonSkeleton,role:"progressbar"}),A().createElement(fN.RadioButtonSkeleton,{className:_3.radioButtonSkeleton,role:"progressbar"})):A().createElement(A().Fragment,null,A().createElement("div",{className:_3.locationResultsContainer},(null==v?void 0:v.length)>0?A().createElement(fN.RadioButtonGroup,{name:"loginLocations",onChange:function(e){i(null==e?void 0:e.toString())},orientation:"vertical",valueSelected:n},v.map(function(e,n){return A().createElement(fN.RadioButton,{className:_3.locationRadioButton,key:e.resource.id,id:e.resource.id,name:e.resource.name,labelText:A().createElement("span",{ref:n==k?w:null},e.resource.name),value:e.resource.id})})):A().createElement("div",{className:_3.emptyState},A().createElement("p",{className:_3.locationNotFound},s("noResultsToDisplay","No results to display")))),y&&A().createElement("div",{className:_3.loadingIcon},A().createElement(fN.InlineLoading,{description:s("loading","Loading")})))))},ho=t(22956),hi=t(467),hs=t(96893),hl=t(64201);function hc(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function hu(e){if(Array.isArray(e))return e}function hd(e){if(Array.isArray(e))return hc(e)}function hp(e,n,t,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){t(e);return}s.done?n(l):Promise.resolve(l).then(r,a)}function hf(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function i(e){hp(o,r,a,i,s,"next",e)}function s(e){hp(o,r,a,i,s,"throw",e)}i(void 0)})}}function h_(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function hh(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function hm(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function hg(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function hA(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function hy(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){h_(e,n,t[n])})}return e}function hb(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function hv(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hb(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function hC(e,n){return hu(e)||hm(e,n)||hw(e,n)||hg()}function h$(e){return hd(e)||hh(e)||hw(e)||hA()}function hw(e,n){if(e){if("string"==typeof e)return hc(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return hc(e,n)}}function hk(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(n){return l([e,n])}}function l(s){if(t)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],r=0}finally{t=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}var hE=(0,hi.Zd)("modalState",{modalContainer:null,modalStack:[]});function hx(e){var n=e.size,t=document.createElement("div");return t.className="cds--modal-container cds--modal-container--".concat(n),t.setAttribute("role","dialog"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-modal","true"),t}var hD=0;function hS(e,n){return hf(function(e,n){var t,r,a,o,i,s=arguments;return hk(this,function(l){switch(l.label){case 0:if(t=s.length>2&&void 0!==s[2]?s[2]:{},r=(0,hs.Fg)(n),a=null,!e)return[3,2];if(!r)throw Error("No modal named '".concat(n,"' has been registered."));return[4,(0,r.load)()];case 1:return o=l.sent(),i=hD++,a=(0,ho.xL)(hv(hy({},o),{name:"".concat(n,"-").concat(i)}),hv(hy({},t),{domElement:e})),[3,3];case 2:(0,hl.N)("Failed to launch modal. Please notify your administrator. Modal name: ".concat(n)),l.label=3;case 3:return[2,a]}})}).apply(this,arguments)}var hz=window.getComputedStyle(document.body).overflow;function hB(e){var n=e.modalStack,t=e.modalContainer;t&&(n.length?(t.style.visibility||(addEventListener("keydown",hN),document.body.style.overflow="hidden",t.style.visibility="unset"),n.forEach(function(e,r){switch(e.state){case"NEW":var a,o,i,s,l,c=hx({size:null!=(l=null==(s=e.props)?void 0:s.size)?l:"md"});e.container=c,hS(c,e.modalName,e.props).then(function(n){e.parcel=n,e.state="MOUNTED",t.prepend(c),c.style.visibility="unset"});break;case"MOUNTED":e.container&&(e.container.style.visibility=r?"hidden":"unset");break;case"TO_BE_DELETED":e.onClose(),null==(o=e.parcel)||null==(a=o.unmount)||a.call(o),null==(i=e.container)||i.remove(),setTimeout(function(){hE.setState({modalContainer:t,modalStack:n.filter(function(n){return n!==e})})},0)}})):(t.style.removeProperty("visibility"),document.body.style.overflow=hz,removeEventListener("keydown",hN)))}function hM(e){var n=hE.getState(),t=[e].concat(h$(n.modalStack));hE.setState(hv(hy({},n),{modalStack:t}))}function hT(e){var n=hE.getState(),t=n.modalStack.map(function(n){return n===e?hv(hy({},n),{state:"TO_BE_DELETED"}):n});hE.setState(hv(hy({},n),{modalStack:t}))}function hO(){var e=hC(hE.getState().modalStack,1)[0];e&&hT(e)}function hN(e){"Escape"===e.key&&hO()}function hP(e){hE.subscribe(hB),hE.setState(hv(hy({},hE.getState()),{modalContainer:e}))}function hI(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=function(){var e=hE.getState().modalStack.find(function(e){return e.onClose===t});e&&hT(e)};return(0,hs.Fg)(e)?hM({state:"NEW",onClose:t,modalName:e,props:hy({close:r},n)}):(0,hl.N)('Failed to launch modal. Please notify your administrator. Modal name: "'.concat(e,'"')),r}var hF=t(94285),hR={};hR.styleTagTransform=T(),hR.setAttributes=S(),hR.insert=x().bind(null,"head"),hR.domAPI=k(),hR.insertStyleElement=B(),$()(hF.A,hR);let hH=hF.A&&hF.A.locals?hF.A.locals:void 0;function hL(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function hj(e){if(Array.isArray(e))return e}function hq(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function hG(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function hV(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function hU(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){hq(e,n,t[n])})}return e}function hW(e,n){if(null==e)return{};var t,r,a=hK(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function hK(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}function hZ(e,n){return hj(e)||hG(e,n)||hY(e,n)||hV()}function hY(e,n){if(e){if("string"==typeof e)return hL(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return hL(e,n)}}var hJ=function(e){return"children"in e},hX=function(e){if(hJ(e)){var n=e.children,t=e.className,r=hW(e,["children","className"]);return A().createElement("div",hU({className:b()(hH.pageHeader,t)},r),n)}var a=e.title,o=e.illustration,i=e.className,s=hW(e,["title","illustration","className"]);return A().createElement("div",hU({className:b()(hH.pageHeader,i)},s),A().createElement(hQ,{title:a,illustration:o}))},hQ=function(e){var n=e.title,t=e.illustration,r=e.className,a=hZ((0,g.useState)(null),2),o=a[0],i=a[1];return(0,g.useEffect)(function(){(0,p.zj)("@openmrs/esm-styleguide").then(function(e){i(e)})},[]),A().createElement("div",{className:b()(hH.pageHeaderContent,r)},t,A().createElement("div",{className:hH.pageLabels},(null==o?void 0:o.implementationName)&&A().createElement("p",null,(0,fI.V)(o.implementationName)),A().createElement("p",{className:hH.pageName},n)))},h0=t(67943),h1=t(40785),h2=t(85195),h3={};h3.styleTagTransform=T(),h3.setAttributes=S(),h3.insert=x().bind(null,"head"),h3.domAPI=k(),h3.insertStyleElement=B(),$()(h2.A,h3);let h4=h2.A&&h2.A.locals?h2.A.locals:void 0;function h5(e){var n=e.showIdentifierLabel,t=e.type,r=e.value;return A().createElement("span",{className:h4.primaryIdentifier},A().createElement(fN.Tag,{className:h4.tag,type:"gray"},n&&(null==t?void 0:t.text)&&A().createElement("span",{className:h4.label},t.text,": "),A().createElement("span",{className:h4.value},r)))}function h6(e){var n=e.showIdentifierLabel,t=e.type,r=e.value;return A().createElement(fN.FormLabel,{className:h4.secondaryIdentifier,id:"patient-banner-identifier-".concat(r)},n&&A().createElement("span",{className:h4.label},null==t?void 0:t.text,": "),A().createElement("span",{className:h4.value},r))}function h8(e){var n,t=e.identifiers,r=e.showIdentifierLabel,a=(0,v.UK)().excludePatientIdentifierCodeTypes,o=(0,v.wJ)().primaryIdentifierCode,i=null!=(n=null==t?void 0:t.filter(function(e){var n,t,r,o=null==(r=e.type)||null==(t=r.coding)||null==(n=t[0])?void 0:n.code;return o&&!(null==a?void 0:a.uuids.includes(o))}))?n:[];return A().createElement(A().Fragment,null,(null==i?void 0:i.length)?i.map(function(e,n){var t,a,s=e.value,l=e.type;return A().createElement(A().Fragment,{key:s},A().createElement("span",{className:h4.identifier},(null==l||null==(a=l.coding)||null==(t=a[0])?void 0:t.code)===o?A().createElement(h5,{showIdentifierLabel:r,type:l,value:s}):A().createElement(h6,{showIdentifierLabel:r,type:l,value:s})),n<i.length-1&&A().createElement("span",{className:h4.separator},"\xb7"))}):"")}let h7=h8;var h9={Female:un,Male:ut,Other:ur,Unknown:ua},me=function(e){var n=h9[e.gender];return n?A().createElement(n,{fill:"#525252"}):null},mn={male:"Male",female:"Female",other:"Other",unknown:"Unknown"},mt=function(e){var n,t=e.toLowerCase(),r=null!=(n=mn[t])?n:"Unknown";return{displayText:(0,fI.V)(t,e),iconKey:r}};function mr(e){var n=e.patient,t=e.renderedFrom,r=(0,h0.Vp)(n),a=(null==n?void 0:n.gender)&&mt(n.gender),o=(0,g.useMemo)(function(){return{patientUuid:n.id,patient:n,renderedFrom:t}},[n.id,n,t]);return A().createElement("div",{className:h4.patientInfo},A().createElement("div",{className:b()(h4.row,h4.patientNameRow)},A().createElement("div",{className:h4.flexRow},A().createElement("span",{className:h4.patientName},r),a&&A().createElement("div",{className:h4.gender},A().createElement(me,{gender:a.iconKey}),A().createElement("span",null,a.displayText)),A().createElement(v.W3,{className:h4.tagsSlot,name:"patient-banner-tags-slot",state:o}))),A().createElement("div",{className:h4.demographics},n.birthDate&&A().createElement(A().Fragment,null,A().createElement("span",null,(0,h1.K)(n.birthDate)),A().createElement("span",{className:h4.separator},"\xb7"),A().createElement("span",null,(0,cx.LW)(n.birthDate,{time:!1})),A().createElement("span",{className:h4.separator},"\xb7")),A().createElement(h7,{identifiers:n.identifier,showIdentifierLabel:!0}),A().createElement(v.W3,{className:h4.extensionSlot,name:"patient-banner-bottom-slot",state:o})))}var ma=t(18282),mo=t(25447),mi={};mi.styleTagTransform=T(),mi.setAttributes=S(),mi.insert=x().bind(null,"head"),mi.domAPI=k(),mi.insertStyleElement=B(),$()(mo.A,mi);let ms=mo.A&&mo.A.locals?mo.A.locals:void 0;function ml(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function mc(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){ml(e,n,t[n])})}return e}function mu(e){var n=e.patient,t=e.patientUuid,r=e.actionsSlotName,a=e.additionalActionsSlotState,o=(0,v.br)(r).extensions,i=(0,g.useMemo)(function(){return mc({patientUuid:t,patient:n},a)},[t,a]);return A().createElement(A().Fragment,null,o.length>0?A().createElement("div",{className:ms.overflowMenuContainer},A().createElement(G,{menuTitle:A().createElement(A().Fragment,null,A().createElement("span",{className:ms.actionsButtonText},(0,fI.V)("actions","Actions"))," ",A().createElement(ma.CH,{size:16,style:{marginLeft:"0.5rem",fill:"#78A9FF"}}))},A().createElement(v.W3,{name:"patient-actions-slot",key:"patient-actions-slot",state:i}))):null)}var md=function(e){var n=e.toast,t=e.closeToast,r=n.description,a=n.kind,o=n.critical,i=n.title,s=n.actionButtonLabel,l=n.onActionButtonClick,c=void 0===l?function(){}:l,u=(0,g.useCallback)(function(){c(),t()},[t,c]);return A().createElement("div",null,A().createElement(fN.ActionableNotification,{actionButtonLabel:s,kind:a||"info",lowContrast:o,subtitle:r,title:i||"",onActionButtonClick:u,onClose:t}))};function mp(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function mf(e){if(Array.isArray(e))return e}function m_(e){if(Array.isArray(e))return mp(e)}function mh(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function mm(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function mg(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function mA(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function my(e,n){return mf(e)||mm(e,n)||mv(e,n)||mg()}function mb(e){return m_(e)||mh(e)||mv(e)||mA()}function mv(e,n){if(e){if("string"==typeof e)return mp(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return mp(e,n)}}let mC=function(e){var n=e.subject,t=my((0,g.useState)([]),2),r=t[0],a=t[1],o=(0,g.useCallback)(function(e){a(function(n){return n.filter(function(n){return n!==e})})},[]);return(0,g.useEffect)(function(){var e=n.subscribe(function(e){return a(function(n){return mb(n.filter(function(n){return n.description!==e.description||n.kind!==e.kind||n.title!==e.title||n.actionButtonLabel!==e.actionButtonLabel||n.onActionButtonClick!==e.onActionButtonClick})).concat([e])})});return function(){return e.unsubscribe()}},[n]),A().createElement(A().Fragment,null,r.map(function(e){return A().createElement(md,{key:e.id,toast:e,closeToast:function(){return o(e)}})}))};function m$(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function mw(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){m$(e,n,t[n])})}return e}function mk(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function mE(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function mx(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}var mD=new fQ.B7,mS=0;function mz(e){e&&(0,_P.createRoot)(e).render(A().createElement(mC,{subject:mD}))}function mB(e){return"string"==typeof e?e.trim().length>0:(void 0===e?"undefined":mx(e))==="object"&&!_N(e)}function mM(e){e&&mB(e.description)?setTimeout(function(){mD.next(mE(mw({},e),{id:mS++}))},0):console.error("showToast must be called with an object having a 'description' property that is a non-empty string or object")}var mT=t(17744);function mO(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function mN(e){if(Array.isArray(e))return mO(e)}function mP(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function mI(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function mF(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function mR(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){mP(e,n,t[n])})}return e}function mH(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function mL(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function mj(e){return mN(e)||mI(e)||mq(e)||mF()}function mq(e,n){if(e){if("string"==typeof e)return mO(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return mO(e,n)}}function mG(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n)return!0;var t=mX(e);return!t||!t()}function mV(e,n){var t,r=m5(),a=null==(t=r.getState())?void 0:t.workspaceGroup,o=null==a?void 0:a.name;if(o&&e===o){var i=o?function(e){return e.currentWorkspaceGroup===o}:function(){return!0};m7(function(){var t=gr(e);t&&(t.setState({},!0),t.subscribe(function(){})()),"function"==typeof(null==a?void 0:a.cleanup)&&a.cleanup(),r.setState(function(e){return mL(mR({},e),{workspaceGroup:void 0})}),"function"==typeof n&&n()},i)}}function mU(e,n){var t,r=(0,hs.Q_)(e),a=n.state,o=n.onWorkspaceGroupLaunch,i=n.workspaceGroupCleanup,s=n.workspaceToLaunch,l=m5();if(l.getState().openWorkspaces.length){var c=l.getState().workspaceGroup;c?mV(null==c?void 0:c.name,function(){mU(e,n)}):m7(function(){mU(e,n)})}else l.setState(function(n){return mL(mR({},n),{workspaceGroup:{name:e,members:r.members,cleanup:i}})}),gr(e,a),null==o||o(),s&&mK(s.name,null!=(t=s.additionalProps)?t:{})}function mW(e,n){var t,r=n.name,a=n.additionalProps;(0,hs.Xb)(r);var o=function(){m1(e.name,{ignoreChanges:!0,onWorkspaceClose:function(){return mK(r,a)},closeWorkspaceGroup:!1})};mG(e.name)?o():ge("closing-workspace-launching-new-workspace",o,null!=(t=e.title)?t:e.name)}function mK(e,n){var t,r,a=m5(),o=(0,hs.Xb)(e),i=a.getState().workspaceGroup;if(i&&!(null==(t=i.members)?void 0:t.includes(e)))return void mV(i.name,function(){mK(e,n)});var s=null==(r=a.getState().workspaceGroup)?void 0:r.name,l=mL(mR({},o),{title:gn(o,n),closeWorkspace:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return m1(e,n)},closeWorkspaceWithSavedChanges:function(n){return m1(e,mR({ignoreChanges:!0},n))},promptBeforeClosing:function(n){return mJ(e,n)},setTitle:function(n,t){l.title=n,l.titleNode=t,a.setState(function(n){var t=n.openWorkspaces.map(function(n){return n.name===e?l:n});return mL(mR({},n),{openWorkspaces:t})})},currentWorkspaceGroup:s,additionalProps:null!=n?n:{}});function c(e,n){a.setState(function(t){var r=[e].concat(mj(null!=n?n:t.openWorkspaces)),a=m8(e);return mL(mR({},t),{openWorkspaces:r,workspaceWindowState:a})})}s&&gr(s,n);var u=a.getState().openWorkspaces,d=u.findIndex(function(n){return n.name===e}),p=d>=0,f=u.find(function(e){return e.type==l.type});if(0===u.length)c(l);else if(u[0].canHide||0===d)if(p){var h=u[d];h.title===gn(h,h.additionalProps)&&(h.title=gn(l,l.additionalProps)),h.additionalProps=l.additionalProps;var m=u.filter(function(n){return n.name!=e});c(u[d],m)}else f?(c(f,a.getState().openWorkspaces.filter(function(e){return e.type!=l.type})),mW(f,{name:e,additionalProps:n})):c(l);else mW(u[0],{name:e,additionalProps:n})}function mZ(e){var n=e.targetUrl,t=e.contextKey,r=e.workspaceName,a=e.additionalProps;m2(t),mK(r,a),(0,mT.oo)({to:n})}var mY={};function mJ(e,n){mY[e]=n}function mX(e){return mY[e]}function mQ(){var e=m5(),n=e.getState();e.setState(mL(mR({},n),{prompt:null}))}var m0={ignoreChanges:!1,onWorkspaceClose:function(){},closeWorkspaceGroup:!0};function m1(e){var n,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=mR({},m0,t);var r=m5(),a=function(){var n,a,o=r.getState();o.openWorkspaces.find(function(n){return n.name===e});var i=o.openWorkspaces.filter(function(n){return n.name!=e}),s=null==(n=r.getState().workspaceGroup)?void 0:n.name;s&&t.closeWorkspaceGroup&&mV(s),mJ(e,function(){return!1}),r.setState(function(e){return mL(mR({},e),{prompt:null,openWorkspaces:i,workspaceWindowState:m8(null==i?void 0:i[0])})}),null==t||null==(a=t.onWorkspaceClose)||a.call(t)};return mG(e,null==t?void 0:t.ignoreChanges)?(a(),!0):(ge("closing-workspace",a,null!=(n=(0,hs.Xb)(e).title)?n:e),!1)}function m2(e){var n=m5();n.getState().context!=e&&n.setState({context:e,openWorkspaces:[],prompt:null})}var m3={context:"",openWorkspaces:[],prompt:null,workspaceWindowState:"normal",workspaceGroup:void 0},m4=(0,hi.Zd)("workspace",m3);function m5(){return m4}function m6(e){var n=m5(),t=n.getState();n.setState(mL(mR({},t),{workspaceWindowState:e}))}function m8(e){var n;return null!=(n=null==e?void 0:e.preferredWindowSize)?n:"normal"}function m7(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},t=m5().getState().openWorkspaces.filter(n).every(function(e){return mG(e.name)}),r=function(){gt(),null==e||e()};t?r():ge("closing-all-workspaces",r)}function m9(){var e=(0,v.Pj)(m4),n=e.workspaceWindowState,t=e.openWorkspaces,r=e.prompt,a=e.workspaceGroup;return(0,g.useMemo)(function(){return{active:t.length>0,prompt:r,workspaceWindowState:n,workspaces:t,workspaceGroup:a}},[t,n,r,a])}function ge(e){var n,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=m5();switch(e){case"closing-workspace":n={title:(0,fI.V)("unsavedChangesTitleText","Unsaved changes"),body:(0,fI.V)("unsavedChangesInOpenedWorkspace","You may have unsaved changes in the opened workspace. Do you want to discard these changes?"),onConfirm:function(){null==t||t()},confirmText:(0,fI.V)("discard","Discard")};break;case"closing-all-workspaces":var o=a.getState().openWorkspaces.filter(function(e){return!mG(e.name)}).map(function(e,n){var t=e.title;return"".concat(n+1,". ").concat(t)});n={title:(0,fI.V)("closingAllWorkspacesPromptTitle","You have unsaved changes"),body:(0,fI.V)("closingAllWorkspacesPromptBody","There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",{workspaceNames:o.join(",")}),onConfirm:function(){null==t||t()},confirmText:(0,fI.V)("closeAllOpenedWorkspaces","Discard changes in {{count}} workspaces",{count:o.length})};break;case"closing-workspace-launching-new-workspace":n={title:(0,fI.V)("unsavedChangesTitleText","Unsaved changes"),body:(0,fI.V)("unsavedChangesInWorkspace",'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',{workspaceName:r}),onConfirm:function(){a.setState(function(e){return mL(mR({},e),{prompt:null})}),null==t||t()},confirmText:(0,fI.V)("openAnyway","Open anyway")};break;default:console.error('Workspace system trying to open unknown prompt type "'.concat(e,'" in function "showWorkspacePrompts"')),null==t||t();return}a.setState(function(e){return mL(mR({},e),{prompt:n})})}function gn(e,n){var t;return null!=(t=null==n?void 0:n.workspaceTitle)?t:e.title}function gt(){m5().setState(m3)}function gr(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&"default"!==e){var t=(0,hi.jf)(e,{});return n&&t.setState(function(e){return mR({},e,n)}),t}}var ga=t(75230),go={};go.styleTagTransform=T(),go.setAttributes=S(),go.insert=x().bind(null,"head"),go.domAPI=k(),go.insertStyleElement=B(),$()(ga.A,go);let gi=ga.A&&ga.A.locals?ga.A.locals:void 0;function gs(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function gl(e){var n=e.getIcon,t=e.formOpenInTheBackground,r=e.tagContent;return A().createElement(A().Fragment,null,n({size:16}),t?A().createElement("span",{className:gi.interruptedTag},"!"):A().createElement("span",{className:gi.countTag},r))}var gc=function(e){var n,t=e.getIcon,r=e.label,a=e.iconDescription,o=e.handler,i=e.type,s=e.tagContent,l=(0,v.qv)(),c=m9(),u=c.workspaces,d=c.workspaceWindowState,p=null!=(n=null==u?void 0:u.findIndex(function(e){return e.type===i}))?n:-1,f="hidden"!==d&&0===p,h=p>0||0===p&&"hidden"===d;return"tablet"===l||"phone"===l?A().createElement(fN.Button,{className:b()(gi.container,gs({},gi.active,f)),iconDescription:a,kind:"ghost",onClick:o,role:"button",tabIndex:0,size:"md"},A().createElement("span",{className:gi.elementContainer},A().createElement(gl,{formOpenInTheBackground:h,getIcon:t,tagContent:s})),A().createElement("span",null,r)):A().createElement(fN.IconButton,{align:"left","aria-label":a,className:b()(gi.container,gs({},gi.active,f)),enterDelayMs:300,kind:"ghost",label:r,onClick:o,size:"md"},A().createElement("div",{className:gi.elementContainer},A().createElement(gl,{formOpenInTheBackground:h,getIcon:t,tagContent:s})))},gu=t(44970);let gd=A().forwardRef(function({children:e,size:n=16,...t},r){return 16===n||"16"===n||"16px"===n?A().createElement(gu.A,{width:n,height:n,ref:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",...t},s||(s=A().createElement("path",{d:"M2 9L2 10 5.3 10 1 14.3 1.7 15 6 10.7 6 14 7 14 7 9zM14 7L14 6 10.7 6 15 1.7 14.3 1 10 5.3 10 2 9 2 9 7z"})),e):A().createElement(gu.A,{width:n,height:n,ref:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...t},l||(l=A().createElement("path",{d:"M4 18L4 20 10.586 20 2 28.582 3.414 30 12 21.414 12 28 14 28 14 18 4 18zM30 3.416L28.592 2 20 10.586 20 4 18 4 18 14 28 14 28 12 21.414 12 30 3.416z"})),e)});var gp=t(54240),gf=t(68622),g_=t(1158),gh=/[\\^$.*+?()[\]{}|]/g,gm=RegExp(gh.source);let gg=function(e){return(e=(0,g_.A)(e))&&gm.test(e)?e.replace(gh,"\\$&"):e};var gA=t(3265),gy={};gy.styleTagTransform=T(),gy.setAttributes=S(),gy.insert=x().bind(null,"head"),gy.domAPI=k(),gy.insertStyleElement=B(),$()(gA.A,gy);let gb=gA.A&&gA.A.locals?gA.A.locals:void 0;function gv(e){var n,t,r=e.contextKey,a=(0,V.useTranslation)().t,o=m9().prompt;return(0,g.useEffect)(function(){new RegExp("/".concat(gg(r),"(/|$)")).test(window.location.pathname)||(0,hl.N)('WorkspaceContainer has provided an invalid context key: "'.concat(r,'". The context key must be part of the URL path, with no initial or trailing slash.'))},[]),(0,g.useEffect)(function(){return m2(r),function(){m2(null)}},[r]),(0,g.useEffect)(function(){var e=function(e){var n=e.detail,t=n.cancelNavigation,a=n.newUrl,o=new RegExp("/".concat(gg(r),"(/|$)")),i=new URL(a),s=o.test(i.pathname),l=m5().getState().openWorkspaces.every(function(e){return mG(e.name)});s||(l?gt():(null==t||t(),m7(function(){(0,mT.oo)({to:a})})))};return window.addEventListener("single-spa:before-routing-event",e),function(){window.removeEventListener("single-spa:before-routing-event",e)}},[]),null!=o?A().createElement(fN.ComposedModal,{open:!0,onClose:mQ},A().createElement(fN.ModalHeader,{title:o.title}),A().createElement(fN.ModalBody,null,A().createElement("p",{className:gb.messageBody},o.body)),A().createElement(fN.ModalFooter,null,A().createElement(fN.Button,{kind:"secondary",onClick:mQ},null!=(n=o.cancelText)?n:a("cancel","Cancel")),A().createElement(fN.Button,{kind:"danger",onClick:o.onConfirm},null!=(t=o.confirmText)?t:a("confirm","Confirm")))):null}var gC=t(6309);function g$(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function gw(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?g$(Object(t),!0).forEach(function(n){gE(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):g$(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function gk(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gE(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function gx(e){return(gx=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function gD(e,n){return(gD=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function gS(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gz(e,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw TypeError("Derived constructors may only return object or undefined");return gS(e)}function gB(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var t,r=gx(e);return t=n?Reflect.construct(r,arguments,gx(this).constructor):r.apply(this,arguments),gz(this,t)}}var gM=function(e){!function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&gD(e,n)}(o,g.Component);var n,t,r,a=gB(o);function o(e){var n;if(function(e,n){if(!(e instanceof n))throw TypeError("Cannot call a class as a function")}(this,o),gE(gS(n=a.call(this,e)),"handleRef",function(e){n.el=e}),gE(gS(n),"addThingToDo",function(e,t){n.state.hasError&&"unmount"!==e||(n.nextThingToDo=(n.nextThingToDo||Promise.resolve()).then(function(){if(!n.unmounted||"unmount"===e)return t.apply(void 0,arguments)}).catch(function(t){throw n.nextThingToDo=Promise.resolve(),n.setState({hasError:!0}),t&&t.message&&(t.message="During '".concat(e,"', parcel threw an error: ").concat(t.message)),n.props.handleError?n.props.handleError(t):setTimeout(function(){throw t}),t}))}),gE(gS(n),"getParcelProps",function(){var e=gw(gw({},n.props),{},{domElement:n.el});return delete e.mountParcel,delete e.config,delete e.wrapWith,delete e.wrapStyle,delete e.appendTo,delete e.handleError,delete e.parcelDidMount,e}),n.state={hasError:!1},!e.config)throw Error("single-spa-react's Parcel component requires the 'config' prop to either be a parcel config or a loading function that returns a promise. See https://github.com/single-spa/single-spa-react");return n}return n=o,t=[{key:"componentDidMount",value:function(){var e=this;this.unmounted=!1,this.addThingToDo("mount",function(){var n,t=e.props.mountParcel||e.mountParcel;if(!t)throw Error("\n <Parcel /> was not passed a mountParcel prop, nor is it rendered where mountParcel is within the React context.\n If you are using <Parcel /> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <Parcel /> as a mountParcel prop \n ");return e.el?n=e.el:(e.createdDomElement=n=document.createElement(e.props.wrapWith),Object.keys(e.props.wrapStyle).forEach(function(t){n.style[t]=e.props.wrapStyle[t]}),e.props.appendTo.appendChild(n)),e.parcel=t(e.props.config,gw({domElement:n},e.getParcelProps())),e.parcel.mountPromise.then(e.props.parcelDidMount),e.parcel.mountPromise})}},{key:"componentDidUpdate",value:function(){var e=this;this.addThingToDo("update",function(){if(e.parcel&&e.parcel.update)return e.parcel.update(e.getParcelProps())})}},{key:"componentWillUnmount",value:function(){var e=this;this.addThingToDo("unmount",function(){if(e.parcel&&"MOUNTED"===e.parcel.getStatus())return e.parcel.unmount()}),this.createdDomElement&&this.createdDomElement.parentNode.removeChild(this.createdDomElement),this.unmounted=!0}},{key:"render",value:function(){var e=this;if(this.props.appendTo)return gC.i&&gC.i.Consumer?g.createElement(gC.i.Consumer,null,function(n){return e.mountParcel=n?n.mountParcel:null,null}):null;var n=gC.i&&gC.i.Consumer?g.createElement(gC.i.Consumer,null,function(n){return e.mountParcel=n?n.mountParcel:null,null}):void 0;return g.createElement(this.props.wrapWith,{ref:this.handleRef,style:this.props.wrapStyle,className:this.props.wrapClassName},n)}}],gk(n.prototype,t),r&&gk(n,r),o}();gE(gM,"defaultProps",{wrapWith:"div",wrapStyle:{},parcelDidMount:function(){}});var gT=t(4784),gO={};gO.styleTagTransform=T(),gO.setAttributes=S(),gO.insert=x().bind(null,"head"),gO.domAPI=k(),gO.insertStyleElement=B(),$()(gT.A,gO);let gN=gT.A&&gT.A.locals?gT.A.locals:void 0;function gP(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function gI(e){if(Array.isArray(e))return e}function gF(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function gR(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function gH(e,n){return gI(e)||gF(e,n)||gL(e,n)||gR()}function gL(e,n){if(e){if("string"==typeof e)return gP(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return gP(e,n)}}function gj(e){var n=gH((0,g.useState)({}),2),t=n[0],r=n[1],a=gH((0,g.useState)(e),2),o=a[0],i=a[1];return(0,g.useEffect)(function(){o!==e&&i(e)},[e]),(0,g.useEffect)(function(){var e,n=gr(o);return n&&(r(n.getState()),e=n.subscribe(r)),function(){n&&(null==e||e())}},[o]),t}function gq(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function gG(e){if(Array.isArray(e))return e}function gV(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function gU(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function gW(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function gK(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){gV(e,n,t[n])})}return e}function gZ(e,n){return gG(e)||gU(e,n)||gY(e,n)||gW()}function gY(e,n){if(e){if("string"==typeof e)return gq(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return gq(e,n)}}function gJ(e){var n=e.workspace,t=e.additionalPropsFromPage,r=gZ((0,g.useState)(),2),a=r[0],o=r[1],i=gj(n.currentWorkspaceGroup);(0,g.useEffect)(function(){var e=!0;return n.load().then(function(n){e&&o(n)}),function(){e=!1}},[n]);var s=(0,g.useMemo)(function(){return n&&gK({closeWorkspace:n.closeWorkspace,closeWorkspaceWithSavedChanges:n.closeWorkspaceWithSavedChanges,promptBeforeClosing:n.promptBeforeClosing,setTitle:n.setTitle},t,i,n.additionalProps)},[n,t,i]);return a?A().createElement(gM,gK({key:n.name,config:a,mountParcel:ho.xL},s)):A().createElement(fN.InlineLoading,{className:gN.loader,description:"".concat((0,fI.V)("loading","Loading")," ...")})}var gX=t(7597),gQ={};gQ.styleTagTransform=T(),gQ.setAttributes=S(),gQ.insert=x().bind(null,"head"),gQ.domAPI=k(),gQ.insertStyleElement=B(),$()(gX.A,gQ);let g0=gX.A&&gX.A.locals?gX.A.locals:void 0;function g1(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function g2(e){if(Array.isArray(e))return e}function g3(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function g4(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function g5(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g6(e,n){return g2(e)||g4(e,n)||g8(e,n)||g5()}function g8(e,n){if(e){if("string"==typeof e)return g1(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g1(e,n)}}function g7(e){var n,t=e.isWithinWorkspace,r=e.name,a=e.actionMenuProps,o=void 0===a?{}:a,i=g6((0,g.useState)(!1),2),s=i[0],l=i[1],c=(0,g.useRef)(window.innerHeight),u=(0,g.useContext)(v.zq).featureName,d=(0,v.qv)();(0,g.useEffect)(function(){var e=function(){l(!(0,v.xl)(d)&&c.current>window.innerHeight),c.current!=window.innerHeight&&(c.current=window.innerHeight)};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[c]);var p="action-menu-".concat(r&&"default"!=r?r:u,"-items-slot");return A().createElement("aside",{className:b()(g0.sideRail,(g3(n={},g0.withinWorkspace,t),g3(n,g0.sideRailHidden,s),g3(n,g0.sideRailVisible,!s),n))},A().createElement("div",{className:g0.container},A().createElement(v.W3,{className:g0.chartExtensions,name:p,state:o})))}let g9=g7;function Ae(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function An(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){Ae(e,n,t[n])})}return e}function At(e){var n,t,r,a=e.contextKey,o=e.overlay,i=e.showSiderailAndBottomNav,s=e.additionalWorkspaceProps,l=e.actionMenuProps,c=(0,v.qv)(),u=m9(),d=u.workspaces,p=u.workspaceWindowState,f=u.workspaceGroup,h=null==f?void 0:f.name,m=d[0],y="hidden"===p||null==m,C="maximized"===p,$=null!=(n=null==m?void 0:m.width)?n:o?"wider":"narrow",w=(0,g.useMemo)(function(){return i||h&&!y},[h,y,i]);return(0,v.yJ)(!y&&!(0,v.xl)(c)),A().createElement(A().Fragment,null,A().createElement("div",{className:i?gN.workspaceContainerWithActionMenu:gN.workspaceContainerWithoutActionMenu},A().createElement("aside",{className:b()(o?gN.workspaceOverlayOuterContainer:gN.workspaceWindowSpacer,(Ae(t={},gN.hiddenRelative,y),Ae(t,gN.narrowWorkspace,"narrow"===$),Ae(t,gN.widerWorkspace,"wider"===$),Ae(t,gN.extraWideWorkspace,"extra-wide"===$),t))},A().createElement("div",{className:b()(gN.workspaceFixedContainer,(Ae(r={},gN.maximizedWindow,C),Ae(r,gN.hiddenFixed,y),r))},d.map(function(e,n){return A().createElement("div",{key:"workspace-container-".concat(e?e.name:"empty-".concat(n)),className:b()(gN.workspaceInnerContainer,Ae({},gN.hiddenExtraWorkspace,0!==n))},A().createElement(g.Suspense,{fallback:null},A().createElement(V.I18nextProvider,{i18n:window.i18next,defaultNS:e.moduleName},A().createElement(Ar,{workspaceInstance:e,additionalWorkspaceProps:s}))))}))),A().createElement(gv,{contextKey:a})),w&&A().createElement(g9,{name:h,isWithinWorkspace:!i,actionMenuProps:l}))}function Ar(e){var n,t=e.workspaceInstance,r=e.additionalWorkspaceProps,a=(0,V.useTranslation)().t,o=(0,v.qv)(),i=m9(),s=i.workspaceWindowState,l=i.workspaceGroup,c=null==l?void 0:l.name,u="maximized"===s;(0,g.useEffect)(function(){var e=a(t.title);e!==t.title&&t.setTitle(e)},[t.title,a,t.setTitle]);var d=(0,g.useContext)(v.zq).featureName,p=(0,g.useCallback)(function(){m6(u?"normal":"maximized")},[u]),f=(0,g.useMemo)(function(){return null!=t?t:{}},[t]),h=f.canHide,m=void 0!==h&&h,y=f.canMaximize,C=void 0!==y&&y,$=f.currentWorkspaceGroup,w=void 0===$?"":$,k=f.closeWorkspace,E=(0,g.useMemo)(function(){return An({},r,null==t?void 0:t.additionalProps)},[r,t]);return t&&A().createElement(A().Fragment,null,A().createElement(fN.Header,{"aria-label":(0,fI.V)("workspaceHeader","Workspace Header"),className:gN.header},!(0,v.xl)(o)&&!m&&A().createElement(fN.HeaderMenuButton,{"aria-label":(0,fI.V)("close","Close"),renderMenuIcon:A().createElement(cI,null),onClick:function(){return k()}}),A().createElement(fN.HeaderName,{prefix:""},null!=(n=t.titleNode)?n:a(t.title)),A().createElement("div",{className:gN.overlayHeaderSpacer}),A().createElement(fN.HeaderGlobalBar,{className:gN.headerButtons},A().createElement(v.W3,{name:"workspace-header-group-".concat(t.currentWorkspaceGroup,"-slot"),state:E}),A().createElement(v.W3,{name:"workspace-header-type-".concat(t.type,"-slot"),state:E}),A().createElement(v.W3,{name:"workspace-header-".concat(d,"-slot"),state:E}),(0,v.xl)(o)&&A().createElement(A().Fragment,null,(C||u)&&A().createElement(fN.HeaderGlobalAction,{"aria-label":u?(0,fI.V)("minimize","Minimize"):(0,fI.V)("maximize","Maximize"),onClick:p},u?A().createElement(gd,null):A().createElement(gp.hz,null)),m&&!c?A().createElement(fN.HeaderGlobalAction,{"aria-label":(0,fI.V)("hide","Hide"),onClick:function(){return m6("hidden")}},A().createElement(cF,null)):A().createElement(fN.HeaderGlobalAction,{"aria-label":(0,fI.V)("close","Close"),onClick:function(){return null==k?void 0:k()}},A().createElement(c1,null))),"tablet"===o&&m&&A().createElement(fN.HeaderGlobalAction,{"aria-label":(0,fI.V)("close","Close"),onClick:function(){return null==k?void 0:k()}},A().createElement(gf.d3,null)))),A().createElement("div",{className:b()(gN.workspaceContent,Ae({},gN.marginWorkspaceContent,!!w))},A().createElement(gJ,{key:t.name,workspace:t,additionalPropsFromPage:r})))}var Aa=t(19958),Ao={};Ao.styleTagTransform=T(),Ao.setAttributes=S(),Ao.insert=x().bind(null,"head"),Ao.domAPI=k(),Ao.insertStyleElement=B(),$()(Aa.A,Ao);let Ai=Aa.A&&Aa.A.locals?Aa.A.locals:void 0;function As(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function Al(e){if(Array.isArray(e))return e}function Ac(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Au(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function Ad(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ap(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){Ac(e,n,t[n])})}return e}function Af(e,n){if(null==e)return{};var t,r,a=A_(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function A_(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}function Ah(e,n){return Al(e)||Au(e,n)||Am(e,n)||Ad()}function Am(e,n){if(e){if("string"==typeof e)return As(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return As(e,n)}}var Ag=function(e){var n,t=e.snackbar,r=e.closeSnackbar,a=t.actionButtonLabel,o=void 0===a?"":a,i=t.kind,s=void 0===i?"success":i,l=t.onActionButtonClick,c=void 0===l?function(){}:l,u=t.isLowContrast,d=void 0===u?"error"!==s:u,p=t.progressActionLabel,f=t.subtitle,h=void 0===f?"":f,m=t.timeoutInMs,y=void 0===m?5e3:m,v=t.autoClose,C=void 0===v?"error"!==s:v,$=t.title,w=(t.id,Af(t,["actionButtonLabel","kind","onActionButtonClick","isLowContrast","progressActionLabel","subtitle","timeoutInMs","autoClose","title","id"])),k=Ah((0,g.useState)(o),2),E=k[0],x=k[1],D=Ah((0,g.useState)(!0),2),S=D[0],z=D[1],B=Ah((0,g.useState)(!1),2),M=B[0],T=B[1],O=(0,g.useCallback)(function(){setTimeout(r,250)},[r]),N=(0,g.useCallback)(function(){T(!0),O()},[O]),P=function(){c(),N(),p&&x(p)};return(0,g.useEffect)(function(){if(C){var e=setTimeout(N,y);return function(){return clearTimeout(e)}}},[y,C,N]),(0,g.useEffect)(function(){z(!1),window.setTimeout(function(){z(!0)},0)},[]),A().createElement(fN.ActionableNotification,Ap({actionButtonLabel:E,"aria-label":"Close snackbar",className:b()(Ai.slideIn,(Ac(n={},Ai.animated,S),Ac(n,Ai.slideOut,M),n)),inline:!0,kind:s,lowContrast:d,onActionButtonClick:P,onClose:O,statusIconDescription:"Snackbar notification",subtitle:h,title:$},w))};function AA(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function Ay(e){if(Array.isArray(e))return e}function Ab(e){if(Array.isArray(e))return AA(e)}function Av(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function AC(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function A$(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Aw(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ak(e,n){return Ay(e)||AC(e,n)||Ax(e,n)||A$()}function AE(e){return Ab(e)||Av(e)||Ax(e)||Aw()}function Ax(e,n){if(e){if("string"==typeof e)return AA(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return AA(e,n)}}let AD=function(e){var n=e.subject,t=Ak((0,g.useState)([]),2),r=t[0],a=t[1],o=(0,g.useCallback)(function(e){a(function(n){return n.filter(function(n){return n!==e})})},[]);return(0,g.useEffect)(function(){var e=n.subscribe(function(e){return a(function(n){return AE(n.filter(function(n){return n.subtitle!==e.subtitle||n.actionButtonLabel!==e.actionButtonLabel||n.onActionButtonClick!==e.onActionButtonClick||n.kind!==e.kind||n.title!==e.title})).concat([e])})});return function(){return e.unsubscribe()}},[n]),A().createElement(A().Fragment,null,r.map(function(e){return A().createElement(Ag,{key:e.id,snackbar:e,closeSnackbar:function(){return o(e)}})}))};function AS(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Az(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){AS(e,n,t[n])})}return e}function AB(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function AM(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}var AT=new fQ.B7,AO=0;function AN(e){e&&(0,_P.createRoot)(e).render(A().createElement(AD,{subject:AT}))}function AP(e){return"string"==typeof e&&e.trim().length>0}function AI(e){e&&AP(e.title)?setTimeout(function(){AT.next(AM(Az({},e),{id:AO++}))},0):console.error("showSnackbar must be called with an object having a 'title' property that is a non-empty string")}var AF=function(e){var n=e.children;return"tablet"===(0,v.qv)()?A().createElement(fN.Layer,null,n):A().createElement(A().Fragment,null,n)},AR=t(25391);let AH="react-avatar/",AL="failing",Aj=function(){try{return"localStorage"in window&&window.localStorage}catch(e){return!1}}();class Aq{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cachePrefix:n=AH,sourceTTL:t=6048e5,sourceSize:r=20}=e;this.cachePrefix=n,this.sourceTTL=t,this.sourceSize=r}set(e,n){if(Aj){n=JSON.stringify(n);try{localStorage.setItem(this.cachePrefix+e,n)}catch(e){console.error(e)}}}get(e){if(!Aj)return null;let n=localStorage.getItem(this.cachePrefix+e);return n?JSON.parse(n):null}sourceFailed(e){let n=this.get(AL)||[];return(n=n.filter(n=>{let t=n.expires>0&&n.expires<Date.now(),r=n===e||n.url==e;return!t&&!r})).unshift({url:e,expires:Date.now()+this.sourceTTL}),n=n.slice(0,this.sourceSize-1),this.set(AL,n)}hasSourceFailedBefore(e){return(this.get(AL)||[]).some(n=>{let t=n.expires>0&&n.expires<Date.now();return(n===e||n.url==e)&&!t})}}let AG=new Aq;var AV=t(93442),AU=t(39067),AW=t.n(AU),AK=t(18946);let AZ=t.n(AK)()(),AY=["#A62A21","#7e3794","#0B51C1","#3A6024","#A81563","#B3003C"],AJ=/^([-+]?(?:\d+(?:\.\d+)?|\.\d+))([a-z]{2,4}|%)?$/;function AX(e,n){let t=[...e].map(e=>e.charCodeAt(0)),r=t.length,a=r%(n-1)+1,o=t.reduce((e,n)=>e+n)%n,i=t[0]%n;for(let e=0;e<r;e++)i=(a*i+o)%n;return i}function AQ(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:AY;if(!e)return"transparent";let t=AX(e,n.length);return n[t]}function A0(e){e=""+e;let[,n=0,t="px"]=AJ.exec(e)||[];return{value:parseFloat(n),str:n+t,unit:t}}function A1(e){return e=isNaN((e=A0(e)).value)?512:"px"===e.unit?e.value:512*(0!==e.value),AZ&&(e*=2),e}function A2(e,n){let{maxInitials:t}=n;return e.split(/\s/).map(e=>e.substring(0,1).toUpperCase()).filter(e=>!!e).slice(0,t).join("").toUpperCase()}let A3={};function A4(e,n){if(A3[n])return void A3[n].push(e);let t=A3[n]=[e];setTimeout(()=>{delete A3[n],t.forEach(e=>e())},n)}function A5(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];for(let e of n){if(e||""===e)return e;if(!1===e||null===e)return null}}function A6(e){return!0===e?"100%":!1!==e?e:void 0}let A8={cache:AG,colors:AY,initials:A2,avatarRedirectUrl:null},A7=Object.keys(A8),A9=A().createContext&&A().createContext(),ye=!A9,yn=ye?null:A9.Consumer,yt=A().forwardRef||(e=>e);class yr extends A().Component{_getContext(){let e={};return A7.forEach(n=>{void 0!==this.props[n]&&(e[n]=this.props[n])}),e}render(){let{children:e}=this.props;return ye?A().Children.only(e):A().createElement(A9.Provider,{value:this._getContext()},A().Children.only(e))}}(0,AV.A)(yr,"displayName","ConfigProvider"),(0,AV.A)(yr,"propTypes",{cache:AW().object,colors:AW().arrayOf(AW().string),initials:AW().func,avatarRedirectUrl:AW().string,children:AW().node});let ya=e=>{function n(n,t){if(ye){let r=t&&t.reactAvatar;return A().createElement(e,(0,AR.A)({},A8,r,n))}return A().createElement(yn,null,r=>A().createElement(e,(0,AR.A)({ref:t},A8,r,n)))}return n.contextTypes=yr.childContextTypes,yt(n)};ye&&(yr.childContextTypes={reactAvatar:AW().object},yr.prototype.getChildContext=function(){return{reactAvatar:this._getContext()}});class yo{constructor(){this.sourcePointer=0,this.active=!0,this.fetch=null}isActive(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.internal===this&&!!this.fetch&&!0===this.active}}function yi(e,n,t){let{cache:r}=n,a=new e(n);if(!a.isCompatible(n))return t();a.get(e=>{!(e&&e.src&&r.hasSourceFailedBefore(e.src))&&e?t(e):t()})}function ys(e){let{sources:n=[]}=e,t=n.reduce((e,n)=>Object.assign(e,n.propTypes),{});class r extends g.PureComponent{constructor(e){super(e),(0,AV.A)(this,"_createFetcher",e=>t=>{let{cache:r}=this.props;if(!e.isActive(this.state))return;t&&"error"===t.type&&r.sourceFailed(t.target.src);let a=e.sourcePointer;if(n.length===a)return;let o=n[a];e.sourcePointer++,yi(o,this.props,n=>{if(!n)return setTimeout(e.fetch,0);e.isActive(this.state)&&(n={src:null,value:null,color:null,...n},this.setState(t=>e.isActive(t)?n:{}))})}),(0,AV.A)(this,"fetch",()=>{let e=new yo;e.fetch=this._createFetcher(e),this.setState({internal:e},e.fetch)}),this.state={internal:null,src:null,value:null,color:e.color}}componentDidMount(){this.fetch()}componentDidUpdate(e){let n=!1;for(let r in t)n=n||e[r]!==this.props[r];n&&setTimeout(this.fetch,0)}componentWillUnmount(){this.state.internal&&(this.state.internal.active=!1)}render(){let{children:e,propertyName:n}=this.props,{src:t,value:r,color:a,sourceName:o,internal:i}=this.state,s={src:t,value:r,color:a,sourceName:o,onRenderFailed:()=>i&&i.fetch()};if("function"==typeof e)return e(s);let l=A().Children.only(e);return A().cloneElement(l,{[n]:s})}}return(0,AV.A)(r,"displayName","AvatarDataProvider"),(0,AV.A)(r,"propTypes",{...t,cache:AW().object,propertyName:AW().string}),(0,AV.A)(r,"defaultProps",{propertyName:"avatar"}),(0,AV.A)(r,"Cache",Aq),(0,AV.A)(r,"ConfigProvider",yr),Object.assign(ya(r),{ConfigProvider:yr,Cache:Aq})}class yl extends A().PureComponent{render(){let{className:e,unstyled:n,round:t,style:r,avatar:a,onClick:o,children:i}=this.props,{sourceName:s}=a,l=A0(this.props.size),c=n?null:{display:"inline-block",verticalAlign:"middle",width:l.str,height:l.str,borderRadius:A6(t),fontFamily:"Helvetica, Arial, sans-serif",...r},u=[e,"sb-avatar"];if(s){let e=s.toLowerCase().replace(/[^a-z0-9-]+/g,"-").replace(/^-+|-+$/g,"");u.push("sb-avatar--"+e)}return A().createElement("div",{className:u.join(" "),onClick:o,style:c},i)}}(0,AV.A)(yl,"propTypes",{className:AW().string,round:AW().oneOfType([AW().bool,AW().string]),style:AW().object,size:AW().oneOfType([AW().number,AW().string]),unstyled:AW().bool,avatar:AW().object,onClick:AW().func,children:AW().node});class yc extends A().PureComponent{render(){let{className:e,round:n,unstyled:t,alt:r,title:a,name:o,value:i,avatar:s}=this.props,l=A0(this.props.size),c=t?null:{maxWidth:"100%",width:l.str,height:l.str,borderRadius:A6(n)};return A().createElement(yl,this.props,A().createElement("img",{className:e+" sb-avatar__image",width:l.str,height:l.str,style:c,src:s.src,alt:A5(r,o||i),title:A5(a,o||i),onError:s.onRenderFailed}))}}(0,AV.A)(yc,"propTypes",{alt:AW().oneOfType([AW().string,AW().bool]),title:AW().oneOfType([AW().string,AW().bool]),name:AW().string,value:AW().string,avatar:AW().object,className:AW().string,unstyled:AW().bool,round:AW().oneOfType([AW().bool,AW().string,AW().number]),size:AW().oneOfType([AW().number,AW().string])}),(0,AV.A)(yc,"defaultProps",{className:"",round:!1,size:100,unstyled:!1});class yu extends A().PureComponent{constructor(){var e;super(...arguments),e=this,(0,AV.A)(this,"_scaleTextNode",function(n){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,{unstyled:r,textSizeRatio:a,textMarginRatio:o,avatar:i}=e.props;if(e._node=n,!n||!n.parentNode||r||i.src||!e._mounted)return;let s=n.parentNode,l=s.parentNode,{width:c,height:u}=s.getBoundingClientRect();if(0==c&&0==u){let r=Math.min(1.5*t,500);A4(()=>e._scaleTextNode(n,r),r);return}if(!l.style.fontSize){let e=u/a;l.style.fontSize="".concat(e,"px")}s.style.fontSize=null;let{width:d}=n.getBoundingClientRect();if(d<0)return;let p=c*(1-2*o);d>p&&(s.style.fontSize="calc(1em * ".concat(p/d,")"))})}componentDidMount(){this._mounted=!0,this._scaleTextNode(this._node)}componentWillUnmount(){this._mounted=!1}render(){let{className:e,round:n,unstyled:t,title:r,name:a,value:o,avatar:i}=this.props,s=A0(this.props.size),l=t?null:{width:s.str,height:s.str,lineHeight:"initial",textAlign:"center",color:this.props.fgColor,background:i.color,borderRadius:A6(n)},c=t?null:{display:"table",tableLayout:"fixed",width:"100%",height:"100%"},u=t?null:{display:"table-cell",verticalAlign:"middle",fontSize:"100%",whiteSpace:"nowrap"},d=[i.value,this.props.size].join("");return A().createElement(yl,this.props,A().createElement("div",{className:e+" sb-avatar__text",style:l,title:A5(r,a||o)},A().createElement("div",{style:c},A().createElement("span",{style:u},A().createElement("span",{ref:this._scaleTextNode,key:d},i.value)))))}}function yd(e){let n=ys(e);return Object.assign(ya(A().forwardRef((e,t)=>A().createElement(n,(0,AR.A)({},e,{propertyName:"avatar"}),n=>{let r=n.src?yc:yu;return A().createElement(r,(0,AR.A)({},e,{avatar:n,ref:t}))}))),{getRandomColor:AQ,ConfigProvider:yr,Cache:Aq})}(0,AV.A)(yu,"propTypes",{name:AW().string,value:AW().string,avatar:AW().object,title:AW().oneOfType([AW().string,AW().bool]),className:AW().string,unstyled:AW().bool,fgColor:AW().string,textSizeRatio:AW().number,textMarginRatio:AW().number,round:AW().oneOfType([AW().bool,AW().string,AW().number]),size:AW().oneOfType([AW().number,AW().string])}),(0,AV.A)(yu,"defaultProps",{className:"",fgColor:"#FFF",round:!1,size:100,textSizeRatio:3,textMarginRatio:.15,unstyled:!1});var yp=t(89150),yf=t.n(yp);class y_{constructor(e){(0,AV.A)(this,"props",null),(0,AV.A)(this,"isCompatible",()=>!!this.props.email||!!this.props.md5Email),(0,AV.A)(this,"get",e=>{let{props:n}=this,t=n.md5Email||yf()(n.email),r=A1(n.size),a="https://secure.gravatar.com/avatar/".concat(t,"?d=404");r&&(a+="&s=".concat(r)),e({sourceName:"gravatar",src:a})}),this.props=e}}(0,AV.A)(y_,"propTypes",{email:AW().string,md5Email:AW().string});class yh{constructor(e){(0,AV.A)(this,"props",null),(0,AV.A)(this,"isCompatible",()=>!!this.props.facebookId),(0,AV.A)(this,"get",e=>{let{facebookId:n}=this.props,t=A1(this.props.size),r="https://graph.facebook.com/".concat(n,"/picture");t&&(r+="?width=".concat(t,"&height=").concat(t)),e({sourceName:"facebook",src:r})}),this.props=e}}(0,AV.A)(yh,"propTypes",{facebookId:AW().string});class ym{constructor(e){(0,AV.A)(this,"props",null),(0,AV.A)(this,"isCompatible",()=>!!this.props.githubHandle),(0,AV.A)(this,"get",e=>{let{githubHandle:n}=this.props,t=A1(this.props.size),r="https://avatars.githubusercontent.com/".concat(n,"?v=4");t&&(r+="&s=".concat(t)),e({sourceName:"github",src:r})}),this.props=e}}(0,AV.A)(ym,"propTypes",{githubHandle:AW().string});class yg{constructor(e){(0,AV.A)(this,"props",null),(0,AV.A)(this,"isCompatible",()=>!!this.props.skypeId),(0,AV.A)(this,"get",e=>{let{skypeId:n}=this.props;e({sourceName:"skype",src:"https://api.skype.com/users/".concat(n,"/profile/avatar")})}),this.props=e}}(0,AV.A)(yg,"propTypes",{skypeId:AW().string});class yA{constructor(e){(0,AV.A)(this,"props",null),(0,AV.A)(this,"isCompatible",()=>!!(this.props.name||this.props.value||this.props.email)),(0,AV.A)(this,"get",e=>{let n=this.getValue();if(!n)return e(null);e({sourceName:"text",value:n,color:this.getColor()})}),this.props=e}getInitials(){let{name:e,initials:n}=this.props;return"string"==typeof n?n:"function"==typeof n?n(e,this.props):A2(e,this.props)}getValue(){return this.props.name?this.getInitials():this.props.value?this.props.value:null}getColor(){let{color:e,colors:n,name:t,email:r,value:a}=this.props,o=t||r||a;return e||AQ(o,n)}}(0,AV.A)(yA,"propTypes",{color:AW().string,name:AW().string,value:AW().string,email:AW().string,maxInitials:AW().number,initials:AW().oneOfType([AW().string,AW().func])});class yy{constructor(e){(0,AV.A)(this,"props",null),(0,AV.A)(this,"isCompatible",()=>!!this.props.src),(0,AV.A)(this,"get",e=>{e({sourceName:"src",src:this.props.src})}),this.props=e}}(0,AV.A)(yy,"propTypes",{src:AW().string});class yb{constructor(e){(0,AV.A)(this,"props",null),(0,AV.A)(this,"icon","✷"),(0,AV.A)(this,"isCompatible",()=>!0),(0,AV.A)(this,"get",e=>{let{color:n,colors:t}=this.props;e({sourceName:"icon",value:this.icon,color:n||AQ(this.icon,t)})}),this.props=e}}function yv(e,n){var t;return t=class{constructor(t){(0,AV.A)(this,"props",null),(0,AV.A)(this,"isCompatible",()=>!!this.props.avatarRedirectUrl&&!!this.props[n]),(0,AV.A)(this,"get",t=>{let{avatarRedirectUrl:r}=this.props,a=A1(this.props.size),o=r.replace(/\/*$/,"/"),i=this.props[n],s=a?"size=".concat(a):"",l="".concat(o).concat(e,"/").concat(i,"?").concat(s);t({sourceName:e,src:l})}),this.props=t}},(0,AV.A)(t,"propTypes",{[n]:AW().oneOfType([AW().string,AW().number])}),t}(0,AV.A)(yb,"propTypes",{color:AW().string});let yC=yv("twitter","twitterHandle"),y$=yv("vkontakte","vkontakteId"),yw=yv("instagram","instagramId"),yk=yd({sources:[yh,yv("google","googleId"),ym,yC,yw,y$,yg,y_,yy,yA,yb]});var yE=t(35570),yx=t.n(yE),yD=t(13624);function yS(e){var n,t,r,a=(0,v.UK)({externalModuleName:"@openmrs/esm-styleguide"}).patientPhotoConceptUuid,o=a?"".concat(fX.Jj,"/obs?patient=").concat(e,"&concept=").concat(a,"&v=full"):null,i=(0,yD.Ay)(e?o:null,fX.lo),s=i.data,l=i.error,c=i.isLoading,u=null==s||null==(n=s.data)?void 0:n.results[0];return{data:u?{dateTime:null==u?void 0:u.obsDatetime,imageSrc:null==u||null==(r=u.value)||null==(t=r.links)?void 0:t.uri}:null,error:l,isLoading:c}}let yz=function(e){var n=e.width,t=void 0===n?56:n,r=e.height,a=void 0===r?56:r,o=(0,V.useTranslation)().t;return A().createElement("svg",{"aria-label":o("patientPhotoPlaceholder","Patient photo placeholder"),width:t,height:a,fill:"none",xmlns:"http://www.w3.org/2000/svg"},A().createElement("path",{fill:"#ffffff",d:"M0 0h56v56H0z"}),A().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m36.75 20.134-.884-.884L19.25 35.866l.884.884 1.25-1.25H34.25a1.252 1.252 0 0 0 1.25-1.25V21.384l1.25-1.25Zm-2.5 14.116H22.634l4.87-4.87 1.487 1.486a1.25 1.25 0 0 0 1.768 0l.991-.991 2.5 2.498v1.877Zm0-3.645-1.616-1.616a1.25 1.25 0 0 0-1.768 0l-.991.991-1.486-1.486 5.861-5.86v7.971Zm-12.5 1.145v-1.875l3.125-3.123.858.859.885-.885-.86-.86a1.25 1.25 0 0 0-1.767 0l-2.241 2.242V21.75h10V20.5h-10c-.69 0-1.25.56-1.25 1.25v10h1.25Z",fill:"#8D8D8D"}))};var yB=t(27069),yM={};yM.styleTagTransform=T(),yM.setAttributes=S(),yM.insert=x().bind(null,"head"),yM.domAPI=k(),yM.insertStyleElement=B(),$()(yB.A,yM);let yT=yB.A&&yB.A.locals?yB.A.locals:void 0;function yO(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function yN(e){if(Array.isArray(e))return e}function yP(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function yI(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function yF(e,n){return yN(e)||yP(e,n)||yR(e,n)||yI()}function yR(e,n){if(e){if("string"==typeof e)return yO(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return yO(e,n)}}function yH(e){var n=e.patientUuid,t=e.patientName,r=(0,V.useTranslation)().t,a=yS(n),o=a.data,i=a.isLoading,s=yF((0,g.useState)(null),2),l=s[0],c=s[1],u=(0,g.useMemo)(function(){return yx().generate(n)},[n]);(0,g.useEffect)(function(){if(null==o?void 0:o.imageSrc){var e=new Image;e.onload=function(){return c(o.imageSrc)},e.onerror=function(){return c(null)},e.src=o.imageSrc}},[null==o?void 0:o.imageSrc]);var d=r("avatarAltText","Profile photo unavailable - grey placeholder image");return i?A().createElement(fN.SkeletonIcon,{className:yT.skeleton,"data-testid":"skeleton-icon"}):(null==o?void 0:o.imageSrc)&&!l?A().createElement(yz,null):A().createElement(yk,{alt:d,color:"rgba(0,0,0,0)",maxInitials:3,name:t,size:"56",src:null!=l?l:void 0,style:l?void 0:{backgroundImage:u.toDataUrl(),backgroundRepeat:"round"},textSizeRatio:2})}var yL=t(6293),yj={};yj.styleTagTransform=T(),yj.setAttributes=S(),yj.insert=x().bind(null,"head"),yj.domAPI=k(),yj.insertStyleElement=B(),$()(yL.A,yj);let yq=yL.A&&yL.A.locals?yL.A.locals:void 0;function yG(e,n){if(null==e)return{};var t,r,a=yV(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function yV(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}var yU=["omrs-pict-appointments","omrs-pict-assessment-1","omrs-pict-assessment-2","omrs-pict-blood-bank","omrs-pict-cardiology","omrs-pict-ct-scan","omrs-pict-dentistry","omrs-pict-emergency-department","omrs-pict-facility","omrs-pict-geriatrics","omrs-pict-gynaecology","omrs-pict-in-patient","omrs-pict-laboratory","omrs-pict-labs-2","omrs-pict-obstetrics","omrs-pict-patient-search","omrs-pict-patients","omrs-pict-payments-desk","omrs-pict-pharmacy","omrs-pict-pharmacy-2","omrs-pict-registration","omrs-pict-service-queues","omrs-pict-stock-management","omrs-pict-transfer","omrs-pict-triage","omrs-pict-x-ray"],yW=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-appointments",pictogramProps:e})})),yK=yW,yZ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-assessment-1",pictogramProps:e})})),yY=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-assessment-2",pictogramProps:e})})),yJ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-blood-bank",pictogramProps:e})})),yX=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-cardiology",pictogramProps:e})})),yQ=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-ct-scan",pictogramProps:e})})),y0=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-dentistry",pictogramProps:e})})),y1=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-emergency-department",pictogramProps:e})})),y2=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-facility",pictogramProps:e})})),y3=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-geriatrics",pictogramProps:e})})),y4=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-gynaecology",pictogramProps:e})})),y5=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-in-patient",pictogramProps:e})})),y6=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-laboratory",pictogramProps:e})})),y8=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-labs-2",pictogramProps:e})})),y7=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-obstetrics",pictogramProps:e})})),y9=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-patient-search",pictogramProps:e})})),be=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-patients",pictogramProps:e})})),bn=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-payments-desk",pictogramProps:e})})),bt=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-pharmacy",pictogramProps:e})})),br=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-pharmacy-2",pictogramProps:e})})),ba=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-registration",pictogramProps:e})})),bo=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-service-queues",pictogramProps:e})})),bi=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-stock-management",pictogramProps:e})})),bs=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-transfer",pictogramProps:e})})),bl=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-triage",pictogramProps:e})})),bc=(0,g.memo)((0,g.forwardRef)(function(e,n){return A().createElement(bf,{ref:n,pictogram:"omrs-pict-x-ray",pictogramProps:e})})),bu=y2,bd=be,bp=(0,g.memo)((0,g.forwardRef)(function(e,n){var t=e.pictogram,r=e.fallback,a=yG(e,["pictogram","fallback"]),o=(0,g.useRef)(document.getElementById(t));return(0,g.useEffect)(function(){var e=document.getElementById("omrs-svgs-container"),n=new MutationObserver(function(e){var n=!0,r=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var l=i.value;"childList"===l.type&&(o.current=document.getElementById(t))}}catch(e){r=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw a}}});return e&&n.observe(e,{childList:!0}),function(){return n.disconnect()}},[t]),A().createElement(v.fS,{value:o.current,fallback:r},A().createElement(bf,{ref:n,pictogram:t,pictogramProps:a}))})),bf=(0,g.memo)((0,g.forwardRef)(function(e,n){var t=e.pictogram,r=Object.assign({},{size:92},e.pictogramProps),a=r.className,o=r.size;return(o<=26||o>144)&&(console.error("Invalid size '".concat(o,"' specified for ").concat(t,". Defaulting to 92.")),o=92),A().createElement("svg",{ref:n,className:b()(yq.pictogram,a),height:o,width:o},A().createElement("use",{href:"#".concat(t)}))})),b_=t(98872),bh={};bh.styleTagTransform=T(),bh.setAttributes=S(),bh.insert=x().bind(null,"head"),bh.domAPI=k(),bh.insertStyleElement=B(),$()(b_.A,bh);let bm=b_.A&&b_.A.locals?b_.A.locals:void 0;var bg=t(99780);function bA(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function by(e){if(Array.isArray(e))return bA(e)}function bb(e,n,t,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){t(e);return}s.done?n(l):Promise.resolve(l).then(r,a)}function bv(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function i(e){bb(o,r,a,i,s,"next",e)}function s(e){bb(o,r,a,i,s,"throw",e)}i(void 0)})}}function bC(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function b$(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function bw(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function bk(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){bC(e,n,t[n])})}return e}function bE(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function bx(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function bD(e){return by(e)||b$(e)||bS(e)||bw()}function bS(e,n){if(e){if("string"==typeof e)return bA(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return bA(e,n)}}function bz(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(n){return l([e,n])}}function l(s){if(t)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],r=0}finally{t=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function bB(e,n){return bv(function(){var t;return bz(this,function(r){switch(r.label){case 0:if(!(t=hs.J_.getState().openedGroup))return[3,3];if(!(t.groupName!==e||!bO(t.props,n)))return[3,2];return[4,bN({reason:"CLOSE_WORKSPACE_GROUP",explicit:!1})];case 1:if(!r.sent())return[2,!1];return[3,3];case 2:return[2,!0];case 3:return hs.J_.setState(function(t){return bx(bk({},t),{openedGroup:{groupName:e,props:n},openedWindows:[]})}),[2,!0]}})})()}function bM(e){return bv(function(){var n,t,r,a;return bz(this,function(o){switch(o.label){case 0:if(t=(n=hs.J_.getState()).openedGroup,r=n.openedWindows,!t)return[3,4];if(!(r.length>0))return[3,3];if(a=e)return[3,2];return[4,bN({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})];case 1:a=o.sent(),o.label=2;case 2:if(!a)return[2,!1];o.label=3;case 3:return hs.J_.setState(function(e){return bx(bk({},e),{openedGroup:null,openedWindows:[]})}),[2,!0];case 4:return[2,!0]}})})()}function bT(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return bv(function(){var a,o,i,s,l,c,u,d,p,f,h,m,g,A,y,b,v,C,$;return bz(this,function(w){switch(w.label){case 0:if(!(a=hs.J_.getState()).registeredWorkspacesByName[e])throw Error("Unable to launch workspace ".concat(e,". Workspace is not registered"));if(!(o=(0,hs.Ml)(e)))throw Error("Unable to launch workspace ".concat(e,". Workspace is not registered to a workspace window"));if(i=a.openedGroup,s=o.name,!(l=(0,hs.o1)(s)))throw Error("Unable to launch workspace ".concat(e,". Workspace window ").concat(o.name," is not registered to a workspace group"));if(u=(c=(0,hs.YX)(e))>=0,!(i&&(i.groupName!==l.name||!bO(i.props,r))))return[3,2];return[4,bN({reason:"CLOSE_WORKSPACE_GROUP",explicit:!1})];case 1:if(w.sent())return hs.J_.setState(bx(bk({},a),{openedGroup:{groupName:l.name,props:r},openedWindows:[{windowName:s,openedWorkspaces:[bF(e,n)],props:t,maximized:!1,hidden:!1}]})),[2,!0];return[2,!1];case 2:if(!u)return[3,9];if(p=a.openedWindows[c],h=null!=(f=null==(d=a.openedGroup)?void 0:d.props)?f:{},m=p.openedWorkspaces,!bO(p.props,t))return[3,6];if(!((g=m.find(function(n){return n.workspaceName===e}))&&bO(g.props,n)))return[3,3];return(p.hidden||c!==a.openedWindows.length-1)&&hs.J_.setState(bP.restoreWindow(a,s)),[2,!0];case 3:return[4,bN({reason:"CLOSE_WORKSPACE",explicit:!1,windowName:s,workspaceName:e})];case 4:if(w.sent())return hs.J_.setState(bx(bk({},a),{openedGroup:{groupName:l.name,props:null!=(y=null==a||null==(A=a.openedGroup)?void 0:A.props)?y:h},openedWindows:bD(a.openedWindows.filter(function(e,n){return n!==c})).concat([{windowName:s,openedWorkspaces:[bF(e,n)],props:null!=(b=null==p?void 0:p.props)?b:t,maximized:!1,hidden:!1}])})),[2,!0];return[2,!1];case 5:return[3,8];case 6:return[4,bN({reason:"CLOSE_WINDOW",explicit:!1,windowName:s})];case 7:if(w.sent())return hs.J_.setState(bx(bk({},a),{openedGroup:{groupName:l.name,props:null!=h?h:null==a||null==(v=a.openedGroup)?void 0:v.props},openedWindows:bD(a.openedWindows.filter(function(e,n){return n!==c})).concat([{windowName:s,openedWorkspaces:[bF(e,n)],props:t,maximized:!1,hidden:!1}])})),[2,!0];return[2,!1];case 8:return[3,10];case 9:return hs.J_.setState(bx(bk({},a),{openedGroup:{groupName:l.name,props:null!=($=null!=r?r:null==a||null==(C=a.openedGroup)?void 0:C.props)?$:null},openedWindows:bD(a.openedWindows).concat([{windowName:s,openedWorkspaces:[bF(e,n)],props:t,maximized:!1,hidden:!1}])})),[2,!0];case 10:return[2]}})})()}function bO(e,n){return null==e||null==n||(0,W.b)(e,n)}function bN(e){function n(n,t){for(var r=[],a=n.openedWorkspaces.length-1;a>=0;a--){var o=n.openedWorkspaces[a];if((o.hasUnsavedChanges||!e.explicit)&&r.push(o),t&&o.workspaceName===t)break}return r}var t=hs.J_.getState(),r=t.openedWindows,a=t.workspaceTitleByWorkspaceName,o=[];switch(e.reason){case"CLOSE_WORKSPACE_GROUP":o=r.flatMap(function(e){return n(e)});break;case"CLOSE_WINDOW":var i=r.find(function(n){return n.windowName===e.windowName});if(!i)throw Error("Window ".concat(e.windowName," not found in opened windows."));o=n(i);break;case"CLOSE_WORKSPACE":var s=r.find(function(n){return n.windowName===e.windowName});if(!s)throw Error("Window ".concat(e.windowName," not found in opened windows."));o=n(s,e.workspaceName)}return 0===o.length?Promise.resolve(!0):new Promise(function(e){var n=hI("workspace2-close-prompt",{onConfirm:function(){n(),e(!0)},onCancel:function(){n(),e(!1)},affectedWorkspaceTitles:o.map(function(e){return a[e.workspaceName]})})})}var bP={setWindowMaximized:function(e,n,t){var r=e.openedWindows.findIndex(function(e){return e.windowName===n}),a=bD(e.openedWindows),o=bx(bk({},a[r]),{maximized:t});return a[r]=o,bx(bk({},e),{openedWindows:a})},hideWindow:function(e,n){var t=e.openedWindows.findIndex(function(e){return e.windowName===n}),r=bD(e.openedWindows),a=bx(bk({},r[t]),{hidden:!0});return r[t]=a,bx(bk({},e),{openedWindows:r})},restoreWindow:function(e,n){var t=e.openedWindows.findIndex(function(e){return e.windowName===n}),r=bx(bk({},e.openedWindows[t]),{hidden:!1}),a=bD(e.openedWindows.filter(function(e,n){return n!==t})).concat([r]);return bx(bk({},e),{openedWindows:a})},closeWorkspace:function(e,n){var t=(0,hs.YX)(n);if(t<0)return e;var r=bk({},e.openedWindows[t]),a=r.openedWorkspaces.findIndex(function(e){return e.workspaceName===n}),o=bD(e.openedWindows);return r.openedWorkspaces=r.openedWorkspaces.slice(0,a),0===r.openedWorkspaces.length?o.splice(t,1):o[t]=r,bx(bk({},e),{openedWindows:o})},openChildWorkspace:function(e,n,t,r){var a=e.registeredWorkspacesByName[t];if(!a)throw Error('No workspace named "'.concat(t,'" registered'));var o=e.registeredWorkspacesByName[n];if(!o)throw Error('No workspace named "'.concat(n,'" registered'));if(o.window!==a.window)throw Error("Child workspace ".concat(t," does not belong to the same workspace window as parent workspace ").concat(n));var i=e.openedWindows.findIndex(function(e){return e.windowName===a.window});if(-1==i)throw Error("Cannot open child workspace ".concat(t," as window ").concat(a.window," is not opened"));var s=e.openedWindows[i].openedWorkspaces;if(s[s.length-1].workspaceName!==n)throw Error("Cannot open child workspace ".concat(t," from parent workspace ").concat(n," as the parent is not the most recently opened workspace within the workspace window"));return{openedWindows:e.openedWindows.map(function(e,n){return n==i?bx(bk({},e),{openedWorkspaces:bD(e.openedWorkspaces).concat([bF(t,r)])}):e})}},setHasUnsavedChanges:function(e,n,t){var r=(0,hs.YX)(n);if(r<0)return e;var a=bk({},e.openedWindows[r]),o=a.openedWorkspaces.findIndex(function(e){return e.workspaceName===n});if(o<0)return e;a.openedWorkspaces[o]=bx(bk({},a.openedWorkspaces[o]),{hasUnsavedChanges:t});var i=bD(e.openedWindows);return i[r]=a,bx(bk({},e),{openedWindows:i})},setWorkspaceTitle:function(e,n,t){var r=bk({},e.workspaceTitleByWorkspaceName);return null===t?delete r[n]:r[n]=t,bx(bk({},e),{workspaceTitleByWorkspaceName:r})}};function bI(){return(0,v.mQ)(hs.J_,bP)}function bF(e,n){return{workspaceName:e,props:null!=n?n:{},hasUnsavedChanges:!1,uuid:(0,bg.A)()}}function bR(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var bH=function(e){var n,t,r,a,o=e.title,i=e.children,s=e.hasUnsavedChanges,l=(0,v.qv)(),c=bI(),u=c.setWindowMaximized,d=c.hideWindow,p=c.closeWorkspace,f=c.setHasUnsavedChanges,h=c.openedWindows,m=c.openedGroup,y=c.registeredGroupsByName,C=c.registeredWindowsByName,$=c.registeredWorkspacesByName,w=c.workspaceTitleByWorkspaceName,k=c.setWorkspaceTitle,E=(0,g.useContext)(gC.i),x=E.workspaceName,D=E.isRootWorkspace,S=E.isLeafWorkspace,z=(0,hs.YX)(x),B=h[z],M=null==B?void 0:B.openedWorkspaces.find(function(e){return e.workspaceName===x});if((0,g.useEffect)(function(){(null==M?void 0:M.hasUnsavedChanges)!=s&&f(x,null!=s&&s)},[M,s]),(0,g.useEffect)(function(){w[x]!==o&&k(x,o)},[M,o]),z<0||null==m||null==M)return null;if(!y[m.groupName])throw Error("Cannot find registered workspace group ".concat(m.groupName));var T=$[x].window,O=C[T];if(!O)throw Error("Cannot find registered workspace window ".concat(T));var N=O.canHide,P=O.canMaximize,I=B.maximized,F=null!=(n=null==O?void 0:O.width)?n:"narrow";return A().createElement("div",{className:b()(bm.workspaceOuterContainer,(bR(t={},bm.narrowWorkspace,"narrow"===F),bR(t,bm.widerWorkspace,"wider"===F),bR(t,bm.extraWideWorkspace,"extra-wide"===F),t))},A().createElement("div",{className:b()(bm.workspaceSpacer,bR({},bm.hidden,B.hidden))}),A().createElement("div",{className:b()(bm.workspaceMiddleContainer,(bR(r={},bm.maximized,I),bR(r,bm.hidden,B.hidden),r))},A().createElement("div",{className:b()(bm.workspaceInnerContainer,(bR(a={},bm.maximized,I),bR(a,bm.hidden,B.hidden),bR(a,bm.isRootWorkspace,D),a))},S&&A().createElement(A().Fragment,null,A().createElement(fN.Header,{"aria-label":(0,fI.V)("workspaceHeader"),className:bm.header},!(0,v.xl)(l)&&!N&&A().createElement(fN.HeaderMenuButton,{"aria-label":(0,fI.V)("close"),renderMenuIcon:A().createElement(cI,null),onClick:function(){return p(x)}}),A().createElement(fN.HeaderName,{prefix:""},o),A().createElement("div",{className:bm.overlayHeaderSpacer}),A().createElement(fN.HeaderGlobalBar,{className:bm.headerButtons},(0,v.xl)(l)&&A().createElement(A().Fragment,null,(P||I)&&A().createElement(fN.HeaderGlobalAction,{"aria-label":I?(0,fI.V)("minimize"):(0,fI.V)("maximize"),onClick:function(){return u(T,!I)}},I?A().createElement(gd,null):A().createElement(gp.hz,null)),N?A().createElement(fN.HeaderGlobalAction,{"aria-label":(0,fI.V)("hide"),onClick:function(){return d(T)}},A().createElement(cF,null)):A().createElement(fN.HeaderGlobalAction,{"aria-label":(0,fI.V)("close"),onClick:function(){return p(x)}},A().createElement(c1,null))),"tablet"===l&&N&&A().createElement(fN.HeaderGlobalAction,{"aria-label":(0,fI.V)("close"),onClick:function(){return p(x)}},A().createElement(gf.d3,null)))),A().createElement("div",{className:b()(bm.workspaceContent)},i)))))},bL=t(64429),bj={};bj.styleTagTransform=T(),bj.setAttributes=S(),bj.insert=x().bind(null,"head"),bj.domAPI=k(),bj.insertStyleElement=B(),$()(bL.A,bj);let bq=bL.A&&bL.A.locals?bL.A.locals:void 0;function bG(e,n,t,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){t(e);return}s.done?n(l):Promise.resolve(l).then(r,a)}function bV(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function i(e){bG(o,r,a,i,s,"next",e)}function s(e){bG(o,r,a,i,s,"throw",e)}i(void 0)})}}function bU(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function bW(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(n){return l([e,n])}}function l(s){if(t)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],r=0}finally{t=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function bK(e){var n=e.getIcon,t=e.isWindowHidden,r=e.tagContent;return A().createElement(A().Fragment,null,n({size:16}),t?A().createElement("span",{className:bq.interruptedTag},"!"):A().createElement("span",{className:bq.countTag},r))}var bZ=function(e){var n,t,r=e.icon,a=e.label,o=e.tagContent,i=e.workspaceToLaunch,s=e.onBeforeWorkspaceLaunch,l=(0,v.qv)(),c=bI(),u=c.openedWindows,d=c.restoreWindow,p=(0,g.useContext)(gC.i).windowName,f=u.find(function(e){return e.windowName===p}),h=null!=f,m=null!=(n=null==f?void 0:f.hidden)&&n,y=bY(u,f),C=function(){return bV(function(){var e,n;return bW(this,function(t){switch(t.label){case 0:if(!h)return[3,1];return y||d(f.windowName),[3,3];case 1:return[4,null==(e=null==s?void 0:s())||e];case 2:t.sent()&&(n=i.workspaceName,bT(n,i.workspaceProps,i.windowProps)),t.label=3;case 3:return[2]}})})()};return"tablet"===l||"phone"===l?A().createElement(fN.Button,{className:b()(bq.container,bU({},bq.active,h)),iconDescription:a,kind:"ghost",onClick:C,role:"button",tabIndex:0,size:"md"},A().createElement("span",{className:bq.elementContainer},A().createElement(bK,{isWindowHidden:m,getIcon:r,tagContent:o})),A().createElement("span",null,a)):A().createElement(fN.IconButton,{align:"left","aria-label":a,className:b()(bq.container,(bU(t={},bq.active,h),bU(t,bq.focused,y),t)),enterDelayMs:300,kind:"ghost",label:a,onClick:C,size:"md"},A().createElement("div",{className:bq.elementContainer},A().createElement(bK,{isWindowHidden:m,getIcon:r,tagContent:o})))};function bY(e,n){for(var t=e.length-1;t>=0;t--){var r=e[t];if(!r.hidden)return r.windowName===(null==n?void 0:n.windowName)}return!1}function bJ(e){var n=e.showContactDetails,t=e.toggleContactDetails,r=e.className;return A().createElement(fN.Button,{className:r,iconDescription:"Toggle contact details",kind:"ghost",onClick:t,renderIcon:n?c0:cJ},n?(0,fI.V)("showLess","Show less"):(0,fI.V)("showMore","Show more"))}var bX="custom:(uuid,display,identifiers:(identifier,uuid,preferred,location:(uuid,name),identifierType:(uuid,name,format,formatDescription,validator)),person:(uuid,display,gender,birthdate,dead,age,deathDate,birthdateEstimated,causeOfDeath,preferredName:(uuid,preferred,givenName,middleName,familyName),attributes,preferredAddress:(uuid,preferred,address1,address2,cityVillage,longitude,stateProvince,latitude,country,postalCode,countyDistrict,address3,address4,address5,address6,address7)))",bQ=function(e){var n,t=fZ()("".concat(fX.Jj,"/patient/").concat(e,"?v=").concat(bX),fX.lo),r=t.data,a=t.error;return{isLoading:t.isLoading,attributes:null!=(n=null==r?void 0:r.data.person.attributes)?n:[],error:a}},b0=function(e){var n=(0,v.UK)({externalModuleName:"@openmrs/esm-patient-banner-app"}).contactAttributeTypes,t=void 0===n?[]:n,r=bQ(e),a=r.attributes,o=r.error,i=r.isLoading;return{contactAttributes:(0,g.useMemo)(function(){return a.filter(function(e){var n=e.attributeType;return null==t?void 0:t.some(function(e){return n.uuid===e})})},[a,t]),isLoading:i,error:o}};function b1(e){var n,t="custom:(uuid,patient:ref,cohort:(uuid,name,startDate,endDate))",r=e?"".concat(fX.Jj,"/cohortm/cohortmember?patient=").concat(e,"&v=").concat(t):null,a=(0,yD.Ay)(r,fX.lo),o=a.data,i=a.isLoading,s=null==o||null==(n=o.data)?void 0:n.results.map(function(e){return{uuid:e.cohort.uuid,name:e.cohort.name,startDate:e.cohort.startDate,endDate:e.cohort.endDate}});return(0,g.useMemo)(function(){return{cohorts:s,isLoading:i}},[i,s])}var b2="custom:(display,uuid,personA:(age,display,birthdate,uuid),personB:(age,display,birthdate,uuid),relationshipType:(uuid,display,description,aIsToB,bIsToA))";function b3(e){var n,t,r="".concat(fX.Jj,"/relationship?v=").concat(b2,"&person=").concat(e),a=(0,yD.Ay)(e?r:null,fX.lo),o=a.data,i=a.error,s=a.isLoading,l=a.isValidating,c=(null==o||null==(t=o.data)||null==(n=t.results)?void 0:n.length)?b4(e,o.data.results):null;return{data:o?c:null,error:i,isLoading:s,isValidating:l}}function b4(e,n){var t=[],r=!0,a=!1,o=void 0;try{for(var i,s=n[Symbol.iterator]();!(r=(i=s.next()).done);r=!0){var l=i.value;e===l.personA.uuid?t.push({uuid:"".concat(l.uuid),display:l.personB.display,relativeAge:l.personB.age,relativeUuid:l.personB.uuid,relationshipType:l.relationshipType.bIsToA}):t.push({uuid:"".concat(l.uuid),display:l.personA.display,relativeAge:l.personA.age,relativeUuid:l.personA.uuid,relationshipType:l.relationshipType.aIsToB})}}catch(e){a=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return t}var b5=t(64197),b6={};b6.styleTagTransform=T(),b6.setAttributes=S(),b6.insert=x().bind(null,"head"),b6.domAPI=k(),b6.insertStyleElement=B(),$()(b5.A,b6);let b8=b5.A&&b5.A.locals?b5.A.locals:void 0;function b7(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function b9(e){if(Array.isArray(e))return e}function ve(e){if(Array.isArray(e))return b7(e)}function vn(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function vt(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function vr(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function va(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function vo(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function vi(e,n){return b9(e)||vr(e,n)||vl(e,n)||va()}function vs(e){return ve(e)||vt(e)||vl(e)||vo()}function vl(e,n){if(e){if("string"==typeof e)return b7(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return b7(e,n)}}var vc=function(e){var n,t=b1(e.patientUuid),r=t.cohorts,a=void 0===r?[]:r,o=t.isLoading;return A().createElement(A().Fragment,null,A().createElement("p",{className:b8.heading},(0,fI.V)("patientLists","Patient Lists")," (",null!=(n=null==a?void 0:a.length)?n:0,")"),o?A().createElement(fN.InlineLoading,{description:"".concat((0,fI.V)("loading","Loading")," ..."),role:"progressbar"}):A().createElement("ul",null,function(){if((null==a?void 0:a.length)>0){var e=a.sort(function(e,n){return(0,cx._U)(null==e?void 0:e.startDate).getTime()-(0,cx._U)(null==n?void 0:n.startDate).getTime()}).slice(0,3);return null==e?void 0:e.map(function(e){return A().createElement("li",{key:e.uuid},A().createElement(v.i_,{to:"".concat(window.spaBase,"/home/patient-lists/").concat(e.uuid),key:e.uuid},e.name))})}return A().createElement("li",null,"--")}(),a.length>3&&A().createElement("li",{className:b8.link},A().createElement(v.i_,{to:"".concat(window.spaBase,"/home/patient-lists")},(0,fI.V)("seeMoreLists","See {{count}} more lists",{count:(null==a?void 0:a.length)-3})))))},vu=function(e){var n,t=e.patientId,r=(0,v.tQ)(t),a=r.patient,o=r.isLoading,i=null==a||null==(n=a.address)?void 0:n.find(function(e){return"home"===e.use}),s=function(e){return e.split("#")[1]};return o?A().createElement(fN.InlineLoading,{description:"".concat((0,fI.V)("loading","Loading")," ..."),role:"progressbar"}):A().createElement(A().Fragment,null,A().createElement("p",{className:b8.heading},(0,fI.V)("address","Address")),A().createElement("ul",null,i?Object.entries(i).filter(function(e){var n=vi(e,1)[0];return"id"!==n&&"use"!==n}).map(function(e){var n,t,r,a=vi(e,2),o=a[0],l=a[1];return"extension"===o?null==(r=i.extension)||null==(t=r[0])||null==(n=t.extension)?void 0:n.map(function(e,n){return A().createElement("li",{key:"address-".concat(o,"-").concat(n)},(0,fI.V)(s(e.url),s(e.url)),": ",e.valueString)}):A().createElement("li",{key:"address-".concat(o)},(0,fI.V)(o,o),": ",l)}):A().createElement("li",null,"--")))},vd=function(e){var n=b0(e.patientUuid),t=n.isLoading,r=n.contactAttributes,a=(0,g.useMemo)(function(){return r?vs(null==r?void 0:r.map(function(e){return[e.attributeType.display?(0,fI.V)(e.attributeType.display,e.attributeType.display):"",e.value]})):[]},[r]);return A().createElement(A().Fragment,null,A().createElement("p",{className:b8.heading},(0,fI.V)("contactDetails","Contact Details")),t?A().createElement(fN.InlineLoading,{description:"".concat((0,fI.V)("loading","Loading")," ..."),role:"progressbar"}):A().createElement("ul",null,a.length?a.map(function(e,n){var t=vi(e,2),r=t[0],a=t[1];return A().createElement("li",{key:"".concat(r,"-").concat(a,"-").concat(n)},r,": ",a)}):A().createElement("li",null,"--")))},vp=function(e){var n=b3(e.patientId),t=n.data,r=n.isLoading;return A().createElement(A().Fragment,null,A().createElement("p",{className:b8.heading},(0,fI.V)("relationships","Relationships")),r?A().createElement(fN.InlineLoading,{description:"".concat((0,fI.V)("loading","Loading")," ..."),role:"progressbar"}):A().createElement("ul",null,t&&t.length>0?A().createElement(A().Fragment,null,t.map(function(e){return A().createElement("li",{key:e.uuid,className:b8.relationship},A().createElement("div",null,A().createElement(v.i_,{to:"".concat(window.spaBase,"/patient/").concat(e.relativeUuid,"/chart")},e.display)),A().createElement("div",null,e.relationshipType),A().createElement("div",null,"".concat(e.relativeAge?e.relativeAge:"--"," ").concat(e.relativeAge?1===e.relativeAge?"yr":"yrs":"")))})):A().createElement("li",null,"--")))};function vf(e){var n=e.patientId,t=e.deceased;return A().createElement("div",{className:b()(b8.contactDetails,vn({},b8.deceased,t))},A().createElement("div",{className:b8.row},A().createElement("div",{className:b8.col},A().createElement(vu,{patientId:n})),A().createElement("div",{className:b8.col},A().createElement(vd,{patientUuid:n}))),A().createElement("div",{className:b8.row},A().createElement("div",{className:b8.col},A().createElement(vp,{patientId:n})),A().createElement("div",{className:b8.col},A().createElement(vc,{patientUuid:n}))))}function v_(e){var n=document.querySelector("template#loading-spinner");if(n){var t=n.content.cloneNode(!0),r=Array.prototype.map.call(t.childNodes,function(e){return e});return e.appendChild(t),function(){return r.forEach(function(e){return e.remove()})}}return function(){}}var vh=t(20186),vm=t(15626),vg={};vg.styleTagTransform=T(),vg.setAttributes=S(),vg.insert=x().bind(null,"head"),vg.domAPI=k(),vg.insertStyleElement=B(),$()(vm.A,vg);let vA=vm.A&&vm.A.locals?vm.A.locals:void 0;function vy(e){var n=e.workspaceGroup,t=bI().registeredWindowsByName,r=n.groupName,a=n.props,o=Object.values(t).filter(function(e){return e.group===r&&void 0!==e.icon}).sort(function(e,n){var t,r;return(null!=(t=e.order)?t:Number.MAX_VALUE)-(null!=(r=n.order)?r:Number.MAX_VALUE)});return 0===o.length?null:A().createElement("aside",{className:vA.sideRail},A().createElement("div",{className:vA.container},o.map(function(e){return A().createElement(gM,{key:e.icon,config:function(){return(0,vh.o)(e.moduleName,e.icon)},mountParcel:ho.xL,windowName:e.name,groupProps:a})})))}function vb(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function vv(e){if(Array.isArray(e))return e}function vC(e,n,t,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){t(e);return}s.done?n(l):Promise.resolve(l).then(r,a)}function v$(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function i(e){vC(o,r,a,i,s,"next",e)}function s(e){vC(o,r,a,i,s,"throw",e)}i(void 0)})}}function vw(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function vk(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function vE(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function vx(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){vw(e,n,t[n])})}return e}function vD(e,n){return vv(e)||vk(e,n)||vS(e,n)||vE()}function vS(e,n){if(e){if("string"==typeof e)return vb(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return vb(e,n)}}function vz(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(n){return l([e,n])}}function l(s){if(t)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],r=0}finally{t=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}var vB=function(e){var n=e.lifeCycle,t=e.openedWorkspace,r=e.openedWindow,a=e.isRootWorkspace,o=e.isLeafWorkspace,i=bI(),s=i.openedGroup,l=i.closeWorkspace,c=i.openChildWorkspace,u=(0,g.useMemo)(function(){var e;return t&&{closeWorkspace:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return v$(function(){var n,a,o,i,s,c;return vz(this,function(u){switch(u.label){case 0:if(a=void 0!==(n=e.closeWindow)&&n,i=void 0!==(o=e.discardUnsavedChanges)&&o,!a)return[3,3];if(s=i)return[3,2];return[4,bN({reason:"CLOSE_WINDOW",explicit:!0,windowName:r.windowName})];case 1:s=u.sent(),u.label=2;case 2:if(s)return l(r.openedWorkspaces[0].workspaceName),[2,!0];return[2,!1];case 3:if(c=i)return[3,5];return[4,bN({reason:"CLOSE_WORKSPACE",explicit:!0,windowName:r.windowName,workspaceName:t.workspaceName})];case 4:c=u.sent(),u.label=5;case 5:if(c)return l(t.workspaceName),[2,!0];return[2,!1];case 6:return[2]}})})()},launchChildWorkspace:function(e,n){c(t.workspaceName,e,null!=n?n:{})},workspaceName:t.workspaceName,workspaceProps:t.props,windowProps:r.props,groupProps:null!=(e=null==s?void 0:s.props)?e:null,isRootWorkspace:a,isLeafWorkspace:o}},[t,l,s,r]);return n?A().createElement(gM,vx({key:t.workspaceName,config:n,mountParcel:ho.xL},u)):A().createElement(fN.InlineLoading,{description:"".concat((0,fI.V)("loading")," ...")})};let vM=function(e){var n=e.openedWindow,t=n.openedWorkspaces,r=vD((0,g.useState)(),2),a=r[0],o=r[1],i=hs.J_.getState().registeredWorkspacesByName;return(0,g.useEffect)(function(){Promise.all(t.map(function(e){var n=i[e.workspaceName],t=n.moduleName,r=n.component;return(0,vh.o)(t,r)})).then(o)},[t]),A().createElement(A().Fragment,null,t.map(function(e,r){return A().createElement(vB,{key:e.uuid,openedWorkspace:e,openedWindow:n,lifeCycle:null==a?void 0:a[r],isRootWorkspace:0===r,isLeafWorkspace:r===t.length-1})}))};var vT=t(950),vO={};vO.styleTagTransform=T(),vO.setAttributes=S(),vO.insert=x().bind(null,"head"),vO.domAPI=k(),vO.insertStyleElement=B(),$()(vT.A,vO);let vN=vT.A&&vT.A.locals?vT.A.locals:void 0;function vP(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function vI(e){e&&(0,_P.createRoot)(e).render(A().createElement(vF,null))}function vF(){var e=bI(),n=e.openedGroup,t=e.openedWindows,r=e.registeredGroupsByName;if(!n)return null;var a=r[n.groupName];return A().createElement("div",{className:b()(vN.workspaceWindowsAndMenuContainer,vP({},vN.overlay,a.overlay))},A().createElement("div",{className:vN.workspaceWindowsContainer},t.map(function(e){return A().createElement(vM,{key:e.windowName,openedWindow:e})})),A().createElement(vy,{workspaceGroup:n}))}},66919:function(e,n,t){"use strict";var r=t(42722);r.Type.UUID,r.Type.String,r.Type.Array,r.Type.Array;var a={slot:"patient-chart-care-panel-dashboard-slot",columns:1,title:"Care panel",path:"Care panel"},o=t(91043),i=t(35400),s=t.n(i),l=t(58088),c=t(70438),u=t(72591),d=t.n(u),p=t(1740),f=t.n(p),h=t(88128),m=t.n(h),g=t(30855),A=t.n(g),y=t(93051),b=t.n(y),v=t(73656),C=t.n(v),$=t(23252),w={};w.styleTagTransform=C(),w.setAttributes=A(),w.insert=m().bind(null,"head"),w.domAPI=f(),w.insertStyleElement=b(),d()($.A,w);let k=$.A&&$.A.locals?$.A.locals:void 0;var E=t(13624),x=t(87809),D=t.n(x),S=function(e){var n,t,a="/ws/rest/v1/kenyaemr/patientHistoricalEnrollment?patientUuid=".concat(e),o=(0,E.Ay)(a,r.openmrsFetch),i=o.data,s=o.isValidating;return{error:o.error,isLoading:o.isLoading,enrollments:null!=(t=D()(null!=(n=null==i?void 0:i.data)?n:[],"programName"))?t:[],isValidating:s}},z=t(35674),B={};B.styleTagTransform=C(),B.setAttributes=A(),B.insert=m().bind(null,"head"),B.domAPI=f(),B.insertStyleElement=b(),d()(z.A,B);let M=z.A&&z.A.locals?z.A.locals:void 0;var T=function(e){var n="/ws/rest/v1/kenyaemr/currentProgramDetails?patientUuid=".concat(e),t=(0,E.Ay)(n,r.openmrsFetch),a=t.data,o=(t.mutate,t.error),i=t.isLoading;return{data:(null==a?void 0:a.data)?null==a?void 0:a.data:null,isError:o,isLoading:i}},O=function(e){return e.HIV="HIV",e.TB="TB",e.TPT="TPT",e.MCH_MOTHER="MCH - Mother Services",e.MCH_CHILD="MCH - Child Services",e.MCHMOTHER="mchMother",e.MCHCHILD="mchChild",e}({}),N=function(e){return e.HIV="ARV",e.TB="TB",e}({}),P=function(e){return e.RegimenLineConcept="163104AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.reasonCodedConcept="1252AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.reasonNonCodedConcept="5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.standardRegimenConcept="1193AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.nonStandardRegimenConcept="1088AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.arvCategoryConcept="1255AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.tbCategoryConcept="1268AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.changeRegimenConcept="1259AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.stopRegimenConcept="1260AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.startOrRestartConcept="1256AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e.regimenForm="da687480-e197-11e8-9f32-f2801f1b9fd1",e.regimenEncounterType="7dffc392-13e7-11e9-ab14-d663bd873d93",e.dateDrugStoppedCon="1191AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",e}({}),I=t(27438),F={};F.styleTagTransform=C(),F.setAttributes=A(),F.insert=m().bind(null,"head"),F.domAPI=f(),F.insertStyleElement=b(),d()(I.A,F);let R=I.A&&I.A.locals?I.A.locals:void 0,H=function(e){var n=e.category,t=e.patientUuid,a=e.onRegimen,o=e.lastRegimenEncounter,i=(0,l.useTranslation)().t;return s().createElement(c.Link,{className:R.linkName,onClick:function(){return(0,r.launchWorkspace)("patient-regimen-workspace",{category:N[n],patientUuid:t,onRegimen:a,lastRegimenEncounter:o})}},i("editRegimen","Edit"))};var L=function(e,n){var t,a,o="/ws/rest/v1/kenyaemr/lastRegimenEncounter?patientUuid=".concat(n,"&category=").concat(e),i=(0,E.Ay)(o,r.openmrsFetch),s=i.data,l=(i.mutate,i.error),c=i.isLoading;return{regimenEncounter:(null==s||null==(t=s.data)?void 0:t.results)?null==s||null==(a=s.data)?void 0:a.results:"",isLoading:c,error:l}};function j(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function q(e){if(Array.isArray(e))return e}function G(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function V(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function U(e,n){return q(e)||G(e,n)||W(e,n)||V()}function W(e,n){if(e){if("string"==typeof e)return j(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return j(e,n)}}let K=function(e){var n,t=e.patientUuid,a=e.programName,o=T(t),i=o.data,u=o.isError,d=o.isLoading,p=(0,l.useTranslation)().t,f=L(N[a],t).regimenEncounter,h="tablet"==(0,r.useLayoutType)();return d?s().createElement(c.StructuredListSkeleton,null):u?s().createElement("span",null,p("errorProgramSummary","Error loading HIV summary")):(null==(n=Object.keys(null!=i?i:{}))?void 0:n.length)!==0&&Object.keys(null!=i?i:{}).length>0?s().createElement(s().Fragment,null,Object.entries(i).map(function(e){var n,o,l,u,d,m,g,A,y,b,v,C,$,w,k,E,x,D,S,z,B,T,N,P,I,F,R,L,j,q,G,V,W,K,Z,Y,J,X,Q,ee,en,et,er,ea,eo,ei,es,el,ec,eu,ed,ep,ef,e_,eh,em,eg,eA,ey,eb,ev,eC,e$,ew,ek,eE,ex,eD,eS,ez,eB,eM,eT,eO,eN=U(e,2),eP=eN[0];return eN[1],eP==O.HIV&&a==O.HIV?s().createElement(c.Tile,null,s().createElement("div",{className:M.card},s().createElement("div",{className:h?M.tabletHeading:M.desktopHeading},s().createElement("h4",{className:M.title}," ",p("currentStatus","Current status"))),s().createElement("div",{className:M.container},s().createElement("div",{className:M.content},s().createElement("p",null,p("lastViralLoad","Last viral load")),s().createElement("p",null," ",s().createElement("span",{className:M.value},(null==i||null==(n=i.HIV)?void 0:n.ldlValue)?null==i||null==(o=i.HIV)?void 0:o.ldlValue:"--"),(null==i||null==(l=i.HIV)?void 0:l.ldlDate)?s().createElement("span",null,"(",(0,r.formatDate)(new Date(null==i||null==(u=i.HIV)?void 0:u.ldlDate)),")"):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("lastCd4Count","Last CD4 count")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(d=i.HIV)?void 0:d.cd4)?null==i||null==(m=i.HIV)?void 0:m.cd4:"--"),(null==i||null==(g=i.HIV)?void 0:g.cd4Date)?s().createElement("span",null," (",(0,r.formatDate)(new Date(null==i||null==(A=i.HIV)?void 0:A.cd4Date)),") "):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("CD4Percentage","CD4 percentage")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(y=i.HIV)?void 0:y.cd4Percent)?null==i||null==(b=i.HIV)?void 0:b.cd4Percent:"--"),(null==i||null==(v=i.HIV)?void 0:v.cd4PercentDate)?s().createElement("span",null,"(",(0,r.formatDate)(new Date(null==i||null==(C=i.HIV)?void 0:C.cd4PercentDate)),") "):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("lastWhoStage","Last WHO stage")),s().createElement("p",null,s().createElement("span",{className:M.value},p("whoStage","WHO STAGE")," ",(null==i||null==($=i.HIV)?void 0:$.whoStage)?null==i||null==(w=i.HIV)?void 0:w.whoStage:"--"),(null==i||null==(k=i.HIV)?void 0:k.whoStageDate)?s().createElement("span",null," (",(0,r.formatDate)(new Date(null==i||null==(E=i.HIV)?void 0:E.whoStageDate)),") "):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("regimen","Regimen")),s().createElement("p",{className:M.value},(null==i||null==(D=i.HIV)||null==(x=D.lastEncDetails)?void 0:x.regimenShortDisplay)?null==i||null==(z=i.HIV)||null==(S=z.lastEncDetails)?void 0:S.regimenShortDisplay:p("neverOnArvRegimen","Never on ARVs"),s().createElement("span",null,s().createElement(H,{patientUuid:t,category:a,onRegimen:(null==i||null==(T=i.HIV)||null==(B=T.lastEncDetails)?void 0:B.regimenShortDisplay)?null==i||null==(P=i.HIV)||null==(N=P.lastEncDetails)?void 0:N.regimenShortDisplay:"",lastRegimenEncounter:f})))),s().createElement("div",{className:M.content},s().createElement("p",null,p("regimenStartDate"," Date started regimen")),s().createElement("p",{className:M.value},(null==i||null==(F=i.HIV)||null==(I=F.lastEncDetails)?void 0:I.startDate)?(0,r.formatDate)(new Date(null==i||null==(L=i.HIV)||null==(R=L.lastEncDetails)?void 0:R.startDate)):"--"))))):eP==O.TB&&a==O.TB?s().createElement(c.Tile,null,s().createElement("div",{className:M.card},s().createElement("div",{className:h?M.tabletHeading:M.desktopHeading},s().createElement("h4",{className:M.title}," ",p("currentStatus","Current status"))),s().createElement("div",{className:M.container},s().createElement("div",{className:M.content},s().createElement("p",null,p("treatmentNumber:","Treatment number")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(j=i.TB)?void 0:j.tbTreatmentNumber)?null==i||null==(q=i.TB)?void 0:q.tbTreatmentNumber:"--"))),s().createElement("div",{className:M.content},s().createElement("p",null,p("diseaseClassification","Disease classification")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(G=i.TB)?void 0:G.tbDiseaseClassification)?null==i||null==(V=i.TB)?void 0:V.tbDiseaseClassification:"--"),(null==i||null==(W=i.TB)?void 0:W.tbDiseaseClassificationDate)?s().createElement("span",null," (",(0,r.formatDate)(new Date(null==i||null==(K=i.TB)?void 0:K.tbDiseaseClassificationDate.toString())),") "):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("patientClassification","Patient classification")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(Z=i.TB)?void 0:Z.tbPatientClassification)?null==i||null==(Y=i.TB)?void 0:Y.tbPatientClassification:"--"))),s().createElement("div",{className:M.content},s().createElement("p",null,p("regimen","Regimen")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(J=i.TB)?void 0:J.lastTbEncounter)?null==i||null==(Q=i.TB)||null==(X=Q.lastTbEncounter)?void 0:X.regimenShortDisplay:p("neverOnTbRegimen","Never on TB regimen")),s().createElement(H,{patientUuid:t,category:a,onRegimen:(null==i||null==(ee=i.TB)?void 0:ee.lastTbEncounter)?null==i||null==(et=i.TB)||null==(en=et.lastTbEncounter)?void 0:en.regimenShortDisplay:"",lastRegimenEncounter:f}))),s().createElement("div",{className:M.content},s().createElement("p",null,p("regimenStartDate"," Date started regimen")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(ea=i.TB)||null==(er=ea.lastTbEncounter)?void 0:er.startDate)?(0,r.formatDate)(new Date(null==i||null==(ei=i.TB)||null==(eo=ei.lastTbEncounter)?void 0:eo.startDate)):"--")))))):eP==O.MCHMOTHER&&a==O.MCHMOTHER?s().createElement(c.Tile,null,s().createElement("div",{className:M.card},s().createElement("div",{className:h?M.tabletHeading:M.desktopHeading},s().createElement("h4",{className:M.title}," ",p("currentStatus","Current status"))),s().createElement("div",{className:M.container},s().createElement("div",{className:M.content},s().createElement("p",null,p("hivStatus:","HIV status")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(es=i.mchMother)?void 0:es.hivStatus)?null==i||null==(el=i.mchMother)?void 0:el.hivStatus:"--"),(null==i||null==(ec=i.mchMother)?void 0:ec.hivStatusDate)?s().createElement("span",null,"(",(0,r.formatDate)(new Date(null==i||null==(eu=i.mchMother)?void 0:eu.hivStatusDate)),")"):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("onART","On ART")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(ed=i.mchMother)?void 0:ed.onHaart)?null==i||null==(ep=i.mchMother)?void 0:ep.onHaart:"--"),(null==i||null==(ef=i.mchMother)?void 0:ef.onHaartDate)?s().createElement("span",null," (",(0,r.formatDate)(new Date(null==i||null==(e_=i.mchMother)?void 0:e_.onHaartDate)),") "):""))))):eP==O.MCHCHILD&&a==O.MCHCHILD?s().createElement(c.Tile,null,s().createElement("div",{className:M.card},s().createElement("div",{className:h?M.tabletHeading:M.desktopHeading},s().createElement("h4",{className:M.title}," ",p("currentStatus","Current status"))),s().createElement("div",{className:M.container},s().createElement("div",{className:M.content},s().createElement("p",null,p("currentProphylaxisUsed:","Current prophylaxis used")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(eh=i.mchChild)?void 0:eh.currentProphylaxisUsed)?null==i||null==(em=i.mchChild)?void 0:em.currentProphylaxisUsed:"--"),(null==i||null==(eg=i.mchChild)?void 0:eg.currentProphylaxisUsedDate)?s().createElement("span",null,(0,r.formatDate)(new Date(null==i||null==(eA=i.mchChild)?void 0:eA.currentProphylaxisUsedDate))):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("currentFeedingOption","Current feeding option")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(ey=i.mchChild)?void 0:ey.currentFeedingOption)?null==i||null==(eb=i.mchChild)?void 0:eb.currentFeedingOption:"--"),(null==i||null==(ev=i.mchChild)?void 0:ev.currentFeedingOptionDate)?s().createElement("span",null," ",(0,r.formatDate)(new Date(null==i||null==(eC=i.mchChild)?void 0:eC.currentFeedingOptionDate))," "):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("milestonesAttained","Milestones Attained")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(e$=i.mchChild)?void 0:e$.milestonesAttained)?null==i||null==(ew=i.mchChild)?void 0:ew.milestonesAttained:"--"),(null==i||null==(ek=i.mchChild)?void 0:ek.milestonesAttainedDate)?s().createElement("span",null,(0,r.formatDate)(new Date(null==i||null==(eE=i.mchChild)?void 0:eE.milestonesAttainedDate))," "):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("heiOutcome","HEI Outcome")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(ex=i.mchChild)?void 0:ex.heiOutcome)?null==i||null==(eD=i.mchChild)?void 0:eD.heiOutcome:"--"),(null==i||null==(eS=i.mchChild)?void 0:eS.heiOutcomeDate)?s().createElement("span",null," (",(0,r.formatDate)(new Date(null==i||null==(ez=i.mchChild)?void 0:ez.heiOutcomeDate)),") "):"")),s().createElement("div",{className:M.content},s().createElement("p",null,p("hivStatus","HIV Status")),s().createElement("p",null,s().createElement("span",{className:M.value},(null==i||null==(eB=i.mchChild)?void 0:eB.hivStatus)?null==i||null==(eM=i.mchChild)?void 0:eM.hivStatus:"--"),(null==i||null==(eT=i.mchChild)?void 0:eT.hivStatusDate)?s().createElement("span",null," (",(0,r.formatDate)(new Date(null==i||null==(eO=i.mchChild)?void 0:eO.hivStatusDate)),") "):""))))):null})):void 0};var Z=t(30374),Y={};Y.styleTagTransform=C(),Y.setAttributes=A(),Y.insert=m().bind(null,"head"),Y.domAPI=f(),Y.insertStyleElement=b(),d()(Z.A,Y);let J=Z.A&&Z.A.locals?Z.A.locals:void 0;var X=t(3514),Q=t.n(X),ee=t(23464),en=t.n(ee),et=t(56622),er=t.n(et),ea=t(22695),eo=function(e){var n="/ws/rest/v1/kenyaemr/heiOutcomeEncounter?patientUuid=".concat(e),t=(0,E.Ay)(n,r.openmrsFetch),a=t.data,o=(t.mutate,t.error),i=t.isLoading;return{heiOutcome:(null==a?void 0:a.data)?null==a?void 0:a.data:{},isLoading:i,error:o}};function ei(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function es(e){if(Array.isArray(e))return e}function el(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function ec(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function eu(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ed(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){el(e,n,t[n])})}return e}function ep(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function ef(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ep(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function e_(e,n){return es(e)||ec(e,n)||eh(e,n)||eu()}function eh(e,n){if(e){if("string"==typeof e)return ei(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ei(e,n)}}var em={dateEnrolled:"Enrolled on",dateCompleted:"Date Completed"},eg={HIV:{dateEnrolled:"Enrolled on",whoStage:"WHO Stage",entryPoint:"Entry Point",reason:"Reason for discontinuation"},TB:ef(ed({},em),{startDate:"Date started regimen",regimenShortName:"Regimen"}),TPT:ef(ed({},em),{tptDrugName:"Regimen",tptDrugStartDate:"Date started regimen",tptIndication:"Indication for TPT"}),"MCH - Mother Services":ef(ed({},em),{lmp:"LMP",eddLmp:"EDD",gravida:"Gravida",parity:"Parity",gestationInWeeks:"Gestation in weeks"}),"MCH - Child Services":ef(ed({},em),{entryPoint:"Entry Point"}),mchMother:{},mchChild:{},VMMC:ed({},em)};let eA=function(e){var n,t=e.enrollments,a=void 0===t?[]:t,u=e.programName,d=(0,l.useTranslation)().t,p=(0,r.useVisit)((0,o.cH)()).currentVisit,f=eo(null==p||null==(n=p.patient)?void 0:n.uuid).heiOutcome,h=er()(a,"dateEnrolled","desc"),m=(0,i.useMemo)(function(){var e;return Object.entries(null!=(e=eg[u])?e:ed({},em)).map(function(e){var n=e_(e,2);return{key:n[0],header:n[1]}})},[u]),g=(0,i.useMemo)(function(){return null==h?void 0:h.map(function(e){var n,t=null!=(n=null==e?void 0:e.firstEncounter)?n:{},r=null==e?void 0:e.enrollmentEncounterUuid;return ef(ed({id:"".concat(e.enrollmentUuid)},e,t),{changeReasons:Array.isArray(null==t?void 0:t.changeReasons)?t.changeReasons.join(", "):"",enrollmentEncounterUuid:r})})},[h]),A=function(){["".concat(r.restBaseUrl,"/kenyaemr/patientHistoricalEnrollment?patientUuid="),"".concat(r.restBaseUrl,"/kenyaemr/patientCurrentEnrollment?patientUuid="),"".concat(r.restBaseUrl,"/kenyaemr/eligiblePrograms?patientUuid=")].forEach(function(e){(0,ea.j)(function(n){return"string"==typeof n&&n.startsWith(e)},void 0,{revalidate:!0})})},y=function(e){var n,t,a;(0,r.launchWorkspace)("patient-form-entry-workspace",{workspaceTitle:null==e?void 0:e.discontinuationFormName,mutateForm:A,formInfo:{encounterUuid:"",visitTypeUuid:null!=(t=null==p||null==(n=p.visitType)?void 0:n.uuid)?t:"",visitUuid:null!=(a=null==p?void 0:p.uuid)?a:"",formUuid:null==e?void 0:e.discontinuationFormUuid,additionalProps:{enrollmentDetails:{dateEnrolled:new Date(e.dateEnrolled),uuid:e.enrollmentUuid}}}})},b=function(){var e,n,t;(0,r.launchWorkspace)("patient-form-entry-workspace",{workspaceTitle:"HEI Outcome",mutateForm:function(){(0,ea.j)(function(e){return!0},void 0,{revalidate:!0})},formInfo:{encounterUuid:"",visitTypeUuid:null!=(n=null==p||null==(e=p.visitType)?void 0:e.uuid)?n:"",visitUuid:null!=(t=null==p?void 0:p.uuid)?t:"",formUuid:"d823f1ef-0973-44ee-b113-7090dc23257b",additionalProps:{}}})},v=function(e){var n,t,a;(0,r.launchWorkspace)("patient-form-entry-workspace",{workspaceTitle:null==e?void 0:e.enrollmentFormName,mutateForm:function(){(0,ea.j)(function(e){return"string"==typeof e&&e.startsWith("/ws/rest/v1/kenyaemr/patientHistoricalEnrollment?patientUuid=")},void 0,{revalidate:!0})},formInfo:{encounterUuid:null==e?void 0:e.enrollmentEncounterUuid,formUuid:null==e?void 0:e.enrollmentFormUuid,visitTypeUuid:null!=(t=null==p||null==(n=p.visitType)?void 0:n.uuid)?t:"",visitUuid:null!=(a=null==p?void 0:p.uuid)?a:"",additionalProps:{enrollmentDetails:{dateEnrolled:new Date(e.dateEnrolled),uuid:e.enrollmentUuid}}}})};return(null==h?void 0:h.length)===0?null:s().createElement(c.Tile,{className:J.whiteBackground},s().createElement("div",{className:J.tileWrapper},s().createElement(c.DataTable,{size:"sm",useZebraStyles:!0,rows:g,headers:m},function(e){var n=e.rows,t=e.headers,a=e.getHeaderProps,o=e.getRowProps,i=e.getTableProps;return s().createElement(c.TableContainer,{title:d("EnrollmentDetails","Enrollment History"),description:""},s().createElement(c.Table,ef(ed({},i()),{"aria-label":""}),s().createElement(c.TableHead,null,s().createElement(c.TableRow,null,t.map(function(e){return s().createElement(c.TableHeader,ed({key:e.key},a({header:e})),e.header)}),s().createElement(c.TableHeader,null))),s().createElement(c.TableBody,null,n.map(function(e,n){var t,a,i;return s().createElement(c.TableRow,ed({key:e.id},o({row:e})),e.cells.map(function(e){return s().createElement(c.TableCell,{key:e.id},Q()(e.value)?"--":en()(e.value).isValid()?(0,r.formatDate)(new Date(e.value)):e.value)}),s().createElement(c.TableCell,{className:"cds--table-column-menu"},Q()(null==(t=h[n])?void 0:t.dateCompleted)&&s().createElement(c.OverflowMenu,{size:"sm",flipped:!0},s().createElement(c.OverflowMenuItem,{hasDivider:!0,itemText:d("edit","Edit"),onClick:function(){return v(h[n])}}),(null==f?void 0:f.heiNumber)&&!(null==f?void 0:f.heiOutcomeEncounterUuid)&&(null==(a=h[n])?void 0:a.programName)==="MCH - Child Services"&&s().createElement(c.OverflowMenuItem,{hasDivider:!0,itemText:d("heiOutcome","Hei Outcome"),onClick:b}),s().createElement(c.OverflowMenuItem,{isDelete:!0,hasDivider:!0,disabled:(null==f?void 0:f.heiNumber)&&!(null==f?void 0:f.heiOutcomeEncounterUuid)&&(null==(i=h[n])?void 0:i.programName)==="MCH - Child Services",itemText:d("discontinue","Discontinue"),onClick:function(){return y(h[n])}}))))}))))})))};var ey=t(98611),eb={};eb.styleTagTransform=C(),eb.setAttributes=A(),eb.insert=m().bind(null,"head"),eb.domAPI=f(),eb.insertStyleElement=b(),d()(ey.A,eb);let ev=ey.A&&ey.A.locals?ey.A.locals:void 0;var eC=function(e,n){var t,a,o="/ws/rest/v1/kenyaemr/regimenHistory?patientUuid=".concat(e,"&category=").concat(n),i=(0,E.Ay)(o,r.openmrsFetch),s=i.data,l=(i.mutate,i.error),c=i.isLoading;return{regimen:(null==s||null==(t=s.data)?void 0:t.results)?null==s||null==(a=s.data)?void 0:a.results:[],isLoading:c,error:l}};let e$=function(e){var n=e.patientUuid,t=e.category,a=(0,l.useTranslation)().t,o="tablet"==(0,r.useLayoutType)(),i=eC(n,N[t]),u=i.regimen,d=i.isLoading,p=i.error;if(d)return s().createElement(c.StructuredListSkeleton,null);if(p)return s().createElement("span",null,a("errorRegimenHistory","Error loading regimen history"));if((null==u?void 0:u.length)!==0&&(null==u?void 0:u.length)){var f=function(){return u.filter(function(e){return null==e?void 0:e.startDate}).map(function(e,n){return s().createElement(c.StructuredListRow,{key:"row-".concat(n),className:ev.structuredList},s().createElement(c.StructuredListCell,null,(null==e?void 0:e.startDate)?(0,r.formatDate)((0,r.parseDate)(null==e?void 0:e.startDate),{mode:"wide"}):""),s().createElement(c.StructuredListCell,null,(null==e?void 0:e.endDate)?(0,r.formatDate)((0,r.parseDate)(null==e?void 0:e.endDate),{mode:"wide"}):""),s().createElement(c.StructuredListCell,null,(null==e?void 0:e.regimenShortDisplay)?null==e?void 0:e.regimenShortDisplay:"——"),s().createElement(c.StructuredListCell,null,(null==e?void 0:e.regimenLine)?null==e?void 0:e.regimenLine:"——"),s().createElement(c.StructuredListCell,null,(null==e?void 0:e.changeReasons)?null==e?void 0:e.changeReasons.slice(1,-1):"——"),s().createElement(c.StructuredListCell,null))})};return s().createElement("section",null,s().createElement(c.Tile,{className:ev.whiteBackground},s().createElement("div",{className:o?ev.tabletHeading:ev.desktopHeading},s().createElement("h4",{className:ev.title},a("regimenHistory","Regimen History"))),s().createElement("div",{className:ev.structuredListBody},s().createElement(c.StructuredListWrapper,null,s().createElement(c.StructuredListHead,null,s().createElement(c.StructuredListRow,{head:!0},s().createElement(c.StructuredListCell,{head:!0},a("start","Start")),s().createElement(c.StructuredListCell,{head:!0},a("end","End")),s().createElement(c.StructuredListCell,{head:!0},a("regimen","Regimen")),s().createElement(c.StructuredListCell,{head:!0},a("regimenLine","Regimen line")),s().createElement(c.StructuredListCell,{head:!0},a("changeReason","Change reason")))),s().createElement(c.StructuredListBody,{className:ev.structuredListBody},f())))))}};var ew=t(47289),ek=t.n(ew),eE=t(40074),ex=t.n(eE);function eD(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function eS(e){if(Array.isArray(e))return e}function ez(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function eB(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function eM(e,n){return eS(e)||ez(e,n)||eT(e,n)||eB()}function eT(e,n){if(e){if("string"==typeof e)return eD(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eD(e,n)}}let eO=function(e){var n=e.patientUuid,t=e.formEntrySub,a=(0,l.useTranslation)().t,u=S(n),d=u.isLoading,p=u.error,f=u.enrollments;u.isValidating;var h=ex()(Object.keys(f||{})),m=eM((0,i.useState)({index:0}),2),g=m[0],A=m[1],y=(0,i.useMemo)(function(){return d?[]:f[(null==g?void 0:g.name)||ek()(h)]},[f,d,null==g?void 0:g.name,h]);return d?s().createElement("div",{className:k.widgetCard},s().createElement(c.StructuredListSkeleton,null)):p?s().createElement(r.ErrorState,{error:p,headerTitle:a("carePanelError","Care panel")}):0===Object.keys(f).length?s().createElement(s().Fragment,null,s().createElement(o.pp,{displayText:a("carePanel","care panel"),headerTitle:a("carePanel","Care panel")})):s().createElement("div",{className:k.widgetCard},s().createElement(o.aR,{title:a("carePanel","Care Panel")},s().createElement("div",{className:k.contextSwitcherContainer},s().createElement(c.ContentSwitcher,{size:"md",selectedIndex:null==g?void 0:g.index,onChange:function(e){return A(e)}},null==h?void 0:h.map(function(e){return s().createElement(c.Switch,{key:e,name:e,text:e})})))),s().createElement("div",{style:{width:"100%",minHeight:"20rem"}},s().createElement(K,{patientUuid:n,programName:h[null==g?void 0:g.index]}),s().createElement(e$,{patientUuid:n,category:h[null==g?void 0:g.index]}),s().createElement(eA,{patientUuid:n,programName:h[null==g?void 0:g.index],enrollments:y,formEntrySub:t})))};var eN=t(60529),eP=t(1899),eI=t(56005),eF=t.n(eI),eR=function(e){var n="/ws/rest/v1/kenyaemr/eligiblePrograms?patientUuid=".concat(e),t=(0,E.Ay)(n,r.openmrsFetch),a=t.data,o=t.error,s=t.isLoading,l=t.isValidating,c=t.mutate;return{eligibleCarePrograms:(0,i.useMemo)(function(){var e,n;return null!=(n=null==a||null==(e=a.data)?void 0:e.filter(function(e){return"active"!==e.enrollmentStatus}))?n:[]},[a]),activeCarePrograms:(0,i.useMemo)(function(){var e,n;return null!=(n=null==a||null==(e=a.data)?void 0:e.filter(function(e){return"active"!==e.enrollmentStatus}))?n:[]},[a]),error:o,isLoading:s,isValidating:l,mutateEligiblePrograms:c}},eH=t(50574),eL=function(e){var n,t,a="custom:(uuid,display,program,dateEnrolled,dateCompleted,location:(uuid,display),states:(startDate,endDate,voided,state:(uuid,concept:(display))))",o="".concat(r.restBaseUrl,"/programenrollment?patient=").concat(e,"&v=").concat(a),i=(0,E.Ay)(o,r.openmrsFetch),s=i.data,l=i.error,c=i.isLoading,u=i.mutate;return{isLoading:c,error:l,enrollments:null!=(t=null==s||null==(n=s.data)?void 0:n.results)?t:[],mutate:u}},ej=function(e){var n="custom:(uuid,display,name,allWorkflows,concept:(uuid,display))",t="".concat(r.restBaseUrl,"/program/").concat(e,"?v=").concat(n),a=(0,E.Ay)(t,r.openmrsFetch),o=a.data,i=a.error,s=a.isLoading,l=a.mutate;return{isLoading:s,error:i,program:null==o?void 0:o.data,mutate:l}},eq=eH.Ay.object({dateEnrolled:eH.Ay.date({coerce:!0}),dateCompleted:eH.Ay.date({coerce:!0}).optional(),location:eH.Ay.string().nonempty()});function eG(e,n,t,a){var o=t.dateEnrolled,i=t.dateCompleted,s=t.location;return(0,r.openmrsFetch)("".concat(r.restBaseUrl,"/programenrollment"),{method:"POST",headers:{"Content-Type":"application/json"},body:{program:e,patient:n,dateEnrolled:o,dateCompleted:i,location:s},signal:a.signal})}function eV(e,n,t){var a=n.dateEnrolled,o=n.dateCompleted,i=n.location;return(0,r.openmrsFetch)("".concat(r.restBaseUrl,"/programenrollment/").concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:{dateEnrolled:a,dateCompleted:o,location:i},signal:t.signal})}var eU=function(e,n){var t=(0,r.showModal)("program-delete-confirmation-modal",{closeDeleteModal:function(){return t()},programEnrollmentId:e,patientUuid:n,size:"sm"})},eW=function(e,n,t,a){(0,r.launchWorkspace)("mch-program-form-workspace",{enrollment:t,patientUuid:n,programUuid:e,onSubmitSuccess:a})},eK=t(6070),eZ={};eZ.styleTagTransform=C(),eZ.setAttributes=A(),eZ.insert=m().bind(null,"head"),eZ.domAPI=f(),eZ.insertStyleElement=b(),d()(eK.A,eZ);let eY=eK.A&&eK.A.locals?eK.A.locals:void 0,eJ=function(){var e=(0,r.useConfig)().careProgramForms,n=(0,i.useCallback)(function(n){var t=e.find(function(e){return e.programUuid===n});return t?t.forms:[]},[e]);return{careProgramForms:e,getProgramForms:n}};function eX(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function eQ(e){if(Array.isArray(e))return eX(e)}function e0(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function e1(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e2(e){return eQ(e)||e0(e)||e3(e)||e1()}function e3(e,n){if(e){if("string"==typeof e)return eX(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eX(e,n)}}let e4=function(e){var n=e.patientUuid,t=(0,l.useTranslation)().t,a=eJ().getProgramForms,u=(0,r.useVisit)(n).currentVisit,d=eR(n),p=d.eligibleCarePrograms,f=d.isLoading,h=d.isValidating,m=d.error,g=d.mutateEligiblePrograms,A=eL(n),y=A.enrollments,b=(A.isLoading,A.error,A.mutate),v="tablet"===(0,r.useLayoutType)(),C=(0,i.useCallback)(function(){g(),(0,ea.j)(function(e){return"string"==typeof e&&e.startsWith("".concat(r.restBaseUrl,"/kenyaemr/patientHistoricalEnrollment?patientUuid="))},void 0,{revalidate:!0}),(0,ea.j)(function(e){return"string"==typeof e&&e.startsWith("".concat(r.restBaseUrl,"/programenrollment?patient=").concat(n))},void 0,{revalidate:!0})},[g,n]);(0,i.useCallback)(function(e){var n,t="active"===e.enrollmentStatus,a=t?e.discontinuationFormUuid:e.enrollmentFormUuid,i=t?"".concat(e.display," Discontinuation form"):"".concat(e.display," Enrollment form");u?(0,r.launchWorkspace)("patient-form-entry-workspace",{workspaceTitle:i,mutateForm:function(){C()},formInfo:{encounterUuid:"",formUuid:a,additionalProps:{enrollmenrDetails:null!=(n=e.enrollmentDetails)?n:{}}}}):(0,o.ri)()},[u,C]);var $=(0,i.useMemo)(function(){return e2(y.map(function(e){var i=a(e.program.uuid);return{id:e.program.uuid,programName:e.program.name,status:s().createElement("div",{className:eY.careProgramButtonContainer},s().createElement(c.Tag,{type:"green"},"Enrolled"),s().createElement(c.OverflowMenu,{"aria-label":"overflow-menu",flipped:!0},i.map(function(e){var n,t,a=null==u||null==(n=u.encounters)?void 0:n.find(function(n){var t;return(null==(t=n.form)?void 0:t.uuid)===e.formUuId}),i=e.dependancies.every(function(e){var n;return null==u||null==(n=u.encounters)?void 0:n.some(function(n){var t;return(null==n||null==(t=n.form)?void 0:t.uuid)===e})});return(null==e||null==(t=e.dependancies)?void 0:t.length)&&!i?null:s().createElement(c.OverflowMenuItem,{key:e.formUuId,itemText:e.formName,onClick:function(){if(u){var n;return(0,r.launchWorkspace)("patient-form-entry-workspace",{workspaceTitle:e.formName,mutateForm:function(){b(),g()},formInfo:{encounterUuid:null!=(n=null==a?void 0:a.uuid)?n:"",formUuid:e.formUuId}})}(0,o.ri)()}})}),s().createElement(c.OverflowMenuItem,{itemText:t("edit","Edit"),onClick:function(){return eW(e.program.uuid,n,e,function(){return b()})}}),s().createElement(c.OverflowMenuItem,{itemText:t("delete","Delete"),onClick:function(){return eU(e.uuid,n)}})))}})).concat(e2(p.map(function(e){var t;return{id:"".concat(e.uuid),programName:e.display,status:s().createElement("div",{className:eY.careProgramButtonContainer},s().createElement("span",null,eF()("".concat(e.enrollmentStatus," ").concat((null==(t=e.enrollmentDetails)?void 0:t.dateEnrolled)&&"active"===e.enrollmentStatus?"Since (".concat((0,r.formatDate)(new Date(e.enrollmentDetails.dateEnrolled)),")"):""))),s().createElement(c.Button,{size:"sm",className:"cds--btn--sm cds--layout--size-sm",kind:"active"==e.enrollmentStatus?"danger--ghost":"ghost",iconDescription:"Dismiss",onClick:function(){return eW(e.uuid,n,void 0,function(){b(),g()})},renderIcon:"active"==e.enrollmentStatus?eN.bm:eP.pT},"active"==e.enrollmentStatus?"Discontinue":"Enroll"))}})))},[y,p,a,t,u,b,g,n]),w=[{key:"programName",header:"Program name"},{key:"status",header:"Status"}];return f?s().createElement(c.DataTableSkeleton,{headers:w,"aria-label":t("loading","Loading...")}):m?s().createElement(o.W5,{headerTitle:t("errorCarePrograms","Care programs"),error:m}):0===p.length?s().createElement(o.pp,{headerTitle:t("careProgram","Care program"),displayText:t("careProgram","care program")}):s().createElement(c.Tile,{className:eY.container},s().createElement(o.aR,{title:t("carePrograms","Care Programs")},h&&s().createElement(c.InlineLoading,{status:"active",iconDescription:t("validating","Loading"),description:t("validating","Validating data...")})),s().createElement(c.DataTable,{size:v?"lg":"sm",useZebraStyles:!0,rows:$,headers:w},function(e){var n=e.rows,t=e.headers,r=e.getTableProps,a=e.getHeaderProps,o=e.getRowProps;return s().createElement(c.TableContainer,null,s().createElement(c.Table,r(),s().createElement(c.TableHead,null,s().createElement(c.TableRow,null,t.map(function(e){return s().createElement(c.TableHeader,a({header:e}),e.header)}))),s().createElement(c.TableBody,null,n.map(function(e){return s().createElement(c.TableRow,o({row:e}),e.cells.map(function(e){return s().createElement(c.TableCell,{key:e.id},e.value)}))}))))}))};function e5(e){var n=new AbortController;return(0,r.openmrsFetch)("/ws/rest/v1/encounter",{headers:{"Content-Type":"application/json"},method:"POST",body:e,signal:n.signal})}function e6(e,n){var t=new AbortController;return(0,r.openmrsFetch)("/ws/rest/v1/encounter/".concat(n),{headers:{"Content-Type":"application/json"},method:"POST",body:e,signal:t.signal})}function e8(e){var n=new AbortController;return(0,r.openmrsFetch)("/ws/rest/v1/encounter/".concat(e),{headers:{"Content-Type":"application/json"},method:"DELETE",signal:n.signal})}function e7(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function e9(e){if(Array.isArray(e))return e}function ne(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function nn(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nt(e,n){return e9(e)||ne(e,n)||nr(e,n)||nn()}function nr(e,n){if(e){if("string"==typeof e)return e7(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return e7(e,n)}}let na=function(e){var n=e.closeCancelModal,t=e.regimenEncounterUuid,a=e.patientUuid,o=e.category,u=e.closeWorkspace,d=(0,l.useTranslation)().t,p=nt((0,i.useState)(!1),2),f=p[0],h=p[1],m=(0,i.useCallback)(function(e){e.preventDefault(),h(!0),e8(t).then(function(e){204===e.status&&(n(),(0,r.showSnackbar)({title:d("regimenDeleted","Regimen deleted"),subtitle:d("regimenDeletedSuccessfully","Regimen deleted successfully"),kind:"success",timeoutInMs:3500,isLowContrast:!0}),(0,ea.j)("/ws/rest/v1/kenyaemr/regimenHistory?patientUuid=".concat(a,"&category=").concat(o)),(0,ea.j)("/ws/rest/v1/kenyaemr/currentProgramDetails?patientUuid=".concat(a)),(0,ea.j)("/ws/rest/v1/kenyaemr/patientSummary?patientUuid=".concat(a)),(0,ea.j)("/ws/rest/v1/kenyaemr/lastRegimenEncounter?patientUuid=".concat(a,"&category=").concat(o)),null==u||u())}).catch(function(e){(0,r.showNotification)({title:d("regimenDeletedError","Error deleting regimen"),kind:"error",critical:!0,description:null==e?void 0:e.message})})},[d,t,n,o,a,u]);return s().createElement("div",null,s().createElement(c.ModalHeader,{closeModal:n,title:d("deleteRegimen","Delete Regimen")}),s().createElement(c.ModalBody,null,s().createElement("p",null,d("deleteRegimenModalConfirmationText","Are you sure you want to delete regimen?"))),s().createElement(c.ModalFooter,null,s().createElement(c.Button,{kind:"secondary",onClick:n},d("discard","Discard")),s().createElement(c.Button,{kind:"danger",onClick:m,disabled:f},d("deleteRegimen","Delete Regimen"))))};var no=function(){var e,n,t="/ws/rest/v1/kenyaemr/standardRegimen",a=(0,E.Ay)(t,r.openmrsFetch),o=a.data,i=(a.mutate,a.error),s=a.isLoading;return{standardRegimen:(null==o||null==(e=o.data)?void 0:e.results)?null==o||null==(n=o.data)?void 0:n.results:[],isLoading:s,error:i}};function ni(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function ns(e){if(Array.isArray(e))return ni(e)}function nl(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function nc(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nu(e){return ns(e)||nl(e)||nd(e)||nc()}function nd(e,n){if(e){if("string"==typeof e)return ni(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ni(e,n)}}function np(e,n,t){t(nf(n,e)?function(n){return n.map(function(n){return n.concept===e.concept?e:n})}:function(n){return nu(n).concat([e])})}var nf=function(e,n){return e.some(function(e){return e.concept===n.concept})};function n_(e,n){if(!(null==e?void 0:e.length))return[];var t=n>14?"Adult":"Child";return e.filter(function(e){var n=e.regimenline;return null==n?void 0:n.includes(t)})}function nh(e,n){if(!e)return 0;var t=new Date(e);if(isNaN(t.getTime()))return 0;var r=n.getFullYear()-t.getFullYear(),a=n.getMonth()-t.getMonth();return(a<0||0===a&&n.getDate()<t.getDate())&&r--,r}function nm(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function ng(e){if(Array.isArray(e))return e}function nA(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function ny(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nb(e,n){return ng(e)||nA(e,n)||nv(e,n)||ny()}function nv(e,n){if(e){if("string"==typeof e)return nm(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return nm(e,n)}}let nC=function(e){var n=e.category,t=e.setStandardRegimen,a=e.setStandardRegimenLine,o=e.selectedRegimenType,u=e.visitDate,d=e.errors,p=(0,l.useTranslation)().t,f=no(),h=f.standardRegimen;f.isLoading,f.error;var m=nb((0,i.useState)(""),2),g=m[0],A=m[1],y=nb((0,i.useState)(""),2),b=y[0],v=y[1],C=nb((0,i.useState)([]),2),$=C[0],w=C[1],k=h.find(function(e){return e.categoryCode===n}),E=(0,r.usePatient)().patient,x=nh(null==E?void 0:E.birthDate,u),D=n_(null==k?void 0:k.category,x);(0,i.useEffect)(function(){var e=null==k?void 0:k.category.find(function(e){return e.regimenLineValue===g});e?w(e.regimen):w([])},[g,h,k]);var S=function(e){A(e.target.value),a(e.target.value),v("")},z=function(e){v(e.target.value),t(e.target.value)};return s().createElement("div",null,s().createElement(s().Fragment,null,"standardUuid"===o?s().createElement(c.Select,{id:"regimenLine",invalid:!!(null==d?void 0:d.standardRegimenLine),invalidText:null==d?void 0:d.standardRegimenLine,labelText:p("selectRegimenLine","Select Regimen Line"),className:R.inputContainer,value:g,onChange:S},g&&"--"!=g?null:s().createElement(c.SelectItem,{text:p("selectRegimenLine","Select Regimen Line"),value:""}),null==D?void 0:D.map(function(e){return s().createElement(c.SelectItem,{key:e.regimenline,text:e.regimenline,value:e.regimenLineValue},e.regimenline)})):null,g&&s().createElement(c.Select,{id:"regimen",invalid:!!(null==d?void 0:d.standardRegimen),invalidText:null==d?void 0:d.standardRegimen,labelText:p("selectRegimen","Select Regimen"),className:R.inputContainer,value:b,onChange:z},b&&"--"!=b?null:s().createElement(c.SelectItem,{text:p("selectRegimen","Select Regimen"),value:""}),null==$?void 0:$.map(function(e){return s().createElement(c.SelectItem,{key:e.conceptRef,text:e.name,value:e.conceptRef},e.name)}))))};var n$=function(){var e,n,t="/ws/rest/v1/kenyaemr/regimenReason",a=(0,E.Ay)(t,r.openmrsFetch),o=a.data,i=(a.mutate,a.error),s=a.isLoading;return{regimenReason:(null==o||null==(e=o.data)?void 0:e.results)?null==o||null==(n=o.data)?void 0:n.results:[],isLoading:s,error:i}};function nw(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function nk(e){if(Array.isArray(e))return e}function nE(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function nx(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nD(e,n){return nk(e)||nE(e,n)||nS(e,n)||nx()}function nS(e,n){if(e){if("string"==typeof e)return nw(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return nw(e,n)}}let nz=function(e){var n=e.category,t=e.setRegimenReason,r=e.errors,a=(0,l.useTranslation)().t,o=n$(),u=o.regimenReason;o.isLoading,o.error;var d=nD((0,i.useState)(""),2),p=d[0],f=d[1],h=u.find(function(e){return e.category===n}),m=function(e){f(e.target.value),t(e.target.value)};return s().createElement("div",null,s().createElement(s().Fragment,null,s().createElement(c.Select,{id:"regimenReason",invalid:!!(null==r?void 0:r.regimenReason),invalidText:null==r?void 0:r.regimenReason,labelText:a("selectReason","Select Reason"),className:R.inputContainer,value:p,onChange:m},p&&"--"!=p?null:s().createElement(c.SelectItem,{text:a("selectReason","Select Reason"),value:""}),null==h?void 0:h.reason.map(function(e){return s().createElement(c.SelectItem,{key:e.label,text:e.label,value:e.value},e.label)}))))};var nB=function(){var e,n,t="/ws/rest/v1/kenyaemr/arvDrugs",a=(0,E.Ay)(t,r.openmrsFetch),o=a.data,i=(a.mutate,a.error),s=a.isLoading;return{nonStandardRegimen:(null==o||null==(e=o.data)?void 0:e.results)?null==o||null==(n=o.data)?void 0:n.results:[],isLoading:s,error:i}};function nM(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function nT(e){if(Array.isArray(e))return e}function nO(e){if(Array.isArray(e))return nM(e)}function nN(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function nP(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function nI(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nF(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nR(e,n){return nT(e)||nP(e,n)||nL(e,n)||nI()}function nH(e){return nO(e)||nN(e)||nL(e)||nF()}function nL(e,n){if(e){if("string"==typeof e)return nM(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return nM(e,n)}}let nj=function(e){e.category;var n=e.selectedRegimenType,t=e.setNonStandardRegimens,a=e.setStandardRegimenLine,o=e.visitDate,u=e.errors,d=(0,l.useTranslation)().t,p=no().standardRegimen,f=nB(),h=f.nonStandardRegimen;f.isLoading,f.error;var m=nR((0,i.useState)(""),2),g=m[0],A=m[1],y=p.find(function(e){return"ARV"===e.categoryCode}),b=nR((0,i.useState)([,,,,,].fill("")),2),v=b[0],C=b[1],$=nR((0,i.useState)([]),2),w=$[0],k=$[1],E=(0,r.usePatient)().patient,x=nh(null==E?void 0:E.birthDate,o),D=n_(null==y?void 0:y.category,x),S=function(e){A(e.target.value),a(e.target.value)},z=function(e,n){var t=nH(v);t[e]=n,C(t)};return(0,i.useEffect)(function(){k(function(){return v.map(function(e){var n=h.find(function(n){return n.uuid===e});return n?{value:n.uuid,concept:P.nonStandardRegimenConcept}:null}).filter(function(e){return e})}())},[v,h]),(0,i.useEffect)(function(){g&&t(w)},[g,w,t]),s().createElement("div",null,s().createElement(s().Fragment,null,"nonStandardUuid"===n?s().createElement(c.Select,{id:"regimenLine",invalid:!!(null==u?void 0:u.standardRegimenLine),invalidText:null==u?void 0:u.standardRegimenLine,labelText:d("selectRegimenLine","Select Regimen Line"),className:R.inputContainer,value:g,onChange:S},g&&"--"!=g?null:s().createElement(c.SelectItem,{text:d("selectRegimenLine","Select Regimen Line"),value:""}),null==D?void 0:D.map(function(e){return s().createElement(c.SelectItem,{key:e.regimenline,text:e.regimenline,value:e.regimenLineValue},e.regimenline)})):null,g&&s().createElement("div",null,(null==u?void 0:u.nonStandardRegimens)&&s().createElement("div",{className:R.errorText},u.nonStandardRegimens),null==v?void 0:v.map(function(e,n){var t=h.filter(function(n){return!v.includes(n.uuid)||n.uuid===e});return s().createElement(c.Select,{key:n,id:"regimen-".concat(n),labelText:"Select Drug ".concat(n+1),className:R.inputContainer,value:e,onChange:function(e){return z(n,e.target.value)}},s().createElement(c.SelectItem,{text:"Select Drug ".concat(n+1),value:""}),t.map(function(e){return s().createElement(c.SelectItem,{key:e.name,text:e.name,value:e.uuid},e.name)}))}))))};var nq=t(57078);function nG(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function nV(e){if(Array.isArray(e))return e}function nU(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function nW(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nK(e,n){return nV(e)||nU(e,n)||nZ(e,n)||nW()}function nZ(e,n){if(e){if("string"==typeof e)return nG(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return nG(e,n)}}var nY=nq.Ik({regimenEvent:nq.Yj().min(1,{message:"Please select a regimen event"}),visitDate:nq.p6({required_error:"Please select a visit date"})}),nJ=nq.Ik({standardRegimenLine:nq.Yj().min(1,{message:"Please select a regimen line"}),standardRegimen:nq.Yj().min(1,{message:"Please select a regimen"})}),nX=nq.Ik({selectedRegimenType:nq.Yj().min(1,"Please select a regimen type")}),nQ=nq.Ik({regimenReason:nq.Yj().min(1,{message:"Please provide a reason for regimen change/stop"})}),n0=nq.Ik({standardRegimenLine:nq.Yj().min(1,{message:"Please select a regimen line"}),nonStandardRegimens:nq.YO(nq.Yj()).min(1,{message:"Please select at least one drug regimen"})}),n1=function(e,n){var t=nY;return e===P.stopRegimenConcept?t=t.merge(nQ):e===P.changeRegimenConcept?(t=t.merge(nQ).merge(nX),"standardUuid"===n?t=t.merge(nJ):"nonStandardUuid"===n&&(t=t.merge(n0))):e===P.startOrRestartConcept&&(t=t.merge(nX),"standardUuid"===n?t=t.merge(nJ):"nonStandardUuid"===n&&(t=t.merge(n0))),t};let n2=function(e){var n,t,a=e.patientUuid,o=e.category,u=e.onRegimen,d=e.lastRegimenEncounter,p=e.closeWorkspace,f=(0,l.useTranslation)().t,h=nK((0,i.useState)({}),2),m=h[0],g=h[1],A="tablet"===(0,r.useLayoutType)(),y=(0,r.useSession)(),b=(0,r.useConfig)(),v=L(o,a),C=v.regimenEncounter;v.isLoading,v.error;var $=nK((0,i.useState)(!1),2),w=$[0],k=$[1],E=nK((0,i.useState)(new Date),2),x=E[0],D=E[1],S=nK((0,i.useState)(""),2),z=S[0],B=S[1],M=nK((0,i.useState)(""),2),T=M[0],O=M[1],N=nK((0,i.useState)(""),2),I=N[0],F=N[1],H=nK((0,i.useState)([]),2),j=H[0],q=H[1],G=nK((0,i.useState)(""),2),V=G[0],U=G[1],W=nK((0,i.useState)(""),2),K=W[0],Z=W[1],Y=nK((0,i.useState)([]),2),J=Y[0],X=Y[1],Q=nK((0,i.useState)([]),2),ee=Q[0],et=Q[1];(0,i.useEffect)(function(){var e={concept:P.RegimenLineConcept,value:I},n={concept:P.standardRegimenConcept,value:T},t={concept:P.reasonCodedConcept,value:V},a={concept:P.dateDrugStoppedCon,value:(0,r.toDateObjectStrict)((0,r.toOmrsIsoString)(new Date(en()(x).year(),en()(x).month(),en()(x).date())))},i={concept:"ARV"===o?P.arvCategoryConcept:P.tbCategoryConcept,value:z};I&&z!==P.stopRegimenConcept&&np(e,J,X),T&&z!==P.stopRegimenConcept&&np(n,J,X),V&&(z===P.stopRegimenConcept||z===P.changeRegimenConcept)&&np(t,ee,et),x&&(z===P.stopRegimenConcept||z===P.changeRegimenConcept)&&np(a,ee,et),z&&o&&(z===P.stopRegimenConcept?np(i,ee,et):np(i,J,X))},[I,V,T,o,z,x,J,ee]),(0,i.useEffect)(function(){"nonStandardUuid"===K&&j.length>0&&z!==P.stopRegimenConcept&&X(function(e){var n=new Map;return e.forEach(function(e){n.set(e.value,e)}),j.forEach(function(e){n.set(e.value,e)}),Array.from(n.values())})},[K,j,z]);var er=(0,i.useCallback)(function(){var e={regimenEvent:z,selectedRegimenType:K,standardRegimenLine:I,standardRegimen:T,regimenReason:V,visitDate:x,nonStandardRegimens:j.map(function(e){return e.value})};try{return n1(z,K).parse(e),g({}),!0}catch(e){return g(e.errors.reduce(function(e,n){return e[n.path[0]]=n.message,e},{})),!1}},[z,K,I,T,V,x,j]),eo=(0,i.useCallback)(function(e){if(e.preventDefault(),er()){k(!0);var n,t,i={encounterDatetime:(0,r.toDateObjectStrict)((0,r.toOmrsIsoString)(new Date(en()(x).year(),en()(x).month(),en()(x).date()))),patient:a,encounterType:P.regimenEncounterType,location:null==y||null==(n=y.sessionLocation)?void 0:n.uuid,encounterProviders:[{provider:null==y||null==(t=y.currentProvider)?void 0:t.uuid,encounterRole:b.regimenObs.encounterProviderRoleUuid}],form:P.regimenForm,obs:J},s={obs:ee};C.uuid&&(e6(s,C.uuid),p()),J.length>0?e5(i).then(function(e){201===e.status&&((0,r.showSnackbar)({title:f("regimenUpdated","Regimen updated"),subtitle:f("regimenUpdatedSuccessfully","Regimen updated successfully"),kind:"success",timeoutInMs:3500,isLowContrast:!0}),k(!1),(0,ea.j)("/ws/rest/v1/kenyaemr/currentProgramDetails?patientUuid=".concat(a)),(0,ea.j)("/ws/rest/v1/kenyaemr/patientSummary?patientUuid=".concat(a)),(0,ea.j)("/ws/rest/v1/kenyaemr/regimenHistory?patientUuid=".concat(a,"&category=").concat(o)),(0,ea.j)("/ws/rest/v1/kenyaemr/lastRegimenEncounter?patientUuid=".concat(a,"&category=").concat(o)),p())},function(e){(0,r.showNotification)({title:f("regimenError","Error updating regimen"),kind:"error",critical:!0,description:null==e?void 0:e.message}),k(!1)}):k(!1)}},[er,x,a,null==y||null==(n=y.sessionLocation)?void 0:n.uuid,null==y||null==(t=y.currentProvider)?void 0:t.uuid,b.regimenObs.encounterProviderRoleUuid,J,ee,C.uuid,p,f,o]),ei=function(){var e=(0,r.showModal)("delete-regimen-confirmation-dialog",{closeCancelModal:function(){return e()},regimenEncounterUuid:C.uuid,patientUuid:a,category:o,closeWorkspace:p})},es=(0,i.useMemo)(function(){return s().createElement(c.DatePicker,{dateFormat:"d/m/Y",datePickerType:"single",maxDate:new Date().toISOString(),onChange:function(e){return D(nK(e,1)[0])},value:x},s().createElement(c.DatePickerInput,{id:"regimenDateInput",labelText:f("date","Date"),placeholder:"dd/mm/yyyy",style:{width:"100%"},invalid:!!m.visitDate,invalidText:m.visitDate}))},[x,f,m.visitDate]);return s().createElement(c.Form,{className:R.form,onSubmit:eo},s().createElement("div",null,s().createElement(c.Stack,{gap:8,className:R.container},s().createElement("h4",{className:R.regimenTitle},"Current Regimen: ",u),s().createElement("section",{className:R.section},s().createElement("div",{className:R.sectionTitle},f("regimenEvent","Regimen event")),s().createElement(c.RadioButtonGroup,{className:R.radioButtonWrapper,name:"regimenEvent",onChange:function(e){return B(e)}},s().createElement(c.RadioButton,{key:"start-regimen",labelText:f("startRegimen","Start"),value:P.startOrRestartConcept,disabled:!!d.uuid}),s().createElement(c.RadioButton,{key:"restart-regimen",labelText:f("restartRegimen","Restart"),value:P.startOrRestartConcept,disabled:!d.endDate&&"STOP ALL"!==d.event}),s().createElement(c.RadioButton,{key:"change-regimen",labelText:f("changeRegimen","Change"),value:P.changeRegimenConcept,disabled:!d.startDate||"STOP ALL"===d.event}),s().createElement(c.RadioButton,{key:"stop-regimen",labelText:f("stopRegimen","Stop"),value:P.stopRegimenConcept,disabled:!!d.endDate||!d.uuid&&!d.endDate}),s().createElement(c.RadioButton,{key:"undo-regimen",labelText:f("undoRegimen","Undo"),value:"undo",disabled:!d.uuid,onClick:ei})),m.regimenEvent&&s().createElement("div",{className:R.errorText},m.regimenEvent),z?s().createElement(s().Fragment,null,"undo"!==z&&es,z&&z!==P.stopRegimenConcept&&"undo"!==z?s().createElement(s().Fragment,null,s().createElement(c.RadioButtonGroup,{className:R.radioButtonWrapper,name:"regimenType",onChange:function(e){return Z(e)}},s().createElement(c.RadioButton,{key:"standardUuid",labelText:"Use standard regimen",value:"standardUuid"}),s().createElement(c.RadioButton,{key:"nonStandardUuid",labelText:"Use non standard regimen",value:"nonStandardUuid",disabled:"ARV"!==o})),m.selectedRegimenType&&s().createElement("div",{className:R.errorText},m.selectedRegimenType),"standardUuid"===K?s().createElement(nC,{category:o,setStandardRegimen:O,setStandardRegimenLine:F,selectedRegimenType:K,visitDate:x,errors:m}):s().createElement(nj,{category:o,setNonStandardRegimens:q,setStandardRegimenLine:F,selectedRegimenType:K,visitDate:x,errors:m})):null,(z===P.stopRegimenConcept||z===P.changeRegimenConcept&&K)&&s().createElement(nz,{category:o,setRegimenReason:U,errors:m})):null))),s().createElement(c.ButtonSet,{className:A?R.tablet:R.desktop},s().createElement(c.Button,{className:R.button,kind:"secondary",onClick:p},f("discard","Discard")),s().createElement(c.Button,{className:R.button,disabled:w,kind:"primary",type:"submit"},f("save","Save"))))};var n3=t(96228),n4=t(85848);let n5=function(e){var n,t,a="custom:(uuid,program:(name,uuid))",o="/ws/rest/v1/programenrollment?v=".concat(a,"&patient=").concat(e),i=(0,r.useConfig)(),s=(0,E.Ay)(o,r.openmrsFetch),l=s.data;return{error:s.error,isLoading:s.isLoading,isPositive:void 0!==(null!=(t=null==l||null==(n=l.data)?void 0:n.results)?t:[]).find(function(e){return e.program.uuid===i.hivProgramUuid})}};var n6=t(9994);t(45511);let n8=function(e){var n="".concat(r.restBaseUrl,"/keml/patientiitscore?patientUuid=").concat(e),t=(0,E.Ay)(n,r.openmrsFetch),a=t.data,o=t.error;return{isLoading:t.isLoading,error:o,riskScore:(0,i.useMemo)(function(){return null==a?void 0:a.data},[a])}};var n7=t(78306),n9={};n9.styleTagTransform=C(),n9.setAttributes=A(),n9.insert=m().bind(null,"head"),n9.domAPI=f(),n9.insertStyleElement=b(),d()(n7.A,n9);let te=n7.A&&n7.A.locals?n7.A.locals:void 0;var tn=[{evaluationDate:"2023-01-12T00:00:00.000Z",riskScore:0,description:"Low Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2023-04-10T00:00:00.000Z",riskScore:0,description:"Low Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2023-07-06T00:00:00.000Z",riskScore:3,description:"Medium Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2023-10-13T00:00:00.000Z",riskScore:3,description:"Medium Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2023-11-23T00:00:00.000Z",riskScore:3,description:"Medium Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2023-12-17T00:00:00.000Z",riskScore:3,description:"Medium Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2024-01-17T00:00:00.000Z",riskScore:3,description:"Medium Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2024-04-09T00:00:00.000Z",riskScore:11,description:"High Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"},{evaluationDate:"2024-07-07T00:00:00.000Z",riskScore:11,description:"High Risk",riskFactors:"Poor adherance, Missed appointments, Late drug pickup"}];let tt=function(e){var n,t,r=n8(e.patientUuid),a=(r.isLoading,r.error,r.riskScore),o=(0,l.useTranslation)().t,i={title:"KenyaHMIS ML Model",legend:{enabled:!1},axes:{bottom:{title:"Evaluation Time",mapsTo:"evaluationDate",scaleType:n6.Wh.LABELS},left:{mapsTo:"riskScore",title:"Risk Score (%)",percentage:!0,scaleType:n6.Wh.LINEAR,includeZero:!0}},curve:"curveMonotoneX",height:"400px",tooltip:{enabled:!0,valueFormatter:function(e,n){if("Risk Score (%)"===n){var t,r;return"".concat(e," (").concat(null!=(r=null==(t=tn.find(function(n){return"".concat(n.riskScore)==="".concat(e)}))?void 0:t.description)?r:"",")")}return"".concat(e)}}};return s().createElement("div",{className:te.riskScoreCard},s().createElement("span",{className:te.sectionHeader},o("iitRiskScoreTrend","IIT Risk Score Trend")),s().createElement("center",null,s().createElement("strong",null,o("latestRiskScore","Latest risk score"),": "),"".concat(null==a?void 0:a.riskScore," (").concat(null==a?void 0:a.description,")")),s().createElement("div",{style:{padding:"1rem"}},s().createElement(n6.bl,{data:(null==a?void 0:a.riskScore)&&!(null==a?void 0:a.riskScore.includes("-"))?[{evaluationDate:a.evaluationDate,riskScore:Number(null==a||null==(t=a.riskScore)||null==(n=t.split("%")[0])?void 0:n.trim()),description:null==a?void 0:a.description,riskFactors:null==a?void 0:a.riskFactors}]:[],options:i})))},tr=function(e){var n,t=n8(e.patientUuid),a=t.riskScore,o=t.error,i=t.isLoading,u=(0,l.useTranslation)().t;if(i)return s().createElement("div",{className:te.riskScoreCard},s().createElement(c.Row,{style:{display:"flex"}},s().createElement(c.Column,{lg:4,md:4,sm:4,className:te.riskScoreCardItem},s().createElement(c.SkeletonText,null),s().createElement(c.SkeletonText,null)),s().createElement(c.Column,{lg:4,md:4,sm:4,className:te.riskScoreCardItem},s().createElement(c.SkeletonText,null),s().createElement(c.SkeletonText,null))),s().createElement(c.Row,{style:{display:"flex"}},s().createElement(c.Column,{lg:4,md:4,sm:4,className:te.riskScoreCardItem},s().createElement(c.SkeletonText,null),s().createElement(c.SkeletonText,null)),s().createElement(c.Column,{lg:12,md:12,sm:12,className:te.riskScoreCardItem},s().createElement(c.SkeletonText,null),s().createElement(c.SkeletonText,null))));var d=(null==a?void 0:a.evaluationDate)&&en()(a.evaluationDate).isValid()?(0,r.formatDate)((0,r.parseDate)(null==a?void 0:a.evaluationDate)):"--";return o?s().createElement(r.ErrorState,{error:o,headerTitle:u("iitRiscScore","IIT Risk Score")}):s().createElement("div",{className:te.riskScoreCard},s().createElement("span",{className:te.sectionHeader},u("iitRiskscore","IIT Risk Score")),s().createElement(c.Row,{style:{display:"flex"}},s().createElement(c.Column,{lg:4,md:4,sm:4,className:te.riskScoreCardItem},s().createElement("strong",null,u("riskScore","Risk Score"),":"),s().createElement("p",null,"".concat(null!=(n=null==a?void 0:a.riskScore)?n:0))),s().createElement(c.Column,{lg:4,md:4,sm:4,className:te.riskScoreCardItem},s().createElement("strong",null,u("evaluationDate","Evaluation Date"),":"),s().createElement("p",null,d))),s().createElement(c.Row,{style:{display:"flex"}},s().createElement(c.Column,{lg:4,md:4,sm:4,className:te.riskScoreCardItem},s().createElement("strong",null,u("description","Description"),":"),s().createElement("p",null,null==a?void 0:a.description)),s().createElement(c.Column,{lg:12,md:12,sm:12,className:te.riskScoreCardItem},s().createElement("strong",null,u("riskFactors","Risk Factors"),":"),s().createElement("p",null,null==a?void 0:a.riskFactors))))};var ta=t(65120),to={};to.styleTagTransform=C(),to.setAttributes=A(),to.insert=m().bind(null,"head"),to.domAPI=f(),to.insertStyleElement=b(),d()(ta.A,to);let ti=ta.A&&ta.A.locals?ta.A.locals:void 0,ts=function(e){var n=e.patientUuid,t=n5(n),a=t.error,i=(t.isLoading,t.isPositive),c=(0,l.useTranslation)().t,u=c("machineLearning","Machine Learning");return a?s().createElement(r.ErrorState,{error:a,headerTitle:u}):s().createElement("div",{className:ti.machineLearning},!i&&s().createElement(o.pp,{headerTitle:u,displayText:c("mlPredictions","machine learning predictions")}),i&&s().createElement(tr,{patientUuid:n}),i&&s().createElement(tt,{patientUuid:n}))};var tl=t(53338),tc={};tc.styleTagTransform=C(),tc.setAttributes=A(),tc.insert=m().bind(null,"head"),tc.domAPI=f(),tc.insertStyleElement=b(),d()(tl.A,tc);let tu=tl.A&&tl.A.locals?tl.A.locals:void 0,td=function(e){var n=e.formEntrySub,t=e.patientUuid,r=(0,l.useTranslation)().t;return s().createElement(c.Layer,{className:tu.container},s().createElement(c.Tile,null,s().createElement("div",{className:tu.desktopHeading},s().createElement("h4",null,r("careProgramsEnrollement","Care panel")))),s().createElement("div",{className:tu.tabs},s().createElement(c.Tabs,null,s().createElement(c.TabList,{contained:!0,activation:"manual","aria-label":"List of care panels"},s().createElement(c.Tab,{renderIcon:n3.xh},r("panelSummary","Panel summary")),s().createElement(c.Tab,{renderIcon:eN.m6},r("enrollments","Program enrollment")),s().createElement(c.Tab,{renderIcon:n4.j0},r("machineLearning","Machine Learning"))),s().createElement(c.TabPanels,null,s().createElement(c.TabPanel,null,s().createElement(eO,{patientUuid:t,formEntrySub:n})),s().createElement(c.TabPanel,null,s().createElement(e4,{patientUuid:t})),s().createElement(c.TabPanel,null,s().createElement(ts,{patientUuid:t}))))))};var tp=function(e){var n="/ws/rest/v1/kenyaemr/patientSummary?patientUuid=".concat(e),t=(0,E.Ay)(n,r.openmrsFetch),a=t.data,o=(t.mutate,t.error),i=t.isLoading;return{data:(null==a?void 0:a.data)?null==a?void 0:a.data:null,error:o,isLoading:i}},tf=t(45203),t_={};t_.styleTagTransform=C(),t_.setAttributes=A(),t_.insert=m().bind(null,"head"),t_.domAPI=f(),t_.insertStyleElement=b(),d()(tf.A,t_);let th=tf.A&&tf.A.locals?tf.A.locals:void 0;var tm=t(31246),tg={};tg.styleTagTransform=C(),tg.setAttributes=A(),tg.insert=m().bind(null,"head"),tg.domAPI=f(),tg.insertStyleElement=b(),d()(tm.A,tg);let tA=tm.A&&tm.A.locals?tm.A.locals:void 0,ty=function(e){var n=e.items,t=(0,l.useTranslation)().t,a=function(e){if(e.isDate)return e.value?(0,r.formatDate)(new Date(e.value),{noToday:!0}):"--";if(e.isGender)switch(e.value){case"F":return"Female";case"M":return"Male";default:return"Unknown"}return e.isNone?"N/A"===e.value||""===e.value?"None":e.value:e.value||"--"};return s().createElement("div",{className:tA.container},n.map(function(e,n){return s().createElement("div",{key:"".concat(e.label,"-").concat(n),className:tA.content},s().createElement("p",{className:tA.label},t(e.label,e.label)),s().createElement("p",null,s().createElement("span",{className:tA.value},a(e))))}))};function tb(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function tv(e){if(Array.isArray(e))return tb(e)}function tC(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function t$(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function tw(e){return tv(e)||tC(e)||tk(e)||t$()}function tk(e,n){if(e){if("string"==typeof e)return tb(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return tb(e,n)}}function tE(e){return e?e.replace(/\b\w/g,function(e){return e.toUpperCase()}):""}let tx=function(e){var n,t,a,o,i,c,u,d,p,f,h,m,g,A,y,b,v,C=e.data,$=(0,l.useTranslation)().t,w=(0,r.useSession)();return s().createElement(s().Fragment,null,s().createElement(ty,{items:[{label:$("reportDate","Report Date"),value:null==C?void 0:C.reportDate,isDate:!0},{label:$("clinicName","Clinic Name"),value:null==C?void 0:C.clinicName},{label:$("mflCode","MFL Code"),value:null==C?void 0:C.mflCode}]}),s().createElement(ty,{items:[{label:$("uniquePatientIdentifier","Unique Patient Identifier"),value:null==C?void 0:C.uniquePatientIdentifier},{label:$("nationalUniquePatientIdentifier","National Unique Patient Identifier"),value:null==C?void 0:C.nationalUniquePatientIdentifier},{label:$("patientName","Patient Name"),value:tE(null==C?void 0:C.patientName)}]}),s().createElement(ty,{items:[{label:$("birthDate","Birth Date"),value:null==C?void 0:C.birthDate,isDate:!0},{label:$("age","Age"),value:null==C?void 0:C.age},{label:$("gender","Gender"),value:null==C?void 0:C.gender,isGender:!0}]}),s().createElement(ty,{items:[{label:$("maritalStatus","Marital Status"),value:null==C?void 0:C.maritalStatus}]}),s().createElement("div",{className:tA.divider}),s().createElement(ty,{items:[{label:$("dateConfirmedPositive","Date Confirmed Positive"),value:null==C?void 0:C.dateConfirmedHIVPositive,isDate:!0},{label:$("firstCD4","First CD4"),value:null==C?void 0:C.firstCd4},{label:$("dateFirstCD4","Date First CD4"),value:null==C?void 0:C.firstCd4Date,isNone:!0}]}),s().createElement(ty,{items:[{label:$("dateEnrolledToCare","Date Enrolled to Care"),value:null==C?void 0:C.dateEnrolledIntoCare,isDate:!0},{label:$("whoAtEnrollment","WHO at Enrollment"),value:null==C?void 0:C.whoStagingAtEnrollment},{label:$("transferInDate","Transfer In Date"),value:null==C?void 0:C.transferInDate,isNone:!0}]}),s().createElement(ty,{items:[{label:$("entryPoint","Entry Point"),value:null==C?void 0:C.patientEntryPoint},{label:$("dateOfEntryPoint","Date of Entry Point"),value:null==C?void 0:C.patientEntryPointDate,isDate:!0},{label:$("facilityTransferredFrom","Facility Transferred From"),value:null==C?void 0:C.transferInFacility}]}),s().createElement("div",{className:tA.divider}),s().createElement(ty,{items:[{label:$("weight","Weight"),value:null==C?void 0:C.weight},{label:$("height","Height"),value:null==C?void 0:C.height},{label:$("bmi","BMI"),value:null==C?void 0:C.bmi}]}),s().createElement(ty,{items:[{label:$("bloodPressure","Blood Pressure"),value:(null==C?void 0:C.bloodPressure)&&(null==C?void 0:C.bpDiastolic)?"".concat(null==C?void 0:C.bloodPressure,"/").concat(null==C?void 0:C.bpDiastolic):null},{label:$("oxygenSaturation","Oxygen Saturation"),value:null==C?void 0:C.oxygenSaturation},{label:$("respiratoryRate","Respiratory Rate"),value:null==C?void 0:C.respiratoryRate}]}),s().createElement(ty,{items:[{label:$("pulseRate","Pulse Rate"),value:null==C?void 0:C.pulseRate},{label:$("familyProtection","Family Protection"),value:null==C?void 0:C.familyProtection},{label:$("tbScreeningOutcome","TB Screening Outcome"),value:null==C?void 0:C.tbScreeningOutcome}]}),s().createElement(ty,{items:[{label:"chronicDisease",value:null==C?void 0:C.chronicDisease},{label:"ioHistory",value:null==C?void 0:C.iosResults},{label:"stiScreeningOutcome",value:null==C?void 0:C.stiScreeningOutcome}]}),s().createElement(ty,{items:tw((null==C?void 0:C.gender)==="F"?[{label:$("caxcScreeningOutcome","CAXC Screening Outcome"),value:null==C?void 0:C.caxcScreeningOutcome}]:[]).concat([{label:$("dateEnrolledInTb","Date Enrolled in TB"),value:null==C?void 0:C.dateEnrolledInTb,isNone:!0},{label:$("dateCompletedInTb","Date Completed in TB"),value:null==C?void 0:C.dateCompletedInTb,isNone:!0}],tw((null==C?void 0:C.gender)==="F"?[{label:$("lmp","LMP"),value:null==C?void 0:C.lmp,isDate:!0}]:[]))}),s().createElement("div",{className:tA.divider}),s().createElement(ty,{items:[{label:$("treatmentSupporterName","Treatment Supporter Name"),value:tE(null==C?void 0:C.nameOfTreatmentSupporter)},{label:$("treatmentSupporterRelationship","Treatment Supporter Relationship"),value:null==C?void 0:C.relationshipToTreatmentSupporter},{label:$("treatmentSupporterContact","Treatment Supporter Contact"),value:null==C?void 0:C.contactOfTreatmentSupporter}]}),s().createElement("div",{className:tA.divider}),s().createElement(ty,{items:[{label:$("drugAllergies","Drug Allergies"),value:null==C?void 0:C.allergies}]}),s().createElement("div",{className:tA.divider}),s().createElement(ty,{items:[{label:$("previousART","Previous ART"),value:null==C?void 0:C.previousArtStatus},{label:$("dateStartedART","Date Started ART"),value:null==C?void 0:C.dateStartedArt,isDate:!0},{label:$("clinicalStageART","Clinical Stage ART"),value:null==C?void 0:C.whoStageAtArtStart}]}),s().createElement(ty,{items:[{label:$("purposeDrugs","Purpose Drugs"),value:null==C?void 0:C.purposeDrugs},{label:$("purposeDate","Purpose Date"),value:null==C?void 0:C.purposeDate,isDate:!0},{label:$("cd4AtArtStart","CD4 at ART Start"),value:null==C?void 0:C.cd4AtArtStart}]}),s().createElement(ty,{items:[{label:$("initialRegimen","Initial Regimen"),value:null==C||null==(n=C.firstRegimen)?void 0:n.regimenShortDisplay},{label:$("initialRegimenDate","Initial Regimen Date"),value:null==C||null==(t=C.firstRegimen)?void 0:t.startDate},{label:$("currentArtRegimen","Current ART Regimen"),value:null==C||null==(a=C.currentArtRegimen)?void 0:a.regimenShortDisplay},{label:$("currentArtRegimenDate","Current ART Regimen Date"),value:null==C||null==(o=C.currentArtRegimen)?void 0:o.startDate,isDate:!0}]}),s().createElement("div",{className:tA.divider}),s().createElement(ty,{items:[{label:$("artInterruptionReason","ART Interruption Reason"),value:"--"},{label:$("substitutionWithin1stLineRegimen","Substitution Within 1st Line Regimen"),value:"--"},{label:$("switchTo2ndLineRegimen","Switch to 2nd Line Regimen"),value:"--"}]}),s().createElement(ty,{items:[{label:$("dapsone","Dapsone"),value:null==C?void 0:C.dapsone},{label:$("tpt","TPT"),value:(null==C||null==(c=C.clinicsEnrolled)||null==(i=c.toLowerCase().split(",").map(function(e){return e.trim()}))?void 0:i.includes("tpt"))?"Yes":"No"},{label:$("clinicsEnrolled","Clinics Enrolled"),value:null==C?void 0:C.clinicsEnrolled}]}),s().createElement(ty,{items:[{label:$("transferOutDate","Transfer Out Date"),value:null==C?void 0:C.transferOutDate,isNone:!0},{label:$("transferOutFacility","Transfer Out Facility"),value:null==C?void 0:C.transferOutFacility},{label:$("deathDate","Death Date"),value:null==C?void 0:C.deathDate,isNone:!0}]}),s().createElement(ty,{items:[{label:$("mostRecentCD4","Most Recent CD4"),value:null==C?void 0:C.mostRecentCd4},{label:$("mostRecentVL","Most Recent VL"),value:null==C?void 0:C.viralLoadValue},{label:$("nextAppointmentDate","Next Appointment Date"),value:null==C?void 0:C.nextAppointmentDate,isDate:!0}]}),s().createElement("div",{className:tA.container},s().createElement("div",{className:tA.content},s().createElement("p",{className:tA.label},$("viralLoadTrends","Viral load trends")),(null==C||null==(d=C.allVlResults)||null==(u=d.value)?void 0:u.length)>0?null==C||null==(f=C.allVlResults)||null==(p=f.value)?void 0:p.map(function(e,n){return s().createElement("div",{key:"vl-".concat(n)},s().createElement("span",{className:tA.value}," ",e.vl," "),(null==e?void 0:e.vlDate)==="N/A"||(null==e?void 0:e.vlDate)===""?s().createElement("span",null,"None"):s().createElement("span",null,"(",(null==e?void 0:e.vlDate)?null==e?void 0:e.vlDate:"--",")"),s().createElement("br",null))}):"--"),s().createElement("div",{className:tA.content},s().createElement("p",{className:tA.label},$("cd4Trends","CD4 Trends")),(null==C||null==(h=C.allCd4CountResults)?void 0:h.length)>0?null==C||null==(m=C.allCd4CountResults)?void 0:m.map(function(e,n){return s().createElement("div",{key:"cd4Trend-".concat(null==e?void 0:e.cd4Count,"-").concat(n)},s().createElement("span",{className:tA.value},null==e?void 0:e.cd4Count),(null==e?void 0:e.cd4Count)==="N/A"||(null==e?void 0:e.cd4Count)===""?s().createElement("span",null,"None"):s().createElement("span",null,"( ",(null==e?void 0:e.cd4CountDate)?null==e?void 0:e.cd4CountDate:"--",")"),s().createElement("br",null))}):"--")),s().createElement("div",{className:tA.divider}),s().createElement(ty,{items:[{label:$("clinicalNotes","Clinical Notes"),value:null!=(v=null==C?void 0:C.clinicalNotes)?v:"--"},{label:$("clinicianName","Clinician Name"),value:null==w||null==(A=w.user)||null==(g=A.person)?void 0:g.display},{label:$("clinicianSignature","Clinician Signature"),value:null==w||null==(b=w.user)||null==(y=b.person)?void 0:y.display}]}))},tD=s().forwardRef(function(e,n){var t=e.data,a=(0,r.useConfig)().logo;return s().createElement("div",{ref:n,className:th.printPage},(null==a?void 0:a.src)&&s().createElement("img",{src:a.src,alt:a.alt||"Logo",width:110,height:40}),s().createElement("div",{className:th.bodyContainer},s().createElement("div",{className:th.card},s().createElement(tx,{data:t}))))});var tS=t(95795);function tz(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function tB(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){tz(e,n,t[n])})}return e}let tM=function(e){var n=e.onPrint,t=e.printMode,a=(0,l.useTranslation)().t,o="tablet"==(0,r.useLayoutType)();return s().createElement("div",{className:o?tA.tabletHeading:tA.desktopHeading},s().createElement("h4",{className:tA.title},a("patientSummary","Patient summary")),!1===t&&s().createElement(c.Button,{size:"sm",className:tA.btnShow,onClick:n,kind:"tertiary",renderIcon:function(e){return s().createElement(tS.xj,tB({size:16},e))},iconDescription:a("print","Print")},a("print","Print")))};function tT(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function tO(e){if(Array.isArray(e))return e}function tN(e,n,t,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){t(e);return}s.done?n(l):Promise.resolve(l).then(r,a)}function tP(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function i(e){tN(o,r,a,i,s,"next",e)}function s(e){tN(o,r,a,i,s,"throw",e)}i(void 0)})}}function tI(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function tF(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function tR(e,n){return tO(e)||tI(e,n)||tH(e,n)||tF()}function tH(e,n){if(e){if("string"==typeof e)return tT(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return tT(e,n)}}function tL(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(n){return l([e,n])}}function l(s){if(t)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],r=0}finally{t=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}let tj=function(e){var n=e.patientUuid,t=(0,l.useTranslation)().t,r=tp(n),a=r.data,o=r.error,u=r.isLoading,d=(0,i.useRef)(null),p=tR((0,i.useState)(!1),2),f=p[0],h=p[1],m=(0,i.useCallback)(function(){return tP(function(){var e,n;return tL(this,function(t){try{d.current&&(e=window.open("","_blank"))&&(n=d.current.innerHTML,e.document.documentElement.innerHTML=n,e.focus(),e.print(),e.close())}catch(e){console.error("Print error:",e),window.print()}return[2]})})()},[]),g=function(){h(!0)};return((0,i.useEffect)(function(){f&&d.current&&setTimeout(function(){m(),h(!1)},100)},[f,m]),u)?s().createElement(c.StructuredListSkeleton,null):o?s().createElement("span",null,t("errorPatientSummary","Error loading patient summary")):a&&0!==Object.keys(a).length?s().createElement(s().Fragment,null,f&&s().createElement("div",{style:{position:"absolute",left:"-9999px"}},s().createElement(tD,{ref:d,data:a})),s().createElement("div",{className:tA.bodyContainer},s().createElement("div",{className:tA.card},s().createElement(tM,{onPrint:g,printMode:!1}),s().createElement(tx,{data:a})))):s().createElement("span",null,t("noPatientSummary","No patient summary available"))};var tq=function(e){var n=new URLSearchParams({code:(0,r.useConfig)().dispensingVitalsConcepts.map(function(e){return e.uuid}).join(","),"subject:Patient":e,_summary:"data",_sort:"-date",_count:"1"}),t="".concat(r.fhirBaseUrl,"/Observation?").concat(n.toString()),a=(0,E.Ay)(t,r.openmrsFetch),o=a.data,s=a.error,l=a.isLoading,c=a.mutate;return{vitals:(0,i.useMemo)(function(){var e,n;return(null!=(n=null==o||null==(e=o.data)?void 0:e.entry)?n:[]).map(function(e){var n,t,a,o,i,s,l;return{display:null==e||null==(t=e.resource)||null==(n=t.code)?void 0:n.text,uuid:null==e||null==(a=e.resource)?void 0:a.id,value:null==e||null==(i=e.resource)||null==(o=i.valueQuantity)?void 0:o.value,dateRecoded:(null==e||null==(s=e.resource)?void 0:s.issued)?(0,r.parseDate)(null==e||null==(l=e.resource)?void 0:l.issued):void 0}})},[o]),isLoading:l,mutate:c,error:s}},tG=t(4929),tV={};tV.styleTagTransform=C(),tV.setAttributes=A(),tV.insert=m().bind(null,"head"),tV.domAPI=f(),tV.insertStyleElement=b(),d()(tG.A,tV);let tU=tG.A&&tG.A.locals?tG.A.locals:void 0,tW=function(e){var n=tq(e.patientUuid),t=n.vitals,r=n.error;return n.isLoading||r||!t.length?null:s().createElement(c.Tile,{className:tU.container},t.map(function(e){return s().createElement("div",null,s().createElement("strong",null,null==e?void 0:e.display,": "),s().createElement("span",null,null==e?void 0:e.value))}))};var tK=t(68622),tZ=function(e){return s().createElement(tK.Jc,e)};function tY(){var e=(0,l.useTranslation)().t,n=function(){(0,r.launchWorkspace)("patient-care-discharge-workspace")};return s().createElement(r.ActionMenuButton,{getIcon:tZ,label:e("discharge","Discharge"),iconDescription:e("discharge","Discharge"),handler:n,type:"ward-patient-discharge"})}var tJ=t(74064),tX=t(78855);function tQ(e,n,t,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){t(e);return}s.done?n(l):Promise.resolve(l).then(r,a)}function t0(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function i(e){tQ(o,r,a,i,s,"next",e)}function s(e){tQ(o,r,a,i,s,"throw",e)}i(void 0)})}}function t1(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(n){return l([e,n])}}function l(s){if(t)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],r=0}finally{t=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}let t2=function(e){var n,t=e.patientUuid,a=e.programUuid,o=e.enrollment,i=e.closeWorkspace,u=e.onSubmitSuccess,d=function(){var e,n,t,r,a;return!(null==o||null==(e=o.location)?void 0:e.uuid)&&(null==p||null==(n=p.sessionLocation)?void 0:n.uuid)?null==p||null==(r=p.sessionLocation)?void 0:r.uuid:null!=(a=null==o||null==(t=o.location)?void 0:t.uuid)?a:null},p=(0,r.useSession)(),f=(0,l.useTranslation)().t,h=ej(a),m=h.isLoading,g=h.error,A=h.program,y=(0,tJ.mN)({resolver:(0,tX.u)(eq),values:{dateEnrolled:new Date,location:null!=(n=d())?n:"",dateCompleted:(null==o?void 0:o.dateCompleted)?new Date(o.dateCompleted):void 0}}),b=function(e){return t0(function(){var n,a;return t1(this,function(s){switch(s.label){case 0:n=new AbortController,s.label=1;case 1:if(s.trys.push([1,6,,7]),!o)return[3,3];return[4,eV(o.uuid,e,n)];case 2:return s.sent(),[3,5];case 3:return[4,eG(A,t,e,n)];case 4:s.sent(),s.label=5;case 5:return(0,r.showSnackbar)({kind:"success",title:"Success",subtitle:f("programEnrollmentSuccessful","Program enrollment successful")}),i(),null==u||u(),[3,7];case 6:return a=s.sent(),(0,r.showSnackbar)({kind:"error",title:"Error",subtitle:null==a?void 0:a.message}),console.error(a),[3,7];case 7:return[2]}})})()};return m?s().createElement(c.InlineLoading,null):g?s().createElement(r.ErrorState,{headerTitle:f("error","Error"),error:g}):s().createElement("form",{className:eY.form,onSubmit:y.handleSubmit(b)},s().createElement(c.Stack,{gap:4,className:eY.grid},s().createElement(c.Column,null,s().createElement(c.TextInput,{readOnly:!0,value:null==A?void 0:A.name,title:f("program","Program"),id:"program",labelText:f("program","Program")})),s().createElement(c.Column,null,s().createElement(tJ.xI,{control:y.control,name:"dateEnrolled",render:function(e){var n=e.field,t=e.fieldState.error;return s().createElement(c.DatePicker,{className:eY.datePickerInput,dateFormat:"d/m/Y",datePickerType:"single",value:n.value,onChange:function(e){var t;return n.onChange(null!=(t=null==e?void 0:e[0])?t:void 0)},invalid:!!(null==t?void 0:t.message),invalidText:null==t?void 0:t.message},s().createElement(c.DatePickerInput,{id:"startdate-input",invalid:!!(null==t?void 0:t.message),invalidText:null==t?void 0:t.message,placeholder:"mm/dd/yyyy",labelText:f("startDate","Start Date"),size:"lg"}))}})),s().createElement(c.Column,null,s().createElement(tJ.xI,{control:y.control,name:"dateCompleted",render:function(e){var n=e.field,t=e.fieldState.error;return s().createElement(c.DatePicker,{className:eY.datePickerInput,dateFormat:"d/m/Y",value:n.value,datePickerType:"single",onChange:function(e){var t;return n.onChange(null!=(t=null==e?void 0:e[0])?t:void 0)},invalid:!!(null==t?void 0:t.message),invalidText:null==t?void 0:t.message},s().createElement(c.DatePickerInput,{id:"endDate",invalid:!!(null==t?void 0:t.message),invalidText:null==t?void 0:t.message,placeholder:"mm/dd/yyyy",labelText:f("endDate","End Date"),size:"lg"}))}})),s().createElement(c.Column,null,s().createElement(tJ.xI,{control:y.control,name:"location",render:function(e){var n,t=e.field,a=t.value,o=t.onChange;return e.fieldState.error,s().createElement(s().Fragment,null,s().createElement(c.FormLabel,{className:"".concat(eY.locationLabel," cds--label")},f("enrollmentLocation","Enrollment location")),s().createElement(r.LocationPicker,{selectedLocationUuid:a,defaultLocationUuid:null==p||null==(n=p.sessionLocation)?void 0:n.uuid,locationTag:"Login Location",onChange:function(e){return o(e)}}))}}))),s().createElement(c.ButtonSet,{className:eY.buttonSet},s().createElement(c.Button,{className:eY.button,kind:"secondary",onClick:function(){return i()}},f("discard","Discard")),s().createElement(c.Button,{className:eY.button,kind:"primary",type:"submit",disabled:y.formState.isSubmitting},f("submit","Submit"))))};function t3(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function t4(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){t3(e,n,t[n])})}return e}function t5(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function t6(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}var t8="@kenyaemr/esm-care-panel-app",t7={featureName:"patient-care-panels",moduleName:t8};t(31437),(0,r.getSyncLifecycle)(td,t7),(0,r.getSyncLifecycle)(na,t7),(0,r.getSyncLifecycle)(eO,t7),(0,r.getSyncLifecycle)(e4,{moduleName:"patient-care-programs",featureName:"care-programs"}),(0,r.getSyncLifecycle)((0,o.bo)(t6(t4({},a),{icon:"omrs-icon-document",moduleName:t8})),t7),(0,r.getSyncLifecycle)(tj,t7),(0,r.getSyncLifecycle)(n2,t7),(0,r.getSyncLifecycle)(tW,t7),(0,r.getSyncLifecycle)(tY,t7),(0,r.getAsyncLifecycle)(function(){return t.e("121").then(t.bind(t,68528))},t7),(0,r.getSyncLifecycle)(t2,t7)},53841:function(e,n,t){"use strict";var r=t(51623),a=t.n(r);function o(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function i(e){if(Array.isArray(e))return e}function s(e){if(Array.isArray(e))return o(e)}function l(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function c(e,n){var t,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,s=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw r}}return o}}function u(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(e,n){return i(e)||c(e,n)||m(e,n)||u()}function f(e){return s(e)||l(e)||m(e)||d()}function h(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function m(e,n){if(e){if("string"==typeof e)return o(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o(e,n)}}var g=[],A={},y="@kenyaemr/esm-care-panel-app",b="version-first";if((t.initializeSharingData||t.initializeExposesData)&&t.federation){var v,C,$,w,k,E,x,D,S,z,B,M,T=function(e,n,t){e&&e[n]&&(e[n]=t)},O=function(e,n,t){var r,a,o,i,s,l,c,u=t();Array.isArray(u)?(null!=(i=(a=e)[o=n])||(a[o]=[]),(r=e[n]).push.apply(r,f(u))):(void 0===u?"undefined":h(u))==="object"&&null!==u&&(null!=(c=(s=e)[l=n])||(s[l]={}),Object.assign(e[n],u))},N=function(e,n,t){var r,a,o;null!=(o=(r=e)[a=n])||(r[a]=t())},P=null!=(D=null==(v=t.remotesLoadingData)?void 0:v.chunkMapping)?D:{},I=null!=(S=null==(C=t.remotesLoadingData)?void 0:C.moduleIdToRemoteDataMapping)?S:{},F=null!=(z=null==($=t.initializeSharingData)?void 0:$.scopeToSharingDataMapping)?z:{},R=null!=(B=null==(w=t.consumesLoadingData)?void 0:w.chunkMapping)?B:{},H=null!=(M=null==(k=t.consumesLoadingData)?void 0:k.moduleIdToConsumeDataMapping)?M:{},L={},j=[],q={},G=null==(E=t.initializeExposesData)?void 0:E.shareScope;for(var V in a())t.federation[V]=a()[V];N(t.federation,"consumesLoadingModuleToHandlerMapping",function(){var e={},n=!0,t=!1,r=void 0;try{for(var a,o=Object.entries(H)[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var i=p(a.value,2),s=i[0],l=i[1];e[s]={getter:l.fallback,shareInfo:{shareConfig:{fixedDependencies:!1,requiredVersion:l.requiredVersion,strictVersion:l.strictVersion,singleton:l.singleton,eager:l.eager},scope:[l.shareScope]},shareKey:l.shareKey}}}catch(e){t=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(t)throw r}}return e}),N(t.federation,"initOptions",function(){return{}}),N(t.federation.initOptions,"name",function(){return y}),N(t.federation.initOptions,"shareStrategy",function(){return b}),N(t.federation.initOptions,"shared",function(){var e={},n=!0,t=!1,r=void 0;try{for(var a,o=Object.entries(F)[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var i=p(a.value,2),s=i[0],l=i[1],c=!0,u=!1,d=void 0;try{for(var f,m=l[Symbol.iterator]();!(c=(f=m.next()).done);c=!0){var g=f.value;if((void 0===g?"undefined":h(g))==="object"&&null!==g){var A=g.name,y=g.version,b=g.factory,v=g.eager,C=g.singleton,$=g.requiredVersion,w=g.strictVersion,k={},E=function(e){return void 0!==e};E(C)&&(k.singleton=C),E($)&&(k.requiredVersion=$),E(v)&&(k.eager=v),E(w)&&(k.strictVersion=w);var x={version:y,scope:[s],shareConfig:k,get:b};e[A]?e[A].push(x):e[A]=[x]}}}catch(e){u=!0,d=e}finally{try{c||null==m.return||m.return()}finally{if(u)throw d}}}}catch(e){t=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(t)throw r}}return e}),O(t.federation.initOptions,"remotes",function(){return Object.values(A).flat().filter(function(e){return"script"===e.externalType})}),O(t.federation.initOptions,"plugins",function(){return g}),N(t.federation,"bundlerRuntimeOptions",function(){return{}}),N(t.federation.bundlerRuntimeOptions,"remotes",function(){return{}}),N(t.federation.bundlerRuntimeOptions.remotes,"chunkMapping",function(){return P}),N(t.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",function(){var e={},n=!0,t=!1,r=void 0;try{for(var a,o=Object.entries(I)[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var i=p(a.value,2),s=i[0],l=i[1];e[s]=[l.shareScope,l.name,l.externalModuleId,l.remoteName]}}catch(e){t=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(t)throw r}}return e}),N(t.federation.bundlerRuntimeOptions.remotes,"webpackRequire",function(){return t}),O(t.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",function(){var e={},n=!0,t=!1,r=void 0;try{for(var a,o=Object.entries(I)[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var i=p(a.value,2),s=i[0],l=A[i[1].remoteName];l&&(e[s]=l)}}catch(e){t=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(t)throw r}}return e}),T(t,"S",t.federation.bundlerRuntime.S),t.federation.attachShareScopeMap&&t.federation.attachShareScopeMap(t),T(t.f,"remotes",function(e,n){return t.federation.bundlerRuntime.remotes({chunkId:e,promises:n,chunkMapping:P,idToExternalAndNameMapping:t.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:t.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:t})}),T(t.f,"consumes",function(e,n){return t.federation.bundlerRuntime.consumes({chunkId:e,promises:n,chunkMapping:R,moduleToHandlerMapping:t.federation.consumesLoadingModuleToHandlerMapping,installedModules:L,webpackRequire:t})}),T(t,"I",function(e,n){return t.federation.bundlerRuntime.I({shareScopeName:e,initScope:n,initPromises:j,initTokens:q,webpackRequire:t})}),T(t,"initContainer",function(e,n,r){return t.federation.bundlerRuntime.initContainerEntry({shareScope:e,initScope:n,remoteEntryInitOptions:r,shareScopeKey:G,webpackRequire:t})}),T(t,"getContainer",function(e,n){var r=t.initializeExposesData.moduleMap;return t.R=n,n=Object.prototype.hasOwnProperty.call(r,e)?r[e]():Promise.resolve().then(function(){throw Error('Module "'+e+'" does not exist in container.')}),t.R=void 0,n}),t.federation.instance=t.federation.runtime.init(t.federation.initOptions),(null==(x=t.consumesLoadingData)?void 0:x.initialConsumes)&&t.federation.bundlerRuntime.installInitialConsumes({webpackRequire:t,installedModules:L,initialConsumes:t.consumesLoadingData.initialConsumes,moduleToHandlerMapping:t.federation.consumesLoadingModuleToHandlerMapping})}},93296:function(e,n,t){"use strict";var r=t(35400);function a(e,n){return e===n&&(0!==e||1/e==1/n)||e!=e&&n!=n}var o="function"==typeof Object.is?Object.is:a,i=r.useState,s=r.useEffect,l=r.useLayoutEffect,c=r.useDebugValue;function u(e,n){var t=n(),r=i({inst:{value:t,getSnapshot:n}}),a=r[0].inst,o=r[1];return l(function(){a.value=t,a.getSnapshot=n,d(a)&&o({inst:a})},[e,t,n]),s(function(){return d(a)&&o({inst:a}),e(function(){d(a)&&o({inst:a})})},[e]),c(t),t}function d(e){var n=e.getSnapshot;e=e.value;try{var t=n();return!o(e,t)}catch(e){return!0}}function p(e,n){return n()}var f="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?p:u;n.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:f},58139:function(e,n,t){"use strict";e.exports=t(93296)},99780:function(e,n,t){"use strict";let r;t.d(n,{A:()=>c});let a="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),o=new Uint8Array(16);function i(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}let s=[];for(let e=0;e<256;++e)s.push((e+256).toString(16).slice(1));function l(e,n=0){return s[e[n+0]]+s[e[n+1]]+s[e[n+2]]+s[e[n+3]]+"-"+s[e[n+4]]+s[e[n+5]]+"-"+s[e[n+6]]+s[e[n+7]]+"-"+s[e[n+8]]+s[e[n+9]]+"-"+s[e[n+10]]+s[e[n+11]]+s[e[n+12]]+s[e[n+13]]+s[e[n+14]]+s[e[n+15]]}let c=function(e,n,t){if(a&&!n&&!e)return a();let r=(e=e||{}).random||(e.rng||i)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,n){t=t||0;for(let e=0;e<16;++e)n[t+e]=r[e];return n}return l(r)}},31437:function(e,n,t){var r={"./en.json":["41066","127"],"./sw.json":["23987","40"],"./am.json":["82735","916"]};function a(e){if(!t.o(r,e))return Promise.resolve().then(function(){var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n});var n=r[e],a=n[0];return t.e(n[1]).then(function(){return t(a)})}a.keys=()=>Object.keys(r),a.id=31437,e.exports=a},94106:function(e,n,t){"use strict";var r=t(44054),a=t(16742),o=t(63767);let i="[ Federation Runtime ]",s=a.createLogger(i);function l(e,n){e||c(n)}function c(e){if(e instanceof Error)throw e.message.startsWith(i)||(e.message=`${i}: ${e.message}`),e;throw Error(`${i}: ${e}`)}function u(e){e instanceof Error&&(e.message.startsWith(i)||(e.message=`${i}: ${e.message}`)),s.warn(e)}function d(e,n){return -1===e.findIndex(e=>e===n)&&e.push(n),e}function p(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function f(e){return void 0!==e.entry}function h(e){return!e.entry.includes(".json")}async function m(e,n){try{return await e()}catch(e){n||u(e);return}}function g(e){return e&&"object"==typeof e}let A=Object.prototype.toString;function y(e){return"[object Object]"===A.call(e)}function b(e,n){let t=/^(https?:)?\/\//i;return e.replace(t,"").replace(/\/$/,"")===n.replace(t,"").replace(/\/$/,"")}function v(e){return Array.isArray(e)?e:[e]}function C(e){let n={url:"",type:"global",globalName:""};return a.isBrowserEnv()||a.isReactNativeEnv()?"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:n:"ssrRemoteEntry"in e?{url:e.ssrRemoteEntry||n.url,type:e.ssrRemoteEntryType||n.type,globalName:e.globalName}:n}let $=(e,n)=>{let t;return t=e.endsWith("/")?e.slice(0,-1):e,n.startsWith(".")&&(n=n.slice(1)),t+=n},w="object"==typeof globalThis?globalThis:window,k=(()=>{try{return document.defaultView}catch(e){return w}})(),E=k;function x(e,n,t){Object.defineProperty(e,n,{value:t,configurable:!1,writable:!0})}function D(e,n){return Object.hasOwnProperty.call(e,n)}D(w,"__GLOBAL_LOADING_REMOTE_ENTRY__")||x(w,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});let S=w.__GLOBAL_LOADING_REMOTE_ENTRY__;function z(e){var n,t,r,a,o,i,s,l,c,u,d,p;D(e,"__VMOK__")&&!D(e,"__FEDERATION__")&&x(e,"__FEDERATION__",e.__VMOK__),D(e,"__FEDERATION__")||(x(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),x(e,"__VMOK__",e.__FEDERATION__)),null!=(s=(n=e.__FEDERATION__).__GLOBAL_PLUGIN__)||(n.__GLOBAL_PLUGIN__=[]),null!=(l=(t=e.__FEDERATION__).__INSTANCES__)||(t.__INSTANCES__=[]),null!=(c=(r=e.__FEDERATION__).moduleInfo)||(r.moduleInfo={}),null!=(u=(a=e.__FEDERATION__).__SHARE__)||(a.__SHARE__={}),null!=(d=(o=e.__FEDERATION__).__MANIFEST_LOADING__)||(o.__MANIFEST_LOADING__={}),null!=(p=(i=e.__FEDERATION__).__PRELOADED_MAP__)||(i.__PRELOADED_MAP__=new Map)}function B(){w.__FEDERATION__.__GLOBAL_PLUGIN__=[],w.__FEDERATION__.__INSTANCES__=[],w.__FEDERATION__.moduleInfo={},w.__FEDERATION__.__SHARE__={},w.__FEDERATION__.__MANIFEST_LOADING__={},Object.keys(S).forEach(e=>{delete S[e]})}function M(e){w.__FEDERATION__.__INSTANCES__.push(e)}function T(){return w.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function O(e,n=a.isDebugMode()){n&&(w.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,w.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.18.0")}function N(e,n){if("string"==typeof n){if(e[n])return{value:e[n],key:n};for(let t of Object.keys(e)){let[r,a]=t.split(":"),o=`${r}:${n}`,i=e[o];if(i)return{value:i,key:o}}return{value:void 0,key:n}}throw Error("key must be string")}z(w),z(k);let P=()=>k.__FEDERATION__.moduleInfo,I=(e,n)=>{let t=N(n,p(e)).value;if(t&&!t.version&&"version"in e&&e.version&&(t.version=e.version),t)return t;if("version"in e&&e.version){let{version:n}=e,t=p(r._object_without_properties_loose(e,["version"])),a=N(k.__FEDERATION__.moduleInfo,t).value;if((null==a?void 0:a.version)===n)return a}},F=e=>I(e,k.__FEDERATION__.moduleInfo),R=(e,n)=>{let t=p(e);return k.__FEDERATION__.moduleInfo[t]=n,k.__FEDERATION__.moduleInfo},H=e=>(k.__FEDERATION__.moduleInfo=r._extends({},k.__FEDERATION__.moduleInfo,e),()=>{for(let n of Object.keys(e))delete k.__FEDERATION__.moduleInfo[n]}),L=(e,n)=>{let t=n||`__FEDERATION_${e}:custom__`,r=w[t];return{remoteEntryKey:t,entryExports:r}},j=e=>{let{__GLOBAL_PLUGIN__:n}=k.__FEDERATION__;e.forEach(e=>{-1===n.findIndex(n=>n.name===e.name)?n.push(e):u(`The plugin ${e.name} has been registered.`)})},q=()=>k.__FEDERATION__.__GLOBAL_PLUGIN__,G=e=>w.__FEDERATION__.__PRELOADED_MAP__.get(e),V=e=>w.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),U="default",W="global",K="[0-9A-Za-z-]+",Z=`(?:\\+(${K}(?:\\.${K})*))`,Y="0|[1-9]\\d*",J="[0-9]+",X="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Q=`(?:${J}|${X})`,ee=`(?:-?(${Q}(?:\\.${Q})*))`,en=`(?:${Y}|${X})`,et=`(?:-(${en}(?:\\.${en})*))`,er=`${Y}|x|X|\\*`,ea=`[v=\\s]*(${er})(?:\\.(${er})(?:\\.(${er})(?:${et})?${Z}?)?)?`,eo=`^\\s*(${ea})\\s+-\\s+(${ea})\\s*$`,ei=`(${J})\\.(${J})\\.(${J})`,es=`[v=\\s]*${ei}${ee}?${Z}?`,el="((?:<|>)?=?)",ec=`(\\s*)${el}\\s*(${es}|${ea})`,eu="(?:~>?)",ed=`(\\s*)${eu}\\s+`,ep="(?:\\^)",ef=`(\\s*)${ep}\\s+`,e_="(<|>)?=?\\s*\\*",eh=`^${ep}${ea}$`,em=`(${Y})\\.(${Y})\\.(${Y})`,eg=`v?${em}${et}?${Z}?`,eA=`^${eu}${ea}$`,ey=`^${el}\\s*${ea}$`,eb=`^${el}\\s*(${eg})$|^$`,ev="^\\s*>=\\s*0.0.0\\s*$";function eC(e){return new RegExp(e)}function e$(e){return!e||"x"===e.toLowerCase()||"*"===e}function ew(...e){return n=>e.reduce((e,n)=>n(e),n)}function ek(e){return e.match(eC(eb))}function eE(e,n,t,r){let a=`${e}.${n}.${t}`;return r?`${a}-${r}`:a}function ex(e){return e.replace(eC(eo),(e,n,t,r,a,o,i,s,l,c,u,d)=>(n=e$(t)?"":e$(r)?`>=${t}.0.0`:e$(a)?`>=${t}.${r}.0`:`>=${n}`,s=e$(l)?"":e$(c)?`<${Number(l)+1}.0.0-0`:e$(u)?`<${l}.${Number(c)+1}.0-0`:d?`<=${l}.${c}.${u}-${d}`:`<=${s}`,`${n} ${s}`.trim()))}function eD(e){return e.replace(eC(ec),"$1$2$3")}function eS(e){return e.replace(eC(ed),"$1~")}function ez(e){return e.replace(eC(ef),"$1^")}function eB(e){return e.trim().split(/\s+/).map(e=>e.replace(eC(eh),(e,n,t,r,a)=>{if(e$(n))return"";if(e$(t))return`>=${n}.0.0 <${Number(n)+1}.0.0-0`;if(e$(r))if("0"===n)return`>=${n}.${t}.0 <${n}.${Number(t)+1}.0-0`;else return`>=${n}.${t}.0 <${Number(n)+1}.0.0-0`;if(a)if("0"!==n)return`>=${n}.${t}.${r}-${a} <${Number(n)+1}.0.0-0`;else if("0"===t)return`>=${n}.${t}.${r}-${a} <${n}.${t}.${Number(r)+1}-0`;else return`>=${n}.${t}.${r}-${a} <${n}.${Number(t)+1}.0-0`;if("0"===n)if("0"===t)return`>=${n}.${t}.${r} <${n}.${t}.${Number(r)+1}-0`;else return`>=${n}.${t}.${r} <${n}.${Number(t)+1}.0-0`;return`>=${n}.${t}.${r} <${Number(n)+1}.0.0-0`})).join(" ")}function eM(e){return e.trim().split(/\s+/).map(e=>e.replace(eC(eA),(e,n,t,r,a)=>e$(n)?"":e$(t)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:e$(r)?`>=${n}.${t}.0 <${n}.${Number(t)+1}.0-0`:a?`>=${n}.${t}.${r}-${a} <${n}.${Number(t)+1}.0-0`:`>=${n}.${t}.${r} <${n}.${Number(t)+1}.0-0`)).join(" ")}function eT(e){return e.split(/\s+/).map(e=>e.trim().replace(eC(ey),(e,n,t,r,a,o)=>{let i=e$(t),s=i||e$(r),l=s||e$(a);if("="===n&&l&&(n=""),o="",i)if(">"===n||"<"===n)return"<0.0.0-0";else return"*";return n&&l?(s&&(r=0),a=0,">"===n?(n=">=",s?(t=Number(t)+1,r=0):r=Number(r)+1,a=0):"<="===n&&(n="<",s?t=Number(t)+1:r=Number(r)+1),"<"===n&&(o="-0"),`${n+t}.${r}.${a}${o}`):s?`>=${t}.0.0${o} <${Number(t)+1}.0.0-0`:l?`>=${t}.${r}.0${o} <${t}.${Number(r)+1}.0-0`:e})).join(" ")}function eO(e){return e.trim().replace(eC(e_),"")}function eN(e){return e.trim().replace(eC(ev),"")}function eP(e,n){return(e=Number(e)||e)>(n=Number(n)||n)?1:e===n?0:-1}function eI(e,n){let{preRelease:t}=e,{preRelease:r}=n;if(void 0===t&&r)return 1;if(t&&void 0===r)return -1;if(void 0===t&&void 0===r)return 0;for(let e=0,n=t.length;e<=n;e++){let n=t[e],a=r[e];if(n!==a){if(void 0===n&&void 0===a)return 0;if(!n)return 1;if(!a)return -1;return eP(n,a)}}return 0}function eF(e,n){return eP(e.major,n.major)||eP(e.minor,n.minor)||eP(e.patch,n.patch)||eI(e,n)}function eR(e,n){return e.version===n.version}function eH(e,n){switch(e.operator){case"":case"=":return eR(e,n);case">":return 0>eF(e,n);case">=":return eR(e,n)||0>eF(e,n);case"<":return eF(e,n)>0;case"<=":return eR(e,n)||eF(e,n)>0;case void 0:return!0;default:return!1}}function eL(e){return ew(eB,eM,eT,eO)(e)}function ej(e){return ew(ex,eD,eS,ez)(e.trim()).split(/\s+/).join(" ")}function eq(e,n){if(!e)return!1;let t=ek(e);if(!t)return!1;let[,r,,a,o,i,s]=t,l={operator:r,version:eE(a,o,i,s),major:a,minor:o,patch:i,preRelease:null==s?void 0:s.split(".")};for(let e of n.split("||")){let n=e.trim();if(!n||"*"===n||"x"===n)return!0;try{let e=ej(n);if(!e.trim())return!0;let t=e.split(" ").map(e=>eL(e)).join(" ");if(!t.trim())return!0;let r=t.split(/\s+/).map(e=>eN(e)).filter(Boolean);if(0===r.length)continue;let a=!0;for(let e of r){let n=ek(e);if(!n){a=!1;break}let[,t,,r,o,i,s]=n,c={operator:t,version:eE(r,o,i,s),major:r,minor:o,patch:i,preRelease:null==s?void 0:s.split(".")};if(!eH(c,l)){a=!1;break}}if(a)return!0}catch(e){console.error(`[semver] Error processing range part "${n}":`,e);continue}}return!1}function eG(e,n,t,a){var o,i,s;let l;return l="get"in e?e.get:"lib"in e?()=>Promise.resolve(e.lib):()=>Promise.resolve(()=>{throw Error(`Can not get shared '${t}'!`)}),r._extends({deps:[],useIn:[],from:n,loading:null},e,{shareConfig:r._extends({requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1},e.shareConfig),get:l,loaded:null!=e&&!!e.loaded||"lib"in e||void 0,version:null!=(o=e.version)?o:"0",scope:Array.isArray(e.scope)?e.scope:[null!=(i=e.scope)?i:"default"],strategy:(null!=(s=e.strategy)?s:a)||"version-first"})}function eV(e,n){let t=n.shared||{},a=n.name,o=Object.keys(t).reduce((e,r)=>{let o=v(t[r]);return e[r]=e[r]||[],o.forEach(t=>{e[r].push(eG(t,a,r,n.shareStrategy))}),e},{}),i=r._extends({},e.shared);return Object.keys(o).forEach(e=>{i[e]?o[e].forEach(n=>{i[e].find(e=>e.version===n.version)||i[e].push(n)}):i[e]=o[e]}),{shared:i,shareInfos:o}}function eU(e,n){let t=e=>{if(!Number.isNaN(Number(e))){let n=e.split("."),t=e;for(let e=0;e<3-n.length;e++)t+=".0";return t}return e};return!!eq(t(e),`<=${t(n)}`)}let eW=(e,n)=>{let t=n||function(e,n){return eU(e,n)};return Object.keys(e).reduce((e,n)=>!e||t(e,n)||"0"===e?n:e,0)},eK=e=>!!e.loaded||"function"==typeof e.lib,eZ=e=>!!e.loading;function eY(e,n,t){let r=e[n][t],a=function(e,n){return!eK(r[e])&&eU(e,n)};return eW(e[n][t],a)}function eJ(e,n,t){let r=e[n][t],a=function(e,n){let t=e=>eK(e)||eZ(e);if(t(r[n]))if(t(r[e]))return!!eU(e,n);else return!0;return!t(r[e])&&eU(e,n)};return eW(e[n][t],a)}function eX(e){return"loaded-first"===e?eJ:eY}function eQ(e,n,t,r){if(!e)return;let{shareConfig:a,scope:o=U,strategy:i}=t;for(let s of Array.isArray(o)?o:[o])if(a&&e[s]&&e[s][n]){let{requiredVersion:o}=a,l=eX(i)(e,s,n),d=()=>{if(a.singleton){if("string"==typeof o&&!eq(l,o)){let r=`Version ${l} from ${l&&e[s][n][l].from} of shared singleton module ${n} does not satisfy the requirement of ${t.from} which needs ${o})`;a.strictVersion?c(r):u(r)}return e[s][n][l]}if(!1===o||"*"===o||eq(l,o))return e[s][n][l];for(let[t,r]of Object.entries(e[s][n]))if(eq(t,o))return r},p={shareScopeMap:e,scope:s,pkgName:n,version:l,GlobalFederation:E.__FEDERATION__,resolver:d};return(r.emit(p)||p).resolver()}}function e0(){return E.__FEDERATION__.__SHARE__}function e1(e){var n;let{pkgName:t,extraOptions:r,shareInfos:a}=e,o=e=>{if(!e)return;let n={};e.forEach(e=>{n[e.version]=e});let t=function(e,t){return!eK(n[e])&&eU(e,t)},r=eW(n,t);return n[r]};return Object.assign({},(null!=(n=null==r?void 0:r.resolver)?n:o)(a[t]),null==r?void 0:r.customShareInfo)}function e2(){return"undefined"!=typeof FEDERATION_BUILD_IDENTIFIER?FEDERATION_BUILD_IDENTIFIER:""}function e3(e,n){for(let t of e){let e=n.startsWith(t.name),r=n.replace(t.name,"");if(e){if(r.startsWith("/"))return{pkgNameOrAlias:t.name,expose:r=`.${r}`,remote:t};else if(""===r)return{pkgNameOrAlias:t.name,expose:".",remote:t}}let a=t.alias&&n.startsWith(t.alias),o=t.alias&&n.replace(t.alias,"");if(t.alias&&a){if(o&&o.startsWith("/"))return{pkgNameOrAlias:t.alias,expose:o=`.${o}`,remote:t};else if(""===o)return{pkgNameOrAlias:t.alias,expose:".",remote:t}}}}function e4(e,n){for(let t of e)if(n===t.name||t.alias&&n===t.alias)return t}function e5(e,n){let t=q(),r=[n.hooks,n.remoteHandler.hooks,n.sharedHandler.hooks,n.snapshotHandler.hooks,n.loaderHook,n.bridgeHook];return t.length>0&&t.forEach(n=>{(null==e?void 0:e.find(e=>e.name!==n.name))&&e.push(n)}),e&&e.length>0&&e.forEach(e=>{r.forEach(t=>{t.applyPlugin(e,n)})}),e}let e6=".then(callbacks[0]).catch(callbacks[1])";async function e8({entry:e,remoteEntryExports:n}){return new Promise((t,r)=>{try{n?t(n):"undefined"!=typeof FEDERATION_ALLOW_NEW_FUNCTION?Function("callbacks",`import("${e}")${e6}`)([t,r]):import(e).then(t).catch(r)}catch(e){r(e)}})}async function e7({entry:e,remoteEntryExports:n}){return new Promise((t,r)=>{try{n?t(n):Function("callbacks",`System.import("${e}")${e6}`)([t,r])}catch(e){r(e)}})}function e9(e,n,t){let{remoteEntryKey:r,entryExports:a}=L(e,n);return l(a,o.getShortErrorMsg(o.RUNTIME_001,o.runtimeDescMap,{remoteName:e,remoteEntryUrl:t,remoteEntryKey:r})),a}async function ne({name:e,globalName:n,entry:t,loaderHook:r}){let{entryExports:i}=L(e,n);return i||a.loadScript(t,{attrs:{},createScriptHook:(e,n)=>{let t=r.lifecycle.createScript.emit({url:e,attrs:n});if(t&&(t instanceof HTMLScriptElement||"script"in t||"timeout"in t))return t}}).then(()=>e9(e,n,t)).catch(n=>{throw l(void 0,o.getShortErrorMsg(o.RUNTIME_008,o.runtimeDescMap,{remoteName:e,resourceUrl:t})),n})}async function nn({remoteInfo:e,remoteEntryExports:n,loaderHook:t}){let{entry:r,entryGlobalName:a,name:o,type:i}=e;switch(i){case"esm":case"module":return e8({entry:r,remoteEntryExports:n});case"system":return e7({entry:r,remoteEntryExports:n});default:return ne({entry:r,globalName:a,name:o,loaderHook:t})}}async function nt({remoteInfo:e,loaderHook:n}){let{entry:t,entryGlobalName:r,name:o,type:i}=e,{entryExports:s}=L(o,r);return s||a.loadScriptNode(t,{attrs:{name:o,globalName:r,type:i},loaderHook:{createScriptHook:(e,t={})=>{let r=n.lifecycle.createScript.emit({url:e,attrs:t});if(r&&"url"in r)return r}}}).then(()=>e9(o,r,t)).catch(e=>{throw e})}function nr(e){let{entry:n,name:t}=e;return a.composeKeyWithSeparator(t,n)}async function na({origin:e,remoteEntryExports:n,remoteInfo:t}){let r=nr(t);if(n)return n;if(!S[r]){let o=e.remoteHandler.hooks.lifecycle.loadEntry,i=e.loaderHook;S[r]=o.emit({loaderHook:i,remoteInfo:t,remoteEntryExports:n}).then(e=>e||(("undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:a.isBrowserEnv())?nn({remoteInfo:t,remoteEntryExports:n,loaderHook:i}):nt({remoteInfo:t,loaderHook:i})))}return S[r]}function no(e){return r._extends({},e,{entry:"entry"in e?e.entry:"",type:e.type||W,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||U})}function ni(e){return r._extends({resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1},e)}function ns(e,n){return n.map(n=>{let t=e4(e,n.nameOrAlias);return l(t,`Unable to preload ${n.nameOrAlias} as it is not included in ${!t&&a.safeToString({remoteInfo:t,remotes:e})}`),{remote:t,preloadConfig:ni(n)}})}function nl(e){return e?e.map(e=>"."===e?e:e.startsWith("./")?e.replace("./",""):e):[]}function nc(e,n,t,r=!0){let{cssAssets:o,jsAssetsWithoutEntry:i,entryAssets:s}=t;if(n.options.inBrowser){if(s.forEach(t=>{let{moduleInfo:r}=t,a=n.moduleCache.get(e.name);a?na({origin:n,remoteInfo:r,remoteEntryExports:a.remoteEntryExports}):na({origin:n,remoteInfo:r,remoteEntryExports:void 0})}),r){let e={rel:"preload",as:"style"};o.forEach(t=>{let{link:r,needAttach:o}=a.createLink({url:t,cb:()=>{},attrs:e,createLinkHook:(e,t)=>{let r=n.loaderHook.lifecycle.createLink.emit({url:e,attrs:t});if(r instanceof HTMLLinkElement)return r}});o&&document.head.appendChild(r)})}else{let e={rel:"stylesheet",type:"text/css"};o.forEach(t=>{let{link:r,needAttach:o}=a.createLink({url:t,cb:()=>{},attrs:e,createLinkHook:(e,t)=>{let r=n.loaderHook.lifecycle.createLink.emit({url:e,attrs:t});if(r instanceof HTMLLinkElement)return r},needDeleteLink:!1});o&&document.head.appendChild(r)})}if(r){let e={rel:"preload",as:"script"};i.forEach(t=>{let{link:r,needAttach:o}=a.createLink({url:t,cb:()=>{},attrs:e,createLinkHook:(e,t)=>{let r=n.loaderHook.lifecycle.createLink.emit({url:e,attrs:t});if(r instanceof HTMLLinkElement)return r}});o&&document.head.appendChild(r)})}else{let t={fetchpriority:"high",type:(null==e?void 0:e.type)==="module"?"module":"text/javascript"};i.forEach(e=>{let{script:r,needAttach:o}=a.createScript({url:e,cb:()=>{},attrs:t,createScriptHook:(e,t)=>{let r=n.loaderHook.lifecycle.createScript.emit({url:e,attrs:t});if(r instanceof HTMLScriptElement)return r},needDeleteScript:!0});o&&document.head.appendChild(r)})}}}var nu={global:{Global:E,nativeGlobal:k,resetFederationGlobalInfo:B,setGlobalFederationInstance:M,getGlobalFederationConstructor:T,setGlobalFederationConstructor:O,getInfoWithoutType:N,getGlobalSnapshot:P,getTargetSnapshotInfoByModuleInfo:I,getGlobalSnapshotInfoByModuleInfo:F,setGlobalSnapshotInfoByModuleInfo:R,addGlobalSnapshot:H,getRemoteEntryExports:L,registerGlobalPlugins:j,getGlobalHostPlugins:q,getPreloaded:G,setPreloaded:V},share:{getRegisteredShare:eQ,getGlobalShareScope:e0},utils:{matchRemoteWithNameAndExpose:e3,preloadAssets:nc,getRemoteInfo:no}};let nd=class{async getEntry(){let e;if(this.remoteEntryExports)return this.remoteEntryExports;try{e=await na({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports})}catch(t){let n=nr(this.remoteInfo);e=await this.host.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:na,origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,globalLoading:S,uniqueKey:n})}return l(e,`remoteEntryExports is undefined
|
|
14
14
|
${a.safeToString(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async get(e,n,t,a){let i,{loadFactory:s=!0}=t||{loadFactory:!0},u=await this.getEntry();if(!this.inited){let n=this.host.shareScopeMap,t=Array.isArray(this.remoteInfo.shareScope)?this.remoteInfo.shareScope:[this.remoteInfo.shareScope];t.length||t.push("default"),t.forEach(e=>{n[e]||(n[e]={})});let i=n[t[0]],s=[],l={version:this.remoteInfo.version||"",shareScopeKeys:Array.isArray(this.remoteInfo.shareScope)?t:this.remoteInfo.shareScope||"default"};Object.defineProperty(l,"shareScopeMap",{value:n,enumerable:!1});let d=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:i,remoteEntryInitOptions:l,initScope:s,remoteInfo:this.remoteInfo,origin:this.host});void 0===(null==u?void 0:u.init)&&c(o.getShortErrorMsg(o.RUNTIME_002,o.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName})),await u.init(d.shareScope,d.initScope,d.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit(r._extends({},d,{id:e,remoteSnapshot:a,remoteEntryExports:u}))}this.lib=u,this.inited=!0,(i=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:u,expose:n,moduleInfo:this.remoteInfo}))||(i=await u.get(n)),l(i,`${p(this.remoteInfo)} remote don't export ${n}.`);let d=$(this.remoteInfo.name,n),f=this.wraperFactory(i,d);return s?await f():f}wraperFactory(e,n){function t(e,n){e&&"object"==typeof e&&Object.isExtensible(e)&&!Object.getOwnPropertyDescriptor(e,Symbol.for("mf_module_id"))&&Object.defineProperty(e,Symbol.for("mf_module_id"),{value:n,enumerable:!1})}return e instanceof Promise?async()=>{let r=await e();return t(r,n),r}:()=>{let r=e();return t(r,n),r}}constructor({remoteInfo:e,host:n}){this.inited=!1,this.lib=void 0,this.remoteInfo=e,this.host=n}};class np{on(e){"function"==typeof e&&this.listeners.add(e)}once(e){let n=this;this.on(function t(...r){return n.remove(t),e.apply(null,r)})}emit(...e){let n;return this.listeners.size>0&&this.listeners.forEach(t=>{n=t(...e)}),n}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}}class nf extends np{emit(...e){let n,t=Array.from(this.listeners);if(t.length>0){let r=0,a=n=>!1!==n&&(r<t.length?Promise.resolve(t[r++].apply(null,e)).then(a):n);n=a()}return Promise.resolve(n)}}function n_(e,n){if(!g(n))return!1;if(e!==n){for(let t in e)if(!(t in n))return!1}return!0}class nh extends np{emit(e){for(let n of(g(e)||c(`The data for the "${this.type}" hook should be an object.`),this.listeners))try{let t=n(e);if(n_(e,t))e=t;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){u(e),this.onerror(e)}return e}constructor(e){super(),this.onerror=c,this.type=e}}class nm extends np{emit(e){g(e)||c(`The response data for the "${this.type}" hook must be an object.`);let n=Array.from(this.listeners);if(n.length>0){let t=0,r=n=>(u(n),this.onerror(n),e),a=o=>{if(n_(e,o)){if(e=o,t<n.length)try{return Promise.resolve(n[t++](e)).then(a,r)}catch(e){return r(e)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(a(e))}return Promise.resolve(e)}constructor(e){super(),this.onerror=c,this.type=e}}class ng{applyPlugin(e,n){l(y(e),"Plugin configuration is invalid.");let t=e.name;l(t,"A name must be provided by the plugin."),this.registerPlugins[t]||(this.registerPlugins[t]=e,null==e.apply||e.apply.call(e,n),Object.keys(this.lifecycle).forEach(n=>{let t=e[n];t&&this.lifecycle[n].on(t)}))}removePlugin(e){l(e,"A name is required.");let n=this.registerPlugins[e];l(n,`The plugin "${e}" is not registered.`),Object.keys(n).forEach(e=>{"name"!==e&&this.lifecycle[e].remove(n[e])})}constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}}function nA(e,n){let t=C(n);t.url||c(`The attribute remoteEntry of ${e.name} must not be undefined.`);let r=a.getResourceUrl(n,t.url);a.isBrowserEnv()||r.startsWith("http")||(r=`https:${r}`),e.type=t.type,e.entryGlobalName=t.globalName,e.entry=r,e.version=n.version,e.buildVersion=n.buildVersion}function ny(){return{name:"snapshot-plugin",async afterResolve(e){let{remote:n,pkgNameOrAlias:t,expose:a,origin:o,remoteInfo:i,id:s}=e;if(!f(n)||!h(n)){let{remoteSnapshot:l,globalSnapshot:c}=await o.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:n,id:s});nA(i,l);let u={remote:n,preloadConfig:{nameOrAlias:t,exposes:[a],resourceCategory:"sync",share:!1,depsRemote:!1}},d=await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:o,preloadOptions:u,remoteInfo:i,remote:n,remoteSnapshot:l,globalSnapshot:c});return d&&nc(i,o,d,!1),r._extends({},e,{remoteSnapshot:l})}return e}}}function nb(e){let n=e.split(":");return 1===n.length?{name:n[0],version:void 0}:2===n.length?{name:n[0],version:n[1]}:{name:n[1],version:n[2]}}function nv(e,n,t,r,o={},i){let{value:s}=N(e,p(n)),l=i||s;if(l&&!a.isManifestProvider(l)&&(t(l,n,r),l.remotesInfo))for(let n of Object.keys(l.remotesInfo)){if(o[n])continue;o[n]=!0;let r=nb(n),a=l.remotesInfo[n];nv(e,{name:r.name,version:a.matchedVersion},t,!1,o,void 0)}}let nC=(e,n)=>document.querySelector(`${e}[${"link"===e?"href":"src"}="${n}"]`);function n$(e,n,t,r,o){let i=[],s=[],l=[],c=new Set,u=new Set,{options:d}=e,{preloadConfig:p}=n,{depsRemote:f}=p;if(nv(r,t,(n,t,r)=>{let o;if(r)o=p;else if(Array.isArray(f)){let e=f.find(e=>e.nameOrAlias===t.name||e.nameOrAlias===t.alias);if(!e)return;o=ni(e)}else{if(!0!==f)return;o=p}let c=a.getResourceUrl(n,C(n).url);c&&l.push({name:t.name,moduleInfo:{name:t.name,entry:c,type:"remoteEntryType"in n?n.remoteEntryType:"global",entryGlobalName:"globalName"in n?n.globalName:t.name,shareScope:"",version:"version"in n?n.version:void 0},url:c});let u="modules"in n?n.modules:[],d=nl(o.exposes);if(d.length&&"modules"in n){var h;u=null==n||null==(h=n.modules)?void 0:h.reduce((e,n)=>((null==d?void 0:d.indexOf(n.moduleName))!==-1&&e.push(n),e),[])}function m(e){let t=e.map(e=>a.getResourceUrl(n,e));return o.filter?t.filter(o.filter):t}if(u){let r=u.length;for(let a=0;a<r;a++){let r=u[a],l=`${t.name}/${r.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:"."===r.moduleName?t.name:l,name:t.name,remoteSnapshot:n,preloadConfig:o,remote:t,origin:e}),G(l)||("all"===o.resourceCategory?(i.push(...m(r.assets.css.async)),i.push(...m(r.assets.css.sync)),s.push(...m(r.assets.js.async))):(o.resourceCategory="sync",i.push(...m(r.assets.css.sync))),s.push(...m(r.assets.js.sync)),V(l))}}},!0,{},o),o.shared&&o.shared.length>0){let n=(n,t)=>{let r=eQ(e.shareScopeMap,t.sharedName,n,e.sharedHandler.hooks.lifecycle.resolveShare);r&&"function"==typeof r.lib&&(t.assets.js.sync.forEach(e=>{c.add(e)}),t.assets.css.sync.forEach(e=>{u.add(e)}))};o.shared.forEach(e=>{var t;let r=null==(t=d.shared)?void 0:t[e.sharedName];if(!r)return;let a=e.version?r.find(n=>n.version===e.version):r;a&&v(a).forEach(t=>{n(t,e)})})}let h=s.filter(e=>!c.has(e)&&!nC("script",e));return{cssAssets:i.filter(e=>!u.has(e)&&!nC("link",e)),jsAssetsWithoutEntry:h,entryAssets:l.filter(e=>!nC("script",e.url))}}let nw=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){let{origin:n,preloadOptions:t,remoteInfo:r,remote:o,globalSnapshot:i,remoteSnapshot:s}=e;return a.isBrowserEnv()?f(o)&&h(o)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:o.name,url:o.entry,moduleInfo:{name:r.name,entry:o.entry,type:r.type||"global",entryGlobalName:"",shareScope:""}}]}:(nA(r,s),n$(n,t,r,i,s)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function nk(e,n){let t=F({name:n.name,version:n.options.version}),r=t&&"remotesInfo"in t&&t.remotesInfo&&N(t.remotesInfo,e.name).value;return r&&r.matchedVersion?{hostGlobalSnapshot:t,globalSnapshot:P(),remoteSnapshot:F({name:e.name,version:r.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:P(),remoteSnapshot:F({name:e.name,version:"version"in e?e.version:void 0})}}class nE{async loadRemoteSnapshotInfo({moduleInfo:e,id:n,expose:t}){let i,s,{options:l}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:l,moduleInfo:e});let u=F({name:this.HostInstance.options.name,version:this.HostInstance.options.version});u||(u={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},H({[this.HostInstance.options.name]:u})),u&&"remotesInfo"in u&&!N(u.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(u.remotesInfo=r._extends({},null==u?void 0:u.remotesInfo,{[e.name]:{matchedVersion:"version"in e?e.version:e.entry}}));let{hostGlobalSnapshot:d,remoteSnapshot:p,globalSnapshot:h}=this.getGlobalRemoteInfo(e),{remoteSnapshot:m,globalSnapshot:g}=await this.hooks.lifecycle.loadSnapshot.emit({options:l,moduleInfo:e,hostGlobalSnapshot:d,remoteSnapshot:p,globalSnapshot:h});if(m)if(a.isManifestProvider(m)){let n=a.isBrowserEnv()?m.remoteEntry:m.ssrRemoteEntry||m.remoteEntry||"",t=await this.getManifestJson(n,e,{}),o=R(r._extends({},e,{entry:n}),t);i=t,s=o}else{let{remoteSnapshot:n}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:m,from:"global"});i=n,s=g}else if(f(e)){let n=await this.getManifestJson(e.entry,e,{}),t=R(e,n),{remoteSnapshot:r}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:n,from:"global"});i=r,s=t}else c(o.getShortErrorMsg(o.RUNTIME_007,o.runtimeDescMap,{hostName:e.name,hostVersion:e.version,globalSnapshot:JSON.stringify(g)}));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:n,host:this.HostInstance,options:l,moduleInfo:e,remoteSnapshot:i}),{remoteSnapshot:i,globalSnapshot:s}}getGlobalRemoteInfo(e){return nk(e,this.HostInstance)}async getManifestJson(e,n,t){let r=async()=>{let t=this.manifestCache.get(e);if(t)return t;try{let n=await this.loaderHook.lifecycle.fetch.emit(e,{});n&&n instanceof Response||(n=await fetch(e,{})),t=await n.json()}catch(r){(t=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}))||(delete this.manifestLoading[e],c(o.getShortErrorMsg(o.RUNTIME_003,o.runtimeDescMap,{manifestUrl:e,moduleName:n.name,hostName:this.HostInstance.options.name},`${r}`)))}return l(t.metaData&&t.exposes&&t.shared,`${e} is not a federation manifest`),this.manifestCache.set(e,t),t},i=async()=>{let t=await r(),o=a.generateSnapshotFromManifest(t,{version:e}),{remoteSnapshot:i}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:n,manifestJson:t,remoteSnapshot:o,manifestUrl:e,from:"manifest"});return i};return this.manifestLoading[e]||(this.manifestLoading[e]=i().then(e=>e)),this.manifestLoading[e]}constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new ng({beforeLoadRemoteSnapshot:new nf("beforeLoadRemoteSnapshot"),loadSnapshot:new nm("loadGlobalSnapshot"),loadRemoteSnapshot:new nm("loadRemoteSnapshot"),afterLoadSnapshot:new nm("afterLoadSnapshot")}),this.manifestLoading=E.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}}class nx{registerShared(e,n){let{shareInfos:t,shared:r}=eV(e,n);return Object.keys(t).forEach(e=>{t[e].forEach(t=>{!eQ(this.shareScopeMap,e,t,this.hooks.lifecycle.resolveShare)&&t&&t.lib&&this.setShared({pkgName:e,lib:t.lib,get:t.get,loaded:!0,shared:t,from:n.name})})}),{shareInfos:t,shared:r}}async loadShare(e,n){let{host:t}=this,r=e1({pkgName:e,extraOptions:n,shareInfos:t.options.shared});(null==r?void 0:r.scope)&&await Promise.all(r.scope.map(async e=>{await Promise.all(this.initializeSharing(e,{strategy:r.strategy}))}));let{shareInfo:a}=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:r,shared:t.options.shared,origin:t});l(a,`Cannot find ${e} Share in the ${t.options.name}. Please ensure that the ${e} Share parameters have been injected`);let o=eQ(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare),i=e=>{e.useIn||(e.useIn=[]),d(e.useIn,t.options.name)};if(o&&o.lib)return i(o),o.lib;if(o&&o.loading&&!o.loaded){let e=await o.loading;return o.loaded=!0,o.lib||(o.lib=e),i(o),e}if(o){let n=(async()=>{let n=await o.get();a.lib=n,a.loaded=!0,i(a);let t=eQ(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare);return t&&(t.lib=n,t.loaded=!0,i(t)),n})();return this.setShared({pkgName:e,loaded:!1,shared:o,from:t.options.name,lib:null,loading:n}),n}{if(null==n?void 0:n.customShareInfo)return!1;let r=(async()=>{let n=await a.get();a.lib=n,a.loaded=!0,i(a);let t=eQ(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare);return t&&(t.lib=n,t.loaded=!0),n})();return this.setShared({pkgName:e,loaded:!1,shared:a,from:t.options.name,lib:null,loading:r}),r}}initializeSharing(e=U,n){let{host:t}=this,r=null==n?void 0:n.from,a=null==n?void 0:n.strategy,o=null==n?void 0:n.initScope,i=[];if("build"!==r){let{initTokens:n}=this;o||(o=[]);let t=n[e];if(t||(t=n[e]={from:this.host.name}),o.indexOf(t)>=0)return i;o.push(t)}let s=this.shareScopeMap,l=t.options.name;s[e]||(s[e]={});let c=s[e],u=(e,n)=>{var t;let{version:r,eager:a}=n;c[e]=c[e]||{};let o=c[e],i=o[r],s=!!(i&&(i.eager||(null==(t=i.shareConfig)?void 0:t.eager)));(!i||"loaded-first"!==i.strategy&&!i.loaded&&(!a!=!s?a:l>i.from))&&(o[r]=n)},d=n=>n&&n.init&&n.init(s[e],o),p=async e=>{let{module:n}=await t.remoteHandler.getRemoteModuleAndOptions({id:e});if(n.getEntry){let r;try{r=await n.getEntry()}catch(n){r=await t.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:"runtime",lifecycle:"beforeLoadShare",origin:t})}n.inited||(await d(r),n.inited=!0)}};return Object.keys(t.options.shared).forEach(n=>{t.options.shared[n].forEach(t=>{t.scope.includes(e)&&u(n,t)})}),("version-first"===t.options.shareStrategy||"version-first"===a)&&t.options.remotes.forEach(n=>{n.shareScope===e&&i.push(p(n.name))}),i}loadShareSync(e,n){let{host:t}=this,r=e1({pkgName:e,extraOptions:n,shareInfos:t.options.shared});(null==r?void 0:r.scope)&&r.scope.forEach(e=>{this.initializeSharing(e,{strategy:r.strategy})});let a=eQ(this.shareScopeMap,e,r,this.hooks.lifecycle.resolveShare),i=e=>{e.useIn||(e.useIn=[]),d(e.useIn,t.options.name)};if(a){if("function"==typeof a.lib)return i(a),a.loaded||(a.loaded=!0,a.from===t.options.name&&(r.loaded=!0)),a.lib;if("function"==typeof a.get){let n=a.get();if(!(n instanceof Promise))return i(a),this.setShared({pkgName:e,loaded:!0,from:t.options.name,lib:n,shared:a}),n}}if(r.lib)return r.loaded||(r.loaded=!0),r.lib;if(r.get){let a=r.get();if(a instanceof Promise){let r=(null==n?void 0:n.from)==="build"?o.RUNTIME_005:o.RUNTIME_006;throw Error(o.getShortErrorMsg(r,o.runtimeDescMap,{hostName:t.options.name,sharedPkgName:e}))}return r.lib=a,this.setShared({pkgName:e,loaded:!0,from:t.options.name,lib:r.lib,shared:r}),r.lib}throw Error(o.getShortErrorMsg(o.RUNTIME_006,o.runtimeDescMap,{hostName:t.options.name,sharedPkgName:e}))}initShareScopeMap(e,n,t={}){let{host:r}=this;this.shareScopeMap[e]=n,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:n,options:r.options,origin:r,scopeName:e,hostShareScopeMap:t.hostShareScopeMap})}setShared({pkgName:e,shared:n,from:t,lib:a,loading:o,loaded:i,get:s}){let{version:l,scope:c="default"}=n,u=r._object_without_properties_loose(n,["version","scope"]);(Array.isArray(c)?c:[c]).forEach(n=>{if(this.shareScopeMap[n]||(this.shareScopeMap[n]={}),this.shareScopeMap[n][e]||(this.shareScopeMap[n][e]={}),!this.shareScopeMap[n][e][l]){this.shareScopeMap[n][e][l]=r._extends({version:l,scope:["default"]},u,{lib:a,loaded:i,loading:o}),s&&(this.shareScopeMap[n][e][l].get=s);return}let t=this.shareScopeMap[n][e][l];o&&!t.loading&&(t.loading=o)})}_setGlobalShareScopeMap(e){let n=e0(),t=e.id||e.name;t&&!n[t]&&(n[t]=this.shareScopeMap)}constructor(e){this.hooks=new ng({afterResolve:new nm("afterResolve"),beforeLoadShare:new nm("beforeLoadShare"),loadShare:new nf,resolveShare:new nh("resolveShare"),initContainerShareScopeMap:new nh("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}}class nD{formatAndRegisterRemote(e,n){return(n.remotes||[]).reduce((e,n)=>(this.registerRemote(n,e,{force:!1}),e),e.remotes)}setIdToRemoteMap(e,n){let{remote:t,expose:r}=n,{name:a,alias:o}=t;if(this.idToRemoteMap[e]={name:t.name,expose:r},o&&e.startsWith(a)){let n=e.replace(a,o);this.idToRemoteMap[n]={name:t.name,expose:r};return}if(o&&e.startsWith(o)){let n=e.replace(o,a);this.idToRemoteMap[n]={name:t.name,expose:r}}}async loadRemote(e,n){let{host:t}=this;try{let{loadFactory:r=!0}=n||{loadFactory:!0},{module:a,moduleOptions:o,remoteMatchInfo:i}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:s,remote:l,expose:c,id:u,remoteSnapshot:d}=i,p=await a.get(u,c,n,d),f=await this.hooks.lifecycle.onLoad.emit({id:u,pkgNameOrAlias:s,expose:c,exposeModule:r?p:void 0,exposeModuleFactory:r?void 0:p,remote:l,options:o,moduleInstance:a,origin:t});if(this.setIdToRemoteMap(e,i),"function"==typeof f)return f;return p}catch(o){let{from:r="runtime"}=n||{from:"runtime"},a=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:o,from:r,lifecycle:"onLoad",origin:t});if(!a)throw o;return a}}async preloadRemote(e){let{host:n}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:n.options,origin:n});let t=ns(n.options.remotes,e);await Promise.all(t.map(async e=>{let{remote:t}=e,r=no(t),{globalSnapshot:a,remoteSnapshot:o}=await n.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t}),i=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:n,preloadOptions:e,remote:t,remoteInfo:r,globalSnapshot:a,remoteSnapshot:o});i&&nc(r,n,i)}))}registerRemotes(e,n){let{host:t}=this;e.forEach(e=>{this.registerRemote(e,t.options.remotes,{force:null==n?void 0:n.force})})}async getRemoteModuleAndOptions(e){let n,{host:t}=this,{id:a}=e;try{n=await this.hooks.lifecycle.beforeRequest.emit({id:a,options:t.options,origin:t})}catch(e){if(!(n=await this.hooks.lifecycle.errorLoadRemote.emit({id:a,options:t.options,origin:t,from:"runtime",error:e,lifecycle:"beforeRequest"})))throw e}let{id:i}=n,s=e3(t.options.remotes,i);l(s,o.getShortErrorMsg(o.RUNTIME_004,o.runtimeDescMap,{hostName:t.options.name,requestId:i}));let{remote:c}=s,u=no(c),d=await t.sharedHandler.hooks.lifecycle.afterResolve.emit(r._extends({id:i},s,{options:t.options,origin:t,remoteInfo:u})),{remote:p,expose:f}=d;l(p&&f,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${i}.`);let h=t.moduleCache.get(p.name),m={host:t,remoteInfo:u};return h||(h=new nd(m),t.moduleCache.set(p.name,h)),{module:h,moduleOptions:m,remoteMatchInfo:d}}registerRemote(e,n,t){let{host:r}=this,o=()=>{if(e.alias){let t=n.find(n=>{var t;return e.alias&&(n.name.startsWith(e.alias)||(null==(t=n.alias)?void 0:t.startsWith(e.alias)))});l(!t,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${t&&t.name} name or alias`)}"entry"in e&&a.isBrowserEnv()&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=U),e.type||(e.type=W)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:r});let i=n.find(n=>n.name===e.name);if(i){let s=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];(null==t?void 0:t.force)&&(this.removeRemote(i),o(),n.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r}),a.warn(s.join(" ")))}else o(),n.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r})}removeRemote(e){try{let{host:t}=this,{name:r}=e,o=t.options.remotes.findIndex(e=>e.name===r);-1!==o&&t.options.remotes.splice(o,1);let i=t.moduleCache.get(e.name);if(i){let r=i.remoteInfo,o=r.entryGlobalName;if(w[o]){var n;(null==(n=Object.getOwnPropertyDescriptor(w,o))?void 0:n.configurable)?delete w[o]:w[o]=void 0}let s=nr(i.remoteInfo);S[s]&&delete S[s],t.snapshotHandler.manifestCache.delete(r.entry);let l=r.buildVersion?a.composeKeyWithSeparator(r.name,r.buildVersion):r.name,c=w.__FEDERATION__.__INSTANCES__.findIndex(e=>r.buildVersion?e.options.id===l:e.name===l);if(-1!==c){let e=w.__FEDERATION__.__INSTANCES__[c];l=e.options.id||l;let n=e0(),t=!0,a=[];Object.keys(n).forEach(e=>{let o=n[e];o&&Object.keys(o).forEach(n=>{let i=o[n];i&&Object.keys(i).forEach(o=>{let s=i[o];s&&Object.keys(s).forEach(i=>{let l=s[i];l&&"object"==typeof l&&l.from===r.name&&(l.loaded||l.loading?(l.useIn=l.useIn.filter(e=>e!==r.name),l.useIn.length?t=!1:a.push([e,n,o,i])):a.push([e,n,o,i]))})})})}),t&&(e.shareScopeMap={},delete n[l]),a.forEach(([e,t,r,a])=>{var o,i,s;null==(s=n[e])||null==(i=s[t])||null==(o=i[r])||delete o[a]}),w.__FEDERATION__.__INSTANCES__.splice(c,1)}let{hostGlobalSnapshot:u}=nk(e,t);if(u){let n=u&&"remotesInfo"in u&&u.remotesInfo&&N(u.remotesInfo,e.name).key;n&&(delete u.remotesInfo[n],E.__FEDERATION__.__MANIFEST_LOADING__[n]&&delete E.__FEDERATION__.__MANIFEST_LOADING__[n])}t.moduleCache.delete(e.name)}}catch(e){s.log("removeRemote fail: ",e)}}constructor(e){this.hooks=new ng({beforeRegisterRemote:new nh("beforeRegisterRemote"),registerRemote:new nh("registerRemote"),beforeRequest:new nm("beforeRequest"),onLoad:new nf("onLoad"),handlePreloadModule:new np("handlePreloadModule"),errorLoadRemote:new nf("errorLoadRemote"),beforePreloadRemote:new nf("beforePreloadRemote"),generatePreloadAssets:new nf("generatePreloadAssets"),afterPreloadRemote:new nf,loadEntry:new nf}),this.host=e,this.idToRemoteMap={}}}let nS="boolean"!=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN||!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN;class nz{initOptions(e){this.registerPlugins(e.plugins);let n=this.formatOptions(this.options,e);return this.options=n,n}async loadShare(e,n){return this.sharedHandler.loadShare(e,n)}loadShareSync(e,n){return this.sharedHandler.loadShareSync(e,n)}initializeSharing(e=U,n){return this.sharedHandler.initializeSharing(e,n)}initRawContainer(e,n,t){let r=new nd({host:this,remoteInfo:no({name:e,entry:n})});return r.remoteEntryExports=t,this.moduleCache.set(e,r),r}async loadRemote(e,n){return this.remoteHandler.loadRemote(e,n)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,n,t={}){this.sharedHandler.initShareScopeMap(e,n,t)}formatOptions(e,n){let{shared:t}=eV(e,n),{userOptions:a,options:o}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:n,options:e,shareInfo:t}),i=this.remoteHandler.formatAndRegisterRemote(o,a),{shared:s}=this.sharedHandler.registerShared(o,a),l=[...o.plugins];a.plugins&&a.plugins.forEach(e=>{l.includes(e)||l.push(e)});let c=r._extends({},e,n,{plugins:l,remotes:i,shared:s});return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){let n=e5(e,this);this.options.plugins=this.options.plugins.reduce((e,n)=>(n&&e&&!e.find(e=>e.name===n.name)&&e.push(n),e),n||[])}registerRemotes(e,n){return this.remoteHandler.registerRemotes(e,n)}registerShared(e){this.sharedHandler.registerShared(this.options,r._extends({},this.options,{shared:e}))}constructor(e){this.hooks=new ng({beforeInit:new nh("beforeInit"),init:new np,beforeInitContainer:new nm("beforeInitContainer"),initContainer:new nm("initContainer")}),this.version="0.18.0",this.moduleCache=new Map,this.loaderHook=new ng({getModuleInfo:new np,createScript:new np,createLink:new np,fetch:new nf,loadEntryError:new nf,getModuleFactory:new nf}),this.bridgeHook=new ng({beforeBridgeRender:new np,afterBridgeRender:new np,beforeBridgeDestroy:new np,afterBridgeDestroy:new np});const n=nS?[ny(),nw()]:[],t={id:e2(),name:e.name,plugins:n,remotes:[],shared:{},inBrowser:a.isBrowserEnv()};this.name=e.name,this.options=t,this.snapshotHandler=new nE(this),this.sharedHandler=new nx(this),this.remoteHandler=new nD(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...t.plugins,...e.plugins||[]]),this.options=this.formatOptions(t,e)}}var nB=Object.freeze({__proto__:null});n.loadScript=a.loadScript,n.loadScriptNode=a.loadScriptNode,n.CurrentGlobal=w,n.Global=E,n.Module=nd,n.ModuleFederation=nz,n.addGlobalSnapshot=H,n.assert=l,n.getGlobalFederationConstructor=T,n.getGlobalSnapshot=P,n.getInfoWithoutType=N,n.getRegisteredShare=eQ,n.getRemoteEntry=na,n.getRemoteInfo=no,n.helpers=nu,n.isStaticResourcesEqual=b,n.matchRemoteWithNameAndExpose=e3,n.registerGlobalPlugins=j,n.resetFederationGlobalInfo=B,n.safeWrapper=m,n.satisfy=eq,n.setGlobalFederationConstructor=O,n.setGlobalFederationInstance=M,n.types=nB},44054:function(e,n){"use strict";function t(){return(t=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}function r(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}n._extends=t,n._object_without_properties_loose=r},8230:function(e,n,t){"use strict";var r=t(94106),a=t(63767),o=t(19857);function i(e){return new(r.getGlobalFederationConstructor()||r.ModuleFederation)(e)}let s=null;function l(e){let n=o.getGlobalFederationInstance(e.name,e.version);return n?(n.initOptions(e),s||(s=n),n):(s=i(e),r.setGlobalFederationInstance(s),s)}function c(...e){return r.assert(s,a.getShortErrorMsg(a.RUNTIME_009,a.runtimeDescMap)),s.loadRemote.apply(s,e)}function u(...e){return r.assert(s,a.getShortErrorMsg(a.RUNTIME_009,a.runtimeDescMap)),s.loadShare.apply(s,e)}function d(...e){return r.assert(s,a.getShortErrorMsg(a.RUNTIME_009,a.runtimeDescMap)),s.loadShareSync.apply(s,e)}function p(...e){return r.assert(s,a.getShortErrorMsg(a.RUNTIME_009,a.runtimeDescMap)),s.preloadRemote.apply(s,e)}function f(...e){return r.assert(s,a.getShortErrorMsg(a.RUNTIME_009,a.runtimeDescMap)),s.registerRemotes.apply(s,e)}function h(...e){return r.assert(s,a.getShortErrorMsg(a.RUNTIME_009,a.runtimeDescMap)),s.registerPlugins.apply(s,e)}function m(){return s}function g(...e){return r.assert(s,a.getShortErrorMsg(a.RUNTIME_009,a.runtimeDescMap)),s.registerShared.apply(s,e)}r.setGlobalFederationConstructor(r.ModuleFederation),n.Module=r.Module,n.ModuleFederation=r.ModuleFederation,n.getRemoteEntry=r.getRemoteEntry,n.getRemoteInfo=r.getRemoteInfo,n.loadScript=r.loadScript,n.loadScriptNode=r.loadScriptNode,n.registerGlobalPlugins=r.registerGlobalPlugins,n.createInstance=i,n.getInstance=m,n.init=l,n.loadRemote=c,n.loadShare=u,n.loadShareSync=d,n.preloadRemote=p,n.registerPlugins=h,n.registerRemotes=f,n.registerShared=g},19857:function(e,n,t){"use strict";var r=t(94106);function a(){return"undefined"!=typeof FEDERATION_BUILD_IDENTIFIER?FEDERATION_BUILD_IDENTIFIER:""}n.getGlobalFederationInstance=function(e,n){let t=a();return r.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(r=>!!t&&r.options.id===t||r.options.name===e&&!r.options.version&&!n||r.options.name===e&&!!n&&r.options.version===n)}},16742:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var polyfills=__webpack_require__(12706);let FederationModuleManifest="federation-manifest.json",MANIFEST_EXT=".json",BROWSER_LOG_KEY="FEDERATION_DEBUG",NameTransformSymbol={AT:"@",HYPHEN:"-",SLASH:"/"},NameTransformMap={[NameTransformSymbol.AT]:"scope_",[NameTransformSymbol.HYPHEN]:"_",[NameTransformSymbol.SLASH]:"__"},EncodedNameTransformMap={[NameTransformMap[NameTransformSymbol.AT]]:NameTransformSymbol.AT,[NameTransformMap[NameTransformSymbol.HYPHEN]]:NameTransformSymbol.HYPHEN,[NameTransformMap[NameTransformSymbol.SLASH]]:NameTransformSymbol.SLASH},SEPARATOR=":",ManifestFileName="mf-manifest.json",StatsFileName="mf-stats.json",MFModuleType={NPM:"npm",APP:"app"},MODULE_DEVTOOL_IDENTIFIER="__MF_DEVTOOLS_MODULE_INFO__",ENCODE_NAME_PREFIX="ENCODE_NAME_PREFIX",TEMP_DIR=".federation",MFPrefetchCommon={identifier:"MFDataPrefetch",globalKey:"__PREFETCH__",library:"mf-data-prefetch",exportsKey:"__PREFETCH_EXPORTS__",fileName:"bootstrap.js"};var ContainerPlugin=Object.freeze({__proto__:null}),ContainerReferencePlugin=Object.freeze({__proto__:null}),ModuleFederationPlugin=Object.freeze({__proto__:null}),SharePlugin=Object.freeze({__proto__:null});function isBrowserEnv(){return"undefined"!=typeof window&&void 0!==window.document}function isReactNativeEnv(){var e;return"undefined"!=typeof navigator&&(null==(e=navigator)?void 0:e.product)==="ReactNative"}function isBrowserDebug(){try{if(isBrowserEnv()&&window.localStorage)return!!localStorage.getItem(BROWSER_LOG_KEY)}catch(e){}return!1}function isDebugMode(){return"undefined"!=typeof process&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:!!("undefined"!=typeof FEDERATION_DEBUG&&FEDERATION_DEBUG)||isBrowserDebug()}let getProcessEnv=function(){return"undefined"!=typeof process&&process.env?process.env:{}},LOG_CATEGORY="[ Federation Runtime ]",parseEntry=(e,n,t=SEPARATOR)=>{let r=e.split(t),a="development"===getProcessEnv().NODE_ENV&&n,o="*",i=e=>e.startsWith("http")||e.includes(MANIFEST_EXT);if(r.length>=2){let[n,...s]=r;e.startsWith(t)&&(n=r.slice(0,2).join(t),s=[a||r.slice(2).join(t)]);let l=a||s.join(t);return i(l)?{name:n,entry:l}:{name:n,version:l||o}}if(1===r.length){let[e]=r;return a&&i(a)?{name:e,entry:a}:{name:e,version:a||o}}throw`Invalid entry value: ${e}`},composeKeyWithSeparator=function(...e){return e.length?e.reduce((e,n)=>n?e?`${e}${SEPARATOR}${n}`:n:e,""):""},encodeName=function(e,n="",t=!1){try{let r=t?".js":"";return`${n}${e.replace(RegExp(`${NameTransformSymbol.AT}`,"g"),NameTransformMap[NameTransformSymbol.AT]).replace(RegExp(`${NameTransformSymbol.HYPHEN}`,"g"),NameTransformMap[NameTransformSymbol.HYPHEN]).replace(RegExp(`${NameTransformSymbol.SLASH}`,"g"),NameTransformMap[NameTransformSymbol.SLASH])}${r}`}catch(e){throw e}},decodeName=function(e,n,t){try{let r=e;if(n){if(!r.startsWith(n))return r;r=r.replace(RegExp(n,"g"),"")}return r=r.replace(RegExp(`${NameTransformMap[NameTransformSymbol.AT]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.AT]]).replace(RegExp(`${NameTransformMap[NameTransformSymbol.SLASH]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.SLASH]]).replace(RegExp(`${NameTransformMap[NameTransformSymbol.HYPHEN]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.HYPHEN]]),t&&(r=r.replace(".js","")),r}catch(e){throw e}},generateExposeFilename=(e,n)=>{if(!e)return"";let t=e;return"."===t&&(t="default_export"),t.startsWith("./")&&(t=t.replace("./","")),encodeName(t,"__federation_expose_",n)},generateShareFilename=(e,n)=>e?encodeName(e,"__federation_shared_",n):"",getResourceUrl=(e,n)=>{if("getPublicPath"in e){let t;return t=e.getPublicPath.startsWith("function")?Function("return "+e.getPublicPath)()():Function(e.getPublicPath)(),`${t}${n}`}return"publicPath"in e?!isBrowserEnv()&&!isReactNativeEnv()&&"ssrPublicPath"in e?`${e.ssrPublicPath}${n}`:`${e.publicPath}${n}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,n),"")},assert=(e,n)=>{e||error(n)},error=e=>{throw Error(`${LOG_CATEGORY}: ${e}`)},warn=e=>{console.warn(`${LOG_CATEGORY}: ${e}`)};function safeToString(e){try{return JSON.stringify(e,null,2)}catch(e){return""}}let VERSION_PATTERN_REGEXP=/^([\d^=v<>~]|[*xX]$)/;function isRequiredVersion(e){return VERSION_PATTERN_REGEXP.test(e)}let simpleJoinRemoteEntry=(e,n)=>{if(!e)return n;let t=(e=>{if("."===e)return"";if(e.startsWith("./"))return e.replace("./","");if(e.startsWith("/")){let n=e.slice(1);return n.endsWith("/")?n.slice(0,-1):n}return e})(e);return t?t.endsWith("/")?`${t}${n}`:`${t}/${n}`:n};function inferAutoPublicPath(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function generateSnapshotFromManifest(e,n={}){var t,r,a;let o,{remotes:i={},overrides:s={},version:l}=n,c=()=>"publicPath"in e.metaData?"auto"===e.metaData.publicPath&&l?inferAutoPublicPath(l):e.metaData.publicPath:e.metaData.getPublicPath,u=Object.keys(s),d={};Object.keys(i).length||(d=(null==(a=e.remotes)?void 0:a.reduce((e,n)=>{let t,r=n.federationContainerName;return t=u.includes(r)?s[r]:"version"in n?n.version:n.entry,e[r]={matchedVersion:t},e},{}))||{}),Object.keys(i).forEach(e=>d[e]={matchedVersion:u.includes(e)?s[e]:i[e]});let{remoteEntry:{path:p,name:f,type:h},types:m,buildInfo:{buildVersion:g},globalName:A,ssrRemoteEntry:y}=e.metaData,{exposes:b}=e,v={version:l||"",buildVersion:g,globalName:A,remoteEntry:simpleJoinRemoteEntry(p,f),remoteEntryType:h,remoteTypes:simpleJoinRemoteEntry(m.path,m.name),remoteTypesZip:m.zip||"",remoteTypesAPI:m.api||"",remotesInfo:d,shared:null==e?void 0:e.shared.map(e=>({assets:e.assets,sharedName:e.name,version:e.version})),modules:null==b?void 0:b.map(e=>({moduleName:e.name,modulePath:e.path,assets:e.assets}))};if(null==(t=e.metaData)?void 0:t.prefetchInterface){let n=e.metaData.prefetchInterface;v=polyfills._({},v,{prefetchInterface:n})}if(null==(r=e.metaData)?void 0:r.prefetchEntry){let{path:n,name:t,type:r}=e.metaData.prefetchEntry;v=polyfills._({},v,{prefetchEntry:simpleJoinRemoteEntry(n,t),prefetchEntryType:r})}return o="publicPath"in e.metaData?polyfills._({},v,{publicPath:c(),ssrPublicPath:e.metaData.ssrPublicPath}):polyfills._({},v,{getPublicPath:c()}),y&&(o.ssrRemoteEntry=simpleJoinRemoteEntry(y.path,y.name),o.ssrRemoteEntryType=y.type||"commonjs-module"),o}function isManifestProvider(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(MANIFEST_EXT))}let PREFIX="[ Module Federation ]",Logger=class{setPrefix(e){this.prefix=e}log(...e){console.log(this.prefix,...e)}warn(...e){console.log(this.prefix,...e)}error(...e){console.log(this.prefix,...e)}success(...e){console.log(this.prefix,...e)}info(...e){console.log(this.prefix,...e)}ready(...e){console.log(this.prefix,...e)}debug(...e){isDebugMode()&&console.log(this.prefix,...e)}constructor(e){this.prefix=e}};function createLogger(e){return new Logger(e)}let logger=createLogger(PREFIX);async function safeWrapper(e,n){try{return await e()}catch(e){n||warn(e);return}}function isStaticResourcesEqual(e,n){let t=/^(https?:)?\/\//i;return e.replace(t,"").replace(/\/$/,"")===n.replace(t,"").replace(/\/$/,"")}function createScript(e){let n,t=null,r=!0,a=2e4,o=document.getElementsByTagName("script");for(let n=0;n<o.length;n++){let a=o[n],i=a.getAttribute("src");if(i&&isStaticResourcesEqual(i,e.url)){t=a,r=!1;break}}if(!t){let n,r=e.attrs;(t=document.createElement("script")).type=(null==r?void 0:r.type)==="module"?"module":"text/javascript",e.createScriptHook&&((n=e.createScriptHook(e.url,e.attrs))instanceof HTMLScriptElement?t=n:"object"==typeof n&&("script"in n&&n.script&&(t=n.script),"timeout"in n&&n.timeout&&(a=n.timeout))),t.src||(t.src=e.url),r&&!n&&Object.keys(r).forEach(e=>{t&&("async"===e||"defer"===e?t[e]=r[e]:t.getAttribute(e)||t.setAttribute(e,r[e]))})}let i=async(r,a)=>{clearTimeout(n);let o=()=>{(null==a?void 0:a.type)==="error"?(null==e?void 0:e.onErrorCallback)&&(null==e||e.onErrorCallback(a)):(null==e?void 0:e.cb)&&(null==e||e.cb())};if(t&&(t.onerror=null,t.onload=null,safeWrapper(()=>{let{needDeleteScript:n=!0}=e;n&&(null==t?void 0:t.parentNode)&&t.parentNode.removeChild(t)}),r&&"function"==typeof r)){let e=r(a);if(e instanceof Promise){let n=await e;return o(),n}return o(),e}o()};return t.onerror=i.bind(null,t.onerror),t.onload=i.bind(null,t.onload),n=setTimeout(()=>{i(null,Error(`Remote script "${e.url}" time-outed.`))},a),{script:t,needAttach:r}}function createLink(e){let n=null,t=!0,r=document.getElementsByTagName("link");for(let a=0;a<r.length;a++){let o=r[a],i=o.getAttribute("href"),s=o.getAttribute("rel");if(i&&isStaticResourcesEqual(i,e.url)&&s===e.attrs.rel){n=o,t=!1;break}}if(!n){let t;(n=document.createElement("link")).setAttribute("href",e.url);let r=e.attrs;e.createLinkHook&&(t=e.createLinkHook(e.url,r))instanceof HTMLLinkElement&&(n=t),r&&!t&&Object.keys(r).forEach(e=>{n&&!n.getAttribute(e)&&n.setAttribute(e,r[e])})}let a=(t,r)=>{let a=()=>{(null==r?void 0:r.type)==="error"?(null==e?void 0:e.onErrorCallback)&&(null==e||e.onErrorCallback(r)):(null==e?void 0:e.cb)&&(null==e||e.cb())};if(n&&(n.onerror=null,n.onload=null,safeWrapper(()=>{let{needDeleteLink:t=!0}=e;t&&(null==n?void 0:n.parentNode)&&n.parentNode.removeChild(n)}),t)){let e=t(r);return a(),e}a()};return n.onerror=a.bind(null,n.onerror),n.onload=a.bind(null,n.onload),{link:n,needAttach:t}}function loadScript(e,n){let{attrs:t={},createScriptHook:r}=n;return new Promise((n,a)=>{let{script:o,needAttach:i}=createScript({url:e,cb:n,onErrorCallback:a,attrs:polyfills._({fetchpriority:"high"},t),createScriptHook:r,needDeleteScript:!0});i&&document.head.appendChild(o)})}function importNodeModule(e){if(!e)throw Error("import specifier is required");return Function("name","return import(name)")(e).then(e=>e).catch(n=>{throw console.error(`Error importing module ${e}:`,n),n})}let loadNodeFetch=async()=>{let e=await importNodeModule("node-fetch");return e.default||e},lazyLoaderHookFetch=async(e,n,t)=>{let r=(e,n)=>t.lifecycle.fetch.emit(e,n),a=await r(e,n||{});return a&&a instanceof Response?a:("undefined"==typeof fetch?await loadNodeFetch():fetch)(e,n||{})},createScriptNode="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(url,cb,attrs,loaderHook)=>{let urlObj;if(null==loaderHook?void 0:loaderHook.createScriptHook){let hookResult=loaderHook.createScriptHook(url);hookResult&&"object"==typeof hookResult&&"url"in hookResult&&(url=hookResult.url)}try{urlObj=new URL(url)}catch(e){console.error("Error constructing URL:",e),cb(Error(`Invalid URL: ${e}`));return}let getFetch=async()=>(null==loaderHook?void 0:loaderHook.fetch)?(e,n)=>lazyLoaderHookFetch(e,n,loaderHook):"undefined"==typeof fetch?loadNodeFetch():fetch,handleScriptFetch=async(f,urlObj)=>{try{var _vm_constants,_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER;let res=await f(urlObj.href),data=await res.text(),[path,vm]=await Promise.all([importNodeModule("path"),importNodeModule("vm")]),scriptContext={exports:{},module:{exports:{}}},urlDirname=urlObj.pathname.split("/").slice(0,-1).join("/"),filename=path.basename(urlObj.pathname),script=new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}
|
|
15
15
|
})`,{filename,importModuleDynamically:null!=(_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER=null==(_vm_constants=vm.constants)?void 0:_vm_constants.USE_MAIN_CONTEXT_DEFAULT_LOADER)?_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER:importNodeModule});script.runInThisContext()(scriptContext.exports,scriptContext.module,eval("require"),urlDirname,filename);let exportedInterface=scriptContext.module.exports||scriptContext.exports;if(attrs&&exportedInterface&&attrs.globalName){let container=exportedInterface[attrs.globalName]||exportedInterface;cb(void 0,container);return}cb(void 0,exportedInterface)}catch(e){cb(e instanceof Error?e:Error(`Script execution error: ${e}`))}};getFetch().then(async e=>{if((null==attrs?void 0:attrs.type)==="esm"||(null==attrs?void 0:attrs.type)==="module")return loadModule(urlObj.href,{fetch:e,vm:await importNodeModule("vm")}).then(async e=>{await e.evaluate(),cb(void 0,e.namespace)}).catch(e=>{cb(e instanceof Error?e:Error(`Script execution error: ${e}`))});handleScriptFetch(e,urlObj)}).catch(e=>{cb(e)})}:(e,n,t,r)=>{n(Error("createScriptNode is disabled in non-Node.js environment"))},loadScriptNode="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(e,n)=>new Promise((t,r)=>{createScriptNode(e,(e,a)=>{if(e)r(e);else{var o,i;let e=(null==n||null==(o=n.attrs)?void 0:o.globalName)||`__FEDERATION_${null==n||null==(i=n.attrs)?void 0:i.name}:custom__`;t(globalThis[e]=a)}},n.attrs,n.loaderHook)}):(e,n)=>{throw Error("loadScriptNode is disabled in non-Node.js environment")};async function loadModule(e,n){let{fetch:t,vm:r}=n,a=await t(e),o=await a.text(),i=new r.SourceTextModule(o,{importModuleDynamically:async(t,r)=>loadModule(new URL(t,e).href,n)});return await i.link(async t=>{let r=new URL(t,e).href;return await loadModule(r,n)}),i}function normalizeOptions(e,n,t){return function(r){if(!1===r)return!1;if(void 0===r)if(e)return n;else return!1;if(!0===r)return n;if(r&&"object"==typeof r)return polyfills._({},n,r);throw Error(`Unexpected type for \`${t}\`, expect boolean/undefined/object, got: ${typeof r}`)}}let createModuleFederationConfig=e=>e;exports.BROWSER_LOG_KEY=BROWSER_LOG_KEY,exports.ENCODE_NAME_PREFIX=ENCODE_NAME_PREFIX,exports.EncodedNameTransformMap=EncodedNameTransformMap,exports.FederationModuleManifest=FederationModuleManifest,exports.MANIFEST_EXT=MANIFEST_EXT,exports.MFModuleType=MFModuleType,exports.MFPrefetchCommon=MFPrefetchCommon,exports.MODULE_DEVTOOL_IDENTIFIER=MODULE_DEVTOOL_IDENTIFIER,exports.ManifestFileName=ManifestFileName,exports.NameTransformMap=NameTransformMap,exports.NameTransformSymbol=NameTransformSymbol,exports.SEPARATOR=SEPARATOR,exports.StatsFileName=StatsFileName,exports.TEMP_DIR=TEMP_DIR,exports.assert=assert,exports.composeKeyWithSeparator=composeKeyWithSeparator,exports.containerPlugin=ContainerPlugin,exports.containerReferencePlugin=ContainerReferencePlugin,exports.createLink=createLink,exports.createLogger=createLogger,exports.createModuleFederationConfig=createModuleFederationConfig,exports.createScript=createScript,exports.createScriptNode=createScriptNode,exports.decodeName=decodeName,exports.encodeName=encodeName,exports.error=error,exports.generateExposeFilename=generateExposeFilename,exports.generateShareFilename=generateShareFilename,exports.generateSnapshotFromManifest=generateSnapshotFromManifest,exports.getProcessEnv=getProcessEnv,exports.getResourceUrl=getResourceUrl,exports.inferAutoPublicPath=inferAutoPublicPath,exports.isBrowserEnv=isBrowserEnv,exports.isDebugMode=isDebugMode,exports.isManifestProvider=isManifestProvider,exports.isReactNativeEnv=isReactNativeEnv,exports.isRequiredVersion=isRequiredVersion,exports.isStaticResourcesEqual=isStaticResourcesEqual,exports.loadScript=loadScript,exports.loadScriptNode=loadScriptNode,exports.logger=logger,exports.moduleFederationPlugin=ModuleFederationPlugin,exports.normalizeOptions=normalizeOptions,exports.parseEntry=parseEntry,exports.safeToString=safeToString,exports.safeWrapper=safeWrapper,exports.sharePlugin=SharePlugin,exports.simpleJoinRemoteEntry=simpleJoinRemoteEntry,exports.warn=warn},12706:function(e,n){"use strict";function t(){return(t=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}n._=t},19945:function(e,n){"use strict";n.FEDERATION_SUPPORTED_TYPES=["script"]},51623:function(e,n,t){"use strict";var r=t(8230),a=t(19945),o=t(16742);function i(e){e.S&&!e.federation.hasAttachShareScopeMap&&e.federation.instance&&e.federation.instance.shareScopeMap&&(e.S=e.federation.instance.shareScopeMap,e.federation.hasAttachShareScopeMap=!0)}function s(e){let{chunkId:n,promises:t,chunkMapping:r,idToExternalAndNameMapping:s,webpackRequire:l,idToRemoteMap:c}=e;i(l),l.o(r,n)&&r[n].forEach(e=>{let n=l.R;n||(n=[]);let r=s[e],i=c[e];if(n.indexOf(r)>=0)return;if(n.push(r),r.p)return t.push(r.p);let u=n=>{n||(n=Error("Container missing")),"string"==typeof n.message&&(n.message+=`
|
|
16
16
|
while loading "${r[1]}" from ${r[2]}`),l.m[e]=()=>{throw n},r.p=0},d=(e,n,a,o,i,s)=>{try{let l=e(n,a);if(!l||!l.then)return i(l,o,s);{let e=l.then(e=>i(e,o),u);if(!s)return e;t.push(r.p=e)}}catch(e){u(e)}},p=(e,n,t)=>e?d(l.I,r[0],0,e,f,t):u();var f=(e,t,a)=>d(t.get,r[1],n,0,h,a),h=n=>{r.p=1,l.m[e]=e=>{e.exports=n()}};let m=()=>{try{let e=o.decodeName(i[0].name,o.ENCODE_NAME_PREFIX)+r[1].slice(1),n=l.federation.instance,t=()=>l.federation.instance.loadRemote(e,{loadFactory:!1,from:"build"});if("version-first"===n.options.shareStrategy)return Promise.all(n.sharedHandler.initializeSharing(r[0])).then(()=>t());return t()}catch(e){u(e)}};1===i.length&&a.FEDERATION_SUPPORTED_TYPES.includes(i[0].externalType)&&i[0].name?d(m,r[2],0,0,h,1):d(l,r[2],0,0,p,1)})}function l(e){let{chunkId:n,promises:t,chunkMapping:r,installedModules:a,moduleToHandlerMapping:o,webpackRequire:s}=e;i(s),s.o(r,n)&&r[n].forEach(e=>{if(s.o(a,e))return t.push(a[e]);let n=n=>{a[e]=0,s.m[e]=t=>{delete s.c[e],t.exports=n()}},r=n=>{delete a[e],s.m[e]=t=>{throw delete s.c[e],n}};try{let i=s.federation.instance;if(!i)throw Error("Federation instance not found!");let{shareKey:l,getter:c,shareInfo:u}=o[e],d=i.loadShare(l,{customShareInfo:u}).then(e=>!1===e?c():e);d.then?t.push(a[e]=d.then(n).catch(r)):n(d)}catch(e){r(e)}})}function c({shareScopeName:e,webpackRequire:n,initPromises:t,initTokens:r,initScope:o}){let s=Array.isArray(e)?e:[e];var l=[],c=function(s){o||(o=[]);let l=n.federation.instance;var c=r[s];if(c||(c=r[s]={from:l.name}),o.indexOf(c)>=0)return;o.push(c);let u=t[s];if(u)return u;var d=e=>"undefined"!=typeof console&&console.warn&&console.warn(e),p=t=>{var r=e=>d("Initialization of sharing external failed: "+e);try{var a=n(t);if(!a)return;var i=t=>t&&t.init&&t.init(n.S[s],o,{shareScopeMap:n.S||{},shareScopeKeys:e});if(a.then)return f.push(a.then(i,r));var l=i(a);if(l&&"boolean"!=typeof l&&l.then)return f.push(l.catch(r))}catch(e){r(e)}};let f=l.initializeSharing(s,{strategy:l.options.shareStrategy,initScope:o,from:"build"});i(n);let h=n.federation.bundlerRuntimeOptions.remotes;return(h&&Object.keys(h.idToRemoteMap).forEach(e=>{let n=h.idToRemoteMap[e],t=h.idToExternalAndNameMapping[e][2];if(n.length>1)p(t);else if(1===n.length){let e=n[0];a.FEDERATION_SUPPORTED_TYPES.includes(e.externalType)||p(t)}}),f.length)?t[s]=Promise.all(f).then(()=>t[s]=!0):t[s]=!0};return s.forEach(e=>{l.push(c(e))}),Promise.all(l).then(()=>!0)}function u(e){let{moduleId:n,moduleToHandlerMapping:t,webpackRequire:r}=e,a=r.federation.instance;if(!a)throw Error("Federation instance not found!");let{shareKey:o,shareInfo:i}=t[n];try{return a.loadShareSync(o,{customShareInfo:i})}catch(e){throw console.error('loadShareSync failed! The function should not be called unless you set "eager:true". If you do not set it, and encounter this issue, you can check whether an async boundary is implemented.'),console.error("The original error message is as follows: "),e}}function d(e){let{moduleToHandlerMapping:n,webpackRequire:t,installedModules:r,initialConsumes:a}=e;a.forEach(e=>{t.m[e]=a=>{r[e]=0,delete t.c[e];let o=u({moduleId:e,moduleToHandlerMapping:n,webpackRequire:t});if("function"!=typeof o)throw Error(`Shared module is not available for eager consumption: ${e}`);a.exports=o()}})}function p(){return(p=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}function f(e){let{webpackRequire:n,shareScope:t,initScope:r,shareScopeKey:a,remoteEntryInitOptions:o}=e;if(!n.S||!n.federation||!n.federation.instance||!n.federation.initOptions)return;let i=n.federation.instance;i.initOptions(p({name:n.federation.initOptions.name,remotes:[]},o));let s=null==o?void 0:o.shareScopeKeys,l=null==o?void 0:o.shareScopeMap;if(a&&"string"!=typeof a)a.forEach(e=>{if(!s||!l)return void i.initShareScopeMap(e,t,{hostShareScopeMap:(null==o?void 0:o.shareScopeMap)||{}});l[e]||(l[e]={});let n=l[e];i.initShareScopeMap(e,n,{hostShareScopeMap:(null==o?void 0:o.shareScopeMap)||{}})});else{let e=a||"default";Array.isArray(s)?s.forEach(e=>{l[e]||(l[e]={});let n=l[e];i.initShareScopeMap(e,n,{hostShareScopeMap:(null==o?void 0:o.shareScopeMap)||{}})}):i.initShareScopeMap(e,t,{hostShareScopeMap:(null==o?void 0:o.shareScopeMap)||{}})}return(n.federation.attachShareScopeMap&&n.federation.attachShareScopeMap(n),"function"==typeof n.federation.prefetch&&n.federation.prefetch(),Array.isArray(a))?n.federation.initOptions.shared?n.I(a,r):Promise.all(a.map(e=>n.I(e,r))).then(()=>!0):n.I(a||"default",r)}e.exports={runtime:function(e){var n=Object.create(null);if(e)for(var t in e)n[t]=e[t];return n.default=e,Object.freeze(n)}(r),instance:void 0,initOptions:void 0,bundlerRuntime:{remotes:s,consumes:l,I:c,S:{},installInitialConsumes:d,initContainerEntry:f},attachShareScopeMap:i,bundlerRuntimeOptions:{}}},77113:function(e){!function(){"use strict";var n={}.hasOwnProperty;function t(){for(var e="",n=0;n<arguments.length;n++){var t=arguments[n];t&&(e=a(e,r(t)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return t.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var r="";for(var o in e)n.call(e,o)&&e[o]&&(r=a(r,o));return r}function a(e,n){return n?e?e+" "+n:e+n:e}e.exports?(t.default=t,e.exports=t):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return t}):window.classNames=t}()},79736:function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw TypeError("Cannot call a class as a function")}t.d(n,{A:()=>r})},36678:function(e,n,t){"use strict";t.d(n,{A:()=>o});var r=t(33780);function a(e,n){for(var t=0;t<n.length;t++){var a=n[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,(0,r.A)(a.key),a)}}function o(e,n,t){return n&&a(e.prototype,n),t&&a(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}},93442:function(e,n,t){"use strict";t.d(n,{A:()=>a});var r=t(33780);function a(e,n,t){return(n=(0,r.A)(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}},25391:function(e,n,t){"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(null,arguments)}t.d(n,{A:()=>r})},98423:function(e,n,t){"use strict";function r(e,n){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e})(e,n)}t.d(n,{A:()=>r})},33780:function(e,n,t){"use strict";t.d(n,{A:()=>o});var r=t(85761);function a(e,n){if("object"!=(0,r.A)(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,n||"default");if("object"!=(0,r.A)(a))return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}function o(e){var n=a(e,"string");return"symbol"==(0,r.A)(n)?n:n+""}},85761:function(e,n,t){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}t.d(n,{A:()=>r})},9994:function(e,n,t){"use strict";let r,a,o,i,s,l,c,u,d,p,f,h,m,g,A,y,b,v,C,$,w,k,E,x,D,S,z,B,M,T,O,N,P,I,F,R,H,L,j,q,G,V,U,W,K,Z,Y,J,X,Q,ee,en,et,er,ea,eo,ei,es,el,ec,eu,ed,ep,ef;t.d(n,{Wh:()=>e1,bl:()=>zE});var e_,eh,em,eg,eA,ey=t(35400),eb=((s=eb||{}).RENDER_FINISHED="render-finished",s.RESIZE="chart-resize",s.MOUSEOVER="chart-mouseover",s.MOUSEOUT="chart-mouseout",s),ev=((l=ev||{}).SHOW="show-modal",l.HIDE="hide-modal",l),eC=((c=eC||{}).UPDATE="model-update",c),e$=((u=e$||{}).SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",u.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",u.BUTTON_CLICK="toolbar-button-click",u.SHOW_TOOLTIP="toolbar-show-tooltip",u.HIDE_TOOLTIP="toolbar-hide-tooltip",u),ew=((d=ew||{}).UPDATE="zoom-bar-update",d.SELECTION_START="zoom-bar-selection-start",d.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",d.SELECTION_END="zoom-bar-selection-end",d),ek=((p=ek||{}).CHANGE="zoom-domain-change",p),eE=((f=eE||{}).CANVAS_ZOOM_IN="canvas-zoom-in",f.CANVAS_ZOOM_OUT="canvas-zoom-out",f),ex=((h=ex||{}).LABEL_MOUSEOVER="axis-label-mouseover",h.LABEL_MOUSEMOVE="axis-label-mousemove",h.LABEL_CLICK="axis-label-click",h.LABEL_MOUSEOUT="axis-label-mouseout",h.LABEL_FOCUS="axis-label-focus",h.LABEL_BLUR="axis-label-blur",h.RENDER_COMPLETE="axis-render-complete",h),eD=((m=eD||{}).POINT_MOUSEOVER="scatter-mouseover",m.POINT_MOUSEMOVE="scatter-mousemove",m.POINT_CLICK="scatter-click",m.POINT_MOUSEOUT="scatter-mouseout",m),eS=((g=eS||{}).WORD_MOUSEOVER="wordcloud-word-mouseover",g.WORD_MOUSEMOVE="wordcloud-word-mousemove",g.WORD_CLICK="wordcloud-word-click",g.WORD_MOUSEOUT="wordcloud-word-mouseout",g),ez=((A=ez||{}).SLICE_MOUSEOVER="pie-slice-mouseover",A.SLICE_MOUSEMOVE="pie-slice-mousemove",A.SLICE_CLICK="pie-slice-click",A.SLICE_MOUSEOUT="pie-slice-mouseout",A),eB=((y=eB||{}).ARC_MOUSEOVER="gauge-arc-mouseover",y.ARC_MOUSEMOVE="gauge-arc-mousemove",y.ARC_CLICK="gauge-arc-click",y.ARC_MOUSEOUT="gauge-arc-mouseout",y),eM=((b=eM||{}).BAR_MOUSEOVER="bar-mouseover",b.BAR_MOUSEMOVE="bar-mousemove",b.BAR_CLICK="bar-click",b.BAR_MOUSEOUT="bar-mouseout",b),eT=((v=eT||{}).BOX_MOUSEOVER="box-mouseover",v.BOX_MOUSEMOVE="box-mousemove",v.BOX_CLICK="box-click",v.BOX_MOUSEOUT="box-mouseout",v.OUTLIER_MOUSEOVER="outlier-mouseover",v.OUTLIER_MOUSEMOVE="outlier-mousemove",v.OUTLIER_CLICK="outlier-click",v.OUTLIER_MOUSEOUT="outlier-mouseout",v),eO=((C=eO||{}).SCATTER_MOUSEOVER="scatter-mouseover",C.SCATTER_MOUSEMOVE="scatter-mousemove",C.SCATTER_CLICK="scatter-click",C.SCATTER_MOUSEOUT="scatter-mouseout",C),eN=(($=eN||{}).POINT_MOUSEOVER="scatter-mouseover",$.POINT_MOUSEMOVE="scatter-mousemove",$.POINT_CLICK="scatter-click",$.POINT_MOUSEOUT="scatter-mouseout",$),eP=((w=eP||{}).X_AXIS_MOUSEOVER="radar-x-axis-mouseover",w.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",w.X_AXIS_CLICK="radar-x-axis-click",w.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",w),eI=((k=eI||{}).NODE_MOUSEOVER="tree-node-mouseover",k.NODE_CLICK="tree-node-click",k.NODE_MOUSEOUT="tree-node-mouseout",k),eF=((E=eF||{}).LEAF_MOUSEOVER="leaf-mouseover",E.LEAF_MOUSEMOVE="leaf-mousemove",E.LEAF_CLICK="leaf-click",E.LEAF_MOUSEOUT="leaf-mouseout",E),eR=((x=eR||{}).SHOW="show-tooltip",x.MOVE="move-tooltip",x.HIDE="hide-tooltip",x),eH=((D=eH||{}).SHOW="show-threshold",D.HIDE="hide-threshold",D),eL=((S=eL||{}).ITEM_HOVER="legend-item-onhover",S.ITEM_CLICK="legend-item-onclick",S.ITEM_MOUSEOUT="legend-item-onmouseout",S.ITEMS_UPDATE="legend-items-update",S),ej=((z=ej||{}).CIRCLE_MOUSEOVER="circle-leaf-mouseover",z.CIRCLE_CLICK="circle-leaf-click",z.CIRCLE_MOUSEOUT="circle-leaf-mouseout",z.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",z),eq=((B=eq||{}).NODE_MOUSEOVER="alluvial-node-mouseover",B.NODE_CLICK="alluvial-node-click",B.NODE_MOUSEOUT="alluvial-node-mouseout",B.NODE_MOUSEMOVE="alluvial-node-mousemove",B.LINE_MOUSEOVER="alluvial-line-mouseover",B.LINE_CLICK="alluvial-line-click",B.LINE_MOUSEOUT="alluvial-line-mouseout",B.LINE_MOUSEMOVE="alluvial-line-mousemove",B),eG=((M=eG||{}).METER_MOUSEOVER="meter-mouseover",M.METER_CLICK="meter-click",M.METER_MOUSEOUT="meter-mouseout",M.METER_MOUSEMOVE="meter-mousemove",M),eV=((T=eV||{}).HEATMAP_MOUSEOVER="heatmap-mouseover",T.HEATMAP_CLICK="heatmap-click",T.HEATMAP_MOUSEOUT="heatmap-mouseout",T.HEATMAP_MOUSEMOVE="hetmap-mousemove",T),eU=((O=eU||{}).CHOROPLETH_MOUSEOVER="choropleth-mouseover",O.CHOROPLETH_CLICK="choropleth-click",O.CHOROPLETH_MOUSEOUT="choropleth-mouseout",O.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",O);let eW=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:eq,Area:eD,Axis:ex,Bar:eM,Boxplot:eT,CanvasZoom:eE,Chart:eb,Choropleth:eU,CirclePack:ej,Gauge:eB,Heatmap:eV,Legend:eL,Line:eN,Meter:eG,Modal:ev,Model:eC,Pie:ez,Radar:eP,Scatter:eO,Threshold:eH,Toolbar:e$,Tooltip:eR,Tree:eI,Treemap:eF,WordCloud:eS,ZoomBar:ew,ZoomDomain:ek},Symbol.toStringTag,{value:"Module"}));var eK=((N=eK||{}).HTML="html",N.SVG="svg",N),eZ=((P=eZ||{}).WHITE="white",P.G100="g100",P.G90="g90",P.G10="g10",P),eY=((I=eY||{}).BACKGROUND="background",I.FILL="fill",I.STROKE="stroke",I.TOOLTIP="tooltip",I),eJ=((F=eJ||{}).LEFT="left",F.RIGHT="right",F.TOP="top",F.BOTTOM="bottom",F),eX=((R=eX||{}).GRAPH_VIEW="graph_view",R.SLIDER_VIEW="slider_view",R),eQ=((H=eQ||{}).END_LINE="end_line",H.MID_LINE="mid_line",H.FRONT_LINE="front_line",H.NONE="none",H),e0=((L=e0||{}).VERTICAL="vertical",L.HORIZONTAL="horizontal",L),e1=((j=e1||{}).TIME="time",j.LINEAR="linear",j.LOG="log",j.LABELS="labels",j.LABELS_RATIO="labels-ratio",j),e2=((q=e2||{}).RIGHT="right",q.LEFT="left",q.TOP="top",q.BOTTOM="bottom",q),e3=((G=e3||{}).LEFT="left",G.CENTER="center",G.RIGHT="right",G),e4=((V=e4||{}).HORIZONTAL="horizontal",V.VERTICAL="vertical",V),e5=((U=e5||{}).TREE="tree",U.DENDROGRAM="dendrogram",U),e6=((W=e6||{}).ROW="row",W.COLUMN="column",W.ROW_REVERSE="row-reverse",W.COLUMN_REVERSE="column-reverse",W),e8=((K=e8||{}).FIXED="fixed",K.PREFERRED="preferred",K.STRETCH="stretch",K),e7=((Z=e7||{}).CENTER="center",Z),e9=((Y=e9||{}).LEFT="left",Y.RIGHT="right",Y),ne=((J=ne||{}).GRID="grid",J.VERT_OR_HORIZ="vertOrHoriz",J.PIE="pie",J.DONUT="donut",J),nn=((X=nn||{}).START="start",X.MIDDLE="middle",X.END="end",X),nt=((Q=nt||{}).BASELINE="baseline",Q.MIDDLE="middle",Q.HANGING="hanging",Q),nr=((ee=nr||{}).SEMI="semi",ee.FULL="full",ee),na=((en=na||{}).UP="up",en.DOWN="down",en),no=((et=no||{}).SUCCESS="success",et.WARNING="warning",et.DANGER="danger",et),ni=((er=ni||{}).ALWAYS="always",er.AUTO="auto",er.NEVER="never",er),ns=((ea=ns||{}).SCATTER="scatter",ea.LINE="line",ea.SIMPLE_BAR="simple-bar",ea.STACKED_BAR="stacked-bar",ea.GROUPED_BAR="grouped-bar",ea.AREA="area",ea.STACKED_AREA="stacked-area",ea),nl=((eo=nl||{}).EXPORT_CSV="Export as CSV",eo.EXPORT_PNG="Export as PNG",eo.EXPORT_JPG="Export as JPG",eo.ZOOM_IN="Zoom in",eo.ZOOM_OUT="Zoom out",eo.RESET_ZOOM="Reset zoom",eo.MAKE_FULLSCREEN="Make fullscreen",eo.EXIT_FULLSCREEN="Exit fullscreen",eo.SHOW_AS_DATATABLE="Show as data-table",eo.CUSTOM="Custom",eo),nc=((ei=nc||{}).LEFT="left",ei.RIGHT="right",ei),nu=((es=nu||{}).CHECKBOX="checkbox",es.RADIUS="radius",es.AREA="area",es.SIZE="size",es.LINE="line",es.QUARTILE="quartile",es.ZOOM="zoom",es),nd=((el=nd||{}).LINEAR="linear",el.QUANTIZE="quantize",el),np=((ec=np||{}).ON="on",ec.AUTO="auto",ec.OFF="off",ec),nf=((eu=nf||{}).DEFAULT="default",eu.HOVERABLE="hoverable",eu),n_=((ed=n_||{}).geoEqualEarth="geoEqualEarth",ed.geoAlbers="geoAlbers",ed.geoConicEqualArea="geoConicEqualArea",ed.geoConicEquidistant="geoConicEquidistant",ed.geoEquirectangular="geoEquirectangular",ed.geoMercator="geoMercator",ed.geoNaturalEarth1="geoNaturalEarth1",ed),nh=((ep=nh||{})["15seconds"]="15seconds",ep.minute="minute",ep["30minutes"]="30minutes",ep.hourly="hourly",ep.daily="daily",ep.weekly="weekly",ep.monthly="monthly",ep.quarterly="quarterly",ep.yearly="yearly",ep);function nm(e){return (n={})=>{let t=n.width?String(n.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}function ng(e){return(n,t)=>{let r;if("formatting"===(t?.context?String(t.context):"standalone")&&e.formattingValues){let n=e.defaultFormattingWidth||e.defaultWidth,a=t?.width?String(t.width):n;r=e.formattingValues[a]||e.formattingValues[n]}else{let n=e.defaultWidth,a=t?.width?String(t.width):e.defaultWidth;r=e.values[a]||e.values[n]}return r[e.argumentCallback?e.argumentCallback(n):n]}}function nA(e){return(n,t={})=>{let r,a=t.width,o=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],i=n.match(o);if(!i)return null;let s=i[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?nb(l,e=>e.test(s)):ny(l,e=>e.test(s));return r=e.valueCallback?e.valueCallback(c):c,{value:r=t.valueCallback?t.valueCallback(r):r,rest:n.slice(s.length)}}}function ny(e,n){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&n(e[t]))return t}function nb(e,n){for(let t=0;t<e.length;t++)if(n(e[t]))return t}function nv(e){return(n,t={})=>{let r=n.match(e.matchPattern);if(!r)return null;let a=r[0],o=n.match(e.parsePattern);if(!o)return null;let i=e.valueCallback?e.valueCallback(o[0]):o[0];return{value:i=t.valueCallback?t.valueCallback(i):i,rest:n.slice(a.length)}}}let nC=6048e5,n$=864e5,nw=6e4,nk=36e5,nE=Symbol.for("constructDateFrom");function nx(e,n){return"function"==typeof e?e(n):e&&"object"==typeof e&&nE in e?e[nE](n):e instanceof Date?new e.constructor(n):new Date(n)}function nD(e,...n){let t=nx.bind(null,n.find(e=>"object"==typeof e));return n.map(t)}let nS={};function nz(){return nS}function nB(e,n){return nx(n||e,e)}function nM(e,n){let t=nz(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??t.weekStartsOn??t.locale?.options?.weekStartsOn??0,a=nB(e,n?.in),o=a.getDay(),i=7*(o<r)+o-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}let nT={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},nO=(e,n,t)=>{let r,a=nT[e];return r="string"==typeof a?a:1===n?a.one:a.other.replace("{{count}}",n.toString()),t?.addSuffix?t.comparison&&t.comparison>0?"in "+r:r+" ago":r},nN={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},nP=(e,n,t,r)=>nN[e],nI={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nF={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},nR={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},nH={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},nL={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},nj={ordinalNumber:(e,n)=>{let t=Number(e),r=t%100;if(r>20||r<10)switch(r%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:ng({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ng({values:nI,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ng({values:nF,defaultWidth:"wide"}),day:ng({values:nR,defaultWidth:"wide"}),dayPeriod:ng({values:nH,defaultWidth:"wide",formattingValues:nL,defaultFormattingWidth:"wide"})},nq={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},nG={any:[/^b/i,/^(a|c)/i]},nV={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},nU={any:[/1/i,/2/i,/3/i,/4/i]},nW={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},nK={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},nZ={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},nY={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},nJ={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},nX={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},nQ={ordinalNumber:nv({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:nA({matchPatterns:nq,defaultMatchWidth:"wide",parsePatterns:nG,defaultParseWidth:"any"}),quarter:nA({matchPatterns:nV,defaultMatchWidth:"wide",parsePatterns:nU,defaultParseWidth:"any",valueCallback:e=>e+1}),month:nA({matchPatterns:nW,defaultMatchWidth:"wide",parsePatterns:nK,defaultParseWidth:"any"}),day:nA({matchPatterns:nZ,defaultMatchWidth:"wide",parsePatterns:nY,defaultParseWidth:"any"}),dayPeriod:nA({matchPatterns:nJ,defaultMatchWidth:"any",parsePatterns:nX,defaultParseWidth:"any"})},n0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},n1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},n2={code:"en-US",formatDistance:nO,formatLong:{date:nm({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:nm({formats:n0,defaultWidth:"full"}),dateTime:nm({formats:n1,defaultWidth:"full"})},formatRelative:nP,localize:nj,match:nQ,options:{weekStartsOn:0,firstWeekContainsDate:1}};var n3="object"==typeof global&&global&&global.Object===Object&&global,n4="object"==typeof self&&self&&self.Object===Object&&self,n5=n3||n4||Function("return this")(),n6=n5.Symbol,n8=Object.prototype,n7=n8.hasOwnProperty,n9=n8.toString,te=n6?n6.toStringTag:void 0;function tn(e){var n=n7.call(e,te),t=e[te];try{e[te]=void 0;var r=!0}catch{}var a=n9.call(e);return r&&(n?e[te]=t:delete e[te]),a}var tt=Object.prototype.toString;function tr(e){return tt.call(e)}var ta="[object Null]",to="[object Undefined]",ti=n6?n6.toStringTag:void 0;function ts(e){return null==e?void 0===e?to:ta:ti&&ti in Object(e)?tn(e):tr(e)}function tl(e){return null!=e&&"object"==typeof e}var tc="[object Symbol]";function tu(e){return"symbol"==typeof e||tl(e)&&ts(e)==tc}function td(e,n){for(var t=-1,r=null==e?0:e.length,a=Array(r);++t<r;)a[t]=n(e[t],t,e);return a}var tp=Array.isArray,tf=n6?n6.prototype:void 0,t_=tf?tf.toString:void 0;function th(e){if("string"==typeof e)return e;if(tp(e))return td(e,th)+"";if(tu(e))return t_?t_.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}function tm(e){var n=typeof e;return null!=e&&("object"==n||"function"==n)}function tg(e){return e}var tA="[object AsyncFunction]",ty="[object Function]",tb="[object GeneratorFunction]",tv="[object Proxy]";function tC(e){if(!tm(e))return!1;var n=ts(e);return n==ty||n==tb||n==tA||n==tv}var t$=n5["__core-js_shared__"],tw=function(){var e=/[^.]+$/.exec(t$&&t$.keys&&t$.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function tk(e){return!!tw&&tw in e}var tE=Function.prototype.toString;function tx(e){if(null!=e){try{return tE.call(e)}catch{}try{return e+""}catch{}}return""}var tD=/[\\^$.*+?()[\]{}|]/g,tS=/^\[object .+?Constructor\]$/,tz=Object.prototype,tB=Function.prototype.toString,tM=tz.hasOwnProperty,tT=RegExp("^"+tB.call(tM).replace(tD,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tO(e){return!(!tm(e)||tk(e))&&(tC(e)?tT:tS).test(tx(e))}function tN(e,n){return e?.[n]}function tP(e,n){var t=tN(e,n);return tO(t)?t:void 0}var tI=tP(n5,"WeakMap"),tF=Object.create,tR=function(){function e(){}return function(n){if(!tm(n))return{};if(tF)return tF(n);e.prototype=n;var t=new e;return e.prototype=void 0,t}}();function tH(e,n,t){switch(t.length){case 0:return e.call(n);case 1:return e.call(n,t[0]);case 2:return e.call(n,t[0],t[1]);case 3:return e.call(n,t[0],t[1],t[2])}return e.apply(n,t)}function tL(){}function tj(e,n){var t=-1,r=e.length;for(n||(n=Array(r));++t<r;)n[t]=e[t];return n}var tq=800,tG=16,tV=Date.now;function tU(e){var n=0,t=0;return function(){var r=tV(),a=tG-(r-t);if(t=r,a>0){if(++n>=tq)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}function tW(e){return function(){return e}}var tK=function(){try{var e=tP(Object,"defineProperty");return e({},"",{}),e}catch{}}(),tZ=tU(tK?function(e,n){return tK(e,"toString",{configurable:!0,enumerable:!1,value:tW(n),writable:!0})}:tg);function tY(e,n){for(var t=-1,r=null==e?0:e.length;++t<r&&!1!==n(e[t],t,e););return e}function tJ(e,n,t,r){for(var a=e.length,o=t+-1;++o<a;)if(n(e[o],o,e))return o;return -1}function tX(e){return e!=e}function tQ(e,n,t){for(var r=t-1,a=e.length;++r<a;)if(e[r]===n)return r;return -1}function t0(e,n,t){return n==n?tQ(e,n,t):tJ(e,tX,t)}function t1(e,n){return!!(null==e?0:e.length)&&t0(e,n,0)>-1}var t2=0x1fffffffffffff,t3=/^(?:0|[1-9]\d*)$/;function t4(e,n){var t=typeof e;return!!(n=n??t2)&&("number"==t||"symbol"!=t&&t3.test(e))&&e>-1&&e%1==0&&e<n}function t5(e,n,t){"__proto__"==n&&tK?tK(e,n,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[n]=t}function t6(e,n){return e===n||e!=e&&n!=n}var t8=Object.prototype.hasOwnProperty;function t7(e,n,t){var r=e[n];t8.call(e,n)&&t6(r,t)&&(void 0!==t||n in e)||t5(e,n,t)}function t9(e,n,t,r){var a=!t;t||(t={});for(var o=-1,i=n.length;++o<i;){var s=n[o],l=void 0;void 0===l&&(l=e[s]),a?t5(t,s,l):t7(t,s,l)}return t}var re=Math.max;function rn(e,n,t){return n=re(void 0===n?e.length-1:n,0),function(){for(var r=arguments,a=-1,o=re(r.length-n,0),i=Array(o);++a<o;)i[a]=r[n+a];a=-1;for(var s=Array(n+1);++a<n;)s[a]=r[a];return s[n]=t(i),tH(e,this,s)}}function rt(e,n){return tZ(rn(e,n,tg),e+"")}var rr=0x1fffffffffffff;function ra(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=rr}function ro(e){return null!=e&&ra(e.length)&&!tC(e)}function ri(e,n,t){if(!tm(t))return!1;var r=typeof n;return("number"==r?!!(ro(t)&&t4(n,t.length)):"string"==r&&n in t)&&t6(t[n],e)}function rs(e){return rt(function(n,t){var r=-1,a=t.length,o=a>1?t[a-1]:void 0,i=a>2?t[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,i&&ri(t[0],t[1],i)&&(o=a<3?void 0:o,a=1),n=Object(n);++r<a;){var s=t[r];s&&e(n,s,r,o)}return n})}var rl=Object.prototype;function rc(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||rl)}function ru(e,n){for(var t=-1,r=Array(e);++t<e;)r[t]=n(t);return r}var rd="[object Arguments]";function rp(e){return tl(e)&&ts(e)==rd}var rf=Object.prototype,r_=rf.hasOwnProperty,rh=rf.propertyIsEnumerable,rm=rp(function(){return arguments}())?rp:function(e){return tl(e)&&r_.call(e,"callee")&&!rh.call(e,"callee")};function rg(){return!1}var rA="object"==typeof exports&&exports&&!exports.nodeType&&exports,ry=rA&&"object"==typeof module&&module&&!module.nodeType&&module,rb=ry&&ry.exports===rA?n5.Buffer:void 0,rv=(rb?rb.isBuffer:void 0)||rg,rC="[object Arguments]",r$="[object Array]",rw="[object Boolean]",rk="[object Date]",rE="[object Error]",rx="[object Function]",rD="[object Map]",rS="[object Number]",rz="[object Object]",rB="[object RegExp]",rM="[object Set]",rT="[object String]",rO="[object WeakMap]",rN="[object ArrayBuffer]",rP="[object DataView]",rI="[object Float64Array]",rF="[object Int8Array]",rR="[object Int16Array]",rH="[object Int32Array]",rL="[object Uint8Array]",rj="[object Uint8ClampedArray]",rq="[object Uint16Array]",rG="[object Uint32Array]",rV={};function rU(e){return tl(e)&&ra(e.length)&&!!rV[ts(e)]}function rW(e){return function(n){return e(n)}}rV["[object Float32Array]"]=rV[rI]=rV[rF]=rV[rR]=rV[rH]=rV[rL]=rV[rj]=rV[rq]=rV[rG]=!0,rV[rC]=rV[r$]=rV[rN]=rV[rw]=rV[rP]=rV[rk]=rV[rE]=rV[rx]=rV[rD]=rV[rS]=rV[rz]=rV[rB]=rV[rM]=rV[rT]=rV[rO]=!1;var rK="object"==typeof exports&&exports&&!exports.nodeType&&exports,rZ=rK&&"object"==typeof module&&module&&!module.nodeType&&module,rY=rZ&&rZ.exports===rK&&n3.process,rJ=function(){try{return rZ&&rZ.require&&rZ.require("util").types||rY&&rY.binding&&rY.binding("util")}catch{}}(),rX=rJ&&rJ.isTypedArray,rQ=rX?rW(rX):rU,r0=Object.prototype.hasOwnProperty;function r1(e,n){var t=tp(e),r=!t&&rm(e),a=!t&&!r&&rv(e),o=!t&&!r&&!a&&rQ(e),i=t||r||a||o,s=i?ru(e.length,String):[],l=s.length;for(var c in e)(n||r0.call(e,c))&&!(i&&("length"==c||a&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||t4(c,l)))&&s.push(c);return s}function r2(e,n){return function(t){return e(n(t))}}var r3=r2(Object.keys,Object),r4=Object.prototype.hasOwnProperty;function r5(e){if(!rc(e))return r3(e);var n=[];for(var t in Object(e))r4.call(e,t)&&"constructor"!=t&&n.push(t);return n}function r6(e){return ro(e)?r1(e):r5(e)}function r8(e){var n=[];if(null!=e)for(var t in Object(e))n.push(t);return n}var r7=Object.prototype.hasOwnProperty;function r9(e){if(!tm(e))return r8(e);var n=rc(e),t=[];for(var r in e)"constructor"==r&&(n||!r7.call(e,r))||t.push(r);return t}function ae(e){return ro(e)?r1(e,!0):r9(e)}var an=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,at=/^\w*$/;function ar(e,n){if(tp(e))return!1;var t=typeof e;return!!("number"==t||"symbol"==t||"boolean"==t||null==e||tu(e))||at.test(e)||!an.test(e)||null!=n&&e in Object(n)}var aa=tP(Object,"create");function ao(){this.__data__=aa?aa(null):{},this.size=0}function ai(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=!!n,n}var as="__lodash_hash_undefined__",al=Object.prototype.hasOwnProperty;function ac(e){var n=this.__data__;if(aa){var t=n[e];return t===as?void 0:t}return al.call(n,e)?n[e]:void 0}var au=Object.prototype.hasOwnProperty;function ad(e){var n=this.__data__;return aa?void 0!==n[e]:au.call(n,e)}var ap="__lodash_hash_undefined__";function af(e,n){var t=this.__data__;return this.size+=+!this.has(e),t[e]=aa&&void 0===n?ap:n,this}function a_(e){var n=-1,t=null==e?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}function ah(){this.__data__=[],this.size=0}function am(e,n){for(var t=e.length;t--;)if(t6(e[t][0],n))return t;return -1}a_.prototype.clear=ao,a_.prototype.delete=ai,a_.prototype.get=ac,a_.prototype.has=ad,a_.prototype.set=af;var ag=Array.prototype.splice;function aA(e){var n=this.__data__,t=am(n,e);return!(t<0)&&(t==n.length-1?n.pop():ag.call(n,t,1),--this.size,!0)}function ay(e){var n=this.__data__,t=am(n,e);return t<0?void 0:n[t][1]}function ab(e){return am(this.__data__,e)>-1}function av(e,n){var t=this.__data__,r=am(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this}function aC(e){var n=-1,t=null==e?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}aC.prototype.clear=ah,aC.prototype.delete=aA,aC.prototype.get=ay,aC.prototype.has=ab,aC.prototype.set=av;var a$=tP(n5,"Map");function aw(){this.size=0,this.__data__={hash:new a_,map:new(a$||aC),string:new a_}}function ak(e){var n=typeof e;return"string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==e:null===e}function aE(e,n){var t=e.__data__;return ak(n)?t["string"==typeof n?"string":"hash"]:t.map}function ax(e){var n=aE(this,e).delete(e);return this.size-=!!n,n}function aD(e){return aE(this,e).get(e)}function aS(e){return aE(this,e).has(e)}function az(e,n){var t=aE(this,e),r=t.size;return t.set(e,n),this.size+=+(t.size!=r),this}function aB(e){var n=-1,t=null==e?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}aB.prototype.clear=aw,aB.prototype.delete=ax,aB.prototype.get=aD,aB.prototype.has=aS,aB.prototype.set=az;var aM="Expected a function";function aT(e,n){if("function"!=typeof e||null!=n&&"function"!=typeof n)throw TypeError(aM);var t=function(){var r=arguments,a=n?n.apply(this,r):r[0],o=t.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return t.cache=o.set(a,i)||o,i};return t.cache=new(aT.Cache||aB),t}aT.Cache=aB;var aO=500,aN=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,aP=/\\(\\)?/g,aI=function(e){var n=aT(e,function(e){return t.size===aO&&t.clear(),e}),t=n.cache;return n}(function(e){var n=[];return 46===e.charCodeAt(0)&&n.push(""),e.replace(aN,function(e,t,r,a){n.push(r?a.replace(aP,"$1"):t||e)}),n});function aF(e){return null==e?"":th(e)}function aR(e,n){return tp(e)?e:ar(e,n)?[e]:aI(aF(e))}function aH(e){if("string"==typeof e||tu(e))return e;var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}function aL(e,n){n=aR(n,e);for(var t=0,r=n.length;null!=e&&t<r;)e=e[aH(n[t++])];return t&&t==r?e:void 0}function aj(e,n,t){var r=null==e?void 0:aL(e,n);return void 0===r?t:r}function aq(e,n){for(var t=-1,r=n.length,a=e.length;++t<r;)e[a+t]=n[t];return e}var aG=n6?n6.isConcatSpreadable:void 0;function aV(e){return tp(e)||rm(e)||!!(aG&&e&&e[aG])}function aU(e,n,t,r,a){var o=-1,i=e.length;for(t||(t=aV),a||(a=[]);++o<i;){var s=e[o];n>0&&t(s)?n>1?aU(s,n-1,t,r,a):aq(a,s):r||(a[a.length]=s)}return a}var aW=r2(Object.getPrototypeOf,Object),aK="[object Object]",aZ=Object.prototype,aY=Function.prototype.toString,aJ=aZ.hasOwnProperty,aX=aY.call(Object);function aQ(e){if(!tl(e)||ts(e)!=aK)return!1;var n=aW(e);if(null===n)return!0;var t=aJ.call(n,"constructor")&&n.constructor;return"function"==typeof t&&t instanceof t&&aY.call(t)==aX}function a0(){this.__data__=new aC,this.size=0}function a1(e){var n=this.__data__,t=n.delete(e);return this.size=n.size,t}function a2(e){return this.__data__.get(e)}function a3(e){return this.__data__.has(e)}var a4=200;function a5(e,n){var t=this.__data__;if(t instanceof aC){var r=t.__data__;if(!a$||r.length<a4-1)return r.push([e,n]),this.size=++t.size,this;t=this.__data__=new aB(r)}return t.set(e,n),this.size=t.size,this}function a6(e){var n=this.__data__=new aC(e);this.size=n.size}function a8(e,n){return e&&t9(n,r6(n),e)}function a7(e,n){return e&&t9(n,ae(n),e)}a6.prototype.clear=a0,a6.prototype.delete=a1,a6.prototype.get=a2,a6.prototype.has=a3,a6.prototype.set=a5;var a9="object"==typeof exports&&exports&&!exports.nodeType&&exports,oe=a9&&"object"==typeof module&&module&&!module.nodeType&&module,on=oe&&oe.exports===a9?n5.Buffer:void 0,ot=on?on.allocUnsafe:void 0;function or(e,n){if(n)return e.slice();var t=e.length,r=ot?ot(t):new e.constructor(t);return e.copy(r),r}function oa(e,n){for(var t=-1,r=null==e?0:e.length,a=0,o=[];++t<r;){var i=e[t];n(i,t,e)&&(o[a++]=i)}return o}function oo(){return[]}var oi=Object.prototype.propertyIsEnumerable,os=Object.getOwnPropertySymbols,ol=os?function(e){return null==e?[]:oa(os(e=Object(e)),function(n){return oi.call(e,n)})}:oo;function oc(e,n){return t9(e,ol(e),n)}var ou=Object.getOwnPropertySymbols?function(e){for(var n=[];e;)aq(n,ol(e)),e=aW(e);return n}:oo;function od(e,n){return t9(e,ou(e),n)}function op(e,n,t){var r=n(e);return tp(e)?r:aq(r,t(e))}function of(e){return op(e,r6,ol)}function o_(e){return op(e,ae,ou)}var oh=tP(n5,"DataView"),om=tP(n5,"Promise"),og=tP(n5,"Set"),oA="[object Map]",oy="[object Object]",ob="[object Promise]",ov="[object Set]",oC="[object WeakMap]",o$="[object DataView]",ow=tx(oh),ok=tx(a$),oE=tx(om),ox=tx(og),oD=tx(tI),oS=ts;(oh&&oS(new oh(new ArrayBuffer(1)))!=o$||a$&&oS(new a$)!=oA||om&&oS(om.resolve())!=ob||og&&oS(new og)!=ov||tI&&oS(new tI)!=oC)&&(oS=function(e){var n=ts(e),t=n==oy?e.constructor:void 0,r=t?tx(t):"";if(r)switch(r){case ow:return o$;case ok:return oA;case oE:return ob;case ox:return ov;case oD:return oC}return n});var oz=Object.prototype.hasOwnProperty;function oB(e){var n=e.length,t=new e.constructor(n);return n&&"string"==typeof e[0]&&oz.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var oM=n5.Uint8Array;function oT(e){var n=new e.constructor(e.byteLength);return new oM(n).set(new oM(e)),n}function oO(e,n){var t=n?oT(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var oN=/\w*$/;function oP(e){var n=new e.constructor(e.source,oN.exec(e));return n.lastIndex=e.lastIndex,n}var oI=n6?n6.prototype:void 0,oF=oI?oI.valueOf:void 0;function oR(e){return oF?Object(oF.call(e)):{}}function oH(e,n){var t=n?oT(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var oL="[object Boolean]",oj="[object Date]",oq="[object Map]",oG="[object Number]",oV="[object RegExp]",oU="[object Set]",oW="[object String]",oK="[object Symbol]",oZ="[object ArrayBuffer]",oY="[object DataView]",oJ="[object Float32Array]",oX="[object Float64Array]",oQ="[object Int8Array]",o0="[object Int16Array]",o1="[object Int32Array]",o2="[object Uint8Array]",o3="[object Uint8ClampedArray]",o4="[object Uint16Array]",o5="[object Uint32Array]";function o6(e,n,t){var r=e.constructor;switch(n){case oZ:return oT(e);case oL:case oj:return new r(+e);case oY:return oO(e,t);case oJ:case oX:case oQ:case o0:case o1:case o2:case o3:case o4:case o5:return oH(e,t);case oq:return new r;case oG:case oW:return new r(e);case oV:return oP(e);case oU:return new r;case oK:return oR(e)}}function o8(e){return"function"!=typeof e.constructor||rc(e)?{}:tR(aW(e))}var o7="[object Map]";function o9(e){return tl(e)&&oS(e)==o7}var ie=rJ&&rJ.isMap,it=ie?rW(ie):o9,ir="[object Set]";function ia(e){return tl(e)&&oS(e)==ir}var io=rJ&&rJ.isSet,ii=io?rW(io):ia,is=1,il=2,ic=4,iu="[object Arguments]",id="[object Array]",ip="[object Boolean]",i_="[object Date]",ih="[object Error]",im="[object Function]",ig="[object GeneratorFunction]",iA="[object Map]",iy="[object Number]",ib="[object Object]",iv="[object RegExp]",iC="[object Set]",i$="[object String]",iw="[object Symbol]",ik="[object WeakMap]",iE="[object ArrayBuffer]",ix="[object DataView]",iD="[object Float32Array]",iS="[object Float64Array]",iz="[object Int8Array]",iB="[object Int16Array]",iM="[object Int32Array]",iT="[object Uint8Array]",iO="[object Uint8ClampedArray]",iN="[object Uint16Array]",iP="[object Uint32Array]",iI={};function iF(e,n,t,r,a,o){var i,s=n&is,l=n&il,c=n⁣if(t&&(i=a?t(e,r,a,o):t(e)),void 0!==i)return i;if(!tm(e))return e;var u=tp(e);if(u){if(i=oB(e),!s)return tj(e,i)}else{var d=oS(e),p=d==im||d==ig;if(rv(e))return or(e,s);if(d==ib||d==iu||p&&!a){if(i=l||p?{}:o8(e),!s)return l?od(e,a7(i,e)):oc(e,a8(i,e))}else{if(!iI[d])return a?e:{};i=o6(e,d,s)}}o||(o=new a6);var f=o.get(e);if(f)return f;o.set(e,i),ii(e)?e.forEach(function(r){i.add(iF(r,n,t,r,e,o))}):it(e)&&e.forEach(function(r,a){i.set(a,iF(r,n,t,a,e,o))});var h=c?l?o_:of:l?ae:r6,m=u?void 0:h(e);return tY(m||e,function(r,a){m&&(r=e[a=r]),t7(i,a,iF(r,n,t,a,e,o))}),i}iI[iu]=iI[id]=iI[iE]=iI[ix]=iI[ip]=iI[i_]=iI[iD]=iI[iS]=iI[iz]=iI[iB]=iI[iM]=iI[iA]=iI[iy]=iI[ib]=iI[iv]=iI[iC]=iI[i$]=iI[iw]=iI[iT]=iI[iO]=iI[iN]=iI[iP]=!0,iI[ih]=iI[im]=iI[ik]=!1;var iR=1,iH=4;function iL(e){return iF(e,iR|iH)}var ij="__lodash_hash_undefined__";function iq(e){return this.__data__.set(e,ij),this}function iG(e){return this.__data__.has(e)}function iV(e){var n=-1,t=null==e?0:e.length;for(this.__data__=new aB;++n<t;)this.add(e[n])}function iU(e,n){for(var t=-1,r=null==e?0:e.length;++t<r;)if(n(e[t],t,e))return!0;return!1}function iW(e,n){return e.has(n)}iV.prototype.add=iV.prototype.push=iq,iV.prototype.has=iG;var iK=1,iZ=2;function iY(e,n,t,r,a,o){var i=t&iK,s=e.length,l=n.length;if(s!=l&&!(i&&l>s))return!1;var c=o.get(e),u=o.get(n);if(c&&u)return c==n&&u==e;var d=-1,p=!0,f=t&iZ?new iV:void 0;for(o.set(e,n),o.set(n,e);++d<s;){var h=e[d],m=n[d];if(r)var g=i?r(m,h,d,n,e,o):r(h,m,d,e,n,o);if(void 0!==g){if(g)continue;p=!1;break}if(f){if(!iU(n,function(e,n){if(!iW(f,n)&&(h===e||a(h,e,t,r,o)))return f.push(n)})){p=!1;break}}else if(!(h===m||a(h,m,t,r,o))){p=!1;break}}return o.delete(e),o.delete(n),p}function iJ(e){var n=-1,t=Array(e.size);return e.forEach(function(e,r){t[++n]=[r,e]}),t}function iX(e){var n=-1,t=Array(e.size);return e.forEach(function(e){t[++n]=e}),t}var iQ=1,i0=2,i1="[object Boolean]",i2="[object Date]",i3="[object Error]",i4="[object Map]",i5="[object Number]",i6="[object RegExp]",i8="[object Set]",i7="[object String]",i9="[object Symbol]",se="[object ArrayBuffer]",sn="[object DataView]",st=n6?n6.prototype:void 0,sr=st?st.valueOf:void 0;function sa(e,n,t,r,a,o,i){switch(t){case sn:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)break;e=e.buffer,n=n.buffer;case se:return!(e.byteLength!=n.byteLength||!o(new oM(e),new oM(n)));case i1:case i2:case i5:return t6(+e,+n);case i3:return e.name==n.name&&e.message==n.message;case i6:case i7:return e==n+"";case i4:var s=iJ;case i8:var l=r&iQ;if(s||(s=iX),e.size!=n.size&&!l)break;var c=i.get(e);if(c)return c==n;r|=i0,i.set(e,n);var u=iY(s(e),s(n),r,a,o,i);return i.delete(e),u;case i9:if(sr)return sr.call(e)==sr.call(n)}return!1}var so=1,si=Object.prototype.hasOwnProperty;function ss(e,n,t,r,a,o){var i=t&so,s=of(e),l=s.length;if(l!=of(n).length&&!i)return!1;for(var c=l;c--;){var u=s[c];if(!(i?u in n:si.call(n,u)))return!1}var d=o.get(e),p=o.get(n);if(d&&p)return d==n&&p==e;var f=!0;o.set(e,n),o.set(n,e);for(var h=i;++c<l;){var m=e[u=s[c]],g=n[u];if(r)var A=i?r(g,m,u,n,e,o):r(m,g,u,e,n,o);if(!(void 0===A?m===g||a(m,g,t,r,o):A)){f=!1;break}h||(h="constructor"==u)}if(f&&!h){var y=e.constructor,b=n.constructor;y!=b&&"constructor"in e&&"constructor"in n&&!("function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b)&&(f=!1)}return o.delete(e),o.delete(n),f}var sl=1,sc="[object Arguments]",su="[object Array]",sd="[object Object]",sp=Object.prototype.hasOwnProperty;function sf(e,n,t,r,a,o){var i=tp(e),s=tp(n),l=i?su:oS(e),c=s?su:oS(n);l=l==sc?sd:l,c=c==sc?sd:c;var u=l==sd,d=c==sd,p=l==c;if(p&&rv(e)){if(!rv(n))return!1;i=!0,u=!1}if(p&&!u)return o||(o=new a6),i||rQ(e)?iY(e,n,t,r,a,o):sa(e,n,l,t,r,a,o);if(!(t&sl)){var f=u&&sp.call(e,"__wrapped__"),h=d&&sp.call(n,"__wrapped__");if(f||h){var m=f?e.value():e,g=h?n.value():n;return o||(o=new a6),a(m,g,t,r,o)}}return!!p&&(o||(o=new a6),ss(e,n,t,r,a,o))}function s_(e,n,t,r,a){return e===n||(null!=e&&null!=n&&(tl(e)||tl(n))?sf(e,n,t,r,s_,a):e!=e&&n!=n)}var sh=1,sm=2;function sg(e,n,t,r){var a=t.length,o=a;if(null==e)return!o;for(e=Object(e);a--;){var i=t[a];if(i[2]?i[1]!==e[i[0]]:!(i[0]in e))return!1}for(;++a<o;){var s=(i=t[a])[0],l=e[s],c=i[1];if(i[2]){if(void 0===l&&!(s in e))return!1}else{var u,d=new a6;if(!(void 0===u?s_(c,l,sh|sm,r,d):u))return!1}}return!0}function sA(e){return e==e&&!tm(e)}function sy(e){for(var n=r6(e),t=n.length;t--;){var r=n[t],a=e[r];n[t]=[r,a,sA(a)]}return n}function sb(e,n){return function(t){return null!=t&&t[e]===n&&(void 0!==n||e in Object(t))}}function sv(e){var n=sy(e);return 1==n.length&&n[0][2]?sb(n[0][0],n[0][1]):function(t){return t===e||sg(t,e,n)}}function sC(e,n){return null!=e&&n in Object(e)}function s$(e,n,t){n=aR(n,e);for(var r=-1,a=n.length,o=!1;++r<a;){var i=aH(n[r]);if(!(o=null!=e&&t(e,i)))break;e=e[i]}return o||++r!=a?o:!!(a=null==e?0:e.length)&&ra(a)&&t4(i,a)&&(tp(e)||rm(e))}function sw(e,n){return null!=e&&s$(e,n,sC)}var sk=1,sE=2;function sx(e,n){return ar(e)&&sA(n)?sb(aH(e),n):function(t){var r=aj(t,e);return void 0===r&&r===n?sw(t,e):s_(n,r,sk|sE)}}function sD(e){return function(n){return n?.[e]}}function sS(e){return function(n){return aL(n,e)}}function sz(e){return ar(e)?sD(aH(e)):sS(e)}function sB(e){return"function"==typeof e?e:null==e?tg:"object"==typeof e?tp(e)?sx(e[0],e[1]):sv(e):sz(e)}var sM=function(e){return function(e,n,t){for(var r=-1,a=Object(e),o=t(e),i=o.length;i--;){var s=o[++r];if(!1===n(a[s],s,a))break}return e}}();function sT(e,n,t){(void 0===t||t6(e[n],t))&&(void 0!==t||n in e)||t5(e,n,t)}function sO(e){return tl(e)&&ro(e)}function sN(e,n){if(("constructor"!==n||"function"!=typeof e[n])&&"__proto__"!=n)return e[n]}function sP(e){return t9(e,ae(e))}function sI(e,n,t,r,a,o,i){var s=sN(e,t),l=sN(n,t),c=i.get(l);if(c)return void sT(e,t,c);var u=o?o(s,l,t+"",e,n,i):void 0,d=void 0===u;if(d){var p=tp(l),f=!p&&rv(l),h=!p&&!f&&rQ(l);u=l,p||f||h?tp(s)?u=s:sO(s)?u=tj(s):f?(d=!1,u=or(l,!0)):h?(d=!1,u=oH(l,!0)):u=[]:aQ(l)||rm(l)?(u=s,rm(s)?u=sP(s):(!tm(s)||tC(s))&&(u=o8(l))):d=!1}d&&(i.set(l,u),a(u,l,r,o,i),i.delete(l)),sT(e,t,u)}function sF(e,n,t,r,a){e!==n&&sM(n,function(o,i){if(a||(a=new a6),tm(o))sI(e,n,i,t,sF,r,a);else{var s=r?r(sN(e,i),o,i+"",e,n,a):void 0;void 0===s&&(s=o),sT(e,i,s)}},ae)}function sR(e){var n=null==e?0:e.length;return n?e[n-1]:void 0}var sH="[object Map]",sL="[object Set]",sj=Object.prototype.hasOwnProperty;function sq(e){if(null==e)return!0;if(ro(e)&&(tp(e)||"string"==typeof e||"function"==typeof e.splice||rv(e)||rQ(e)||rm(e)))return!e.length;var n=oS(e);if(n==sH||n==sL)return!e.size;if(rc(e))return!r5(e).length;for(var t in e)if(sj.call(e,t))return!1;return!0}var sG=rs(function(e,n,t){sF(e,n,t)}),sV=1/0,sU=og&&1/iX(new og([,-0]))[1]==sV?function(e){return new og(e)}:tL,sW=200;function sK(e,n,t){var r=-1,a=t1,o=e.length,i=!0,s=[],l=s;if(o>=sW){var c=n?null:sU(e);if(c)return iX(c);i=!1,a=iW,l=new iV}else l=n?[]:s;r:for(;++r<o;){var u=e[r],d=n?n(u):u;if(u=0!==u?u:0,i&&d==d){for(var p=l.length;p--;)if(l[p]===d)continue r;n&&l.push(d),s.push(u)}else a(l,d,t)||(l!==s&&l.push(d),s.push(u))}return s}var sZ=rt(function(e){var n=sR(e);return sO(n)&&(n=void 0),sK(aU(e,1,sO,!0),sB(n))});function sY(e){return e&&e.length?sK(e):[]}function sJ(e,n){return null==e||null==n?NaN:e<n?-1:e>n?1:e>=n?0:NaN}function sX(e,n){return null==e||null==n?NaN:n<e?-1:n>e?1:n>=e?0:NaN}function sQ(e){let n,t,r;function a(e,r,o=0,i=e.length){if(o<i){if(0!==n(r,r))return i;do{let n=o+i>>>1;0>t(e[n],r)?o=n+1:i=n}while(o<i)}return o}function o(e,n,t=0,i=e.length){let s=a(e,n,t,i-1);return s>t&&r(e[s-1],n)>-r(e[s],n)?s-1:s}return 2!==e.length?(n=sJ,t=(n,t)=>sJ(e(n),t),r=(n,t)=>e(n)-t):(n=e===sJ||e===sX?e:s0,t=e,r=e),{left:a,center:o,right:function(e,r,a=0,o=e.length){if(a<o){if(0!==n(r,r))return o;do{let n=a+o>>>1;0>=t(e[n],r)?a=n+1:o=n}while(a<o)}return a}}}function s0(){return 0}function s1(e){return null===e?NaN:+e}function*s2(e,n){for(let n of e)null!=n&&(n*=1)>=n&&(yield n)}let s3=sQ(sJ).right;function s4(e,n){let t,r;if(void 0===n)for(let n of e)null!=n&&(void 0===t?n>=n&&(t=r=n):(t>n&&(t=n),r<n&&(r=n)));else{let a=-1;for(let o of e)null!=(o=n(o,++a,e))&&(void 0===t?o>=o&&(t=r=o):(t>o&&(t=o),r<o&&(r=o)))}return[t,r]}sQ(s1).center;let s5=class extends Map{constructor(e,n=s9){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),null!=e)for(const[n,t]of e)this.set(n,t)}get(e){return super.get(s6(this,e))}has(e){return super.has(s6(this,e))}set(e,n){return super.set(s8(this,e),n)}delete(e){return super.delete(s7(this,e))}};function s6({_intern:e,_key:n},t){let r=n(t);return e.has(r)?e.get(r):t}function s8({_intern:e,_key:n},t){let r=n(t);return e.has(r)?e.get(r):(e.set(r,t),t)}function s7({_intern:e,_key:n},t){let r=n(t);return e.has(r)&&(t=e.get(r),e.delete(r)),t}function s9(e){return null!==e&&"object"==typeof e?e.valueOf():e}let le=Math.sqrt(50),ln=Math.sqrt(10),lt=Math.sqrt(2);function lr(e,n,t){let r,a,o,i=(n-e)/Math.max(0,t),s=Math.floor(Math.log10(i)),l=i/Math.pow(10,s),c=l>=le?10:l>=ln?5:l>=lt?2:1;return s<0?(r=Math.round(e*(o=Math.pow(10,-s)/c)),a=Math.round(n*o),r/o<e&&++r,a/o>n&&--a,o=-o):(r=Math.round(e/(o=Math.pow(10,s)*c)),a=Math.round(n/o),r*o<e&&++r,a*o>n&&--a),a<r&&.5<=t&&t<2?lr(e,n,2*t):[r,a,o]}function la(e,n,t){if(n*=1,e*=1,!((t*=1)>0))return[];if(e===n)return[e];let r=n<e,[a,o,i]=r?lr(n,e,t):lr(e,n,t);if(!(o>=a))return[];let s=o-a+1,l=Array(s);if(r)if(i<0)for(let e=0;e<s;++e)l[e]=-((o-e)/i);else for(let e=0;e<s;++e)l[e]=(o-e)*i;else if(i<0)for(let e=0;e<s;++e)l[e]=-((a+e)/i);else for(let e=0;e<s;++e)l[e]=(a+e)*i;return l}function lo(e,n,t){return lr(e*=1,n*=1,t*=1)[2]}function li(e,n,t){n*=1,e*=1,t*=1;let r=n<e,a=r?lo(n,e,t):lo(e,n,t);return(r?-1:1)*(a<0?-(1/a):a)}function ls(e,n){let t;if(void 0===n)for(let n of e)null!=n&&(t<n||void 0===t&&n>=n)&&(t=n);else{let r=-1;for(let a of e)null!=(a=n(a,++r,e))&&(t<a||void 0===t&&a>=a)&&(t=a)}return t}function ll(e,n){let t;for(let n of e)null!=n&&(t>n||void 0===t&&n>=n)&&(t=n);return t}var lc={value:()=>{}};function lu(){for(var e,n=0,t=arguments.length,r={};n<t;++n){if(!(e=arguments[n]+"")||e in r||/[\s.]/.test(e))throw Error("illegal type: "+e);r[e]=[]}return new ld(r)}function ld(e){this._=e}function lp(e,n){return e.trim().split(/^|\s+/).map(function(e){var t="",r=e.indexOf(".");if(r>=0&&(t=e.slice(r+1),e=e.slice(0,r)),e&&!n.hasOwnProperty(e))throw Error("unknown type: "+e);return{type:e,name:t}})}function lf(e,n){for(var t,r=0,a=e.length;r<a;++r)if((t=e[r]).name===n)return t.value}function l_(e,n,t){for(var r=0,a=e.length;r<a;++r)if(e[r].name===n){e[r]=lc,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=t&&e.push({name:n,value:t}),e}ld.prototype=lu.prototype={constructor:ld,on:function(e,n){var t,r=this._,a=lp(e+"",r),o=-1,i=a.length;if(arguments.length<2){for(;++o<i;)if((t=(e=a[o]).type)&&(t=lf(r[t],e.name)))return t;return}if(null!=n&&"function"!=typeof n)throw Error("invalid callback: "+n);for(;++o<i;)if(t=(e=a[o]).type)r[t]=l_(r[t],e.name,n);else if(null==n)for(t in r)r[t]=l_(r[t],e.name,null);return this},copy:function(){var e={},n=this._;for(var t in n)e[t]=n[t].slice();return new ld(e)},call:function(e,n){if((t=arguments.length-2)>0)for(var t,r,a=Array(t),o=0;o<t;++o)a[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(r=this._[e],o=0,t=r.length;o<t;++o)r[o].value.apply(n,a)},apply:function(e,n,t){if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(var r=this._[e],a=0,o=r.length;a<o;++a)r[a].value.apply(n,t)}};var lh="http://www.w3.org/1999/xhtml";let lm={svg:"http://www.w3.org/2000/svg",xhtml:lh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function lg(e){var n=e+="",t=n.indexOf(":");return t>=0&&"xmlns"!==(n=e.slice(0,t))&&(e=e.slice(t+1)),lm.hasOwnProperty(n)?{space:lm[n],local:e}:e}function lA(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===lh&&n.documentElement.namespaceURI===lh?n.createElement(e):n.createElementNS(t,e)}}function ly(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function lb(e){var n=lg(e);return(n.local?ly:lA)(n)}function lv(){}function lC(e){return null==e?lv:function(){return this.querySelector(e)}}function l$(e){"function"!=typeof e&&(e=lC(e));for(var n=this._groups,t=n.length,r=Array(t),a=0;a<t;++a)for(var o,i,s=n[a],l=s.length,c=r[a]=Array(l),u=0;u<l;++u)(o=s[u])&&(i=e.call(o,o.__data__,u,s))&&("__data__"in o&&(i.__data__=o.__data__),c[u]=i);return new cj(r,this._parents)}function lw(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}function lk(){return[]}function lE(e){return null==e?lk:function(){return this.querySelectorAll(e)}}function lx(e){return function(){return lw(e.apply(this,arguments))}}function lD(e){e="function"==typeof e?lx(e):lE(e);for(var n=this._groups,t=n.length,r=[],a=[],o=0;o<t;++o)for(var i,s=n[o],l=s.length,c=0;c<l;++c)(i=s[c])&&(r.push(e.call(i,i.__data__,c,s)),a.push(i));return new cj(r,a)}function lS(e){return function(){return this.matches(e)}}function lz(e){return function(n){return n.matches(e)}}var lB=Array.prototype.find;function lM(e){return function(){return lB.call(this.children,e)}}function lT(){return this.firstElementChild}function lO(e){return this.select(null==e?lT:lM("function"==typeof e?e:lz(e)))}var lN=Array.prototype.filter;function lP(){return Array.from(this.children)}function lI(e){return function(){return lN.call(this.children,e)}}function lF(e){return this.selectAll(null==e?lP:lI("function"==typeof e?e:lz(e)))}function lR(e){"function"!=typeof e&&(e=lS(e));for(var n=this._groups,t=n.length,r=Array(t),a=0;a<t;++a)for(var o,i=n[a],s=i.length,l=r[a]=[],c=0;c<s;++c)(o=i[c])&&e.call(o,o.__data__,c,i)&&l.push(o);return new cj(r,this._parents)}function lH(e){return Array(e.length)}function lL(){return new cj(this._enter||this._groups.map(lH),this._parents)}function lj(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}function lq(e){return function(){return e}}function lG(e,n,t,r,a,o){for(var i,s=0,l=n.length,c=o.length;s<c;++s)(i=n[s])?(i.__data__=o[s],r[s]=i):t[s]=new lj(e,o[s]);for(;s<l;++s)(i=n[s])&&(a[s]=i)}function lV(e,n,t,r,a,o,i){var s,l,c,u=new Map,d=n.length,p=o.length,f=Array(d);for(s=0;s<d;++s)(l=n[s])&&(f[s]=c=i.call(l,l.__data__,s,n)+"",u.has(c)?a[s]=l:u.set(c,l));for(s=0;s<p;++s)c=i.call(e,o[s],s,o)+"",(l=u.get(c))?(r[s]=l,l.__data__=o[s],u.delete(c)):t[s]=new lj(e,o[s]);for(s=0;s<d;++s)(l=n[s])&&u.get(f[s])===l&&(a[s]=l)}function lU(e){return e.__data__}function lW(e,n){if(!arguments.length)return Array.from(this,lU);var t=n?lV:lG,r=this._parents,a=this._groups;"function"!=typeof e&&(e=lq(e));for(var o=a.length,i=Array(o),s=Array(o),l=Array(o),c=0;c<o;++c){var u=r[c],d=a[c],p=d.length,f=lK(e.call(u,u&&u.__data__,c,r)),h=f.length,m=s[c]=Array(h),g=i[c]=Array(h);t(u,d,m,g,l[c]=Array(p),f,n);for(var A,y,b=0,v=0;b<h;++b)if(A=m[b]){for(b>=v&&(v=b+1);!(y=g[v])&&++v<h;);A._next=y||null}}return(i=new cj(i,r))._enter=s,i._exit=l,i}function lK(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function lZ(){return new cj(this._exit||this._groups.map(lH),this._parents)}function lY(e,n,t){var r=this.enter(),a=this,o=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=n&&(a=n(a))&&(a=a.selection()),null==t?o.remove():t(o),r&&a?r.merge(a).order():a}function lJ(e){for(var n=e.selection?e.selection():e,t=this._groups,r=n._groups,a=t.length,o=r.length,i=Math.min(a,o),s=Array(a),l=0;l<i;++l)for(var c,u=t[l],d=r[l],p=u.length,f=s[l]=Array(p),h=0;h<p;++h)(c=u[h]||d[h])&&(f[h]=c);for(;l<a;++l)s[l]=t[l];return new cj(s,this._parents)}function lX(){for(var e=this._groups,n=-1,t=e.length;++n<t;)for(var r,a=e[n],o=a.length-1,i=a[o];--o>=0;)(r=a[o])&&(i&&4^r.compareDocumentPosition(i)&&i.parentNode.insertBefore(r,i),i=r);return this}function lQ(e){function n(n,t){return n&&t?e(n.__data__,t.__data__):!n-!t}e||(e=l0);for(var t=this._groups,r=t.length,a=Array(r),o=0;o<r;++o){for(var i,s=t[o],l=s.length,c=a[o]=Array(l),u=0;u<l;++u)(i=s[u])&&(c[u]=i);c.sort(n)}return new cj(a,this._parents).order()}function l0(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function l1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function l2(){return Array.from(this)}function l3(){for(var e=this._groups,n=0,t=e.length;n<t;++n)for(var r=e[n],a=0,o=r.length;a<o;++a){var i=r[a];if(i)return i}return null}function l4(){let e=0;for(let n of this)++e;return e}function l5(){return!this.node()}function l6(e){for(var n=this._groups,t=0,r=n.length;t<r;++t)for(var a,o=n[t],i=0,s=o.length;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function l8(e){return function(){this.removeAttribute(e)}}function l7(e){return function(){this.removeAttributeNS(e.space,e.local)}}function l9(e,n){return function(){this.setAttribute(e,n)}}function ce(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function cn(e,n){return function(){var t=n.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}}function ct(e,n){return function(){var t=n.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}}function cr(e,n){var t=lg(e);if(arguments.length<2){var r=this.node();return t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}return this.each((null==n?t.local?l7:l8:"function"==typeof n?t.local?ct:cn:t.local?ce:l9)(t,n))}function ca(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function co(e){return function(){this.style.removeProperty(e)}}function ci(e,n,t){return function(){this.style.setProperty(e,n,t)}}function cs(e,n,t){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,t)}}function cl(e,n,t){return arguments.length>1?this.each((null==n?co:"function"==typeof n?cs:ci)(e,n,t??"")):cc(this.node(),e)}function cc(e,n){return e.style.getPropertyValue(n)||ca(e).getComputedStyle(e,null).getPropertyValue(n)}function cu(e){return function(){delete this[e]}}function cd(e,n){return function(){this[e]=n}}function cp(e,n){return function(){var t=n.apply(this,arguments);null==t?delete this[e]:this[e]=t}}function cf(e,n){return arguments.length>1?this.each((null==n?cu:"function"==typeof n?cp:cd)(e,n)):this.node()[e]}function c_(e){return e.trim().split(/^|\s+/)}function ch(e){return e.classList||new cm(e)}function cm(e){this._node=e,this._names=c_(e.getAttribute("class")||"")}function cg(e,n){for(var t=ch(e),r=-1,a=n.length;++r<a;)t.add(n[r])}function cA(e,n){for(var t=ch(e),r=-1,a=n.length;++r<a;)t.remove(n[r])}function cy(e){return function(){cg(this,e)}}function cb(e){return function(){cA(this,e)}}function cv(e,n){return function(){(n.apply(this,arguments)?cg:cA)(this,e)}}function cC(){this.textContent=""}function c$(e){return function(){this.textContent=e}}function cw(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function ck(){this.innerHTML=""}function cE(e){return function(){this.innerHTML=e}}function cx(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function cD(){this.nextSibling&&this.parentNode.appendChild(this)}function cS(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function cz(){return null}function cB(){var e=this.parentNode;e&&e.removeChild(this)}function cM(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function cT(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function cO(e){return function(n){e.call(this,n,this.__data__)}}function cN(e){return e.trim().split(/^|\s+/).map(function(e){var n="",t=e.indexOf(".");return t>=0&&(n=e.slice(t+1),e=e.slice(0,t)),{type:e,name:n}})}function cP(e){return function(){var n=this.__on;if(n){for(var t,r=0,a=-1,o=n.length;r<o;++r)t=n[r],e.type&&t.type!==e.type||t.name!==e.name?n[++a]=t:this.removeEventListener(t.type,t.listener,t.options);++a?n.length=a:delete this.__on}}}function cI(e,n,t){return function(){var r,a=this.__on,o=cO(n);if(a){for(var i=0,s=a.length;i<s;++i)if((r=a[i]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=t),r.value=n;return}}this.addEventListener(e.type,o,t),r={type:e.type,name:e.name,value:n,listener:o,options:t},a?a.push(r):this.__on=[r]}}function cF(e,n,t){var r=ca(e),a=r.CustomEvent;"function"==typeof a?a=new a(n,t):(a=r.document.createEvent("Event"),t?(a.initEvent(n,t.bubbles,t.cancelable),a.detail=t.detail):a.initEvent(n,!1,!1)),e.dispatchEvent(a)}function cR(e,n){return function(){return cF(this,e,n)}}function cH(e,n){return function(){return cF(this,e,n.apply(this,arguments))}}lj.prototype={constructor:lj,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},cm.prototype={add:function(e){0>this._names.indexOf(e)&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var cL=[null];function cj(e,n){this._groups=e,this._parents=n}function cq(){return new cj([[document.documentElement]],cL)}function cG(e){let n;for(;n=e.sourceEvent;)e=n;return e}function cV(e,n){if(e=cG(e),void 0===n&&(n=e.currentTarget),n){var t=n.ownerSVGElement||n;if(t.createSVGPoint){var r=t.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}if(n.getBoundingClientRect){var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}}return[e.pageX,e.pageY]}function cU(e,n,t){e.prototype=n.prototype=t,t.constructor=e}function cW(e,n){var t=Object.create(e.prototype);for(var r in n)t[r]=n[r];return t}function cK(){}cj.prototype=cq.prototype={constructor:cj,select:l$,selectAll:lD,selectChild:lO,selectChildren:lF,filter:lR,data:lW,enter:lL,exit:lZ,join:lY,merge:lJ,selection:function(){return this},order:lX,sort:lQ,call:l1,nodes:l2,node:l3,size:l4,empty:l5,each:l6,attr:cr,style:cl,property:cf,classed:function(e,n){var t=c_(e+"");if(arguments.length<2){for(var r=ch(this.node()),a=-1,o=t.length;++a<o;)if(!r.contains(t[a]))return!1;return!0}return this.each(("function"==typeof n?cv:n?cy:cb)(t,n))},text:function(e){return arguments.length?this.each(null==e?cC:("function"==typeof e?cw:c$)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?ck:("function"==typeof e?cx:cE)(e)):this.node().innerHTML},raise:function(){return this.each(cD)},lower:function(){return this.each(cS)},append:function(e){var n="function"==typeof e?e:lb(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},insert:function(e,n){var t="function"==typeof e?e:lb(e),r=null==n?cz:"function"==typeof n?n:lC(n);return this.select(function(){return this.insertBefore(t.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(cB)},clone:function(e){return this.select(e?cT:cM)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,n,t){var r,a,o=cN(e+""),i=o.length;if(arguments.length<2){var s=this.node().__on;if(s){for(var l,c=0,u=s.length;c<u;++c)for(r=0,l=s[c];r<i;++r)if((a=o[r]).type===l.type&&a.name===l.name)return l.value}return}for(s=n?cI:cP,r=0;r<i;++r)this.each(s(o[r],n,t));return this},dispatch:function(e,n){return this.each(("function"==typeof n?cH:cR)(e,n))},[Symbol.iterator]:function*(){for(var e=this._groups,n=0,t=e.length;n<t;++n)for(var r,a=e[n],o=0,i=a.length;o<i;++o)(r=a[o])&&(yield r)}};var cZ=.7,cY=1.4285714285714286,cJ="\\s*([+-]?\\d+)\\s*",cX="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cQ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",c0=/^#([0-9a-f]{3,8})$/,c1=RegExp(`^rgb\\(${cJ},${cJ},${cJ}\\)$`),c2=RegExp(`^rgb\\(${cQ},${cQ},${cQ}\\)$`),c3=RegExp(`^rgba\\(${cJ},${cJ},${cJ},${cX}\\)$`),c4=RegExp(`^rgba\\(${cQ},${cQ},${cQ},${cX}\\)$`),c5=RegExp(`^hsl\\(${cX},${cQ},${cQ}\\)$`),c6=RegExp(`^hsla\\(${cX},${cQ},${cQ},${cX}\\)$`),c8={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function c7(){return this.rgb().formatHex()}function c9(){return this.rgb().formatRgb()}function ue(e){var n,t;return e=(e+"").trim().toLowerCase(),(n=c0.exec(e))?(t=n[1].length,n=parseInt(n[1],16),6===t?un(n):3===t?new uo(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===t?ut(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===t?ut(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=c1.exec(e))?new uo(n[1],n[2],n[3],1):(n=c2.exec(e))?new uo(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=c3.exec(e))?ut(n[1],n[2],n[3],n[4]):(n=c4.exec(e))?ut(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=c5.exec(e))?up(n[1],n[2]/100,n[3]/100,1):(n=c6.exec(e))?up(n[1],n[2]/100,n[3]/100,n[4]):c8.hasOwnProperty(e)?un(c8[e]):"transparent"===e?new uo(NaN,NaN,NaN,0):null}function un(e){return new uo(e>>16&255,e>>8&255,255&e,1)}function ut(e,n,t,r){return r<=0&&(e=n=t=NaN),new uo(e,n,t,r)}function ur(e){return e instanceof cK||(e=ue(e)),e?new uo((e=e.rgb()).r,e.g,e.b,e.opacity):new uo}function ua(e,n,t,r){return 1==arguments.length?ur(e):new uo(e,n,t,r??1)}function uo(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}function ui(){return`#${ud(this.r)}${ud(this.g)}${ud(this.b)}`}function us(){return`#${ud(this.r)}${ud(this.g)}${ud(this.b)}${ud((isNaN(this.opacity)?1:this.opacity)*255)}`}function ul(){let e=uc(this.opacity);return`${1===e?"rgb(":"rgba("}${uu(this.r)}, ${uu(this.g)}, ${uu(this.b)}${1===e?")":`, ${e})`}`}function uc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function uu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ud(e){return((e=uu(e))<16?"0":"")+e.toString(16)}function up(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new uh(e,n,t,r)}function uf(e){if(e instanceof uh)return new uh(e.h,e.s,e.l,e.opacity);if(e instanceof cK||(e=ue(e)),!e)return new uh;if(e instanceof uh)return e;var n=(e=e.rgb()).r/255,t=e.g/255,r=e.b/255,a=Math.min(n,t,r),o=Math.max(n,t,r),i=NaN,s=o-a,l=(o+a)/2;return s?(i=n===o?(t-r)/s+(t<r)*6:t===o?(r-n)/s+2:(n-t)/s+4,s/=l<.5?o+a:2-o-a,i*=60):s=l>0&&l<1?0:i,new uh(i,s,l,e.opacity)}function u_(e,n,t,r){return 1==arguments.length?uf(e):new uh(e,n,t,r??1)}function uh(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}function um(e){return(e=(e||0)%360)<0?e+360:e}function ug(e){return Math.max(0,Math.min(1,e||0))}function uA(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}cU(cK,ue,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:c7,formatHex:c7,formatHex8:function e(){return this.rgb().formatHex8()},formatHsl:function e(){return uf(this).formatHsl()},formatRgb:c9,toString:c9}),cU(uo,ua,cW(cK,{brighter(e){return e=null==e?cY:Math.pow(cY,e),new uo(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?cZ:Math.pow(cZ,e),new uo(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new uo(uu(this.r),uu(this.g),uu(this.b),uc(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ui,formatHex:ui,formatHex8:us,formatRgb:ul,toString:ul})),cU(uh,u_,cW(cK,{brighter(e){return e=null==e?cY:Math.pow(cY,e),new uh(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?cZ:Math.pow(cZ,e),new uh(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,a=2*t-r;return new uo(uA(e>=240?e-240:e+120,a,r),uA(e,a,r),uA(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new uh(um(this.h),ug(this.s),ug(this.l),uc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=uc(this.opacity);return`${1===e?"hsl(":"hsla("}${um(this.h)}, ${100*ug(this.s)}%, ${100*ug(this.l)}%${1===e?")":`, ${e})`}`}}));let uy=e=>()=>e;function ub(e,n){return function(t){return e+t*n}}function uv(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function uC(e){return 1==(e*=1)?u$:function(n,t){return t-n?uv(n,t,e):uy(isNaN(n)?t:n)}}function u$(e,n){var t=n-e;return t?ub(e,t):uy(isNaN(e)?n:e)}let uw=function e(n){var t=uC(n);function r(e,n){var r=t((e=ua(e)).r,(n=ua(n)).r),a=t(e.g,n.g),o=t(e.b,n.b),i=u$(e.opacity,n.opacity);return function(n){return e.r=r(n),e.g=a(n),e.b=o(n),e.opacity=i(n),e+""}}return r.gamma=e,r}(1);function uk(e,n){n||(n=[]);var t,r=e?Math.min(n.length,e.length):0,a=n.slice();return function(o){for(t=0;t<r;++t)a[t]=e[t]*(1-o)+n[t]*o;return a}}function uE(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ux(e,n){var t,r=n?n.length:0,a=e?Math.min(r,e.length):0,o=Array(a),i=Array(r);for(t=0;t<a;++t)o[t]=uP(e[t],n[t]);for(;t<r;++t)i[t]=n[t];return function(e){for(t=0;t<a;++t)i[t]=o[t](e);return i}}function uD(e,n){var t=new Date;return e*=1,n*=1,function(r){return t.setTime(e*(1-r)+n*r),t}}function uS(e,n){return e*=1,n*=1,function(t){return e*(1-t)+n*t}}function uz(e,n){var t,r={},a={};for(t in(null===e||"object"!=typeof e)&&(e={}),(null===n||"object"!=typeof n)&&(n={}),n)t in e?r[t]=uP(e[t],n[t]):a[t]=n[t];return function(e){for(t in r)a[t]=r[t](e);return a}}var uB=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uM=RegExp(uB.source,"g");function uT(e){return function(){return e}}function uO(e){return function(n){return e(n)+""}}function uN(e,n){var t,r,a,o=uB.lastIndex=uM.lastIndex=0,i=-1,s=[],l=[];for(e+="",n+="";(t=uB.exec(e))&&(r=uM.exec(n));)(a=r.index)>o&&(a=n.slice(o,a),s[i]?s[i]+=a:s[++i]=a),(t=t[0])===(r=r[0])?s[i]?s[i]+=r:s[++i]=r:(s[++i]=null,l.push({i:i,x:uS(t,r)})),o=uM.lastIndex;return o<n.length&&(a=n.slice(o),s[i]?s[i]+=a:s[++i]=a),s.length<2?l[0]?uO(l[0].x):uT(n):(n=l.length,function(e){for(var t,r=0;r<n;++r)s[(t=l[r]).i]=t.x(e);return s.join("")})}function uP(e,n){var t,r=typeof n;return null==n||"boolean"===r?uy(n):("number"===r?uS:"string"===r?(t=ue(n))?(n=t,uw):uN:n instanceof ue?uw:n instanceof Date?uD:uE(n)?uk:Array.isArray(n)?ux:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?uz:uS)(e,n)}function uI(e,n){return e*=1,n*=1,function(t){return Math.round(e*(1-t)+n*t)}}var uF=180/Math.PI,uR={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function uH(e,n,t,r,a,o){var i,s,l;return(i=Math.sqrt(e*e+n*n))&&(e/=i,n/=i),(l=e*t+n*r)&&(t-=e*l,r-=n*l),(s=Math.sqrt(t*t+r*r))&&(t/=s,r/=s,l/=s),e*r<n*t&&(e=-e,n=-n,l=-l,i=-i),{translateX:a,translateY:o,rotate:Math.atan2(n,e)*uF,skewX:Math.atan(l)*uF,scaleX:i,scaleY:s}}function uL(e){return null!=e&&(uq||(uq=document.createElementNS("http://www.w3.org/2000/svg","g")),uq.setAttribute("transform",e),e=uq.transform.baseVal.consolidate())?uH((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):uR}function uj(e,n,t,r){function a(e){return e.length?e.pop()+" ":""}function o(e,r,a,o,i,s){if(e!==a||r!==o){var l=i.push("translate(",null,n,null,t);s.push({i:l-4,x:uS(e,a)},{i:l-2,x:uS(r,o)})}else(a||o)&&i.push("translate("+a+n+o+t)}function i(e,n,t,o){e!==n?(e-n>180?n+=360:n-e>180&&(e+=360),o.push({i:t.push(a(t)+"rotate(",null,r)-2,x:uS(e,n)})):n&&t.push(a(t)+"rotate("+n+r)}function s(e,n,t,o){e!==n?o.push({i:t.push(a(t)+"skewX(",null,r)-2,x:uS(e,n)}):n&&t.push(a(t)+"skewX("+n+r)}function l(e,n,t,r,o,i){if(e!==t||n!==r){var s=o.push(a(o)+"scale(",null,",",null,")");i.push({i:s-4,x:uS(e,t)},{i:s-2,x:uS(n,r)})}else(1!==t||1!==r)&&o.push(a(o)+"scale("+t+","+r+")")}return function(n,t){var r=[],a=[];return n=e(n),t=e(t),o(n.translateX,n.translateY,t.translateX,t.translateY,r,a),i(n.rotate,t.rotate,r,a),s(n.skewX,t.skewX,r,a),l(n.scaleX,n.scaleY,t.scaleX,t.scaleY,r,a),n=t=null,function(e){for(var n,t=-1,o=a.length;++t<o;)r[(n=a[t]).i]=n.x(e);return r.join("")}}}var uq,uG,uV,uU=uj(function(e){let n=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?uR:uH(n.a,n.b,n.c,n.d,n.e,n.f)},"px, ","px)","deg)"),uW=uj(uL,", ",")",")"),uK=0,uZ=0,uY=0,uJ=1e3,uX=0,uQ=0,u0=0,u1="object"==typeof performance&&performance.now?performance:Date,u2="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function u3(){return uQ||(u2(u4),uQ=u1.now()+u0)}function u4(){uQ=0}function u5(){this._call=this._time=this._next=null}function u6(e,n,t){var r=new u5;return r.restart(e,n,t),r}function u8(){u3(),++uK;for(var e,n=uG;n;)(e=uQ-n._time)>=0&&n._call.call(void 0,e),n=n._next;--uK}function u7(){uQ=(uX=u1.now())+u0,uK=uZ=0;try{u8()}finally{uK=0,de(),uQ=0}}function u9(){var e=u1.now(),n=e-uX;n>uJ&&(u0-=n,uX=e)}function de(){for(var e,n,t=uG,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:uG=n);uV=e,dn(r)}function dn(e){!uK&&(uZ&&(uZ=clearTimeout(uZ)),e-uQ>24?(e<1/0&&(uZ=setTimeout(u7,e-u1.now()-u0)),uY&&(uY=clearInterval(uY))):(uY||(uX=u1.now(),uY=setInterval(u9,uJ)),uK=1,u2(u7)))}function dt(e,n,t){var r=new u5;return n=null==n?0:+n,r.restart(t=>{r.stop(),e(t+n)},n,t),r}u5.prototype=u6.prototype={constructor:u5,restart:function(e,n,t){if("function"!=typeof e)throw TypeError("callback is not a function");t=(null==t?u3():+t)+(null==n?0:+n),this._next||uV===this||(uV?uV._next=this:uG=this,uV=this),this._call=e,this._time=t,dn()},stop:function(){this._call&&(this._call=null,this._time=1/0,dn())}};var dr=lu("start","end","cancel","interrupt"),da=[],di=0,ds=1,dl=2,dc=3,du=4,dd=5,dp=6;function df(e,n,t,r,a,o){var i=e.__transition;if(i){if(t in i)return}else e.__transition={};dg(e,t,{name:n,index:r,group:a,on:dr,tween:da,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:di})}function d_(e,n){var t=dm(e,n);if(t.state>di)throw Error("too late; already scheduled");return t}function dh(e,n){var t=dm(e,n);if(t.state>dc)throw Error("too late; already running");return t}function dm(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw Error("transition not found");return t}function dg(e,n,t){var r,a=e.__transition;function o(e){t.state=ds,t.timer.restart(i,t.delay,t.time),t.delay<=e&&i(e-t.delay)}function i(o){var c,u,d,p;if(t.state!==ds)return l();for(c in a)if((p=a[c]).name===t.name){if(p.state===dc)return dt(i);p.state===du?(p.state=dp,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete a[c]):+c<n&&(p.state=dp,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete a[c])}if(dt(function(){t.state===dc&&(t.state=du,t.timer.restart(s,t.delay,t.time),s(o))}),t.state=dl,t.on.call("start",e,e.__data__,t.index,t.group),t.state===dl){for(t.state=dc,r=Array(d=t.tween.length),c=0,u=-1;c<d;++c)(p=t.tween[c].value.call(e,e.__data__,t.index,t.group))&&(r[++u]=p);r.length=u+1}}function s(n){for(var a=n<t.duration?t.ease.call(null,n/t.duration):(t.timer.restart(l),t.state=dd,1),o=-1,i=r.length;++o<i;)r[o].call(e,a);t.state===dd&&(t.on.call("end",e,e.__data__,t.index,t.group),l())}function l(){for(var r in t.state=dp,t.timer.stop(),delete a[n],a)return;delete e.__transition}a[n]=t,t.timer=u6(o,0,t.time)}function dA(e,n){var t,r,a,o=e.__transition,i=!0;if(o){for(a in n=null==n?null:n+"",o){if((t=o[a]).name!==n){i=!1;continue}r=t.state>dl&&t.state<dd,t.state=dp,t.timer.stop(),t.on.call(r?"interrupt":"cancel",e,e.__data__,t.index,t.group),delete o[a]}i&&delete e.__transition}}function dy(e){return this.each(function(){dA(this,e)})}function db(e,n){var t,r;return function(){var a=dh(this,e),o=a.tween;if(o!==t){r=t=o;for(var i=0,s=r.length;i<s;++i)if(r[i].name===n){(r=r.slice()).splice(i,1);break}}a.tween=r}}function dv(e,n,t){var r,a;if("function"!=typeof t)throw Error();return function(){var o=dh(this,e),i=o.tween;if(i!==r){a=(r=i).slice();for(var s={name:n,value:t},l=0,c=a.length;l<c;++l)if(a[l].name===n){a[l]=s;break}l===c&&a.push(s)}o.tween=a}}function dC(e,n){var t=this._id;if(e+="",arguments.length<2){for(var r,a=dm(this.node(),t).tween,o=0,i=a.length;o<i;++o)if((r=a[o]).name===e)return r.value;return null}return this.each((null==n?db:dv)(t,e,n))}function d$(e,n,t){var r=e._id;return e.each(function(){var e=dh(this,r);(e.value||(e.value={}))[n]=t.apply(this,arguments)}),function(e){return dm(e,r).value[n]}}function dw(e,n){var t;return("number"==typeof n?uS:n instanceof ue?uw:(t=ue(n))?(n=t,uw):uN)(e,n)}function dk(e){return function(){this.removeAttribute(e)}}function dE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function dx(e,n,t){var r,a,o=t+"";return function(){var i=this.getAttribute(e);return i===o?null:i===r?a:a=n(r=i,t)}}function dD(e,n,t){var r,a,o=t+"";return function(){var i=this.getAttributeNS(e.space,e.local);return i===o?null:i===r?a:a=n(r=i,t)}}function dS(e,n,t){var r,a,o;return function(){var i,s,l=t(this);return null==l?void this.removeAttribute(e):(i=this.getAttribute(e))===(s=l+"")?null:i===r&&s===a?o:(a=s,o=n(r=i,l))}}function dz(e,n,t){var r,a,o;return function(){var i,s,l=t(this);return null==l?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:i===r&&s===a?o:(a=s,o=n(r=i,l))}}function dB(e,n){var t=lg(e),r="transform"===t?uW:dw;return this.attrTween(e,"function"==typeof n?(t.local?dz:dS)(t,r,d$(this,"attr."+e,n)):null==n?(t.local?dE:dk)(t):(t.local?dD:dx)(t,r,n))}function dM(e,n){return function(t){this.setAttribute(e,n.call(this,t))}}function dT(e,n){return function(t){this.setAttributeNS(e.space,e.local,n.call(this,t))}}function dO(e,n){var t,r;function a(){var a=n.apply(this,arguments);return a!==r&&(t=(r=a)&&dT(e,a)),t}return a._value=n,a}function dN(e,n){var t,r;function a(){var a=n.apply(this,arguments);return a!==r&&(t=(r=a)&&dM(e,a)),t}return a._value=n,a}function dP(e,n){var t="attr."+e;if(arguments.length<2)return(t=this.tween(t))&&t._value;if(null==n)return this.tween(t,null);if("function"!=typeof n)throw Error();var r=lg(e);return this.tween(t,(r.local?dO:dN)(r,n))}function dI(e,n){return function(){d_(this,e).delay=+n.apply(this,arguments)}}function dF(e,n){return n*=1,function(){d_(this,e).delay=n}}function dR(e){var n=this._id;return arguments.length?this.each(("function"==typeof e?dI:dF)(n,e)):dm(this.node(),n).delay}function dH(e,n){return function(){dh(this,e).duration=+n.apply(this,arguments)}}function dL(e,n){return n*=1,function(){dh(this,e).duration=n}}function dj(e){var n=this._id;return arguments.length?this.each(("function"==typeof e?dH:dL)(n,e)):dm(this.node(),n).duration}function dq(e,n){if("function"!=typeof n)throw Error();return function(){dh(this,e).ease=n}}function dG(e){var n=this._id;return arguments.length?this.each(dq(n,e)):dm(this.node(),n).ease}function dV(e,n){return function(){var t=n.apply(this,arguments);if("function"!=typeof t)throw Error();dh(this,e).ease=t}}function dU(e){if("function"!=typeof e)throw Error();return this.each(dV(this._id,e))}function dW(e){"function"!=typeof e&&(e=lS(e));for(var n=this._groups,t=n.length,r=Array(t),a=0;a<t;++a)for(var o,i=n[a],s=i.length,l=r[a]=[],c=0;c<s;++c)(o=i[c])&&e.call(o,o.__data__,c,i)&&l.push(o);return new pp(r,this._parents,this._name,this._id)}function dK(e){if(e._id!==this._id)throw Error();for(var n=this._groups,t=e._groups,r=n.length,a=t.length,o=Math.min(r,a),i=Array(r),s=0;s<o;++s)for(var l,c=n[s],u=t[s],d=c.length,p=i[s]=Array(d),f=0;f<d;++f)(l=c[f]||u[f])&&(p[f]=l);for(;s<r;++s)i[s]=n[s];return new pp(i,this._parents,this._name,this._id)}function dZ(e){return(e+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||"start"===e})}function dY(e,n,t){var r,a,o=dZ(n)?d_:dh;return function(){var i=o(this,e),s=i.on;s!==r&&(a=(r=s).copy()).on(n,t),i.on=a}}function dJ(e,n){var t=this._id;return arguments.length<2?dm(this.node(),t).on.on(e):this.each(dY(t,e,n))}function dX(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function dQ(){return this.on("end.remove",dX(this._id))}function d0(e){var n=this._name,t=this._id;"function"!=typeof e&&(e=lC(e));for(var r=this._groups,a=r.length,o=Array(a),i=0;i<a;++i)for(var s,l,c=r[i],u=c.length,d=o[i]=Array(u),p=0;p<u;++p)(s=c[p])&&(l=e.call(s,s.__data__,p,c))&&("__data__"in s&&(l.__data__=s.__data__),d[p]=l,df(d[p],n,t,p,d,dm(s,t)));return new pp(o,this._parents,n,t)}function d1(e){var n=this._name,t=this._id;"function"!=typeof e&&(e=lE(e));for(var r=this._groups,a=r.length,o=[],i=[],s=0;s<a;++s)for(var l,c=r[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var p,f=e.call(l,l.__data__,d,c),h=dm(l,t),m=0,g=f.length;m<g;++m)(p=f[m])&&df(p,n,t,m,f,h);o.push(f),i.push(l)}return new pp(o,i,n,t)}var d2=cq.prototype.constructor;function d3(){return new d2(this._groups,this._parents)}function d4(e,n){var t,r,a;return function(){var o=cc(this,e),i=(this.style.removeProperty(e),cc(this,e));return o===i?null:o===t&&i===r?a:a=n(t=o,r=i)}}function d5(e){return function(){this.style.removeProperty(e)}}function d6(e,n,t){var r,a,o=t+"";return function(){var i=cc(this,e);return i===o?null:i===r?a:a=n(r=i,t)}}function d8(e,n,t){var r,a,o;return function(){var i=cc(this,e),s=t(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=cc(this,e)),i===l?null:i===r&&l===a?o:(a=l,o=n(r=i,s))}}function d7(e,n){var t,r,a,o,i="style."+n,s="end."+i;return function(){var l=dh(this,e),c=l.on,u=null==l.value[i]?o||(o=d5(n)):void 0;(c!==t||a!==u)&&(r=(t=c).copy()).on(s,a=u),l.on=r}}function d9(e,n,t){var r="transform"==(e+="")?uU:dw;return null==n?this.styleTween(e,d4(e,r)).on("end.style."+e,d5(e)):"function"==typeof n?this.styleTween(e,d8(e,r,d$(this,"style."+e,n))).each(d7(this._id,e)):this.styleTween(e,d6(e,r,n),t).on("end.style."+e,null)}function pe(e,n,t){return function(r){this.style.setProperty(e,n.call(this,r),t)}}function pn(e,n,t){var r,a;function o(){var o=n.apply(this,arguments);return o!==a&&(r=(a=o)&&pe(e,o,t)),r}return o._value=n,o}function pt(e,n,t){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw Error();return this.tween(r,pn(e,n,t??""))}function pr(e){return function(){this.textContent=e}}function pa(e){return function(){var n=e(this);this.textContent=n??""}}function po(e){return this.tween("text","function"==typeof e?pa(d$(this,"text",e)):pr(null==e?"":e+""))}function pi(e){return function(n){this.textContent=e.call(this,n)}}function ps(e){var n,t;function r(){var r=e.apply(this,arguments);return r!==t&&(n=(t=r)&&pi(r)),n}return r._value=e,r}function pl(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw Error();return this.tween(n,ps(e))}function pc(){for(var e=this._name,n=this._id,t=pf(),r=this._groups,a=r.length,o=0;o<a;++o)for(var i,s=r[o],l=s.length,c=0;c<l;++c)if(i=s[c]){var u=dm(i,n);df(i,e,t,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new pp(r,this._parents,e,t)}function pu(){var e,n,t=this,r=t._id,a=t.size();return new Promise(function(o,i){var s={value:i},l={value:function(){0==--a&&o()}};t.each(function(){var t=dh(this,r),a=t.on;a!==e&&((n=(e=a).copy())._.cancel.push(s),n._.interrupt.push(s),n._.end.push(l)),t.on=n}),0===a&&o()})}var pd=0;function pp(e,n,t,r){this._groups=e,this._parents=n,this._name=t,this._id=r}function pf(){return++pd}var p_=cq.prototype;function ph(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}pp.prototype={constructor:pp,select:d0,selectAll:d1,selectChild:p_.selectChild,selectChildren:p_.selectChildren,filter:dW,merge:dK,selection:d3,transition:pc,call:p_.call,nodes:p_.nodes,node:p_.node,size:p_.size,empty:p_.empty,each:p_.each,on:dJ,attr:dB,attrTween:dP,style:d9,styleTween:pt,text:po,textTween:pl,remove:dQ,tween:dC,delay:dR,duration:dj,ease:dG,easeVarying:dU,end:pu,[Symbol.iterator]:p_[Symbol.iterator]};var pm={time:null,delay:0,duration:250,ease:ph};function pg(e,n){for(var t;!(t=e.__transition)||!(t=t[n]);)if(!(e=e.parentNode))throw Error(`transition ${n} not found`);return t}function pA(e){e instanceof pp?(a=e._id,e=e._name):(a=pf(),(o=pm).time=u3(),e=null==e?null:e+"");for(var n=this._groups,t=n.length,r=0;r<t;++r)for(var a,o,i,s=n[r],l=s.length,c=0;c<l;++c)(i=s[c])&&df(i,e,a,c,s,o||pg(i,a));return new pp(n,this._parents,e,a)}function py(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function pb(e,n){if((t=(e=n?e.toExponential(n-1):e.toExponential()).indexOf("e"))<0)return null;var t,r=e.slice(0,t);return[r.length>1?r[0]+r.slice(2):r,+e.slice(t+1)]}function pv(e){return(e=pb(Math.abs(e)))?e[1]:NaN}function pC(e,n){return function(t,r){for(var a=t.length,o=[],i=0,s=e[0],l=0;a>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(t.substring(a-=s,a+s)),!((l+=s+1)>r));)s=e[i=(i+1)%e.length];return o.reverse().join(n)}}function p$(e){return function(n){return n.replace(/[0-9]/g,function(n){return e[+n]})}}cq.prototype.interrupt=dy,cq.prototype.transition=pA;var pw=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function pk(e){var n;if(!(n=pw.exec(e)))throw Error("invalid format: "+e);return new pE({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function pE(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function px(e){r:for(var n,t=e.length,r=1,a=-1;r<t;++r)switch(e[r]){case".":a=n=r;break;case"0":0===a&&(a=r),n=r;break;default:if(!+e[r])break r;a>0&&(a=0)}return a>0?e.slice(0,a)+e.slice(n+1):e}function pD(e,n){var t=pb(e,n);if(!t)return e+"";var r=t[0],a=t[1];return a<0?"0."+Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+Array(a-r.length+2).join("0")}pk.prototype=pE.prototype,pE.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};let pS={"%":(e,n)=>(100*e).toFixed(n),b:e=>Math.round(e).toString(2),c:e=>e+"",d:py,e:(e,n)=>e.toExponential(n),f:(e,n)=>e.toFixed(n),g:(e,n)=>e.toPrecision(n),o:e=>Math.round(e).toString(8),p:(e,n)=>pD(100*e,n),r:pD,s:function(e,n){var t=pb(e,n);if(!t)return e+"";var r=t[0],a=t[1],o=a-(CR=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,i=r.length;return o===i?r:o>i?r+Array(o-i+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+Array(1-o).join("0")+pb(e,Math.max(0,n+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function pz(e){return e}var pB=Array.prototype.map,pM=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function pT(e){var n=void 0===e.grouping||void 0===e.thousands?pz:pC(pB.call(e.grouping,Number),e.thousands+""),t=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",o=void 0===e.numerals?pz:p$(pB.call(e.numerals,String)),i=void 0===e.percent?"%":e.percent+"",s=void 0===e.minus?"−":e.minus+"",l=void 0===e.nan?"NaN":e.nan+"";function c(e){var c=(e=pk(e)).fill,u=e.align,d=e.sign,p=e.symbol,f=e.zero,h=e.width,m=e.comma,g=e.precision,A=e.trim,y=e.type;"n"===y?(m=!0,y="g"):pS[y]||(void 0===g&&(g=12),A=!0,y="g"),(f||"0"===c&&"="===u)&&(f=!0,c="0",u="=");var b="$"===p?t:"#"===p&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",v="$"===p?r:/[%p]/.test(y)?i:"",C=pS[y],$=/[defgprs%]/.test(y);function w(e){var t,r,i,p=b,w=v;if("c"===y)w=C(e)+w,e="";else{var k=(e*=1)<0||1/e<0;if(e=isNaN(e)?l:C(Math.abs(e),g),A&&(e=px(e)),k&&0==+e&&"+"!==d&&(k=!1),p=(k?"("===d?d:s:"-"===d||"("===d?"":d)+p,w=("s"===y?pM[8+CR/3]:"")+w+(k&&"("===d?")":""),$){for(t=-1,r=e.length;++t<r;)if(48>(i=e.charCodeAt(t))||i>57){w=(46===i?a+e.slice(t+1):e.slice(t))+w,e=e.slice(0,t);break}}}m&&!f&&(e=n(e,1/0));var E=p.length+e.length+w.length,x=E<h?Array(h-E+1).join(c):"";switch(m&&f&&(e=n(x+e,x.length?h-w.length:1/0),x=""),u){case"<":e=p+e+w+x;break;case"=":e=p+x+e+w;break;case"^":e=x.slice(0,E=x.length>>1)+p+e+w+x.slice(E);break;default:e=x+p+e+w}return o(e)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),w.toString=function(){return e+""},w}function u(e,n){var t=c(((e=pk(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(pv(n)/3))),a=Math.pow(10,-r),o=pM[8+r/3];return function(e){return t(a*e)+o}}return{format:c,formatPrefix:u}}function pO(e){return Math.max(0,-pv(Math.abs(e)))}function pN(e,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(pv(n)/3)))-pv(Math.abs(e)))}function pP(e,n){return Math.max(0,pv(n=Math.abs(n)-(e=Math.abs(e)))-pv(e))+1}function pI(e,n){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(n).domain(e)}return this}(function e(e){return CL=(CH=pT(e)).format,Cj=CH.formatPrefix})({thousands:",",grouping:[3],currency:["$",""]});let pF=Symbol("implicit");function pR(){var e=new s5,n=[],t=[],r=pF;function a(a){let o=e.get(a);if(void 0===o){if(r!==pF)return r;e.set(a,o=n.push(a)-1)}return t[o%t.length]}return a.domain=function(t){if(!arguments.length)return n.slice();for(let r of(n=[],e=new s5,t))e.has(r)||e.set(r,n.push(r)-1);return a},a.range=function(e){return arguments.length?(t=Array.from(e),a):t.slice()},a.unknown=function(e){return arguments.length?(r=e,a):r},a.copy=function(){return pR(n,t).unknown(r)},pI.apply(a,arguments),a}function pH(e){return function(){return e}}function pL(e){return+e}var pj=[0,1];function pq(e){return e}function pG(e,n){return(n-=e*=1)?function(t){return(t-e)/n}:pH(isNaN(n)?NaN:.5)}function pV(e,n){var t;return e>n&&(t=e,e=n,n=t),function(t){return Math.max(e,Math.min(n,t))}}function pU(e,n,t){var r=e[0],a=e[1],o=n[0],i=n[1];return a<r?(r=pG(a,r),o=t(i,o)):(r=pG(r,a),o=t(o,i)),function(e){return o(r(e))}}function pW(e,n,t){var r=Math.min(e.length,n.length)-1,a=Array(r),o=Array(r),i=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),n=n.slice().reverse());++i<r;)a[i]=pG(e[i],e[i+1]),o[i]=t(n[i],n[i+1]);return function(n){var t=s3(e,n,1,r)-1;return o[t](a[t](n))}}function pK(e,n){return n.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function pZ(){var e,n,t,r,a,o,i=pj,s=pj,l=uP,c=pq;function u(){var e=Math.min(i.length,s.length);return c!==pq&&(c=pV(i[0],i[e-1])),r=e>2?pW:pU,a=o=null,d}function d(n){return null==n||isNaN(n*=1)?t:(a||(a=r(i.map(e),s,l)))(e(c(n)))}return d.invert=function(t){return c(n((o||(o=r(s,i.map(e),uS)))(t)))},d.domain=function(e){return arguments.length?(i=Array.from(e,pL),u()):i.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=uI,u()},d.clamp=function(e){return arguments.length?(c=!!e||pq,u()):c!==pq},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(t=e,d):t},function(t,r){return e=t,n=r,u()}}function pY(){return pZ()(pq,pq)}function pJ(e,n,t,r){var a,o=li(e,n,t);switch((r=pk(r??",f")).type){case"s":var i=Math.max(Math.abs(e),Math.abs(n));return null!=r.precision||isNaN(a=pN(o,i))||(r.precision=a),Cj(r,i);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(a=pP(o,Math.max(Math.abs(e),Math.abs(n))))||(r.precision=a-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(a=pO(o))||(r.precision=a-("%"===r.type)*2)}return CL(r)}function pX(e){var n=e.domain;return e.ticks=function(e){var t=n();return la(t[0],t[t.length-1],e??10)},e.tickFormat=function(e,t){var r=n();return pJ(r[0],r[r.length-1],e??10,t)},e.nice=function(t){null==t&&(t=10);var r,a,o=n(),i=0,s=o.length-1,l=o[i],c=o[s],u=10;for(c<l&&(a=l,l=c,c=a,a=i,i=s,s=a);u-- >0;){if((a=lo(l,c,t))===r)return o[i]=l,o[s]=c,n(o);if(a>0)l=Math.floor(l/a)*a,c=Math.ceil(c/a)*a;else if(a<0)l=Math.ceil(l*a)/a,c=Math.floor(c*a)/a;else break;r=a}return e},e}function pQ(){var e=pY();return e.copy=function(){return pK(e,pQ())},pI.apply(e,arguments),pX(e)}function p0(){var e,n=0,t=1,r=1,a=[.5],o=[0,1];function i(n){return null!=n&&n<=n?o[s3(a,n,0,r)]:e}function s(){var e=-1;for(a=Array(r);++e<r;)a[e]=((e+1)*t-(e-r)*n)/(r+1);return i}return i.domain=function(e){return arguments.length?([n,t]=e,n*=1,t*=1,s()):[n,t]},i.range=function(e){return arguments.length?(r=(o=Array.from(e)).length-1,s()):o.slice()},i.invertExtent=function(e){var i=o.indexOf(e);return i<0?[NaN,NaN]:i<1?[n,a[0]]:i>=r?[a[r-1],t]:[a[i-1],a[i]]},i.unknown=function(n){return arguments.length&&(e=n),i},i.thresholds=function(){return a.slice()},i.copy=function(){return p0().domain([n,t]).range(o).unknown(e)},pI.apply(pX(i),arguments)}function p1(e,n,t){this.k=e,this.x=n,this.y=t}p1.prototype={constructor:p1,scale:function(e){return 1===e?this:new p1(this.k*e,this.x,this.y)},translate:function(e,n){return 0===e&0===n?this:new p1(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},p1.prototype;let p2="cds",p3=.05,p4=.4,p5=7,p6=2.5,p8=3.5,p7={reference:"value",compareTo:"marker"},p9=.1,fe=4,fn={duration:1e3,ease:ph,zoomLevel:3},ft={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},fr={"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1},fa=4,fo={hovered:1,default:.3},fi={hovered:.5,default:.3},fs=1,fl=2,fc=10,fu={items:{status:{ACTIVE:1,DISABLED:0},horizontalSpace:12,verticalSpace:24,textYOffset:8,spaceAfter:4},checkbox:{radius:6.5},radius:{iconData:[{cx:7,cy:7,r:6.5},{cx:7,cy:10,r:3.5}],fill:null,stroke:"#8c8c8c"},line:{yPosition:6,width:24,strokeWidth:1.4,fill:null,stroke:"#999999"},area:{width:24,height:14,fill:"#6f6f6f",stroke:null},size:{iconData:[{width:23,height:12},{width:13,height:6}],fill:null,stroke:"#8D8D8D"},quartile:{iconData:[{x:0,y:0,width:24,height:13},{x:11,y:4,width:1,height:4}]},zoom:{iconData:[{x:0,y:0,width:12,height:12}],color:"#8D8D8D"},color:{barWidth:300,barHeight:8,axisYTranslation:10}},fd=.3,fp=1,ff=2,f_=1,fh=5,fm=16,fg=15,fA=36,fy=24,fb=8,fv=16,fC=2,f$=-15,fw=2,fk=.007,fE=3,fx=30,fD=20,fS=10,fz=5,fB=15,fM=12,fT=8,fO=2,fN={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},fP=4,fI=24,fF=.3,fR=.8,fH=1,fL=16,fj=24,fq={defaultOffset:4,horizontalOffset:10},fG={default:{duration:300},pie_slice_mouseover:{duration:100},pie_slice_mouseout:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},fV={[eX.GRAPH_VIEW]:32,[eX.SLIDER_VIEW]:10},fU=8,fW=5,fK=1,fZ=12,fY=[{type:nu.RADIUS,name:"Radius"},{type:nu.AREA,name:"Poor area"},{type:nu.AREA,name:"Satisfactory area"},{type:nu.AREA,name:"Great area"},{type:nu.QUARTILE,name:"Quartiles"}],fJ={type:eQ.END_LINE,threshold:16,numCharacter:14},fX=4,fQ={code:"u">typeof navigator&&navigator?.language||"en-US",number:(e,n=navigator?.language||"en-US")=>e?.toLocaleString?.(n),date:(e,n=navigator?.language||"en-US",t={},r=null)=>r||e.toLocaleDateString(n,t),time:(e,n=navigator?.language||"en-US",t={},r=null)=>r||e.toLocaleTimeString(n,t),optionsObject:{"15seconds":{primary:{"MMM d, pp":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"MMM d, h:mm:ss.SSS a":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},secondary:{pp:{hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"h:mm:ss.SSS a":{hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},type:"time"},minute:{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},"30minutes":{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},hourly:{primary:{"MMM d, hh a":{month:"short",day:"numeric",hour:"2-digit",hourCycle:"h12"}},secondary:{"hh a":{hour:"2-digit",hourCycle:"h12"}},type:"time"},daily:{primary:{"MMM d":{month:"short",day:"numeric"}},secondary:{d:{day:"numeric"}},type:"date"},weekly:{primary:{"eee, MMM d":{weekday:"short",month:"short",day:"numeric"}},secondary:{eee:{weekday:"short"}},type:"date"},monthly:{primary:{"MMM yyyy":{month:"short",year:"numeric"}},secondary:{MMM:{month:"short"}},type:"date"},quarterly:{primary:{},secondary:{},type:"date"},yearly:{primary:{yyyy:{year:"numeric"}},secondary:{yyyy:{year:"numeric"}},type:"date"}},translations:{group:"Group",total:"Total",meter:{title:""},tabularRep:{title:"Tabular representation",downloadAsCSV:"Download as CSV"},toolbar:{exportAsCSV:"Export to CSV",exportAsJPG:"Export to JPG",exportAsPNG:"Export to PNG",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",moreOptions:"More options",makeFullScreen:"Make fullscreen",exitFullScreen:"Exit fullscreen",showAsTable:"Show as table"}}},f0={enabled:!0,position:e2.BOTTOM,clickable:!0,truncation:fJ,alignment:e3.LEFT,order:null,additionalItems:[]},f1={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},f2={enabled:!0},f3={enabled:!0,showTotal:!0,truncation:fJ,groupLabel:"Group"},f4={top:{visible:!0,includeZero:!0,truncation:fJ},bottom:{visible:!0,includeZero:!0,truncation:fJ},left:{visible:!0,includeZero:!0,truncation:fJ},right:{visible:!0,includeZero:!0,truncation:fJ}},f5={addSpaceOnEdges:1,showDayName:!1,localeObject:n2,timeIntervalFormats:{"15seconds":{primary:"MMM d, pp",secondary:"pp"},minute:{primary:"MMM d, p",secondary:"p"},"30minutes":{primary:"MMM d, p",secondary:"p"},hourly:{primary:"MMM d, hh a",secondary:"hh a"},daily:{primary:"MMM d",secondary:"d"},weekly:{primary:"eee, MMM d",secondary:"eee"},monthly:{primary:"MMM yyyy",secondary:"MMM"},quarterly:{primary:"QQQ ''yy",secondary:"QQQ"},yearly:{primary:"yyyy",secondary:"yyyy"}}},f6=!1;try{f6="u">typeof document&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}let f8={width:null,height:null,resizable:!0,theme:eZ.WHITE,tooltip:f3,legend:f0,locale:fQ,style:{prefix:"cc"},data:{groupMapsTo:"group",loading:!1,selectedGroups:[]},color:{scale:null,pairing:{numberOfVariants:null,option:1},gradient:{enabled:!1}},toolbar:{enabled:!0,numberOfIcons:3,controls:[{type:nl.SHOW_AS_DATATABLE},...f6?[{type:nl.MAKE_FULLSCREEN}]:[],{type:nl.EXPORT_CSV},{type:nl.EXPORT_PNG},{type:nl.EXPORT_JPG}]}},f7=sG({},f8,{thematic:{projection:n_.geoNaturalEarth1}}),f9=sG({},f8,{axes:f4,timeScale:f5,grid:f1,ruler:f2,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:eX.GRAPH_VIEW}}}),_e=sG({},f9,{bars:{maxWidth:16,spacingFactor:.25,preserveSpaceForMissingBars:!0},timeScale:sG(f5,{addSpaceOnEdges:1})}),_n=sG({},_e,{}),_t=sG({},_e,{}),_r=sG({},_e,{bars:sG({},_e.bars,{dividerSize:1.5})}),_a=sG({},_e,{}),_o=sG({},f9,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),_i=_o,_s=sG({},_o,{points:{radius:3,filled:!1,enabled:!0}}),_l=sG({},_s,{timeScale:sG(f5,{addSpaceOnEdges:0})}),_c=_l,_u=sG({},f9,{bubble:{radiusMapsTo:"radius",radiusLabel:"Radius",radiusRange:e=>{let n=Math.min(e.width,e.height);return[3*n/400,25*n/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:nu.RADIUS,name:"Radius"}]}}),_d=sG({},f9,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:nu.AREA,name:"Poor area"},{type:nu.AREA,name:"Satisfactory area"},{type:nu.AREA,name:"Great area"},{type:nu.QUARTILE,name:"Quartiles"}]}}),_p=sG({},_e,{bars:{dividerSize:1.5},timeScale:sG(f5,{addSpaceOnEdges:0})}),_f=sG({},f8,{tooltip:sG({},f3,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:e=>{let n=Math.min(e.width,e.height);return[20*n/400,75*n/400]},wordMapsTo:"word"}}),__=sG({},f8,{pie:{labels:{formatter:null,enabled:!0},alignment:e3.LEFT,sortFunction:null,valueMapsTo:"value"}}),_h=sG({},f8,{legend:{enabled:!1},gauge:{type:nr.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,alignment:e3.LEFT}}),_m=sG({},__,{donut:{center:{numberFontSize:e=>`${Math.min(e/100*24,24)}px`,titleFontSize:e=>`${Math.min(e/100*15,15)}px`,titleYPosition:e=>Math.min(e/80*20,20)},alignment:e3.LEFT}}),_g=sG({},f8,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),_A=sG({},_g,{legend:{enabled:!0}}),_y=sG({},f8,{radar:{axes:{angle:"key",value:"value"},alignment:e3.LEFT},tooltip:{gridline:{enabled:!0}}}),_b=sG({},_e,{comboChartTypes:[]}),_v=sG({tree:{type:e5.TREE}},f8,{}),_C=sG({},f8,{data:sG(f8.data,{groupMapsTo:"name"})}),_$=sG({},f8,ft,{data:sG(f8.data,{groupMapsTo:"name"})}),_w=sG({},f8,{alluvial:{data:sG(f8.data,{groupMapsTo:"source"}),nodeAlignment:e3.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),_k=sG({},f8,{axes:f4,heatmap:{divider:{state:np.AUTO},colorLegend:{type:"linear"}}}),_E={alluvialChart:_w,areaChart:_l,axisChart:f9,boxplotChart:_a,bubbleChart:_u,bulletChart:_d,chart:f8,circlePackChart:_$,choroplethChart:sG({},f7,{choropleth:{colorLegend:{type:"linear"}}}),comboChart:_b,donutChart:_m,gaugeChart:_h,groupedBarChart:_t,heatmapChart:_k,histogramChart:_p,lineChart:_s,lollipopChart:_i,meterChart:_g,pieChart:__,proportionalMeterChart:_A,radarChart:_y,scatterChart:_o,simpleBarChart:_n,stackedAreaChart:_c,stackedBarChart:_r,thematicChart:f7,treeChart:_v,treemapChart:_C,wordCloudChart:_f};function _x(e,n,t){let r=null;return function(...a){let o=this;o.mousePosition=cV(a[0],t),clearTimeout(r),r=setTimeout(function(){e.apply(o,a)},n)}}function _D(e,n){let t=iL(e),r=Object.keys(n.axes||{});for(let e in n?.toolbar?.controls&&delete t.toolbar.controls,0===r.length&&delete t.axes,t.axes)if(r.includes(e)){let t=n.axes[e];if((t.primary||t.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/"),null==t.mapsTo){let e=t.scaleType;null==e?t.mapsTo="value":e===e1.TIME?t.mapsTo="date":e===e1.LABELS&&(t.mapsTo="key")}}else delete t.axes[e];return _T(t,n),sG(t,n)}function _S(e){if(!e)return;let n=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,t=e.getAttribute("transform").match(n);if(!t)return null;if(t[0]){let e=t[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:e[0],ty:e[1]}}return null}function _z(e){let n=/\(([^)]+)\)/.exec(e);if(n&&n.length>1){let e=n[1].split(",");if(e.length>1)return{x:parseFloat(e[0]),y:parseFloat(e[1])}}return{x:0,y:0}}function _B(e,n,t="value",r=!1){let a=e/n.reduce((e,n)=>e+n[t],0)*100;return r?a:a%1!=0?parseFloat(a.toFixed(1)):a}function _M(e,n,t){return t>e.length?e:n===eQ.MID_LINE?e.substr(0,t/2)+"..."+e.substr(-t/2):n===eQ.FRONT_LINE?"..."+e.substr(-t):n===eQ.END_LINE?e.substr(0,t)+"...":void 0}function _T(e,n){let t=_O(e,"legend","additionalItems"),r=_O(n,"legend","additionalItems");if(t&&r){let a=r.map(e=>e.type),o=t.map(e=>e.type),i=fY.filter(e=>o.includes(e.type)&&!a.includes(e.type));e.legend.additionalItems=i,n.legend.additionalItems=sZ(i,r,"name")}}let _O=(e,...n)=>{let t=e;if(t){for(let e of n)if(null===t[e]||void 0===t[e])return null;else t=t[e];return t}return null},_N=(e,n)=>n===e0.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,_P=(e,n)=>{let{x0:t,x1:r,y0:a,y1:o}=_N(e,n);return`M${t},${a}L${t},${o}L${r},${o}L${r},${a}L${t},${a}`};function _I(e,n,t){return t===e0.VERTICAL?[e,n]:[n,e]}function _F(e){let n=nB(e),t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),e-t}function _R(e,n){let t=nB(e,n?.in);return t.setHours(0,0,0,0),t}function _H(e,n,t){let[r,a]=nD(t?.in,e,n),o=_R(r),i=_R(a);return Math.round((o-_F(o)-(i-_F(i)))/n$)}function _L(e,n){let t=nB(e,n?.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}function _j(e,n){let t=nB(e,n?.in);return _H(t,_L(t))+1}function _q(e,n){return nM(e,{...n,weekStartsOn:1})}function _G(e,n){let t=nB(e,n?.in),r=t.getFullYear(),a=nx(t,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);let o=_q(a),i=nx(t,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);let s=_q(i);return t.getTime()>=o.getTime()?r+1:t.getTime()>=s.getTime()?r:r-1}function _V(e,n){let t=_G(e,n),r=nx(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),_q(r)}function _U(e,n){let t=nB(e,n?.in);return Math.round((_q(t)-_V(t))/nC)+1}function _W(e,n){let t=nB(e,n?.in),r=t.getFullYear(),a=nz(),o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=nx(n?.in||e,0);i.setFullYear(r+1,0,o),i.setHours(0,0,0,0);let s=nM(i,n),l=nx(n?.in||e,0);l.setFullYear(r,0,o),l.setHours(0,0,0,0);let c=nM(l,n);return+t>=+s?r+1:+t>=+c?r:r-1}function _K(e,n){let t=nz(),r=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??t.firstWeekContainsDate??t.locale?.options?.firstWeekContainsDate??1,a=_W(e,n),o=nx(n?.in||e,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),nM(o,n)}function _Z(e,n){let t=nB(e,n?.in);return Math.round((nM(t,n)-_K(t,n))/nC)+1}function _Y(e,n){return(e<0?"-":"")+Math.abs(e).toString().padStart(n,"0")}let _J={y(e,n){let t=e.getFullYear(),r=t>0?t:1-t;return _Y("yy"===n?r%100:r,n.length)},M(e,n){let t=e.getMonth();return"M"===n?String(t+1):_Y(t+1,2)},d:(e,n)=>_Y(e.getDate(),n.length),a(e,n){let t=e.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];default:return"am"===t?"a.m.":"p.m."}},h:(e,n)=>_Y(e.getHours()%12||12,n.length),H:(e,n)=>_Y(e.getHours(),n.length),m:(e,n)=>_Y(e.getMinutes(),n.length),s:(e,n)=>_Y(e.getSeconds(),n.length),S(e,n){let t=n.length;return _Y(Math.trunc(e.getMilliseconds()*Math.pow(10,t-3)),n.length)}},_X="midnight",_Q="noon",_0="morning",_1="afternoon",_2="evening",_3="night",_4={G:function(e,n,t){let r=+(e.getFullYear()>0);switch(n){case"G":case"GG":case"GGG":return t.era(r,{width:"abbreviated"});case"GGGGG":return t.era(r,{width:"narrow"});default:return t.era(r,{width:"wide"})}},y:function(e,n,t){if("yo"===n){let n=e.getFullYear(),r=n>0?n:1-n;return t.ordinalNumber(r,{unit:"year"})}return _J.y(e,n)},Y:function(e,n,t,r){let a=_W(e,r),o=a>0?a:1-a;return"YY"===n?_Y(o%100,2):"Yo"===n?t.ordinalNumber(o,{unit:"year"}):_Y(o,n.length)},R:function(e,n){return _Y(_G(e),n.length)},u:function(e,n){return _Y(e.getFullYear(),n.length)},Q:function(e,n,t){let r=Math.ceil((e.getMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return _Y(r,2);case"Qo":return t.ordinalNumber(r,{unit:"quarter"});case"QQQ":return t.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(r,{width:"narrow",context:"formatting"});default:return t.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,n,t){let r=Math.ceil((e.getMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return _Y(r,2);case"qo":return t.ordinalNumber(r,{unit:"quarter"});case"qqq":return t.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(r,{width:"narrow",context:"standalone"});default:return t.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,n,t){let r=e.getMonth();switch(n){case"M":case"MM":return _J.M(e,n);case"Mo":return t.ordinalNumber(r+1,{unit:"month"});case"MMM":return t.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(r,{width:"narrow",context:"formatting"});default:return t.month(r,{width:"wide",context:"formatting"})}},L:function(e,n,t){let r=e.getMonth();switch(n){case"L":return String(r+1);case"LL":return _Y(r+1,2);case"Lo":return t.ordinalNumber(r+1,{unit:"month"});case"LLL":return t.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(r,{width:"narrow",context:"standalone"});default:return t.month(r,{width:"wide",context:"standalone"})}},w:function(e,n,t,r){let a=_Z(e,r);return"wo"===n?t.ordinalNumber(a,{unit:"week"}):_Y(a,n.length)},I:function(e,n,t){let r=_U(e);return"Io"===n?t.ordinalNumber(r,{unit:"week"}):_Y(r,n.length)},d:function(e,n,t){return"do"===n?t.ordinalNumber(e.getDate(),{unit:"date"}):_J.d(e,n)},D:function(e,n,t){let r=_j(e);return"Do"===n?t.ordinalNumber(r,{unit:"dayOfYear"}):_Y(r,n.length)},E:function(e,n,t){let r=e.getDay();switch(n){case"E":case"EE":case"EEE":return t.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(r,{width:"short",context:"formatting"});default:return t.day(r,{width:"wide",context:"formatting"})}},e:function(e,n,t,r){let a=e.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return _Y(o,2);case"eo":return t.ordinalNumber(o,{unit:"day"});case"eee":return t.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(a,{width:"short",context:"formatting"});default:return t.day(a,{width:"wide",context:"formatting"})}},c:function(e,n,t,r){let a=e.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return _Y(o,n.length);case"co":return t.ordinalNumber(o,{unit:"day"});case"ccc":return t.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(a,{width:"narrow",context:"standalone"});case"cccccc":return t.day(a,{width:"short",context:"standalone"});default:return t.day(a,{width:"wide",context:"standalone"})}},i:function(e,n,t){let r=e.getDay(),a=0===r?7:r;switch(n){case"i":return String(a);case"ii":return _Y(a,n.length);case"io":return t.ordinalNumber(a,{unit:"day"});case"iii":return t.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(r,{width:"short",context:"formatting"});default:return t.day(r,{width:"wide",context:"formatting"})}},a:function(e,n,t){let r=e.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(r,{width:"narrow",context:"formatting"});default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,n,t){let r,a=e.getHours();switch(r=12===a?_Q:0===a?_X:a/12>=1?"pm":"am",n){case"b":case"bb":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(r,{width:"narrow",context:"formatting"});default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,n,t){let r,a=e.getHours();switch(r=a>=17?_2:a>=12?_1:a>=4?_0:_3,n){case"B":case"BB":case"BBB":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(r,{width:"narrow",context:"formatting"});default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,n,t){if("ho"===n){let n=e.getHours()%12;return 0===n&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return _J.h(e,n)},H:function(e,n,t){return"Ho"===n?t.ordinalNumber(e.getHours(),{unit:"hour"}):_J.H(e,n)},K:function(e,n,t){let r=e.getHours()%12;return"Ko"===n?t.ordinalNumber(r,{unit:"hour"}):_Y(r,n.length)},k:function(e,n,t){let r=e.getHours();return 0===r&&(r=24),"ko"===n?t.ordinalNumber(r,{unit:"hour"}):_Y(r,n.length)},m:function(e,n,t){return"mo"===n?t.ordinalNumber(e.getMinutes(),{unit:"minute"}):_J.m(e,n)},s:function(e,n,t){return"so"===n?t.ordinalNumber(e.getSeconds(),{unit:"second"}):_J.s(e,n)},S:function(e,n){return _J.S(e,n)},X:function(e,n,t){let r=e.getTimezoneOffset();if(0===r)return"Z";switch(n){case"X":return _6(r);case"XXXX":case"XX":return _8(r);default:return _8(r,":")}},x:function(e,n,t){let r=e.getTimezoneOffset();switch(n){case"x":return _6(r);case"xxxx":case"xx":return _8(r);default:return _8(r,":")}},O:function(e,n,t){let r=e.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+_5(r,":");default:return"GMT"+_8(r,":")}},z:function(e,n,t){let r=e.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+_5(r,":");default:return"GMT"+_8(r,":")}},t:function(e,n,t){return _Y(Math.trunc(e/1e3),n.length)},T:function(e,n,t){return _Y(+e,n.length)}};function _5(e,n=""){let t=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),o=r%60;return 0===o?t+String(a):t+String(a)+n+_Y(o,2)}function _6(e,n){return e%60==0?(e>0?"-":"+")+_Y(Math.abs(e)/60,2):_8(e,n)}function _8(e,n=""){let t=e>0?"-":"+",r=Math.abs(e);return t+_Y(Math.trunc(r/60),2)+n+_Y(r%60,2)}let _7=(e,n)=>{switch(e){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});default:return n.date({width:"full"})}},_9=(e,n)=>{switch(e){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});default:return n.time({width:"full"})}},he=(e,n)=>{let t,r=e.match(/(P+)(p+)?/)||[],a=r[1],o=r[2];if(!o)return _7(e,n);switch(a){case"P":t=n.dateTime({width:"short"});break;case"PP":t=n.dateTime({width:"medium"});break;case"PPP":t=n.dateTime({width:"long"});break;default:t=n.dateTime({width:"full"})}return t.replace("{{date}}",_7(a,n)).replace("{{time}}",_9(o,n))},hn={p:_9,P:he},ht=/^D+$/,hr=/^Y+$/,ha=["D","DD","YY","YYYY"];function ho(e){return ht.test(e)}function hi(e){return hr.test(e)}function hs(e,n,t){let r=hl(e,n,t);if(console.warn(r),ha.includes(e))throw RangeError(r)}function hl(e,n,t){let r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${n}\`) for formatting ${r} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function hc(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function hu(e){return!(!hc(e)&&"number"!=typeof e||isNaN(+nB(e)))}let hd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,hp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,hf=/^'([^]*?)'?$/,h_=/''/g,hh=/[a-zA-Z]/;function hm(e,n,t){let r=nz(),a=t?.locale??r.locale??n2,o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=nB(e,t?.in);if(!hu(s))throw RangeError("Invalid time value");let l=n.match(hp).map(e=>{let n=e[0];return"p"===n||"P"===n?(0,hn[n])(e,a.formatLong):e}).join("").match(hd).map(e=>{if("''"===e)return{isToken:!1,value:"'"};let n=e[0];if("'"===n)return{isToken:!1,value:hg(e)};if(_4[n])return{isToken:!0,value:e};if(n.match(hh))throw RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return{isToken:!1,value:e}});a.localize.preprocessor&&(l=a.localize.preprocessor(s,l));let c={firstWeekContainsDate:o,weekStartsOn:i,locale:a};return l.map(r=>{if(!r.isToken)return r.value;let o=r.value;return(!t?.useAdditionalWeekYearTokens&&hi(o)||!t?.useAdditionalDayOfYearTokens&&ho(o))&&hs(o,n,String(e)),(0,_4[o[0]])(s,o,a.localize,c)}).join("")}function hg(e){let n=e.match(hf);return n?n[1].replace(h_,"'"):e}let hA=[["15seconds",15e3],["minute",6e4],["30minutes",18e5],["hourly",36e5],["daily",864e5],["monthly",2592e6],["quarterly",7776e6],["yearly",31104e6]];function hy(e,n,t,r,a){let o=0===n,i=2===Number(hm(new Date(e),"c")),s=1===Number(hm(new Date(e),"q")),l=0!==n?t[n-1]:null;switch(r){case"15seconds":case"minute":case"30minutes":case"hourly":return o||hk(e)||hE(e,l)||hx(e);case"daily":return a?o||i||hx(e):o||hE(e,l)||hx(e);case"weekly":return o||i||hx(e);case"monthly":return o||hx(e);case"quarterly":return o||s;case"yearly":return!1;default:throw Error(`${r} is not a valid time interval.`)}}function hb(e,n,t,r,a,o){let i=a.showDayName,s="daily"===r&&i?"weekly":r,l=new Date(e),c=_O(a,"timeIntervalFormats")[s],u=_O(c,"primary"),d=_O(c,"secondary"),p=hy(e,n,t,r,i),f=p?u:d;"15seconds"===r&&0!==l.getMilliseconds()&&(f=f.replace("pp","h:mm:ss.SSS a"));let h=a.localeObject,{code:m,optionsObject:g}=o,A=g[r].type,y=g[r][p?"primary":"secondary"][f];if("quarterly"!==r&&y)return o[A](l,m,y);{let e=hm(l,f,{locale:h}).split("").map(e=>{let n=Number(e);return" "===e||Number.isNaN(n)?e:n?.toLocaleString?.(m)});return o[A](l,m,{},e.join(""))}}function hv(e){let n=new Date(e);return{M:n.getMonth()+1,d:n.getDate(),H:n.getHours(),m:n.getMinutes(),s:n.getSeconds()}}function hC(e){if(e)return e.slice(1).map((n,t)=>n-e[t])}function h$(e){let n=hA.reduce((n,[,t],r)=>Math.abs(hA[n][1]-e)<Math.abs(t-e)?n:r,0);return hA[n][0]}function hw(e,n){return nh[n]?n:1===e.length?"15seconds":h$(ll(hC(e)))}function hk(e){let{s:n,m:t,H:r}=hv(e);return 0===r&&0===t&&0===n}function hE(e,n){return hv(e).M!==hv(n).M}function hx(e){let{M:n,d:t,s:r,m:a,H:o}=hv(e);return 1===n&&1===t&&0===o&&0===a&&0===r}function hD(e){return void 0===e?"":e.toISOString()}function hS(e){let n=s4(e,e=>e.value),t=pQ().domain(n).nice().domain();if(t[0]>0)t[0]=0;else if(0===t[0]&&0===t[1])return[0,1];return t[0]<0&&t[1]>0&&(Math.abs(t[0])>t[1]?t[1]=Math.abs(t[0]):t[0]=-t[1]),t}function hz(e,n){let t=_O(n,"gradient","colors"),r=!sq(t),a=_O(n,"pairing","option"),o=hS(e),i=o[0]<0&&o[1]>0?"diverge":"mono";(a<1&&a>4&&"mono"===i||a<1&&a>2&&"diverge"===i)&&(a=1);let s=r?t:[];if(!r){let e="diverge"===i?17:11;for(let n=1;n<e+1;n++)s.push(`fill-${i}-${a}-${n}`)}return p0().domain(o).range(s)}var hB=((ef=hB||{}).GRAPHICS_DOCUMENT="graphics-document",ef.GRAPHICS_OBJECT="graphics-object",ef.GRAPHICS_SYMBOL="graphics-symbol",ef.GROUP="group",ef.DOCUMENT="document",ef.CHECKBOX="checkbox",ef.BUTTON="button",ef.MENU="menu",ef.MENU_ITEM="menuitem",ef.IMG="img",ef),hM=function(e,n){return function(n,t){if(null==n)return n;if(!ro(n))return e(n,t);for(var r=n.length,a=-1,o=Object(n);++a<r&&!1!==t(o[a],a,o););return n}}(function(e,n){return e&&sM(e,n,r6)});function hT(e){return function(){return e}}var hO=Array.prototype.slice;function hN(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function hP(e,n,t,r){for(var a=-1,o=null==e?0:e.length;++a<o;){var i=e[a];n(r,i,t(i),e)}return r}function hI(e,n,t,r){return hM(e,function(e,a,o){n(r,e,t(e),o)}),r}function hF(e,n){return function(n,t){var r=tp(n)?hP:hI,a={};return r(n,e,sB(t),a)}}function hR(e){for(var n=-1,t=null==e?0:e.length,r={};++n<t;){var a=e[n];r[a[0]]=a[1]}return r}var hH=Object.prototype.hasOwnProperty,hL=hF(function(e,n,t){hH.call(e,t)?e[t].push(n):t5(e,t,[n])});function hj(e,n){let t=0;for(let n of e)null!=n&&(n*=1)>=n&&++t;return t}function hq(e){return e}function hG(e=sJ){if(e===sJ)return hV;if("function"!=typeof e)throw TypeError("compare is not a function");return(n,t)=>{let r=e(n,t);return r||0===r?r:(0===e(t,t))-(0===e(n,n))}}function hV(e,n){return(null==e||!(e>=e))-(null==n||!(n>=n))||(e<n?-1:+(e>n))}var hU=Array.prototype.slice;function hW(e){return()=>e}function hK(e,n,t){let r;for(;;){let a=lo(e,n,t);if(a===r||0===a||!isFinite(a))return[e,n];a>0?(e=Math.floor(e/a)*a,n=Math.ceil(n/a)*a):a<0&&(e=Math.ceil(e*a)/a,n=Math.floor(n*a)/a),r=a}}function hZ(e){return Math.max(1,Math.ceil(Math.log(hj(e))/Math.LN2)+1)}function hY(){var e=hq,n=s4,t=hZ;function r(r){Array.isArray(r)||(r=Array.from(r));var a,o,i,s=r.length,l=Array(s);for(a=0;a<s;++a)l[a]=e(r[a],a,r);var c=n(l),u=c[0],d=c[1],p=t(l,u,d);if(!Array.isArray(p)){let e=d,t=+p;if(n===s4&&([u,d]=hK(u,d,t)),(p=la(u,d,t))[0]<=u&&(i=lo(u,d,t)),p[p.length-1]>=d)if(e>=d&&n===s4){let e=lo(u,d,t);isFinite(e)&&(e>0?d=(Math.floor(d/e)+1)*e:e<0&&(d=-((Math.ceil(-(d*e))+1)/e)))}else p.pop()}for(var f=p.length,h=0,m=f;p[h]<=u;)++h;for(;p[m-1]>d;)--m;(h||m<f)&&(p=p.slice(h,m),f=m-h);var g,A=Array(f+1);for(a=0;a<=f;++a)(g=A[a]=[]).x0=a>0?p[a-1]:u,g.x1=a<f?p[a]:d;if(isFinite(i)){if(i>0)for(a=0;a<s;++a)null!=(o=l[a])&&u<=o&&o<=d&&A[Math.min(f,Math.floor((o-u)/i))].push(r[a]);else if(i<0){for(a=0;a<s;++a)if(null!=(o=l[a])&&u<=o&&o<=d){let e=Math.floor((u-o)*i);A[Math.min(f,e+(p[e]<=o))].push(r[a])}}}else for(a=0;a<s;++a)null!=(o=l[a])&&u<=o&&o<=d&&A[s3(p,o,0,f)].push(r[a]);return A}return r.value=function(n){return arguments.length?(e="function"==typeof n?n:hW(n),r):e},r.domain=function(e){return arguments.length?(n="function"==typeof e?e:hW([e[0],e[1]]),r):n},r.thresholds=function(e){return arguments.length?(t="function"==typeof e?e:hW(Array.isArray(e)?hU.call(e):e),r):t},r}function hJ(e,n,t=0,r=1/0,a){if(n=Math.floor(n),t=Math.floor(Math.max(0,t)),r=Math.floor(Math.min(e.length-1,r)),!(t<=n&&n<=r))return e;for(a=void 0===a?hV:hG(a);r>t;){if(r-t>600){let o=r-t+1,i=n-t+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(i-o/2<0?-1:1),u=Math.max(t,Math.floor(n-i*l/o+c)),d=Math.min(r,Math.floor(n+(o-i)*l/o+c));hJ(e,n,u,d,a)}let o=e[n],i=t,s=r;for(hX(e,t,n),a(e[r],o)>0&&hX(e,t,r);i<s;){for(hX(e,i,s),++i,--s;0>a(e[i],o);)++i;for(;a(e[s],o)>0;)--s}0===a(e[t],o)?hX(e,t,s):hX(e,++s,r),s<=n&&(t=s+1),n<=s&&(r=s-1)}return e}function hX(e,n,t){let r=e[n];e[n]=e[t],e[t]=r}function hQ(e,n,t){if(!(!(r=(e=Float64Array.from(s2(e))).length)||isNaN(n*=1))){if(n<=0||r<2)return ll(e);if(n>=1)return ls(e);var r,a=(r-1)*n,o=Math.floor(a),i=ls(hJ(e,o).subarray(0,o+1));return i+(ll(e.subarray(o+1))-i)*(a-o)}}function h0(e,n){if((a=e.length)>1)for(var t,r,a,o=1,i=e[n[0]],s=i.length;o<a;++o)for(r=i,i=e[n[o]],t=0;t<s;++t)i[t][1]+=i[t][0]=isNaN(r[t][1])?r[t][0]:r[t][1]}function h1(e){for(var n=e.length,t=Array(n);--n>=0;)t[n]=n;return t}function h2(e,n){return e[n]}function h3(e){let n=[];return n.key=e,n}function h4(){var e=hT([]),n=h1,t=h0,r=h2;function a(a){var o,i,s=Array.from(e.apply(this,arguments),h3),l=s.length,c=-1;for(let e of a)for(o=0,++c;o<l;++o)(s[o][c]=[0,+r(e,s[o].key,c,a)]).data=e;for(o=0,i=hN(n(s));o<l;++o)s[i[o]].index=o;return t(s,i),s}return a.keys=function(n){return arguments.length?(e="function"==typeof n?n:hT(Array.from(n)),a):e},a.value=function(e){return arguments.length?(r="function"==typeof e?e:hT(+e),a):r},a.order=function(e){return arguments.length?(n=null==e?h1:"function"==typeof e?e:hT(Array.from(e)),a):n},a.offset=function(e){return arguments.length?(t=e??h0,a):t},a}function h5(e,n){if((s=e.length)>0)for(var t,r,a,o,i,s,l=0,c=e[n[0]].length;l<c;++l)for(o=i=0,t=0;t<s;++t)(a=(r=e[n[t]][l])[1]-r[0])>0?(r[0]=o,r[1]=o+=a):a<0?(r[1]=i,r[0]=i+=a):(r[0]=0,r[1]=a)}function h6(e){let n=e.trim();return["=","+","-","@"," ","\r"].includes(n.charAt(0))?`\xa0${n}`:/[,\"\n]/.test(n)?`"${n}"`:n}class h8{constructor(e){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=e}formatTable({headers:e,cells:n}){let t,r=this.getOptions(),{code:a,date:o,number:i}=_O(r,"locale"),s=_O(r,"tabularRepModal","tableHeadingFormatter"),l=_O(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services;return c?.getDomainAxisScaleType()===e1.TIME&&(t=e=>o(e,a,{month:"short",day:"numeric",year:"numeric"})),["function"==typeof s?s(e):e,..."function"==typeof l?l(n):n.map(e=>{for(let n in t&&(e[1]=t(e[1])),e){let t=e[n];"number"==typeof t&&(e[n]=i(t,a))}return e})]}getAllDataFromDomain(e){if(!this.getData())return null;let n=this.getOptions(),t=this.getData(),r=this.getDataGroups(),{groupMapsTo:a}=_O(n,"data"),o=_O(n,"axes");return e&&(t=t.filter(n=>e.includes(n[a]))),o&&Object.keys(o).forEach(e=>{let n=o[e].mapsTo,r=o[e].scaleType;if((r===e1.LINEAR||r===e1.LOG)&&(t=t.map(e=>({...e,[n]:null===e[n]?e[n]:Number(e[n])}))),n&&o[e].domain)if(r===e1.LABELS)t=t.filter(t=>o[e].domain.includes(t[n]));else{let[r,a]=o[e].domain;t=t.filter(e=>!(n in e)||e[n]>=r&&e[n]<=a)}}),t.filter(e=>r.find(n=>n.name===e[a]))}getDisplayData(e){if(!this.get("data"))return null;let{ACTIVE:n}=fu.items.status,t=this.getDataGroups(e),{groupMapsTo:r}=this.getOptions().data;return this.getAllDataFromDomain(e).filter(e=>t.find(t=>t.name===e[r]&&t.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(e){let n=this.sanitize(iL(e)),t=this.generateDataGroups(n);return this.set({data:n,dataGroups:t}),n}getDataGroups(e){return _O(this.getOptions(),"data","loading")?[]:e?this.get("dataGroups").filter(n=>e.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(e){let{ACTIVE:n}=fu.items.status;return this.getDataGroups(e).filter(e=>e.status===n)}getDataGroupNames(e){return this.getDataGroups(e).map(e=>e.name)}getActiveDataGroupNames(e){return this.getActiveDataGroups(e).map(e=>e.name)}aggregateBinDataByGroup(e){return hL(e,"group")}getBinConfigurations(){let e=this.getDisplayData(),n=this.getOptions(),t=this.services.cartesianScales.getMainXAxisPosition(),r=this.services.cartesianScales.getDomainIdentifier(),a=n.axes[t],{groupMapsTo:o}=n.data,{bins:i=fc}=a,s=Array.isArray(i),l=hY().value(e=>e[r]).thresholds(i)(e);if(s)l[l.length-1].x1=i[i.length-1];else{let e=l[0].x1-l[0].x0;l[l.length-1].x1=+l[l.length-1].x0+e}let c=s?[i[0],i[i.length-1]]:[l[0].x0,l[l.length-1].x1],u=Array.from(new Set(e.map(e=>e[o]))),d=[];return l.forEach(e=>{let n=`${e.x0}-${e.x1}`,t=this.aggregateBinDataByGroup(e);u.forEach(r=>{d.push({group:r,key:n,value:t[r]||0,bin:e.x0})})}),{bins:l,binsDomain:c}}getBinnedStackedData(){let{groupMapsTo:e}=this.getOptions().data,n=this.getActiveDataGroupNames(),{bins:t}=this.getBinConfigurations(),r=this.getDataValuesGroupedByKeys({bins:t});return h4().keys(n)(r).map((t,r)=>Object.keys(t).filter(e=>!isNaN(e)).map(a=>{let o=t[a];return o[e]=n[r],o}))}getGroupedData(e){let n=this.getDisplayData(e),t={},{groupMapsTo:r}=this.getOptions().data;return n.map(e=>{let n=e[r];null!==t[n]&&void 0!==t[n]?t[n].push(e):t[n]=[e]}),Object.keys(t).map(e=>({name:e,data:t[e]}))}getStackKeys({bins:e=null,groups:n=null}={bins:null,groups:null}){let t,r=this.getOptions(),a=this.getDisplayData(n);t=e?e.map(e=>`${e.x0}:${e.x1}`):sY(a.map(e=>{let n=this.services.cartesianScales.getDomainIdentifier(e);return e[n]instanceof Date?hD(e[n]):e[n]&&"function"==typeof e[n].toString?e[n].toString():e[n]}));let o=this.services.cartesianScales.domainAxisPosition,i=r.axes[o].scaleType;return i===e1.TIME?t.sort((e,n)=>new Date(e)-new Date(n)):(i===e1.LOG||i===e1.LINEAR)&&t.sort((e,n)=>e-n),t}getDataValuesGroupedByKeys({bins:e=null,groups:n=null}){let{groupMapsTo:t}=this.getOptions().data,r=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:e,groups:n});return e?o.map(n=>{let[r,o]=n.split(":"),i={x0:r,x1:o},s=e.find(e=>e.x0.toString()===r.toString());return a.forEach(e=>{i[e]=s.filter(n=>n[t]===e).length}),i}):o.map(e=>{let n={sharedStackKey:e};return a.forEach(a=>{let o=r.find(n=>{let r=this.services.cartesianScales.getDomainIdentifier(n);return n[t]===a&&Object.prototype.hasOwnProperty.call(n,r)&&(n[r]instanceof Date?hD(n[r])===e:n[r].toString()===e)}),i=this.services.cartesianScales.getRangeIdentifier(n);n[a]=o?o[i]:null}),n})}getStackedData({percentage:e=!1,groups:n=null,divergent:t=!1}){let{groupMapsTo:r}=this.getOptions().data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(e){let e=hR(o.map(e=>[e.sharedStackKey,0]));o.forEach(n=>{a.forEach(t=>{e[n.sharedStackKey]+=n[t]})}),o.forEach(n=>{a.forEach(t=>{let r=e[n.sharedStackKey];e[n.sharedStackKey]?n[t]=n[t]/r*100:n[t]=0})})}return(t?h4().offset(h5):h4()).keys(a)(o).map((e,n)=>Object.keys(e).filter(e=>!isNaN(e)).map(t=>{let o=e[t];return o[r]=a[n],o}))}getOptions(){return this.state.options}set(e,n){this.state=Object.assign({},this.state,e);let t=Object.assign({skipUpdate:!1,animate:!0},n);t.skipUpdate||this.update(t.animate)}get(e){return e?this.state[e]:this.state}setOptions(e){let n=this.getOptions();_T(n,e),this.set({options:sG(n,e)})}update(e=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(eW.Model.UPDATE,{animate:e}))}toggleDataLabel(e){let{ACTIVE:n,DISABLED:t}=fu.items.status,r=this.getDataGroups(),a=r.some(e=>e.status===t),o=r.filter(e=>e.status===n);if(a)if(1===o.length&&o[0].name===e)r.forEach((e,t)=>{r[t].status=n});else{let a=r.findIndex(n=>n.name===e);r[a].status=r[a].status===t?n:t}else r.forEach((a,o)=>{r[o].status=a.name===e?n:t});let i=r.filter(e=>e.status===n),s=this.getOptions();r.some(e=>e.status===t)?s.data.selectedGroups=i.map(e=>e.name):s.data.selectedGroups=[],this.services.events.dispatchEvent(eW.Legend.ITEMS_UPDATE,{dataGroups:r}),this.set({dataGroups:r})}getIsFilled(e,n,t,r){let a=this.getOptions();return a.getIsFilled?a.getIsFilled(e,n,t,r):r}getFillColor(e,n,t){let r=this.getOptions(),a=_O(this.colorScale,e);return r.getFillColor?r.getFillColor(e,n,t,a):a}getStrokeColor(e,n,t){let r=this.getOptions(),a=_O(this.colorScale,e);return r.getStrokeColor?r.getStrokeColor(e,n,t,a):a}isUserProvidedColorScaleValid(){let e=_O(this.getOptions(),"color","scale"),n=this.getDataGroups();return null!=e&&0!=Object.keys(e).length&&n.some(n=>Object.keys(e).includes(n.name))}getColorClassName(e){let n=this.colorClassNames(e.dataGroupName),t=e.originalClassName;return e.classNameTypes.forEach(r=>t=e.originalClassName?`${t} ${r}-${n}`:`${r}-${n}`),t||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(e){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/");let n=[],{datasets:t,labels:r}=e;return t.forEach(e=>{e.data.forEach((t,a)=>{let o,i=_O(e,"label");if(null===i){let e=_O(r,a);o=e||"Ungrouped"}else o=i;let s={group:o,key:r[a]};isNaN(t)?(s.value=t.value,s.date=t.date):s.value=t,n.push(s)})}),n}getTabularDataArray(){return[]}exportToCSV(){let e=this.getTabularDataArray().map(e=>e.map(e=>`"${("–"===e?"–":e).split(/[,;'"`]/).map(e=>h6(e)).join("")}"`)).map(e=>e.join(",")).join(`
|
|
@@ -101,4 +101,4 @@ If you're the maintainer: the 'elements' key only works with '_type' equal to 'A
|
|
|
101
101
|
${n}`)}return r}ey(ea.getState(),eo.getState()),ea.subscribe(e=>ey(e,eo.getState())),eo.subscribe(e=>ey(ea.getState(),e)),ev(ea.getState(),eo.getState()),ea.subscribe(e=>ev(e,eo.getState())),eo.subscribe(e=>ev(ea.getState(),e)),eb(ea.getState(),eo.getState()),ea.subscribe(e=>eb(e,eo.getState())),eo.subscribe(e=>eb(ea.getState(),e)),eC(ea.getState(),el.getState(),eo.getState()),ea.subscribe(e=>{eC(e,el.getState(),eo.getState())}),el.subscribe(e=>{eC(ea.getState(),e,eo.getState())}),eo.subscribe(e=>{eC(ea.getState(),el.getState(),e)});let eX=(e,n)=>{let t=O(n);if(!e)return t;for(let n of Object.keys(e)){let r=t[n],a=e[n];if(a&&(a.hasOwnProperty("_type")||a.hasOwnProperty("_default"))){t.hasOwnProperty(n)||(t[n]=a._default);let e=a._elements;if(r&&eQ(e)){if(a._type===W.Array&&Array.isArray(r)){let a=r.map(n=>eX(e,n));t[n]=a}else if(a._type===W.Object)for(let n of Object.keys(r))r[n]=eX(e,r[n])}}else if(e0(a)){let e=r??{};e0(e)&&(t[n]=eX(a,e))}}return t};function eQ(e){return!!e&&Object.keys(e).filter(e=>!["_default","_validators"].includes(e)).length>0}function e0(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}let e1=new Set;function e2(e,n){let t=`${e}:::${n}`;e1||(e1=new Set),e1.has(t)||(console.error(n),e1.add(t))}function e3(e){e?e1.forEach(n=>{n.startsWith(e)&&e1.delete(n)}):e1.clear()}function e4(e){let[n]=e.split("#");return n}let e5={"Translation overrides":{_description:"Per-language overrides for frontend translations should be keyed by language code and each language dictionary contains the translation key and the display value",_type:W.Object,_default:{},_validators:[K(e=>Object.keys(e).every(e=>/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e)),e=>{let n=Object.keys(e).filter(e=>!/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e));return`The 'Translation overrides' object should have language codes for keys. Language codes must be in the form of a two-to-three letter language code optionally followed by a hyphen and a two-to-three letter country code. The following keys do not conform: ${n.join(", ")}.`})]}},e6={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:W.Array,_default:[]}},...e5},e8=(e,n)=>K(t=>e<=t&&t<=n,`must be between ${e} and ${n}`),e7=e=>{let n=e.concat(["openmrsBase","openmrsSpaBase"]);return K(e=>{if(!e||"string"!=typeof e)return!1;let t=/\${(.*?)}/g,r=t.exec(e);for(;r;){if(!n.includes(r[1]))return!1;r=t.exec(e)}return!0},"Should be a URL or path. The allowed template parameters are "+n.map(e=>"${"+e+"}").join(", "))},e9=e7([]),ne=e=>K(n=>e.includes(n),`Must be one of the following: '${e.join("', '")}'.`),nn={inRange:e8,isUrl:e9,isUrlWithTemplateParameters:e7,oneOf:ne}},81565:function(e,n,t){"use strict";t.d(n,{Ln:()=>c,Yv:()=>o,rL:()=>i,zC:()=>l});var r=t(27760),a=t(61836);function o(e){return e.replace(/[\/\-@]/g,"_")}async function i(e,n="./start",r){let a,c=!r?.maxLoadingTime||r.maxLoadingTime<=0?6e5:r.maxLoadingTime;await Promise.race([l(e,r?.importMap),new Promise((n,t)=>{a=setTimeout(()=>{t(Error(`Could not resolve requested script, ${e}, within ${s(c)}.`))},c)})]),a&&clearTimeout(a);let d=o(e),p=window[d];if(!u(p)){let e=`The global variable ${d} does not refer to a federated module`;throw console.error(e),Error(e)}p.init(t.S.default);let f=(await p.get(n))();if("object"!=typeof f||null===f){let n=`Container for ${e} did not return an ESM module as expected`;throw console.error(n),Error(n)}return f}function s(e){return e<1e3?`${e} milliseconds`:e<6e4?`${Math.floor(e/1e3)} seconds`:e<36e5?`${Math.floor(e/6e4)} minutes`:e<864e5?`${Math.floor(e/36e5)} hours`:`${Math.floor(e/864e5)} days`}async function l(e,n){if("string"!=typeof e||0===e.trim().length){let e="Attempted to call importDynamic() without supplying a package to load";throw console.error(e),Error(e)}let t=o(e);if(!window[t]){let t=n??await c();if(!t.imports.hasOwnProperty(e)){let n=`Could not find the package ${e} defined in the current importmap`;throw console.error(n),Error(n)}let o=t.imports[e];o.startsWith("./")&&(o=window.spaBase+o.substring(1));let i=!!window.localStorage.getItem(`import-map-override:${e}`);try{return await new Promise((e,n)=>{p(o,e,n)})}catch(e){return i&&(0,r.Vt)({kind:"error",title:(0,a.V)("scriptLoadingFailed","Error: Script failed to load"),description:(0,a.V)("scriptLoadingError","Failed to load overridden script from {{- url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",{url:o}),actionButtonLabel:(0,a.V)("resetOverrides","Reset overrides"),onActionButtonClick(){window.importMapOverrides.resetOverrides(),window.location.reload()}}),Promise.reject(e)}}return Promise.resolve()}async function c(){return window.importMapOverrides.getCurrentPageMap()}function u(e){return"object"==typeof e&&null!==e&&"init"in e&&"function"==typeof e.init&&"get"in e&&"function"==typeof e.get}let d=Symbol("__openmrs_script_loading");function p(e,n,t){let r=document.head.querySelector(`script[src="${e}"]`),a=window[d];if(a||(a=window[d]=new Set([])),r)if(a.has(e)){let e,a,o;o=()=>{e&&r.removeEventListener("load",e),a&&r.removeEventListener("error",a)},e=()=>{o(),n(null)},a=e=>{o(),t(e.message)},r.addEventListener("load",e),r.addEventListener("error",a)}else console.warn(`Script at ${e} already loaded. Not loading it again.`),n(null);else{let r,o,i;a.add(e);let s=document.createElement("script");s.src=e,s.type="text/javascript",s.async=!0;let l=setTimeout(()=>{console.error(`The script at ${e} did not load within 5 seconds. This may indicate an issue with the imports in the script's entry-point file or with the script's bundler configuration.`)},5e3);i=()=>{clearTimeout(l),a.delete(e),r&&s.removeEventListener("load",r),o&&s.removeEventListener("error",o)},r=()=>{i(),n(null)},o=n=>{i();let r=`Failed to load script from ${e}`;console.error(r,n),t(n.message??r)},s.addEventListener("load",r),s.addEventListener("error",o),document.head.appendChild(s)}}},30924:function(e,n,t){"use strict";t.d(n,{hG:()=>u,dx:()=>$,Bv:()=>i,Pu:()=>g,Vs:()=>h,cD:()=>s,KU:()=>o,BX:()=>x,Ds:()=>B,DK:()=>O,BR:()=>T,xL:()=>M,E$:()=>f,Rb:()=>k,SY:()=>l,NH:()=>D,Cj:()=>w,Qx:()=>m,Zu:()=>a});var r=t(70937);let a=`${r.Jj}/attachment`;function o(e,n){return(0,r.lo)(`${a}/${e}`,{signal:n.signal})}function i(e,n,t){return(0,r.lo)(`${a}?patient=${e}&includeEncounterless=${n}`,{signal:t.signal})}async function s(e,n){let t=new FormData;return t.append("fileCaption",n.fileDescription),t.append("patient",e),n.file?t.append("file",n.file,n.fileName):(t.append("file",new File([""],n.fileName),n.fileName),t.append("base64Content",n.base64Content)),(0,r.lo)(`${a}`,{method:"POST",body:t})}function l(e,n){return(0,r.lo)(`${a}/${e}`,{method:"DELETE",signal:n.signal})}var c=t(43920);async function u(e,n,t=!0){if(e){let a=null,[o,i]=await Promise.all([(0,r.lo)(`${r.IU}/Patient/${e}`,n).catch(e=>a=e),t?d(e):Promise.resolve(null)]);if(o.ok)return o.data;if(i)return i;if(a)throw a}return null}async function d(e){let n=(await (0,c.pb)("patient-registration")).find(n=>n.fhirPatient.id===e);return n?.fhirPatient??null}var p=t(99549);function f(e){return{uuid:e.uuid,display:e.display}}function h(e=null,n=null){let t=new URLSearchParams;e&&t.set("tag",e),n&&t.set("q",n);let a=t.toString(),o=`${r.Jj}/location${a?"?"+a:""}`;return(0,r.ut)(o).pipe((0,p.map)(e=>e.data.results.map(f))).pipe((0,p.take)(1))}function m(e){return{uuid:e.uuid,display:e.display,name:e.name}}function g(){return(0,r.ut)(`${r.Jj}/visittype`).pipe((0,p.map)(e=>e.data.results.map(m))).pipe((0,p.take)(1))}var A=t(467),y=t(32505),b=t(60482),v=t(20320),C=function(e){function n(n){var t=e.call(this)||this;return t._value=n,t}return y.C6(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(n){var t=e.prototype._subscribe.call(this,n);return t&&!t.closed&&n.next(this._value),t},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(!this.closed)return this._value;throw new v.P},n.prototype.next=function(n){e.prototype.next.call(this,this._value=n)},n}(b.B7),$=function(e){return e.NEWVISIT="startVisit",e.EDITVISIT="editVisit",e.LOADING="loadingVisit",e}({}),w=function(e){return e.NOTSTARTED="notStarted",e.ONGOING="ongoing",e}({});let k="custom:(uuid,display,voided,indication,startDatetime,stopDatetime,encounters:(uuid,display,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,display),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display))",E=z()||{patientUuid:null,manuallySetVisitUuid:null,mutateVisitCallbacks:{}};function x(){return(0,A.jf)("visit",E)}function D(e,n){x().setState({patientUuid:e,manuallySetVisitUuid:n})}function S(e){sessionStorage.setItem("openmrs:visitStoreState",JSON.stringify(e))}function z(){try{return JSON.parse(sessionStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}function B(e,n){return(0,r.lo)(`${r.Jj}/visit`,{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function M(e,n,t){return(0,r.lo)(`${r.Jj}/visit/${e}`,{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:n})}function T(e,n,t){let a=t??k;return(0,r.lo)(`${r.Jj}/visit?patient=${e}&v=${a}`,{signal:n.signal,method:"GET",headers:{"Content-type":"application/json"}})}x().subscribe(e=>{S(e)});let O=new C(null)},64201:function(e,n,t){"use strict";t.d(n,{J:()=>o,N:()=>a});var r=t(27760);function a(e){let n=i(e);setTimeout(()=>{throw n})}function o(){let e=Error();return n=>{let t=i(n);t.stack+=`
|
|
102
102
|
Async stacktrace:
|
|
103
103
|
${e.stack}`,a(n)}}function i(e){let n;if(e instanceof Error)return e;if(null===e)return Error("'null' was thrown as an error");if("object"==typeof e){try{n=`Object thrown as error: ${JSON.stringify(e)}`}catch(t){n=`Object thrown as error with the following properties: ${Object.keys(e)}`}return Error(n)}if(void 0===e)return Error("'undefined' was thrown as an error");return Error(e.toString())}window.onerror=function(e){return console.error("Unexpected error: ",e),(0,r.Vt)({description:e??"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(e){console.error("Unhandled rejection: ",e.reason),(0,r.Vt)({description:e.reason??"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})}},6250:function(e,n,t){"use strict";t.d(n,{dX:()=>x,wE:()=>B,_3:()=>$,uN:()=>z,$F:()=>D,Gz:()=>E,eb:()=>k,Sj:()=>S,mv:()=>w,PQ:()=>r.A});var r=t(60950);let a="ArrowFunctionExpression";var o={name:"arrow",init(e){function n(t){t&&(Object.values(t).forEach(e=>{e&&"object"==typeof e&&n(e)}),"=>"===t.operator&&(t.type=a,t.params=t.left?[t.left]:null,t.body=t.right,t.params&&t.params[0].type===e.SEQUENCE_EXP&&(t.params=t.params[0].expressions),delete t.left,delete t.right,delete t.operator))}e.addBinaryOp("=>",.1,!0),e.hooks.add("gobble-expression",function(n){if(this.gobbleSpaces(),this.code===e.OPAREN_CODE){let t=this.index;if(this.index++,this.gobbleSpaces(),this.code===e.CPAREN_CODE){this.index++;let e=this.gobbleBinaryOp();if("=>"===e){let t=this.gobbleBinaryExpression();t||this.throwError("Expected expression after "+e),n.node={type:a,params:null,body:t};return}}this.index=t}}),e.hooks.add("after-expression",function(e){n(e.node)})}},i={name:"new",init(e){e.addUnaryOp("new"),e.hooks.add("after-token",function(n){let t=n.node;if(t&&"new"===t.operator){t.argument&&[e.CALL_EXP,e.MEMBER_EXP].includes(t.argument.type)||this.throwError("Expected new function()"),n.node=t.argument;let r=n.node;for(;r.type===e.MEMBER_EXP||r.type===e.CALL_EXP&&r.callee.type===e.MEMBER_EXP;)r=r.type===e.MEMBER_EXP?r.object:r.callee.object;r.type="NewExpression"}})}};let s=48,l=95;var c={name:"numbers",init(e){function n(e){return"x"===e||"X"===e?(this.index+=2,[[48,57],[65,70],[97,102]]):"b"===e||"B"===e?(this.index+=2,[[48,49]]):"o"===e||"O"===e||e>="0"&&e<="7"?(this.index+=e<="7"?1:2,[[48,55]]):null}function t(e){return"x"===e||"X"===e?16:"b"===e||"B"===e?2:8}function r(e,n){return e===l||n.some(([n,t])=>e>=n&&e<=t)}function a(n){let t=this.index,r="",a=()=>{for(;e.isDecimalDigit(this.code)||this.code===l;)this.code===l?this.index++:r+=this.expr.charAt(this.index++)};a(),this.code===e.PERIOD_CODE&&(r+=this.expr.charAt(this.index++),a());let o=this.char;("e"===o||"E"===o)&&(r+=this.expr.charAt(this.index++),("+"===(o=this.char)||"-"===o)&&(r+=this.expr.charAt(this.index++)),a(),e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+r+this.char+")"));let i=this.code;if(e.isIdentifierStart(i))this.throwError("Variable names cannot start with a number ("+r+this.char+")");else if(i===e.PERIOD_CODE){r.length>1&&this.throwError(`Unexpected period ${JSON.stringify({chCode:i,number:r},null,2)}`),this.index=t;return}n.node={type:e.LITERAL,value:parseFloat(r),raw:this.expr.substring(t,this.index)}}e.hooks.add("gobble-token",function(o){if(this.code===s){let i=this.index,s=this.expr.charAt(this.index+1),c=n.call(this,s);if(!c)return;let u="";for(;r(this.code,c);)this.code===l?this.index++:u+=this.expr.charAt(this.index++);if(e.isIdentifierPart(this.code)){if(e.isDecimalDigit(this.code)&&e.isDecimalDigit(s.charCodeAt(0))){this.index=i+1,a.call(this,o);return}this.throwError("unexpected char within number")}o.node={type:e.LITERAL,value:parseInt(u,t(s)),raw:this.expr.substring(i,this.index)}}else(e.isDecimalDigit(this.code)||this.code===e.PERIOD_CODE)&&a.call(this,o)})}};let u=47,d=92;var p={name:"regex",init(e){e.hooks.add("gobble-token",function(n){if(this.code===u){let t=++this.index,r=!1;for(;this.index<this.expr.length;){if(this.code===u&&!r){let r,a=this.expr.slice(t,this.index),o="";for(;++this.index<this.expr.length;){let e=this.code;if(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57)o+=this.char;else break}try{r=new RegExp(a,o)}catch(e){this.throwError(e.message)}return n.node={type:e.LITERAL,value:r,raw:this.expr.slice(t-1,this.index)},n.node=this.gobbleTokenProperty(n.node),n.node}this.code===e.OBRACK_CODE?r=!0:r&&this.code===e.CBRACK_CODE&&(r=!1),this.index+=this.code===d?2:1}this.throwError("Unclosed Regex")}})}};let f="ConditionalExpression";var h={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let t=n.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let a=this.gobbleExpression();if(a||this.throwError("Expected expression"),n.node={type:f,test:t,consequent:r,alternate:a},t.operator&&e.binary_ops[t.operator]<=.9){let r=t;for(;r.right.operator&&e.binary_ops[r.right.operator]<=.9;)r=r.right;n.node.test=r.right,r.right=n.node,n.node=t}}else this.throwError("Expected :")}})}};let m=96,g=125,A="TaggedTemplateExpression",y="TemplateLiteral",b="TemplateElement";var v={name:"jsepTemplateLiteral",init(e){function n(e,t=!0){if(this.code===m){let n={type:y,quasis:[],expressions:[]},r="",a="",o=!1,i=this.expr.length,s=()=>n.quasis.push({type:b,value:{raw:a,cooked:r},tail:o});for(;this.index<i;){let i=this.expr.charAt(++this.index);if("`"===i)return this.index+=1,o=!0,s(),e.node=n,t&&(e.node=this.gobbleTokenProperty(e.node)),e.node;if("$"===i&&"{"===this.expr.charAt(this.index+1))this.index+=2,s(),a="",r="",n.expressions.push(...this.gobbleExpressions(g)),this.code!==g&&this.throwError("unclosed ${");else if("\\"===i)switch(a+=i,i=this.expr.charAt(++this.index),a+=i,i){case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+=" ";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:r+=i}else r+=i,a+=i}this.throwError("Unclosed `")}}e.hooks.add("gobble-token",n),e.hooks.add("after-token",function(t){if((t.node.type===e.IDENTIFIER||t.node.type===e.MEMBER_EXP)&&this.code===m)return t.node={type:A,tag:t.node,quasi:n.bind(this)(t,!1)},t.node=this.gobbleTokenProperty(t.node),t.node})}},C=t(74339);function $(e,n={}){return S(e,n,M)}async function w(e,n={}){return z(e,n,M)}function k(e,n={}){return S(e,n,T)}function E(e,n={}){return z(e,n,T)}function x(e,n={}){return S(e,n,O)}function D(e,n={}){return z(e,n,O)}function S(e,n={},t){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))throw`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`;null==n&&(n={});let a=Y(n),o=N("string"==typeof e?(0,r.A)(e):e,a);if(t(o))return o;throw{type:"Invalid result",message:"string"==typeof e?`The expression ${e} did not produce a valid result`:"The expression did not produce a valid result"}}async function z(e,n={},t){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))return Promise.reject(`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`);null==n&&(n={});let a=J(n);return Promise.resolve(N("string"==typeof e?(0,r.A)(e):e,a)).then(n=>{if(t(n))return n;throw{type:"Invalid result",message:"string"==typeof e?`The expression ${e} did not produce a valid result`:"The expression did not produce a valid result"}})}function B(e){return(0,r.A)(e)}function M(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e||e instanceof Date}function T(e){return"boolean"==typeof e}function O(e){return"number"==typeof e}function N(e,n){switch(e.type){case"UnaryExpression":return I(e,n);case"BinaryExpression":return F(e,n);case"ConditionalExpression":return R(e,n);case"CallExpression":return H(e,n);case"ArrowFunctionExpression":return L(e,n);case"MemberExpression":return j(e,n);case"ArrayExpression":return q(e,n);case"SequenceExpression":return G(e,n);case"NewExpression":return V(e,n);case"Literal":return Z(e,n);case"Identifier":return K(e,n);case"TemplateLiteral":return U(e,n);case"TemplateElement":return W(e,n);default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function P(e,n){switch(e.type){case"Literal":return e.value;case"Identifier":return e.name;case"MemberExpression":return P(e.property,n);default:throw`VisitExpressionName does not support expression of type '${e.type}'`}}function I(e,n){let t=N(e.argument,n);switch(e.operator){case"+":return+t;case"-":return-t;case"~":return~t;case"!":return!t;default:throw`Expression evaluator does not support operator '${e.operator}''`}}function F(e,n){let t=N(e.left,n),r=N(e.right,n);switch(e.operator){case"+":return t+r;case"-":return t-r;case"*":return t*r;case"/":return t/r;case"%":return t%r;case"**":return t**r;case"==":return t==r;case"===":return t===r;case"!=":return t!=r;case"!==":return t!==r;case">":return t>r;case">=":return t>=r;case"<":return t<r;case"<=":return t<=r;case"in":return t in r;case"&&":return t&&r;case"||":return t||r;case"??":return t??r;default:throw`Expression evaluator does not support operator '${e.operator}' operator`}}function R(e,n){return N(e.test,n)?N(e.consequent,n):N(e.alternate,n)}function H(e,n){let t=e.arguments?.map(Q(n)),r=N(e.callee,n);if(r){if("function"!=typeof r)throw`${et(e.callee)} is not a function`}else throw`No function named ${et(e.callee)} is defined in this context`;return r(...t)}function L(e,n){let t=e.params?.map(e=>{if("Identifier"===e.type)return e.name;throw`Cannot handle parameter of type ${e.type}`})??[];return(function(...r){if(r.length<t.length)throw`Required argument(s) ${t.slice(r.length,-1).join(", ")} were not provided`;let a=Object.fromEntries(t.reduce((e,n,t)=>{let a=r[t];return en(a)&&e.push([n,a]),e},[]));return N(e.body,n.addVariables(a))}).bind(n.thisObj??null)}function j(e,n){let t,r=N(e.object,n);if(void 0===r)switch(e.object.type){case"Identifier":{let t=P(e.object,n);throw ReferenceError(`ReferenceError: ${t} is not defined`)}case"MemberExpression":{let t=P(e.property,n);throw TypeError(`TypeError: cannot read properties of undefined (reading '${t}')`)}default:throw`VisitMemberExpression does not support operator '${e.object.type}' type`}let a=r;if("string"==typeof r)a=String.prototype;else if("number"==typeof r)a=Number.prototype;else if("function"==typeof r);else if("object"!=typeof r)throw`VisitMemberExpression does not support member access on type ${typeof r}`;switch(n.thisObj=a,e.property.type){case"Identifier":case"MemberExpression":t=N(e.property,n);break;default:{let a=N(e.property,n);if(void 0===a)throw{type:"Illegal property access",message:"No property was supplied to the property access"};ee(a),t=r[a]}}return"function"==typeof t?t.bind(r):t}function q(e,n){return e.elements?.map(Q(n))}function G(e,n){let t=e.expressions.map(Q(n));return t[t.length-1]}function V(e,n){if(e.callee&&"Identifier"===e.callee.type){let t=e.arguments?.map(Q(n));switch(e.callee.name){case"Date":return new Date(...t);case"RegExp":return new RegExp(...t);default:throw`Cannot instantiate object of type ${e.callee.name}`}}if(e.callee)throw"new must be called with either Date or RegExp";throw'Could not handle "new" without a specified class'}function U(e,n){let t=e.expressions?.map(Q(n))??[],r=e.quasis?.map(Q(n))??[];return r.filter(e=>!e.tail).map(e=>e.value).join("")+t.join("")+r.filter(e=>e.tail).map(e=>e.value).join("")}function W(e,n){return{value:e.cooked,tail:e.tail}}function K(e,n){ee(e.name);let t=n.thisObj;if(t&&("object"==typeof t||"function"==typeof t)&&e.name in t){let n=t[e.name];return ee(n),n}if(n.variables&&e.name in n.variables){let t=n.variables[e.name];return ee(t),t}return e.name in n.globals?n.globals[e.name]:void 0}function Z(e,n){return ee(e.value),e.value}function Y(e){return X(e,C.z)}function J(e){return X(e,C.f)}function X(e,n){let t={thisObj:void 0,variables:{...e},globals:{...n},addVariables(e){return this.variables={...this.variables,...e},this}};return t.addVariables.bind(t),t}function Q(e){return function(n){return null===n?null:N(n,e)}}function ee(e){if("__proto__"===e||"prototype"===e||"constructor"===e)throw{type:"Illegal property access",message:`Cannot access the ${e} property of objects`}}function en(e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e||"function"==typeof e||null===e||e instanceof RegExp)return!0;if("object"==typeof e){for(let n of Object.keys(e))if(!en(e[n]))return!1;return!0}if(Array.isArray(e)){for(let n of e)if(!en(n))break}return!1}function et(e){return e?"MemberExpression"===e.type?e.property?.name:e.name:null}r.A.plugins.register(o),r.A.plugins.register(i),r.A.plugins.register(c),r.A.plugins.register(p),r.A.plugins.register(h),r.A.plugins.register(v),r.A.addBinaryOp("in",7),r.A.addBinaryOp("??",1)},74339:function(e,n,t){"use strict";t.d(n,{f:()=>a,z:()=>r});let r={Array,Boolean,Symbol,Infinity,NaN,Math,Number,BigInt,String,RegExp,JSON,isFinite,isNaN,parseFloat,parseInt,decodeURI,encodeURI,encodeURIComponent,Object:{__proto__:void 0,assign:Object.assign.bind(null),fromEntries:Object.fromEntries.bind(null),hasOwn:Object.hasOwn.bind(null),keys:Object.keys.bind(null),is:Object.is.bind(null),values:Object.values.bind(null)}},a={...r,Promise}},96893:function(e,n,t){"use strict";t.d(n,{J_:()=>eO,zx:()=>e_,ES:()=>eo,FY:()=>em,zF:()=>Y,Uh:()=>eH,io:()=>eD,Ef:()=>V,wG:()=>eq,Qb:()=>eR,dO:()=>G,o1:()=>eP,rD:()=>eF,Vx:()=>ey,sr:()=>eb,YX:()=>eI,Tj:()=>es,Gp:()=>eA,K0:()=>ec,Q_:()=>eB,a9:()=>K,xg:()=>ei,DQ:()=>Z,Ml:()=>eN,Xb:()=>ez,Fg:()=>e$,VK:()=>el,pm:()=>ex,Ju:()=>eC,cL:()=>eg,Yo:()=>eu,No:()=>ed});var r=t(70937),a=t(13070),o=t(6250),i=t(10201),s=t(27760),l=t(9826),c=t(47427),u=t(61098),d=t(37999),p=t(81963);let f=function(e,n,t){(void 0===t||(0,p.A)(e[n],t))&&(void 0!==t||n in e)||(0,d.A)(e,n,t)},h=function(e){return function(e,n,t){for(var r=-1,a=Object(e),o=t(e),i=o.length;i--;){var s=o[++r];if(!1===n(a[s],s,a))break}return e}}();var m=t(13137),g=t(84934),A=t(17052),y=t(47514),b=t(17820),v=t(36820),C=t(55259),$=t(62873);let w=function(e){return(0,$.A)(e)&&(0,C.A)(e)};var k=t(75323),E=t(49885),x=t(12174),D=t(92562),S=t(43148);let z=function(e,n){if(("constructor"!==n||"function"!=typeof e[n])&&"__proto__"!=n)return e[n]};var B=t(51158),M=t(22678);let T=function(e){return(0,B.A)(e,(0,M.A)(e))},O=function(e,n,t,r,a,o,i){var s=z(e,t),l=z(n,t),c=i.get(l);if(c)return void f(e,t,c);var u=o?o(s,l,t+"",e,n,i):void 0,d=void 0===u;if(d){var p=(0,v.A)(l),h=!p&&(0,k.A)(l),C=!p&&!h&&(0,S.A)(l);u=l,p||h||C?(0,v.A)(s)?u=s:w(s)?u=(0,A.A)(s):h?(d=!1,u=(0,m.A)(l,!0)):C?(d=!1,u=(0,g.A)(l,!0)):u=[]:(0,D.A)(l)||(0,b.A)(l)?(u=s,(0,b.A)(s)?u=T(s):(!(0,x.A)(s)||(0,E.A)(s))&&(u=(0,y.A)(l))):d=!1}d&&(i.set(l,u),a(u,l,r,o,i),i.delete(l)),f(e,t,u)};function N(e,n,t,r,a){e!==n&&h(n,function(o,i){if(a||(a=new u.A),(0,x.A)(o))O(e,n,i,t,N,r,a);else{var s=r?r(z(e,i),o,i+"",e,n,a):void 0;void 0===s&&(s=o),f(e,i,s)}},M.A)}let P=N;var I=t(68527),F=t(54979),R=t(44168);let H=function(e,n){return(0,R.A)((0,F.A)(e,n,I.A),e+"")};var L=t(27322);let j=function(e,n,t){if(!(0,x.A)(t))return!1;var r=typeof n;return("number"==r?!!((0,C.A)(t)&&(0,L.A)(n,t.length)):"string"==r&&n in t)&&(0,p.A)(t[n],e)},q=function(e){return H(function(n,t){var r=-1,a=t.length,o=a>1?t[a-1]:void 0,i=a>2?t[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,i&&j(t[0],t[1],i)&&(o=a<3?void 0:o,a=1),n=Object(n);++r<a;){var s=t[r];s&&e(n,s,r,o)}return n})}(function(e,n,t){P(e,n,t)});function G(e=!0,n=!1){return V((0,l.s)(),e,n)}function V(e,n=!0,t=!1){return!!(e?n:t)}var U=t(467);let W=(0,U.Zd)("extensionsInternal",{slots:{},extensions:{}}),K=()=>(0,U.jf)("extensionsInternal",{slots:{},extensions:{}});function Z(e){let n=W.getState(),t=e(n);t!==n&&W.setState(t)}let Y=()=>(0,U.jf)("extensions",{slots:{}});function J(e){let n=[];for(let t of Object.values(e.extensions))for(let e of t.instances)n.push({slotModuleName:e.slotModuleName,extensionModuleName:t.moduleName,slotName:e.slotName,extensionId:e.id});(0,c.A)(a.hs.getState().mountedExtensions,n)||a.hs.setState({mountedExtensions:n})}J(W.getState()),W.subscribe(J);let X=K(),Q=Y(),ee=(0,a.YP)(),en=(0,a.GI)();function et(e,n,t,r,o){let i={},s=(0,l.s)(),u=Object.entries(r.flags).filter(([,{enabled:e}])=>e).map(([e])=>e);for(let[r,l]of Object.entries(e.slots)){let{config:c}=(0,a.vu)(n,l.name),d=ef(r,e,c,t,u,s,o.session);i[r]={moduleName:l.moduleName,assignedExtensions:d}}(0,c.A)(Q.getState().slots,i)||Q.setState({slots:i})}function er(){et(X.getState(),ee.getState(),en.getState(),i.jX.getState(),r.eA.getState())}function ea(e,n){return{moduleName:n,name:e,attachedIds:[],config:null}}function eo(e){let[n]=e.split("#");return n}function ei(e,n){let t=eo(n);return e.extensions[t]}function es(e){return ei(X.getState(),e)}X.subscribe(e=>{et(e,ee.getState(),en.getState(),i.jX.getState(),r.eA.getState())}),ee.subscribe(e=>{et(X.getState(),e,en.getState(),i.jX.getState(),r.eA.getState())}),en.subscribe(e=>{et(X.getState(),ee.getState(),e,i.jX.getState(),r.eA.getState())}),i.jX.subscribe(e=>{et(X.getState(),ee.getState(),en.getState(),e,r.eA.getState())}),r.eA.subscribe(e=>{et(X.getState(),ee.getState(),en.getState(),i.jX.getState(),e)}),er(),(0,s.gj)(er);let el=e=>X.setState(n=>(n.extensions[e.name]={...e,instances:[]},n));function ec(e,n){Z(t=>{let r=t.slots[e];return r?{...t,slots:{...t.slots,[e]:{...r,attachedIds:[...r.attachedIds,n]}}}:{...t,slots:{...t.slots,[e]:{...ea(e),attachedIds:[n]}}}})}function eu(e,n){Z(t=>{let r=t.slots[e];return r&&r.attachedIds.includes(n)?{...t,slots:{...t.slots,[e]:{...r,attachedIds:r.attachedIds.filter(e=>e!==n)}}}:t})}function ed(e){Z(n=>{let t=n.slots[e];return t?{...n,slots:{...n.slots,[e]:{...t,attachedIds:[]}}}:n})}function ep(e,n,t,r){let a=n.indexOf(e);if(-1!==a)return a;{if(void 0!==t)return 1e3+t;let n=r.indexOf(e);return -1!==n?2e3+n:-1}}function ef(e,n,t,i,s,l,c){let u=eh(t,n.slots[e].attachedIds),d=[];for(let p of u){let{config:u}=(0,a.P0)(i,e,p),f=q(u,(0,a.g$)(t,e,p)),h=eo(p),m=n.extensions[h];if(m){let e=f?.["Display conditions"]?.privileges??m.privileges??[];if(e&&("string"==typeof e||Array.isArray(e)&&e.length>0)&&(!c?.user||!(0,r.st)(e,c.user)))continue;let n=f?.["Display conditions"]?.expression??null;if(null!==n)try{if(!(0,o.eb)(n,{session:c}))continue}catch(e){console.error(`Error while evaluating expression ${n}`,e);continue}if(m.featureFlag&&!s.includes(m.featureFlag)||window.offlineEnabled&&!V(l,m.online,m.offline))continue;d.push({id:p,name:h,moduleName:m.moduleName,config:f,featureFlag:m.featureFlag,meta:m.meta,online:f?.["Display conditions"]?.online??m.online??!0,offline:f?.["Display conditions"]?.offline??m.offline??!1})}}return d}function e_(e){let n=X.getState(),{config:t}=(0,a.G9)(e),o=en.getState(),s=i.jX.getState(),c=r.eA.getState(),u=(0,l.s)();return ef(e,n,t,o,Object.entries(s.flags).filter(([,{enabled:e}])=>e).map(([e])=>e),u,c.session)}function eh(e,n){let t=e.add||[],r=e.remove||[],a=e.order||[],{extensions:o}=X.getState();return[...n,...t].filter(e=>!r.includes(e)).sort((e,t)=>{let r=ep(e,a,o[eo(e)]?.order,n),i=ep(t,a,o[eo(t)]?.order,n);return -1===i?-1:-1===r?1:r-i})}let em=(e,n)=>X.setState(t=>{let r=t.slots[n]?.moduleName;if(r&&r!=e)return console.warn(`An extension slot with the name '${n}' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ${r}.`),t;if(r&&r==e)return t;if(t.slots[n])return{...t,slots:{...t.slots,[n]:{...t.slots[n],moduleName:e}}};let a=ea(n,e);return{...t,slots:{...t.slots,[n]:a}}}),eg=()=>Q.setState(()=>({slots:{},extensions:{}})),eA=(0,U.Zd)("left-nav",{slotName:null,basePath:window.spaBase,mode:"normal"});function ey({name:e,basePath:n,mode:t,componentContext:r}){eA.setState({slotName:e,basePath:n,mode:t??"normal",componentContext:r})}function eb(e){eA.getState().slotName===e&&eA.setState(eA.getInitialState(),!0)}let ev=(0,U.Zd)("modalRegistry",{modals:{}});function eC(e){ev.setState(n=>(n.modals[e.name]=e,n))}function e$(e){let n=ev.getState().modals[e];if(!n){let t=es(e);t&&(n={name:e,load:t.load,moduleName:t.moduleName},console.warn(`Modal ${e} was registered as an extension. This is deprecated and will be removed in the future. Please register it in the "modals" section of routes.json instead of the "extensions" section.`),eC(n))}return n}var ew=t(61836);let ek=(0,U.Zd)("workspaceRegistrations",{workspaces:{}}),eE=(0,U.Zd)("workspaceGroups",{workspaceGroups:{}});function ex(e){ek.setState(n=>({workspaces:{...n.workspaces,[e.name]:{...e,load:e.load,preferredWindowSize:e.preferredWindowSize??"normal",type:e.type??"form",canHide:e.canHide??!1,canMaximize:e.canMaximize??!1,width:e.width??"narrow",groups:e.groups??[]}}}))}function eD(e){eE.setState(n=>{let t=n.workspaceGroups[e.name];return t?{workspaceGroups:{...n.workspaceGroups,[e.name]:{...t,members:Array.from(new Set([...t.members,...e.members]))}}}:{workspaceGroups:{...n.workspaceGroups,[e.name]:{name:e.name,members:e.members}}}})}let eS=new Set;function ez(e){let n=ek.getState().workspaces;if(n[e])return n[e];{let n=es(e);if(n)return eS.has(e)||(console.warn(`The workspace '${e}' is registered as an extension. This is deprecated. Please register it in the "workspaces" section of the routes.json file.`),eS.add(e)),{name:n.name,title:eM(n),moduleName:n.moduleName,preferredWindowSize:n.meta?.screenSize??"normal",load:n.load,type:n.meta?.type??"form",canHide:n.meta?.canHide??!1,canMaximize:n.meta?.canMaximize??!1,width:n.meta?.width??"narrow",groups:n.meta?.groups??[]};throw Error(`No workspace named '${e}' has been registered.`)}}function eB(e){let n=eE.getState().workspaceGroups;if(n[e])return n[e];throw Error(`No workspace group named '${e}' has been registered.`)}function eM(e){let n=e?.meta?.title;return"string"==typeof n?n:n&&"object"==typeof n?(0,ew.t)(e.moduleName,n.key,n.default):e.name}let eT={registeredGroupsByName:{},registeredWindowsByName:{},registeredWorkspacesByName:{},openedGroup:null,openedWindows:[],workspaceTitleByWorkspaceName:{}},eO=(0,U.Zd)("workspace2",eT);function eN(e){let{registeredWorkspacesByName:n,registeredWindowsByName:t}=eO.getState(),r=n[e];if(r){let n=t[r.window];if(n)return n;throw Error(`No workspace window found with name: ${r.window} for workspace: ${e}`)}throw Error(`No workspace found with name: ${e}`)}function eP(e){let{registeredGroupsByName:n,registeredWindowsByName:t}=eO.getState(),r=t[e];if(r){let t=n[r.group];if(t)return t;throw Error(`No workspace group found with name: ${r.group} for window: ${e}`)}throw Error(`No workspace window found with name: ${e}`)}function eI(e){let{openedWindows:n}=eO.getState();return n.findIndex(n=>n.openedWorkspaces.find(n=>n.workspaceName===e))}function eF(e){if(0==e.length)return;let{registeredGroupsByName:n}=eO.getState(),t={...n};for(let n of e){if(t[n.name])throw Error(`Cannot register workspace group ${n.name} more than once`);t[n.name]=n}eO.setState({registeredGroupsByName:t})}function eR(e,n){if(0==n.length)return;let{registeredWindowsByName:t}=eO.getState(),r={...t};for(let t of n){if(r[t.name])throw Error(`Cannot register workspace window ${t.name} more than once`);let n={...t,moduleName:e};r[t.name]=n}eO.setState({registeredWindowsByName:r})}function eH(e,n){if(0==n.length)return;let{registeredWorkspacesByName:t}=eO.getState(),r={...t};for(let t of n){if(r[t.name])throw Error(`Cannot register workspace ${t.name} more than once`);let n={...t,moduleName:e};r[t.name]=n}eO.setState({registeredWorkspacesByName:r})}var eL=t(22956);let ej=0;async function eq(e,n,t,r,a=e=>e,o={}){let i=eo(r),s=es(r),l=null;if(e){if(!s)throw Error(`Couldn't find extension '${i}' to attach to '${n}'`);let{meta:c,moduleName:u,online:d,offline:p,load:f}=s;if(G(d,p)){Z(a=>{let o={domElement:e,id:r,slotName:n,slotModuleName:t};return{...a,extensions:{...a.extensions,[i]:{...a.extensions[i],instances:[...a.extensions[i].instances,o]}}}});let s=await f(),d=ej++;l=(0,eL.xL)(a({...s,name:`${n}/${i}-${d}`}),{...o,_meta:c,_extensionContext:{extensionId:r,extensionSlotName:n,extensionSlotModuleName:t,extensionModuleName:u},domElement:e})}}else console.warn(`Tried to render ${r} into ${n} but no DOM element was available.`);return l}},27760:function(e,n,t){"use strict";t.d(n,{$3:()=>g,FI:()=>h,LQ:()=>m,Vt:()=>A,Yt:()=>a,bJ:()=>y,bK:()=>b,dX:()=>v,ff:()=>c,gj:()=>o,ls:()=>C,pc:()=>l,sT:()=>i});let r="openmrs:connectivity-changed";function a(e){window.dispatchEvent(new CustomEvent(r,{detail:{online:e}}))}function o(e){if(!window.offlineEnabled)return()=>{};let n=n=>e(n.detail);return window.addEventListener(r,n),()=>window.removeEventListener(r,n)}function i(e){return e({online:!window.offlineEnabled||navigator.onLine}),o(e)}let s="openmrs:precache-static-dependencies";function l(e={}){window.dispatchEvent(new CustomEvent(s,{detail:e}))}function c(e){let n=n=>e(n.detail);return window.addEventListener(s,n),()=>window.removeEventListener(s,n)}let u="openmrs:notification-shown",d="openmrs:actionable-notification-shown",p="openmrs:toast-shown",f="openmrs:snack-bar-shown";function h(e){window.dispatchEvent(new CustomEvent(u,{detail:e}))}function m(e){window.dispatchEvent(new CustomEvent(d,{detail:e}))}function g(e){window.dispatchEvent(new CustomEvent(f,{detail:e}))}function A(e){window.dispatchEvent(new CustomEvent(p,{detail:e}))}function y(e){let n=n=>e(n.detail);return window.addEventListener(u,n),()=>window.removeEventListener(u,n)}function b(e){let n=n=>e(n.detail);return window.addEventListener(d,n),()=>window.removeEventListener(d,n)}function v(e){let n=n=>e(n.detail);return window.addEventListener(p,n),()=>window.removeEventListener(p,n)}function C(e){let n=n=>e(n.detail);return window.addEventListener(f,n),()=>window.removeEventListener(f,n)}},17744:function(e,n,t){"use strict";function r(e){for(var n=[],t=0;t<e.length;){var r=e[t];if("*"===r||"+"===r||"?"===r){n.push({type:"MODIFIER",index:t,value:e[t++]});continue}if("\\"===r){n.push({type:"ESCAPED_CHAR",index:t++,value:e[t++]});continue}if("{"===r){n.push({type:"OPEN",index:t,value:e[t++]});continue}if("}"===r){n.push({type:"CLOSE",index:t,value:e[t++]});continue}if(":"===r){for(var a="",o=t+1;o<e.length;){var i=e.charCodeAt(o);if(i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||95===i){a+=e[o++];continue}break}if(!a)throw TypeError("Missing parameter name at "+t);n.push({type:"NAME",index:t,value:a}),t=o;continue}if("("===r){var s=1,l="",o=t+1;if("?"===e[o])throw TypeError('Pattern cannot start with "?" at '+o);for(;o<e.length;){if("\\"===e[o]){l+=e[o++]+e[o++];continue}if(")"===e[o]){if(0==--s){o++;break}}else if("("===e[o]&&(s++,"?"!==e[o+1]))throw TypeError("Capturing groups are not allowed at "+o);l+=e[o++]}if(s)throw TypeError("Unbalanced pattern at "+t);if(!l)throw TypeError("Missing pattern at "+t);n.push({type:"PATTERN",index:t,value:l}),t=o;continue}n.push({type:"CHAR",index:t,value:e[t++]})}return n.push({type:"END",index:t,value:""}),n}function a(e,n){void 0===n&&(n={});for(var t=r(e),a=n.prefixes,i=void 0===a?"./":a,s="[^"+o(n.delimiter||"/#?")+"]+?",l=[],c=0,u=0,d="",p=function(e){if(u<t.length&&t[u].type===e)return t[u++].value},f=function(e){var n=p(e);if(void 0!==n)return n;var r=t[u];throw TypeError("Unexpected "+r.type+" at "+r.index+", expected "+e)},h=function(){for(var e,n="";e=p("CHAR")||p("ESCAPED_CHAR");)n+=e;return n};u<t.length;){var m=p("CHAR"),g=p("NAME"),A=p("PATTERN");if(g||A){var y=m||"";-1===i.indexOf(y)&&(d+=y,y=""),d&&(l.push(d),d=""),l.push({name:g||c++,prefix:y,suffix:"",pattern:A||s,modifier:p("MODIFIER")||""});continue}var b=m||p("ESCAPED_CHAR");if(b){d+=b;continue}if(d&&(l.push(d),d=""),p("OPEN")){var y=h(),v=p("NAME")||"",C=p("PATTERN")||"",$=h();f("CLOSE"),l.push({name:v||(C?c++:""),pattern:v&&!C?s:C,prefix:y,suffix:$,modifier:p("MODIFIER")||""});continue}f("END")}return l}t.d(n,{tA:()=>T,JK:()=>M,g4:()=>O,vf:()=>h,MY:()=>m,Wh:()=>B,qh:()=>C,lz:()=>g,D_:()=>v,JG:()=>k,oo:()=>D,zl:()=>E});function o(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function i(e){return e&&e.sensitive?"":"i"}function s(e,n){if(!n)return e;var t=e.source.match(/\((?!\?)/g);if(t)for(var r=0;r<t.length;r++)n.push({name:r,prefix:"",suffix:"",modifier:"",pattern:""});return e}function l(e,n,t){return RegExp("(?:"+e.map(function(e){return d(e,n,t).source}).join("|")+")",i(t))}function c(e,n,t){return u(a(e,t),n,t)}function u(e,n,t){void 0===t&&(t={});for(var r=t.strict,a=void 0!==r&&r,s=t.start,l=void 0===s||s,c=t.end,u=void 0===c||c,d=t.encode,p=void 0===d?function(e){return e}:d,f="["+o(t.endsWith||"")+"]|$",h="["+o(t.delimiter||"/#?")+"]",m=l?"^":"",g=0,A=e;g<A.length;g++){var y=A[g];if("string"==typeof y)m+=o(p(y));else{var b=o(p(y.prefix)),v=o(p(y.suffix));if(y.pattern)if(n&&n.push(y),b||v)if("+"===y.modifier||"*"===y.modifier){var C="*"===y.modifier?"?":"";m+="(?:"+b+"((?:"+y.pattern+")(?:"+v+b+"(?:"+y.pattern+"))*)"+v+")"+C}else m+="(?:"+b+"("+y.pattern+")"+v+")"+y.modifier;else m+="("+y.pattern+")"+y.modifier;else m+="(?:"+b+v+")"+y.modifier}}if(u)a||(m+=h+"?"),m+=t.endsWith?"(?="+f+")":"$";else{var $=e[e.length-1],w="string"==typeof $?h.indexOf($[$.length-1])>-1:void 0===$;a||(m+="(?:"+h+"(?="+f+"))?"),w||(m+="(?="+h+"|"+f+")")}return new RegExp(m,i(t))}function d(e,n,t){return e instanceof RegExp?s(e,n):Array.isArray(e)?l(e,n,t):c(e,n,t)}let p=(0,t(467).Zd)("breadcrumbs",[]);function f(e){return e.matcher instanceof RegExp?e.matcher:"string"==typeof e.matcher?d(e.matcher):d(e.path)}function h(e){return m([e])}function m(e){let n=[...g(),...e.map(e=>({matcher:f(e),settings:e}))];p.setState(n,!0)}function g(){return p.getState()}function A(e,n){let[t]=e.filter(e=>e.matcher.test(n));return t}function y(e,n){let t=n.split("/");for(;t.length>1;){t.pop();let n=b(e,t.join("/"));if(n)return n}}function b(e,n){if(n)return A(e,n)||y(e,n)}function v(e,n){if(e.length>0){let t=b(e,n);if(t){let n=[t],r=b(e,t.settings.parent);for(;void 0!==r;)n.push(r),r=b(e,r.settings.parent);return n.reverse()}}return[]}function C(e){return v(g(),e)}var $=t(22956);function w(e){return e.replace(/\/$/,"")}function k(e,n){let t=w(window.getOpenmrsSpaBase());return E(e,{openmrsBase:window.openmrsBase,openmrsSpaBase:t,...n}).replace(/^\/\//,"/")}function E(e,n){return Object.keys(n).reduce((e,t)=>e.split("${"+t+"}").join(n[t]),e)}function x(e){return e.replace(/\/$/,"")}function D({to:e,templateParams:n}){let t=x(window.getOpenmrsSpaBase()),r=k(e,n).replace(window.location.origin,"");r.startsWith(t)?(0,$.EH)(r):window.location.assign(r)}let S="openmrs:history";function z(e){let n=JSON.parse(sessionStorage.getItem(S)??"[]")||[];n.push(e);let t=50;n.length>t&&(n=n.slice(-t)),sessionStorage.setItem(S,JSON.stringify(n))}function B(){0===JSON.parse(sessionStorage.getItem(S)??"[]").length&&document.referrer&&z(document.referrer),window.addEventListener("single-spa:routing-event",e=>{let n=M();e.detail.originalEvent?.singleSpaTrigger=="replaceState"?(n[n.length-1]=window.location.href,sessionStorage.setItem(S,JSON.stringify(n))):!e.detail.originalEvent?.singleSpa&&n.includes(window.location.href)?T({toUrl:window.location.href}):n[n.length-1]!==window.location.href&&z(window.location.href)})}function M(){return JSON.parse(sessionStorage.getItem(S)??"[]")}function T({toUrl:e}){let n=M(),t=n.lastIndexOf(e);if(-1!=t){let e=n.slice(0,t+1);D({to:n[t]}),sessionStorage.setItem(S,JSON.stringify(e))}else throw Error(`URL ${e} not found in history; cannot go back to it.`)}function O(){sessionStorage.removeItem(S)}},43920:function(e,n,t){"use strict";let r,a;t.d(n,{nr:()=>M,xN:()=>rE,u1:()=>rG,KG:()=>rK,FO:()=>rx,FE:()=>rI,LM:()=>rh,sA:()=>rM,Rs:()=>y,ff:()=>rH,wn:()=>rj,sK:()=>rZ,lY:()=>rD,ms:()=>$,Zr:()=>rb,WK:()=>rW,WA:()=>rF,UH:()=>b,cy:()=>rS,Gp:()=>rk,jU:()=>rB,Og:()=>B,iD:()=>rP,C$:()=>rw,qb:()=>rN,Iq:()=>ry,NU:()=>rL,sZ:()=>A,yD:()=>rR,Io:()=>rv,wJ:()=>z,JC:()=>C,e:()=>rd,xc:()=>rC,pb:()=>r$,bO:()=>rT,AO:()=>rm,Td:()=>rq,Gj:()=>v});try{self["workbox:window:6.5.4"]&&_()}catch(e){}function o(e,n){return new Promise(function(t){var r=new MessageChannel;r.port1.onmessage=function(e){t(e.data)},e.postMessage(n,[r.port2])})}function i(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function l(e,n){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return s(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?s(e,void 0):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}try{self["workbox:core:6.5.4"]&&_()}catch(e){}var c=function(){var e=this;this.promise=new Promise(function(n,t){e.resolve=n,e.reject=t})};function u(e,n){var t=location.href;return new URL(e,t).href===new URL(n,t).href}var d=function(e,n){this.type=e,Object.assign(this,n)};function p(e,n,t){return t?n?n(e):e:(e&&e.then||(e=Promise.resolve(e)),n?e.then(n):e)}function f(){}var h={type:"SKIP_WAITING"};function m(e,n){if(!n)return e&&e.then?e.then(f):Promise.resolve()}var g=function(e){function n(n,t){var r,a;return void 0===t&&(t={}),(r=e.call(this)||this).nn={},r.tn=0,r.rn=new c,r.en=new c,r.on=new c,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,n=e.installing;r.tn>0||!u(n.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=n,e.removeEventListener("updatefound",r.cn)):(r.hn=n,r.an.add(n),r.rn.resolve(n)),++r.tn,n.addEventListener("statechange",r.ln)},r.ln=function(e){var n=r.fn,t=e.target,a=t.state,o=t===r.vn,i={sw:t,isExternal:o,originalEvent:e};!o&&r.mn&&(i.isUpdate=!0),r.dispatchEvent(new d(a,i)),"installed"===a?r.wn=self.setTimeout(function(){"installed"===a&&n.waiting===t&&r.dispatchEvent(new d("waiting",i))},200):"activating"===a&&(clearTimeout(r.wn),o||r.en.resolve(t))},r.dn=function(e){var n=r.hn,t=n!==navigator.serviceWorker.controller;r.dispatchEvent(new d("controlling",{isExternal:t,originalEvent:e,sw:n,isUpdate:r.mn})),t||r.on.resolve(n)},a=function(e){var n=e.data,t=e.ports,a=e.source;return p(r.getSW(),function(){r.an.has(a)&&r.dispatchEvent(new d("message",{data:n,originalEvent:e,ports:t,sw:a}))})},r.gn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(a.apply(this,e))}catch(e){return Promise.reject(e)}},r.sn=n,r.nn=t,navigator.serviceWorker.addEventListener("message",r.gn),r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var t,r,a,s,l,f=n.prototype;return f.register=function(e){var n=(void 0===e?{}:e).immediate,t=void 0!==n&&n;try{var r=this;return function(e,n){var t=e();return t&&t.then?t.then(n):n(t)}(function(){if(!t&&"complete"!==document.readyState)return m(new Promise(function(e){return window.addEventListener("load",e)}))},function(){return r.mn=!!navigator.serviceWorker.controller,r.yn=r.pn(),p(r.bn(),function(e){r.fn=e,r.yn&&(r.hn=r.yn,r.en.resolve(r.yn),r.on.resolve(r.yn),r.yn.addEventListener("statechange",r.ln,{once:!0}));var n=r.fn.waiting;return n&&u(n.scriptURL,r.sn.toString())&&(r.hn=n,Promise.resolve().then(function(){r.dispatchEvent(new d("waiting",{sw:n,wasWaitingBeforeRegister:!0}))}).then(function(){})),r.hn&&(r.rn.resolve(r.hn),r.an.add(r.hn)),r.fn.addEventListener("updatefound",r.cn),navigator.serviceWorker.addEventListener("controllerchange",r.dn),r.fn})})}catch(e){return Promise.reject(e)}},f.update=function(){try{return this.fn?m(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},f.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},f.messageSW=function(e){try{return p(this.getSW(),function(n){return o(n,e)})}catch(e){return Promise.reject(e)}},f.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&o(this.fn.waiting,h)},f.pn=function(){var e=navigator.serviceWorker.controller;return e&&u(e.scriptURL,this.sn.toString())?e:void 0},f.bn=function(){try{var e=this;return function(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}(function(){return p(navigator.serviceWorker.register(e.sn,e.nn),function(n){return e.un=performance.now(),n})},function(e){throw e})}catch(e){return Promise.reject(e)}},s=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}],i((a=n).prototype,s),l&&i(a,l),n}(function(){function e(){this.Pn=new Map}var n=e.prototype;return n.addEventListener=function(e,n){this.Sn(e).add(n)},n.removeEventListener=function(e,n){this.Sn(e).delete(n)},n.dispatchEvent=function(e){e.target=this;for(var n,t=l(this.Sn(e.type));!(n=t()).done;)(0,n.value)(e)},n.Sn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}());function A(e,n){if(void 0!==a)return console.warn(`The application's Service Worker has already been registered. The new service worker at ${e} will not be registered.`),a;if(!("serviceWorker"in navigator))throw Error("Registering the Service Worker is not possible due to missing browser capabilities.");let t=new g(e,n);return a=t.register().then(()=>t.controlling.then(()=>t))}function y(){return a??Promise.resolve(void 0)}let b="x-omrs-offline-response-body",v="x-omrs-offline-response-status",C="x-omrs-offline-caching-strategy";async function $(e){let n=await y();return n?await n.messageSW(e):{success:!1,result:void 0,error:"No service worker has been registered. This is typically the case when the application has been built without offline-related features."}}async function w(){let e=window.sessionStorage;try{e.setItem("someKeyHere","test"),e.removeItem("someKeyHere")}catch(n){if(n.code===DOMException.QUOTA_EXCEEDED_ERR&&0===e.length)return!0}return!1}async function k(){return!window.indexedDB}async function E(){return new Promise(e=>{let n=indexedDB.open("test");n.onerror=()=>e(!0),n.onsuccess=()=>e(!1)})}async function x(){return await E()||await k()||await w()}let D="openmrs3:offline-mode",S="unavailable";function z(){return{current:S,notAvailable:"unavailable"===S,active:"on"===S}}function B(e){"unavailable"!==S&&"unavailable"!==e&&(localStorage.setItem(D,"on"===e?"active":"disabled"),S=e)}async function M(){await x()||(S="active"===localStorage.getItem(D)?"on":"off"),navigator.onLine}let T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,O=Object.keys,N=Array.isArray;function P(e,n){return"object"!=typeof n||O(n).forEach(function(t){e[t]=n[t]}),e}"undefined"==typeof Promise||T.Promise||(T.Promise=Promise);let I=Object.getPrototypeOf,F={}.hasOwnProperty;function R(e,n){return F.call(e,n)}function H(e,n){"function"==typeof n&&(n=n(I(e))),("undefined"==typeof Reflect?O:Reflect.ownKeys)(n).forEach(t=>{j(e,t,n[t])})}let L=Object.defineProperty;function j(e,n,t,r){L(e,n,P(t&&R(t,"get")&&"function"==typeof t.get?{get:t.get,set:t.set,configurable:!0}:{value:t,configurable:!0,writable:!0},r))}function q(e){return{from:function(n){return e.prototype=Object.create(n.prototype),j(e.prototype,"constructor",e),{extend:H.bind(null,e.prototype)}}}}let G=Object.getOwnPropertyDescriptor;function V(e,n){let t;return G(e,n)||(t=I(e))&&V(t,n)}let U=[].slice;function W(e,n,t){return U.call(e,n,t)}function K(e,n){return n(e)}function Z(e){if(!e)throw Error("Assertion Failed")}function Y(e){T.setImmediate?setImmediate(e):setTimeout(e,0)}function J(e,n){return e.reduce((e,t,r)=>{var a=n(t,r);return a&&(e[a[0]]=a[1]),e},{})}function X(e,n){if("string"==typeof n&&R(e,n))return e[n];if(!n)return e;if("string"!=typeof n){for(var t=[],r=0,a=n.length;r<a;++r){var o=X(e,n[r]);t.push(o)}return t}var i=n.indexOf(".");if(-1!==i){var s=e[n.substr(0,i)];return null==s?void 0:X(s,n.substr(i+1))}}function Q(e,n,t){if(e&&void 0!==n&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof n&&"length"in n){Z("string"!=typeof t&&"length"in t);for(var r=0,a=n.length;r<a;++r)Q(e,n[r],t[r])}else{var o=n.indexOf(".");if(-1!==o){var i=n.substr(0,o),s=n.substr(o+1);if(""===s)void 0===t?N(e)&&!isNaN(parseInt(i))?e.splice(i,1):delete e[i]:e[i]=t;else{var l=e[i];l&&R(e,i)||(l=e[i]={}),Q(l,s,t)}}else void 0===t?N(e)&&!isNaN(parseInt(n))?e.splice(n,1):delete e[n]:e[n]=t}}function ee(e){var n={};for(var t in e)R(e,t)&&(n[t]=e[t]);return n}let en=[].concat;function et(e){return en.apply([],e)}let er="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(et([8,16,32,64].map(e=>["Int","Uint","Float"].map(n=>n+e+"Array")))).filter(e=>T[e]),ea=er.map(e=>T[e]);J(er,e=>[e,!0]);let eo=null;function ei(e){eo="undefined"!=typeof WeakMap&&new WeakMap;let n=es(e);return eo=null,n}function es(e){if(!e||"object"!=typeof e)return e;let n=eo&&eo.get(e);if(n)return n;if(N(e)){n=[],eo&&eo.set(e,n);for(var t=0,r=e.length;t<r;++t)n.push(es(e[t]))}else if(ea.indexOf(e.constructor)>=0)n=e;else{let t=I(e);for(var a in n=t===Object.prototype?{}:Object.create(t),eo&&eo.set(e,n),e)R(e,a)&&(n[a]=es(e[a]))}return n}let{toString:el}={};function ec(e){return el.call(e).slice(8,-1)}let eu="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",ed="symbol"==typeof eu?function(e){var n;return null!=e&&(n=e[eu])&&n.apply(e)}:function(){return null},ep={};function ef(e){var n,t,r,a;if(1==arguments.length){if(N(e))return e.slice();if(this===ep&&"string"==typeof e)return[e];if(a=ed(e)){for(t=[];!(r=a.next()).done;)t.push(r.value);return t}if(null==e)return[e];if("number"==typeof(n=e.length)){for(t=Array(n);n--;)t[n]=e[n];return t}return[e]}for(n=arguments.length,t=Array(n);n--;)t[n]=arguments[n];return t}let e_="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var eh="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function em(e,n){eh=e,eg=n}var eg=()=>!0;let eA=!Error("").stack;function ey(){if(eA)try{throw ey.arguments,Error()}catch(e){return e}return Error()}function eb(e,n){var t=e.stack;return t?(n=n||0,0===t.indexOf(e.name)&&(n+=(e.name+e.message).split("\n").length),t.split("\n").slice(n).filter(eg).map(e=>"\n"+e).join("")):""}var ev=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],eC=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(ev),e$={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function ew(e,n){this._e=ey(),this.name=e,this.message=n}function ek(e,n){return e+". Errors: "+Object.keys(n).map(e=>n[e].toString()).filter((e,n,t)=>t.indexOf(e)===n).join("\n")}function eE(e,n,t,r){this._e=ey(),this.failures=n,this.failedKeys=r,this.successCount=t,this.message=ek(e,n)}function ex(e,n){this._e=ey(),this.name="BulkError",this.failures=Object.keys(n).map(e=>n[e]),this.failuresByPos=n,this.message=ek(e,n)}q(ew).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+eb(this._e,2))}},toString:function(){return this.name+": "+this.message}}),q(eE).from(ew),q(ex).from(ew);var eD=eC.reduce((e,n)=>(e[n]=n+"Error",e),{});let eS=ew;var ez=eC.reduce((e,n)=>{var t=n+"Error";function r(e,r){this._e=ey(),this.name=t,e?"string"==typeof e?(this.message=`${e}${r?"\n "+r:""}`,this.inner=r||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=e$[n]||t,this.inner=null)}return q(r).from(eS),e[n]=r,e},{});ez.Syntax=SyntaxError,ez.Type=TypeError,ez.Range=RangeError;var eB=ev.reduce((e,n)=>(e[n+"Error"]=ez[n],e),{}),eM=eC.reduce((e,n)=>(-1===["Syntax","Type","Range"].indexOf(n)&&(e[n+"Error"]=ez[n]),e),{});function eT(){}function eO(e){return e}function eN(e,n){return null==e||e===eO?n:function(t){return n(e(t))}}function eP(e,n){return function(){e.apply(this,arguments),n.apply(this,arguments)}}function eI(e,n){return e===eT?n:function(){var t=e.apply(this,arguments);void 0!==t&&(arguments[0]=t);var r=this.onsuccess,a=this.onerror;this.onsuccess=null,this.onerror=null;var o=n.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?eP(r,this.onsuccess):r),a&&(this.onerror=this.onerror?eP(a,this.onerror):a),void 0!==o?o:t}}function eF(e,n){return e===eT?n:function(){e.apply(this,arguments);var t=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,n.apply(this,arguments),t&&(this.onsuccess=this.onsuccess?eP(t,this.onsuccess):t),r&&(this.onerror=this.onerror?eP(r,this.onerror):r)}}function eR(e,n){return e===eT?n:function(t){var r=e.apply(this,arguments);P(t,r);var a=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=n.apply(this,arguments);return a&&(this.onsuccess=this.onsuccess?eP(a,this.onsuccess):a),o&&(this.onerror=this.onerror?eP(o,this.onerror):o),void 0===r?void 0===i?void 0:i:P(r,i)}}function eH(e,n){return e===eT?n:function(){return!1!==n.apply(this,arguments)&&e.apply(this,arguments)}}function eL(e,n){return e===eT?n:function(){var t=e.apply(this,arguments);if(t&&"function"==typeof t.then){for(var r=this,a=arguments.length,o=Array(a);a--;)o[a]=arguments[a];return t.then(function(){return n.apply(r,o)})}return n.apply(this,arguments)}}eM.ModifyError=eE,eM.DexieError=ew,eM.BulkError=ex;var ej={};let eq=100,[eG,eV,eU]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,I(e),e];let n=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[n,I(n),e]})(),eW=eV&&eV.then,eK=eG&&eG.constructor,eZ=!!eU;var eY=!1,eJ=eU?()=>{eU.then(nu)}:T.setImmediate?setImmediate.bind(null,nu):T.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver(()=>{nu(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(nu,0)},eX=function(e,n){e8.push([e,n]),e0&&(eJ(),e0=!1)},eQ=!0,e0=!0,e1=[],e2=[],e3=null,e4=eO,e5={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:nN,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(e=>{try{nN(e[0],e[1])}catch(e){}})}},e6=e5,e8=[],e7=0,e9=[];function ne(e){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=eT,this._lib=!1;var n=this._PSD=e6;if(eh&&(this._stackHolder=ey(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==ej)throw TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&na(this,this._value))}this._state=null,this._value=null,++n.ref,nr(this,e)}let nn={get:function(){var e=e6,n=nb;function t(t,r){var a=!e.global&&(e!==e6||n!==nb);let o=a&&!nw();var i=new ne((n,i)=>{ni(this,new nt(nM(t,e,a,o),nM(r,e,a,o),n,i,e))});return eh&&nc(i,this),i}return t.prototype=ej,t},set:function(e){j(this,"then",e&&e.prototype===ej?nn:{get:function(){return e},set:nn.set})}};function nt(e,n,t,r,a){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.resolve=t,this.reject=r,this.psd=a}function nr(e,n){try{n(n=>{if(null===e._state){if(n===e)throw TypeError("A promise cannot be resolved with itself.");var t=e._lib&&nd();n&&"function"==typeof n.then?nr(e,(e,t)=>{n instanceof ne?n._then(e,t):n.then(e,t)}):(e._state=!0,e._value=n,no(e)),t&&np()}},na.bind(null,e))}catch(n){na(e,n)}}function na(e,n){if(e2.push(n),null===e._state){var t=e._lib&&nd();n=e4(n),e._state=!1,e._value=n,eh&&null!==n&&"object"==typeof n&&!n._promise&&function(e,n,t){try{e.apply(null,void 0)}catch(e){}}(()=>{var t=V(n,"stack");n._promise=e,j(n,"stack",{get:()=>eY?t&&(t.get?t.get.apply(n):t.value):e.stack})}),function(e){e1.some(n=>n._value===e._value)||e1.push(e)}(e),no(e),t&&np()}}function no(e){var n=e._listeners;e._listeners=[];for(var t=0,r=n.length;t<r;++t)ni(e,n[t]);var a=e._PSD;--a.ref||a.finalize(),0===e7&&(++e7,eX(()=>{0==--e7&&nf()},[]))}function ni(e,n){if(null!==e._state){var t=e._state?n.onFulfilled:n.onRejected;if(null===t)return(e._state?n.resolve:n.reject)(e._value);++n.psd.ref,++e7,eX(ns,[t,e,n])}else e._listeners.push(n)}function ns(e,n,t){try{e3=n;var r,a=n._value;n._state?r=e(a):(e2.length&&(e2=[]),r=e(a),-1===e2.indexOf(a)&&function(e){for(var n=e1.length;n;)if(e1[--n]._value===e._value)return void e1.splice(n,1)}(n)),t.resolve(r)}catch(e){t.reject(e)}finally{e3=null,0==--e7&&nf(),--t.psd.ref||t.psd.finalize()}}function nl(e,n,t){if(n.length===t)return n;var r="";if(!1===e._state){var a,o,i=e._value;null!=i?(a=i.name||"Error",o=i.message||i,r=eb(i,0)):(a=i,o=""),n.push(a+(o?": "+o:"")+r)}return eh&&((r=eb(e._stackHolder,2))&&-1===n.indexOf(r)&&n.push(r),e._prev&&nl(e._prev,n,t)),n}function nc(e,n){var t=n?n._numPrev+1:0;t<100&&(e._prev=n,e._numPrev=t)}function nu(){nd()&&np()}function nd(){var e=eQ;return eQ=!1,e0=!1,e}function np(){var e,n,t;do for(;e8.length>0;)for(e=e8,e8=[],t=e.length,n=0;n<t;++n){var r=e[n];r[0].apply(null,r[1])}while(e8.length>0);eQ=!0,e0=!0}function nf(){var e=e1;e1=[],e.forEach(e=>{e._PSD.onunhandled.call(null,e._value,e)});for(var n=e9.slice(0),t=n.length;t;)n[--t]()}function n_(e){return new ne(ej,!1,e)}function nh(e,n){var t=e6;return function(){var r=nd(),a=e6;try{return nD(t,!0),e.apply(this,arguments)}catch(e){n&&n(e)}finally{nD(a,!1),r&&np()}}}H(ne.prototype,{then:nn,_then:function(e,n){ni(this,new nt(null,null,e,n,e6))},catch:function(e){if(1==arguments.length)return this.then(null,e);var n=arguments[0],t=arguments[1];return"function"==typeof n?this.then(null,e=>e instanceof n?t(e):n_(e)):this.then(null,e=>e&&e.name===n?t(e):n_(e))},finally:function(e){return this.then(n=>(e(),n),n=>(e(),n_(n)))},stack:{get:function(){if(this._stack)return this._stack;try{eY=!0;var e=nl(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{eY=!1}}},timeout:function(e,n){return e<1/0?new ne((t,r)=>{var a=setTimeout(()=>r(new ez.Timeout(n)),e);this.then(t,r).finally(clearTimeout.bind(null,a))}):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&j(ne.prototype,Symbol.toStringTag,"Dexie.Promise"),e5.env=nS(),H(ne,{all:function(){var e=ef.apply(null,arguments).map(nk);return new ne(function(n,t){0===e.length&&n([]);var r=e.length;e.forEach((a,o)=>ne.resolve(a).then(t=>{e[o]=t,--r||n(e)},t))})},resolve:e=>{if(e instanceof ne)return e;if(e&&"function"==typeof e.then)return new ne((n,t)=>{e.then(n,t)});var n=new ne(ej,!0,e);return nc(n,e3),n},reject:n_,race:function(){var e=ef.apply(null,arguments).map(nk);return new ne((n,t)=>{e.map(e=>ne.resolve(e).then(n,t))})},PSD:{get:()=>e6,set:e=>e6=e},totalEchoes:{get:()=>nb},newPSD:nC,usePSD:nz,scheduler:{get:()=>eX,set:e=>{eX=e}},rejectionMapper:{get:()=>e4,set:e=>{e4=e}},follow:(e,n)=>new ne((t,r)=>nC((n,t)=>{var r=e6;r.unhandleds=[],r.onunhandled=t,r.finalize=eP(function(){!function(e){function n(){e(),e9.splice(e9.indexOf(n),1)}e9.push(n),++e7,eX(()=>{0==--e7&&nf()},[])}(()=>{0===this.unhandleds.length?n():t(this.unhandleds[0])})},r.finalize),e()},n,t,r))}),eK&&(eK.allSettled&&j(ne,"allSettled",function(){let e=ef.apply(null,arguments).map(nk);return new ne(n=>{0===e.length&&n([]);let t=e.length,r=Array(t);e.forEach((e,a)=>ne.resolve(e).then(e=>r[a]={status:"fulfilled",value:e},e=>r[a]={status:"rejected",reason:e}).then(()=>--t||n(r)))})}),eK.any&&"undefined"!=typeof AggregateError&&j(ne,"any",function(){let e=ef.apply(null,arguments).map(nk);return new ne((n,t)=>{0===e.length&&t(AggregateError([]));let r=e.length,a=Array(r);e.forEach((e,o)=>ne.resolve(e).then(e=>n(e),e=>{a[o]=e,--r||t(AggregateError(a))}))})}));let nm={awaits:0,echoes:0,id:0};var ng=0,nA=[],ny=0,nb=0,nv=0;function nC(e,n,t,r){var a=e6,o=Object.create(a);o.parent=a,o.ref=0,o.global=!1,o.id=++nv;var i=e5.env;o.env=eZ?{Promise:ne,PromiseProp:{value:ne,configurable:!0,writable:!0},all:ne.all,race:ne.race,allSettled:ne.allSettled,any:ne.any,resolve:ne.resolve,reject:ne.reject,nthen:nT(i.nthen,o),gthen:nT(i.gthen,o)}:{},n&&P(o,n),++a.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=nz(o,e,t,r);return 0===o.ref&&o.finalize(),s}function n$(){return nm.id||(nm.id=++ng),++nm.awaits,nm.echoes+=eq,nm.id}function nw(){return!!nm.awaits&&(0==--nm.awaits&&(nm.id=0),nm.echoes=nm.awaits*eq,!0)}function nk(e){return nm.echoes&&e&&e.constructor===eK?(n$(),e.then(e=>(nw(),e),e=>(nw(),nP(e)))):e}function nE(e){++nb,nm.echoes&&0!=--nm.echoes||(nm.echoes=nm.id=0),nA.push(e6),nD(e,!0)}function nx(){var e=nA[nA.length-1];nA.pop(),nD(e,!1)}function nD(e,n){var t=e6;if((n?!nm.echoes||ny++&&e===e6:!ny||--ny&&e===e6)||nB(n?nE.bind(null,e):nx),e!==e6&&(e6=e,t===e5&&(e5.env=nS()),eZ)){var r=e5.env.Promise,a=e.env;eV.then=a.nthen,r.prototype.then=a.gthen,(t.global||e.global)&&(Object.defineProperty(T,"Promise",a.PromiseProp),r.all=a.all,r.race=a.race,r.resolve=a.resolve,r.reject=a.reject,a.allSettled&&(r.allSettled=a.allSettled),a.any&&(r.any=a.any))}}function nS(){var e=T.Promise;return eZ?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(T,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:eV.then,gthen:e.prototype.then}:{}}function nz(e,n,t,r,a){var o=e6;try{return nD(e,!0),n(t,r,a)}finally{nD(o,!1)}}function nB(e){eW.call(eG,e)}function nM(e,n,t,r){return"function"!=typeof e?e:function(){var a=e6;t&&n$(),nD(n,!0);try{return e.apply(this,arguments)}finally{nD(a,!1),r&&nB(nw)}}}function nT(e,n){return function(t,r){return e.call(this,nM(t,n),nM(r,n))}}-1===(""+eW).indexOf("[native code]")&&(n$=nw=eT);let nO="unhandledrejection";function nN(e,n){var t;try{t=n.onuncatched(e)}catch(e){}if(!1!==t)try{var r,a={promise:n,reason:e};if(T.document&&document.createEvent?((r=document.createEvent("Event")).initEvent(nO,!0,!0),P(r,a)):T.CustomEvent&&P(r=new CustomEvent(nO,{detail:a}),a),r&&T.dispatchEvent&&(dispatchEvent(r),!T.PromiseRejectionEvent&&T.onunhandledrejection))try{T.onunhandledrejection(r)}catch(e){}eh&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}var nP=ne.reject;function nI(e,n,t,r){if(e.idbdb&&(e._state.openComplete||e6.letThrough||e._vip)){var a=e._createTransaction(n,t,e._dbSchema);try{a.create(),e._state.PR1398_maxLoop=3}catch(a){return a.name===eD.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then(()=>nI(e,n,t,r))):nP(a)}return a._promise(n,(e,n)=>nC(()=>(e6.trans=a,r(e,n,a)))).then(e=>a._completion.then(()=>e))}if(e._state.openComplete)return nP(new ez.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return nP(new ez.DatabaseClosed);e.open().catch(eT)}return e._state.dbReadyPromise.then(()=>nI(e,n,t,r))}let nF="3.2.7",nR=String.fromCharCode(65535),nH=-1/0,nL="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",nj="String expected.",nq=[],nG="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),nV=nG,nU=nG,nW=e=>!/(dexie\.js|dexie\.min\.js)/.test(e),nK="__dbnames",nZ="readonly",nY="readwrite";function nJ(e,n){return e?n?function(){return e.apply(this,arguments)&&n.apply(this,arguments)}:e:n}let nX={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function nQ(e){return"string"!=typeof e||/\./.test(e)?e=>e:n=>(void 0===n[e]&&e in n&&delete(n=ei(n))[e],n)}class n0{_trans(e,n,t){let r=this._tx||e6.trans,a=this.name;function o(e,t,r){if(!r.schema[a])throw new ez.NotFound("Table "+a+" not part of transaction");return n(r.idbtrans,r)}let i=nd();try{return r&&r.db===this.db?r===e6.trans?r._promise(e,o,t):nC(()=>r._promise(e,o,t),{trans:r,transless:e6.transless||e6}):nI(this.db,e,[this.name],o)}finally{i&&np()}}get(e,n){return e&&e.constructor===Object?this.where(e).first(n):this._trans("readonly",n=>this.core.get({trans:n,key:e}).then(e=>this.hook.reading.fire(e))).then(n)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(N(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);let n=O(e);if(1===n.length)return this.where(n[0]).equals(e[n[0]]);let t=this.schema.indexes.concat(this.schema.primKey).filter(e=>{if(e.compound&&n.every(n=>e.keyPath.indexOf(n)>=0)){for(let t=0;t<n.length;++t)if(-1===n.indexOf(e.keyPath[t]))return!1;return!0}return!1}).sort((e,n)=>e.keyPath.length-n.keyPath.length)[0];if(t&&this.db._maxKey!==nR){let r=t.keyPath.slice(0,n.length);return this.where(r).equals(r.map(n=>e[n]))}!t&&eh&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${n.join("+")}]`);let{idxByName:r}=this.schema,a=this.db._deps.indexedDB;function o(e,n){try{return 0===a.cmp(e,n)}catch(e){return!1}}let[i,s]=n.reduce(([n,t],a)=>{let i=r[a],s=e[a];return[n||i,n||!i?nJ(t,i&&i.multi?e=>{let n=X(e,a);return N(n)&&n.some(e=>o(s,e))}:e=>o(s,X(e,a))):t]},[null,null]);return i?this.where(i.name).equals(e[i.keyPath]).filter(s):t?this.filter(s):this.where(n).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,N(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;let n=n=>{if(!n)return n;let t=Object.create(e.prototype);for(var r in n)if(R(n,r))try{t[r]=n[r]}catch(e){}return t};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=n,this.hook("reading",n),e}defineClass(){return this.mapToClass(function(e){P(this,e)})}add(e,n){let{auto:t,keyPath:r}=this.schema.primKey,a=e;return r&&t&&(a=nQ(r)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"add",keys:null!=n?[n]:null,values:[a]})).then(e=>e.numFailures?ne.reject(e.failures[0]):e.lastResult).then(n=>{if(r)try{Q(e,r,n)}catch(e){}return n})}update(e,n){if("object"!=typeof e||N(e))return this.where(":id").equals(e).modify(n);{let t=X(e,this.schema.primKey.keyPath);if(void 0===t)return nP(new ez.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof n?O(n).forEach(t=>{Q(e,t,n[t])}):n(e,{value:e,primKey:t})}catch(e){}return this.where(":id").equals(t).modify(n)}}put(e,n){let{auto:t,keyPath:r}=this.schema.primKey,a=e;return r&&t&&(a=nQ(r)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"put",values:[a],keys:null!=n?[n]:null})).then(e=>e.numFailures?ne.reject(e.failures[0]):e.lastResult).then(n=>{if(r)try{Q(e,r,n)}catch(e){}return n})}delete(e){return this._trans("readwrite",n=>this.core.mutate({trans:n,type:"delete",keys:[e]})).then(e=>e.numFailures?ne.reject(e.failures[0]):void 0)}clear(){return this._trans("readwrite",e=>this.core.mutate({trans:e,type:"deleteRange",range:nX})).then(e=>e.numFailures?ne.reject(e.failures[0]):void 0)}bulkGet(e){return this._trans("readonly",n=>this.core.getMany({keys:e,trans:n}).then(e=>e.map(e=>this.hook.reading.fire(e))))}bulkAdd(e,n,t){let r=Array.isArray(n)?n:void 0,a=(t=t||(r?void 0:n))?t.allKeys:void 0;return this._trans("readwrite",n=>{let{auto:t,keyPath:o}=this.schema.primKey;if(o&&r)throw new ez.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new ez.InvalidArgument("Arguments objects and keys must have the same length");let i=e.length,s=o&&t?e.map(nQ(o)):e;return this.core.mutate({trans:n,type:"add",keys:r,values:s,wantResults:a}).then(({numFailures:e,results:n,lastResult:t,failures:r})=>{if(0===e)return a?n:t;throw new ex(`${this.name}.bulkAdd(): ${e} of ${i} operations failed`,r)})})}bulkPut(e,n,t){let r=Array.isArray(n)?n:void 0,a=(t=t||(r?void 0:n))?t.allKeys:void 0;return this._trans("readwrite",n=>{let{auto:t,keyPath:o}=this.schema.primKey;if(o&&r)throw new ez.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new ez.InvalidArgument("Arguments objects and keys must have the same length");let i=e.length,s=o&&t?e.map(nQ(o)):e;return this.core.mutate({trans:n,type:"put",keys:r,values:s,wantResults:a}).then(({numFailures:e,results:n,lastResult:t,failures:r})=>{if(0===e)return a?n:t;throw new ex(`${this.name}.bulkPut(): ${e} of ${i} operations failed`,r)})})}bulkDelete(e){let n=e.length;return this._trans("readwrite",n=>this.core.mutate({trans:n,type:"delete",keys:e})).then(({numFailures:e,lastResult:t,failures:r})=>{if(0===e)return t;throw new ex(`${this.name}.bulkDelete(): ${e} of ${n} operations failed`,r)})}}function n1(e){var n={},t=function(t,r){if(r){for(var a=arguments.length,o=Array(a-1);--a;)o[a-1]=arguments[a];return n[t].subscribe.apply(null,o),e}if("string"==typeof t)return n[t]};t.addEventType=o;for(var r=1,a=arguments.length;r<a;++r)o(arguments[r]);return t;function o(e,r,a){if("object"!=typeof e){r||(r=eH),a||(a=eT);var i,s={subscribers:[],fire:a,subscribe:function(e){-1===s.subscribers.indexOf(e)&&(s.subscribers.push(e),s.fire=r(s.fire,e))},unsubscribe:function(e){s.subscribers=s.subscribers.filter(function(n){return n!==e}),s.fire=s.subscribers.reduce(r,a)}};return n[e]=t[e]=s,s}O(i=e).forEach(function(e){var n=i[e];if(N(n))o(e,i[e][0],i[e][1]);else{if("asap"!==n)throw new ez.InvalidArgument("Invalid event config");var t=o(e,eO,function(){for(var e=arguments.length,n=Array(e);e--;)n[e]=arguments[e];t.subscribers.forEach(function(e){Y(function(){e.apply(null,n)})})})}})}}function n2(e,n){return q(n).from({prototype:e}),n}function n3(e,n){return!(e.filter||e.algorithm||e.or)&&(n?e.justLimit:!e.replayFilter)}function n4(e,n){e.filter=nJ(e.filter,n)}function n5(e,n,t){var r=e.replayFilter;e.replayFilter=r?()=>nJ(r(),n()):n,e.justLimit=t&&!r}function n6(e,n){if(e.isPrimKey)return n.primaryKey;let t=n.getIndexByKeyPath(e.index);if(!t)throw new ez.Schema("KeyPath "+e.index+" on object store "+n.name+" is not indexed");return t}function n8(e,n,t){let r=n6(e,n.schema);return n.openCursor({trans:t,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function n7(e,n,t,r){let a=e.replayFilter?nJ(e.filter,e.replayFilter()):e.filter;if(e.or){let o={},i=(e,t,r)=>{if(!a||a(t,r,e=>t.stop(e),e=>t.fail(e))){var i=t.primaryKey,s=""+i;"[object ArrayBuffer]"===s&&(s=""+new Uint8Array(i)),R(o,s)||(o[s]=!0,n(e,t,r))}};return Promise.all([e.or._iterate(i,t),n9(n8(e,r,t),e.algorithm,i,!e.keysOnly&&e.valueMapper)])}return n9(n8(e,r,t),nJ(e.algorithm,a),n,!e.keysOnly&&e.valueMapper)}function n9(e,n,t,r){var a=nh(r?(e,n,a)=>t(r(e),n,a):t);return e.then(e=>{if(e)return e.start(()=>{var t=()=>e.continue();n&&!n(e,e=>t=e,n=>{e.stop(n),t=eT},n=>{e.fail(n),t=eT})||a(e.value,e,e=>t=e),t()})})}function te(e,n){try{let t=tn(e),r=tn(n);if(t!==r)return"Array"===t?1:"Array"===r?-1:"binary"===t?1:"binary"===r?-1:"string"===t?1:"string"===r?-1:"Date"===t?1:"Date"!==r?NaN:-1;switch(t){case"number":case"Date":case"string":return e>n?1:e<n?-1:0;case"binary":return function(e,n){let t=e.length,r=n.length,a=t<r?t:r;for(let t=0;t<a;++t)if(e[t]!==n[t])return e[t]<n[t]?-1:1;return t===r?0:t<r?-1:1}(tt(e),tt(n));case"Array":return function(e,n){let t=e.length,r=n.length,a=t<r?t:r;for(let t=0;t<a;++t){let r=te(e[t],n[t]);if(0!==r)return r}return t===r?0:t<r?-1:1}(e,n)}}catch(e){}return NaN}function tn(e){let n=typeof e;if("object"!==n)return n;if(ArrayBuffer.isView(e))return"binary";let t=ec(e);return"ArrayBuffer"===t?"binary":t}function tt(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class tr{_read(e,n){var t=this._ctx;return t.error?t.table._trans(null,nP.bind(null,t.error)):t.table._trans("readonly",e).then(n)}_write(e){var n=this._ctx;return n.error?n.table._trans(null,nP.bind(null,n.error)):n.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var n=this._ctx;n.algorithm=nJ(n.algorithm,e)}_iterate(e,n){return n7(this._ctx,e,n,this._ctx.table.core)}clone(e){var n=Object.create(this.constructor.prototype),t=Object.create(this._ctx);return e&&P(t,e),n._ctx=t,n}raw(){return this._ctx.valueMapper=null,this}each(e){var n=this._ctx;return this._read(t=>n7(n,e,t,n.table.core))}count(e){return this._read(e=>{let n=this._ctx,t=n.table.core;if(n3(n,!0))return t.count({trans:e,query:{index:n6(n,t.schema),range:n.range}}).then(e=>Math.min(e,n.limit));var r=0;return n7(n,()=>(++r,!1),e,t).then(()=>r)}).then(e)}sortBy(e,n){let t=e.split(".").reverse(),r=t[0],a=t.length-1;function o(e,n){return n?o(e[t[n]],n-1):e[r]}var i="next"===this._ctx.dir?1:-1;function s(e,n){var t=o(e,a),r=o(n,a);return t<r?-i:t>r?i:0}return this.toArray(function(e){return e.sort(s)}).then(n)}toArray(e){return this._read(e=>{var n=this._ctx;if("next"===n.dir&&n3(n,!0)&&n.limit>0){let{valueMapper:t}=n,r=n6(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:r,range:n.range}}).then(({result:e})=>t?e.map(t):e)}{let t=[];return n7(n,e=>t.push(e),e,n.table.core).then(()=>t)}},e)}offset(e){var n=this._ctx;return e<=0||(n.offset+=e,n3(n)?n5(n,()=>{var n=e;return(e,t)=>0===n||(1===n?--n:t(()=>{e.advance(n),n=0}),!1)}):n5(n,()=>{var n=e;return()=>--n<0})),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),n5(this._ctx,()=>{var n=e;return function(e,t,r){return--n<=0&&t(r),n>=0}},!0),this}until(e,n){return n4(this._ctx,function(t,r,a){return!e(t.value)||(r(a),n)}),this}first(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)}last(e){return this.reverse().first(e)}filter(e){var n,t;return n4(this._ctx,function(n){return e(n.value)}),n=this._ctx,t=e,n.isMatch=nJ(n.isMatch,t),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each(function(n,t){e(t.key,t)})}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each(function(n,t){e(t.primaryKey,t)})}keys(e){var n=this._ctx;n.keysOnly=!n.isMatch;var t=[];return this.each(function(e,n){t.push(n.key)}).then(function(){return t}).then(e)}primaryKeys(e){var n=this._ctx;if("next"===n.dir&&n3(n,!0)&&n.limit>0)return this._read(e=>{var t=n6(n,n.table.core.schema);return n.table.core.query({trans:e,values:!1,limit:n.limit,query:{index:t,range:n.range}})}).then(({result:e})=>e).then(e);n.keysOnly=!n.isMatch;var t=[];return this.each(function(e,n){t.push(n.primaryKey)}).then(function(){return t}).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys(function(e){return e[0]}).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,n=e.index&&e.table.schema.idxByName[e.index];if(!n||!n.multi)return this;var t={};return n4(this._ctx,function(e){var n=e.primaryKey.toString(),r=R(t,n);return t[n]=!0,!r}),this}modify(e){var n=this._ctx;return this._write(t=>{var r;if("function"==typeof e)r=e;else{var a=O(e),o=a.length;r=function(n){for(var t=!1,r=0;r<o;++r){var i=a[r],s=e[i];X(n,i)!==s&&(Q(n,i,s),t=!0)}return t}}let i=n.table.core,{outbound:s,extractKey:l}=i.schema.primaryKey,c=this.db._options.modifyChunkSize||200,u=[],d=0,p=[],f=(e,n)=>{let{failures:t,numFailures:r}=n;for(let n of(d+=e-r,O(t)))u.push(t[n])};return this.clone().primaryKeys().then(a=>{let o=u=>{let d=Math.min(c,a.length-u);return i.getMany({trans:t,keys:a.slice(u,u+d),cache:"immutable"}).then(p=>{let h=[],m=[],g=s?[]:null,A=[];for(let e=0;e<d;++e){let n=p[e],t={value:ei(n),primKey:a[u+e]};!1!==r.call(t,t.value,t)&&(null==t.value?A.push(a[u+e]):s||0===te(l(n),l(t.value))?(m.push(t.value),s&&g.push(a[u+e])):(A.push(a[u+e]),h.push(t.value)))}let y=n3(n)&&n.limit===1/0&&("function"!=typeof e||e===ta)&&{index:n.index,range:n.range};return Promise.resolve(h.length>0&&i.mutate({trans:t,type:"add",values:h}).then(e=>{for(let n in e.failures)A.splice(parseInt(n),1);f(h.length,e)})).then(()=>(m.length>0||y&&"object"==typeof e)&&i.mutate({trans:t,type:"put",keys:g,values:m,criteria:y,changeSpec:"function"!=typeof e&&e}).then(e=>f(m.length,e))).then(()=>(A.length>0||y&&e===ta)&&i.mutate({trans:t,type:"delete",keys:A,criteria:y}).then(e=>f(A.length,e))).then(()=>a.length>u+d&&o(u+c))})};return o(0).then(()=>{if(u.length>0)throw new eE("Error modifying one or more objects",u,d,p);return a.length})})})}delete(){var e=this._ctx,n=e.range;return n3(e)&&(e.isPrimKey&&!nU||3===n.type)?this._write(t=>{let{primaryKey:r}=e.table.core.schema,a=n;return e.table.core.count({trans:t,query:{index:r,range:a}}).then(n=>e.table.core.mutate({trans:t,type:"deleteRange",range:a}).then(({failures:e,lastResult:t,results:r,numFailures:a})=>{if(a)throw new eE("Could not delete some values",Object.keys(e).map(n=>e[n]),n-a);return n-a}))}):this.modify(ta)}}let ta=(e,n)=>n.value=null;function to(e,n){return e<n?-1:+(e!==n)}function ti(e,n){return e>n?-1:+(e!==n)}function ts(e,n,t){var r=e instanceof tf?new e.Collection(e):e;return r._ctx.error=t?new t(n):TypeError(n),r}function tl(e){return new e.Collection(e,()=>tp("")).limit(0)}function tc(e,n,t,r,a,o){for(var i=Math.min(e.length,r.length),s=-1,l=0;l<i;++l){var c=n[l];if(c!==r[l])return 0>a(e[l],t[l])?e.substr(0,l)+t[l]+t.substr(l+1):0>a(e[l],r[l])?e.substr(0,l)+r[l]+t.substr(l+1):s>=0?e.substr(0,s)+n[s]+t.substr(s+1):null;0>a(e[l],c)&&(s=l)}return i<r.length&&"next"===o?e+t.substr(e.length):i<e.length&&"prev"===o?e.substr(0,t.length):s<0?null:e.substr(0,s)+r[s]+t.substr(s+1)}function tu(e,n,t,r){var a,o,i,s,l,c,u,d=t.length;if(!t.every(e=>"string"==typeof e))return ts(e,nj);function p(e){a=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),o=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),i="next"===e?to:ti;var n=t.map(function(e){return{lower:o(e),upper:a(e)}}).sort(function(e,n){return i(e.lower,n.lower)});s=n.map(function(e){return e.upper}),l=n.map(function(e){return e.lower}),c=e,u="next"===e?"":r}p("next");var f=new e.Collection(e,()=>td(s[0],l[d-1]+r));f._ondirectionchange=function(e){p(e)};var h=0;return f._addAlgorithm(function(e,t,r){var a=e.key;if("string"!=typeof a)return!1;var p=o(a);if(n(p,l,h))return!0;for(var f=null,m=h;m<d;++m){var g=tc(a,p,s[m],l[m],i,c);null===g&&null===f?h=m+1:(null===f||i(f,g)>0)&&(f=g)}return t(null!==f?function(){e.continue(f+u)}:r),!1}),f}function td(e,n,t,r){return{type:2,lower:e,upper:n,lowerOpen:t,upperOpen:r}}function tp(e){return{type:1,lower:e,upper:e}}class tf{get Collection(){return this._ctx.table.db.Collection}between(e,n,t,r){t=!1!==t,r=!0===r;try{return this._cmp(e,n)>0||0===this._cmp(e,n)&&(t||r)&&(!t||!r)?tl(this):new this.Collection(this,()=>td(e,n,!t,!r))}catch(e){return ts(this,nL)}}equals(e){return null==e?ts(this,nL):new this.Collection(this,()=>tp(e))}above(e){return null==e?ts(this,nL):new this.Collection(this,()=>td(e,void 0,!0))}aboveOrEqual(e){return null==e?ts(this,nL):new this.Collection(this,()=>td(e,void 0,!1))}below(e){return null==e?ts(this,nL):new this.Collection(this,()=>td(void 0,e,!1,!0))}belowOrEqual(e){return null==e?ts(this,nL):new this.Collection(this,()=>td(void 0,e))}startsWith(e){return"string"!=typeof e?ts(this,nj):this.between(e,e+nR,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):tu(this,(e,n)=>0===e.indexOf(n[0]),[e],nR)}equalsIgnoreCase(e){return tu(this,(e,n)=>e===n[0],[e],"")}anyOfIgnoreCase(){var e=ef.apply(ep,arguments);return 0===e.length?tl(this):tu(this,(e,n)=>-1!==n.indexOf(e),e,"")}startsWithAnyOfIgnoreCase(){var e=ef.apply(ep,arguments);return 0===e.length?tl(this):tu(this,(e,n)=>n.some(n=>0===e.indexOf(n)),e,nR)}anyOf(){let e=ef.apply(ep,arguments),n=this._cmp;try{e.sort(n)}catch(e){return ts(this,nL)}if(0===e.length)return tl(this);let t=new this.Collection(this,()=>td(e[0],e[e.length-1]));t._ondirectionchange=t=>{n="next"===t?this._ascending:this._descending,e.sort(n)};let r=0;return t._addAlgorithm((t,a,o)=>{let i=t.key;for(;n(i,e[r])>0;)if(++r===e.length)return a(o),!1;return 0===n(i,e[r])||(a(()=>{t.continue(e[r])}),!1)}),t}notEqual(e){return this.inAnyRange([[nH,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){let e=ef.apply(ep,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return ts(this,nL)}let n=e.reduce((e,n)=>e?e.concat([[e[e.length-1][1],n]]):[[nH,n]],null);return n.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(n,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,n){let t=this._cmp,r=this._ascending,a=this._descending,o=this._min,i=this._max;if(0===e.length)return tl(this);if(!e.every(e=>void 0!==e[0]&&void 0!==e[1]&&0>=r(e[0],e[1])))return ts(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",ez.InvalidArgument);let s=!n||!1!==n.includeLowers,l=n&&!0===n.includeUppers,c,u=r;function d(e,n){return u(e[0],n[0])}try{(c=e.reduce(function(e,n){let r=0,a=e.length;for(;r<a;++r){let a=e[r];if(0>t(n[0],a[1])&&t(n[1],a[0])>0){a[0]=o(a[0],n[0]),a[1]=i(a[1],n[1]);break}}return r===a&&e.push(n),e},[])).sort(d)}catch(e){return ts(this,nL)}let p=0,f=l?e=>r(e,c[p][1])>0:e=>r(e,c[p][1])>=0,h=s?e=>a(e,c[p][0])>0:e=>a(e,c[p][0])>=0,m=f,g=new this.Collection(this,()=>td(c[0][0],c[c.length-1][1],!s,!l));return g._ondirectionchange=e=>{"next"===e?(m=f,u=r):(m=h,u=a),c.sort(d)},g._addAlgorithm((e,n,t)=>{for(var a=e.key;m(a);)if(++p===c.length)return n(t),!1;return!!function(e){return!f(e)&&!h(e)}(a)||(0===this._cmp(a,c[p][1])||0===this._cmp(a,c[p][0])||n(()=>{u===r?e.continue(c[p][0]):e.continue(c[p][1])}),!1)}),g}startsWithAnyOf(){let e=ef.apply(ep,arguments);return e.every(e=>"string"==typeof e)?0===e.length?tl(this):this.inAnyRange(e.map(e=>[e,e+nR])):ts(this,"startsWithAnyOf() only works with strings")}}function t_(e){return nh(function(n){return th(n),e(n.target.error),!1})}function th(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}let tm="storagemutated",tg="x-storagemutated-1",tA=n1(null,tm);class ty{_lock(){return Z(!e6.global),++this._reculock,1!==this._reculock||e6.global||(e6.lockOwnerFor=this),this}_unlock(){if(Z(!e6.global),0==--this._reculock)for(e6.global||(e6.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{nz(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&e6.lockOwnerFor!==this}create(e){if(!this.mode)return this;let n=this.db.idbdb,t=this.db._state.dbOpenError;if(Z(!this.idbtrans),!e&&!n)switch(t&&t.name){case"DatabaseClosedError":throw new ez.DatabaseClosed(t);case"MissingAPIError":throw new ez.MissingAPI(t.message,t);default:throw new ez.OpenFailed(t)}if(!this.active)throw new ez.TransactionInactive;return Z(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=nh(n=>{th(n),this._reject(e.error)}),e.onabort=nh(n=>{th(n),this.active&&this._reject(new ez.Abort(e.error)),this.active=!1,this.on("abort").fire(n)}),e.oncomplete=nh(()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&tA.storagemutated.fire(e.mutatedParts)}),this}_promise(e,n,t){if("readwrite"===e&&"readwrite"!==this.mode)return nP(new ez.ReadOnly("Transaction is readonly"));if(!this.active)return nP(new ez.TransactionInactive);if(this._locked())return new ne((r,a)=>{this._blockedFuncs.push([()=>{this._promise(e,n,t).then(r,a)},e6])});if(t)return nC(()=>{var e=new ne((e,t)=>{this._lock();let r=n(e,t,this);r&&r.then&&r.then(e,t)});return e.finally(()=>this._unlock()),e._lib=!0,e});var r=new ne((e,t)=>{var r=n(e,t,this);r&&r.then&&r.then(e,t)});return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(e){var n=this._root();let t=ne.resolve(e);if(n._waitingFor)n._waitingFor=n._waitingFor.then(()=>t);else{n._waitingFor=t,n._waitingQueue=[];var r=n.idbtrans.objectStore(n.storeNames[0]);!function e(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var a=n._waitingFor;return new ne((e,r)=>{t.then(t=>n._waitingQueue.push(nh(e.bind(null,t))),e=>n._waitingQueue.push(nh(r.bind(null,e)))).finally(()=>{n._waitingFor===a&&(n._waitingFor=null)})})}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ez.Abort))}table(e){let n=this._memoizedTables||(this._memoizedTables={});if(R(n,e))return n[e];let t=this.schema[e];if(!t)throw new ez.NotFound("Table "+e+" not part of transaction");let r=new this.db.Table(e,t,this);return r.core=this.db.core.table(e),n[e]=r,r}}function tb(e,n,t,r,a,o,i){return{name:e,keyPath:n,unique:t,multi:r,auto:a,compound:o,src:(t&&!i?"&":"")+(r?"*":"")+(a?"++":"")+tv(n)}}function tv(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function tC(e,n,t){return{name:e,primKey:n,indexes:t,mappedClass:null,idxByName:J(t,e=>[e.name,e])}}let t$=e=>{try{return e.only([[]]),t$=()=>[[]],[[]]}catch(e){return t$=()=>nR,nR}};function tw(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?n=>n[e]:n=>X(n,e)}(e):n=>X(n,e)}function tk(e){return[].slice.call(e)}let tE=0;function tx(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function tD(e,n,t){function r(e){if(3===e.type)return null;if(4===e.type)throw Error("Cannot convert never type to IDBKeyRange");let{lower:t,upper:r,lowerOpen:a,upperOpen:o}=e;return void 0===t?void 0===r?null:n.upperBound(r,!!o):void 0===r?n.lowerBound(t,!!a):n.bound(t,r,!!a,!!o)}let{schema:a,hasGetAll:o}=function(e,n){let t=tk(e.objectStoreNames);return{schema:{name:e.name,tables:t.map(e=>n.objectStore(e)).map(e=>{let{keyPath:n,autoIncrement:t}=e,r=N(n),a=null==n,o={},i={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:a,compound:r,keyPath:n,autoIncrement:t,unique:!0,extractKey:tw(n)},indexes:tk(e.indexNames).map(n=>e.index(n)).map(e=>{let{name:n,unique:t,multiEntry:r,keyPath:a}=e,i={name:n,compound:N(a),keyPath:a,unique:t,multiEntry:r,extractKey:tw(a)};return o[tx(a)]=i,i}),getIndexByKeyPath:e=>o[tx(e)]};return o[":id"]=i.primaryKey,null!=n&&(o[tx(n)]=i.primaryKey),i})},hasGetAll:t.length>0&&"getAll"in n.objectStore(t[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,t),i=a.tables.map(e=>(function(e){let n=e.name;return{name:n,schema:e,mutate:function({trans:e,type:t,keys:a,values:o,range:i}){return new Promise((s,l)=>{let c;s=nh(s);let u=e.objectStore(n),d=null==u.keyPath,p="put"===t||"add"===t;if(!p&&"delete"!==t&&"deleteRange"!==t)throw Error("Invalid operation type: "+t);let{length:f}=a||o||{length:1};if(a&&o&&a.length!==o.length)throw Error("Given keys array must have same length as given values array.");if(0===f)return s({numFailures:0,failures:{},results:[],lastResult:void 0});let h=[],m=[],g=0,A=e=>{++g,th(e)};if("deleteRange"===t){if(4===i.type)return s({numFailures:g,failures:m,results:[],lastResult:void 0});3===i.type?h.push(c=u.clear()):h.push(c=u.delete(r(i)))}else{let[e,n]=p?d?[o,a]:[o,null]:[a,null];if(p)for(let r=0;r<f;++r)h.push(c=n&&void 0!==n[r]?u[t](e[r],n[r]):u[t](e[r])),c.onerror=A;else for(let n=0;n<f;++n)h.push(c=u[t](e[n])),c.onerror=A}let y=e=>{let n=e.target.result;h.forEach((e,n)=>null!=e.error&&(m[n]=e.error)),s({numFailures:g,failures:m,results:"delete"===t?a:h.map(e=>e.result),lastResult:n})};c.onerror=e=>{A(e),y(e)},c.onsuccess=y})},getMany:({trans:e,keys:t})=>new Promise((r,a)=>{r=nh(r);let o=e.objectStore(n),i=t.length,s=Array(i),l,c=0,u=0,d=e=>{let n=e.target;s[n._pos]=n.result,++u===c&&r(s)},p=t_(a);for(let e=0;e<i;++e)null!=t[e]&&((l=o.get(t[e]))._pos=e,l.onsuccess=d,l.onerror=p,++c);0===c&&r(s)}),get:({trans:e,key:t})=>new Promise((r,a)=>{r=nh(r);let o=e.objectStore(n).get(t);o.onsuccess=e=>r(e.target.result),o.onerror=t_(a)}),query:function(e){return t=>new Promise((a,o)=>{a=nh(a);let{trans:i,values:s,limit:l,query:c}=t,u=l===1/0?void 0:l,{index:d,range:p}=c,f=i.objectStore(n),h=d.isPrimaryKey?f:f.index(d.name),m=r(p);if(0===l)return a({result:[]});if(e){let e=s?h.getAll(m,u):h.getAllKeys(m,u);e.onsuccess=e=>a({result:e.target.result}),e.onerror=t_(o)}else{let e=0,n=!s&&"openKeyCursor"in h?h.openKeyCursor(m):h.openCursor(m),t=[];n.onsuccess=r=>{let o=n.result;return o?(t.push(s?o.value:o.primaryKey),++e===l?a({result:t}):void o.continue()):a({result:t})},n.onerror=t_(o)}})}(o),openCursor:function({trans:e,values:t,query:a,reverse:o,unique:i}){return new Promise((s,l)=>{s=nh(s);let{index:c,range:u}=a,d=e.objectStore(n),p=c.isPrimaryKey?d:d.index(c.name),f=o?i?"prevunique":"prev":i?"nextunique":"next",h=!t&&"openKeyCursor"in p?p.openKeyCursor(r(u),f):p.openCursor(r(u),f);h.onerror=t_(l),h.onsuccess=nh(n=>{let t=h.result;if(!t)return void s(null);t.___id=++tE,t.done=!1;let r=t.continue.bind(t),a=t.continuePrimaryKey;a&&(a=a.bind(t));let o=t.advance.bind(t),i=()=>{throw Error("Cursor not stopped")};t.trans=e,t.stop=t.continue=t.continuePrimaryKey=t.advance=()=>{throw Error("Cursor not started")},t.fail=nh(l),t.next=function(){let e=1;return this.start(()=>e--?this.continue():this.stop()).then(()=>this)},t.start=e=>{let n=new Promise((e,n)=>{e=nh(e),h.onerror=t_(n),t.fail=n,t.stop=n=>{t.stop=t.continue=t.continuePrimaryKey=t.advance=i,e(n)}}),s=()=>{if(h.result)try{e()}catch(e){t.fail(e)}else t.done=!0,t.start=()=>{throw Error("Cursor behind last entry")},t.stop()};return h.onsuccess=nh(e=>{h.onsuccess=s,s()}),t.continue=r,t.continuePrimaryKey=a,t.advance=o,s(),n},s(t)},l)})},count({query:e,trans:t}){let{index:a,range:o}=e;return new Promise((e,i)=>{let s=t.objectStore(n),l=a.isPrimaryKey?s:s.index(a.name),c=r(o),u=c?l.count(c):l.count();u.onsuccess=nh(n=>e(n.target.result)),u.onerror=t_(i)})}}})(e)),s={};return i.forEach(e=>s[e.name]=e),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!s[e])throw Error(`Table '${e}' not found`);return s[e]},MIN_KEY:-1/0,MAX_KEY:t$(n),schema:a}}function tS({_novip:e},n){let t=n.db,r=function(e,n,{IDBKeyRange:t,indexedDB:r},a){return{dbcore:function(e,n){return n.reduce((e,{create:n})=>({...e,...n(e)}),e)}(tD(n,t,a),e.dbcore)}}(e._middlewares,t,e._deps,n);e.core=r.dbcore,e.tables.forEach(n=>{let t=n.name;e.core.schema.tables.some(e=>e.name===t)&&(n.core=e.core.table(t),e[t]instanceof e.Table&&(e[t].core=n.core))})}function tz({_novip:e},n,t,r){t.forEach(t=>{let a=r[t];n.forEach(n=>{let r=V(n,t);(!r||"value"in r&&void 0===r.value)&&(n===e.Transaction.prototype||n instanceof e.Transaction?j(n,t,{get(){return this.table(t)},set(e){L(this,t,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):n[t]=new e.Table(t,a))})})}function tB({_novip:e},n){n.forEach(n=>{for(let t in n)n[t]instanceof e.Table&&delete n[t]})}function tM(e,n){return e._cfg.version-n._cfg.version}function tT(e,n,t,r){let a=e._dbSchema,o=e._createTransaction("readwrite",e._storeNames,a);o.create(t),o._completion.catch(r);let i=o._reject.bind(o),s=e6.transless||e6;nC(()=>{e6.trans=o,e6.transless=s,0===n?(O(a).forEach(e=>{tN(t,e,a[e].primKey,a[e].indexes)}),tS(e,t),ne.follow(()=>e.on.populate.fire(o)).catch(i)):(function({_novip:e},n,t,r){let a=[],o=e._versions,i=e._dbSchema=tI(e,e.idbdb,r),s=!1;function l(){return a.length?ne.resolve(a.shift()(t.idbtrans)).then(l):ne.resolve()}return o.filter(e=>e._cfg.version>=n).forEach(o=>{a.push(()=>{let a=i,l=o._cfg.dbschema;tF(e,a,r),tF(e,l,r),i=e._dbSchema=l;let c=tO(a,l);c.add.forEach(e=>{tN(r,e[0],e[1].primKey,e[1].indexes)}),c.change.forEach(e=>{if(e.recreate)throw new ez.Upgrade("Not yet support for changing primary key");{let n=r.objectStore(e.name);e.add.forEach(e=>tP(n,e)),e.change.forEach(e=>{n.deleteIndex(e.name),tP(n,e)}),e.del.forEach(e=>n.deleteIndex(e))}});let u=o._cfg.contentUpgrade;if(u&&o._cfg.version>n){let n;tS(e,r),t._memoizedTables={},s=!0;let o=ee(l);c.del.forEach(e=>{o[e]=a[e]}),tB(e,[e.Transaction.prototype]),tz(e,[e.Transaction.prototype],O(o),o),t.schema=o;let i=e_(u);i&&n$();let d=ne.follow(()=>{if((n=u(t))&&i){var e=nw.bind(null,null);n.then(e,e)}});return n&&"function"==typeof n.then?ne.resolve(n):d.then(()=>n)}}),a.push(n=>{s&&nV||function(e,n){[].slice.call(n.db.objectStoreNames).forEach(t=>null==e[t]&&n.db.deleteObjectStore(t))}(o._cfg.dbschema,n),tB(e,[e.Transaction.prototype]),tz(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),t.schema=e._dbSchema})}),l().then(()=>{var e,n;n=r,O(e=i).forEach(t=>{n.db.objectStoreNames.contains(t)||tN(n,t,e[t].primKey,e[t].indexes)})})})(e,n,o,t).catch(i)})}function tO(e,n){let t,r={del:[],add:[],change:[]};for(t in e)n[t]||r.del.push(t);for(t in n){let a=e[t],o=n[t];if(a){let e={name:t,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(a.primKey.keyPath||"")==""+(o.primKey.keyPath||"")&&(a.primKey.auto===o.primKey.auto||nG)){let n,t=a.idxByName,i=o.idxByName;for(n in t)i[n]||e.del.push(n);for(n in i){let r=t[n],a=i[n];r?r.src!==a.src&&e.change.push(a):e.add.push(a)}(e.del.length>0||e.add.length>0||e.change.length>0)&&r.change.push(e)}else e.recreate=!0,r.change.push(e)}else r.add.push([t,o])}return r}function tN(e,n,t,r){let a=e.db.createObjectStore(n,t.keyPath?{keyPath:t.keyPath,autoIncrement:t.auto}:{autoIncrement:t.auto});return r.forEach(e=>tP(a,e)),a}function tP(e,n){e.createIndex(n.name,n.keyPath,{unique:n.unique,multiEntry:n.multi})}function tI(e,n,t){let r={};return W(n.objectStoreNames,0).forEach(e=>{let n=t.objectStore(e),a=n.keyPath,o=tb(tv(a),a||"",!1,!1,!!n.autoIncrement,a&&"string"!=typeof a,!0),i=[];for(let e=0;e<n.indexNames.length;++e){let t=n.index(n.indexNames[e]);a=t.keyPath;var s=tb(t.name,a,!!t.unique,!!t.multiEntry,!1,a&&"string"!=typeof a,!1);i.push(s)}r[e]=tC(e,o,i)}),r}function tF({_novip:e},n,t){let r=t.db.objectStoreNames;for(let a=0;a<r.length;++a){let o=r[a],i=t.objectStore(o);e._hasGetAll="getAll"in i;for(let e=0;e<i.indexNames.length;++e){let t=i.indexNames[e],r=i.index(t).keyPath,a="string"==typeof r?r:"["+W(r).join("+")+"]";if(n[o]){let e=n[o].idxByName[a];e&&(e.name=t,delete n[o].idxByName[a],n[o].idxByName[t]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&T.WorkerGlobalScope&&T instanceof T.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class tR{_parseStoresSpec(e,n){O(e).forEach(t=>{if(null!==e[t]){var r=e[t].split(",").map((e,n)=>{let t=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(t)?t.match(/^\[(.*)\]$/)[1].split("+"):t;return tb(t,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),N(r),0===n)}),a=r.shift();if(a.multi)throw new ez.Schema("Primary key cannot be multi-valued");r.forEach(e=>{if(e.auto)throw new ez.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new ez.Schema("Index must have a name and cannot be an empty string")}),n[t]=tC(t,a,r)}})}stores(e){let n=this.db;this._cfg.storesSource=this._cfg.storesSource?P(this._cfg.storesSource,e):e;let t=n._versions,r={},a={};return t.forEach(e=>{P(r,e._cfg.storesSource),a=e._cfg.dbschema={},e._parseStoresSpec(r,a)}),n._dbSchema=a,tB(n,[n._allTables,n,n.Transaction.prototype]),tz(n,[n._allTables,n,n.Transaction.prototype,this._cfg.tables],O(a),a),n._storeNames=O(a),this}upgrade(e){return this._cfg.contentUpgrade=eL(this._cfg.contentUpgrade||eT,e),this}}function tH(e,n){let t=e._dbNamesDB;return t||(t=e._dbNamesDB=new t9(nK,{addons:[],indexedDB:e,IDBKeyRange:n})).version(1).stores({dbnames:"name"}),t.table("dbnames")}function tL(e){return e&&"function"==typeof e.databases}function tj(e){return nC(function(){return e6.letThrough=!0,e()})}function tq(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(n){var t=function(){return indexedDB.databases().finally(n)};e=setInterval(t,100),t()}).finally(function(){return clearInterval(e)}):Promise.resolve()}function tG(e){let n=e._state,{indexedDB:t}=e._deps;if(n.isBeingOpened||e.idbdb)return n.dbReadyPromise.then(()=>n.dbOpenError?nP(n.dbOpenError):e);eh&&(n.openCanceller._stackHolder=ey()),n.isBeingOpened=!0,n.dbOpenError=null,n.openComplete=!1;let r=n.openCanceller;function a(){if(n.openCanceller!==r)throw new ez.DatabaseClosed("db.open() was cancelled")}let o=n.dbReadyResolve,i=null,s=!1,l=()=>new ne((r,o)=>{if(a(),!t)throw new ez.MissingAPI;let l=e.name,c=n.autoSchema?t.open(l):t.open(l,Math.round(10*e.verno));if(!c)throw new ez.MissingAPI;c.onerror=t_(o),c.onblocked=nh(e._fireOnBlocked),c.onupgradeneeded=nh(r=>{if(i=c.transaction,n.autoSchema&&!e._options.allowEmptyDB){c.onerror=th,i.abort(),c.result.close();let e=t.deleteDatabase(l);e.onsuccess=e.onerror=nh(()=>{o(new ez.NoSuchDatabase(`Database ${l} doesnt exist`))})}else{i.onerror=t_(o);var a=r.oldVersion>0x4000000000000000?0:r.oldVersion;s=a<1,e._novip.idbdb=c.result,tT(e,a/10,i,o)}},o),c.onsuccess=nh(()=>{var t;i=null;let a=e._novip.idbdb=c.result,o=W(a.objectStoreNames);if(o.length>0)try{let r=a.transaction(1===(t=o).length?t[0]:t,"readonly");n.autoSchema?function({_novip:e},n,t){e.verno=n.version/10;let r=e._dbSchema=tI(0,n,t);e._storeNames=W(n.objectStoreNames,0),tz(e,[e._allTables],O(r),r)}(e,a,r):(tF(e,e._dbSchema,r),function(e,n){let t=tO(tI(0,e.idbdb,n),e._dbSchema);return!(t.add.length||t.change.some(e=>e.add.length||e.change.length))}(e,r)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),tS(e,r)}catch(e){}nq.push(e),a.onversionchange=nh(t=>{n.vcFired=!0,e.on("versionchange").fire(t)}),a.onclose=nh(n=>{e.on("close").fire(n)}),s&&function({indexedDB:e,IDBKeyRange:n},t){tL(e)||t===nK||tH(e,n).put({name:t}).catch(eT)}(e._deps,l),r()},o)}).catch(e=>e&&"UnknownError"===e.name&&n.PR1398_maxLoop>0?(n.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),l()):ne.reject(e));return ne.race([r,("undefined"==typeof navigator?ne.resolve():tq()).then(l)]).then(()=>(a(),n.onReadyBeingFired=[],ne.resolve(tj(()=>e.on.ready.fire(e.vip))).then(function t(){if(n.onReadyBeingFired.length>0){let r=n.onReadyBeingFired.reduce(eL,eT);return n.onReadyBeingFired=[],ne.resolve(tj(()=>r(e.vip))).then(t)}}))).finally(()=>{n.onReadyBeingFired=null,n.isBeingOpened=!1}).then(()=>e).catch(t=>{n.dbOpenError=t;try{i&&i.abort()}catch(e){}return r===n.openCanceller&&e._close(),nP(t)}).finally(()=>{n.openComplete=!0,o()})}function tV(e){var n=n=>e.next(n),t=a(n),r=a(n=>e.throw(n));function a(e){return n=>{var a=e(n),o=a.value;return a.done?o:o&&"function"==typeof o.then?o.then(t,r):N(o)?Promise.all(o).then(t,r):t(o)}}return a(n)()}function tU(e,n,t){var r=arguments.length;if(r<2)throw new ez.InvalidArgument("Too few arguments");for(var a=Array(r-1);--r;)a[r-1]=arguments[r];return t=a.pop(),[e,et(a),t]}function tW(e,n,t,r,a){return ne.resolve().then(()=>{let o,i=e6.transless||e6,s=e._createTransaction(n,t,e._dbSchema,r),l={trans:s,transless:i};if(r)s.idbtrans=r.idbtrans;else try{s.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===eD.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then(()=>tW(e,n,t,null,a))):nP(r)}let c=e_(a);c&&n$();let u=ne.follow(()=>{if(o=a.call(s,s))if(c){var e=nw.bind(null,null);o.then(e,e)}else"function"==typeof o.next&&"function"==typeof o.throw&&(o=tV(o))},l);return(o&&"function"==typeof o.then?ne.resolve(o).then(e=>s.active?e:nP(new ez.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))):u.then(()=>o)).then(e=>(r&&s._resolve(),s._completion.then(()=>e))).catch(e=>(s._reject(e),nP(e)))})}function tK(e,n,t){let r=N(e)?e.slice():[e];for(let e=0;e<t;++e)r.push(n);return r}let tZ={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(n){let t=e.table(n),{schema:r}=t,a={},o=[];function i(e,n,t){let r=tx(e),s=a[r]=a[r]||[],l=null==e?0:"string"==typeof e?1:e.length,c=n>0,u={...t,isVirtual:c,keyTail:n,keyLength:l,extractKey:tw(e),unique:!c&&t.unique};return s.push(u),u.isPrimaryKey||o.push(u),l>1&&i(2===l?e[0]:e.slice(0,l-1),n+1,t),s.sort((e,n)=>e.keyTail-n.keyTail),u}let s=i(r.primaryKey.keyPath,0,r.primaryKey);for(let e of(a[":id"]=[s],r.indexes))i(e.keyPath,0,e);function l(n){var t,r;let a=n.query.index;return a.isVirtual?{...n,query:{index:a,range:(t=n.query.range,r=a.keyTail,{type:1===t.type?2:t.type,lower:tK(t.lower,t.lowerOpen?e.MAX_KEY:e.MIN_KEY,r),lowerOpen:!0,upper:tK(t.upper,t.upperOpen?e.MIN_KEY:e.MAX_KEY,r),upperOpen:!0})}}:n}return{...t,schema:{...r,primaryKey:s,indexes:o,getIndexByKeyPath:function(e){let n=a[tx(e)];return n&&n[0]}},count:e=>t.count(l(e)),query:e=>t.query(l(e)),openCursor(n){let{keyTail:r,isVirtual:a,keyLength:o}=n.query.index;return a?t.openCursor(l(n)).then(t=>t&&function(t){return Object.create(t,{continue:{value:function(a){null!=a?t.continue(tK(a,n.reverse?e.MAX_KEY:e.MIN_KEY,r)):n.unique?t.continue(t.key.slice(0,o).concat(n.reverse?e.MIN_KEY:e.MAX_KEY,r)):t.continue()}},continuePrimaryKey:{value(n,a){t.continuePrimaryKey(tK(n,e.MAX_KEY,r),a)}},primaryKey:{get:()=>t.primaryKey},key:{get(){let e=t.key;return 1===o?e[0]:e.slice(0,o)}},value:{get:()=>t.value}})}(t)):t.openCursor(n)}}}}}};function tY(e,n,t,r){return t=t||{},r=r||"",O(e).forEach(a=>{if(R(n,a)){var o=e[a],i=n[a];if("object"==typeof o&&"object"==typeof i&&o&&i){let e=ec(o);e!==ec(i)?t[r+a]=n[a]:"Object"===e?tY(o,i,t,r+a+"."):o!==i&&(t[r+a]=n[a])}else o!==i&&(t[r+a]=n[a])}else t[r+a]=void 0}),O(n).forEach(a=>{R(e,a)||(t[r+a]=n[a])}),t}let tJ={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(n){let t=e.table(n),{primaryKey:r}=t.schema;return{...t,mutate(e){let a=e6.trans,{deleting:o,creating:i,updating:s}=a.table(n).hook;switch(e.type){case"add":if(i.fire===eT)break;return a._promise("readwrite",()=>l(e),!0);case"put":if(i.fire===eT&&s.fire===eT)break;return a._promise("readwrite",()=>l(e),!0);case"delete":if(o.fire===eT)break;return a._promise("readwrite",()=>l(e),!0);case"deleteRange":if(o.fire===eT)break;return a._promise("readwrite",()=>(function(e){return c(e.trans,e.range,1e4)})(e),!0)}return t.mutate(e);function l(e){let n=e6.trans,a=e.keys||function(e,n){return"delete"===n.type?n.keys:n.keys||n.values.map(e.extractKey)}(r,e);if(!a)throw Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:a}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),(function(e,n,t){return"add"===n.type?Promise.resolve([]):e.getMany({trans:n.trans,keys:t,cache:"immutable"})})(t,e,a).then(l=>{let c=a.map((t,a)=>{let c=l[a],u={onerror:null,onsuccess:null};if("delete"===e.type)o.fire.call(u,t,c,n);else if("add"===e.type||void 0===c){let o=i.fire.call(u,t,e.values[a],n);null==t&&null!=o&&(t=o,e.keys[a]=t,r.outbound||Q(e.values[a],r.keyPath,t))}else{let r=tY(c,e.values[a]),o=s.fire.call(u,r,t,c,n);if(o){let n=e.values[a];Object.keys(o).forEach(e=>{R(n,e)?n[e]=o[e]:Q(n,e,o[e])})}}return u});return t.mutate(e).then(({failures:n,results:t,numFailures:r,lastResult:o})=>{for(let r=0;r<a.length;++r){let o=t?t[r]:a[r],i=c[r];null==o?i.onerror&&i.onerror(n[r]):i.onsuccess&&i.onsuccess("put"===e.type&&l[r]?e.values[r]:o)}return{failures:n,results:t,numFailures:r,lastResult:o}}).catch(e=>(c.forEach(n=>n.onerror&&n.onerror(e)),Promise.reject(e)))})}function c(e,n,a){return t.query({trans:e,values:!1,query:{index:r,range:n},limit:a}).then(({result:t})=>l({type:"delete",keys:t,trans:e}).then(r=>r.numFailures>0?Promise.reject(r.failures[0]):t.length<a?{failures:[],numFailures:0,lastResult:void 0}:c(e,{...n,lower:t[t.length-1],lowerOpen:!0},a)))}}}}})};function tX(e,n,t){try{if(!n||n.keys.length<e.length)return null;let r=[];for(let a=0,o=0;a<n.keys.length&&o<e.length;++a)0===te(n.keys[a],e[o])&&(r.push(t?ei(n.values[a]):n.values[a]),++o);return r.length===e.length?r:null}catch(e){return null}}let tQ={stack:"dbcore",level:-1,create:e=>({table:n=>{let t=e.table(n);return{...t,getMany:e=>{if(!e.cache)return t.getMany(e);let n=tX(e.keys,e.trans._cache,"clone"===e.cache);return n?ne.resolve(n):t.getMany(e).then(n=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?ei(n):n},n))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),t.mutate(e))}}})};function t0(e){return!("from"in e)}let t1=function(e,n){if(!this){let n=new t1;return e&&"d"in e&&P(n,e),n}P(this,arguments.length?{d:1,from:e,to:arguments.length>1?n:e}:{d:0})};function t2(e,n,t){let r=te(n,t);if(isNaN(r))return;if(r>0)throw RangeError();if(t0(e))return P(e,{from:n,to:t,d:1});let a=e.l,o=e.r;if(0>te(t,e.from))return a?t2(a,n,t):e.l={from:n,to:t,d:1,l:null,r:null},t6(e);if(te(n,e.to)>0)return o?t2(o,n,t):e.r={from:n,to:t,d:1,l:null,r:null},t6(e);0>te(n,e.from)&&(e.from=n,e.l=null,e.d=o?o.d+1:1),te(t,e.to)>0&&(e.to=t,e.r=null,e.d=e.l?e.l.d+1:1);let i=!e.r;a&&!e.l&&t3(e,a),o&&i&&t3(e,o)}function t3(e,n){t0(n)||function e(n,{from:t,to:r,l:a,r:o}){t2(n,t,r),a&&e(n,a),o&&e(n,o)}(e,n)}function t4(e,n){let t=t5(n),r=t.next();if(r.done)return!1;let a=r.value,o=t5(e),i=o.next(a.from),s=i.value;for(;!r.done&&!i.done;){if(0>=te(s.from,a.to)&&te(s.to,a.from)>=0)return!0;0>te(a.from,s.from)?a=(r=t.next(s.from)).value:s=(i=o.next(a.from)).value}return!1}function t5(e){let n=t0(e)?null:{s:0,n:e};return{next(e){let t=arguments.length>0;for(;n;)switch(n.s){case 0:if(n.s=1,t)for(;n.n.l&&0>te(e,n.n.from);)n={up:n,n:n.n.l,s:1};else for(;n.n.l;)n={up:n,n:n.n.l,s:1};case 1:if(n.s=2,!t||0>=te(e,n.n.to))return{value:n.n,done:!1};case 2:if(n.n.r){n.s=3,n={up:n,n:n.n.r,s:0};continue}case 3:n=n.up}return{done:!0}}}}function t6(e){var n,t;let r=((null==(n=e.r)?void 0:n.d)||0)-((null==(t=e.l)?void 0:t.d)||0),a=r>1?"r":r<-1?"l":"";if(a){let n="r"===a?"l":"r",t={...e},r=e[a];e.from=r.from,e.to=r.to,e[a]=r[a],t[a]=r[n],e[n]=t,t.d=t8(t)}e.d=t8(e)}function t8({r:e,l:n}){return(e?n?Math.max(e.d,n.d):e.d:n?n.d:0)+1}H(t1.prototype,{add(e){return t3(this,e),this},addKey(e){return t2(this,e,e),this},addKeys(e){return e.forEach(e=>t2(this,e,e)),this},[eu](){return t5(this)}});let t7={stack:"dbcore",level:0,create:e=>{let n=e.schema.name,t=new t1(e.MIN_KEY,e.MAX_KEY);return{...e,table:r=>{let a=e.table(r),{schema:o}=a,{primaryKey:i}=o,{extractKey:s,outbound:l}=i,c={...a,mutate:e=>{let i=e.trans,s=i.mutatedParts||(i.mutatedParts={}),l=e=>{let t=`idb://${n}/${r}/${e}`;return s[t]||(s[t]=new t1)},c=l(""),u=l(":dels"),{type:d}=e,[p,f]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],h=e.trans._cache;return a.mutate(e).then(e=>{if(N(p)){"delete"!==d&&(p=e.results),c.addKeys(p);let n=tX(p,h);n||"add"===d||u.addKeys(p),(n||f)&&function(e,n,t,r){function a(n){let a=e(n.name||"");function o(e){return null!=e?n.extractKey(e):null}let i=e=>n.multiEntry&&N(e)?e.forEach(e=>a.addKey(e)):a.addKey(e);(t||r).forEach((e,n)=>{let a=t&&o(t[n]),s=r&&o(r[n]);0!==te(a,s)&&(null!=a&&i(a),null!=s&&i(s))})}n.indexes.forEach(a)}(l,o,n,f)}else if(p){let e={from:p.lower,to:p.upper};u.add(e),c.add(e)}else c.add(t),u.add(t),o.indexes.forEach(e=>l(e.name).add(t));return e})}},u=({query:{index:n,range:t}})=>{var r,a;return[n,new t1(null!=(r=t.lower)?r:e.MIN_KEY,null!=(a=t.upper)?a:e.MAX_KEY)]},d={get:e=>[i,new t1(e.key)],getMany:e=>[i,(new t1).addKeys(e.keys)],count:u,query:u,openCursor:u};return O(d).forEach(e=>{c[e]=function(o){let{subscr:i}=e6;if(i){let c=e=>{let t=`idb://${n}/${r}/${e}`;return i[t]||(i[t]=new t1)},u=c(""),p=c(":dels"),[f,h]=d[e](o);if(c(f.name||"").add(h),!f.isPrimaryKey){if("count"!==e){let n="query"===e&&l&&o.values&&a.query({...o,values:!1});return a[e].apply(this,arguments).then(t=>{if("query"===e){if(l&&o.values)return n.then(({result:e})=>(u.addKeys(e),t));let e=o.values?t.result.map(s):t.result;o.values?u.addKeys(e):p.addKeys(e)}else if("openCursor"===e){let e=t,n=o.values;return e&&Object.create(e,{key:{get:()=>(p.addKey(e.primaryKey),e.key)},primaryKey:{get(){let n=e.primaryKey;return p.addKey(n),n}},value:{get:()=>(n&&u.addKey(e.primaryKey),e.value)}})}return t})}p.add(t)}}return a[e].apply(this,arguments)}}),c}}}};class t9{constructor(e,n){var t;this._middlewares={},this.verno=0;const r=t9.dependencies;this._options=n={addons:t9.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange,...n},this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};const{addons:a}=n;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const o={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:eT,dbReadyPromise:null,cancelOpen:eT,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};o.dbReadyPromise=new ne(e=>{o.dbReadyResolve=e}),o.openCanceller=new ne((e,n)=>{o.cancelOpen=n}),this._state=o,this.name=e,this.on=n1(this,"populate","blocked","versionchange","close",{ready:[eL,eT]}),this.on.ready.subscribe=K(this.on.ready.subscribe,e=>(n,t)=>{t9.vip(()=>{let r=this._state;if(r.openComplete)r.dbOpenError||ne.resolve().then(n),t&&e(n);else if(r.onReadyBeingFired)r.onReadyBeingFired.push(n),t&&e(n);else{e(n);let r=this;t||e(function e(){r.on.ready.unsubscribe(n),r.on.ready.unsubscribe(e)})}})}),this.Collection=(t=this,n2(tr.prototype,function(e,n){this.db=t;let r=nX,a=null;if(n)try{r=n()}catch(e){a=e}let o=e._ctx,i=o.table,s=i.hook.reading.fire;this._ctx={table:i,index:o.index,isPrimKey:!o.index||i.schema.primKey.keyPath&&o.index===i.schema.primKey.name,range:r,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:a,or:o.or,valueMapper:s!==eO?s:null}})),this.Table=function(e){return n2(n0.prototype,function(n,t,r){this.db=e,this._tx=r,this.name=n,this.schema=t,this.hook=e._allTables[n]?e._allTables[n].hook:n1(null,{creating:[eI,eT],reading:[eN,eO],updating:[eR,eT],deleting:[eF,eT]})})}(this),this.Transaction=function(e){return n2(ty.prototype,function(n,t,r,a,o){this.db=e,this.mode=n,this.storeNames=t,this.schema=r,this.chromeTransactionDurability=a,this.idbtrans=null,this.on=n1(this,"complete","error","abort"),this.parent=o||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new ne((e,n)=>{this._resolve=e,this._reject=n}),this._completion.then(()=>{this.active=!1,this.on.complete.fire()},e=>{var n=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):n&&this.idbtrans&&this.idbtrans.abort(),nP(e)})})}(this),this.Version=function(e){return n2(tR.prototype,function(n){this.db=e,this._cfg={version:n,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}(this),this.WhereClause=function(e){return n2(tf.prototype,function(n,t,r){this.db=e,this._ctx={table:n,index:":id"===t?null:t,or:r};let a=e._deps.indexedDB;if(!a)throw new ez.MissingAPI;this._cmp=this._ascending=a.cmp.bind(a),this._descending=(e,n)=>a.cmp(n,e),this._max=(e,n)=>a.cmp(e,n)>0?e:n,this._min=(e,n)=>0>a.cmp(e,n)?e:n,this._IDBKeyRange=e._deps.IDBKeyRange})}(this),this.on("versionchange",e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()}),this.on("blocked",e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)}),this._maxKey=t$(n.IDBKeyRange),this._createTransaction=(e,n,t,r)=>new this.Transaction(e,n,t,this._options.chromeTransactionDurability,r),this._fireOnBlocked=e=>{this.on("blocked").fire(e),nq.filter(e=>e.name===this.name&&e!==this&&!e._state.vcFired).map(n=>n.on("versionchange").fire(e))},this.use(tZ),this.use(tJ),this.use(t7),this.use(tQ),this.vip=Object.create(this,{_vip:{value:!0}}),a.forEach(e=>e(this))}version(e){if(isNaN(e)||e<.1)throw new ez.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new ez.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);let n=this._versions;var t=n.filter(n=>n._cfg.version===e)[0];return t||(t=new this.Version(e),n.push(t),n.sort(tM),t.stores({}),this._state.autoSchema=!1,t)}_whenReady(e){return this.idbdb&&(this._state.openComplete||e6.letThrough||this._vip)?e():new ne((e,n)=>{if(this._state.openComplete)return n(new ez.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void n(new ez.DatabaseClosed);this.open().catch(eT)}this._state.dbReadyPromise.then(e,n)}).then(e)}use({stack:e,create:n,level:t,name:r}){r&&this.unuse({stack:e,name:r});let a=this._middlewares[e]||(this._middlewares[e]=[]);return a.push({stack:e,create:n,level:null==t?10:t,name:r}),a.sort((e,n)=>e.level-n.level),this}unuse({stack:e,name:n,create:t}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter(e=>t?e.create!==t:!!n&&e.name!==n)),this}open(){return tG(this)}_close(){let e=this._state,n=nq.indexOf(this);if(n>=0&&nq.splice(n,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new ne(n=>{e.dbReadyResolve=n}),e.openCanceller=new ne((n,t)=>{e.cancelOpen=t})}close(){this._close();let e=this._state;this._options.autoOpen=!1,e.dbOpenError=new ez.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){let e=arguments.length>0,n=this._state;return new ne((t,r)=>{let a=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=nh(()=>{!function({indexedDB:e,IDBKeyRange:n},t){tL(e)||t===nK||tH(e,n).delete(t).catch(eT)}(this._deps,this.name),t()}),e.onerror=t_(r),e.onblocked=this._fireOnBlocked};if(e)throw new ez.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(a):a()})}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){let e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return O(this._allTables).map(e=>this._allTables[e])}transaction(){let e=tU.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,n,t){let r,a,o=e6.trans;o&&o.db===this&&-1===e.indexOf("!")||(o=null);let i=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(a=n.map(e=>{var n=e instanceof this.Table?e.name:e;if("string"!=typeof n)throw TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return n}),"r"==e||e===nZ)r=nZ;else{if("rw"!=e&&e!=nY)throw new ez.InvalidArgument("Invalid transaction mode: "+e);r=nY}if(o){if(o.mode===nZ&&r===nY){if(!i)throw new ez.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&a.forEach(e=>{if(o&&-1===o.storeNames.indexOf(e)){if(!i)throw new ez.SubTransaction("Table "+e+" not included in parent transaction.");o=null}}),i&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,(n,t)=>{t(e)}):nP(e)}let s=tW.bind(null,this,r,a,o,t);return o?o._promise(r,s,"lock"):e6.trans?nz(e6.transless,()=>this._whenReady(s)):this._whenReady(s)}table(e){if(!R(this._allTables,e))throw new ez.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}let re="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class rn{constructor(e){this._subscribe=e}subscribe(e,n,t){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:n,complete:t})}[re](){return this}}function rt(e,n){return O(n).forEach(t=>{t3(e[t]||(e[t]=new t1),n[t])}),e}function rr(e){let n,t=!1,r=new rn(r=>{let a=e_(e),o=!1,i={},s={},l={get closed(){return o},unsubscribe:()=>{o=!0,tA.storagemutated.unsubscribe(p)}};r.start&&r.start(l);let c=!1,u=!1;function d(){return O(s).some(e=>i[e]&&t4(i[e],s[e]))}let p=e=>{rt(i,e),d()&&f()},f=()=>{if(c||o)return;i={};let h={},m=function(n){a&&n$();let t=()=>nC(e,{subscr:n,trans:null}),r=e6.trans?nz(e6.transless,t):t();return a&&r.then(nw,nw),r}(h);u||(tA(tm,p),u=!0),c=!0,Promise.resolve(m).then(e=>{t=!0,n=e,c=!1,o||(d()?f():(i={},s=h,r.next&&r.next(e)))},e=>{c=!1,t=!1,r.error&&r.error(e),l.unsubscribe()})};return f(),l});return r.hasValue=()=>t,r.getValue=()=>n,r}try{r={indexedDB:T.indexedDB||T.mozIndexedDB||T.webkitIndexedDB||T.msIndexedDB,IDBKeyRange:T.IDBKeyRange||T.webkitIDBKeyRange}}catch(e){r={indexedDB:null,IDBKeyRange:null}}let ra=t9;function ro(e){let n=ri;try{ri=!0,tA.storagemutated.fire(e)}finally{ri=n}}H(ra,{...eM,delete:e=>new ra(e,{addons:[]}).delete(),exists:e=>new ra(e,{addons:[]}).open().then(e=>(e.close(),!0)).catch("NoSuchDatabaseError",()=>!1),getDatabaseNames(e){try{return(function({indexedDB:e,IDBKeyRange:n}){return tL(e)?Promise.resolve(e.databases()).then(e=>e.map(e=>e.name).filter(e=>e!==nK)):tH(e,n).toCollection().primaryKeys()})(ra.dependencies).then(e)}catch(e){return nP(new ez.MissingAPI)}},defineClass:()=>function(e){P(this,e)},ignoreTransaction:e=>e6.trans?nz(e6.transless,e):e(),vip:tj,async:function(e){return function(){try{var n=tV(e.apply(this,arguments));return n&&"function"==typeof n.then?n:ne.resolve(n)}catch(e){return nP(e)}}},spawn:function(e,n,t){try{var r=tV(e.apply(t,n||[]));return r&&"function"==typeof r.then?r:ne.resolve(r)}catch(e){return nP(e)}},currentTransaction:{get:()=>e6.trans||null},waitFor:function(e,n){let t=ne.resolve("function"==typeof e?ra.ignoreTransaction(e):e).timeout(n||6e4);return e6.trans?e6.trans.waitFor(t):t},Promise:ne,debug:{get:()=>eh,set:e=>{em(e,"dexie"===e?()=>!0:nW)}},derive:q,extend:P,props:H,override:K,Events:n1,on:tA,liveQuery:rr,extendObservabilitySet:rt,getByKeyPath:X,setByKeyPath:Q,delByKeyPath:function(e,n){"string"==typeof n?Q(e,n,void 0):"length"in n&&[].map.call(n,function(n){Q(e,n,void 0)})},shallowClone:ee,deepClone:ei,getObjectDiff:tY,cmp:te,asap:Y,minKey:nH,addons:[],connections:nq,errnames:eD,dependencies:r,semVer:nF,version:nF.split(".").map(e=>parseInt(e)).reduce((e,n,t)=>e+n/Math.pow(10,2*t))}),ra.maxKey=t$(ra.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(tA(tm,e=>{if(!ri){let n;nG?(n=document.createEvent("CustomEvent")).initCustomEvent(tg,!0,!0,e):n=new CustomEvent(tg,{detail:e}),ri=!0,dispatchEvent(n),ri=!1}}),addEventListener(tg,({detail:e})=>{ri||ro(e)}));let ri=!1;if("undefined"!=typeof BroadcastChannel){let e=new BroadcastChannel(tg);"function"==typeof e.unref&&e.unref(),tA(tm,n=>{ri||e.postMessage(n)}),e.onmessage=e=>{e.data&&ro(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){tA(tm,e=>{try{ri||("undefined"!=typeof localStorage&&localStorage.setItem(tg,JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach(n=>n.postMessage({type:tg,changedParts:e})))}catch(e){}}),"undefined"!=typeof addEventListener&&addEventListener("storage",e=>{if(e.key===tg){let n=JSON.parse(e.newValue);n&&ro(n.changedParts)}});let e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",function({data:e}){e&&e.type===tg&&ro(e.changedParts)})}ne.rejectionMapper=function(e,n){if(!e||e instanceof ew||e instanceof TypeError||e instanceof SyntaxError||!e.name||!eB[e.name])return e;var t=new eB[e.name](n||e.message,e);return"stack"in e&&j(t,"stack",{get:function(){return this.inner.stack}}),t},em(eh,nW);var rs=t(70937),rl=t(467);function rc(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}class ru extends t9{constructor(){super("EsmOffline"),rc(this,"syncQueue",void 0),rc(this,"dynamicOfflineData",void 0),this.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),this.syncQueue=this.table("syncQueue"),this.dynamicOfflineData=this.table("dynamicOfflineData")}}function rd(){return new ru}let rp=new ru,rf={},r_=(0,rl.Zd)("offline-synchronization",{});function rh(){return r_}async function rm(){if(r_.getState().synchronization)return;let e=await rp.syncQueue.count(),n={},t=Object.entries(rf),r=t.length,a={},o=new AbortController,i=()=>{let e=r_.getState().synchronization;r_.setState({synchronization:{...e,pendingCount:e.pendingCount-1}})};try{r_.setState({synchronization:{totalCount:e,pendingCount:e,abortController:o}});for(let e=0;e<r&&t.length>0;e++)for(let e=t.length;e--;){let[r,s]=t[e],l=s.dependsOn.map(e=>n[e]);l.every(Boolean)&&(a[r]={},await Promise.all(l),n[r]=rg(s,a,o,i),t.splice(e,1))}await Promise.allSettled(Object.values(n))}finally{r_.setState({synchronization:void 0})}}async function rg({type:e,dependsOn:n,process:t},r,a,o){let i=[],s=[],l=await rA();await rp.syncQueue.where({type:e,userId:l}).each((e,n)=>{i.push([n.primaryKey,e.content,e.descriptor]),s.push(e.content)});for(let c=0;c<i.length;c++){let[u,d,{id:p,dependencies:f=[]}]=i[c];try{let o=await t(d,{abort:a,index:c,items:s,userId:l,dependencies:f.map(({id:e,type:t})=>n.includes(t)?r[t][e]:void 0)});void 0!==p&&(r[e][p]=o),await rp.syncQueue.delete(u)}catch(e){await rp.syncQueue.update(u,{lastError:{name:e?.name,message:e?.message??e?.toString()}})}finally{o()}}}async function rA(){let e=await (0,rs.xC)();return e?.uuid||"*"}async function ry(e,n,t,r){let a=r&&r.id;return void 0!==a&&await rp.syncQueue.where({type:n,userId:e}).filter(e=>e?.descriptor.id===a).delete().catch(t9.errnames.DatabaseClosed),await rp.syncQueue.add({type:n,content:t,userId:e,descriptor:r||{},createdOn:new Date}).catch(t9.errnames.DatabaseClosed,()=>-1)}async function rb(e,n,t){let r=await rA();return await ry(r,e,n,t)}async function rv(e,n){return(await rC(e,n)).map(e=>e.content)}async function rC(e,n){let t=n?{type:n,userId:e}:{userId:e};return await rp.syncQueue.where(t).toArray().catch(t9.errnames.DatabaseClosed,()=>[])}async function r$(e){let n=await rA();return await rv(n,e)}async function rw(e){let n=await rA();return await rC(n,e)}async function rk(e){return await rp.syncQueue.get(e).catch(t9.errnames.DatabaseClosed,()=>void 0)}function rE(e){return!!rf[e]?.options.onBeginEditSyncItem}async function rx(e){let n=await rk(e);if(!n)throw Error(`No sync item with the ID ${e} exists.`);let t=rf[n.type]?.options.onBeginEditSyncItem;if(!t)throw Error(`A sync item with the ID ${e} exists, but the associated handler (if one exists) doesn't support editing the item. You can avoid this error by either verifying that sync items of this type can be edited via the "canEditSynchronizationItemsOfType(type: string)" function or alternatively ensure that the synchronizaton handler for sync items of type "${n.type}" supports editing items.`);t(n)}async function rD(e){await rp.syncQueue.delete(e).catch(t9.errnames.DatabaseClosed)}function rS(e,n,t,r={}){rf[e]={type:e,dependsOn:n,process:t,options:r}}var rz=t(99780);let rB="OFFLINE+";function rM(){return rB+(0,rz.A)()}function rT(e){return e.startsWith(rB)}let rO={};function rN(){return Object.values(rO)}function rP(e){rO[e.id]&&console.warn(`[setupDynamicOfflineDataHandler] Another second handler with the ID "${e.id}" was registered. This handler will override the previous one. This could be unintended as the previous handler might run different flows than the newly registered one. If this is the case, ensure that you are setting up the handlers with different IDs.`),rO[e.id]=e}async function rI(e){let n=await rV();return await rF(n,e)}async function rF(e,n){let t=n?{type:n,users:e}:{users:e},r=new ru;return await r.dynamicOfflineData.where(t).toArray().catch(t9.errnames.DatabaseClosed,()=>[])}async function rR(e,n){let t=await rV();return await rH(t,e,n)}async function rH(e,n,t){let r=new ru,a=await r.dynamicOfflineData.get({type:n,identifier:t}).catch(t9.errnames.DatabaseClosed,()=>void 0);a?a.users.includes(e)||await r.dynamicOfflineData.update(a.id,{users:[...a.users,e]}).catch(t9.errnames.DatabaseClosed):await r.dynamicOfflineData.add({users:[e],type:n,identifier:t}).catch(t9.errnames.DatabaseClosed)}async function rL(e,n){let t=await rV();return await rj(t,e,n)}async function rj(e,n,t){let r=new ru,a=await r.dynamicOfflineData.get({type:n,identifier:t,users:e}).catch(t9.errnames.DatabaseClosed,()=>void 0);a&&(a.users.length>1?await r.dynamicOfflineData.update(a.id,{users:a.users.filter(n=>n!==e)}).catch(t9.errnames.DatabaseClosed):await r.dynamicOfflineData.delete(a.id).catch(t9.errnames.DatabaseClosed))}async function rq(e,n){let t=await rI(e);await Promise.all(t.map(async e=>rG(e.type,e.identifier,n)))}async function rG(e,n,t){await rR(e,n);let r=new ru,a=await rV(),o=await r.dynamicOfflineData.get({type:e,identifier:n}).catch(t9.errnames.DatabaseClosed,()=>void 0),i=rN().filter(n=>n.type===e);if(!o)return;let s=await Promise.all(i.map(async e=>{try{return e.sync(n,t),{id:e.id,error:void 0}}catch(t){let n=t.message?.toString()??t.toString();return{id:e.id,error:n}}})),l=s.filter(e=>!e.error).map(e=>e.id),c=s.filter(e=>e.error).map(e=>e.id),u=s.filter(e=>e.error).map(e=>({handlerId:e.id,message:e.error})),d={syncedOn:new Date,syncedBy:a,succeededHandlers:l,erroredHandlers:c,errors:u};o.id&&await r.dynamicOfflineData.update(o.id,{syncState:d}).catch(t9.errnames.DatabaseClosed)}async function rV(){let e=(await (0,rs.xC)()).uuid;if(!e)throw Error("Using the dynamic offline data API requires a logged in user.");return e}let rU=(0,rl.Zd)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function rW(){return rY(),rU}function rK(e,n){rY(),rP({type:"patient",displayName:n.displayName,id:e,isSynced:()=>Promise.resolve(!0),sync:(e,t)=>n.onOfflinePatientAdded({patientUuid:e,signal:t??new AbortController().signal})})}async function rZ(e){rY(),await rG("patient",e)}function rY(){console.warn("The offline patient API has been deprecated and will be removed in a future release. To prevent future crashes, the functions remain available for the moment, but any invocations should be migrated ASAP.")}},44408:function(e,n,t){"use strict";let r;t.d(n,{fq:()=>e7,JK:()=>V,if:()=>eV,tQ:()=>e1,YY:()=>u,E4:()=>e$,zD:()=>eh,g9:()=>W,uL:()=>A,kH:()=>eW,br:()=>b,Gz:()=>eE,M3:()=>eJ,qw:()=>N,Wq:()=>ek,rr:()=>g,oU:()=>e3,wV:()=>ne,d7:()=>ey,Jm:()=>eZ,xH:()=>e8,W3:()=>C,zq:()=>o,Ie:()=>Z,CH:()=>eS,ns:()=>U,vL:()=>eL,xl:()=>eG,Us:()=>J,UK:()=>e_,fS:()=>T,yJ:()=>et,u:()=>eD,to:()=>eT,iy:()=>eP,_9:()=>en,Bf:()=>eF,Tt:()=>Q,CX:()=>y,Ed:()=>ez,p6:()=>M,Wr:()=>eK,TA:()=>eU,F7:()=>G,qv:()=>eq,sc:()=>K,WQ:()=>eQ,Pj:()=>h,i_:()=>l,$B:()=>ew,oq:()=>eH,wJ:()=>e2,mQ:()=>m,wr:()=>e9,mw:()=>eO,jn:()=>B,Fx:()=>eA});var a=t(35400);let o=(0,a.createContext)({moduleName:"",featureName:""});var i=t(17744);function s(e,n,t,r){0!==e.button||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey||(e.preventDefault(),r?.(e),(0,i.oo)({to:n,templateParams:t})),0===e.button&&(e.ctrlKey||e.metaKey)&&r?.(e),0===e.button&&e.shiftKey&&r?.(e),1===e.button&&r?.(e)}function l({to:e,templateParams:n,onBeforeNavigate:t,children:r,...o}){return(0,a.useEffect)(()=>{o.href&&console.warn(`ConfigurableLink does not support the href prop. Use the 'to' prop instead. The provided href value is '${o.href}'`),o.onClick&&console.warn(`ConfigurableLink does not support the onClick prop. Use the 'onBeforeNavigate' prop instead. The 'to' prop of the offending link is ${e}`)},[]),a.createElement("a",{onClick:r=>s(r,e,n,t),href:(0,i.JG)(e,n),...o},r)}var c=t(96893);let u=({state:e,children:n,...t})=>{let{extension:r}=(0,a.useContext)(o),i=(0,a.useRef)(null),s=(0,a.useRef)(Promise.resolve()),l=(0,a.useCallback)(n=>{r?.extensionSlotName&&r.extensionSlotModuleName&&r.extensionSlotModuleName&&!i.current&&(0,c.wG)(n,r.extensionSlotName,r.extensionSlotModuleName,r.extensionId,void 0,e).then(e=>{i.current=e})},[]);return(0,a.useEffect)(()=>()=>{if(i&&i.current)switch(i.current.getStatus()){case"MOUNTING":i.current.mountPromise.then(()=>{i.current?.getStatus()==="MOUNTED"&&i.current.unmount()});break;case"MOUNTED":i.current.unmount();break;case"UPDATING":s.current&&s.current.then(()=>{i.current?.getStatus()==="MOUNTED"&&i.current.unmount()})}},[]),(0,a.useEffect)(()=>{i.current&&i.current.update&&"UNMOUNTING"!==i.current.getStatus()&&Promise.all([i.current.mountPromise,s.current]).then(()=>{i?.current?.getStatus()==="MOUNTED"&&i.current.update&&(s.current=i.current.update({...e}).catch(e=>{if(!(e instanceof Error)||!e.message.includes("minified message #32")||i.current?.getStatus()==="MOUNTED")throw e}))})},[e]),r?a.createElement("div",{ref:l,"data-extension-id":r?.extensionId,style:{position:"relative"},...t}):null};var d=t(467);function p(e,n){"function"==typeof n&&(n=n(e));let t={};for(let[r,a]of Object.entries(n)){let n=function(...n){e.setState(e=>a(e,...n))};t[r]=n}return t}let f=()=>e=>e;function h(e,n=f(),t){let[r,o]=(0,a.useState)(()=>n(e.getState()));(0,a.useEffect)(()=>(0,d.i7)(e,n,o),[e,n]);let i=(0,a.useMemo)(()=>t?p(e,t):{},[e,t]);return{...r,...i}}function m(e,n){return h(e,f(),n)}function g(e){return function(n){let[t,r]=(0,a.useState)(e.getState());(0,a.useEffect)(()=>e.subscribe(e=>r(e)),[]);let o=(0,a.useMemo)(()=>n?p(e,n):{},[n]);return{...t,...o}}}let A=e=>h((0,c.zF)(),n=>n.slots?.[e]);function y(e){let n=A(e);return n?.assignedExtensions??[]}function b(e){let{moduleName:n}=(0,a.useContext)(o);if(!n)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,a.useEffect)(()=>{(0,c.FY)(n,e)},[]),{extensions:y(e),extensionSlotName:e,extensionSlotModuleName:n}}function v(e){return e}function C({name:e,extensionSlotName:n,select:t=v,children:r,state:i,style:s,...l}){if(r&&i)throw Error("Both children and state have been provided. If children are provided, the state must be passed as a prop to the `Extension` component.");let c=e??n,d=(0,a.useRef)(null),{extensions:p,extensionSlotModuleName:f}=b(c),h=(0,a.useMemo)(()=>t(p),[t,p]),m=(0,a.useMemo)(()=>{if("function"==typeof r&&!a.isValidElement(r))return h.map(e=>r(e,i))},[r,h]);return a.createElement("div",{ref:d,"data-extension-slot-name":c,"data-extension-slot-module-name":f,style:{...s,position:"relative"},...l},c&&h?.map((e,n)=>a.createElement(o.Provider,{key:e.id,value:{moduleName:f,featureName:"",extension:{extensionId:e.id,extensionSlotName:c,extensionSlotModuleName:f}}},m?.[n]??("function"!=typeof r?r:null)??a.createElement(u,{state:i}))))}let $=(0,t(58644).y)()(()=>({}));(0,d.CE)("openmrs-app-context",$);let w={};function k(e,n=w){$.setState(t=>{if(e in t)throw Error(`Attempted to re-register namespace ${e} in the app context. Each namespace must be unregistered before the name can be registered again.`);return Object.assign({},t,{[e]:n===w?{}:n})})}function E(e){$.setState(n=>(e in n&&delete n[e],n))}function x(e,n=e=>e){let t=$.getState();return e in t?Object.freeze(Object.assign({},n?n(t[e]):t[e])):null}function D(e,n){$.setState(t=>(e in t||(t[e]={}),t[e]=n(t[e]),Object.assign({},t)))}function S(e,n){let t=x(e);return n(Object.freeze(Object.assign({},t))),$.subscribe(r=>{let a=e in r?r[e]:null;a!==t&&(t=a,n(Object.freeze(Object.assign({},a))))})}var z=t(90108);function B(e,n){let t=(0,a.useRef)(n??{}),r=(0,a.useRef)(n=>D(e,n));return(0,a.useEffect)(()=>(k(e,n??{}),()=>{E(e)}),[e]),(0,a.useEffect)(()=>{let r=n??{};(0,z.b)(t.current,r)||(D(e,()=>r),t.current=r)},[n]),r.current}function M({namespace:e,value:n}){return B(e,n),null}let T=({children:e,value:n,fallback:t})=>n?a.createElement(a.Fragment,null,e):t?a.createElement(a.Fragment,null,t):null;var O=t(70937);let N=({privilege:e,fallback:n,children:t})=>{let[r,o]=(0,a.useState)(null);return((0,a.useEffect)(()=>{let e=(0,O.HW)({includeAuthStatus:!1}).subscribe(o);return()=>e.unsubscribe()},[]),r&&(0,O.st)(e,r))?a.createElement(a.Fragment,null,t):n?a.createElement(a.Fragment,null,n):null};var P=t(25873),I=t(6309),F=t(58088),R=t(13624);function H(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}let L={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},j=new Map,q={errorRetryCount:3,fetcher:O.lo,focusThrottleInterval:18e5,revalidateIfStale:!0,revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshInterval:0,provider:()=>j};function G(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw Error("Invalid options");let n=Object.assign({},L,e),t={...q,...n.swrConfig};return function(e){var r,i;return H(i=class extends(r=a.Component){componentDidCatch(e,t){t&&t.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:t.componentStack})),n.throwErrorsToConsole&&setTimeout(()=>{throw e}),this.setState({caughtError:e,caughtErrorInfo:t})}render(){if(this.state.caughtError)return a.createElement("div",null,"An error has occurred. Please try reloading the page.");{let r=a.createElement(a.Suspense,{fallback:null},a.createElement(R.BE,{value:t},a.createElement(o.Provider,{value:this.state.config},n.disableTranslations?a.createElement(e,this.props):a.createElement(F.I18nextProvider,{i18n:window.i18next,defaultNS:this.state.config.extension?`${this.state.config.moduleName}___${this.state.config.extension.extensionSlotName}___${this.state.config.extension.extensionId}`:this.state.config.moduleName},a.createElement(e,this.props)))));return n.strictMode&&a.StrictMode?a.createElement(a.StrictMode,null,r):r}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:n.moduleName,featureName:n.featureName,extension:e._extensionContext}}}},"displayName",`OpenmrsReactComponent(${n.featureName})`),i}}function V(e,n){return(0,I.A)({React:a,ReactDOMClient:P,rootComponent:G(n)(e)})}function U(e,n){return()=>e().then(({default:e})=>V(e,n))}function W(e,n){return()=>Promise.resolve(V(e,n))}let K=U;function Z(){let e=(0,a.useRef)();return(!e.current||e.current.signal.aborted)&&(e.current=new AbortController),(0,a.useEffect)(()=>{let n=e.current;return()=>n?.abort()},[]),e.current}let Y=Z;function J(e,n=e=>e??{}){let[t,r]=(0,a.useState)();return(0,a.useEffect)(()=>{if(null==e||""===e.replace(" ",""))throw Error(`The namespace supplied to useAppContext must be a non-empty string, but was "${e}".`)},[e]),(0,a.useEffect)(()=>S(e,e=>{if(void 0!==e){let a=n?n(e):e??{};(0,z.b)(t,a)||r(a)}}),[]),t}var X=t(47427);function Q(e){let[n,t]=(0,a.useState)([]);return(0,a.useEffect)(()=>(0,c.zF)().subscribe(r=>{let a=r.slots[e]?.assignedExtensions.map(e=>e.id)??[];(0,X.A)(a,n)||t(a)}),[]),n}var ee=t(30924);function en(e,n){let{data:t,error:r,mutate:o,isLoading:i,isValidating:s}=(0,R.Ay)(`${ee.Zu}?patient=${e}&includeEncounterless=${n}`,O.lo);return(0,a.useMemo)(()=>({isLoading:i,data:t?.data.results??[],error:r,mutate:o,isValidating:s}),[t,r,i,s,o])}function et(e){(0,a.useEffect)(()=>{if(e){let e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[e])}var er=t(13070);let ea={},eo=`No ComponentContext has been provided. This should come from "openmrsComponentDecorator".
|
|
104
|
-
Usually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".`;function ei(e){return()=>{let n=e.getState();return n.loaded&&n.config?n.config:null}}function es(e,n){return n?()=>{let t=e.getState(),r=(0,er.P0)(t,n.extensionSlotName,n.extensionId);if(r.loaded&&r.config)return r.config}:null}function el(e){return new Promise(n=>{let t=e.subscribe(e=>{e.loaded&&e.config&&(n(e.config),t())})})}function ec(e,n){return new Promise(t=>{let r=e.subscribe(e=>{let a=(0,er.P0)(e,n.extensionSlotName,n.extensionId);a.loaded&&a.config&&(t(a.config),r())})})}function eu(e){let[n,t]=(0,a.useState)(ei(e));return(0,a.useEffect)(()=>e?.subscribe(e=>{e.loaded&&e.config&&t(e.config)}),[e]),n}function ed(e,n){let[t,r]=(0,a.useState)(es(e,n));return(0,a.useEffect)(()=>{if(n)return e.subscribe(e=>{let a=(0,er.P0)(e,n.extensionSlotName,n.extensionId);a.loaded&&a.config&&!(0,X.A)(a.config,t)&&r(a.config)})},[e,n,t]),t}function ep(e){let n=(0,a.useMemo)(er.GI,[]),t=ed(n,e);if(!t&&e){let t=`${e.extensionSlotName}-${e.extensionId}`;throw!ea[t]&&n&&(ea[t]=ec(n,e)),ea[t]}return t||{}}function ef(e){let n=(0,a.useMemo)(()=>(0,er.IS)(e),[e]),t=e,r=eu(n);if(!r)throw ea[t]||(ea[t]=el(n)),ea[t];return r}function e_(e){let{moduleName:n,extension:t}=(0,a.useContext)(o),r=e?.externalModuleName??n;if(!r&&!t)throw Error(eo);let i=ef(r),s=ep(t);return(0,a.useMemo)(()=>e?.externalModuleName&&r===e.externalModuleName?{...i}:{...i,...s},[r,e?.externalModuleName,i,s])}let eh=y;var em=t(27760),eg=t(9826);function eA(){let[e,n]=(0,a.useState)((0,eg.s)());return(0,a.useEffect)(()=>(0,em.gj)(({online:e})=>n(e)),[]),e}function ey(e,n=300){let[t,r]=(0,a.useState)(e);return(0,a.useEffect)(()=>{let t=setTimeout(()=>{r(e)},n);return()=>{clearTimeout(t)}},[e,n]),t}var eb=t(36142);let ev=[["admissionDecisionConcept","ref"],["admissionEncounterType","ref"],["admissionForm","ref"],["atFacilityVisitType","ref"],["bedAssignmentEncounterType","ref"],["cancelADTRequestEncounterType","ref"],["checkInClerkEncounterRole","ref"],["checkInEncounterType","ref"],["clinicianEncounterRole","ref"],["conceptSourcesForDiagnosisSearch","ref"],["consultEncounterType","ref"],["consultFreeTextCommentsConcept","ref"],["denyAdmissionConcept","ref"],["diagnosisMetadata","ref"],["diagnosisSets","ref"],["dischargeForm","ref"],["dispositionDescriptor","ref"],["dispositions","ref"],["emrApiConceptSource","ref"],["exitFromInpatientEncounterType","ref"],["extraPatientIdentifierTypes","ref"],["fullPrivilegeLevel","ref"],["highPrivilegeLevel","ref"],["identifierTypesToSearch","ref"],["inpatientNoteEncounterType","ref"],["lastViewedPatientSizeLimit","ref"],["metadataSourceName","ref"],["motherChildRelationshipType","ref"],["narrowerThanConceptMapType","ref"],["nonDiagnosisConceptSets","ref"],["orderingProviderEncounterRole","ref"],["patientDiedConcept","ref"],["personImageDirectory","ref"],["primaryIdentifierType","ref"],["sameAsConceptMapType","ref"],["suppressedDiagnosisConcepts","ref"],["supportsAdmissionLocationTag","(uuid,display,name,links)"],["supportsLoginLocationTag","(uuid,display,name,links)"],["supportsTransferLocationTag","(uuid,display,name,links)"],["supportsVisitsLocationTag","(uuid,display,name,links)"],["telephoneAttributeType","ref"],["testPatientPersonAttributeType","ref"],["transferForm","ref"],["transferRequestEncounterType","ref"],["transferWithinHospitalEncounterType","ref"],["unknownCauseOfDeathConcept","ref"],["unknownLocation","ref"],["unknownPatientPersonAttributeType","ref"],["unknownProvider","ref"],["visitAssignmentHandlerAdjustEncounterTimeOfDayIfNecessary","ref"],["visitExpireHours","ref"],["visitNoteEncounterType","ref"]],eC=`custom:${ev.map(([e,n])=>`${e}:${n}`).join(",")}`;function e$(){let e=eb(`${O.Jj}/emrapi/configuration?v=${eC}`,O.lo);return(0,a.useMemo)(()=>({emrConfiguration:e.data?.data,isLoadingEmrConfiguration:e.isLoading,mutateEmrConfiguration:e.mutate,errorFetchingEmrConfiguration:e.error}),[e])}let ew=g((0,c.a9)());function ek(e){let n=y(e);return(0,a.useMemo)(()=>Object.fromEntries(n.map(e=>[e.name,e.meta])),[n])}let eE=g((0,c.zF)());var ex=t(10201);function eD(e){let{flags:n}=h(ex.jX);return n[e]?.enabled??!1}function eS(){let[,e]=(0,a.useState)(0);return(0,a.useCallback)(()=>{e(e=>e+1)},[])}function ez(e,n,t={}){return eM(e,n,eB,t)}let eB={getPaginatedUrl:(e,n,t)=>{if(!e)return null;{let r=new URL((0,O.Gm)(e.toString()),window.location.toString());return r.searchParams.set("limit",""+n),r.searchParams.set("startIndex",""+t),r.searchParams.set("totalCount","true"),r.toString()}},getNextUrl:e=>{let n=e?.links?.find(e=>"next"==e.rel)?.uri;if(!n)return null;{let e=new URL(n);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.totalCount??NaN,getCurrentPageSize:e=>e?.results?.length??NaN,getData:e=>e?.results};function eM(e,n,t,r={}){let{getPaginatedUrl:o,getTotalCount:i,getCurrentPageSize:s,getData:l}=t,{immutable:c,swrConfig:u}=r,d=r.fetcher??O.lo,[p,f]=(0,a.useState)(1),h=(0,a.useRef)(NaN),m=(0,a.useRef)(NaN),g=n,A=(p-1)*n,y=(0,a.useMemo)(()=>o(e,g,A),[e,g,A]),{data:b,...v}=(c?eb:R.Ay)(y,d,u);b?.data&&(h.current=i(b?.data),m.current=s(b?.data));let C=Math.ceil(h.current/n),$=(0,a.useCallback)(e=>{0<e&&e<=C?f(e):console.warn("Invalid attempt to go to out of bounds page: "+e)},[e,p,C]),w=(0,a.useCallback)(()=>{$(p+1)},[e,p,C]),k=(0,a.useCallback)(()=>{$(p-1)},[e,p,C]);return{data:l(b?.data),totalPages:C,totalCount:h.current,currentPage:p,currentPageSize:m,paginated:C>1,showNextButton:p<C,showPreviousButton:p>1,goTo:$,goToNext:w,goToPrevious:k,...v}}function eT(e,n,t={}){return eM(e,n,eO(),t)}function eO(){return{getPaginatedUrl:(e,n,t)=>{if(!e)return null;{let r=new URL((0,O.Gm)(e.toString()),window.location.toString());return r.searchParams.set("_count",""+n),r.searchParams.set("_getpagesoffset",""+t),r.toString()}},getNextUrl:e=>{let n=e?.link?.find(e=>"next"==e.relation)?.url;if(!n)return null;{let e=new URL(n);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.total??NaN,getCurrentPageSize:e=>e?.entry?.length??NaN,getData:e=>e?.entry?.map(e=>e.resource)}}var eN=t(97744);function eP(e,n={}){return eI(e,eB,n)}function eI(e,n,t={}){let{swrInfiniteConfig:r,immutable:o}=t,{getNextUrl:i,getTotalCount:s,getData:l}=n,c=t.fetcher??O.lo,{data:u,size:d,setSize:p,...f}=eN((0,a.useCallback)((t,r)=>0==t?e?.toString()??null:n.getNextUrl(r.data),[e]),c,{...r,...o?{revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1}:{}}),h=i(u?.[u.length-1].data),m=null!=h,g=()=>{p((u?.length??0)+1)},A=s(u?.[0]?.data);return{data:u?.flatMap(e=>l(e.data)),totalCount:A,hasMore:m,loadMore:g,nextUri:h,...f}}function eF(e,n={}){return eR(e,eB,n)}function eR(e,n,t={}){let r=eI(e,n,t),{hasMore:o,error:i,data:s,loadMore:l,isLoading:c,nextUri:u}=r;return((0,a.useEffect)(()=>{o&&!i&&l()},[o,u]),t.partialData)?r:{...r,data:o||i?void 0:s,isLoading:c||o}}function eH(e,n={}){return eR(e,eO(),n)}function eL(e,n={}){return eI(e,eO(),n)}function ej(){let e="tablet";return document.body.classList.forEach(n=>{switch(n){case"omrs-breakpoint-lt-tablet":e="phone";break;case"omrs-breakpoint-gt-small-desktop":e="large-desktop";break;case"omrs-breakpoint-gt-tablet":e="small-desktop"}}),e}function eq(){let[e,n]=(0,a.useState)(ej);return(0,a.useEffect)(()=>{let e=()=>{n(ej())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}let eG=e=>"small-desktop"===e||"large-desktop"===e;function eV(e){let n=(0,a.useContext)(o);(0,a.useEffect)(()=>(n&&n.moduleName&&(e.componentContext=n),(0,c.Vx)(e),()=>{(0,c.sr)(e.name)}),[n,e])}function eU(){return h(c.Gp)}function eW(e=null,n=null){let[t,r]=(0,a.useState)([]);return(0,a.useEffect)(()=>{let t=(0,ee.Vs)(e,n).subscribe(e=>{r(e)},e=>{console.error(e)});return()=>t.unsubscribe()},[e,n]),t}function eK(e,n=!0){let t=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let r=r=>{!n||!t.current||t.current.contains(r.target)||e(r)};return window.addEventListener("mousedown",r),window.addEventListener("touchstart",r),()=>{window.removeEventListener("mousedown",r),window.removeEventListener("touchstart",r)}},[e,n]),t}function eZ(e){let n=(0,a.useRef)();return(0,a.useEffect)(()=>{let t=new IntersectionObserver(n=>{for(let t of n)if(t.isIntersecting)return void e()},{threshold:1});return n.current&&t.observe(n.current),()=>{n.current&&t.unobserve(n.current)}},[n.current,e]),n}function eY(e,n){if(n)return"function"==typeof n?n(e):n;if("string"==typeof e)return e;throw Error(`When using useOpenmrsSWR with a key that is not a string, you must provide a url() function that converts the key to a valid url. The key for this hook is ${e}.`)}function eJ(e,n={}){let{abortController:t,fetchInit:r,url:o,swrConfig:i}=n,s=Y(),l=(0,a.useMemo)(()=>r?.signal??t?.signal??s.signal,[t?.signal,r?.signal,s.signal]),c=(0,a.useCallback)(e=>{let n=eY(e,o);return(0,O.lo)(n,{...r,signal:l})},[l,r,o]);return(0,R.Ay)(e,c,i)}let eX=10;function eQ(e=[],n=eX){let[t,r]=(0,a.useState)(1),o=(0,a.useMemo)(()=>"number"==typeof n&&n>0?Math.max(1,Math.ceil(e.length/n)):1,[e.length,n]),i=(0,a.useMemo)(()=>{let r=(t-1)*n,a=(t+0)*n;return e.slice(r,a)},[e,t,n]),s=(0,a.useCallback)(e=>{r(Math.max(1,Math.min(o,e)))},[r,o]),l=(0,a.useCallback)(()=>{t<o&&r(t+1)},[t,o,r]),c=(0,a.useCallback)(()=>{t>1&&r(t-1)},[t,r]);return(0,a.useMemo)(()=>({results:i,totalPages:o,currentPage:t,paginated:e.length>n,showNextButton:t<o,showPreviousButton:t>1,goTo:s,goToNext:l,goToPrevious:c}),[i,o,e.length,n,t,s,l,c])}function e0(){let e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function e1(e){let[n,t]=(0,a.useState)(e??e0()),{data:r,error:o,isValidating:i}=(0,R.Ay)(n?["patient",n]:null,()=>(0,ee.hG)(n,{}));return(0,a.useEffect)(()=>{let e=()=>{let e=e0();e!==n&&t(e)};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)},[n]),(0,a.useMemo)(()=>({isLoading:i&&!o&&!r,patient:r,patientUuid:n,error:o}),[i,o,r,n])}function e2(){let e=`${O.Jj}/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType`,{data:n,error:t,isLoading:r}=(0,R.Ay)(e,O.lo);return(0,a.useMemo)(()=>({primaryIdentifierCode:n?.data?.results[0]?.metadataUuid,isLoading:r,error:t}),[n,t,r])}function e3(e){let{extensions:n,extensionSlotModuleName:t}=b(e);return e?n.map(n=>({state:r})=>a.createElement(o.Provider,{value:{moduleName:t,featureName:"",extension:{extensionId:n.id,extensionSlotName:e,extensionSlotModuleName:t}}},a.createElement(u,{state:r}))):[]}var e4=t(23464),e5=t(85602);let e6={setVisitContext:(e,n)=>null==n?{manuallySetVisitUuid:null}:{manuallySetVisitUuid:n.uuid,patientUuid:n.patient?.uuid},mutateVisit(e){for(let n of Object.values(e.mutateVisitCallbacks??{}))n();return{}}};function e8(e){let n=(0,a.useId)();return(0,a.useEffect)(()=>{let t=(0,ee.BX)();return e&&t.setState({mutateVisitCallbacks:{...t.getState().mutateVisitCallbacks,[n]:e}}),()=>{if(e){let e={...t.getState().mutateVisitCallbacks};delete e[n],t.setState({mutateVisitCallbacks:e})}}},[n,e]),m((0,ee.BX)(),e6)}function e7(e,n=ee.Rb){let{patientUuid:t,manuallySetVisitUuid:r,setVisitContext:o}=e8(),i=e&&t==e?r:null,s=`?patient=${e}&v=${n}&includeInactive=false`,l=`/${i}?v=${n}`,{data:c,error:u,mutate:d,isValidating:p}=(0,R.Ay)(e?`${O.Jj}/visit${s}`:null,O.lo),{data:f,error:h,mutate:m,isValidating:g}=(0,R.Ay)(e&&i?`${O.Jj}/visit${l}`:null,O.lo),A=(0,a.useMemo)(()=>c?.data.results.find(e=>null===e.stopDatetime)??null,[c]),y=(0,a.useMemo)(()=>i&&f?f.data:null,[f,i]),b=(0,a.useRef)(null);(0,a.useEffect)(()=>{!p&&A&&t===e&&null===r&&o(A),g||(b.current&&y&&b.current.uuid===y.uuid&&!b.current.stopDatetime&&y.stopDatetime&&o(null),b.current=y)},[y,r,A,p,g,t]);let v=(0,a.useCallback)(()=>{d(),m()},[d,m]);return e8(v),{error:u||h,mutate:v,isValidating:p||g,activeVisit:A,currentVisit:y,currentVisitIsRetrospective:!!i,isLoading:!!((!c||i&&!f)&&(!u||!h))}}function e9(){let[e,n]=(0,a.useState)([]);return(0,a.useEffect)(()=>{let e=(0,ee.Pu)().subscribe(e=>{n(e)},e=>console.error(e));return()=>e.unsubscribe()},[]),e}function ne(){let e=(0,a.useRef)(),[n,t]=(0,a.useState)(null),o=null;if(!n){if(r){let e=(0,O.EW)().getState();e.loaded&&(o=e.session)}else r=new Promise(n=>{let t=({loaded:t,session:r})=>{t&&(n(r),o=r,e.current&&(e.current(),e.current=void 0))};t((0,O.EW)().getState()),o||(e.current=(0,O.EW)().subscribe(t))});if(o)t(o);else throw r}(0,a.useEffect)(()=>(e.current||(e.current=(0,O.EW)().subscribe(({loaded:e,session:n})=>{e&&(o=n,t(n))})),()=>{e.current&&(e.current(),e.current=void 0)}),[]);let i=n||o;if(!i)if(r)throw console.warn("useSession is in an unexpected state. Attempting to recover."),r;else throw Error("useSession is in an invalid state.");return i}e4.extend(e5)},20186:function(e,n,t){"use strict";t.d(n,{o:()=>i});var r=t(81565),a=t(13070);let o=new Map;async function i(e,n){let t=n.indexOf("#"),a=t>=0,o=a?n.substring(0,t):e,i=a?n.substring(t+1):n,c=await (0,r.rL)(o);return c&&Object.hasOwn(c,i)&&"function"==typeof c[i]?l(o,c).then(()=>c[i]()):(c?c&&Object.hasOwn(c,i)?console.warn(`The export ${n}, defined in ${e}'s routes.json, is not a function`):console.warn(`${o} does not define a component called "${i}", referenced in ${e}'s routes.json. This cannot be loaded.`):console.warn(`Unknown app ${o} for ${n} defined in ${e}'s routes.json`),s)}let s={bootstrap:()=>Promise.resolve(),mount:()=>Promise.resolve(),unmount:()=>Promise.resolve()};async function l(e,n){if(e in o)await o[e];else{let t=n??await (0,r.rL)(e);await (o[e]=new Promise((n,r)=>{if(Object.hasOwn(t,"startupApp")){let o=t.startupApp;if("function"==typeof o)return Promise.resolve(o()).then(()=>{(0,a.kl)(e),n(null)}).catch(r)}(0,a.kl)(e),n(null)}))}}},467:function(e,n,t){"use strict";t.d(n,{i7:()=>c,jf:()=>l,CE:()=>s,Zd:()=>i});var r=t(90108),a=t(58644);let o={};function i(e,n){let t=o[e];if(t)return t.active?console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):t.value.setState(n,!0),t.active=!0,t.value;{let t=(0,a.y)()(()=>n);return o[e]={value:t,active:!0},t}}function s(e,n){let t=o[e];return t?(t.active?console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):t.value=n,t.active=!0,t.value):(o[e]={value:n,active:!0},n)}function l(e,n){let t=o[e];if(!t){let t=(0,a.y)()(()=>n??{});return o[e]={value:t,active:!1},t}return t.value}function c(...e){let[n,t,a]=e,o=void 0===a?t:a,i=void 0===a?e=>e:t;return o(i(n.getState())),n.subscribe((e,n)=>{let t=i(e);(0,r.b)(n,t)||o(t)})}setTimeout(()=>{window&&"development"===window.spaEnv&&(window.stores=o)},1e3)},61836:function(e,n,t){"use strict";t.d(n,{V:()=>J,t:()=>Y});let r={closeWorkspaces2PromptTitle:"Close workspace(s)",closeWorkspaces2PromptBody:"You are about to close the following workspace(s), which might have unsaved changes:"},a={address1:"Address line 1",address2:"Address line 2",address3:"Address line 3",address4:"Address line 4",address5:"Address line 5",address6:"Address line 6",city:"City",cityVillage:"City",country:"Country",countyDistrict:"District",district:"District",postalCode:"Postal code",state:"State",stateProvince:"State",closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",closingAllWorkspacesPromptTitle:"You have unsaved changes",discard:"Discard",hide:"Hide",maximize:"Maximize",minimize:"Minimize",openAnyway:"Open anyway",unsavedChangesInOpenedWorkspace:"You may have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header",...r,actions:"Actions",address:"Address",age:"Age",cancel:"Cancel",change:"Change",Clinic:"Clinic",close:"Close",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",delete:"Delete",edit:"Edit",error:"Error",errorCopy:"Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",female:"Female",loading:"Loading",male:"Male",other:"Other",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",relationships:"Relationships",resetOverrides:"Reset overrides",save:"Save",scriptLoadingFailed:"Error: Script failed to load",scriptLoadingError:"Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",seeMoreLists:"See {{count}} more lists",sex:"Sex",showLess:"Show less",showMore:"Show more",toggleDevTools:"Toggle dev tools",unknown:"Unknown"};var o=t(85761),i=t(93442);function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?Object(arguments[n]):{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.forEach(function(n){(0,i.A)(e,n,t[n])})}return e}var l=t(79736),c=t(36678);function u(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,n){if(n&&("object"==(0,o.A)(n)||"function"==typeof n))return n;if(void 0!==n)throw TypeError("Derived constructors may only return object or undefined");return u(e)}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var f=t(98423);function h(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&(0,f.A)(e,n)}var m={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,n){console&&console[e]&&console[e].apply(console,n)}},g=new(function(){function e(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,l.A)(this,e),this.init(n,t)}return(0,c.A)(e,[{key:"init",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||m,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];return this.forward(n,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];return this.forward(n,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];return this.forward(n,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,n,t,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(t).concat(this.prefix," ").concat(e[0])),this.logger[n](e))}},{key:"create",value:function(n){return new e(this.logger,s({},{prefix:"".concat(this.prefix,":").concat(n,":")},this.options))}}]),e}()),A=function(){function e(){(0,l.A)(this,e),this.observers={}}return(0,c.A)(e,[{key:"on",value:function(e,n){var t=this;return e.split(" ").forEach(function(e){t.observers[e]=t.observers[e]||[],t.observers[e].push(n)}),this}},{key:"off",value:function(e,n){if(this.observers[e]){if(!n)return void delete this.observers[e];this.observers[e]=this.observers[e].filter(function(e){return e!==n})}}},{key:"emit",value:function(e){for(var n=arguments.length,t=Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];this.observers[e]&&[].concat(this.observers[e]).forEach(function(e){e.apply(void 0,t)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(function(n){n.apply(n,[e].concat(t))})}}]),e}();function y(){var e,n,t=new Promise(function(t,r){e=t,n=r});return t.resolve=e,t.reject=n,t}function b(e){return null==e?"":""+e}function v(e,n,t){e.forEach(function(e){n[e]&&(t[e]=n[e])})}function C(e,n,t){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function a(){return!e||"string"==typeof e}for(var o="string"!=typeof n?[].concat(n):n.split(".");o.length>1;){if(a())return{};var i=r(o.shift());!e[i]&&t&&(e[i]=new t),e=Object.prototype.hasOwnProperty.call(e,i)?e[i]:{}}return a()?{}:{obj:e,k:r(o.shift())}}function $(e,n,t){var r=C(e,n,Object);r.obj[r.k]=t}function w(e,n,t,r){var a=C(e,n,Object),o=a.obj,i=a.k;o[i]=o[i]||[],r&&(o[i]=o[i].concat(t)),r||o[i].push(t)}function k(e,n){var t=C(e,n),r=t.obj,a=t.k;if(r)return r[a]}function E(e,n,t){var r=k(e,t);return void 0!==r?r:k(n,t)}function x(e,n,t){for(var r in n)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof n[r]||n[r]instanceof String?t&&(e[r]=n[r]):x(e[r],n[r],t):e[r]=n[r]);return e}function D(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var S={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function z(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return S[e]}):e}var B="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,M=function(e){function n(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return(0,l.A)(this,n),t=d(this,p(n).call(this)),B&&A.call(u(t)),t.data=e||{},t.options=r,void 0===t.options.keySeparator&&(t.options.keySeparator="."),t}return h(n,e),(0,c.A)(n,[{key:"addNamespaces",value:function(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}},{key:"getResource",value:function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=[e,n];return t&&"string"!=typeof t&&(o=o.concat(t)),t&&"string"==typeof t&&(o=o.concat(a?t.split(a):t)),e.indexOf(".")>-1&&(o=e.split(".")),k(this.data,o)}},{key:"addResource",value:function(e,n,t,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var i=[e,n];t&&(i=i.concat(o?t.split(o):t)),e.indexOf(".")>-1&&(i=e.split("."),r=n,n=i[1]),this.addNamespaces(n),$(this.data,i,r),a.silent||this.emit("added",e,n,t,r)}},{key:"addResources",value:function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var a in t)("string"==typeof t[a]||"[object Array]"===Object.prototype.toString.apply(t[a]))&&this.addResource(e,n,a,t[a],{silent:!0});r.silent||this.emit("added",e,n,t)}},{key:"addResourceBundle",value:function(e,n,t,r,a){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},i=[e,n];e.indexOf(".")>-1&&(i=e.split("."),r=t,t=n,n=i[1]),this.addNamespaces(n);var l=k(this.data,i)||{};r?x(l,t,a):l=s({},l,t),$(this.data,i,l),o.silent||this.emit("added",e,n,t)}},{key:"removeResourceBundle",value:function(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}},{key:"hasResourceBundle",value:function(e,n){return void 0!==this.getResource(e,n)}},{key:"getResourceBundle",value:function(e,n){return(n||(n=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?s({},{},this.getResource(e,n)):this.getResource(e,n)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),n}(A),T={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,n,t,r,a){var o=this;return e.forEach(function(e){o.processors[e]&&(n=o.processors[e].process(n,t,r,a))}),n}},O={},N=function(e){function n(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,l.A)(this,n),t=d(this,p(n).call(this)),B&&A.call(u(t)),v(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,u(t)),t.options=r,void 0===t.options.keySeparator&&(t.options.keySeparator="."),t.logger=g.create("translator"),t}return h(n,e),(0,c.A)(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},t=this.resolve(e,n);return t&&void 0!==t.res}},{key:"extractFromKey",value:function(e,n){var t=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===t&&(t=":");var r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=n.ns||this.options.defaultNS;if(t&&e.indexOf(t)>-1){var o=e.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:e,namespaces:a};var i=e.split(t);(t!==r||t===r&&this.options.ns.indexOf(i[0])>-1)&&(a=i.shift()),e=i.join(r)}return"string"==typeof a&&(a=[a]),{key:e,namespaces:a}}},{key:"translate",value:function(e,t,r){var a=this;if("object"!==(0,o.A)(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,l=this.extractFromKey(e[e.length-1],t),c=l.key,u=l.namespaces,d=u[u.length-1],p=t.lng||this.language,f=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&"cimode"===p.toLowerCase())return f?d+(t.nsSeparator||this.options.nsSeparator)+c:c;var h=this.resolve(e,t),m=h&&h.res,g=h&&h.usedKey||c,A=h&&h.exactUsedKey||c,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],v=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject,$="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(C&&m&&$&&0>b.indexOf(y)&&("string"!=typeof v||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,t):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");if(i){var w="[object Array]"===y,k=w?[]:{},E=w?A:g;for(var x in m)if(Object.prototype.hasOwnProperty.call(m,x)){var D="".concat(E).concat(i).concat(x);k[x]=this.translate(D,s({},t,{joinArrays:!1,ns:u})),k[x]===D&&(k[x]=m[x])}m=k}}else if(C&&"string"==typeof v&&"[object Array]"===y)(m=m.join(v))&&(m=this.extendTranslation(m,e,t,r));else{var S=!1,z=!1,B=void 0!==t.count&&"string"!=typeof t.count,M=n.hasDefaultValue(t),T=B?this.pluralResolver.getSuffix(p,t.count):"",O=t["defaultValue".concat(T)]||t.defaultValue;!this.isValidLookup(m)&&M&&(S=!0,m=O),this.isValidLookup(m)||(z=!0,m=c);var N=M&&O!==m&&this.options.updateMissing;if(z||S||N){if(this.logger.log(N?"updateKey":"missingKey",p,d,c,N?O:m),i){var P=this.resolve(c,s({},t,{keySeparator:!1}));P&&P.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var I=[],F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&F&&F[0])for(var R=0;R<F.length;R++)I.push(F[R]);else"all"===this.options.saveMissingTo?I=this.languageUtils.toResolveHierarchy(t.lng||this.language):I.push(t.lng||this.language);var H=function(e,n,r){a.options.missingKeyHandler?a.options.missingKeyHandler(e,d,n,N?r:m,N,t):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(e,d,n,N?r:m,N,t),a.emit("missingKey",e,d,n,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&B?I.forEach(function(e){a.pluralResolver.getSuffixes(e).forEach(function(n){H([e],c+n,t["defaultValue".concat(n)]||O)})}):H(I,c,O))}m=this.extendTranslation(m,e,t,h,r),z&&m===c&&this.options.appendNamespaceToMissingKey&&(m="".concat(d,":").concat(c)),z&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(m))}return m}},{key:"extendTranslation",value:function(e,n,t,r,a){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,t,r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!t.skipInterpolation){t.interpolation&&this.interpolator.init(s({},t,{interpolation:s({},this.options.interpolation,t.interpolation)}));var i,l=t.interpolation&&t.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(l){var c=e.match(this.interpolator.nestingRegexp);i=c&&c.length}var u=t.replace&&"string"!=typeof t.replace?t.replace:t;if(this.options.interpolation.defaultVariables&&(u=s({},this.options.interpolation.defaultVariables,u)),e=this.interpolator.interpolate(e,u,t.lng||this.language,t),l){var d=e.match(this.interpolator.nestingRegexp);i<(d&&d.length)&&(t.nest=!1)}!1!==t.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return a&&a[0]===r[0]&&!t.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(n[0])),null):o.translate.apply(o,r.concat([n]))},t)),t.interpolation&&this.interpolator.reset()}var p=t.postProcess||this.options.postProcess,f="string"==typeof p?[p]:p;return null!=e&&f&&f.length&&!1!==t.applyPostProcessor&&(e=T.handle(f,e,n,this.options&&this.options.postProcessPassResolved?s({i18nResolved:r},t):t,this)),e}},{key:"resolve",value:function(e){var n,t,r,a,o,i=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(function(e){if(!i.isValidLookup(n)){var l=i.extractFromKey(e,s),c=l.key;t=c;var u=l.namespaces;i.options.fallbackNS&&(u=u.concat(i.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,p=void 0!==s.context&&"string"==typeof s.context&&""!==s.context,f=s.lngs?s.lngs:i.languageUtils.toResolveHierarchy(s.lng||i.language,s.fallbackLng);u.forEach(function(e){i.isValidLookup(n)||(o=e,!O["".concat(f[0],"-").concat(e)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(o)&&(O["".concat(f[0],"-").concat(e)]=!0,i.logger.warn('key "'.concat(t,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(function(t){if(!i.isValidLookup(n)){a=t;var o,l,u=c,f=[u];for(i.i18nFormat&&i.i18nFormat.addLookupKeys?i.i18nFormat.addLookupKeys(f,c,t,e,s):(d&&(o=i.pluralResolver.getSuffix(t,s.count)),d&&p&&f.push(u+o),p&&f.push(u+="".concat(i.options.contextSeparator).concat(s.context)),d&&f.push(u+=o));l=f.pop();)i.isValidLookup(n)||(r=l,n=i.getResource(t,e,l,s))}}))})}}),{res:n,usedKey:t,exactUsedKey:r,usedLng:a,usedNS:o}}},{key:"isValidLookup",value:function(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,t,r):this.resourceStore.getResource(e,n,t,r)}}],[{key:"hasDefaultValue",value:function(e){var n="defaultValue";for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&n===t.substring(0,n.length)&&void 0!==e[t])return!0;return!1}}]),n}(A);function P(e){return e.charAt(0).toUpperCase()+e.slice(1)}var I=function(){function e(n){(0,l.A)(this,e),this.options=n,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=g.create("languageUtils")}return(0,c.A)(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||0>e.indexOf("-"))return null;var n=e.split("-");return 2===n.length||(n.pop(),"x"===n[n.length-1].toLowerCase())?null:this.formatLanguageCode(n.join("-"))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||0>e.indexOf("-"))return e;var n=e.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],t=e.split("-");return this.options.lowerCaseLng?t=t.map(function(e){return e.toLowerCase()}):2===t.length?(t[0]=t[0].toLowerCase(),t[1]=t[1].toUpperCase(),n.indexOf(t[1].toLowerCase())>-1&&(t[1]=P(t[1].toLowerCase()))):3===t.length&&(t[0]=t[0].toLowerCase(),2===t[1].length&&(t[1]=t[1].toUpperCase()),"sgn"!==t[0]&&2===t[2].length&&(t[2]=t[2].toUpperCase()),n.indexOf(t[1].toLowerCase())>-1&&(t[1]=P(t[1].toLowerCase())),n.indexOf(t[2].toLowerCase())>-1&&(t[2]=P(t[2].toLowerCase()))),t.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var n,t=this;return e?(e.forEach(function(e){if(!n){var r=t.formatLanguageCode(e);(!t.options.supportedLngs||t.isSupportedCode(r))&&(n=r)}}),!n&&this.options.supportedLngs&&e.forEach(function(e){if(!n){var r=t.getLanguagePartFromCode(e);if(t.isSupportedCode(r))return n=r;n=t.options.supportedLngs.find(function(e){if(0===e.indexOf(r))return e})}}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n):null}},{key:"getFallbackCodes",value:function(e,n){if(!e)return[];if("function"==typeof e&&(e=e(n)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!n)return e.default||[];var t=e[n];return t||(t=e[this.getScriptPartFromCode(n)]),t||(t=e[this.formatLanguageCode(n)]),t||(t=e[this.getLanguagePartFromCode(n)]),t||(t=e.default),t||[]}},{key:"toResolveHierarchy",value:function(e,n){var t=this,r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),a=[],o=function(e){e&&(t.isSupportedCode(e)?a.push(e):t.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach(function(e){0>a.indexOf(e)&&o(t.formatLanguageCode(e))}),a}}]),e}(),F=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],R={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(+(1!=e&&(e%10!=1||e%100==11)))},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:3*(e%100==3||e%100==4))},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};function H(){var e={};return F.forEach(function(n){n.lngs.forEach(function(t){e[t]={numbers:n.nr,plurals:R[n.fc]}})}),e}var L=function(){function e(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,l.A)(this,e),this.languageUtils=n,this.options=t,this.logger=g.create("pluralResolver"),this.rules=H()}return(0,c.A)(e,[{key:"addRule",value:function(e,n){this.rules[e]=n}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var n=this.getRule(e);return n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,n){return this.getSuffixes(e).map(function(e){return n+e})}},{key:"getSuffixes",value:function(e){var n=this,t=this.getRule(e);return t?t.numbers.map(function(t){return n.getSuffix(e,t)}):[]}},{key:"getSuffix",value:function(e,n){var t=this,r=this.getRule(e);if(r){var a=r.noAbs?r.plurals(n):r.plurals(Math.abs(n)),o=r.numbers[a];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return t.options.prepend&&o.toString()?t.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON?i():this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?i():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),j=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,l.A)(this,e),this.logger=g.create("interpolator"),this.options=n,this.format=n.interpolation&&n.interpolation.format||function(e){return e},this.init(n)}return(0,c.A)(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var n=e.interpolation;this.escape=void 0!==n.escape?n.escape:z,this.escapeValue=void 0===n.escapeValue||n.escapeValue,this.useRawValueToEscape=void 0!==n.useRawValueToEscape&&n.useRawValueToEscape,this.prefix=n.prefix?D(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?D(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?D(n.nestingPrefix):n.nestingPrefixEscaped||D("$t("),this.nestingSuffix=n.nestingSuffix?D(n.nestingSuffix):n.nestingSuffixEscaped||D(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=void 0!==n.alwaysFormat&&n.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=RegExp(e,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=RegExp(n,"g");var t="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=RegExp(t,"g")}},{key:"interpolate",value:function(e,n,t,r){var a,o,i,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(0>e.indexOf(s.formatSeparator)){var a=E(n,l,e);return s.alwaysFormat?s.format(a,void 0,t):a}var o=e.split(s.formatSeparator),i=o.shift().trim(),c=o.join(s.formatSeparator).trim();return s.format(E(n,l,i),c,t,r)};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,p=r&&r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?c(s.escape(e)):c(e)}}].forEach(function(n){for(i=0;a=n.regex.exec(e);){if(void 0===(o=u(a[1].trim())))if("function"==typeof d){var t=d(e,a,r);o="string"==typeof t?t:""}else if(p){o=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(a[1]," for interpolating ").concat(e)),o="";else"string"==typeof o||s.useRawValueToEscape||(o=b(o));if(e=e.replace(a[0],n.safeValue(o)),n.regex.lastIndex=0,++i>=s.maxReplaces)break}}),e}},{key:"nest",value:function(e,n){var t,r,a=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=s({},o);function l(e,n){var t=this.nestingOptionsSeparator;if(0>e.indexOf(t))return e;var r=e.split(new RegExp("".concat(t,"[ ]*{"))),a="{".concat(r[1]);e=r[0],a=(a=this.interpolate(a,i)).replace(/'/g,'"');try{i=JSON.parse(a),n&&(i=s({},n,i))}catch(n){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),n),"".concat(e).concat(t).concat(a)}return delete i.defaultValue,e}for(i.applyPostProcessor=!1,delete i.defaultValue;t=this.nestingRegexp.exec(e);){var c=[],u=!1;if(t[0].includes(this.formatSeparator)&&!/{.*}/.test(t[1])){var d=t[1].split(this.formatSeparator).map(function(e){return e.trim()});t[1]=d.shift(),c=d,u=!0}if((r=n(l.call(this,t[1].trim(),i),i))&&t[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=b(r)),r||(this.logger.warn("missed to resolve ".concat(t[1]," for nesting ").concat(e)),r=""),u&&(r=c.reduce(function(e,n){return a.format(e,n,o.lng,o)},r.trim())),e=e.replace(t[0],r),this.regexp.lastIndex=0}return e}}]),e}();function q(e,n){for(var t=e.indexOf(n);-1!==t;)e.splice(t,1),t=e.indexOf(n)}var G=function(e){function n(e,t,r){var a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,l.A)(this,n),a=d(this,p(n).call(this)),B&&A.call(u(a)),a.backend=e,a.store=t,a.services=r,a.languageUtils=r.languageUtils,a.options=o,a.logger=g.create("backendConnector"),a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(r,o.backend,o),a}return h(n,e),(0,c.A)(n,[{key:"queueLoad",value:function(e,n,t,r){var a=this,o=[],i=[],s=[],l=[];return e.forEach(function(e){var r=!0;n.forEach(function(n){var s="".concat(e,"|").concat(n);!t.reload&&a.store.hasResourceBundle(e,n)?a.state[s]=2:a.state[s]<0||(1===a.state[s]?0>i.indexOf(s)&&i.push(s):(a.state[s]=1,r=!1,0>i.indexOf(s)&&i.push(s),0>o.indexOf(s)&&o.push(s),0>l.indexOf(n)&&l.push(n)))}),r||s.push(e)}),(o.length||i.length)&&this.queue.push({pending:i,loaded:{},errors:[],callback:r}),{toLoad:o,pending:i,toLoadLanguages:s,toLoadNamespaces:l}}},{key:"loaded",value:function(e,n,t){var r=e.split("|"),a=r[0],o=r[1];n&&this.emit("failedLoading",a,o,n),t&&this.store.addResourceBundle(a,o,t),this.state[e]=n?-1:2;var i={};this.queue.forEach(function(t){w(t.loaded,[a],o),q(t.pending,e),n&&t.errors.push(n),0!==t.pending.length||t.done||(Object.keys(t.loaded).forEach(function(e){i[e]||(i[e]=[]),t.loaded[e].length&&t.loaded[e].forEach(function(n){0>i[e].indexOf(n)&&i[e].push(n)})}),t.done=!0,t.errors.length?t.callback(t.errors):t.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(function(e){return!e.done})}},{key:"read",value:function(e,n,t){var r=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,i=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[t](e,n,function(s,l){s&&l&&a<5?setTimeout(function(){r.read.call(r,e,n,t,a+1,2*o,i)},o):i(s,l)}):i(null,{})}},{key:"prepareLoading",value:function(e,n){var t=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof n&&(n=[n]);var o=this.queueLoad(e,n,r,a);if(!o.toLoad.length)return o.pending.length||a(),null;o.toLoad.forEach(function(e){t.loadOne(e)})}},{key:"load",value:function(e,n,t){this.prepareLoading(e,n,{},t)}},{key:"reload",value:function(e,n,t){this.prepareLoading(e,n,{reload:!0},t)}},{key:"loadOne",value:function(e){var n=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),a=r[0],o=r[1];this.read(a,o,"read",void 0,void 0,function(r,i){r&&n.logger.warn("".concat(t,"loading namespace ").concat(o," for language ").concat(a," failed"),r),!r&&i&&n.logger.log("".concat(t,"loaded namespace ").concat(o," for language ").concat(a),i),n.loaded(e,r,i)})}},{key:"saveMissing",value:function(e,n,t,r,a){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)?this.logger.warn('did not save key "'.concat(t,'" as the namespace "').concat(n,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null==t||""===t||(this.backend&&this.backend.create&&this.backend.create(e,n,t,r,null,s({},o,{isUpdate:a})),e&&e[0]&&this.store.addResource(e[0],n,t,r))}}]),n}(A);function V(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var n={};if("object"===(0,o.A)(e[1])&&(n=e[1]),"string"==typeof e[1]&&(n.defaultValue=e[1]),"string"==typeof e[2]&&(n.tDescription=e[2]),"object"===(0,o.A)(e[2])||"object"===(0,o.A)(e[3])){var t=e[3]||e[2];Object.keys(t).forEach(function(e){n[e]=t[e]})}return n},interpolation:{escapeValue:!0,format:function(e,n,t,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function U(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&0>e.whitelist.indexOf("cimode")&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&0>e.supportedLngs.indexOf("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function W(){}let K=new(function(e){function n(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if((0,l.A)(this,n),e=d(this,p(n).call(this)),B&&A.call(u(e)),e.options=U(t),e.services={},e.logger=g,e.modules={external:[]},r&&!e.isInitialized&&!t.isClone){if(!e.options.initImmediate)return e.init(t,r),d(e,u(e));setTimeout(function(){e.init(t,r)},0)}return e}return h(n,e),(0,c.A)(n,[{key:"init",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;function r(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof n&&(t=n,n={}),n.whitelist&&!n.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),n.nonExplicitWhitelist&&!n.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=s({},V(),this.options,U(n)),this.format=this.options.interpolation.format,t||(t=W),!this.options.isClone){this.modules.logger?g.init(r(this.modules.logger),this.options):g.init(null,this.options);var a=new I(this.options);this.store=new M(this.options.resources,this.options);var o=this.services;o.logger=g,o.resourceStore=this.store,o.languageUtils=a,o.pluralResolver=new L(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),o.interpolator=new j(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new G(r(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",function(n){for(var t=arguments.length,r=Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];e.emit.apply(e,[n].concat(r))}),this.modules.languageDetector&&(o.languageDetector=r(this.modules.languageDetector),o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=r(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new N(this.services,this.options),this.translator.on("*",function(n){for(var t=arguments.length,r=Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];e.emit.apply(e,[n].concat(r))}),this.modules.external.forEach(function(n){n.init&&n.init(e)})}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var i=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);i.length>0&&"dev"!==i[0]&&(this.options.lng=i[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(function(n){e[n]=function(){var t;return(t=e.store)[n].apply(t,arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(function(n){e[n]=function(){var t;return(t=e.store)[n].apply(t,arguments),e}});var l=y(),c=function(){var n=function(n,r){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),l.resolve(r),t(n,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return n(null,e.t.bind(e));e.changeLanguage(e.options.lng,n)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),l}},{key:"loadResources",value:function(e){var n=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:W,r=t,a="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(a&&"cimode"===a.toLowerCase())return r();var o=[],i=function(e){if(e){var t=n.services.languageUtils.toResolveHierarchy(e);t.forEach(function(e){0>o.indexOf(e)&&o.push(e)})}};a?i(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(e){return i(e)}),this.options.preload&&this.options.preload.forEach(function(e){return i(e)}),this.services.backendConnector.load(o,this.options.ns,r)}else r(null)}},{key:"reloadResources",value:function(e,n,t){var r=y();return e||(e=this.languages),n||(n=this.options.ns),t||(t=W),this.services.backendConnector.reload(e,n,function(e){r.resolve(),t(e)}),r}},{key:"use",value:function(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&T.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,n){var t=this;this.isLanguageChangingTo=e;var r=y();this.emit("languageChanging",e);var a=function(e,a){a?(t.language=a,t.languages=t.services.languageUtils.toResolveHierarchy(a),t.translator.changeLanguage(a),t.isLanguageChangingTo=void 0,t.emit("languageChanged",a),t.logger.log("languageChanged",a)):t.isLanguageChangingTo=void 0,r.resolve(function(){return t.t.apply(t,arguments)}),n&&n(e,function(){return t.t.apply(t,arguments)})},o=function(e){var n="string"==typeof e?e:t.services.languageUtils.getBestMatchFromCodes(e);n&&(t.language||(t.language=n,t.languages=t.services.languageUtils.toResolveHierarchy(n)),t.translator.language||t.translator.changeLanguage(n),t.services.languageDetector&&t.services.languageDetector.cacheUserLanguage(n)),t.loadResources(n,function(e){a(e,n)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,n){var t=this,r=function e(n,r){var a;if("object"!==(0,o.A)(r)){for(var i=arguments.length,l=Array(i>2?i-2:0),c=2;c<i;c++)l[c-2]=arguments[c];a=t.options.overloadTranslationOptionHandler([n,r].concat(l))}else a=s({},r);return a.lng=a.lng||e.lng,a.lngs=a.lngs||e.lngs,a.ns=a.ns||e.ns,t.t(n,a)};return"string"==typeof e?r.lng=e:r.lngs=e,r.ns=n,r}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var n=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.languages[0],a=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var i=function(e,t){var r=n.services.backendConnector.state["".concat(e,"|").concat(t)];return -1===r||2===r};if(t.precheck){var s=t.precheck(this,i);if(void 0!==s)return s}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||i(r,e)&&(!a||i(o,e)))}},{key:"loadNamespaces",value:function(e,n){var t=this,r=y();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(function(e){0>t.options.ns.indexOf(e)&&t.options.ns.push(e)}),this.loadResources(function(e){r.resolve(),n&&n(e)}),r):(n&&n(),Promise.resolve())}},{key:"loadLanguages",value:function(e,n){var t=y();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],a=e.filter(function(e){return 0>r.indexOf(e)});return a.length?(this.options.preload=r.concat(a),this.loadResources(function(e){t.resolve(),n&&n(e)}),t):(n&&n(),Promise.resolve())}},{key:"dir",value:function(e){return(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),e)?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new n(e,t)}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:W,a=s({},this.options,t,{isClone:!0}),o=new n(a);return["store","services","language"].forEach(function(n){o[n]=e[n]}),o.services=s({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new N(o.services,o.options),o.translator.on("*",function(e){for(var n=arguments.length,t=Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];o.emit.apply(o,[e].concat(t))}),o.init(a,r),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}}]),n}(A)),Z=K.default||K;function Y(e,n,t,r){return Z.t(n,{ns:e,defaultValue:t,...r})}function J(e,n,t){return a[e]?Y("core",e,n??a[e],t):(console.error(`O3 Core Translations does not provide key '${e}'. The key itself is being rendered as text.`),e)}Z.on("initialized",function(){window.i18next.loadNamespaces(["core"])})},40785:function(e,n,t){"use strict";t.d(n,{K:()=>c});var r=t(18140),a=t(8902),o=t(23464),i=t(44397),s=t(92801),l=t(42729);function c(e,n=o()){let t;if(null==e)return null;let i=(0,l.J)(),u=o(n);if("string"==typeof e){let n=(0,a.CD)(e,i);if(n.invalid)return console.warn(`Could not interpret '${e}' as a date`),null;n.day&&!n.month&&(n=Object.assign({},(0,s.A)(n,"day"),{month:n.day})),n.month&&(n.month-=1),n.day&&(n=Object.assign({},(0,s.A)(n,"day"),{date:n.day})),t=o(u).set(n)}else t=o(e);let d=u.diff(t,"hours"),p=u.diff(t,"days"),f=u.diff(t,"weeks"),h=u.diff(t,"months"),m=u.diff(t,"years"),g={},A={style:"short",localeMatcher:"lookup"};if(d<2){let e=u.diff(t,"minutes");g.minutes=e,0===e&&(A.minutesDisplay="always")}else if(p<2)g.hours=d;else if(f<4)g.days=p;else if(m<1){let e=u.subtract(f,"weeks").diff(t,"days");g.weeks=f,g.days=e}else if(m<2){let e=u.subtract(h,"months").diff(t,"days");g.months=h,g.days=e}else if(m<18){let e=u.subtract(m,"year").diff(t,"months");g.years=m,g.months=e}else g.years=m;return new r.DurationFormat(i,A).format(g)}o.extend(i)},22613:function(e,n,t){"use strict";t.d(n,{Rt:()=>P,vU:()=>C,hl:()=>v,XE:()=>S,fU:()=>N,a3:()=>F,LW:()=>M,_U:()=>k,d4:()=>I,l0:()=>w,a7:()=>z,kQ:()=>$,Yq:()=>T});var r=t(31530),a=t(32878),o=t(18140),i=t(8902),s=t(23464),l=t(85602),c=t(44397),u=t(57657);let d=function(e){return null==e};var p=t(92801),f=t(42729);function h(e,n){if(n.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function m(e,n){return n.get?n.get.call(e):n.value}function g(e,n,t){if(!n.has(e))throw TypeError("attempted to "+t+" private field on non-instance");return n.get(e)}function A(e,n){var t=g(e,n,"get");return m(e,t)}function y(e,n,t){h(e,n),n.set(e,t)}s.extend(l),s.extend(u),s.extend(c);let b="YYYY-MM-DDTHH:mm:ss.SSSZZ";function v(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&("+"===e[23]||"-"===e[23])&&s(e,b).isValid()}function C(e){return s(e).isToday()}function $(e){return v(e)?s(e,b).toDate():null}function w(e,n=!1){let t=s(e);return n&&(t=t.utc()),t.format(b)}function k(e){return s(e).toDate()}var E=new WeakMap;class x{register(e,n){A(this,E).set(e,n)}getCalendar(e){if(!e)return;if(e.calendar)return e.calendar;if(e.region){let n=`${e.language}-${e.region}`;if(A(this,E).has(n))return A(this,E).get(n)}if(e.language&&A(this,E).has(e.language))return A(this,E).get(e.language);let n=new Intl.DateTimeFormat(e.toString()).resolvedOptions().calendar;return A(this,E).set(`${e.language}${e.region?`-${e.region}`:""}`,n),n}constructor(){y(this,E,{writable:!0,value:new Map})}}let D=new x;function S(e,n){D.register(e,n)}function z(e){let n=e??(0,f.J)();return D.getCalendar(n instanceof Intl.Locale?n:new Intl.Locale(n))}let B={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1};function M(e,n={}){let t=(0,f.J)(),r=(0,i.CD)(e,t);if(r.invalid)return console.warn(`Could not parse invalid date '${e}'`),null;!d(r.day)&&d(r.month)&&(r=Object.assign({},(0,p.A)(r,"day"),{month:r.day})),r.month&&(r.month-=1),r.day&&(r=Object.assign({},(0,p.A)(r,"day"),{date:r.day}));let a=s().set(r).toDate();return d(r.year)&&(n.year=!1),d(r.month)&&(n.month=!1),d(r.date)&&(n.day=!1),T(a,n)}function T(e,n){let t,r=n?.locale??(0,f.J)(),a=new Intl.Locale(r),{calendar:o,mode:i,time:l,day:c,month:u,year:d,noToday:p,numberingSystem:h}={...B,...{noToday:"am"===a.language},...n},m={calendar:o??z(a),year:d?"numeric":void 0,month:u?"short":void 0,day:c?"2-digit":void 0,numberingSystem:h},g=s(e).isToday();if(g&&!p)t=(t=new Intl.RelativeTimeFormat(r,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(r)+t.slice(1);else{"en"===a.language&&(r="en-GB");let n=new Intl.DateTimeFormat(r,m).formatToParts(e);("en"===a.language||"am"===a.language)&&"standard"==i&&d&&c&&(n=n.map(O("-"))),"wide"==i&&(n=n.map(O(" — "))),"ethiopic"===m.calendar&&(n=n.filter((e,n,t)=>"era"!==e.type&&("literal"!==e.type||!(n<t.length-1)||"era"!==t[n+1].type))),t=n.map(e=>e.value).join("")}return(!0===l||g&&"for today"===l)&&(t+=`, ${N(e)}`),t}let O=e=>(n,t,r)=>"literal"!==n.type||" "!==n.value||t<r.length-1&&"era"===r[t+1].type?n:{type:"literal",value:e};function N(e){return e.toLocaleTimeString((0,f.J)(),{hour:"2-digit",minute:"2-digit"})}function P(e,n){return T(e,{...n,time:!0})}function I(e,n){let t=z("string"==typeof n?new Intl.Locale(n):n);return t?(0,r.yP)(e,(0,a.d)(t)):e}function F(e,n){return new o.DurationFormat((0,f.J)(),n).format(e)}},42729:function(e,n,t){"use strict";function r(){let e=window.i18next.language;return"ht"===(e=e.replace("_","-"))&&(e="fr-HT"),e}t.d(n,{J:()=>r})},9826:function(e,n,t){"use strict";function r(e){return!window.offlineEnabled||(e??navigator.onLine)}t.d(n,{s:()=>r})},67943:function(e,n,t){"use strict";function r(e){return o(s(e,"usual","official"))}function a(e){return r(e)}function o(e){return e?e.text??l(e):""}function i(e){return o(e)}function s(e,...n){for(let t of(0==n.length&&(n=["usual"]),n)){let n=e.name?.find(e=>c(e,t));if(n)return n}}function l(e){let n=e.given??[];return(e.family?n.concat(e.family):n).join(" ")}function c(e,n){return e.use?e.use===n:"usual"===n}t.d(n,{QC:()=>a,Qr:()=>o,VO:()=>s,Vp:()=>r,qK:()=>i})},90108:function(e,n,t){"use strict";function r(e,n){if(e===n||Object.is(e,n))return!0;if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}if(Array.isArray(n)||"object"!=typeof e||null===e||"object"!=typeof n||null===n)return!1;let t=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(n);return t.length===r.length&&t.every(t=>e[t]===n[t])}t.d(n,{b:()=>r})},22695:function(e,n,t){"use strict";t.d(n,{f:()=>X,I:()=>z,j:()=>Y,c:()=>Z,B:()=>h,n:()=>G,g:()=>ee,r:()=>B,u:()=>T,U:()=>c,d:()=>J,o:()=>q,z:()=>$,s:()=>L,a:()=>p,O:()=>u,e:()=>d,S:()=>Q,i:()=>y,t:()=>M,b:()=>s,m:()=>f});var r=t(35400),a=t(67395),o=Object.prototype.hasOwnProperty;function i(e,n){var t,r;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&i(e[r],n[r]););return -1===r}if(!t||"object"==typeof e){for(t in r=0,e)if(o.call(e,t)&&++r&&!o.call(n,t)||!(t in n)||!i(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!=e&&n!=n}let s=new WeakMap,l=()=>{},c=l(),u=Object,d=e=>e===c,p=e=>"function"==typeof e,f=(e,n)=>({...e,...n}),h=e=>p(e.then),m={},g={},A="undefined",y=typeof window!=A,b=typeof document!=A,v=y&&"Deno"in window,C=()=>y&&typeof window.requestAnimationFrame!=A,$=(e,n)=>{let t=s.get(e);return[()=>!d(n)&&e.get(n)||m,r=>{if(!d(n)){let a=e.get(n);n in g||(g[n]=a),t[5](n,f(a,r),a||m)}},t[6],()=>!d(n)&&n in g?g[n]:!d(n)&&e.get(n)||m]},w=!0,k=()=>w,[E,x]=y&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[l,l],D={isOnline:k,isVisible:()=>{let e=b&&document.visibilityState;return d(e)||"hidden"!==e}},S={initFocus:e=>(b&&document.addEventListener("visibilitychange",e),E("focus",e),()=>{b&&document.removeEventListener("visibilitychange",e),x("focus",e)}),initReconnect:e=>{let n=()=>{w=!0,e()},t=()=>{w=!1};return E("online",n),E("offline",t),()=>{x("online",n),x("offline",t)}}},z=!r.useId,B=!y||v,M=e=>C()?window.requestAnimationFrame(e):setTimeout(e,1),T=B?r.useEffect:r.useLayoutEffect,O="undefined"!=typeof navigator&&navigator.connection,N=!B&&O&&(["slow-2g","2g"].includes(O.effectiveType)||O.saveData),P=new WeakMap,I=e=>u.prototype.toString.call(e),F=(e,n)=>e===`[object ${n}]`,R=0,H=e=>{let n,t,r=typeof e,a=I(e),o=F(a,"Date"),i=F(a,"RegExp"),s=F(a,"Object");if(u(e)!==e||o||i)n=o?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(n=P.get(e))return n;if(n=++R+"~",P.set(e,n),Array.isArray(e)){for(t=0,n="@";t<e.length;t++)n+=H(e[t])+",";P.set(e,n)}if(s){n="#";let r=u.keys(e).sort();for(;!d(t=r.pop());)d(e[t])||(n+=t+":"+H(e[t])+",");P.set(e,n)}}return n},L=e=>{if(p(e))try{e=e()}catch(n){e=""}let n=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?H(e):"",n]},j=0,q=()=>++j;async function G(...e){let[n,t,r,o]=e,i=f({populateCache:!0,throwOnError:!0},"boolean"==typeof o?{revalidate:o}:o||{}),l=i.populateCache,u=i.rollbackOnError,m=i.optimisticData,g=e=>"function"==typeof u?u(e):!1!==u,A=i.throwOnError;if(p(t)){let e=t,r=[];for(let t of n.keys())!/^\$(inf|sub)\$/.test(t)&&e(n.get(t)._k)&&r.push(t);return Promise.all(r.map(y))}return y(t);async function y(t){let o,[u]=L(t);if(!u)return;let[f,y]=$(n,u),[b,v,C,w]=s.get(n),k=()=>{let e=b[u];return(p(i.revalidate)?i.revalidate(f().data,t):!1!==i.revalidate)&&(delete C[u],delete w[u],e&&e[0])?e[0](a.q2).then(()=>f().data):f().data};if(e.length<3)return k();let E=r,x=!1,D=q();v[u]=[D,0];let S=!d(m),z=f(),B=z.data,M=z._c,T=d(M)?B:M;if(S&&y({data:m=p(m)?m(T,B):m,_c:T}),p(E))try{E=E(T)}catch(e){o=e,x=!0}if(E&&h(E)){if(E=await E.catch(e=>{o=e,x=!0}),D!==v[u][0]){if(x)throw o;return E}x&&S&&g(o)&&(l=!0,y({data:T,_c:c}))}if(l&&!x&&(p(l)?y({data:l(E,T),error:c,_c:c}):y({data:E,error:c,_c:c})),v[u][1]=q(),Promise.resolve(k()).then(()=>{y({_c:c})}),x){if(A)throw o;return}return E}}let V=(e,n)=>{for(let t in e)e[t][0]&&e[t][0](n)},U=(e,n)=>{if(!s.has(e)){let t=f(S,n),r=Object.create(null),o=G.bind(c,e),i=l,u=Object.create(null),d=(e,n)=>{let t=u[e]||[];return u[e]=t,t.push(n),()=>t.splice(t.indexOf(n),1)},p=(n,t,r)=>{e.set(n,t);let a=u[n];if(a)for(let e of a)e(t,r)},h=()=>{if(!s.has(e)&&(s.set(e,[r,Object.create(null),Object.create(null),Object.create(null),o,p,d]),!B)){let n=t.initFocus(setTimeout.bind(c,V.bind(c,r,a.CC))),o=t.initReconnect(setTimeout.bind(c,V.bind(c,r,a.jB)));i=()=>{n&&n(),o&&o(),s.delete(e)}}};return h(),[e,o,h,i]}return[e,s.get(e)[4]]},W=(e,n,t,r,a)=>{let o=t.errorRetryCount,i=a.retryCount,s=~~((Math.random()+.5)*(1<<(i<8?i:8)))*t.errorRetryInterval;(d(o)||!(i>o))&&setTimeout(r,s,a)},K=i,[Z,Y]=U(new Map),J=f({onLoadingSlow:l,onSuccess:l,onError:l,onErrorRetry:W,onDiscarded:l,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:N?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:N?5e3:3e3,compare:K,isPaused:()=>!1,cache:Z,mutate:Y,fallback:{}},D),X=(e,n)=>{let t=f(e,n);if(n){let{use:r,fallback:a}=e,{use:o,fallback:i}=n;r&&o&&(t.use=r.concat(o)),a&&i&&(t.fallback=f(a,i))}return t},Q=(0,r.createContext)({}),ee=e=>{let{value:n}=e,t=(0,r.useContext)(Q),a=p(n),o=(0,r.useMemo)(()=>a?n(t):n,[a,t,n]),i=(0,r.useMemo)(()=>a?o:X(t,o),[a,t,o]),s=o&&o.provider,l=(0,r.useRef)(c);s&&!l.current&&(l.current=U(s(i.cache||Z),o));let u=l.current;return u&&(i.cache=u[0],i.mutate=u[1]),T(()=>{if(u)return u[2]&&u[2](),u[3]},[]),(0,r.createElement)(Q.Provider,f(e,{value:i}))}},12215:function(e,n,t){"use strict";t.d(n,{q:()=>r});let r="$inf$"},67395:function(e,n,t){"use strict";t.d(n,{CC:()=>r,I0:()=>i,jB:()=>a,q2:()=>o});let r=0,a=1,o=2,i=3},64764:function(e,n,t){"use strict";t.d(n,{Ht:()=>m,aw:()=>h,qm:()=>f});var r=t(22695),a=t(12215),o=t(35400);let i=r.i&&window.__SWR_DEVTOOLS_USE__,s=i?window.__SWR_DEVTOOLS_USE__:[],l=()=>{i&&(window.__SWR_DEVTOOLS_REACT__=o)},c=e=>(0,r.a)(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],u=()=>{let e=(0,o.useContext)(r.S);return(0,o.useMemo)(()=>(0,r.m)(r.d,e),[e])},d=e=>(n,t,o)=>{let i=t&&((...e)=>{let[o]=(0,r.s)(n),[,,,i]=r.b.get(r.c);if(o.startsWith(a.q))return t(...e);let s=i[o];return(0,r.e)(s)?t(...e):(delete i[o],s)});return e(n,i,o)},p=s.concat(d),f=e=>function(...n){let t=u(),[a,o,i]=c(n),s=(0,r.f)(t,i),l=e,{use:d}=s,f=(d||[]).concat(p);for(let e=f.length;e--;)l=f[e](l);return l(a,o||s.fetcher||null,s)},h=(e,n,t)=>{let r=n[e]||(n[e]=[]);return r.push(t),()=>{let e=r.indexOf(t);e>=0&&(r[e]=r[r.length-1],r.pop())}},m=(e,n)=>(...t)=>{let[r,a,o]=c(t),i=(o.use||[]).concat(n);return e(r,a,{...o,use:i})};l()},13624:function(e,n,t){"use strict";t.d(n,{Ay:()=>w,BE:()=>$});var r=t(35400),a=t(58139),o=t(22695),i=t(67395),s=t(64764);let l=()=>{},c=l(),u=null,d=e=>e===c,p=e=>"function"==typeof e,f=new WeakMap,h=e=>u.prototype.toString.call(e),m=(e,n)=>e===`[object ${n}]`,g=0,A=e=>{let n,t,r=typeof e,a=h(e),o=m(a,"Date"),i=m(a,"RegExp"),s=m(a,"Object");if(u(e)!==e||o||i)n=o?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(n=f.get(e))return n;if(n=++g+"~",f.set(e,n),Array.isArray(e)){for(t=0,n="@";t<e.length;t++)n+=A(e[t])+",";f.set(e,n)}if(s){n="#";let r=u.keys(e).sort();for(;!d(t=r.pop());)d(e[t])||(n+=t+":"+A(e[t])+",");f.set(e,n)}}return n},y=r.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(n=>{e.status="fulfilled",e.value=n},n=>{e.status="rejected",e.reason=n}),e}}),b={dedupe:!0},v=Promise.resolve(o.U),C=(e,n,t)=>{let{cache:l,compare:c,suspense:u,fallbackData:d,revalidateOnMount:p,revalidateIfStale:f,refreshInterval:h,refreshWhenHidden:m,refreshWhenOffline:g,keepPreviousData:A}=t,[C,$,w,k]=o.b.get(l),[E,x]=(0,o.s)(e),D=(0,r.useRef)(!1),S=(0,r.useRef)(!1),z=(0,r.useRef)(E),B=(0,r.useRef)(n),M=(0,r.useRef)(t),T=()=>M.current,O=()=>T().isVisible()&&T().isOnline(),[N,P,I,F]=(0,o.z)(l,E),R=(0,r.useRef)({}).current,H=(0,o.e)(d)?(0,o.e)(t.fallback)?o.U:t.fallback[E]:d,L=(e,n)=>{for(let t in R){let r=t;if("data"===r){if(!c(e[r],n[r])&&(!(0,o.e)(e[r])||!c(Y,n[r])))return!1}else if(n[r]!==e[r])return!1}return!0},j=(0,r.useMemo)(()=>{let e=!!E&&!!n&&((0,o.e)(p)?!T().isPaused()&&!u&&!1!==f:p),t=n=>{let t=(0,o.m)(n);return(delete t._k,e)?{isValidating:!0,isLoading:!0,...t}:t},r=N(),a=F(),i=t(r),s=r===a?i:t(a),l=i;return[()=>{let e=t(N());return L(e,l)?(l.data=e.data,l.isLoading=e.isLoading,l.isValidating=e.isValidating,l.error=e.error,l):(l=e,e)},()=>s]},[l,E]),q=(0,a.useSyncExternalStore)((0,r.useCallback)(e=>I(E,(n,t)=>{L(t,n)||e()}),[l,E]),j[0],j[1]),G=!D.current,V=C[E]&&C[E].length>0,U=q.data,W=(0,o.e)(U)?H&&(0,o.B)(H)?y(H):H:U,K=q.error,Z=(0,r.useRef)(W),Y=A?(0,o.e)(U)?(0,o.e)(Z.current)?W:Z.current:U:W,J=(!V||!!(0,o.e)(K))&&(G&&!(0,o.e)(p)?p:!T().isPaused()&&(u?!(0,o.e)(W)&&f:(0,o.e)(W)||f)),X=!!(E&&n&&G&&J),Q=(0,o.e)(q.isValidating)?X:q.isValidating,ee=(0,o.e)(q.isLoading)?X:q.isLoading,en=(0,r.useCallback)(async e=>{let n,r,a=B.current;if(!E||!a||S.current||T().isPaused())return!1;let s=!0,l=e||{},u=!w[E]||!l.dedupe,d=()=>o.I?!S.current&&E===z.current&&D.current:E===z.current,p={isValidating:!1,isLoading:!1},f=()=>{P(p)},h=()=>{let e=w[E];e&&e[1]===r&&delete w[E]},m={isValidating:!0};(0,o.e)(N().data)&&(m.isLoading=!0);try{if(u&&(P(m),t.loadingTimeout&&(0,o.e)(N().data)&&setTimeout(()=>{s&&d()&&T().onLoadingSlow(E,t)},t.loadingTimeout),w[E]=[a(x),(0,o.o)()]),[n,r]=w[E],n=await n,u&&setTimeout(h,t.dedupingInterval),!w[E]||w[E][1]!==r)return u&&d()&&T().onDiscarded(E),!1;p.error=o.U;let e=$[E];if(!(0,o.e)(e)&&(r<=e[0]||r<=e[1]||0===e[1]))return f(),u&&d()&&T().onDiscarded(E),!1;let i=N().data;p.data=c(i,n)?i:n,u&&d()&&T().onSuccess(n,E,t)}catch(t){h();let e=T(),{shouldRetryOnError:n}=e;!e.isPaused()&&(p.error=t,u&&d()&&(e.onError(t,E,e),(!0===n||(0,o.a)(n)&&n(t))&&(!T().revalidateOnFocus||!T().revalidateOnReconnect||O())&&e.onErrorRetry(t,E,e,e=>{let n=C[E];n&&n[0]&&n[0](i.I0,e)},{retryCount:(l.retryCount||0)+1,dedupe:!0})))}return s=!1,f(),!0},[E,l]),et=(0,r.useCallback)((...e)=>(0,o.n)(l,z.current,...e),[]);if((0,o.u)(()=>{B.current=n,M.current=t,(0,o.e)(U)||(Z.current=U)}),(0,o.u)(()=>{if(!E)return;let e=en.bind(o.U,b),n=0;T().revalidateOnFocus&&(n=Date.now()+T().focusThrottleInterval);let t=(t,r={})=>{if(t==i.CC){let t=Date.now();T().revalidateOnFocus&&t>n&&O()&&(n=t+T().focusThrottleInterval,e())}else if(t==i.jB)T().revalidateOnReconnect&&O()&&e();else if(t==i.q2)return en();else if(t==i.I0)return en(r)},r=(0,s.aw)(E,C,t);return S.current=!1,z.current=E,D.current=!0,P({_k:x}),J&&!w[E]&&((0,o.e)(W)||o.r?e():(0,o.t)(e)),()=>{S.current=!0,r()}},[E]),(0,o.u)(()=>{let e;function n(){let n=(0,o.a)(h)?h(N().data):h;n&&-1!==e&&(e=setTimeout(t,n))}function t(){!N().error&&(m||T().isVisible())&&(g||T().isOnline())?en(b).then(n):n()}return n(),()=>{e&&(clearTimeout(e),e=-1)}},[h,m,g,E]),(0,r.useDebugValue)(Y),u){let e=E&&(0,o.e)(W);if(!o.I&&o.r&&e)throw Error("Fallback data is required when using Suspense in SSR.");e&&(B.current=n,M.current=t,S.current=!1);let r=k[E];if(y(!(0,o.e)(r)&&e?et(r):v),!(0,o.e)(K)&&e)throw K;let a=e?en(b):v;!(0,o.e)(Y)&&e&&(a.status="fulfilled",a.value=!0),y(a)}return{mutate:et,get data(){return R.data=!0,Y},get error(){return R.error=!0,K},get isValidating(){return R.isValidating=!0,Q},get isLoading(){return R.isLoading=!0,ee}}},$=o.O.defineProperty(o.g,"defaultValue",{value:o.d}),w=(0,s.qm)(C)},51280:function(e,n,t){"use strict";t.r(n),t.d(n,{__addDisposableResource:()=>P,__assign:()=>o,__asyncDelegator:()=>E,__asyncGenerator:()=>k,__asyncValues:()=>x,__await:()=>w,__awaiter:()=>h,__classPrivateFieldGet:()=>T,__classPrivateFieldIn:()=>N,__classPrivateFieldSet:()=>O,__createBinding:()=>g,__decorate:()=>s,__disposeResources:()=>F,__esDecorate:()=>c,__exportStar:()=>A,__extends:()=>a,__generator:()=>m,__importDefault:()=>M,__importStar:()=>B,__makeTemplateObject:()=>D,__metadata:()=>f,__param:()=>l,__propKey:()=>d,__read:()=>b,__rest:()=>i,__rewriteRelativeImportExtension:()=>R,__runInitializers:()=>u,__setFunctionName:()=>p,__spread:()=>v,__spreadArray:()=>$,__spreadArrays:()=>C,__values:()=>y,default:()=>H});var r=function(e,n){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])})(e,n)};function a(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}r(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var o=function(){return(o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var a in n=arguments[t])Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a]);return e}).apply(this,arguments)};function i(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>n.indexOf(r)&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)0>n.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(t[r[a]]=e[r[a]]);return t}function s(e,n,t,r){var a,o=arguments.length,i=o<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,n,t,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(o<3?a(i):o>3?a(n,t,i):a(n,t))||i);return o>3&&i&&Object.defineProperty(n,t,i),i}function l(e,n){return function(t,r){n(t,r,e)}}function c(e,n,t,r,a,o){function i(e){if(void 0!==e&&"function"!=typeof e)throw TypeError("Function expected");return e}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!n&&e?r.static?e:e.prototype:null,d=n||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),p=!1,f=t.length-1;f>=0;f--){var h={};for(var m in r)h[m]="access"===m?{}:r[m];for(var m in r.access)h.access[m]=r.access[m];h.addInitializer=function(e){if(p)throw TypeError("Cannot add initializers after decoration has completed");o.push(i(e||null))};var g=(0,t[f])("accessor"===l?{get:d.get,set:d.set}:d[c],h);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw TypeError("Object expected");(s=i(g.get))&&(d.get=s),(s=i(g.set))&&(d.set=s),(s=i(g.init))&&a.unshift(s)}else(s=i(g))&&("field"===l?a.unshift(s):d[c]=s)}u&&Object.defineProperty(u,r.name,d),p=!0}function u(e,n,t){for(var r=arguments.length>2,a=0;a<n.length;a++)t=r?n[a].call(e,t):n[a].call(e);return r?t:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function p(e,n,t){return"symbol"==typeof n&&(n=n.description?"[".concat(n.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:t?"".concat(t," ",n):n})}function f(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}function h(e,n,t,r){function a(e){return e instanceof t?e:new t(function(n){n(e)})}return new(t||(t=Promise))(function(t,o){function i(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){e.done?t(e.value):a(e.value).then(i,s)}l((r=r.apply(e,n||[])).next())})}function m(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(n){return l([e,n])}}function l(s){if(t)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],r=0}finally{t=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}var g=Object.create?function(e,n,t,r){void 0===r&&(r=t);var a=Object.getOwnPropertyDescriptor(n,t);(!a||("get"in a?!n.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,a)}:function(e,n,t,r){void 0===r&&(r=t),e[r]=n[t]};function A(e,n){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(n,t)||g(n,e,t)}function y(e){var n="function"==typeof Symbol&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,a,o=t.call(e),i=[];try{for(;(void 0===n||n-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(a)throw a.error}}return i}function v(){for(var e=[],n=0;n<arguments.length;n++)e=e.concat(b(arguments[n]));return e}function C(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;for(var r=Array(e),a=0,n=0;n<t;n++)for(var o=arguments[n],i=0,s=o.length;i<s;i++,a++)r[a]=o[i];return r}function $(e,n,t){if(t||2==arguments.length)for(var r,a=0,o=n.length;a<o;a++)!r&&a in n||(r||(r=Array.prototype.slice.call(n,0,a)),r[a]=n[a]);return e.concat(r||Array.prototype.slice.call(n))}function w(e){return this instanceof w?(this.v=e,this):new w(e)}function k(e,n,t){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var r,a=t.apply(e,n||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",i),r[Symbol.asyncIterator]=function(){return this},r;function i(e){return function(n){return Promise.resolve(n).then(e,d)}}function s(e,n){a[e]&&(r[e]=function(n){return new Promise(function(t,r){o.push([e,n,t,r])>1||l(e,n)})},n&&(r[e]=n(r[e])))}function l(e,n){try{c(a[e](n))}catch(e){p(o[0][3],e)}}function c(e){e.value instanceof w?Promise.resolve(e.value.v).then(u,d):p(o[0][2],e)}function u(e){l("next",e)}function d(e){l("throw",e)}function p(e,n){e(n),o.shift(),o.length&&l(o[0][0],o[0][1])}}function E(e){var n,t;return n={},r("next"),r("throw",function(e){throw e}),r("return"),n[Symbol.iterator]=function(){return this},n;function r(r,a){n[r]=e[r]?function(n){return(t=!t)?{value:w(e[r](n)),done:!1}:a?a(n):n}:a}}function x(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,t=e[Symbol.asyncIterator];return t?t.call(e):(e=y(e),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,o){a(r,o,(n=e[t](n)).done,n.value)})}}function a(e,n,t,r){Promise.resolve(r).then(function(n){e({value:n,done:t})},n)}}function D(e,n){return Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,e}var S=Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n},z=function(e){return(z=Object.getOwnPropertyNames||function(e){var n=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[n.length]=t);return n})(e)};function B(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var t=z(e),r=0;r<t.length;r++)"default"!==t[r]&&g(n,e,t[r]);return S(n,e),n}function M(e){return e&&e.__esModule?e:{default:e}}function T(e,n,t,r){if("a"===t&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof n?e!==n||!r:!n.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?r:"a"===t?r.call(e):r?r.value:n.get(e)}function O(e,n,t,r,a){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!a)throw TypeError("Private accessor was defined without a setter");if("function"==typeof n?e!==n||!a:!n.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(e,t):a?a.value=t:n.set(e,t),t}function N(e,n){if(null===n||"object"!=typeof n&&"function"!=typeof n)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?n===e:e.has(n)}function P(e,n,t){if(null!=n){var r,a;if("object"!=typeof n&&"function"!=typeof n)throw TypeError("Object expected.");if(t){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");r=n[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");r=n[Symbol.dispose],t&&(a=r)}if("function"!=typeof r)throw TypeError("Object not disposable.");a&&(r=function(){try{a.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:n,dispose:r,async:t})}else t&&e.stack.push({async:!0});return n}var I="function"==typeof SuppressedError?SuppressedError:function(e,n,t){var r=Error(t);return r.name="SuppressedError",r.error=e,r.suppressed=n,r};function F(e){function n(n){e.error=e.hasError?new I(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}var t,r=0;function a(){for(;t=e.stack.pop();)try{if(!t.async&&1===r)return r=0,e.stack.push(t),Promise.resolve().then(a);if(t.dispose){var o=t.dispose.call(t.value);if(t.async)return r|=2,Promise.resolve(o).then(a,function(e){return n(e),a()})}else r|=1}catch(e){n(e)}if(1===r)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return a()}function R(e,n){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,t,r,a,o){return t?n?".jsx":".js":!r||a&&o?r+a+"."+o.toLowerCase()+"js":e}):e}let H={__extends:a,__assign:o,__rest:i,__decorate:s,__param:l,__esDecorate:c,__runInitializers:u,__propKey:d,__setFunctionName:p,__metadata:f,__awaiter:h,__generator:m,__createBinding:g,__exportStar:A,__values:y,__read:b,__spread:v,__spreadArrays:C,__spreadArray:$,__await:w,__asyncGenerator:k,__asyncDelegator:E,__asyncValues:x,__makeTemplateObject:D,__importStar:B,__importDefault:M,__classPrivateFieldGet:T,__classPrivateFieldSet:O,__classPrivateFieldIn:N,__addDisposableResource:P,__disposeResources:F,__rewriteRelativeImportExtension:R}},50574:function(e,n,t){"use strict";t.d(n,{Ay:()=>c});var r={};t.r(r),t.d(r,{BRAND:()=>s.qt,DIRTY:()=>o.jm,EMPTY_PATH:()=>o.I3,INVALID:()=>o.uY,NEVER:()=>s.tm,OK:()=>o.OK,ParseStatus:()=>o.MY,Schema:()=>s.Sj,ZodAny:()=>s.Ml,ZodArray:()=>s.n,ZodBigInt:()=>s.Lr,ZodBoolean:()=>s.WF,ZodBranded:()=>s.eN,ZodCatch:()=>s.hw,ZodDate:()=>s.aP,ZodDefault:()=>s.Xi,ZodDiscriminatedUnion:()=>s.jv,ZodEffects:()=>s.k1,ZodEnum:()=>s.Vb,ZodError:()=>l.G,ZodFirstPartyTypeKind:()=>s.kY,ZodFunction:()=>s.CZ,ZodIntersection:()=>s.Jv,ZodIssueCode:()=>l.eq,ZodLazy:()=>s.Ih,ZodLiteral:()=>s.DN,ZodMap:()=>s.Ut,ZodNaN:()=>s.Tq,ZodNativeEnum:()=>s.WM,ZodNever:()=>s.iS,ZodNull:()=>s.PQ,ZodNullable:()=>s.l1,ZodNumber:()=>s.rS,ZodObject:()=>s.bv,ZodOptional:()=>s.Ii,ZodParsedType:()=>i.Zp,ZodPipeline:()=>s._c,ZodPromise:()=>s.$i,ZodReadonly:()=>s.EV,ZodRecord:()=>s.b8,ZodSchema:()=>s.lK,ZodSet:()=>s.Kz,ZodString:()=>s.ND,ZodSymbol:()=>s.K5,ZodTransformer:()=>s.BG,ZodTuple:()=>s.y0,ZodType:()=>s.aR,ZodUndefined:()=>s._Z,ZodUnion:()=>s.fZ,ZodUnknown:()=>s._,ZodVoid:()=>s.a0,addIssueToContext:()=>o.zn,any:()=>s.bz,array:()=>s.YO,bigint:()=>s.o,boolean:()=>s.zM,coerce:()=>s.au,custom:()=>s.Ie,date:()=>s.p6,datetimeRegex:()=>s.fm,defaultErrorMap:()=>a.su,discriminatedUnion:()=>s.gM,effect:()=>s.QZ,enum:()=>s.k5,function:()=>s.fH,getErrorMap:()=>a.$W,getParsedType:()=>i.CR,instanceof:()=>s.Nl,intersection:()=>s.E$,isAborted:()=>o.G4,isAsync:()=>o.xP,isDirty:()=>o.DM,isValid:()=>o.fn,late:()=>s.fn,lazy:()=>s.RZ,literal:()=>s.eu,makeIssue:()=>o.y7,map:()=>s.Tj,nan:()=>s.oi,nativeEnum:()=>s.fc,never:()=>s.Zm,null:()=>s.ch,nullable:()=>s.me,number:()=>s.ai,object:()=>s.Ik,objectUtil:()=>i.o6,oboolean:()=>s.yN,onumber:()=>s.p7,optional:()=>s.lq,ostring:()=>s.Di,pipeline:()=>s.Tk,preprocess:()=>s.vk,promise:()=>s.iv,quotelessJson:()=>l.WI,record:()=>s.g1,set:()=>s.hZ,setErrorMap:()=>a.pJ,strictObject:()=>s.re,string:()=>s.Yj,symbol:()=>s.HR,transformer:()=>s.Gu,tuple:()=>s.PV,undefined:()=>s.Vx,union:()=>s.KC,unknown:()=>s.L5,util:()=>i.ZS,void:()=>s.rI});var a=t(77939),o=t(88559),i=t(39378),s=t(57078),l=t(44341);let c=r},44341:function(e,n,t){"use strict";t.d(n,{G:()=>i,WI:()=>o,eq:()=>a});var r=t(39378);let a=r.ZS.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),o=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class i extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(e){return e.message},t={_errors:[]},r=e=>{for(let a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)t._errors.push(n(a));else{let e=t,r=0;for(;r<a.path.length;){let t=a.path[r];r===a.path.length-1?(e[t]=e[t]||{_errors:[]},e[t]._errors.push(n(a))):e[t]=e[t]||{_errors:[]},e=e[t],r++}}};return r(this),t}static assert(e){if(!(e instanceof i))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.ZS.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let n={},t=[];for(let r of this.issues)if(r.path.length>0){let t=r.path[0];n[t]=n[t]||[],n[t].push(e(r))}else t.push(e(r));return{formErrors:t,fieldErrors:n}}get formErrors(){return this.flatten()}}i.create=e=>new i(e)},77939:function(e,n,t){"use strict";t.d(n,{$W:()=>i,pJ:()=>o,su:()=>r.A});var r=t(15011);let a=r.A;function o(e){a=e}function i(){return a}},88559:function(e,n,t){"use strict";t.d(n,{DM:()=>f,G4:()=>p,I3:()=>i,MY:()=>l,OK:()=>d,fn:()=>h,jm:()=>u,uY:()=>c,xP:()=>m,y7:()=>o,zn:()=>s});var r=t(77939),a=t(15011);let o=e=>{let{data:n,path:t,errorMaps:r,issueData:a}=e,o=[...t,...a.path||[]],i={...a,path:o};if(void 0!==a.message)return{...a,path:o,message:a.message};let s="";for(let e of r.filter(e=>!!e).slice().reverse())s=e(i,{data:n,defaultError:s}).message;return{...a,path:o,message:s}},i=[];function s(e,n){let t=(0,r.$W)(),i=o({issueData:n,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,t,t===a.A?void 0:a.A].filter(e=>!!e)});e.common.issues.push(i)}class l{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,n){let t=[];for(let r of n){if("aborted"===r.status)return c;"dirty"===r.status&&e.dirty(),t.push(r.value)}return{status:e.value,value:t}}static async mergeObjectAsync(e,n){let t=[];for(let e of n){let n=await e.key,r=await e.value;t.push({key:n,value:r})}return l.mergeObjectSync(e,t)}static mergeObjectSync(e,n){let t={};for(let r of n){let{key:n,value:a}=r;if("aborted"===n.status||"aborted"===a.status)return c;"dirty"===n.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"!==n.value&&(void 0!==a.value||r.alwaysSet)&&(t[n.value]=a.value)}return{status:e.value,value:t}}}let c=Object.freeze({status:"aborted"}),u=e=>({status:"dirty",value:e}),d=e=>({status:"valid",value:e}),p=e=>"aborted"===e.status,f=e=>"dirty"===e.status,h=e=>"valid"===e.status,m=e=>"undefined"!=typeof Promise&&e instanceof Promise},39378:function(e,n,t){"use strict";var r,a;t.d(n,{CR:()=>i,ZS:()=>r,Zp:()=>o,o6:()=>a}),function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw Error()},e.arrayToEnum=e=>{let n={};for(let t of e)n[t]=t;return n},e.getValidEnumValues=n=>{let t=e.objectKeys(n).filter(e=>"number"!=typeof n[n[e]]),r={};for(let e of t)r[e]=n[e];return e.objectValues(r)},e.objectValues=n=>e.objectKeys(n).map(function(e){return n[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let n=[];for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);return n},e.find=(e,n)=>{for(let t of e)if(n(t))return t},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,n=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(n)},e.jsonStringifyReplacer=(e,n)=>"bigint"==typeof n?n.toString():n}(r||(r={})),function(e){e.mergeShapes=(e,n)=>({...e,...n})}(a||(a={}));let o=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return o.undefined;case"string":return o.string;case"number":return Number.isNaN(e)?o.nan:o.number;case"boolean":return o.boolean;case"function":return o.function;case"bigint":return o.bigint;case"symbol":return o.symbol;case"object":if(Array.isArray(e))return o.array;if(null===e)return o.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return o.promise;if("undefined"!=typeof Map&&e instanceof Map)return o.map;if("undefined"!=typeof Set&&e instanceof Set)return o.set;if("undefined"!=typeof Date&&e instanceof Date)return o.date;return o.object;default:return o.unknown}}},15011:function(e,n,t){"use strict";t.d(n,{A:()=>o});var r=t(44341),a=t(39378);let o=(e,n)=>{let t;switch(e.code){case r.eq.invalid_type:t=e.received===a.Zp.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case r.eq.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(e.expected,a.ZS.jsonStringifyReplacer)}`;break;case r.eq.unrecognized_keys:t=`Unrecognized key(s) in object: ${a.ZS.joinValues(e.keys,", ")}`;break;case r.eq.invalid_union:t="Invalid input";break;case r.eq.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${a.ZS.joinValues(e.options)}`;break;case r.eq.invalid_enum_value:t=`Invalid enum value. Expected ${a.ZS.joinValues(e.options)}, received '${e.received}'`;break;case r.eq.invalid_arguments:t="Invalid function arguments";break;case r.eq.invalid_return_type:t="Invalid function return type";break;case r.eq.invalid_date:t="Invalid date";break;case r.eq.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(t=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(t=`${t} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?t=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?t=`Invalid input: must end with "${e.validation.endsWith}"`:a.ZS.assertNever(e.validation):t="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case r.eq.too_small:t="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case r.eq.too_big:t="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case r.eq.custom:t="Invalid input";break;case r.eq.invalid_intersection_types:t="Intersection results could not be merged";break;case r.eq.not_multiple_of:t=`Number must be a multiple of ${e.multipleOf}`;break;case r.eq.not_finite:t="Number must be finite";break;default:t=n.defaultError,a.ZS.assertNever(e)}return{message:t}}},57078:function(e,n,t){"use strict";let r;t.d(n,{ch:()=>eR,WM:()=>eh,Vx:()=>eF,Ik:()=>eV,b8:()=>es,Nl:()=>ez,p7:()=>nt,Tj:()=>eX,l1:()=>ey,ND:()=>R,gM:()=>eK,Vb:()=>e_,Lr:()=>j,Ii:()=>eA,a0:()=>J,zM:()=>eN,au:()=>na,fm:()=>N,iv:()=>e5,Tq:()=>eC,oi:()=>eT,n:()=>X,RZ:()=>e1,hZ:()=>eQ,yN:()=>nr,hw:()=>ev,Jv:()=>eo,rS:()=>L,EV:()=>eE,Ie:()=>eD,Zm:()=>ej,vk:()=>e9,$i:()=>em,re:()=>eU,_Z:()=>U,K5:()=>V,DN:()=>ep,Kz:()=>ec,iS:()=>Y,aR:()=>h,_c:()=>ek,eu:()=>e2,jv:()=>er,CZ:()=>eu,_:()=>Z,g1:()=>eJ,HR:()=>eI,fH:()=>e0,aP:()=>G,YO:()=>eG,Di:()=>nn,Tk:()=>ne,o:()=>eO,PQ:()=>W,k5:()=>e3,tm:()=>no,fZ:()=>en,BG:()=>eg,p6:()=>eP,fn:()=>eS,fc:()=>e4,Yj:()=>eB,Ih:()=>ed,KC:()=>eW,L5:()=>eL,bz:()=>eH,Ml:()=>K,Sj:()=>h,k1:()=>eg,kY:()=>o,lK:()=>h,y0:()=>ei,qt:()=>e$,me:()=>e7,ai:()=>eM,PV:()=>eY,rI:()=>eq,E$:()=>eZ,WF:()=>q,lq:()=>e8,Gu:()=>e6,Ut:()=>el,eN:()=>ew,Xi:()=>eb,bv:()=>ee,QZ:()=>e6});var a,o,i=t(44341),s=t(77939),l=t(15011);!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(a||(a={}));var c=t(88559),u=t(39378);class d{constructor(e,n,t,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=t,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let p=(e,n)=>{if((0,c.fn)(n))return{success:!0,data:n.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new i.G(e.common.issues);return this._error=n,this._error}}};function f(e){if(!e)return{};let{errorMap:n,invalid_type_error:t,required_error:r,description:a}=e;if(n&&(t||r))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return n?{errorMap:n,description:a}:{errorMap:(n,a)=>{let{message:o}=e;return"invalid_enum_value"===n.code?{message:o??a.defaultError}:void 0===a.data?{message:o??r??a.defaultError}:"invalid_type"!==n.code?{message:a.defaultError}:{message:o??t??a.defaultError}},description:a}}class h{get description(){return this._def.description}_getType(e){return(0,u.CR)(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:(0,u.CR)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new c.MY,ctx:{common:e.parent.common,data:e.data,parsedType:(0,u.CR)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if((0,c.xP)(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,n){let t=this.safeParse(e,n);if(t.success)return t.data;throw t.error}safeParse(e,n){let t={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,u.CR)(e)},r=this._parseSync({data:e,path:t.path,parent:t});return p(t,r)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,u.CR)(e)};if(!this["~standard"].async)try{let t=this._parseSync({data:e,path:[],parent:n});return(0,c.fn)(t)?{value:t.value}:{issues:n.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(e=>(0,c.fn)(e)?{value:e.value}:{issues:n.common.issues})}async parseAsync(e,n){let t=await this.safeParseAsync(e,n);if(t.success)return t.data;throw t.error}async safeParseAsync(e,n){let t={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,u.CR)(e)},r=this._parse({data:e,path:t.path,parent:t});return p(t,await ((0,c.xP)(r)?r:Promise.resolve(r)))}refine(e,n){let t=e=>"string"==typeof n||void 0===n?{message:n}:"function"==typeof n?n(e):n;return this._refinement((n,r)=>{let a=e(n),o=()=>r.addIssue({code:i.eq.custom,...t(n)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then(e=>!!e||(o(),!1)):!!a||(o(),!1)})}refinement(e,n){return this._refinement((t,r)=>!!e(t)||(r.addIssue("function"==typeof n?n(t,r):n),!1))}_refinement(e){return new eg({schema:this,typeName:o.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return eA.create(this,this._def)}nullable(){return ey.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return X.create(this)}promise(){return em.create(this,this._def)}or(e){return en.create([this,e],this._def)}and(e){return eo.create(this,e,this._def)}transform(e){return new eg({...f(this._def),schema:this,typeName:o.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n="function"==typeof e?e:()=>e;return new eb({...f(this._def),innerType:this,defaultValue:n,typeName:o.ZodDefault})}brand(){return new ew({typeName:o.ZodBranded,type:this,...f(this._def)})}catch(e){let n="function"==typeof e?e:()=>e;return new ev({...f(this._def),innerType:this,catchValue:n,typeName:o.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return ek.create(this,e)}readonly(){return eE.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let m=/^c[^\s-]{8,}$/i,g=/^[0-9a-z]+$/,A=/^[0-9A-HJKMNP-TV-Z]{26}$/i,y=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,b=/^[a-z0-9_-]{21}$/i,v=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,C=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,$=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,w="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",k=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,E=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,x=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,D=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,S=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,B="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",M=RegExp(`^${B}$`);function T(e){let n="[0-5]\\d";e.precision?n=`${n}\\.\\d{${e.precision}}`:null==e.precision&&(n=`${n}(\\.\\d+)?`);let t=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${t}`}function O(e){return RegExp(`^${T(e)}$`)}function N(e){let n=`${B}T${T(e)}`,t=[];return t.push(e.local?"Z?":"Z"),e.offset&&t.push("([+-]\\d{2}:?\\d{2})"),n=`${n}(${t.join("|")})`,RegExp(`^${n}$`)}function P(e,n){return!!(("v4"===n||!n)&&k.test(e)||("v6"===n||!n)&&x.test(e))}function I(e,n){if(!v.test(e))return!1;try{let[t]=e.split(".");if(!t)return!1;let r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(r));if("object"!=typeof a||null===a||"typ"in a&&a?.typ!=="JWT"||!a.alg||n&&a.alg!==n)return!1;return!0}catch{return!1}}function F(e,n){return!!(("v4"===n||!n)&&E.test(e)||("v6"===n||!n)&&D.test(e))}class R extends h{_parse(e){let n;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.Zp.string){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.string,received:n.parsedType}),c.uY}let t=new c.MY;for(let a of this._def.checks)if("min"===a.kind)e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("max"===a.kind)e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("length"===a.kind){let r=e.data.length>a.value,o=e.data.length<a.value;(r||o)&&(n=this._getOrReturnCtx(e,n),r?(0,c.zn)(n,{code:i.eq.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&(0,c.zn)(n,{code:i.eq.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),t.dirty())}else if("email"===a.kind)$.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"email",code:i.eq.invalid_string,message:a.message}),t.dirty());else if("emoji"===a.kind)r||(r=RegExp(w,"u")),r.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"emoji",code:i.eq.invalid_string,message:a.message}),t.dirty());else if("uuid"===a.kind)y.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"uuid",code:i.eq.invalid_string,message:a.message}),t.dirty());else if("nanoid"===a.kind)b.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"nanoid",code:i.eq.invalid_string,message:a.message}),t.dirty());else if("cuid"===a.kind)m.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"cuid",code:i.eq.invalid_string,message:a.message}),t.dirty());else if("cuid2"===a.kind)g.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"cuid2",code:i.eq.invalid_string,message:a.message}),t.dirty());else if("ulid"===a.kind)A.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"ulid",code:i.eq.invalid_string,message:a.message}),t.dirty());else if("url"===a.kind)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"url",code:i.eq.invalid_string,message:a.message}),t.dirty()}else"regex"===a.kind?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"regex",code:i.eq.invalid_string,message:a.message}),t.dirty())):"trim"===a.kind?e.data=e.data.trim():"includes"===a.kind?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),t.dirty()):"toLowerCase"===a.kind?e.data=e.data.toLowerCase():"toUpperCase"===a.kind?e.data=e.data.toUpperCase():"startsWith"===a.kind?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.invalid_string,validation:{startsWith:a.value},message:a.message}),t.dirty()):"endsWith"===a.kind?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.invalid_string,validation:{endsWith:a.value},message:a.message}),t.dirty()):"datetime"===a.kind?N(a).test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.invalid_string,validation:"datetime",message:a.message}),t.dirty()):"date"===a.kind?M.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.invalid_string,validation:"date",message:a.message}),t.dirty()):"time"===a.kind?O(a).test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.invalid_string,validation:"time",message:a.message}),t.dirty()):"duration"===a.kind?C.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"duration",code:i.eq.invalid_string,message:a.message}),t.dirty()):"ip"===a.kind?P(e.data,a.version)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"ip",code:i.eq.invalid_string,message:a.message}),t.dirty()):"jwt"===a.kind?I(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"jwt",code:i.eq.invalid_string,message:a.message}),t.dirty()):"cidr"===a.kind?F(e.data,a.version)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"cidr",code:i.eq.invalid_string,message:a.message}),t.dirty()):"base64"===a.kind?S.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"base64",code:i.eq.invalid_string,message:a.message}),t.dirty()):"base64url"===a.kind?z.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"base64url",code:i.eq.invalid_string,message:a.message}),t.dirty()):u.ZS.assertNever(a);return{status:t.value,value:e.data}}_regex(e,n,t){return this.refinement(n=>e.test(n),{validation:n,code:i.eq.invalid_string,...a.errToObj(t)})}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...a.errToObj(e)})}url(e){return this._addCheck({kind:"url",...a.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...a.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...a.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...a.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...a.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...a.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...a.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...a.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...a.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...a.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...a.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...a.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...a.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...a.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...a.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...a.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...a.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...a.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...a.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...a.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...a.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...a.errToObj(n)})}nonempty(e){return this.min(1,a.errToObj(e))}trim(){return new R({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let n of this._def.checks)"min"===n.kind&&(null===e||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)"max"===n.kind&&(null===e||n.value<e)&&(e=n.value);return e}}function H(e,n){let t=(e.toString().split(".")[1]||"").length,r=(n.toString().split(".")[1]||"").length,a=t>r?t:r;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(n.toFixed(a).replace(".",""))/10**a}R.create=e=>new R({checks:[],typeName:o.ZodString,coerce:e?.coerce??!1,...f(e)});class L extends h{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let n;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.Zp.number){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.number,received:n.parsedType}),c.uY}let t=new c.MY;for(let r of this._def.checks)"int"===r.kind?u.ZS.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.invalid_type,expected:"integer",received:"float",message:r.message}),t.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),t.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),t.dirty()):"multipleOf"===r.kind?0!==H(e.data,r.value)&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.not_multiple_of,multipleOf:r.value,message:r.message}),t.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.not_finite,message:r.message}),t.dirty()):u.ZS.assertNever(r);return{status:t.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,a.toString(n))}gt(e,n){return this.setLimit("min",e,!1,a.toString(n))}lte(e,n){return this.setLimit("max",e,!0,a.toString(n))}lt(e,n){return this.setLimit("max",e,!1,a.toString(n))}setLimit(e,n,t,r){return new L({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:t,message:a.toString(r)}]})}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:a.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:a.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:a.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:a.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:a.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:a.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:a.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:a.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:a.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)"min"===n.kind&&(null===e||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)"max"===n.kind&&(null===e||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&u.ZS.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let t of this._def.checks)if("finite"===t.kind||"int"===t.kind||"multipleOf"===t.kind)return!0;else"min"===t.kind?(null===n||t.value>n)&&(n=t.value):"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return Number.isFinite(n)&&Number.isFinite(e)}}L.create=e=>new L({checks:[],typeName:o.ZodNumber,coerce:e?.coerce||!1,...f(e)});class j extends h{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let n;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.Zp.bigint)return this._getInvalidInput(e);let t=new c.MY;for(let r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),t.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),t.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.not_multiple_of,multipleOf:r.value,message:r.message}),t.dirty()):u.ZS.assertNever(r);return{status:t.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.bigint,received:n.parsedType}),c.uY}gte(e,n){return this.setLimit("min",e,!0,a.toString(n))}gt(e,n){return this.setLimit("min",e,!1,a.toString(n))}lte(e,n){return this.setLimit("max",e,!0,a.toString(n))}lt(e,n){return this.setLimit("max",e,!1,a.toString(n))}setLimit(e,n,t,r){return new j({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:t,message:a.toString(r)}]})}_addCheck(e){return new j({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:a.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:a.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:a.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:a.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:a.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)"min"===n.kind&&(null===e||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)"max"===n.kind&&(null===e||n.value<e)&&(e=n.value);return e}}j.create=e=>new j({checks:[],typeName:o.ZodBigInt,coerce:e?.coerce??!1,...f(e)});class q extends h{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.Zp.boolean){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.boolean,received:n.parsedType}),c.uY}return(0,c.OK)(e.data)}}q.create=e=>new q({typeName:o.ZodBoolean,coerce:e?.coerce||!1,...f(e)});class G extends h{_parse(e){let n;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.Zp.date){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.date,received:n.parsedType}),c.uY}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_date}),c.uY}let t=new c.MY;for(let r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):u.ZS.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new G({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:a.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:a.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)"min"===n.kind&&(null===e||n.value>e)&&(e=n.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)"max"===n.kind&&(null===e||n.value<e)&&(e=n.value);return null!=e?new Date(e):null}}G.create=e=>new G({checks:[],coerce:e?.coerce||!1,typeName:o.ZodDate,...f(e)});class V extends h{_parse(e){if(this._getType(e)!==u.Zp.symbol){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.symbol,received:n.parsedType}),c.uY}return(0,c.OK)(e.data)}}V.create=e=>new V({typeName:o.ZodSymbol,...f(e)});class U extends h{_parse(e){if(this._getType(e)!==u.Zp.undefined){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.undefined,received:n.parsedType}),c.uY}return(0,c.OK)(e.data)}}U.create=e=>new U({typeName:o.ZodUndefined,...f(e)});class W extends h{_parse(e){if(this._getType(e)!==u.Zp.null){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.null,received:n.parsedType}),c.uY}return(0,c.OK)(e.data)}}W.create=e=>new W({typeName:o.ZodNull,...f(e)});class K extends h{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,c.OK)(e.data)}}K.create=e=>new K({typeName:o.ZodAny,...f(e)});class Z extends h{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,c.OK)(e.data)}}Z.create=e=>new Z({typeName:o.ZodUnknown,...f(e)});class Y extends h{_parse(e){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.never,received:n.parsedType}),c.uY}}Y.create=e=>new Y({typeName:o.ZodNever,...f(e)});class J extends h{_parse(e){if(this._getType(e)!==u.Zp.undefined){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.void,received:n.parsedType}),c.uY}return(0,c.OK)(e.data)}}J.create=e=>new J({typeName:o.ZodVoid,...f(e)});class X extends h{_parse(e){let{ctx:n,status:t}=this._processInputParams(e),r=this._def;if(n.parsedType!==u.Zp.array)return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.array,received:n.parsedType}),c.uY;if(null!==r.exactLength){let e=n.data.length>r.exactLength.value,a=n.data.length<r.exactLength.value;(e||a)&&((0,c.zn)(n,{code:e?i.eq.too_big:i.eq.too_small,minimum:a?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),t.dirty())}if(null!==r.minLength&&n.data.length<r.minLength.value&&((0,c.zn)(n,{code:i.eq.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),t.dirty()),null!==r.maxLength&&n.data.length>r.maxLength.value&&((0,c.zn)(n,{code:i.eq.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),t.dirty()),n.common.async)return Promise.all([...n.data].map((e,t)=>r.type._parseAsync(new d(n,e,n.path,t)))).then(e=>c.MY.mergeArray(t,e));let a=[...n.data].map((e,t)=>r.type._parseSync(new d(n,e,n.path,t)));return c.MY.mergeArray(t,a)}get element(){return this._def.type}min(e,n){return new X({...this._def,minLength:{value:e,message:a.toString(n)}})}max(e,n){return new X({...this._def,maxLength:{value:e,message:a.toString(n)}})}length(e,n){return new X({...this._def,exactLength:{value:e,message:a.toString(n)}})}nonempty(e){return this.min(1,e)}}function Q(e){if(e instanceof ee){let n={};for(let t in e.shape){let r=e.shape[t];n[t]=eA.create(Q(r))}return new ee({...e._def,shape:()=>n})}if(e instanceof X)return new X({...e._def,type:Q(e.element)});if(e instanceof eA)return eA.create(Q(e.unwrap()));if(e instanceof ey)return ey.create(Q(e.unwrap()));if(e instanceof ei)return ei.create(e.items.map(e=>Q(e)));else return e}X.create=(e,n)=>new X({type:e,minLength:null,maxLength:null,exactLength:null,typeName:o.ZodArray,...f(n)});class ee extends h{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),n=u.ZS.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==u.Zp.object){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.object,received:n.parsedType}),c.uY}let{status:n,ctx:t}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Y&&"strip"===this._def.unknownKeys))for(let e in t.data)a.includes(e)||o.push(e);let s=[];for(let e of a){let n=r[e],a=t.data[e];s.push({key:{status:"valid",value:e},value:n._parse(new d(t,a,t.path,e)),alwaysSet:e in t.data})}if(this._def.catchall instanceof Y){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of o)s.push({key:{status:"valid",value:e},value:{status:"valid",value:t.data[e]}});else if("strict"===e)o.length>0&&((0,c.zn)(t,{code:i.eq.unrecognized_keys,keys:o}),n.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let n of o){let r=t.data[n];s.push({key:{status:"valid",value:n},value:e._parse(new d(t,r,t.path,n)),alwaysSet:n in t.data})}}return t.common.async?Promise.resolve().then(async()=>{let e=[];for(let n of s){let t=await n.key,r=await n.value;e.push({key:t,value:r,alwaysSet:n.alwaysSet})}return e}).then(e=>c.MY.mergeObjectSync(n,e)):c.MY.mergeObjectSync(n,s)}get shape(){return this._def.shape()}strict(e){return a.errToObj,new ee({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(n,t)=>{let r=this._def.errorMap?.(n,t).message??t.defaultError;return"unrecognized_keys"===n.code?{message:a.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new ee({...this._def,unknownKeys:"strip"})}passthrough(){return new ee({...this._def,unknownKeys:"passthrough"})}extend(e){return new ee({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ee({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:o.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ee({...this._def,catchall:e})}pick(e){let n={};for(let t of u.ZS.objectKeys(e))e[t]&&this.shape[t]&&(n[t]=this.shape[t]);return new ee({...this._def,shape:()=>n})}omit(e){let n={};for(let t of u.ZS.objectKeys(this.shape))e[t]||(n[t]=this.shape[t]);return new ee({...this._def,shape:()=>n})}deepPartial(){return Q(this)}partial(e){let n={};for(let t of u.ZS.objectKeys(this.shape)){let r=this.shape[t];e&&!e[t]?n[t]=r:n[t]=r.optional()}return new ee({...this._def,shape:()=>n})}required(e){let n={};for(let t of u.ZS.objectKeys(this.shape))if(e&&!e[t])n[t]=this.shape[t];else{let e=this.shape[t];for(;e instanceof eA;)e=e._def.innerType;n[t]=e}return new ee({...this._def,shape:()=>n})}keyof(){return ef(u.ZS.objectKeys(this.shape))}}ee.create=(e,n)=>new ee({shape:()=>e,unknownKeys:"strip",catchall:Y.create(),typeName:o.ZodObject,...f(n)}),ee.strictCreate=(e,n)=>new ee({shape:()=>e,unknownKeys:"strict",catchall:Y.create(),typeName:o.ZodObject,...f(n)}),ee.lazycreate=(e,n)=>new ee({shape:e,unknownKeys:"strip",catchall:Y.create(),typeName:o.ZodObject,...f(n)});class en extends h{_parse(e){let{ctx:n}=this._processInputParams(e),t=this._def.options;function r(e){for(let n of e)if("valid"===n.result.status)return n.result;for(let t of e)if("dirty"===t.result.status)return n.common.issues.push(...t.ctx.common.issues),t.result;let t=e.map(e=>new i.G(e.ctx.common.issues));return(0,c.zn)(n,{code:i.eq.invalid_union,unionErrors:t}),c.uY}if(n.common.async)return Promise.all(t.map(async e=>{let t={...n,common:{...n.common,issues:[]},parent:null};return{result:await e._parseAsync({data:n.data,path:n.path,parent:t}),ctx:t}})).then(r);{let e,r=[];for(let a of t){let t={...n,common:{...n.common,issues:[]},parent:null},o=a._parseSync({data:n.data,path:n.path,parent:t});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:t}),t.common.issues.length&&r.push(t.common.issues)}if(e)return n.common.issues.push(...e.ctx.common.issues),e.result;let a=r.map(e=>new i.G(e));return(0,c.zn)(n,{code:i.eq.invalid_union,unionErrors:a}),c.uY}}get options(){return this._def.options}}en.create=(e,n)=>new en({options:e,typeName:o.ZodUnion,...f(n)});let et=e=>{if(e instanceof ed)return et(e.schema);if(e instanceof eg)return et(e.innerType());if(e instanceof ep)return[e.value];if(e instanceof e_)return e.options;if(e instanceof eh)return u.ZS.objectValues(e.enum);else if(e instanceof eb)return et(e._def.innerType);else if(e instanceof U)return[void 0];else if(e instanceof W)return[null];else if(e instanceof eA)return[void 0,...et(e.unwrap())];else if(e instanceof ey)return[null,...et(e.unwrap())];else if(e instanceof ew)return et(e.unwrap());else if(e instanceof eE)return et(e.unwrap());else if(e instanceof ev)return et(e._def.innerType);else return[]};class er extends h{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==u.Zp.object)return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.object,received:n.parsedType}),c.uY;let t=this.discriminator,r=n.data[t],a=this.optionsMap.get(r);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):((0,c.zn)(n,{code:i.eq.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[t]}),c.uY)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,t){let r=new Map;for(let t of n){let n=et(t.shape[e]);if(!n.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of n){if(r.has(a))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,t)}}return new er({typeName:o.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...f(t)})}}function ea(e,n){let t=(0,u.CR)(e),r=(0,u.CR)(n);if(e===n)return{valid:!0,data:e};if(t===u.Zp.object&&r===u.Zp.object){let t=u.ZS.objectKeys(n),r=u.ZS.objectKeys(e).filter(e=>-1!==t.indexOf(e)),a={...e,...n};for(let t of r){let r=ea(e[t],n[t]);if(!r.valid)return{valid:!1};a[t]=r.data}return{valid:!0,data:a}}if(t===u.Zp.array&&r===u.Zp.array){if(e.length!==n.length)return{valid:!1};let t=[];for(let r=0;r<e.length;r++){let a=ea(e[r],n[r]);if(!a.valid)return{valid:!1};t.push(a.data)}return{valid:!0,data:t}}if(t===u.Zp.date&&r===u.Zp.date&&+e==+n)return{valid:!0,data:e};return{valid:!1}}class eo extends h{_parse(e){let{status:n,ctx:t}=this._processInputParams(e),r=(e,r)=>{if((0,c.G4)(e)||(0,c.G4)(r))return c.uY;let a=ea(e.value,r.value);return a.valid?(((0,c.DM)(e)||(0,c.DM)(r))&&n.dirty(),{status:n.value,value:a.data}):((0,c.zn)(t,{code:i.eq.invalid_intersection_types}),c.uY)};return t.common.async?Promise.all([this._def.left._parseAsync({data:t.data,path:t.path,parent:t}),this._def.right._parseAsync({data:t.data,path:t.path,parent:t})]).then(([e,n])=>r(e,n)):r(this._def.left._parseSync({data:t.data,path:t.path,parent:t}),this._def.right._parseSync({data:t.data,path:t.path,parent:t}))}}eo.create=(e,n,t)=>new eo({left:e,right:n,typeName:o.ZodIntersection,...f(t)});class ei extends h{_parse(e){let{status:n,ctx:t}=this._processInputParams(e);if(t.parsedType!==u.Zp.array)return(0,c.zn)(t,{code:i.eq.invalid_type,expected:u.Zp.array,received:t.parsedType}),c.uY;if(t.data.length<this._def.items.length)return(0,c.zn)(t,{code:i.eq.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),c.uY;!this._def.rest&&t.data.length>this._def.items.length&&((0,c.zn)(t,{code:i.eq.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let r=[...t.data].map((e,n)=>{let r=this._def.items[n]||this._def.rest;return r?r._parse(new d(t,e,t.path,n)):null}).filter(e=>!!e);return t.common.async?Promise.all(r).then(e=>c.MY.mergeArray(n,e)):c.MY.mergeArray(n,r)}get items(){return this._def.items}rest(e){return new ei({...this._def,rest:e})}}ei.create=(e,n)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ei({items:e,typeName:o.ZodTuple,rest:null,...f(n)})};class es extends h{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:t}=this._processInputParams(e);if(t.parsedType!==u.Zp.object)return(0,c.zn)(t,{code:i.eq.invalid_type,expected:u.Zp.object,received:t.parsedType}),c.uY;let r=[],a=this._def.keyType,o=this._def.valueType;for(let e in t.data)r.push({key:a._parse(new d(t,e,t.path,e)),value:o._parse(new d(t,t.data[e],t.path,e)),alwaysSet:e in t.data});return t.common.async?c.MY.mergeObjectAsync(n,r):c.MY.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,t){return new es(n instanceof h?{keyType:e,valueType:n,typeName:o.ZodRecord,...f(t)}:{keyType:R.create(),valueType:e,typeName:o.ZodRecord,...f(n)})}}class el extends h{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:t}=this._processInputParams(e);if(t.parsedType!==u.Zp.map)return(0,c.zn)(t,{code:i.eq.invalid_type,expected:u.Zp.map,received:t.parsedType}),c.uY;let r=this._def.keyType,a=this._def.valueType,o=[...t.data.entries()].map(([e,n],o)=>({key:r._parse(new d(t,e,t.path,[o,"key"])),value:a._parse(new d(t,n,t.path,[o,"value"]))}));if(t.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let t of o){let r=await t.key,a=await t.value;if("aborted"===r.status||"aborted"===a.status)return c.uY;("dirty"===r.status||"dirty"===a.status)&&n.dirty(),e.set(r.value,a.value)}return{status:n.value,value:e}})}{let e=new Map;for(let t of o){let r=t.key,a=t.value;if("aborted"===r.status||"aborted"===a.status)return c.uY;("dirty"===r.status||"dirty"===a.status)&&n.dirty(),e.set(r.value,a.value)}return{status:n.value,value:e}}}}el.create=(e,n,t)=>new el({valueType:n,keyType:e,typeName:o.ZodMap,...f(t)});class ec extends h{_parse(e){let{status:n,ctx:t}=this._processInputParams(e);if(t.parsedType!==u.Zp.set)return(0,c.zn)(t,{code:i.eq.invalid_type,expected:u.Zp.set,received:t.parsedType}),c.uY;let r=this._def;null!==r.minSize&&t.data.size<r.minSize.value&&((0,c.zn)(t,{code:i.eq.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),null!==r.maxSize&&t.data.size>r.maxSize.value&&((0,c.zn)(t,{code:i.eq.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let a=this._def.valueType;function o(e){let t=new Set;for(let r of e){if("aborted"===r.status)return c.uY;"dirty"===r.status&&n.dirty(),t.add(r.value)}return{status:n.value,value:t}}let s=[...t.data.values()].map((e,n)=>a._parse(new d(t,e,t.path,n)));return t.common.async?Promise.all(s).then(e=>o(e)):o(s)}min(e,n){return new ec({...this._def,minSize:{value:e,message:a.toString(n)}})}max(e,n){return new ec({...this._def,maxSize:{value:e,message:a.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}ec.create=(e,n)=>new ec({valueType:e,minSize:null,maxSize:null,typeName:o.ZodSet,...f(n)});class eu extends h{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==u.Zp.function)return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.function,received:n.parsedType}),c.uY;function t(e,t){return(0,c.y7)({data:e,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,(0,s.$W)(),l.A].filter(e=>!!e),issueData:{code:i.eq.invalid_arguments,argumentsError:t}})}function r(e,t){return(0,c.y7)({data:e,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,(0,s.$W)(),l.A].filter(e=>!!e),issueData:{code:i.eq.invalid_return_type,returnTypeError:t}})}let a={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof em){let e=this;return(0,c.OK)(async function(...n){let s=new i.G([]),l=await e._def.args.parseAsync(n,a).catch(e=>{throw s.addIssue(t(n,e)),s}),c=await Reflect.apply(o,this,l);return await e._def.returns._def.type.parseAsync(c,a).catch(e=>{throw s.addIssue(r(c,e)),s})})}{let e=this;return(0,c.OK)(function(...n){let s=e._def.args.safeParse(n,a);if(!s.success)throw new i.G([t(n,s.error)]);let l=Reflect.apply(o,this,s.data),c=e._def.returns.safeParse(l,a);if(!c.success)throw new i.G([r(l,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new eu({...this._def,args:ei.create(e).rest(Z.create())})}returns(e){return new eu({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,t){return new eu({args:e||ei.create([]).rest(Z.create()),returns:n||Z.create(),typeName:o.ZodFunction,...f(t)})}}class ed extends h{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ed.create=(e,n)=>new ed({getter:e,typeName:o.ZodLazy,...f(n)});class ep extends h{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{received:n.data,code:i.eq.invalid_literal,expected:this._def.value}),c.uY}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ef(e,n){return new e_({values:e,typeName:o.ZodEnum,...f(n)})}ep.create=(e,n)=>new ep({value:e,typeName:o.ZodLiteral,...f(n)});class e_ extends h{_parse(e){if("string"!=typeof e.data){let n=this._getOrReturnCtx(e),t=this._def.values;return(0,c.zn)(n,{expected:u.ZS.joinValues(t),received:n.parsedType,code:i.eq.invalid_type}),c.uY}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),t=this._def.values;return(0,c.zn)(n,{received:n.data,code:i.eq.invalid_enum_value,options:t}),c.uY}return(0,c.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return e_.create(e,{...this._def,...n})}exclude(e,n=this._def){return e_.create(this.options.filter(n=>!e.includes(n)),{...this._def,...n})}}e_.create=ef;class eh extends h{_parse(e){let n=u.ZS.getValidEnumValues(this._def.values),t=this._getOrReturnCtx(e);if(t.parsedType!==u.Zp.string&&t.parsedType!==u.Zp.number){let e=u.ZS.objectValues(n);return(0,c.zn)(t,{expected:u.ZS.joinValues(e),received:t.parsedType,code:i.eq.invalid_type}),c.uY}if(this._cache||(this._cache=new Set(u.ZS.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=u.ZS.objectValues(n);return(0,c.zn)(t,{received:t.data,code:i.eq.invalid_enum_value,options:e}),c.uY}return(0,c.OK)(e.data)}get enum(){return this._def.values}}eh.create=(e,n)=>new eh({values:e,typeName:o.ZodNativeEnum,...f(n)});class em extends h{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==u.Zp.promise&&!1===n.common.async)return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.promise,received:n.parsedType}),c.uY;let t=n.parsedType===u.Zp.promise?n.data:Promise.resolve(n.data);return(0,c.OK)(t.then(e=>this._def.type.parseAsync(e,{path:n.path,errorMap:n.common.contextualErrorMap})))}}em.create=(e,n)=>new em({type:e,typeName:o.ZodPromise,...f(n)});class eg extends h{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===o.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:t}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:e=>{(0,c.zn)(t,e),e.fatal?n.abort():n.dirty()},get path(){return t.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===r.type){let e=r.transform(t.data,a);if(t.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===n.value)return c.uY;let r=await this._def.schema._parseAsync({data:e,path:t.path,parent:t});return"aborted"===r.status?c.uY:"dirty"===r.status||"dirty"===n.value?(0,c.jm)(r.value):r});{if("aborted"===n.value)return c.uY;let r=this._def.schema._parseSync({data:e,path:t.path,parent:t});return"aborted"===r.status?c.uY:"dirty"===r.status||"dirty"===n.value?(0,c.jm)(r.value):r}}if("refinement"===r.type){let e=e=>{let n=r.refinement(e,a);if(t.common.async)return Promise.resolve(n);if(n instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==t.common.async)return this._def.schema._parseAsync({data:t.data,path:t.path,parent:t}).then(t=>"aborted"===t.status?c.uY:("dirty"===t.status&&n.dirty(),e(t.value).then(()=>({status:n.value,value:t.value}))));{let r=this._def.schema._parseSync({data:t.data,path:t.path,parent:t});return"aborted"===r.status?c.uY:("dirty"===r.status&&n.dirty(),e(r.value),{status:n.value,value:r.value})}}if("transform"===r.type)if(!1!==t.common.async)return this._def.schema._parseAsync({data:t.data,path:t.path,parent:t}).then(e=>(0,c.fn)(e)?Promise.resolve(r.transform(e.value,a)).then(e=>({status:n.value,value:e})):c.uY);else{let e=this._def.schema._parseSync({data:t.data,path:t.path,parent:t});if(!(0,c.fn)(e))return c.uY;let o=r.transform(e.value,a);if(o instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}u.ZS.assertNever(r)}}eg.create=(e,n,t)=>new eg({schema:e,typeName:o.ZodEffects,effect:n,...f(t)}),eg.createWithPreprocess=(e,n,t)=>new eg({schema:n,effect:{type:"preprocess",transform:e},typeName:o.ZodEffects,...f(t)});class eA extends h{_parse(e){return this._getType(e)===u.Zp.undefined?(0,c.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eA.create=(e,n)=>new eA({innerType:e,typeName:o.ZodOptional,...f(n)});class ey extends h{_parse(e){return this._getType(e)===u.Zp.null?(0,c.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ey.create=(e,n)=>new ey({innerType:e,typeName:o.ZodNullable,...f(n)});class eb extends h{_parse(e){let{ctx:n}=this._processInputParams(e),t=n.data;return n.parsedType===u.Zp.undefined&&(t=this._def.defaultValue()),this._def.innerType._parse({data:t,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}eb.create=(e,n)=>new eb({innerType:e,typeName:o.ZodDefault,defaultValue:"function"==typeof n.default?n.default:()=>n.default,...f(n)});class ev extends h{_parse(e){let{ctx:n}=this._processInputParams(e),t={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t}});return(0,c.xP)(r)?r.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new i.G(t.common.issues)},input:t.data})})):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new i.G(t.common.issues)},input:t.data})}}removeCatch(){return this._def.innerType}}ev.create=(e,n)=>new ev({innerType:e,typeName:o.ZodCatch,catchValue:"function"==typeof n.catch?n.catch:()=>n.catch,...f(n)});class eC extends h{_parse(e){if(this._getType(e)!==u.Zp.nan){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.nan,received:n.parsedType}),c.uY}return{status:"valid",value:e.data}}}eC.create=e=>new eC({typeName:o.ZodNaN,...f(e)});let e$=Symbol("zod_brand");class ew extends h{_parse(e){let{ctx:n}=this._processInputParams(e),t=n.data;return this._def.type._parse({data:t,path:n.path,parent:n})}unwrap(){return this._def.type}}class ek extends h{_parse(e){let{status:n,ctx:t}=this._processInputParams(e);if(t.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:t.data,path:t.path,parent:t});return"aborted"===e.status?c.uY:"dirty"===e.status?(n.dirty(),(0,c.jm)(e.value)):this._def.out._parseAsync({data:e.value,path:t.path,parent:t})})();{let e=this._def.in._parseSync({data:t.data,path:t.path,parent:t});return"aborted"===e.status?c.uY:"dirty"===e.status?(n.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:t.path,parent:t})}}static create(e,n){return new ek({in:e,out:n,typeName:o.ZodPipeline})}}class eE extends h{_parse(e){let n=this._def.innerType._parse(e),t=e=>((0,c.fn)(e)&&(e.value=Object.freeze(e.value)),e);return(0,c.xP)(n)?n.then(e=>t(e)):t(n)}unwrap(){return this._def.innerType}}function ex(e,n){let t="function"==typeof e?e(n):"string"==typeof e?{message:e}:e;return"string"==typeof t?{message:t}:t}function eD(e,n={},t){return e?K.create().superRefine((r,a)=>{let o=e(r);if(o instanceof Promise)return o.then(e=>{if(!e){let e=ex(n,r),o=e.fatal??t??!0;a.addIssue({code:"custom",...e,fatal:o})}});if(!o){let e=ex(n,r),o=e.fatal??t??!0;a.addIssue({code:"custom",...e,fatal:o})}}):K.create()}eE.create=(e,n)=>new eE({innerType:e,typeName:o.ZodReadonly,...f(n)});let eS={object:ee.lazycreate};!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(o||(o={}));let ez=(e,n={message:`Input not instance of ${e.name}`})=>eD(n=>n instanceof e,n),eB=R.create,eM=L.create,eT=eC.create,eO=j.create,eN=q.create,eP=G.create,eI=V.create,eF=U.create,eR=W.create,eH=K.create,eL=Z.create,ej=Y.create,eq=J.create,eG=X.create,eV=ee.create,eU=ee.strictCreate,eW=en.create,eK=er.create,eZ=eo.create,eY=ei.create,eJ=es.create,eX=el.create,eQ=ec.create,e0=eu.create,e1=ed.create,e2=ep.create,e3=e_.create,e4=eh.create,e5=em.create,e6=eg.create,e8=eA.create,e7=ey.create,e9=eg.createWithPreprocess,ne=ek.create,nn=()=>eB().optional(),nt=()=>eM().optional(),nr=()=>eN().optional(),na={string:e=>R.create({...e,coerce:!0}),number:e=>L.create({...e,coerce:!0}),boolean:e=>q.create({...e,coerce:!0}),bigint:e=>j.create({...e,coerce:!0}),date:e=>G.create({...e,coerce:!0})},no=c.uY},58644:function(e,n,t){"use strict";t.d(n,{y:()=>a});let r=e=>{let n,t=new Set,r=(e,r)=>{let a="function"==typeof e?e(n):e;if(!Object.is(a,n)){let e=n;n=(null!=r?r:"object"!=typeof a||null===a)?a:Object.assign({},n,a),t.forEach(t=>t(n,e))}},a=()=>n,o={setState:r,getState:a,getInitialState:()=>i,subscribe:e=>(t.add(e),()=>t.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},i=n=e(r,a,o);return o},a=e=>e?r(e):r}},__webpack_module_cache__={};function __webpack_require__(e){var n=__webpack_module_cache__[e];if(void 0!==n)return n.exports;var t=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(t.exports,t,t.exports,__webpack_require__),t.loaded=!0,t.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.c=__webpack_module_cache__,__webpack_require__.x=()=>__webpack_require__(49448),(()=>{__webpack_require__.federation||(__webpack_require__.federation={chunkMatcher:function(e){return!/^(257|333)$/.test(e)},rootOutputDir:""})})(),(()=>{__webpack_require__.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(n,{a:n}),n}})(),(()=>{var e,n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;__webpack_require__.t=function(t,r){if(1&r&&(t=this(t)),8&r||"object"==typeof t&&t&&(4&r&&t.__esModule||16&r&&"function"==typeof t.then))return t;var a=Object.create(null);__webpack_require__.r(a);var o={};e=e||[null,n({}),n([]),n(n)];for(var i=2&r&&t;"object"==typeof i&&!~e.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach(e=>{o[e]=()=>t[e]});return o.default=()=>t,__webpack_require__.d(a,o),a}})(),(()=>{__webpack_require__.d=(e,n)=>{for(var t in n)__webpack_require__.o(n,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})}})(),(()=>{var e=__webpack_require__.x,n=!1;__webpack_require__.x=function(){if(n||(n=!0,__webpack_require__(53841)),"function"==typeof e)return e();console.warn("[MF] Invalid prevStartup")}})(),(()=>{__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce((n,t)=>(__webpack_require__.f[t](e,n),n),[]))})(),(()=>{__webpack_require__.u=e=>""+e+".js"})(),(()=>{__webpack_require__.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})()})(),(()=>{__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n)})(),(()=>{var e={},n="@kenyaemr/esm-care-panel-app:";__webpack_require__.l=function(t,r,a,o){if(e[t])return void e[t].push(r);if(void 0!==a)for(var i,s,l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==n+a){i=u;break}}i||(s=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,__webpack_require__.nc&&i.setAttribute("nonce",__webpack_require__.nc),i.setAttribute("data-webpack",n+a),i.src=t),e[t]=[r];var d=function(n,r){i.onerror=i.onload=null,clearTimeout(p);var a=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach(function(e){return e(r)}),n)return n(r)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),s&&document.head.appendChild(i)}})(),(()=>{__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})(),(()=>{__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e)})(),(()=>{__webpack_require__.nc=void 0})(),(()=>{__webpack_require__.rv=()=>"1.5.8"})(),(()=>{__webpack_require__.S={},__webpack_require__.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"@carbon/react",version:"1.93.0",factory:()=>Promise.all([__webpack_require__.e("689"),__webpack_require__.e("228"),__webpack_require__.e("478"),__webpack_require__.e("456"),__webpack_require__.e("257")]).then(()=>()=>__webpack_require__(73603)),eager:0,singleton:1,requiredVersion:"1.x",strictVersion:0},{name:"@openmrs/esm-framework",version:"8.0.1-pre.3423",factory:()=>Promise.all([__webpack_require__.e("689"),__webpack_require__.e("329"),__webpack_require__.e("478"),__webpack_require__.e("706"),__webpack_require__.e("729"),__webpack_require__.e("257"),__webpack_require__.e("333")]).then(()=>()=>__webpack_require__(53496)),eager:0,singleton:1,requiredVersion:"8.x",strictVersion:0},{name:"react-i18next",version:"11.18.6",factory:()=>Promise.all([__webpack_require__.e("267"),__webpack_require__.e("257"),__webpack_require__.e("675")]).then(()=>()=>__webpack_require__(566)),eager:0,singleton:1,requiredVersion:"11.x",strictVersion:0},{name:"react-router-dom",version:"6.30.1",factory:()=>Promise.all([__webpack_require__.e("689"),__webpack_require__.e("998"),__webpack_require__.e("257")]).then(()=>()=>__webpack_require__(18053)),eager:0,singleton:1,requiredVersion:"6.x",strictVersion:0},{name:"react",version:"18.3.1",factory:()=>__webpack_require__.e("466").then(()=>()=>__webpack_require__(14041)),eager:0,singleton:1,requiredVersion:"^18.1.0",strictVersion:0},{name:"swr/immutable",version:"2.3.6",factory:()=>Promise.all([__webpack_require__.e("329"),__webpack_require__.e("257"),__webpack_require__.e("847")]).then(()=>()=>__webpack_require__(44924)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0},{name:"swr/infinite",version:"2.3.6",factory:()=>Promise.all([__webpack_require__.e("329"),__webpack_require__.e("257"),__webpack_require__.e("472")]).then(()=>()=>__webpack_require__(82910)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0}]},uniqueName:"@kenyaemr/esm-care-panel-app"},__webpack_require__.I=__webpack_require__.I||function(){throw Error("should have __webpack_require__.I")}})(),(()=>{__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var e,n=__webpack_require__.g.document;if(!e&&n&&(n.currentScript&&"SCRIPT"===n.currentScript.tagName.toUpperCase()&&(e=n.currentScript.src),!e)){var t=n.getElementsByTagName("script");if(t.length)for(var r=t.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=t[r--].src}if(!e)throw Error("Automatic publicPath is not supported in this browser");__webpack_require__.p=e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")})(),(()=>{__webpack_require__.consumesLoadingData={chunkMapping:{333:["75721","97744","36142","42722","58088","70438"],889:["75721","97744","36142","42722","35400","58088","70438"],257:["35400"]},moduleIdToConsumeDataMapping:{75721:{shareScope:"default",shareKey:"react-router-dom",import:"react-router-dom",requiredVersion:"6.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("998").then(()=>()=>__webpack_require__(18053))},70438:{shareScope:"default",shareKey:"@carbon/react",import:"@carbon/react",requiredVersion:"1.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("228"),__webpack_require__.e("456")]).then(()=>()=>__webpack_require__(73603))},97744:{shareScope:"default",shareKey:"swr/infinite",import:"swr/infinite",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("91").then(()=>()=>__webpack_require__(82910))},36142:{shareScope:"default",shareKey:"swr/immutable",import:"swr/immutable",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("85").then(()=>()=>__webpack_require__(44924))},35400:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"^18.1.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("466").then(()=>()=>__webpack_require__(14041))},42722:{shareScope:"default",shareKey:"@openmrs/esm-framework",import:"@openmrs/esm-framework",requiredVersion:"8.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("729").then(()=>()=>__webpack_require__(53496))},58088:{shareScope:"default",shareKey:"react-i18next",import:"react-i18next",requiredVersion:"11.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("267").then(()=>()=>__webpack_require__(566))}},initialConsumes:["75721","97744","36142","42722","35400","58088","70438"]},__webpack_require__.f.consumes=__webpack_require__.f.consumes||function(){throw Error("should have __webpack_require__.f.consumes")}})(),(()=>{var e={889:0};__webpack_require__.f.j=function(n,t){var r=__webpack_require__.o(e,n)?e[n]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(257|333)$/.test(n))e[n]=0;else{var a=new Promise((t,a)=>r=e[n]=[t,a]);t.push(r[2]=a);var o=__webpack_require__.p+__webpack_require__.u(n),i=Error(),s=function(t){if(__webpack_require__.o(e,n)&&(0!==(r=e[n])&&(e[n]=void 0),r)){var a=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+n+" failed.\n("+a+": "+o+")",i.name="ChunkLoadError",i.type=a,i.request=o,r[1](i)}};__webpack_require__.l(o,s,"chunk-"+n,n)}};var n=(n,t)=>{var r,a,[o,i,s]=t,l=0;if(o.some(n=>0!==e[n])){for(r in i)__webpack_require__.o(i,r)&&(__webpack_require__.m[r]=i[r]);s&&s(__webpack_require__)}for(n&&n(t);l<o.length;l++)a=o[l],__webpack_require__.o(e,a)&&e[a]&&e[a][0](),e[a]=0},t=globalThis.webpackChunk_kenyaemr_esm_care_panel_app=globalThis.webpackChunk_kenyaemr_esm_care_panel_app||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))})(),(()=>{__webpack_require__.ruid="bundler=rspack@1.5.8"})();var __webpack_exports__=__webpack_require__.x()})();
|
|
104
|
+
Usually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".`;function ei(e){return()=>{let n=e.getState();return n.loaded&&n.config?n.config:null}}function es(e,n){return n?()=>{let t=e.getState(),r=(0,er.P0)(t,n.extensionSlotName,n.extensionId);if(r.loaded&&r.config)return r.config}:null}function el(e){return new Promise(n=>{let t=e.subscribe(e=>{e.loaded&&e.config&&(n(e.config),t())})})}function ec(e,n){return new Promise(t=>{let r=e.subscribe(e=>{let a=(0,er.P0)(e,n.extensionSlotName,n.extensionId);a.loaded&&a.config&&(t(a.config),r())})})}function eu(e){let[n,t]=(0,a.useState)(ei(e));return(0,a.useEffect)(()=>e?.subscribe(e=>{e.loaded&&e.config&&t(e.config)}),[e]),n}function ed(e,n){let[t,r]=(0,a.useState)(es(e,n));return(0,a.useEffect)(()=>{if(n)return e.subscribe(e=>{let a=(0,er.P0)(e,n.extensionSlotName,n.extensionId);a.loaded&&a.config&&!(0,X.A)(a.config,t)&&r(a.config)})},[e,n,t]),t}function ep(e){let n=(0,a.useMemo)(er.GI,[]),t=ed(n,e);if(!t&&e){let t=`${e.extensionSlotName}-${e.extensionId}`;throw!ea[t]&&n&&(ea[t]=ec(n,e)),ea[t]}return t||{}}function ef(e){let n=(0,a.useMemo)(()=>(0,er.IS)(e),[e]),t=e,r=eu(n);if(!r)throw ea[t]||(ea[t]=el(n)),ea[t];return r}function e_(e){let{moduleName:n,extension:t}=(0,a.useContext)(o),r=e?.externalModuleName??n;if(!r&&!t)throw Error(eo);let i=ef(r),s=ep(t);return(0,a.useMemo)(()=>e?.externalModuleName&&r===e.externalModuleName?{...i}:{...i,...s},[r,e?.externalModuleName,i,s])}let eh=y;var em=t(27760),eg=t(9826);function eA(){let[e,n]=(0,a.useState)((0,eg.s)());return(0,a.useEffect)(()=>(0,em.gj)(({online:e})=>n(e)),[]),e}function ey(e,n=300){let[t,r]=(0,a.useState)(e);return(0,a.useEffect)(()=>{let t=setTimeout(()=>{r(e)},n);return()=>{clearTimeout(t)}},[e,n]),t}var eb=t(36142);let ev=[["admissionDecisionConcept","ref"],["admissionEncounterType","ref"],["admissionForm","ref"],["atFacilityVisitType","ref"],["bedAssignmentEncounterType","ref"],["cancelADTRequestEncounterType","ref"],["checkInClerkEncounterRole","ref"],["checkInEncounterType","ref"],["clinicianEncounterRole","ref"],["conceptSourcesForDiagnosisSearch","ref"],["consultEncounterType","ref"],["consultFreeTextCommentsConcept","ref"],["denyAdmissionConcept","ref"],["diagnosisMetadata","ref"],["diagnosisSets","ref"],["dischargeForm","ref"],["dispositionDescriptor","ref"],["dispositions","ref"],["emrApiConceptSource","ref"],["exitFromInpatientEncounterType","ref"],["extraPatientIdentifierTypes","ref"],["fullPrivilegeLevel","ref"],["highPrivilegeLevel","ref"],["identifierTypesToSearch","ref"],["inpatientNoteEncounterType","ref"],["lastViewedPatientSizeLimit","ref"],["metadataSourceName","ref"],["motherChildRelationshipType","ref"],["narrowerThanConceptMapType","ref"],["nonDiagnosisConceptSets","ref"],["orderingProviderEncounterRole","ref"],["patientDiedConcept","ref"],["personImageDirectory","ref"],["primaryIdentifierType","ref"],["sameAsConceptMapType","ref"],["suppressedDiagnosisConcepts","ref"],["supportsAdmissionLocationTag","(uuid,display,name,links)"],["supportsLoginLocationTag","(uuid,display,name,links)"],["supportsTransferLocationTag","(uuid,display,name,links)"],["supportsVisitsLocationTag","(uuid,display,name,links)"],["telephoneAttributeType","ref"],["testPatientPersonAttributeType","ref"],["transferForm","ref"],["transferRequestEncounterType","ref"],["transferWithinHospitalEncounterType","ref"],["unknownCauseOfDeathConcept","ref"],["unknownLocation","ref"],["unknownPatientPersonAttributeType","ref"],["unknownProvider","ref"],["visitAssignmentHandlerAdjustEncounterTimeOfDayIfNecessary","ref"],["visitExpireHours","ref"],["visitNoteEncounterType","ref"]],eC=`custom:${ev.map(([e,n])=>`${e}:${n}`).join(",")}`;function e$(){let e=eb(`${O.Jj}/emrapi/configuration?v=${eC}`,O.lo);return(0,a.useMemo)(()=>({emrConfiguration:e.data?.data,isLoadingEmrConfiguration:e.isLoading,mutateEmrConfiguration:e.mutate,errorFetchingEmrConfiguration:e.error}),[e])}let ew=g((0,c.a9)());function ek(e){let n=y(e);return(0,a.useMemo)(()=>Object.fromEntries(n.map(e=>[e.name,e.meta])),[n])}let eE=g((0,c.zF)());var ex=t(10201);function eD(e){let{flags:n}=h(ex.jX);return n[e]?.enabled??!1}function eS(){let[,e]=(0,a.useState)(0);return(0,a.useCallback)(()=>{e(e=>e+1)},[])}function ez(e,n,t={}){return eM(e,n,eB,t)}let eB={getPaginatedUrl:(e,n,t)=>{if(!e)return null;{let r=new URL((0,O.Gm)(e.toString()),window.location.toString());return r.searchParams.set("limit",""+n),r.searchParams.set("startIndex",""+t),r.searchParams.set("totalCount","true"),r.toString()}},getNextUrl:e=>{let n=e?.links?.find(e=>"next"==e.rel)?.uri;if(!n)return null;{let e=new URL(n);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.totalCount??NaN,getCurrentPageSize:e=>e?.results?.length??NaN,getData:e=>e?.results};function eM(e,n,t,r={}){let{getPaginatedUrl:o,getTotalCount:i,getCurrentPageSize:s,getData:l}=t,{immutable:c,swrConfig:u}=r,d=r.fetcher??O.lo,[p,f]=(0,a.useState)(1),h=(0,a.useRef)(NaN),m=(0,a.useRef)(NaN),g=n,A=(p-1)*n,y=(0,a.useMemo)(()=>o(e,g,A),[e,g,A]),{data:b,...v}=(c?eb:R.Ay)(y,d,u);b?.data&&(h.current=i(b?.data),m.current=s(b?.data));let C=Math.ceil(h.current/n),$=(0,a.useCallback)(e=>{0<e&&e<=C?f(e):console.warn("Invalid attempt to go to out of bounds page: "+e)},[e,p,C]),w=(0,a.useCallback)(()=>{$(p+1)},[e,p,C]),k=(0,a.useCallback)(()=>{$(p-1)},[e,p,C]);return{data:l(b?.data),totalPages:C,totalCount:h.current,currentPage:p,currentPageSize:m,paginated:C>1,showNextButton:p<C,showPreviousButton:p>1,goTo:$,goToNext:w,goToPrevious:k,...v}}function eT(e,n,t={}){return eM(e,n,eO(),t)}function eO(){return{getPaginatedUrl:(e,n,t)=>{if(!e)return null;{let r=new URL((0,O.Gm)(e.toString()),window.location.toString());return r.searchParams.set("_count",""+n),r.searchParams.set("_getpagesoffset",""+t),r.toString()}},getNextUrl:e=>{let n=e?.link?.find(e=>"next"==e.relation)?.url;if(!n)return null;{let e=new URL(n);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.total??NaN,getCurrentPageSize:e=>e?.entry?.length??NaN,getData:e=>e?.entry?.map(e=>e.resource)}}var eN=t(97744);function eP(e,n={}){return eI(e,eB,n)}function eI(e,n,t={}){let{swrInfiniteConfig:r,immutable:o}=t,{getNextUrl:i,getTotalCount:s,getData:l}=n,c=t.fetcher??O.lo,{data:u,size:d,setSize:p,...f}=eN((0,a.useCallback)((t,r)=>0==t?e?.toString()??null:n.getNextUrl(r.data),[e]),c,{...r,...o?{revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1}:{}}),h=i(u?.[u.length-1].data),m=null!=h,g=()=>{p((u?.length??0)+1)},A=s(u?.[0]?.data);return{data:u?.flatMap(e=>l(e.data)),totalCount:A,hasMore:m,loadMore:g,nextUri:h,...f}}function eF(e,n={}){return eR(e,eB,n)}function eR(e,n,t={}){let r=eI(e,n,t),{hasMore:o,error:i,data:s,loadMore:l,isLoading:c,nextUri:u}=r;return((0,a.useEffect)(()=>{o&&!i&&l()},[o,u]),t.partialData)?r:{...r,data:o||i?void 0:s,isLoading:c||o}}function eH(e,n={}){return eR(e,eO(),n)}function eL(e,n={}){return eI(e,eO(),n)}function ej(){let e="tablet";return document.body.classList.forEach(n=>{switch(n){case"omrs-breakpoint-lt-tablet":e="phone";break;case"omrs-breakpoint-gt-small-desktop":e="large-desktop";break;case"omrs-breakpoint-gt-tablet":e="small-desktop"}}),e}function eq(){let[e,n]=(0,a.useState)(ej);return(0,a.useEffect)(()=>{let e=()=>{n(ej())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}let eG=e=>"small-desktop"===e||"large-desktop"===e;function eV(e){let n=(0,a.useContext)(o);(0,a.useEffect)(()=>(n&&n.moduleName&&(e.componentContext=n),(0,c.Vx)(e),()=>{(0,c.sr)(e.name)}),[n,e])}function eU(){return h(c.Gp)}function eW(e=null,n=null){let[t,r]=(0,a.useState)([]);return(0,a.useEffect)(()=>{let t=(0,ee.Vs)(e,n).subscribe(e=>{r(e)},e=>{console.error(e)});return()=>t.unsubscribe()},[e,n]),t}function eK(e,n=!0){let t=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let r=r=>{!n||!t.current||t.current.contains(r.target)||e(r)};return window.addEventListener("mousedown",r),window.addEventListener("touchstart",r),()=>{window.removeEventListener("mousedown",r),window.removeEventListener("touchstart",r)}},[e,n]),t}function eZ(e){let n=(0,a.useRef)();return(0,a.useEffect)(()=>{let t=new IntersectionObserver(n=>{for(let t of n)if(t.isIntersecting)return void e()},{threshold:1});return n.current&&t.observe(n.current),()=>{n.current&&t.unobserve(n.current)}},[n.current,e]),n}function eY(e,n){if(n)return"function"==typeof n?n(e):n;if("string"==typeof e)return e;throw Error(`When using useOpenmrsSWR with a key that is not a string, you must provide a url() function that converts the key to a valid url. The key for this hook is ${e}.`)}function eJ(e,n={}){let{abortController:t,fetchInit:r,url:o,swrConfig:i}=n,s=Y(),l=(0,a.useMemo)(()=>r?.signal??t?.signal??s.signal,[t?.signal,r?.signal,s.signal]),c=(0,a.useCallback)(e=>{let n=eY(e,o);return(0,O.lo)(n,{...r,signal:l})},[l,r,o]);return(0,R.Ay)(e,c,i)}let eX=10;function eQ(e=[],n=eX){let[t,r]=(0,a.useState)(1),o=(0,a.useMemo)(()=>"number"==typeof n&&n>0?Math.max(1,Math.ceil(e.length/n)):1,[e.length,n]),i=(0,a.useMemo)(()=>{let r=(t-1)*n,a=(t+0)*n;return e.slice(r,a)},[e,t,n]),s=(0,a.useCallback)(e=>{r(Math.max(1,Math.min(o,e)))},[r,o]),l=(0,a.useCallback)(()=>{t<o&&r(t+1)},[t,o,r]),c=(0,a.useCallback)(()=>{t>1&&r(t-1)},[t,r]);return(0,a.useMemo)(()=>({results:i,totalPages:o,currentPage:t,paginated:e.length>n,showNextButton:t<o,showPreviousButton:t>1,goTo:s,goToNext:l,goToPrevious:c}),[i,o,e.length,n,t,s,l,c])}function e0(){let e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function e1(e){let[n,t]=(0,a.useState)(e??e0()),{data:r,error:o,isValidating:i}=(0,R.Ay)(n?["patient",n]:null,()=>(0,ee.hG)(n,{}));return(0,a.useEffect)(()=>{let e=()=>{let e=e0();e!==n&&t(e)};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)},[n]),(0,a.useMemo)(()=>({isLoading:i&&!o&&!r,patient:r,patientUuid:n,error:o}),[i,o,r,n])}function e2(){let e=`${O.Jj}/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType`,{data:n,error:t,isLoading:r}=(0,R.Ay)(e,O.lo);return(0,a.useMemo)(()=>({primaryIdentifierCode:n?.data?.results[0]?.metadataUuid,isLoading:r,error:t}),[n,t,r])}function e3(e){let{extensions:n,extensionSlotModuleName:t}=b(e);return e?n.map(n=>({state:r})=>a.createElement(o.Provider,{value:{moduleName:t,featureName:"",extension:{extensionId:n.id,extensionSlotName:e,extensionSlotModuleName:t}}},a.createElement(u,{state:r}))):[]}var e4=t(23464),e5=t(85602);let e6={setVisitContext:(e,n)=>null==n?{manuallySetVisitUuid:null}:{manuallySetVisitUuid:n.uuid,patientUuid:n.patient?.uuid},mutateVisit(e){for(let n of Object.values(e.mutateVisitCallbacks??{}))n();return{}}};function e8(e){let n=(0,a.useId)();return(0,a.useEffect)(()=>{let t=(0,ee.BX)();return e&&t.setState({mutateVisitCallbacks:{...t.getState().mutateVisitCallbacks,[n]:e}}),()=>{if(e){let e={...t.getState().mutateVisitCallbacks};delete e[n],t.setState({mutateVisitCallbacks:e})}}},[n,e]),m((0,ee.BX)(),e6)}function e7(e,n=ee.Rb){let{patientUuid:t,manuallySetVisitUuid:r,setVisitContext:o}=e8(),i=e&&t==e?r:null,s=`?patient=${e}&v=${n}&includeInactive=false`,l=`/${i}?v=${n}`,{data:c,error:u,mutate:d,isValidating:p}=(0,R.Ay)(e?`${O.Jj}/visit${s}`:null,O.lo),{data:f,error:h,mutate:m,isValidating:g}=(0,R.Ay)(e&&i?`${O.Jj}/visit${l}`:null,O.lo),A=(0,a.useMemo)(()=>c?.data.results.find(e=>null===e.stopDatetime)??null,[c]),y=(0,a.useMemo)(()=>i&&f?f.data:null,[f,i]),b=(0,a.useRef)(null);(0,a.useEffect)(()=>{!p&&A&&t===e&&null===r&&o(A),g||(b.current&&y&&b.current.uuid===y.uuid&&!b.current.stopDatetime&&y.stopDatetime&&o(null),b.current=y)},[y,r,A,p,g,t]);let v=(0,a.useCallback)(()=>{d(),m()},[d,m]);return e8(v),{error:u||h,mutate:v,isValidating:p||g,activeVisit:A,currentVisit:y,currentVisitIsRetrospective:!!i,isLoading:!!((!c||i&&!f)&&(!u||!h))}}function e9(){let[e,n]=(0,a.useState)([]);return(0,a.useEffect)(()=>{let e=(0,ee.Pu)().subscribe(e=>{n(e)},e=>console.error(e));return()=>e.unsubscribe()},[]),e}function ne(){let e=(0,a.useRef)(),[n,t]=(0,a.useState)(null),o=null;if(!n){if(r){let e=(0,O.EW)().getState();e.loaded&&(o=e.session)}else r=new Promise(n=>{let t=({loaded:t,session:r})=>{t&&(n(r),o=r,e.current&&(e.current(),e.current=void 0))};t((0,O.EW)().getState()),o||(e.current=(0,O.EW)().subscribe(t))});if(o)t(o);else throw r}(0,a.useEffect)(()=>(e.current||(e.current=(0,O.EW)().subscribe(({loaded:e,session:n})=>{e&&(o=n,t(n))})),()=>{e.current&&(e.current(),e.current=void 0)}),[]);let i=n||o;if(!i)if(r)throw console.warn("useSession is in an unexpected state. Attempting to recover."),r;else throw Error("useSession is in an invalid state.");return i}e4.extend(e5)},20186:function(e,n,t){"use strict";t.d(n,{o:()=>i});var r=t(81565),a=t(13070);let o=new Map;async function i(e,n){let t=n.indexOf("#"),a=t>=0,o=a?n.substring(0,t):e,i=a?n.substring(t+1):n,c=await (0,r.rL)(o);return c&&Object.hasOwn(c,i)&&"function"==typeof c[i]?l(o,c).then(()=>c[i]()):(c?c&&Object.hasOwn(c,i)?console.warn(`The export ${n}, defined in ${e}'s routes.json, is not a function`):console.warn(`${o} does not define a component called "${i}", referenced in ${e}'s routes.json. This cannot be loaded.`):console.warn(`Unknown app ${o} for ${n} defined in ${e}'s routes.json`),s)}let s={bootstrap:()=>Promise.resolve(),mount:()=>Promise.resolve(),unmount:()=>Promise.resolve()};async function l(e,n){if(e in o)await o[e];else{let t=n??await (0,r.rL)(e);await (o[e]=new Promise((n,r)=>{if(Object.hasOwn(t,"startupApp")){let o=t.startupApp;if("function"==typeof o)return Promise.resolve(o()).then(()=>{(0,a.kl)(e),n(null)}).catch(r)}(0,a.kl)(e),n(null)}))}}},467:function(e,n,t){"use strict";t.d(n,{i7:()=>c,jf:()=>l,CE:()=>s,Zd:()=>i});var r=t(90108),a=t(58644);let o={};function i(e,n){let t=o[e];if(t)return t.active?console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):t.value.setState(n,!0),t.active=!0,t.value;{let t=(0,a.y)()(()=>n);return o[e]={value:t,active:!0},t}}function s(e,n){let t=o[e];return t?(t.active?console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):t.value=n,t.active=!0,t.value):(o[e]={value:n,active:!0},n)}function l(e,n){let t=o[e];if(!t){let t=(0,a.y)()(()=>n??{});return o[e]={value:t,active:!1},t}return t.value}function c(...e){let[n,t,a]=e,o=void 0===a?t:a,i=void 0===a?e=>e:t;return o(i(n.getState())),n.subscribe((e,n)=>{let t=i(e);(0,r.b)(n,t)||o(t)})}setTimeout(()=>{window&&"development"===window.spaEnv&&(window.stores=o)},1e3)},61836:function(e,n,t){"use strict";t.d(n,{V:()=>J,t:()=>Y});let r={closeWorkspaces2PromptTitle:"Close workspace(s)",closeWorkspaces2PromptBody:"You are about to close the following workspace(s), which might have unsaved changes:"},a={address1:"Address line 1",address2:"Address line 2",address3:"Address line 3",address4:"Address line 4",address5:"Address line 5",address6:"Address line 6",city:"City",cityVillage:"City",country:"Country",countyDistrict:"District",district:"District",postalCode:"Postal code",state:"State",stateProvince:"State",closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",closingAllWorkspacesPromptTitle:"You have unsaved changes",discard:"Discard",hide:"Hide",maximize:"Maximize",minimize:"Minimize",openAnyway:"Open anyway",unsavedChangesInOpenedWorkspace:"You may have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header",...r,actions:"Actions",address:"Address",age:"Age",cancel:"Cancel",change:"Change",Clinic:"Clinic",close:"Close",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",delete:"Delete",edit:"Edit",error:"Error",errorCopy:"Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",female:"Female",loading:"Loading",male:"Male",other:"Other",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",relationships:"Relationships",resetOverrides:"Reset overrides",save:"Save",scriptLoadingFailed:"Error: Script failed to load",scriptLoadingError:"Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",seeMoreLists:"See {{count}} more lists",sex:"Sex",showLess:"Show less",showMore:"Show more",toggleDevTools:"Toggle dev tools",unknown:"Unknown"};var o=t(85761),i=t(93442);function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?Object(arguments[n]):{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.forEach(function(n){(0,i.A)(e,n,t[n])})}return e}var l=t(79736),c=t(36678);function u(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,n){if(n&&("object"==(0,o.A)(n)||"function"==typeof n))return n;if(void 0!==n)throw TypeError("Derived constructors may only return object or undefined");return u(e)}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var f=t(98423);function h(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&(0,f.A)(e,n)}var m={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,n){console&&console[e]&&console[e].apply(console,n)}},g=new(function(){function e(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,l.A)(this,e),this.init(n,t)}return(0,c.A)(e,[{key:"init",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||m,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];return this.forward(n,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];return this.forward(n,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];return this.forward(n,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,n,t,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(t).concat(this.prefix," ").concat(e[0])),this.logger[n](e))}},{key:"create",value:function(n){return new e(this.logger,s({},{prefix:"".concat(this.prefix,":").concat(n,":")},this.options))}}]),e}()),A=function(){function e(){(0,l.A)(this,e),this.observers={}}return(0,c.A)(e,[{key:"on",value:function(e,n){var t=this;return e.split(" ").forEach(function(e){t.observers[e]=t.observers[e]||[],t.observers[e].push(n)}),this}},{key:"off",value:function(e,n){if(this.observers[e]){if(!n)return void delete this.observers[e];this.observers[e]=this.observers[e].filter(function(e){return e!==n})}}},{key:"emit",value:function(e){for(var n=arguments.length,t=Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];this.observers[e]&&[].concat(this.observers[e]).forEach(function(e){e.apply(void 0,t)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(function(n){n.apply(n,[e].concat(t))})}}]),e}();function y(){var e,n,t=new Promise(function(t,r){e=t,n=r});return t.resolve=e,t.reject=n,t}function b(e){return null==e?"":""+e}function v(e,n,t){e.forEach(function(e){n[e]&&(t[e]=n[e])})}function C(e,n,t){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function a(){return!e||"string"==typeof e}for(var o="string"!=typeof n?[].concat(n):n.split(".");o.length>1;){if(a())return{};var i=r(o.shift());!e[i]&&t&&(e[i]=new t),e=Object.prototype.hasOwnProperty.call(e,i)?e[i]:{}}return a()?{}:{obj:e,k:r(o.shift())}}function $(e,n,t){var r=C(e,n,Object);r.obj[r.k]=t}function w(e,n,t,r){var a=C(e,n,Object),o=a.obj,i=a.k;o[i]=o[i]||[],r&&(o[i]=o[i].concat(t)),r||o[i].push(t)}function k(e,n){var t=C(e,n),r=t.obj,a=t.k;if(r)return r[a]}function E(e,n,t){var r=k(e,t);return void 0!==r?r:k(n,t)}function x(e,n,t){for(var r in n)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof n[r]||n[r]instanceof String?t&&(e[r]=n[r]):x(e[r],n[r],t):e[r]=n[r]);return e}function D(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var S={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function z(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return S[e]}):e}var B="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,M=function(e){function n(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return(0,l.A)(this,n),t=d(this,p(n).call(this)),B&&A.call(u(t)),t.data=e||{},t.options=r,void 0===t.options.keySeparator&&(t.options.keySeparator="."),t}return h(n,e),(0,c.A)(n,[{key:"addNamespaces",value:function(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}},{key:"getResource",value:function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=[e,n];return t&&"string"!=typeof t&&(o=o.concat(t)),t&&"string"==typeof t&&(o=o.concat(a?t.split(a):t)),e.indexOf(".")>-1&&(o=e.split(".")),k(this.data,o)}},{key:"addResource",value:function(e,n,t,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var i=[e,n];t&&(i=i.concat(o?t.split(o):t)),e.indexOf(".")>-1&&(i=e.split("."),r=n,n=i[1]),this.addNamespaces(n),$(this.data,i,r),a.silent||this.emit("added",e,n,t,r)}},{key:"addResources",value:function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var a in t)("string"==typeof t[a]||"[object Array]"===Object.prototype.toString.apply(t[a]))&&this.addResource(e,n,a,t[a],{silent:!0});r.silent||this.emit("added",e,n,t)}},{key:"addResourceBundle",value:function(e,n,t,r,a){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},i=[e,n];e.indexOf(".")>-1&&(i=e.split("."),r=t,t=n,n=i[1]),this.addNamespaces(n);var l=k(this.data,i)||{};r?x(l,t,a):l=s({},l,t),$(this.data,i,l),o.silent||this.emit("added",e,n,t)}},{key:"removeResourceBundle",value:function(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}},{key:"hasResourceBundle",value:function(e,n){return void 0!==this.getResource(e,n)}},{key:"getResourceBundle",value:function(e,n){return(n||(n=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?s({},{},this.getResource(e,n)):this.getResource(e,n)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),n}(A),T={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,n,t,r,a){var o=this;return e.forEach(function(e){o.processors[e]&&(n=o.processors[e].process(n,t,r,a))}),n}},O={},N=function(e){function n(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,l.A)(this,n),t=d(this,p(n).call(this)),B&&A.call(u(t)),v(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,u(t)),t.options=r,void 0===t.options.keySeparator&&(t.options.keySeparator="."),t.logger=g.create("translator"),t}return h(n,e),(0,c.A)(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},t=this.resolve(e,n);return t&&void 0!==t.res}},{key:"extractFromKey",value:function(e,n){var t=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===t&&(t=":");var r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=n.ns||this.options.defaultNS;if(t&&e.indexOf(t)>-1){var o=e.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:e,namespaces:a};var i=e.split(t);(t!==r||t===r&&this.options.ns.indexOf(i[0])>-1)&&(a=i.shift()),e=i.join(r)}return"string"==typeof a&&(a=[a]),{key:e,namespaces:a}}},{key:"translate",value:function(e,t,r){var a=this;if("object"!==(0,o.A)(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,l=this.extractFromKey(e[e.length-1],t),c=l.key,u=l.namespaces,d=u[u.length-1],p=t.lng||this.language,f=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&"cimode"===p.toLowerCase())return f?d+(t.nsSeparator||this.options.nsSeparator)+c:c;var h=this.resolve(e,t),m=h&&h.res,g=h&&h.usedKey||c,A=h&&h.exactUsedKey||c,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],v=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject,$="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(C&&m&&$&&0>b.indexOf(y)&&("string"!=typeof v||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,t):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");if(i){var w="[object Array]"===y,k=w?[]:{},E=w?A:g;for(var x in m)if(Object.prototype.hasOwnProperty.call(m,x)){var D="".concat(E).concat(i).concat(x);k[x]=this.translate(D,s({},t,{joinArrays:!1,ns:u})),k[x]===D&&(k[x]=m[x])}m=k}}else if(C&&"string"==typeof v&&"[object Array]"===y)(m=m.join(v))&&(m=this.extendTranslation(m,e,t,r));else{var S=!1,z=!1,B=void 0!==t.count&&"string"!=typeof t.count,M=n.hasDefaultValue(t),T=B?this.pluralResolver.getSuffix(p,t.count):"",O=t["defaultValue".concat(T)]||t.defaultValue;!this.isValidLookup(m)&&M&&(S=!0,m=O),this.isValidLookup(m)||(z=!0,m=c);var N=M&&O!==m&&this.options.updateMissing;if(z||S||N){if(this.logger.log(N?"updateKey":"missingKey",p,d,c,N?O:m),i){var P=this.resolve(c,s({},t,{keySeparator:!1}));P&&P.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var I=[],F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&F&&F[0])for(var R=0;R<F.length;R++)I.push(F[R]);else"all"===this.options.saveMissingTo?I=this.languageUtils.toResolveHierarchy(t.lng||this.language):I.push(t.lng||this.language);var H=function(e,n,r){a.options.missingKeyHandler?a.options.missingKeyHandler(e,d,n,N?r:m,N,t):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(e,d,n,N?r:m,N,t),a.emit("missingKey",e,d,n,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&B?I.forEach(function(e){a.pluralResolver.getSuffixes(e).forEach(function(n){H([e],c+n,t["defaultValue".concat(n)]||O)})}):H(I,c,O))}m=this.extendTranslation(m,e,t,h,r),z&&m===c&&this.options.appendNamespaceToMissingKey&&(m="".concat(d,":").concat(c)),z&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(m))}return m}},{key:"extendTranslation",value:function(e,n,t,r,a){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,t,r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!t.skipInterpolation){t.interpolation&&this.interpolator.init(s({},t,{interpolation:s({},this.options.interpolation,t.interpolation)}));var i,l=t.interpolation&&t.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(l){var c=e.match(this.interpolator.nestingRegexp);i=c&&c.length}var u=t.replace&&"string"!=typeof t.replace?t.replace:t;if(this.options.interpolation.defaultVariables&&(u=s({},this.options.interpolation.defaultVariables,u)),e=this.interpolator.interpolate(e,u,t.lng||this.language,t),l){var d=e.match(this.interpolator.nestingRegexp);i<(d&&d.length)&&(t.nest=!1)}!1!==t.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return a&&a[0]===r[0]&&!t.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(n[0])),null):o.translate.apply(o,r.concat([n]))},t)),t.interpolation&&this.interpolator.reset()}var p=t.postProcess||this.options.postProcess,f="string"==typeof p?[p]:p;return null!=e&&f&&f.length&&!1!==t.applyPostProcessor&&(e=T.handle(f,e,n,this.options&&this.options.postProcessPassResolved?s({i18nResolved:r},t):t,this)),e}},{key:"resolve",value:function(e){var n,t,r,a,o,i=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(function(e){if(!i.isValidLookup(n)){var l=i.extractFromKey(e,s),c=l.key;t=c;var u=l.namespaces;i.options.fallbackNS&&(u=u.concat(i.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,p=void 0!==s.context&&"string"==typeof s.context&&""!==s.context,f=s.lngs?s.lngs:i.languageUtils.toResolveHierarchy(s.lng||i.language,s.fallbackLng);u.forEach(function(e){i.isValidLookup(n)||(o=e,!O["".concat(f[0],"-").concat(e)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(o)&&(O["".concat(f[0],"-").concat(e)]=!0,i.logger.warn('key "'.concat(t,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(function(t){if(!i.isValidLookup(n)){a=t;var o,l,u=c,f=[u];for(i.i18nFormat&&i.i18nFormat.addLookupKeys?i.i18nFormat.addLookupKeys(f,c,t,e,s):(d&&(o=i.pluralResolver.getSuffix(t,s.count)),d&&p&&f.push(u+o),p&&f.push(u+="".concat(i.options.contextSeparator).concat(s.context)),d&&f.push(u+=o));l=f.pop();)i.isValidLookup(n)||(r=l,n=i.getResource(t,e,l,s))}}))})}}),{res:n,usedKey:t,exactUsedKey:r,usedLng:a,usedNS:o}}},{key:"isValidLookup",value:function(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,t,r):this.resourceStore.getResource(e,n,t,r)}}],[{key:"hasDefaultValue",value:function(e){var n="defaultValue";for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&n===t.substring(0,n.length)&&void 0!==e[t])return!0;return!1}}]),n}(A);function P(e){return e.charAt(0).toUpperCase()+e.slice(1)}var I=function(){function e(n){(0,l.A)(this,e),this.options=n,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=g.create("languageUtils")}return(0,c.A)(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||0>e.indexOf("-"))return null;var n=e.split("-");return 2===n.length||(n.pop(),"x"===n[n.length-1].toLowerCase())?null:this.formatLanguageCode(n.join("-"))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||0>e.indexOf("-"))return e;var n=e.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],t=e.split("-");return this.options.lowerCaseLng?t=t.map(function(e){return e.toLowerCase()}):2===t.length?(t[0]=t[0].toLowerCase(),t[1]=t[1].toUpperCase(),n.indexOf(t[1].toLowerCase())>-1&&(t[1]=P(t[1].toLowerCase()))):3===t.length&&(t[0]=t[0].toLowerCase(),2===t[1].length&&(t[1]=t[1].toUpperCase()),"sgn"!==t[0]&&2===t[2].length&&(t[2]=t[2].toUpperCase()),n.indexOf(t[1].toLowerCase())>-1&&(t[1]=P(t[1].toLowerCase())),n.indexOf(t[2].toLowerCase())>-1&&(t[2]=P(t[2].toLowerCase()))),t.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var n,t=this;return e?(e.forEach(function(e){if(!n){var r=t.formatLanguageCode(e);(!t.options.supportedLngs||t.isSupportedCode(r))&&(n=r)}}),!n&&this.options.supportedLngs&&e.forEach(function(e){if(!n){var r=t.getLanguagePartFromCode(e);if(t.isSupportedCode(r))return n=r;n=t.options.supportedLngs.find(function(e){if(0===e.indexOf(r))return e})}}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n):null}},{key:"getFallbackCodes",value:function(e,n){if(!e)return[];if("function"==typeof e&&(e=e(n)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!n)return e.default||[];var t=e[n];return t||(t=e[this.getScriptPartFromCode(n)]),t||(t=e[this.formatLanguageCode(n)]),t||(t=e[this.getLanguagePartFromCode(n)]),t||(t=e.default),t||[]}},{key:"toResolveHierarchy",value:function(e,n){var t=this,r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),a=[],o=function(e){e&&(t.isSupportedCode(e)?a.push(e):t.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach(function(e){0>a.indexOf(e)&&o(t.formatLanguageCode(e))}),a}}]),e}(),F=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],R={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(+(1!=e&&(e%10!=1||e%100==11)))},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:3*(e%100==3||e%100==4))},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};function H(){var e={};return F.forEach(function(n){n.lngs.forEach(function(t){e[t]={numbers:n.nr,plurals:R[n.fc]}})}),e}var L=function(){function e(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,l.A)(this,e),this.languageUtils=n,this.options=t,this.logger=g.create("pluralResolver"),this.rules=H()}return(0,c.A)(e,[{key:"addRule",value:function(e,n){this.rules[e]=n}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var n=this.getRule(e);return n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,n){return this.getSuffixes(e).map(function(e){return n+e})}},{key:"getSuffixes",value:function(e){var n=this,t=this.getRule(e);return t?t.numbers.map(function(t){return n.getSuffix(e,t)}):[]}},{key:"getSuffix",value:function(e,n){var t=this,r=this.getRule(e);if(r){var a=r.noAbs?r.plurals(n):r.plurals(Math.abs(n)),o=r.numbers[a];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return t.options.prepend&&o.toString()?t.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON?i():this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?i():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),j=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,l.A)(this,e),this.logger=g.create("interpolator"),this.options=n,this.format=n.interpolation&&n.interpolation.format||function(e){return e},this.init(n)}return(0,c.A)(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var n=e.interpolation;this.escape=void 0!==n.escape?n.escape:z,this.escapeValue=void 0===n.escapeValue||n.escapeValue,this.useRawValueToEscape=void 0!==n.useRawValueToEscape&&n.useRawValueToEscape,this.prefix=n.prefix?D(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?D(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?D(n.nestingPrefix):n.nestingPrefixEscaped||D("$t("),this.nestingSuffix=n.nestingSuffix?D(n.nestingSuffix):n.nestingSuffixEscaped||D(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=void 0!==n.alwaysFormat&&n.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=RegExp(e,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=RegExp(n,"g");var t="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=RegExp(t,"g")}},{key:"interpolate",value:function(e,n,t,r){var a,o,i,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(0>e.indexOf(s.formatSeparator)){var a=E(n,l,e);return s.alwaysFormat?s.format(a,void 0,t):a}var o=e.split(s.formatSeparator),i=o.shift().trim(),c=o.join(s.formatSeparator).trim();return s.format(E(n,l,i),c,t,r)};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,p=r&&r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?c(s.escape(e)):c(e)}}].forEach(function(n){for(i=0;a=n.regex.exec(e);){if(void 0===(o=u(a[1].trim())))if("function"==typeof d){var t=d(e,a,r);o="string"==typeof t?t:""}else if(p){o=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(a[1]," for interpolating ").concat(e)),o="";else"string"==typeof o||s.useRawValueToEscape||(o=b(o));if(e=e.replace(a[0],n.safeValue(o)),n.regex.lastIndex=0,++i>=s.maxReplaces)break}}),e}},{key:"nest",value:function(e,n){var t,r,a=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=s({},o);function l(e,n){var t=this.nestingOptionsSeparator;if(0>e.indexOf(t))return e;var r=e.split(new RegExp("".concat(t,"[ ]*{"))),a="{".concat(r[1]);e=r[0],a=(a=this.interpolate(a,i)).replace(/'/g,'"');try{i=JSON.parse(a),n&&(i=s({},n,i))}catch(n){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),n),"".concat(e).concat(t).concat(a)}return delete i.defaultValue,e}for(i.applyPostProcessor=!1,delete i.defaultValue;t=this.nestingRegexp.exec(e);){var c=[],u=!1;if(t[0].includes(this.formatSeparator)&&!/{.*}/.test(t[1])){var d=t[1].split(this.formatSeparator).map(function(e){return e.trim()});t[1]=d.shift(),c=d,u=!0}if((r=n(l.call(this,t[1].trim(),i),i))&&t[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=b(r)),r||(this.logger.warn("missed to resolve ".concat(t[1]," for nesting ").concat(e)),r=""),u&&(r=c.reduce(function(e,n){return a.format(e,n,o.lng,o)},r.trim())),e=e.replace(t[0],r),this.regexp.lastIndex=0}return e}}]),e}();function q(e,n){for(var t=e.indexOf(n);-1!==t;)e.splice(t,1),t=e.indexOf(n)}var G=function(e){function n(e,t,r){var a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,l.A)(this,n),a=d(this,p(n).call(this)),B&&A.call(u(a)),a.backend=e,a.store=t,a.services=r,a.languageUtils=r.languageUtils,a.options=o,a.logger=g.create("backendConnector"),a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(r,o.backend,o),a}return h(n,e),(0,c.A)(n,[{key:"queueLoad",value:function(e,n,t,r){var a=this,o=[],i=[],s=[],l=[];return e.forEach(function(e){var r=!0;n.forEach(function(n){var s="".concat(e,"|").concat(n);!t.reload&&a.store.hasResourceBundle(e,n)?a.state[s]=2:a.state[s]<0||(1===a.state[s]?0>i.indexOf(s)&&i.push(s):(a.state[s]=1,r=!1,0>i.indexOf(s)&&i.push(s),0>o.indexOf(s)&&o.push(s),0>l.indexOf(n)&&l.push(n)))}),r||s.push(e)}),(o.length||i.length)&&this.queue.push({pending:i,loaded:{},errors:[],callback:r}),{toLoad:o,pending:i,toLoadLanguages:s,toLoadNamespaces:l}}},{key:"loaded",value:function(e,n,t){var r=e.split("|"),a=r[0],o=r[1];n&&this.emit("failedLoading",a,o,n),t&&this.store.addResourceBundle(a,o,t),this.state[e]=n?-1:2;var i={};this.queue.forEach(function(t){w(t.loaded,[a],o),q(t.pending,e),n&&t.errors.push(n),0!==t.pending.length||t.done||(Object.keys(t.loaded).forEach(function(e){i[e]||(i[e]=[]),t.loaded[e].length&&t.loaded[e].forEach(function(n){0>i[e].indexOf(n)&&i[e].push(n)})}),t.done=!0,t.errors.length?t.callback(t.errors):t.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(function(e){return!e.done})}},{key:"read",value:function(e,n,t){var r=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,i=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[t](e,n,function(s,l){s&&l&&a<5?setTimeout(function(){r.read.call(r,e,n,t,a+1,2*o,i)},o):i(s,l)}):i(null,{})}},{key:"prepareLoading",value:function(e,n){var t=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof n&&(n=[n]);var o=this.queueLoad(e,n,r,a);if(!o.toLoad.length)return o.pending.length||a(),null;o.toLoad.forEach(function(e){t.loadOne(e)})}},{key:"load",value:function(e,n,t){this.prepareLoading(e,n,{},t)}},{key:"reload",value:function(e,n,t){this.prepareLoading(e,n,{reload:!0},t)}},{key:"loadOne",value:function(e){var n=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),a=r[0],o=r[1];this.read(a,o,"read",void 0,void 0,function(r,i){r&&n.logger.warn("".concat(t,"loading namespace ").concat(o," for language ").concat(a," failed"),r),!r&&i&&n.logger.log("".concat(t,"loaded namespace ").concat(o," for language ").concat(a),i),n.loaded(e,r,i)})}},{key:"saveMissing",value:function(e,n,t,r,a){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)?this.logger.warn('did not save key "'.concat(t,'" as the namespace "').concat(n,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null==t||""===t||(this.backend&&this.backend.create&&this.backend.create(e,n,t,r,null,s({},o,{isUpdate:a})),e&&e[0]&&this.store.addResource(e[0],n,t,r))}}]),n}(A);function V(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var n={};if("object"===(0,o.A)(e[1])&&(n=e[1]),"string"==typeof e[1]&&(n.defaultValue=e[1]),"string"==typeof e[2]&&(n.tDescription=e[2]),"object"===(0,o.A)(e[2])||"object"===(0,o.A)(e[3])){var t=e[3]||e[2];Object.keys(t).forEach(function(e){n[e]=t[e]})}return n},interpolation:{escapeValue:!0,format:function(e,n,t,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function U(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&0>e.whitelist.indexOf("cimode")&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&0>e.supportedLngs.indexOf("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function W(){}let K=new(function(e){function n(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if((0,l.A)(this,n),e=d(this,p(n).call(this)),B&&A.call(u(e)),e.options=U(t),e.services={},e.logger=g,e.modules={external:[]},r&&!e.isInitialized&&!t.isClone){if(!e.options.initImmediate)return e.init(t,r),d(e,u(e));setTimeout(function(){e.init(t,r)},0)}return e}return h(n,e),(0,c.A)(n,[{key:"init",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;function r(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof n&&(t=n,n={}),n.whitelist&&!n.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),n.nonExplicitWhitelist&&!n.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=s({},V(),this.options,U(n)),this.format=this.options.interpolation.format,t||(t=W),!this.options.isClone){this.modules.logger?g.init(r(this.modules.logger),this.options):g.init(null,this.options);var a=new I(this.options);this.store=new M(this.options.resources,this.options);var o=this.services;o.logger=g,o.resourceStore=this.store,o.languageUtils=a,o.pluralResolver=new L(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),o.interpolator=new j(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new G(r(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",function(n){for(var t=arguments.length,r=Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];e.emit.apply(e,[n].concat(r))}),this.modules.languageDetector&&(o.languageDetector=r(this.modules.languageDetector),o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=r(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new N(this.services,this.options),this.translator.on("*",function(n){for(var t=arguments.length,r=Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];e.emit.apply(e,[n].concat(r))}),this.modules.external.forEach(function(n){n.init&&n.init(e)})}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var i=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);i.length>0&&"dev"!==i[0]&&(this.options.lng=i[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(function(n){e[n]=function(){var t;return(t=e.store)[n].apply(t,arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(function(n){e[n]=function(){var t;return(t=e.store)[n].apply(t,arguments),e}});var l=y(),c=function(){var n=function(n,r){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),l.resolve(r),t(n,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return n(null,e.t.bind(e));e.changeLanguage(e.options.lng,n)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),l}},{key:"loadResources",value:function(e){var n=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:W,r=t,a="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(a&&"cimode"===a.toLowerCase())return r();var o=[],i=function(e){if(e){var t=n.services.languageUtils.toResolveHierarchy(e);t.forEach(function(e){0>o.indexOf(e)&&o.push(e)})}};a?i(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(e){return i(e)}),this.options.preload&&this.options.preload.forEach(function(e){return i(e)}),this.services.backendConnector.load(o,this.options.ns,r)}else r(null)}},{key:"reloadResources",value:function(e,n,t){var r=y();return e||(e=this.languages),n||(n=this.options.ns),t||(t=W),this.services.backendConnector.reload(e,n,function(e){r.resolve(),t(e)}),r}},{key:"use",value:function(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&T.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,n){var t=this;this.isLanguageChangingTo=e;var r=y();this.emit("languageChanging",e);var a=function(e,a){a?(t.language=a,t.languages=t.services.languageUtils.toResolveHierarchy(a),t.translator.changeLanguage(a),t.isLanguageChangingTo=void 0,t.emit("languageChanged",a),t.logger.log("languageChanged",a)):t.isLanguageChangingTo=void 0,r.resolve(function(){return t.t.apply(t,arguments)}),n&&n(e,function(){return t.t.apply(t,arguments)})},o=function(e){var n="string"==typeof e?e:t.services.languageUtils.getBestMatchFromCodes(e);n&&(t.language||(t.language=n,t.languages=t.services.languageUtils.toResolveHierarchy(n)),t.translator.language||t.translator.changeLanguage(n),t.services.languageDetector&&t.services.languageDetector.cacheUserLanguage(n)),t.loadResources(n,function(e){a(e,n)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,n){var t=this,r=function e(n,r){var a;if("object"!==(0,o.A)(r)){for(var i=arguments.length,l=Array(i>2?i-2:0),c=2;c<i;c++)l[c-2]=arguments[c];a=t.options.overloadTranslationOptionHandler([n,r].concat(l))}else a=s({},r);return a.lng=a.lng||e.lng,a.lngs=a.lngs||e.lngs,a.ns=a.ns||e.ns,t.t(n,a)};return"string"==typeof e?r.lng=e:r.lngs=e,r.ns=n,r}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var n=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.languages[0],a=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var i=function(e,t){var r=n.services.backendConnector.state["".concat(e,"|").concat(t)];return -1===r||2===r};if(t.precheck){var s=t.precheck(this,i);if(void 0!==s)return s}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||i(r,e)&&(!a||i(o,e)))}},{key:"loadNamespaces",value:function(e,n){var t=this,r=y();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(function(e){0>t.options.ns.indexOf(e)&&t.options.ns.push(e)}),this.loadResources(function(e){r.resolve(),n&&n(e)}),r):(n&&n(),Promise.resolve())}},{key:"loadLanguages",value:function(e,n){var t=y();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],a=e.filter(function(e){return 0>r.indexOf(e)});return a.length?(this.options.preload=r.concat(a),this.loadResources(function(e){t.resolve(),n&&n(e)}),t):(n&&n(),Promise.resolve())}},{key:"dir",value:function(e){return(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),e)?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new n(e,t)}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:W,a=s({},this.options,t,{isClone:!0}),o=new n(a);return["store","services","language"].forEach(function(n){o[n]=e[n]}),o.services=s({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new N(o.services,o.options),o.translator.on("*",function(e){for(var n=arguments.length,t=Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];o.emit.apply(o,[e].concat(t))}),o.init(a,r),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}}]),n}(A)),Z=K.default||K;function Y(e,n,t,r){return Z.t(n,{ns:e,defaultValue:t,...r})}function J(e,n,t){return a[e]?Y("core",e,n??a[e],t):(console.error(`O3 Core Translations does not provide key '${e}'. The key itself is being rendered as text.`),e)}Z.on("initialized",function(){window.i18next.loadNamespaces(["core"])})},40785:function(e,n,t){"use strict";t.d(n,{K:()=>c});var r=t(18140),a=t(8902),o=t(23464),i=t(44397),s=t(92801),l=t(42729);function c(e,n=o()){let t;if(null==e)return null;let i=(0,l.J)(),u=o(n);if("string"==typeof e){let n=(0,a.CD)(e,i);if(n.invalid)return console.warn(`Could not interpret '${e}' as a date`),null;n.day&&!n.month&&(n=Object.assign({},(0,s.A)(n,"day"),{month:n.day})),n.month&&(n.month-=1),n.day&&(n=Object.assign({},(0,s.A)(n,"day"),{date:n.day})),t=o(u).set(n)}else t=o(e);let d=u.diff(t,"hours"),p=u.diff(t,"days"),f=u.diff(t,"weeks"),h=u.diff(t,"months"),m=u.diff(t,"years"),g={},A={style:"short",localeMatcher:"lookup"};if(d<2){let e=u.diff(t,"minutes");g.minutes=e,0===e&&(A.minutesDisplay="always")}else if(p<2)g.hours=d;else if(f<4)g.days=p;else if(m<1){let e=u.subtract(f,"weeks").diff(t,"days");g.weeks=f,g.days=e}else if(m<2){let e=u.subtract(h,"months").diff(t,"days");g.months=h,g.days=e}else if(m<18){let e=u.subtract(m,"year").diff(t,"months");g.years=m,g.months=e}else g.years=m;return new r.DurationFormat(i,A).format(g)}o.extend(i)},22613:function(e,n,t){"use strict";t.d(n,{Rt:()=>P,vU:()=>C,hl:()=>v,XE:()=>S,fU:()=>N,a3:()=>F,LW:()=>M,_U:()=>k,d4:()=>I,l0:()=>w,a7:()=>z,kQ:()=>$,Yq:()=>T});var r=t(31530),a=t(32878),o=t(18140),i=t(8902),s=t(23464),l=t(85602),c=t(44397),u=t(57657);let d=function(e){return null==e};var p=t(92801),f=t(42729);function h(e,n){if(n.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function m(e,n){return n.get?n.get.call(e):n.value}function g(e,n,t){if(!n.has(e))throw TypeError("attempted to "+t+" private field on non-instance");return n.get(e)}function A(e,n){var t=g(e,n,"get");return m(e,t)}function y(e,n,t){h(e,n),n.set(e,t)}s.extend(l),s.extend(u),s.extend(c);let b="YYYY-MM-DDTHH:mm:ss.SSSZZ";function v(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&("+"===e[23]||"-"===e[23])&&s(e,b).isValid()}function C(e){return s(e).isToday()}function $(e){return v(e)?s(e,b).toDate():null}function w(e,n=!1){let t=s(e);return n&&(t=t.utc()),t.format(b)}function k(e){return s(e).toDate()}var E=new WeakMap;class x{register(e,n){A(this,E).set(e,n)}getCalendar(e){if(!e)return;if(e.calendar)return e.calendar;if(e.region){let n=`${e.language}-${e.region}`;if(A(this,E).has(n))return A(this,E).get(n)}if(e.language&&A(this,E).has(e.language))return A(this,E).get(e.language);let n=new Intl.DateTimeFormat(e.toString()).resolvedOptions().calendar;return A(this,E).set(`${e.language}${e.region?`-${e.region}`:""}`,n),n}constructor(){y(this,E,{writable:!0,value:new Map})}}let D=new x;function S(e,n){D.register(e,n)}function z(e){let n=e??(0,f.J)();return D.getCalendar(n instanceof Intl.Locale?n:new Intl.Locale(n))}let B={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1};function M(e,n={}){let t=(0,f.J)(),r=(0,i.CD)(e,t);if(r.invalid)return console.warn(`Could not parse invalid date '${e}'`),null;!d(r.day)&&d(r.month)&&(r=Object.assign({},(0,p.A)(r,"day"),{month:r.day})),r.month&&(r.month-=1),r.day&&(r=Object.assign({},(0,p.A)(r,"day"),{date:r.day}));let a=s().set(r).toDate();return d(r.year)&&(n.year=!1),d(r.month)&&(n.month=!1),d(r.date)&&(n.day=!1),T(a,n)}function T(e,n){let t,r=n?.locale??(0,f.J)(),a=new Intl.Locale(r),{calendar:o,mode:i,time:l,day:c,month:u,year:d,noToday:p,numberingSystem:h}={...B,...{noToday:"am"===a.language},...n},m={calendar:o??z(a),year:d?"numeric":void 0,month:u?"short":void 0,day:c?"2-digit":void 0,numberingSystem:h},g=s(e).isToday();if(g&&!p)t=(t=new Intl.RelativeTimeFormat(r,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(r)+t.slice(1);else{"en"===a.language&&(r="en-GB");let n=new Intl.DateTimeFormat(r,m).formatToParts(e);("en"===a.language||"am"===a.language)&&"standard"==i&&d&&c&&(n=n.map(O("-"))),"wide"==i&&(n=n.map(O(" — "))),"ethiopic"===m.calendar&&(n=n.filter((e,n,t)=>"era"!==e.type&&("literal"!==e.type||!(n<t.length-1)||"era"!==t[n+1].type))),t=n.map(e=>e.value).join("")}return(!0===l||g&&"for today"===l)&&(t+=`, ${N(e)}`),t}let O=e=>(n,t,r)=>"literal"!==n.type||" "!==n.value||t<r.length-1&&"era"===r[t+1].type?n:{type:"literal",value:e};function N(e){return e.toLocaleTimeString((0,f.J)(),{hour:"2-digit",minute:"2-digit"})}function P(e,n){return T(e,{...n,time:!0})}function I(e,n){let t=z("string"==typeof n?new Intl.Locale(n):n);return t?(0,r.yP)(e,(0,a.d)(t)):e}function F(e,n){return new o.DurationFormat((0,f.J)(),n).format(e)}},42729:function(e,n,t){"use strict";function r(){let e=window.i18next.language;return"ht"===(e=e.replace("_","-"))&&(e="fr-HT"),e}t.d(n,{J:()=>r})},9826:function(e,n,t){"use strict";function r(e){return!window.offlineEnabled||(e??navigator.onLine)}t.d(n,{s:()=>r})},67943:function(e,n,t){"use strict";function r(e){return o(s(e,"usual","official"))}function a(e){return r(e)}function o(e){return e?e.text??l(e):""}function i(e){return o(e)}function s(e,...n){for(let t of(0==n.length&&(n=["usual"]),n)){let n=e.name?.find(e=>c(e,t));if(n)return n}}function l(e){let n=e.given??[];return(e.family?n.concat(e.family):n).join(" ")}function c(e,n){return e.use?e.use===n:"usual"===n}t.d(n,{QC:()=>a,Qr:()=>o,VO:()=>s,Vp:()=>r,qK:()=>i})},90108:function(e,n,t){"use strict";function r(e,n){if(e===n||Object.is(e,n))return!0;if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}if(Array.isArray(n)||"object"!=typeof e||null===e||"object"!=typeof n||null===n)return!1;let t=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(n);return t.length===r.length&&t.every(t=>e[t]===n[t])}t.d(n,{b:()=>r})},22695:function(e,n,t){"use strict";t.d(n,{f:()=>X,I:()=>z,j:()=>Y,c:()=>Z,B:()=>h,n:()=>G,g:()=>ee,r:()=>B,u:()=>T,U:()=>c,d:()=>J,o:()=>q,z:()=>$,s:()=>L,a:()=>p,O:()=>u,e:()=>d,S:()=>Q,i:()=>y,t:()=>M,b:()=>s,m:()=>f});var r=t(35400),a=t(67395),o=Object.prototype.hasOwnProperty;function i(e,n){var t,r;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&i(e[r],n[r]););return -1===r}if(!t||"object"==typeof e){for(t in r=0,e)if(o.call(e,t)&&++r&&!o.call(n,t)||!(t in n)||!i(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!=e&&n!=n}let s=new WeakMap,l=()=>{},c=l(),u=Object,d=e=>e===c,p=e=>"function"==typeof e,f=(e,n)=>({...e,...n}),h=e=>p(e.then),m={},g={},A="undefined",y=typeof window!=A,b=typeof document!=A,v=y&&"Deno"in window,C=()=>y&&typeof window.requestAnimationFrame!=A,$=(e,n)=>{let t=s.get(e);return[()=>!d(n)&&e.get(n)||m,r=>{if(!d(n)){let a=e.get(n);n in g||(g[n]=a),t[5](n,f(a,r),a||m)}},t[6],()=>!d(n)&&n in g?g[n]:!d(n)&&e.get(n)||m]},w=!0,k=()=>w,[E,x]=y&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[l,l],D={isOnline:k,isVisible:()=>{let e=b&&document.visibilityState;return d(e)||"hidden"!==e}},S={initFocus:e=>(b&&document.addEventListener("visibilitychange",e),E("focus",e),()=>{b&&document.removeEventListener("visibilitychange",e),x("focus",e)}),initReconnect:e=>{let n=()=>{w=!0,e()},t=()=>{w=!1};return E("online",n),E("offline",t),()=>{x("online",n),x("offline",t)}}},z=!r.useId,B=!y||v,M=e=>C()?window.requestAnimationFrame(e):setTimeout(e,1),T=B?r.useEffect:r.useLayoutEffect,O="undefined"!=typeof navigator&&navigator.connection,N=!B&&O&&(["slow-2g","2g"].includes(O.effectiveType)||O.saveData),P=new WeakMap,I=e=>u.prototype.toString.call(e),F=(e,n)=>e===`[object ${n}]`,R=0,H=e=>{let n,t,r=typeof e,a=I(e),o=F(a,"Date"),i=F(a,"RegExp"),s=F(a,"Object");if(u(e)!==e||o||i)n=o?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(n=P.get(e))return n;if(n=++R+"~",P.set(e,n),Array.isArray(e)){for(t=0,n="@";t<e.length;t++)n+=H(e[t])+",";P.set(e,n)}if(s){n="#";let r=u.keys(e).sort();for(;!d(t=r.pop());)d(e[t])||(n+=t+":"+H(e[t])+",");P.set(e,n)}}return n},L=e=>{if(p(e))try{e=e()}catch(n){e=""}let n=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?H(e):"",n]},j=0,q=()=>++j;async function G(...e){let[n,t,r,o]=e,i=f({populateCache:!0,throwOnError:!0},"boolean"==typeof o?{revalidate:o}:o||{}),l=i.populateCache,u=i.rollbackOnError,m=i.optimisticData,g=e=>"function"==typeof u?u(e):!1!==u,A=i.throwOnError;if(p(t)){let e=t,r=[];for(let t of n.keys())!/^\$(inf|sub)\$/.test(t)&&e(n.get(t)._k)&&r.push(t);return Promise.all(r.map(y))}return y(t);async function y(t){let o,[u]=L(t);if(!u)return;let[f,y]=$(n,u),[b,v,C,w]=s.get(n),k=()=>{let e=b[u];return(p(i.revalidate)?i.revalidate(f().data,t):!1!==i.revalidate)&&(delete C[u],delete w[u],e&&e[0])?e[0](a.q2).then(()=>f().data):f().data};if(e.length<3)return k();let E=r,x=!1,D=q();v[u]=[D,0];let S=!d(m),z=f(),B=z.data,M=z._c,T=d(M)?B:M;if(S&&y({data:m=p(m)?m(T,B):m,_c:T}),p(E))try{E=E(T)}catch(e){o=e,x=!0}if(E&&h(E)){if(E=await E.catch(e=>{o=e,x=!0}),D!==v[u][0]){if(x)throw o;return E}x&&S&&g(o)&&(l=!0,y({data:T,_c:c}))}if(l&&!x&&(p(l)?y({data:l(E,T),error:c,_c:c}):y({data:E,error:c,_c:c})),v[u][1]=q(),Promise.resolve(k()).then(()=>{y({_c:c})}),x){if(A)throw o;return}return E}}let V=(e,n)=>{for(let t in e)e[t][0]&&e[t][0](n)},U=(e,n)=>{if(!s.has(e)){let t=f(S,n),r=Object.create(null),o=G.bind(c,e),i=l,u=Object.create(null),d=(e,n)=>{let t=u[e]||[];return u[e]=t,t.push(n),()=>t.splice(t.indexOf(n),1)},p=(n,t,r)=>{e.set(n,t);let a=u[n];if(a)for(let e of a)e(t,r)},h=()=>{if(!s.has(e)&&(s.set(e,[r,Object.create(null),Object.create(null),Object.create(null),o,p,d]),!B)){let n=t.initFocus(setTimeout.bind(c,V.bind(c,r,a.CC))),o=t.initReconnect(setTimeout.bind(c,V.bind(c,r,a.jB)));i=()=>{n&&n(),o&&o(),s.delete(e)}}};return h(),[e,o,h,i]}return[e,s.get(e)[4]]},W=(e,n,t,r,a)=>{let o=t.errorRetryCount,i=a.retryCount,s=~~((Math.random()+.5)*(1<<(i<8?i:8)))*t.errorRetryInterval;(d(o)||!(i>o))&&setTimeout(r,s,a)},K=i,[Z,Y]=U(new Map),J=f({onLoadingSlow:l,onSuccess:l,onError:l,onErrorRetry:W,onDiscarded:l,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:N?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:N?5e3:3e3,compare:K,isPaused:()=>!1,cache:Z,mutate:Y,fallback:{}},D),X=(e,n)=>{let t=f(e,n);if(n){let{use:r,fallback:a}=e,{use:o,fallback:i}=n;r&&o&&(t.use=r.concat(o)),a&&i&&(t.fallback=f(a,i))}return t},Q=(0,r.createContext)({}),ee=e=>{let{value:n}=e,t=(0,r.useContext)(Q),a=p(n),o=(0,r.useMemo)(()=>a?n(t):n,[a,t,n]),i=(0,r.useMemo)(()=>a?o:X(t,o),[a,t,o]),s=o&&o.provider,l=(0,r.useRef)(c);s&&!l.current&&(l.current=U(s(i.cache||Z),o));let u=l.current;return u&&(i.cache=u[0],i.mutate=u[1]),T(()=>{if(u)return u[2]&&u[2](),u[3]},[]),(0,r.createElement)(Q.Provider,f(e,{value:i}))}},12215:function(e,n,t){"use strict";t.d(n,{q:()=>r});let r="$inf$"},67395:function(e,n,t){"use strict";t.d(n,{CC:()=>r,I0:()=>i,jB:()=>a,q2:()=>o});let r=0,a=1,o=2,i=3},64764:function(e,n,t){"use strict";t.d(n,{Ht:()=>m,aw:()=>h,qm:()=>f});var r=t(22695),a=t(12215),o=t(35400);let i=r.i&&window.__SWR_DEVTOOLS_USE__,s=i?window.__SWR_DEVTOOLS_USE__:[],l=()=>{i&&(window.__SWR_DEVTOOLS_REACT__=o)},c=e=>(0,r.a)(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],u=()=>{let e=(0,o.useContext)(r.S);return(0,o.useMemo)(()=>(0,r.m)(r.d,e),[e])},d=e=>(n,t,o)=>{let i=t&&((...e)=>{let[o]=(0,r.s)(n),[,,,i]=r.b.get(r.c);if(o.startsWith(a.q))return t(...e);let s=i[o];return(0,r.e)(s)?t(...e):(delete i[o],s)});return e(n,i,o)},p=s.concat(d),f=e=>function(...n){let t=u(),[a,o,i]=c(n),s=(0,r.f)(t,i),l=e,{use:d}=s,f=(d||[]).concat(p);for(let e=f.length;e--;)l=f[e](l);return l(a,o||s.fetcher||null,s)},h=(e,n,t)=>{let r=n[e]||(n[e]=[]);return r.push(t),()=>{let e=r.indexOf(t);e>=0&&(r[e]=r[r.length-1],r.pop())}},m=(e,n)=>(...t)=>{let[r,a,o]=c(t),i=(o.use||[]).concat(n);return e(r,a,{...o,use:i})};l()},13624:function(e,n,t){"use strict";t.d(n,{Ay:()=>w,BE:()=>$});var r=t(35400),a=t(58139),o=t(22695),i=t(67395),s=t(64764);let l=()=>{},c=l(),u=null,d=e=>e===c,p=e=>"function"==typeof e,f=new WeakMap,h=e=>u.prototype.toString.call(e),m=(e,n)=>e===`[object ${n}]`,g=0,A=e=>{let n,t,r=typeof e,a=h(e),o=m(a,"Date"),i=m(a,"RegExp"),s=m(a,"Object");if(u(e)!==e||o||i)n=o?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(n=f.get(e))return n;if(n=++g+"~",f.set(e,n),Array.isArray(e)){for(t=0,n="@";t<e.length;t++)n+=A(e[t])+",";f.set(e,n)}if(s){n="#";let r=u.keys(e).sort();for(;!d(t=r.pop());)d(e[t])||(n+=t+":"+A(e[t])+",");f.set(e,n)}}return n},y=r.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(n=>{e.status="fulfilled",e.value=n},n=>{e.status="rejected",e.reason=n}),e}}),b={dedupe:!0},v=Promise.resolve(o.U),C=(e,n,t)=>{let{cache:l,compare:c,suspense:u,fallbackData:d,revalidateOnMount:p,revalidateIfStale:f,refreshInterval:h,refreshWhenHidden:m,refreshWhenOffline:g,keepPreviousData:A}=t,[C,$,w,k]=o.b.get(l),[E,x]=(0,o.s)(e),D=(0,r.useRef)(!1),S=(0,r.useRef)(!1),z=(0,r.useRef)(E),B=(0,r.useRef)(n),M=(0,r.useRef)(t),T=()=>M.current,O=()=>T().isVisible()&&T().isOnline(),[N,P,I,F]=(0,o.z)(l,E),R=(0,r.useRef)({}).current,H=(0,o.e)(d)?(0,o.e)(t.fallback)?o.U:t.fallback[E]:d,L=(e,n)=>{for(let t in R){let r=t;if("data"===r){if(!c(e[r],n[r])&&(!(0,o.e)(e[r])||!c(Y,n[r])))return!1}else if(n[r]!==e[r])return!1}return!0},j=(0,r.useMemo)(()=>{let e=!!E&&!!n&&((0,o.e)(p)?!T().isPaused()&&!u&&!1!==f:p),t=n=>{let t=(0,o.m)(n);return(delete t._k,e)?{isValidating:!0,isLoading:!0,...t}:t},r=N(),a=F(),i=t(r),s=r===a?i:t(a),l=i;return[()=>{let e=t(N());return L(e,l)?(l.data=e.data,l.isLoading=e.isLoading,l.isValidating=e.isValidating,l.error=e.error,l):(l=e,e)},()=>s]},[l,E]),q=(0,a.useSyncExternalStore)((0,r.useCallback)(e=>I(E,(n,t)=>{L(t,n)||e()}),[l,E]),j[0],j[1]),G=!D.current,V=C[E]&&C[E].length>0,U=q.data,W=(0,o.e)(U)?H&&(0,o.B)(H)?y(H):H:U,K=q.error,Z=(0,r.useRef)(W),Y=A?(0,o.e)(U)?(0,o.e)(Z.current)?W:Z.current:U:W,J=(!V||!!(0,o.e)(K))&&(G&&!(0,o.e)(p)?p:!T().isPaused()&&(u?!(0,o.e)(W)&&f:(0,o.e)(W)||f)),X=!!(E&&n&&G&&J),Q=(0,o.e)(q.isValidating)?X:q.isValidating,ee=(0,o.e)(q.isLoading)?X:q.isLoading,en=(0,r.useCallback)(async e=>{let n,r,a=B.current;if(!E||!a||S.current||T().isPaused())return!1;let s=!0,l=e||{},u=!w[E]||!l.dedupe,d=()=>o.I?!S.current&&E===z.current&&D.current:E===z.current,p={isValidating:!1,isLoading:!1},f=()=>{P(p)},h=()=>{let e=w[E];e&&e[1]===r&&delete w[E]},m={isValidating:!0};(0,o.e)(N().data)&&(m.isLoading=!0);try{if(u&&(P(m),t.loadingTimeout&&(0,o.e)(N().data)&&setTimeout(()=>{s&&d()&&T().onLoadingSlow(E,t)},t.loadingTimeout),w[E]=[a(x),(0,o.o)()]),[n,r]=w[E],n=await n,u&&setTimeout(h,t.dedupingInterval),!w[E]||w[E][1]!==r)return u&&d()&&T().onDiscarded(E),!1;p.error=o.U;let e=$[E];if(!(0,o.e)(e)&&(r<=e[0]||r<=e[1]||0===e[1]))return f(),u&&d()&&T().onDiscarded(E),!1;let i=N().data;p.data=c(i,n)?i:n,u&&d()&&T().onSuccess(n,E,t)}catch(t){h();let e=T(),{shouldRetryOnError:n}=e;!e.isPaused()&&(p.error=t,u&&d()&&(e.onError(t,E,e),(!0===n||(0,o.a)(n)&&n(t))&&(!T().revalidateOnFocus||!T().revalidateOnReconnect||O())&&e.onErrorRetry(t,E,e,e=>{let n=C[E];n&&n[0]&&n[0](i.I0,e)},{retryCount:(l.retryCount||0)+1,dedupe:!0})))}return s=!1,f(),!0},[E,l]),et=(0,r.useCallback)((...e)=>(0,o.n)(l,z.current,...e),[]);if((0,o.u)(()=>{B.current=n,M.current=t,(0,o.e)(U)||(Z.current=U)}),(0,o.u)(()=>{if(!E)return;let e=en.bind(o.U,b),n=0;T().revalidateOnFocus&&(n=Date.now()+T().focusThrottleInterval);let t=(t,r={})=>{if(t==i.CC){let t=Date.now();T().revalidateOnFocus&&t>n&&O()&&(n=t+T().focusThrottleInterval,e())}else if(t==i.jB)T().revalidateOnReconnect&&O()&&e();else if(t==i.q2)return en();else if(t==i.I0)return en(r)},r=(0,s.aw)(E,C,t);return S.current=!1,z.current=E,D.current=!0,P({_k:x}),J&&!w[E]&&((0,o.e)(W)||o.r?e():(0,o.t)(e)),()=>{S.current=!0,r()}},[E]),(0,o.u)(()=>{let e;function n(){let n=(0,o.a)(h)?h(N().data):h;n&&-1!==e&&(e=setTimeout(t,n))}function t(){!N().error&&(m||T().isVisible())&&(g||T().isOnline())?en(b).then(n):n()}return n(),()=>{e&&(clearTimeout(e),e=-1)}},[h,m,g,E]),(0,r.useDebugValue)(Y),u){let e=E&&(0,o.e)(W);if(!o.I&&o.r&&e)throw Error("Fallback data is required when using Suspense in SSR.");e&&(B.current=n,M.current=t,S.current=!1);let r=k[E];if(y(!(0,o.e)(r)&&e?et(r):v),!(0,o.e)(K)&&e)throw K;let a=e?en(b):v;!(0,o.e)(Y)&&e&&(a.status="fulfilled",a.value=!0),y(a)}return{mutate:et,get data(){return R.data=!0,Y},get error(){return R.error=!0,K},get isValidating(){return R.isValidating=!0,Q},get isLoading(){return R.isLoading=!0,ee}}},$=o.O.defineProperty(o.g,"defaultValue",{value:o.d}),w=(0,s.qm)(C)},51280:function(e,n,t){"use strict";t.r(n),t.d(n,{__addDisposableResource:()=>P,__assign:()=>o,__asyncDelegator:()=>E,__asyncGenerator:()=>k,__asyncValues:()=>x,__await:()=>w,__awaiter:()=>h,__classPrivateFieldGet:()=>T,__classPrivateFieldIn:()=>N,__classPrivateFieldSet:()=>O,__createBinding:()=>g,__decorate:()=>s,__disposeResources:()=>F,__esDecorate:()=>c,__exportStar:()=>A,__extends:()=>a,__generator:()=>m,__importDefault:()=>M,__importStar:()=>B,__makeTemplateObject:()=>D,__metadata:()=>f,__param:()=>l,__propKey:()=>d,__read:()=>b,__rest:()=>i,__rewriteRelativeImportExtension:()=>R,__runInitializers:()=>u,__setFunctionName:()=>p,__spread:()=>v,__spreadArray:()=>$,__spreadArrays:()=>C,__values:()=>y,default:()=>H});var r=function(e,n){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])})(e,n)};function a(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}r(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var o=function(){return(o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var a in n=arguments[t])Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a]);return e}).apply(this,arguments)};function i(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>n.indexOf(r)&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)0>n.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(t[r[a]]=e[r[a]]);return t}function s(e,n,t,r){var a,o=arguments.length,i=o<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,n,t,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(o<3?a(i):o>3?a(n,t,i):a(n,t))||i);return o>3&&i&&Object.defineProperty(n,t,i),i}function l(e,n){return function(t,r){n(t,r,e)}}function c(e,n,t,r,a,o){function i(e){if(void 0!==e&&"function"!=typeof e)throw TypeError("Function expected");return e}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!n&&e?r.static?e:e.prototype:null,d=n||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),p=!1,f=t.length-1;f>=0;f--){var h={};for(var m in r)h[m]="access"===m?{}:r[m];for(var m in r.access)h.access[m]=r.access[m];h.addInitializer=function(e){if(p)throw TypeError("Cannot add initializers after decoration has completed");o.push(i(e||null))};var g=(0,t[f])("accessor"===l?{get:d.get,set:d.set}:d[c],h);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw TypeError("Object expected");(s=i(g.get))&&(d.get=s),(s=i(g.set))&&(d.set=s),(s=i(g.init))&&a.unshift(s)}else(s=i(g))&&("field"===l?a.unshift(s):d[c]=s)}u&&Object.defineProperty(u,r.name,d),p=!0}function u(e,n,t){for(var r=arguments.length>2,a=0;a<n.length;a++)t=r?n[a].call(e,t):n[a].call(e);return r?t:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function p(e,n,t){return"symbol"==typeof n&&(n=n.description?"[".concat(n.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:t?"".concat(t," ",n):n})}function f(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}function h(e,n,t,r){function a(e){return e instanceof t?e:new t(function(n){n(e)})}return new(t||(t=Promise))(function(t,o){function i(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){e.done?t(e.value):a(e.value).then(i,s)}l((r=r.apply(e,n||[])).next())})}function m(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(n){return l([e,n])}}function l(s){if(t)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],r=0}finally{t=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}var g=Object.create?function(e,n,t,r){void 0===r&&(r=t);var a=Object.getOwnPropertyDescriptor(n,t);(!a||("get"in a?!n.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,a)}:function(e,n,t,r){void 0===r&&(r=t),e[r]=n[t]};function A(e,n){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(n,t)||g(n,e,t)}function y(e){var n="function"==typeof Symbol&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,a,o=t.call(e),i=[];try{for(;(void 0===n||n-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(a)throw a.error}}return i}function v(){for(var e=[],n=0;n<arguments.length;n++)e=e.concat(b(arguments[n]));return e}function C(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;for(var r=Array(e),a=0,n=0;n<t;n++)for(var o=arguments[n],i=0,s=o.length;i<s;i++,a++)r[a]=o[i];return r}function $(e,n,t){if(t||2==arguments.length)for(var r,a=0,o=n.length;a<o;a++)!r&&a in n||(r||(r=Array.prototype.slice.call(n,0,a)),r[a]=n[a]);return e.concat(r||Array.prototype.slice.call(n))}function w(e){return this instanceof w?(this.v=e,this):new w(e)}function k(e,n,t){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var r,a=t.apply(e,n||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",i),r[Symbol.asyncIterator]=function(){return this},r;function i(e){return function(n){return Promise.resolve(n).then(e,d)}}function s(e,n){a[e]&&(r[e]=function(n){return new Promise(function(t,r){o.push([e,n,t,r])>1||l(e,n)})},n&&(r[e]=n(r[e])))}function l(e,n){try{c(a[e](n))}catch(e){p(o[0][3],e)}}function c(e){e.value instanceof w?Promise.resolve(e.value.v).then(u,d):p(o[0][2],e)}function u(e){l("next",e)}function d(e){l("throw",e)}function p(e,n){e(n),o.shift(),o.length&&l(o[0][0],o[0][1])}}function E(e){var n,t;return n={},r("next"),r("throw",function(e){throw e}),r("return"),n[Symbol.iterator]=function(){return this},n;function r(r,a){n[r]=e[r]?function(n){return(t=!t)?{value:w(e[r](n)),done:!1}:a?a(n):n}:a}}function x(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,t=e[Symbol.asyncIterator];return t?t.call(e):(e=y(e),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,o){a(r,o,(n=e[t](n)).done,n.value)})}}function a(e,n,t,r){Promise.resolve(r).then(function(n){e({value:n,done:t})},n)}}function D(e,n){return Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,e}var S=Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n},z=function(e){return(z=Object.getOwnPropertyNames||function(e){var n=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[n.length]=t);return n})(e)};function B(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var t=z(e),r=0;r<t.length;r++)"default"!==t[r]&&g(n,e,t[r]);return S(n,e),n}function M(e){return e&&e.__esModule?e:{default:e}}function T(e,n,t,r){if("a"===t&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof n?e!==n||!r:!n.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?r:"a"===t?r.call(e):r?r.value:n.get(e)}function O(e,n,t,r,a){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!a)throw TypeError("Private accessor was defined without a setter");if("function"==typeof n?e!==n||!a:!n.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(e,t):a?a.value=t:n.set(e,t),t}function N(e,n){if(null===n||"object"!=typeof n&&"function"!=typeof n)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?n===e:e.has(n)}function P(e,n,t){if(null!=n){var r,a;if("object"!=typeof n&&"function"!=typeof n)throw TypeError("Object expected.");if(t){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");r=n[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");r=n[Symbol.dispose],t&&(a=r)}if("function"!=typeof r)throw TypeError("Object not disposable.");a&&(r=function(){try{a.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:n,dispose:r,async:t})}else t&&e.stack.push({async:!0});return n}var I="function"==typeof SuppressedError?SuppressedError:function(e,n,t){var r=Error(t);return r.name="SuppressedError",r.error=e,r.suppressed=n,r};function F(e){function n(n){e.error=e.hasError?new I(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}var t,r=0;function a(){for(;t=e.stack.pop();)try{if(!t.async&&1===r)return r=0,e.stack.push(t),Promise.resolve().then(a);if(t.dispose){var o=t.dispose.call(t.value);if(t.async)return r|=2,Promise.resolve(o).then(a,function(e){return n(e),a()})}else r|=1}catch(e){n(e)}if(1===r)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return a()}function R(e,n){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,t,r,a,o){return t?n?".jsx":".js":!r||a&&o?r+a+"."+o.toLowerCase()+"js":e}):e}let H={__extends:a,__assign:o,__rest:i,__decorate:s,__param:l,__esDecorate:c,__runInitializers:u,__propKey:d,__setFunctionName:p,__metadata:f,__awaiter:h,__generator:m,__createBinding:g,__exportStar:A,__values:y,__read:b,__spread:v,__spreadArrays:C,__spreadArray:$,__await:w,__asyncGenerator:k,__asyncDelegator:E,__asyncValues:x,__makeTemplateObject:D,__importStar:B,__importDefault:M,__classPrivateFieldGet:T,__classPrivateFieldSet:O,__classPrivateFieldIn:N,__addDisposableResource:P,__disposeResources:F,__rewriteRelativeImportExtension:R}},50574:function(e,n,t){"use strict";t.d(n,{Ay:()=>c});var r={};t.r(r),t.d(r,{BRAND:()=>s.qt,DIRTY:()=>o.jm,EMPTY_PATH:()=>o.I3,INVALID:()=>o.uY,NEVER:()=>s.tm,OK:()=>o.OK,ParseStatus:()=>o.MY,Schema:()=>s.Sj,ZodAny:()=>s.Ml,ZodArray:()=>s.n,ZodBigInt:()=>s.Lr,ZodBoolean:()=>s.WF,ZodBranded:()=>s.eN,ZodCatch:()=>s.hw,ZodDate:()=>s.aP,ZodDefault:()=>s.Xi,ZodDiscriminatedUnion:()=>s.jv,ZodEffects:()=>s.k1,ZodEnum:()=>s.Vb,ZodError:()=>l.G,ZodFirstPartyTypeKind:()=>s.kY,ZodFunction:()=>s.CZ,ZodIntersection:()=>s.Jv,ZodIssueCode:()=>l.eq,ZodLazy:()=>s.Ih,ZodLiteral:()=>s.DN,ZodMap:()=>s.Ut,ZodNaN:()=>s.Tq,ZodNativeEnum:()=>s.WM,ZodNever:()=>s.iS,ZodNull:()=>s.PQ,ZodNullable:()=>s.l1,ZodNumber:()=>s.rS,ZodObject:()=>s.bv,ZodOptional:()=>s.Ii,ZodParsedType:()=>i.Zp,ZodPipeline:()=>s._c,ZodPromise:()=>s.$i,ZodReadonly:()=>s.EV,ZodRecord:()=>s.b8,ZodSchema:()=>s.lK,ZodSet:()=>s.Kz,ZodString:()=>s.ND,ZodSymbol:()=>s.K5,ZodTransformer:()=>s.BG,ZodTuple:()=>s.y0,ZodType:()=>s.aR,ZodUndefined:()=>s._Z,ZodUnion:()=>s.fZ,ZodUnknown:()=>s._,ZodVoid:()=>s.a0,addIssueToContext:()=>o.zn,any:()=>s.bz,array:()=>s.YO,bigint:()=>s.o,boolean:()=>s.zM,coerce:()=>s.au,custom:()=>s.Ie,date:()=>s.p6,datetimeRegex:()=>s.fm,defaultErrorMap:()=>a.su,discriminatedUnion:()=>s.gM,effect:()=>s.QZ,enum:()=>s.k5,function:()=>s.fH,getErrorMap:()=>a.$W,getParsedType:()=>i.CR,instanceof:()=>s.Nl,intersection:()=>s.E$,isAborted:()=>o.G4,isAsync:()=>o.xP,isDirty:()=>o.DM,isValid:()=>o.fn,late:()=>s.fn,lazy:()=>s.RZ,literal:()=>s.eu,makeIssue:()=>o.y7,map:()=>s.Tj,nan:()=>s.oi,nativeEnum:()=>s.fc,never:()=>s.Zm,null:()=>s.ch,nullable:()=>s.me,number:()=>s.ai,object:()=>s.Ik,objectUtil:()=>i.o6,oboolean:()=>s.yN,onumber:()=>s.p7,optional:()=>s.lq,ostring:()=>s.Di,pipeline:()=>s.Tk,preprocess:()=>s.vk,promise:()=>s.iv,quotelessJson:()=>l.WI,record:()=>s.g1,set:()=>s.hZ,setErrorMap:()=>a.pJ,strictObject:()=>s.re,string:()=>s.Yj,symbol:()=>s.HR,transformer:()=>s.Gu,tuple:()=>s.PV,undefined:()=>s.Vx,union:()=>s.KC,unknown:()=>s.L5,util:()=>i.ZS,void:()=>s.rI});var a=t(77939),o=t(88559),i=t(39378),s=t(57078),l=t(44341);let c=r},44341:function(e,n,t){"use strict";t.d(n,{G:()=>i,WI:()=>o,eq:()=>a});var r=t(39378);let a=r.ZS.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),o=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class i extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(e){return e.message},t={_errors:[]},r=e=>{for(let a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)t._errors.push(n(a));else{let e=t,r=0;for(;r<a.path.length;){let t=a.path[r];r===a.path.length-1?(e[t]=e[t]||{_errors:[]},e[t]._errors.push(n(a))):e[t]=e[t]||{_errors:[]},e=e[t],r++}}};return r(this),t}static assert(e){if(!(e instanceof i))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.ZS.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let n={},t=[];for(let r of this.issues)if(r.path.length>0){let t=r.path[0];n[t]=n[t]||[],n[t].push(e(r))}else t.push(e(r));return{formErrors:t,fieldErrors:n}}get formErrors(){return this.flatten()}}i.create=e=>new i(e)},77939:function(e,n,t){"use strict";t.d(n,{$W:()=>i,pJ:()=>o,su:()=>r.A});var r=t(15011);let a=r.A;function o(e){a=e}function i(){return a}},88559:function(e,n,t){"use strict";t.d(n,{DM:()=>f,G4:()=>p,I3:()=>i,MY:()=>l,OK:()=>d,fn:()=>h,jm:()=>u,uY:()=>c,xP:()=>m,y7:()=>o,zn:()=>s});var r=t(77939),a=t(15011);let o=e=>{let{data:n,path:t,errorMaps:r,issueData:a}=e,o=[...t,...a.path||[]],i={...a,path:o};if(void 0!==a.message)return{...a,path:o,message:a.message};let s="";for(let e of r.filter(e=>!!e).slice().reverse())s=e(i,{data:n,defaultError:s}).message;return{...a,path:o,message:s}},i=[];function s(e,n){let t=(0,r.$W)(),i=o({issueData:n,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,t,t===a.A?void 0:a.A].filter(e=>!!e)});e.common.issues.push(i)}class l{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,n){let t=[];for(let r of n){if("aborted"===r.status)return c;"dirty"===r.status&&e.dirty(),t.push(r.value)}return{status:e.value,value:t}}static async mergeObjectAsync(e,n){let t=[];for(let e of n){let n=await e.key,r=await e.value;t.push({key:n,value:r})}return l.mergeObjectSync(e,t)}static mergeObjectSync(e,n){let t={};for(let r of n){let{key:n,value:a}=r;if("aborted"===n.status||"aborted"===a.status)return c;"dirty"===n.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"!==n.value&&(void 0!==a.value||r.alwaysSet)&&(t[n.value]=a.value)}return{status:e.value,value:t}}}let c=Object.freeze({status:"aborted"}),u=e=>({status:"dirty",value:e}),d=e=>({status:"valid",value:e}),p=e=>"aborted"===e.status,f=e=>"dirty"===e.status,h=e=>"valid"===e.status,m=e=>"undefined"!=typeof Promise&&e instanceof Promise},39378:function(e,n,t){"use strict";var r,a;t.d(n,{CR:()=>i,ZS:()=>r,Zp:()=>o,o6:()=>a}),function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw Error()},e.arrayToEnum=e=>{let n={};for(let t of e)n[t]=t;return n},e.getValidEnumValues=n=>{let t=e.objectKeys(n).filter(e=>"number"!=typeof n[n[e]]),r={};for(let e of t)r[e]=n[e];return e.objectValues(r)},e.objectValues=n=>e.objectKeys(n).map(function(e){return n[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let n=[];for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);return n},e.find=(e,n)=>{for(let t of e)if(n(t))return t},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,n=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(n)},e.jsonStringifyReplacer=(e,n)=>"bigint"==typeof n?n.toString():n}(r||(r={})),function(e){e.mergeShapes=(e,n)=>({...e,...n})}(a||(a={}));let o=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return o.undefined;case"string":return o.string;case"number":return Number.isNaN(e)?o.nan:o.number;case"boolean":return o.boolean;case"function":return o.function;case"bigint":return o.bigint;case"symbol":return o.symbol;case"object":if(Array.isArray(e))return o.array;if(null===e)return o.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return o.promise;if("undefined"!=typeof Map&&e instanceof Map)return o.map;if("undefined"!=typeof Set&&e instanceof Set)return o.set;if("undefined"!=typeof Date&&e instanceof Date)return o.date;return o.object;default:return o.unknown}}},15011:function(e,n,t){"use strict";t.d(n,{A:()=>o});var r=t(44341),a=t(39378);let o=(e,n)=>{let t;switch(e.code){case r.eq.invalid_type:t=e.received===a.Zp.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case r.eq.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(e.expected,a.ZS.jsonStringifyReplacer)}`;break;case r.eq.unrecognized_keys:t=`Unrecognized key(s) in object: ${a.ZS.joinValues(e.keys,", ")}`;break;case r.eq.invalid_union:t="Invalid input";break;case r.eq.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${a.ZS.joinValues(e.options)}`;break;case r.eq.invalid_enum_value:t=`Invalid enum value. Expected ${a.ZS.joinValues(e.options)}, received '${e.received}'`;break;case r.eq.invalid_arguments:t="Invalid function arguments";break;case r.eq.invalid_return_type:t="Invalid function return type";break;case r.eq.invalid_date:t="Invalid date";break;case r.eq.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(t=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(t=`${t} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?t=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?t=`Invalid input: must end with "${e.validation.endsWith}"`:a.ZS.assertNever(e.validation):t="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case r.eq.too_small:t="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case r.eq.too_big:t="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case r.eq.custom:t="Invalid input";break;case r.eq.invalid_intersection_types:t="Intersection results could not be merged";break;case r.eq.not_multiple_of:t=`Number must be a multiple of ${e.multipleOf}`;break;case r.eq.not_finite:t="Number must be finite";break;default:t=n.defaultError,a.ZS.assertNever(e)}return{message:t}}},57078:function(e,n,t){"use strict";let r;t.d(n,{ch:()=>eR,WM:()=>eh,Vx:()=>eF,Ik:()=>eV,b8:()=>es,Nl:()=>ez,p7:()=>nt,Tj:()=>eX,l1:()=>ey,ND:()=>R,gM:()=>eK,Vb:()=>e_,Lr:()=>j,Ii:()=>eA,a0:()=>J,zM:()=>eN,au:()=>na,fm:()=>N,iv:()=>e5,Tq:()=>eC,oi:()=>eT,n:()=>X,RZ:()=>e1,hZ:()=>eQ,yN:()=>nr,hw:()=>ev,Jv:()=>eo,rS:()=>L,EV:()=>eE,Ie:()=>eD,Zm:()=>ej,vk:()=>e9,$i:()=>em,re:()=>eU,_Z:()=>U,K5:()=>V,DN:()=>ep,Kz:()=>ec,iS:()=>Y,aR:()=>h,_c:()=>ek,eu:()=>e2,jv:()=>er,CZ:()=>eu,_:()=>Z,g1:()=>eJ,HR:()=>eI,fH:()=>e0,aP:()=>G,YO:()=>eG,Di:()=>nn,Tk:()=>ne,o:()=>eO,PQ:()=>W,k5:()=>e3,tm:()=>no,fZ:()=>en,BG:()=>eg,p6:()=>eP,fn:()=>eS,fc:()=>e4,Yj:()=>eB,Ih:()=>ed,KC:()=>eW,L5:()=>eL,bz:()=>eH,Ml:()=>K,Sj:()=>h,k1:()=>eg,kY:()=>o,lK:()=>h,y0:()=>ei,qt:()=>e$,me:()=>e7,ai:()=>eM,PV:()=>eY,rI:()=>eq,E$:()=>eZ,WF:()=>q,lq:()=>e8,Gu:()=>e6,Ut:()=>el,eN:()=>ew,Xi:()=>eb,bv:()=>ee,QZ:()=>e6});var a,o,i=t(44341),s=t(77939),l=t(15011);!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(a||(a={}));var c=t(88559),u=t(39378);class d{constructor(e,n,t,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=t,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let p=(e,n)=>{if((0,c.fn)(n))return{success:!0,data:n.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new i.G(e.common.issues);return this._error=n,this._error}}};function f(e){if(!e)return{};let{errorMap:n,invalid_type_error:t,required_error:r,description:a}=e;if(n&&(t||r))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return n?{errorMap:n,description:a}:{errorMap:(n,a)=>{let{message:o}=e;return"invalid_enum_value"===n.code?{message:o??a.defaultError}:void 0===a.data?{message:o??r??a.defaultError}:"invalid_type"!==n.code?{message:a.defaultError}:{message:o??t??a.defaultError}},description:a}}class h{get description(){return this._def.description}_getType(e){return(0,u.CR)(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:(0,u.CR)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new c.MY,ctx:{common:e.parent.common,data:e.data,parsedType:(0,u.CR)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if((0,c.xP)(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,n){let t=this.safeParse(e,n);if(t.success)return t.data;throw t.error}safeParse(e,n){let t={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,u.CR)(e)},r=this._parseSync({data:e,path:t.path,parent:t});return p(t,r)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,u.CR)(e)};if(!this["~standard"].async)try{let t=this._parseSync({data:e,path:[],parent:n});return(0,c.fn)(t)?{value:t.value}:{issues:n.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(e=>(0,c.fn)(e)?{value:e.value}:{issues:n.common.issues})}async parseAsync(e,n){let t=await this.safeParseAsync(e,n);if(t.success)return t.data;throw t.error}async safeParseAsync(e,n){let t={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,u.CR)(e)},r=this._parse({data:e,path:t.path,parent:t});return p(t,await ((0,c.xP)(r)?r:Promise.resolve(r)))}refine(e,n){let t=e=>"string"==typeof n||void 0===n?{message:n}:"function"==typeof n?n(e):n;return this._refinement((n,r)=>{let a=e(n),o=()=>r.addIssue({code:i.eq.custom,...t(n)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then(e=>!!e||(o(),!1)):!!a||(o(),!1)})}refinement(e,n){return this._refinement((t,r)=>!!e(t)||(r.addIssue("function"==typeof n?n(t,r):n),!1))}_refinement(e){return new eg({schema:this,typeName:o.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return eA.create(this,this._def)}nullable(){return ey.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return X.create(this)}promise(){return em.create(this,this._def)}or(e){return en.create([this,e],this._def)}and(e){return eo.create(this,e,this._def)}transform(e){return new eg({...f(this._def),schema:this,typeName:o.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n="function"==typeof e?e:()=>e;return new eb({...f(this._def),innerType:this,defaultValue:n,typeName:o.ZodDefault})}brand(){return new ew({typeName:o.ZodBranded,type:this,...f(this._def)})}catch(e){let n="function"==typeof e?e:()=>e;return new ev({...f(this._def),innerType:this,catchValue:n,typeName:o.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return ek.create(this,e)}readonly(){return eE.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let m=/^c[^\s-]{8,}$/i,g=/^[0-9a-z]+$/,A=/^[0-9A-HJKMNP-TV-Z]{26}$/i,y=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,b=/^[a-z0-9_-]{21}$/i,v=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,C=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,$=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,w="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",k=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,E=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,x=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,D=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,S=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,B="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",M=RegExp(`^${B}$`);function T(e){let n="[0-5]\\d";e.precision?n=`${n}\\.\\d{${e.precision}}`:null==e.precision&&(n=`${n}(\\.\\d+)?`);let t=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${t}`}function O(e){return RegExp(`^${T(e)}$`)}function N(e){let n=`${B}T${T(e)}`,t=[];return t.push(e.local?"Z?":"Z"),e.offset&&t.push("([+-]\\d{2}:?\\d{2})"),n=`${n}(${t.join("|")})`,RegExp(`^${n}$`)}function P(e,n){return!!(("v4"===n||!n)&&k.test(e)||("v6"===n||!n)&&x.test(e))}function I(e,n){if(!v.test(e))return!1;try{let[t]=e.split(".");if(!t)return!1;let r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(r));if("object"!=typeof a||null===a||"typ"in a&&a?.typ!=="JWT"||!a.alg||n&&a.alg!==n)return!1;return!0}catch{return!1}}function F(e,n){return!!(("v4"===n||!n)&&E.test(e)||("v6"===n||!n)&&D.test(e))}class R extends h{_parse(e){let n;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.Zp.string){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.string,received:n.parsedType}),c.uY}let t=new c.MY;for(let a of this._def.checks)if("min"===a.kind)e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("max"===a.kind)e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("length"===a.kind){let r=e.data.length>a.value,o=e.data.length<a.value;(r||o)&&(n=this._getOrReturnCtx(e,n),r?(0,c.zn)(n,{code:i.eq.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&(0,c.zn)(n,{code:i.eq.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),t.dirty())}else if("email"===a.kind)$.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"email",code:i.eq.invalid_string,message:a.message}),t.dirty());else if("emoji"===a.kind)r||(r=RegExp(w,"u")),r.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"emoji",code:i.eq.invalid_string,message:a.message}),t.dirty());else if("uuid"===a.kind)y.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"uuid",code:i.eq.invalid_string,message:a.message}),t.dirty());else if("nanoid"===a.kind)b.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"nanoid",code:i.eq.invalid_string,message:a.message}),t.dirty());else if("cuid"===a.kind)m.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"cuid",code:i.eq.invalid_string,message:a.message}),t.dirty());else if("cuid2"===a.kind)g.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"cuid2",code:i.eq.invalid_string,message:a.message}),t.dirty());else if("ulid"===a.kind)A.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"ulid",code:i.eq.invalid_string,message:a.message}),t.dirty());else if("url"===a.kind)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"url",code:i.eq.invalid_string,message:a.message}),t.dirty()}else"regex"===a.kind?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"regex",code:i.eq.invalid_string,message:a.message}),t.dirty())):"trim"===a.kind?e.data=e.data.trim():"includes"===a.kind?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),t.dirty()):"toLowerCase"===a.kind?e.data=e.data.toLowerCase():"toUpperCase"===a.kind?e.data=e.data.toUpperCase():"startsWith"===a.kind?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.invalid_string,validation:{startsWith:a.value},message:a.message}),t.dirty()):"endsWith"===a.kind?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.invalid_string,validation:{endsWith:a.value},message:a.message}),t.dirty()):"datetime"===a.kind?N(a).test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.invalid_string,validation:"datetime",message:a.message}),t.dirty()):"date"===a.kind?M.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.invalid_string,validation:"date",message:a.message}),t.dirty()):"time"===a.kind?O(a).test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.invalid_string,validation:"time",message:a.message}),t.dirty()):"duration"===a.kind?C.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"duration",code:i.eq.invalid_string,message:a.message}),t.dirty()):"ip"===a.kind?P(e.data,a.version)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"ip",code:i.eq.invalid_string,message:a.message}),t.dirty()):"jwt"===a.kind?I(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"jwt",code:i.eq.invalid_string,message:a.message}),t.dirty()):"cidr"===a.kind?F(e.data,a.version)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"cidr",code:i.eq.invalid_string,message:a.message}),t.dirty()):"base64"===a.kind?S.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"base64",code:i.eq.invalid_string,message:a.message}),t.dirty()):"base64url"===a.kind?z.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{validation:"base64url",code:i.eq.invalid_string,message:a.message}),t.dirty()):u.ZS.assertNever(a);return{status:t.value,value:e.data}}_regex(e,n,t){return this.refinement(n=>e.test(n),{validation:n,code:i.eq.invalid_string,...a.errToObj(t)})}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...a.errToObj(e)})}url(e){return this._addCheck({kind:"url",...a.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...a.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...a.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...a.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...a.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...a.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...a.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...a.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...a.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...a.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...a.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...a.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...a.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...a.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...a.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...a.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...a.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...a.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...a.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...a.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...a.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...a.errToObj(n)})}nonempty(e){return this.min(1,a.errToObj(e))}trim(){return new R({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let n of this._def.checks)"min"===n.kind&&(null===e||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)"max"===n.kind&&(null===e||n.value<e)&&(e=n.value);return e}}function H(e,n){let t=(e.toString().split(".")[1]||"").length,r=(n.toString().split(".")[1]||"").length,a=t>r?t:r;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(n.toFixed(a).replace(".",""))/10**a}R.create=e=>new R({checks:[],typeName:o.ZodString,coerce:e?.coerce??!1,...f(e)});class L extends h{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let n;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.Zp.number){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.number,received:n.parsedType}),c.uY}let t=new c.MY;for(let r of this._def.checks)"int"===r.kind?u.ZS.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.invalid_type,expected:"integer",received:"float",message:r.message}),t.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),t.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),t.dirty()):"multipleOf"===r.kind?0!==H(e.data,r.value)&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.not_multiple_of,multipleOf:r.value,message:r.message}),t.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.not_finite,message:r.message}),t.dirty()):u.ZS.assertNever(r);return{status:t.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,a.toString(n))}gt(e,n){return this.setLimit("min",e,!1,a.toString(n))}lte(e,n){return this.setLimit("max",e,!0,a.toString(n))}lt(e,n){return this.setLimit("max",e,!1,a.toString(n))}setLimit(e,n,t,r){return new L({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:t,message:a.toString(r)}]})}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:a.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:a.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:a.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:a.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:a.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:a.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:a.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:a.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:a.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)"min"===n.kind&&(null===e||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)"max"===n.kind&&(null===e||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&u.ZS.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let t of this._def.checks)if("finite"===t.kind||"int"===t.kind||"multipleOf"===t.kind)return!0;else"min"===t.kind?(null===n||t.value>n)&&(n=t.value):"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return Number.isFinite(n)&&Number.isFinite(e)}}L.create=e=>new L({checks:[],typeName:o.ZodNumber,coerce:e?.coerce||!1,...f(e)});class j extends h{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let n;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.Zp.bigint)return this._getInvalidInput(e);let t=new c.MY;for(let r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),t.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),t.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.not_multiple_of,multipleOf:r.value,message:r.message}),t.dirty()):u.ZS.assertNever(r);return{status:t.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.bigint,received:n.parsedType}),c.uY}gte(e,n){return this.setLimit("min",e,!0,a.toString(n))}gt(e,n){return this.setLimit("min",e,!1,a.toString(n))}lte(e,n){return this.setLimit("max",e,!0,a.toString(n))}lt(e,n){return this.setLimit("max",e,!1,a.toString(n))}setLimit(e,n,t,r){return new j({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:t,message:a.toString(r)}]})}_addCheck(e){return new j({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:a.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:a.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:a.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:a.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:a.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)"min"===n.kind&&(null===e||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)"max"===n.kind&&(null===e||n.value<e)&&(e=n.value);return e}}j.create=e=>new j({checks:[],typeName:o.ZodBigInt,coerce:e?.coerce??!1,...f(e)});class q extends h{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.Zp.boolean){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.boolean,received:n.parsedType}),c.uY}return(0,c.OK)(e.data)}}q.create=e=>new q({typeName:o.ZodBoolean,coerce:e?.coerce||!1,...f(e)});class G extends h{_parse(e){let n;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.Zp.date){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.date,received:n.parsedType}),c.uY}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_date}),c.uY}let t=new c.MY;for(let r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),(0,c.zn)(n,{code:i.eq.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):u.ZS.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new G({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:a.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:a.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)"min"===n.kind&&(null===e||n.value>e)&&(e=n.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)"max"===n.kind&&(null===e||n.value<e)&&(e=n.value);return null!=e?new Date(e):null}}G.create=e=>new G({checks:[],coerce:e?.coerce||!1,typeName:o.ZodDate,...f(e)});class V extends h{_parse(e){if(this._getType(e)!==u.Zp.symbol){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.symbol,received:n.parsedType}),c.uY}return(0,c.OK)(e.data)}}V.create=e=>new V({typeName:o.ZodSymbol,...f(e)});class U extends h{_parse(e){if(this._getType(e)!==u.Zp.undefined){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.undefined,received:n.parsedType}),c.uY}return(0,c.OK)(e.data)}}U.create=e=>new U({typeName:o.ZodUndefined,...f(e)});class W extends h{_parse(e){if(this._getType(e)!==u.Zp.null){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.null,received:n.parsedType}),c.uY}return(0,c.OK)(e.data)}}W.create=e=>new W({typeName:o.ZodNull,...f(e)});class K extends h{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,c.OK)(e.data)}}K.create=e=>new K({typeName:o.ZodAny,...f(e)});class Z extends h{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,c.OK)(e.data)}}Z.create=e=>new Z({typeName:o.ZodUnknown,...f(e)});class Y extends h{_parse(e){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.never,received:n.parsedType}),c.uY}}Y.create=e=>new Y({typeName:o.ZodNever,...f(e)});class J extends h{_parse(e){if(this._getType(e)!==u.Zp.undefined){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.void,received:n.parsedType}),c.uY}return(0,c.OK)(e.data)}}J.create=e=>new J({typeName:o.ZodVoid,...f(e)});class X extends h{_parse(e){let{ctx:n,status:t}=this._processInputParams(e),r=this._def;if(n.parsedType!==u.Zp.array)return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.array,received:n.parsedType}),c.uY;if(null!==r.exactLength){let e=n.data.length>r.exactLength.value,a=n.data.length<r.exactLength.value;(e||a)&&((0,c.zn)(n,{code:e?i.eq.too_big:i.eq.too_small,minimum:a?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),t.dirty())}if(null!==r.minLength&&n.data.length<r.minLength.value&&((0,c.zn)(n,{code:i.eq.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),t.dirty()),null!==r.maxLength&&n.data.length>r.maxLength.value&&((0,c.zn)(n,{code:i.eq.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),t.dirty()),n.common.async)return Promise.all([...n.data].map((e,t)=>r.type._parseAsync(new d(n,e,n.path,t)))).then(e=>c.MY.mergeArray(t,e));let a=[...n.data].map((e,t)=>r.type._parseSync(new d(n,e,n.path,t)));return c.MY.mergeArray(t,a)}get element(){return this._def.type}min(e,n){return new X({...this._def,minLength:{value:e,message:a.toString(n)}})}max(e,n){return new X({...this._def,maxLength:{value:e,message:a.toString(n)}})}length(e,n){return new X({...this._def,exactLength:{value:e,message:a.toString(n)}})}nonempty(e){return this.min(1,e)}}function Q(e){if(e instanceof ee){let n={};for(let t in e.shape){let r=e.shape[t];n[t]=eA.create(Q(r))}return new ee({...e._def,shape:()=>n})}if(e instanceof X)return new X({...e._def,type:Q(e.element)});if(e instanceof eA)return eA.create(Q(e.unwrap()));if(e instanceof ey)return ey.create(Q(e.unwrap()));if(e instanceof ei)return ei.create(e.items.map(e=>Q(e)));else return e}X.create=(e,n)=>new X({type:e,minLength:null,maxLength:null,exactLength:null,typeName:o.ZodArray,...f(n)});class ee extends h{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),n=u.ZS.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==u.Zp.object){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.object,received:n.parsedType}),c.uY}let{status:n,ctx:t}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Y&&"strip"===this._def.unknownKeys))for(let e in t.data)a.includes(e)||o.push(e);let s=[];for(let e of a){let n=r[e],a=t.data[e];s.push({key:{status:"valid",value:e},value:n._parse(new d(t,a,t.path,e)),alwaysSet:e in t.data})}if(this._def.catchall instanceof Y){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of o)s.push({key:{status:"valid",value:e},value:{status:"valid",value:t.data[e]}});else if("strict"===e)o.length>0&&((0,c.zn)(t,{code:i.eq.unrecognized_keys,keys:o}),n.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let n of o){let r=t.data[n];s.push({key:{status:"valid",value:n},value:e._parse(new d(t,r,t.path,n)),alwaysSet:n in t.data})}}return t.common.async?Promise.resolve().then(async()=>{let e=[];for(let n of s){let t=await n.key,r=await n.value;e.push({key:t,value:r,alwaysSet:n.alwaysSet})}return e}).then(e=>c.MY.mergeObjectSync(n,e)):c.MY.mergeObjectSync(n,s)}get shape(){return this._def.shape()}strict(e){return a.errToObj,new ee({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(n,t)=>{let r=this._def.errorMap?.(n,t).message??t.defaultError;return"unrecognized_keys"===n.code?{message:a.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new ee({...this._def,unknownKeys:"strip"})}passthrough(){return new ee({...this._def,unknownKeys:"passthrough"})}extend(e){return new ee({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ee({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:o.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ee({...this._def,catchall:e})}pick(e){let n={};for(let t of u.ZS.objectKeys(e))e[t]&&this.shape[t]&&(n[t]=this.shape[t]);return new ee({...this._def,shape:()=>n})}omit(e){let n={};for(let t of u.ZS.objectKeys(this.shape))e[t]||(n[t]=this.shape[t]);return new ee({...this._def,shape:()=>n})}deepPartial(){return Q(this)}partial(e){let n={};for(let t of u.ZS.objectKeys(this.shape)){let r=this.shape[t];e&&!e[t]?n[t]=r:n[t]=r.optional()}return new ee({...this._def,shape:()=>n})}required(e){let n={};for(let t of u.ZS.objectKeys(this.shape))if(e&&!e[t])n[t]=this.shape[t];else{let e=this.shape[t];for(;e instanceof eA;)e=e._def.innerType;n[t]=e}return new ee({...this._def,shape:()=>n})}keyof(){return ef(u.ZS.objectKeys(this.shape))}}ee.create=(e,n)=>new ee({shape:()=>e,unknownKeys:"strip",catchall:Y.create(),typeName:o.ZodObject,...f(n)}),ee.strictCreate=(e,n)=>new ee({shape:()=>e,unknownKeys:"strict",catchall:Y.create(),typeName:o.ZodObject,...f(n)}),ee.lazycreate=(e,n)=>new ee({shape:e,unknownKeys:"strip",catchall:Y.create(),typeName:o.ZodObject,...f(n)});class en extends h{_parse(e){let{ctx:n}=this._processInputParams(e),t=this._def.options;function r(e){for(let n of e)if("valid"===n.result.status)return n.result;for(let t of e)if("dirty"===t.result.status)return n.common.issues.push(...t.ctx.common.issues),t.result;let t=e.map(e=>new i.G(e.ctx.common.issues));return(0,c.zn)(n,{code:i.eq.invalid_union,unionErrors:t}),c.uY}if(n.common.async)return Promise.all(t.map(async e=>{let t={...n,common:{...n.common,issues:[]},parent:null};return{result:await e._parseAsync({data:n.data,path:n.path,parent:t}),ctx:t}})).then(r);{let e,r=[];for(let a of t){let t={...n,common:{...n.common,issues:[]},parent:null},o=a._parseSync({data:n.data,path:n.path,parent:t});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:t}),t.common.issues.length&&r.push(t.common.issues)}if(e)return n.common.issues.push(...e.ctx.common.issues),e.result;let a=r.map(e=>new i.G(e));return(0,c.zn)(n,{code:i.eq.invalid_union,unionErrors:a}),c.uY}}get options(){return this._def.options}}en.create=(e,n)=>new en({options:e,typeName:o.ZodUnion,...f(n)});let et=e=>{if(e instanceof ed)return et(e.schema);if(e instanceof eg)return et(e.innerType());if(e instanceof ep)return[e.value];if(e instanceof e_)return e.options;if(e instanceof eh)return u.ZS.objectValues(e.enum);else if(e instanceof eb)return et(e._def.innerType);else if(e instanceof U)return[void 0];else if(e instanceof W)return[null];else if(e instanceof eA)return[void 0,...et(e.unwrap())];else if(e instanceof ey)return[null,...et(e.unwrap())];else if(e instanceof ew)return et(e.unwrap());else if(e instanceof eE)return et(e.unwrap());else if(e instanceof ev)return et(e._def.innerType);else return[]};class er extends h{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==u.Zp.object)return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.object,received:n.parsedType}),c.uY;let t=this.discriminator,r=n.data[t],a=this.optionsMap.get(r);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):((0,c.zn)(n,{code:i.eq.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[t]}),c.uY)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,t){let r=new Map;for(let t of n){let n=et(t.shape[e]);if(!n.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of n){if(r.has(a))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,t)}}return new er({typeName:o.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...f(t)})}}function ea(e,n){let t=(0,u.CR)(e),r=(0,u.CR)(n);if(e===n)return{valid:!0,data:e};if(t===u.Zp.object&&r===u.Zp.object){let t=u.ZS.objectKeys(n),r=u.ZS.objectKeys(e).filter(e=>-1!==t.indexOf(e)),a={...e,...n};for(let t of r){let r=ea(e[t],n[t]);if(!r.valid)return{valid:!1};a[t]=r.data}return{valid:!0,data:a}}if(t===u.Zp.array&&r===u.Zp.array){if(e.length!==n.length)return{valid:!1};let t=[];for(let r=0;r<e.length;r++){let a=ea(e[r],n[r]);if(!a.valid)return{valid:!1};t.push(a.data)}return{valid:!0,data:t}}if(t===u.Zp.date&&r===u.Zp.date&&+e==+n)return{valid:!0,data:e};return{valid:!1}}class eo extends h{_parse(e){let{status:n,ctx:t}=this._processInputParams(e),r=(e,r)=>{if((0,c.G4)(e)||(0,c.G4)(r))return c.uY;let a=ea(e.value,r.value);return a.valid?(((0,c.DM)(e)||(0,c.DM)(r))&&n.dirty(),{status:n.value,value:a.data}):((0,c.zn)(t,{code:i.eq.invalid_intersection_types}),c.uY)};return t.common.async?Promise.all([this._def.left._parseAsync({data:t.data,path:t.path,parent:t}),this._def.right._parseAsync({data:t.data,path:t.path,parent:t})]).then(([e,n])=>r(e,n)):r(this._def.left._parseSync({data:t.data,path:t.path,parent:t}),this._def.right._parseSync({data:t.data,path:t.path,parent:t}))}}eo.create=(e,n,t)=>new eo({left:e,right:n,typeName:o.ZodIntersection,...f(t)});class ei extends h{_parse(e){let{status:n,ctx:t}=this._processInputParams(e);if(t.parsedType!==u.Zp.array)return(0,c.zn)(t,{code:i.eq.invalid_type,expected:u.Zp.array,received:t.parsedType}),c.uY;if(t.data.length<this._def.items.length)return(0,c.zn)(t,{code:i.eq.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),c.uY;!this._def.rest&&t.data.length>this._def.items.length&&((0,c.zn)(t,{code:i.eq.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let r=[...t.data].map((e,n)=>{let r=this._def.items[n]||this._def.rest;return r?r._parse(new d(t,e,t.path,n)):null}).filter(e=>!!e);return t.common.async?Promise.all(r).then(e=>c.MY.mergeArray(n,e)):c.MY.mergeArray(n,r)}get items(){return this._def.items}rest(e){return new ei({...this._def,rest:e})}}ei.create=(e,n)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ei({items:e,typeName:o.ZodTuple,rest:null,...f(n)})};class es extends h{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:t}=this._processInputParams(e);if(t.parsedType!==u.Zp.object)return(0,c.zn)(t,{code:i.eq.invalid_type,expected:u.Zp.object,received:t.parsedType}),c.uY;let r=[],a=this._def.keyType,o=this._def.valueType;for(let e in t.data)r.push({key:a._parse(new d(t,e,t.path,e)),value:o._parse(new d(t,t.data[e],t.path,e)),alwaysSet:e in t.data});return t.common.async?c.MY.mergeObjectAsync(n,r):c.MY.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,t){return new es(n instanceof h?{keyType:e,valueType:n,typeName:o.ZodRecord,...f(t)}:{keyType:R.create(),valueType:e,typeName:o.ZodRecord,...f(n)})}}class el extends h{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:t}=this._processInputParams(e);if(t.parsedType!==u.Zp.map)return(0,c.zn)(t,{code:i.eq.invalid_type,expected:u.Zp.map,received:t.parsedType}),c.uY;let r=this._def.keyType,a=this._def.valueType,o=[...t.data.entries()].map(([e,n],o)=>({key:r._parse(new d(t,e,t.path,[o,"key"])),value:a._parse(new d(t,n,t.path,[o,"value"]))}));if(t.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let t of o){let r=await t.key,a=await t.value;if("aborted"===r.status||"aborted"===a.status)return c.uY;("dirty"===r.status||"dirty"===a.status)&&n.dirty(),e.set(r.value,a.value)}return{status:n.value,value:e}})}{let e=new Map;for(let t of o){let r=t.key,a=t.value;if("aborted"===r.status||"aborted"===a.status)return c.uY;("dirty"===r.status||"dirty"===a.status)&&n.dirty(),e.set(r.value,a.value)}return{status:n.value,value:e}}}}el.create=(e,n,t)=>new el({valueType:n,keyType:e,typeName:o.ZodMap,...f(t)});class ec extends h{_parse(e){let{status:n,ctx:t}=this._processInputParams(e);if(t.parsedType!==u.Zp.set)return(0,c.zn)(t,{code:i.eq.invalid_type,expected:u.Zp.set,received:t.parsedType}),c.uY;let r=this._def;null!==r.minSize&&t.data.size<r.minSize.value&&((0,c.zn)(t,{code:i.eq.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),null!==r.maxSize&&t.data.size>r.maxSize.value&&((0,c.zn)(t,{code:i.eq.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let a=this._def.valueType;function o(e){let t=new Set;for(let r of e){if("aborted"===r.status)return c.uY;"dirty"===r.status&&n.dirty(),t.add(r.value)}return{status:n.value,value:t}}let s=[...t.data.values()].map((e,n)=>a._parse(new d(t,e,t.path,n)));return t.common.async?Promise.all(s).then(e=>o(e)):o(s)}min(e,n){return new ec({...this._def,minSize:{value:e,message:a.toString(n)}})}max(e,n){return new ec({...this._def,maxSize:{value:e,message:a.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}ec.create=(e,n)=>new ec({valueType:e,minSize:null,maxSize:null,typeName:o.ZodSet,...f(n)});class eu extends h{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==u.Zp.function)return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.function,received:n.parsedType}),c.uY;function t(e,t){return(0,c.y7)({data:e,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,(0,s.$W)(),l.A].filter(e=>!!e),issueData:{code:i.eq.invalid_arguments,argumentsError:t}})}function r(e,t){return(0,c.y7)({data:e,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,(0,s.$W)(),l.A].filter(e=>!!e),issueData:{code:i.eq.invalid_return_type,returnTypeError:t}})}let a={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof em){let e=this;return(0,c.OK)(async function(...n){let s=new i.G([]),l=await e._def.args.parseAsync(n,a).catch(e=>{throw s.addIssue(t(n,e)),s}),c=await Reflect.apply(o,this,l);return await e._def.returns._def.type.parseAsync(c,a).catch(e=>{throw s.addIssue(r(c,e)),s})})}{let e=this;return(0,c.OK)(function(...n){let s=e._def.args.safeParse(n,a);if(!s.success)throw new i.G([t(n,s.error)]);let l=Reflect.apply(o,this,s.data),c=e._def.returns.safeParse(l,a);if(!c.success)throw new i.G([r(l,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new eu({...this._def,args:ei.create(e).rest(Z.create())})}returns(e){return new eu({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,t){return new eu({args:e||ei.create([]).rest(Z.create()),returns:n||Z.create(),typeName:o.ZodFunction,...f(t)})}}class ed extends h{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ed.create=(e,n)=>new ed({getter:e,typeName:o.ZodLazy,...f(n)});class ep extends h{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{received:n.data,code:i.eq.invalid_literal,expected:this._def.value}),c.uY}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ef(e,n){return new e_({values:e,typeName:o.ZodEnum,...f(n)})}ep.create=(e,n)=>new ep({value:e,typeName:o.ZodLiteral,...f(n)});class e_ extends h{_parse(e){if("string"!=typeof e.data){let n=this._getOrReturnCtx(e),t=this._def.values;return(0,c.zn)(n,{expected:u.ZS.joinValues(t),received:n.parsedType,code:i.eq.invalid_type}),c.uY}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),t=this._def.values;return(0,c.zn)(n,{received:n.data,code:i.eq.invalid_enum_value,options:t}),c.uY}return(0,c.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return e_.create(e,{...this._def,...n})}exclude(e,n=this._def){return e_.create(this.options.filter(n=>!e.includes(n)),{...this._def,...n})}}e_.create=ef;class eh extends h{_parse(e){let n=u.ZS.getValidEnumValues(this._def.values),t=this._getOrReturnCtx(e);if(t.parsedType!==u.Zp.string&&t.parsedType!==u.Zp.number){let e=u.ZS.objectValues(n);return(0,c.zn)(t,{expected:u.ZS.joinValues(e),received:t.parsedType,code:i.eq.invalid_type}),c.uY}if(this._cache||(this._cache=new Set(u.ZS.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=u.ZS.objectValues(n);return(0,c.zn)(t,{received:t.data,code:i.eq.invalid_enum_value,options:e}),c.uY}return(0,c.OK)(e.data)}get enum(){return this._def.values}}eh.create=(e,n)=>new eh({values:e,typeName:o.ZodNativeEnum,...f(n)});class em extends h{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==u.Zp.promise&&!1===n.common.async)return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.promise,received:n.parsedType}),c.uY;let t=n.parsedType===u.Zp.promise?n.data:Promise.resolve(n.data);return(0,c.OK)(t.then(e=>this._def.type.parseAsync(e,{path:n.path,errorMap:n.common.contextualErrorMap})))}}em.create=(e,n)=>new em({type:e,typeName:o.ZodPromise,...f(n)});class eg extends h{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===o.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:t}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:e=>{(0,c.zn)(t,e),e.fatal?n.abort():n.dirty()},get path(){return t.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===r.type){let e=r.transform(t.data,a);if(t.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===n.value)return c.uY;let r=await this._def.schema._parseAsync({data:e,path:t.path,parent:t});return"aborted"===r.status?c.uY:"dirty"===r.status||"dirty"===n.value?(0,c.jm)(r.value):r});{if("aborted"===n.value)return c.uY;let r=this._def.schema._parseSync({data:e,path:t.path,parent:t});return"aborted"===r.status?c.uY:"dirty"===r.status||"dirty"===n.value?(0,c.jm)(r.value):r}}if("refinement"===r.type){let e=e=>{let n=r.refinement(e,a);if(t.common.async)return Promise.resolve(n);if(n instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==t.common.async)return this._def.schema._parseAsync({data:t.data,path:t.path,parent:t}).then(t=>"aborted"===t.status?c.uY:("dirty"===t.status&&n.dirty(),e(t.value).then(()=>({status:n.value,value:t.value}))));{let r=this._def.schema._parseSync({data:t.data,path:t.path,parent:t});return"aborted"===r.status?c.uY:("dirty"===r.status&&n.dirty(),e(r.value),{status:n.value,value:r.value})}}if("transform"===r.type)if(!1!==t.common.async)return this._def.schema._parseAsync({data:t.data,path:t.path,parent:t}).then(e=>(0,c.fn)(e)?Promise.resolve(r.transform(e.value,a)).then(e=>({status:n.value,value:e})):c.uY);else{let e=this._def.schema._parseSync({data:t.data,path:t.path,parent:t});if(!(0,c.fn)(e))return c.uY;let o=r.transform(e.value,a);if(o instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}u.ZS.assertNever(r)}}eg.create=(e,n,t)=>new eg({schema:e,typeName:o.ZodEffects,effect:n,...f(t)}),eg.createWithPreprocess=(e,n,t)=>new eg({schema:n,effect:{type:"preprocess",transform:e},typeName:o.ZodEffects,...f(t)});class eA extends h{_parse(e){return this._getType(e)===u.Zp.undefined?(0,c.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eA.create=(e,n)=>new eA({innerType:e,typeName:o.ZodOptional,...f(n)});class ey extends h{_parse(e){return this._getType(e)===u.Zp.null?(0,c.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ey.create=(e,n)=>new ey({innerType:e,typeName:o.ZodNullable,...f(n)});class eb extends h{_parse(e){let{ctx:n}=this._processInputParams(e),t=n.data;return n.parsedType===u.Zp.undefined&&(t=this._def.defaultValue()),this._def.innerType._parse({data:t,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}eb.create=(e,n)=>new eb({innerType:e,typeName:o.ZodDefault,defaultValue:"function"==typeof n.default?n.default:()=>n.default,...f(n)});class ev extends h{_parse(e){let{ctx:n}=this._processInputParams(e),t={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t}});return(0,c.xP)(r)?r.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new i.G(t.common.issues)},input:t.data})})):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new i.G(t.common.issues)},input:t.data})}}removeCatch(){return this._def.innerType}}ev.create=(e,n)=>new ev({innerType:e,typeName:o.ZodCatch,catchValue:"function"==typeof n.catch?n.catch:()=>n.catch,...f(n)});class eC extends h{_parse(e){if(this._getType(e)!==u.Zp.nan){let n=this._getOrReturnCtx(e);return(0,c.zn)(n,{code:i.eq.invalid_type,expected:u.Zp.nan,received:n.parsedType}),c.uY}return{status:"valid",value:e.data}}}eC.create=e=>new eC({typeName:o.ZodNaN,...f(e)});let e$=Symbol("zod_brand");class ew extends h{_parse(e){let{ctx:n}=this._processInputParams(e),t=n.data;return this._def.type._parse({data:t,path:n.path,parent:n})}unwrap(){return this._def.type}}class ek extends h{_parse(e){let{status:n,ctx:t}=this._processInputParams(e);if(t.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:t.data,path:t.path,parent:t});return"aborted"===e.status?c.uY:"dirty"===e.status?(n.dirty(),(0,c.jm)(e.value)):this._def.out._parseAsync({data:e.value,path:t.path,parent:t})})();{let e=this._def.in._parseSync({data:t.data,path:t.path,parent:t});return"aborted"===e.status?c.uY:"dirty"===e.status?(n.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:t.path,parent:t})}}static create(e,n){return new ek({in:e,out:n,typeName:o.ZodPipeline})}}class eE extends h{_parse(e){let n=this._def.innerType._parse(e),t=e=>((0,c.fn)(e)&&(e.value=Object.freeze(e.value)),e);return(0,c.xP)(n)?n.then(e=>t(e)):t(n)}unwrap(){return this._def.innerType}}function ex(e,n){let t="function"==typeof e?e(n):"string"==typeof e?{message:e}:e;return"string"==typeof t?{message:t}:t}function eD(e,n={},t){return e?K.create().superRefine((r,a)=>{let o=e(r);if(o instanceof Promise)return o.then(e=>{if(!e){let e=ex(n,r),o=e.fatal??t??!0;a.addIssue({code:"custom",...e,fatal:o})}});if(!o){let e=ex(n,r),o=e.fatal??t??!0;a.addIssue({code:"custom",...e,fatal:o})}}):K.create()}eE.create=(e,n)=>new eE({innerType:e,typeName:o.ZodReadonly,...f(n)});let eS={object:ee.lazycreate};!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(o||(o={}));let ez=(e,n={message:`Input not instance of ${e.name}`})=>eD(n=>n instanceof e,n),eB=R.create,eM=L.create,eT=eC.create,eO=j.create,eN=q.create,eP=G.create,eI=V.create,eF=U.create,eR=W.create,eH=K.create,eL=Z.create,ej=Y.create,eq=J.create,eG=X.create,eV=ee.create,eU=ee.strictCreate,eW=en.create,eK=er.create,eZ=eo.create,eY=ei.create,eJ=es.create,eX=el.create,eQ=ec.create,e0=eu.create,e1=ed.create,e2=ep.create,e3=e_.create,e4=eh.create,e5=em.create,e6=eg.create,e8=eA.create,e7=ey.create,e9=eg.createWithPreprocess,ne=ek.create,nn=()=>eB().optional(),nt=()=>eM().optional(),nr=()=>eN().optional(),na={string:e=>R.create({...e,coerce:!0}),number:e=>L.create({...e,coerce:!0}),boolean:e=>q.create({...e,coerce:!0}),bigint:e=>j.create({...e,coerce:!0}),date:e=>G.create({...e,coerce:!0})},no=c.uY},58644:function(e,n,t){"use strict";t.d(n,{y:()=>a});let r=e=>{let n,t=new Set,r=(e,r)=>{let a="function"==typeof e?e(n):e;if(!Object.is(a,n)){let e=n;n=(null!=r?r:"object"!=typeof a||null===a)?a:Object.assign({},n,a),t.forEach(t=>t(n,e))}},a=()=>n,o={setState:r,getState:a,getInitialState:()=>i,subscribe:e=>(t.add(e),()=>t.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},i=n=e(r,a,o);return o},a=e=>e?r(e):r}},__webpack_module_cache__={};function __webpack_require__(e){var n=__webpack_module_cache__[e];if(void 0!==n)return n.exports;var t=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(t.exports,t,t.exports,__webpack_require__),t.loaded=!0,t.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.c=__webpack_module_cache__,__webpack_require__.x=()=>__webpack_require__(66919),(()=>{__webpack_require__.federation||(__webpack_require__.federation={chunkMatcher:function(e){return!/^(257|333)$/.test(e)},rootOutputDir:""})})(),(()=>{__webpack_require__.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(n,{a:n}),n}})(),(()=>{var e,n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;__webpack_require__.t=function(t,r){if(1&r&&(t=this(t)),8&r||"object"==typeof t&&t&&(4&r&&t.__esModule||16&r&&"function"==typeof t.then))return t;var a=Object.create(null);__webpack_require__.r(a);var o={};e=e||[null,n({}),n([]),n(n)];for(var i=2&r&&t;"object"==typeof i&&!~e.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach(e=>{o[e]=()=>t[e]});return o.default=()=>t,__webpack_require__.d(a,o),a}})(),(()=>{__webpack_require__.d=(e,n)=>{for(var t in n)__webpack_require__.o(n,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})}})(),(()=>{var e=__webpack_require__.x,n=!1;__webpack_require__.x=function(){if(n||(n=!0,__webpack_require__(53841)),"function"==typeof e)return e();console.warn("[MF] Invalid prevStartup")}})(),(()=>{__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce((n,t)=>(__webpack_require__.f[t](e,n),n),[]))})(),(()=>{__webpack_require__.u=e=>""+e+".js"})(),(()=>{__webpack_require__.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})()})(),(()=>{__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n)})(),(()=>{var e={},n="@kenyaemr/esm-care-panel-app:";__webpack_require__.l=function(t,r,a,o){if(e[t])return void e[t].push(r);if(void 0!==a)for(var i,s,l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==n+a){i=u;break}}i||(s=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,__webpack_require__.nc&&i.setAttribute("nonce",__webpack_require__.nc),i.setAttribute("data-webpack",n+a),i.src=t),e[t]=[r];var d=function(n,r){i.onerror=i.onload=null,clearTimeout(p);var a=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach(function(e){return e(r)}),n)return n(r)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),s&&document.head.appendChild(i)}})(),(()=>{__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})(),(()=>{__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e)})(),(()=>{__webpack_require__.nc=void 0})(),(()=>{__webpack_require__.rv=()=>"1.5.8"})(),(()=>{__webpack_require__.S={},__webpack_require__.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"@carbon/react",version:"1.93.0",factory:()=>Promise.all([__webpack_require__.e("689"),__webpack_require__.e("228"),__webpack_require__.e("478"),__webpack_require__.e("456"),__webpack_require__.e("257")]).then(()=>()=>__webpack_require__(73603)),eager:0,singleton:1,requiredVersion:"1.x",strictVersion:0},{name:"@openmrs/esm-framework",version:"8.0.1-pre.3423",factory:()=>Promise.all([__webpack_require__.e("689"),__webpack_require__.e("329"),__webpack_require__.e("478"),__webpack_require__.e("706"),__webpack_require__.e("729"),__webpack_require__.e("257"),__webpack_require__.e("333")]).then(()=>()=>__webpack_require__(53496)),eager:0,singleton:1,requiredVersion:"8.x",strictVersion:0},{name:"react-i18next",version:"11.18.6",factory:()=>Promise.all([__webpack_require__.e("267"),__webpack_require__.e("257"),__webpack_require__.e("675")]).then(()=>()=>__webpack_require__(566)),eager:0,singleton:1,requiredVersion:"11.x",strictVersion:0},{name:"react-router-dom",version:"6.30.1",factory:()=>Promise.all([__webpack_require__.e("689"),__webpack_require__.e("998"),__webpack_require__.e("257")]).then(()=>()=>__webpack_require__(18053)),eager:0,singleton:1,requiredVersion:"6.x",strictVersion:0},{name:"react",version:"18.3.1",factory:()=>__webpack_require__.e("466").then(()=>()=>__webpack_require__(14041)),eager:0,singleton:1,requiredVersion:"^18.1.0",strictVersion:0},{name:"swr/immutable",version:"2.3.6",factory:()=>Promise.all([__webpack_require__.e("329"),__webpack_require__.e("257"),__webpack_require__.e("847")]).then(()=>()=>__webpack_require__(44924)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0},{name:"swr/infinite",version:"2.3.6",factory:()=>Promise.all([__webpack_require__.e("329"),__webpack_require__.e("257"),__webpack_require__.e("472")]).then(()=>()=>__webpack_require__(82910)),eager:0,singleton:1,requiredVersion:"2.x",strictVersion:0}]},uniqueName:"@kenyaemr/esm-care-panel-app"},__webpack_require__.I=__webpack_require__.I||function(){throw Error("should have __webpack_require__.I")}})(),(()=>{__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var e,n=__webpack_require__.g.document;if(!e&&n&&(n.currentScript&&"SCRIPT"===n.currentScript.tagName.toUpperCase()&&(e=n.currentScript.src),!e)){var t=n.getElementsByTagName("script");if(t.length)for(var r=t.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=t[r--].src}if(!e)throw Error("Automatic publicPath is not supported in this browser");__webpack_require__.p=e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")})(),(()=>{__webpack_require__.consumesLoadingData={chunkMapping:{333:["75721","97744","36142","42722","58088","70438"],889:["75721","97744","36142","42722","35400","58088","70438"],257:["35400"]},moduleIdToConsumeDataMapping:{75721:{shareScope:"default",shareKey:"react-router-dom",import:"react-router-dom",requiredVersion:"6.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("998").then(()=>()=>__webpack_require__(18053))},70438:{shareScope:"default",shareKey:"@carbon/react",import:"@carbon/react",requiredVersion:"1.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("228"),__webpack_require__.e("456")]).then(()=>()=>__webpack_require__(73603))},97744:{shareScope:"default",shareKey:"swr/infinite",import:"swr/infinite",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("91").then(()=>()=>__webpack_require__(82910))},36142:{shareScope:"default",shareKey:"swr/immutable",import:"swr/immutable",requiredVersion:"2.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("85").then(()=>()=>__webpack_require__(44924))},35400:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"^18.1.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("466").then(()=>()=>__webpack_require__(14041))},42722:{shareScope:"default",shareKey:"@openmrs/esm-framework",import:"@openmrs/esm-framework",requiredVersion:"8.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("729").then(()=>()=>__webpack_require__(53496))},58088:{shareScope:"default",shareKey:"react-i18next",import:"react-i18next",requiredVersion:"11.x",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("267").then(()=>()=>__webpack_require__(566))}},initialConsumes:["75721","97744","36142","42722","35400","58088","70438"]},__webpack_require__.f.consumes=__webpack_require__.f.consumes||function(){throw Error("should have __webpack_require__.f.consumes")}})(),(()=>{var e={889:0};__webpack_require__.f.j=function(n,t){var r=__webpack_require__.o(e,n)?e[n]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(257|333)$/.test(n))e[n]=0;else{var a=new Promise((t,a)=>r=e[n]=[t,a]);t.push(r[2]=a);var o=__webpack_require__.p+__webpack_require__.u(n),i=Error(),s=function(t){if(__webpack_require__.o(e,n)&&(0!==(r=e[n])&&(e[n]=void 0),r)){var a=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+n+" failed.\n("+a+": "+o+")",i.name="ChunkLoadError",i.type=a,i.request=o,r[1](i)}};__webpack_require__.l(o,s,"chunk-"+n,n)}};var n=(n,t)=>{var r,a,[o,i,s]=t,l=0;if(o.some(n=>0!==e[n])){for(r in i)__webpack_require__.o(i,r)&&(__webpack_require__.m[r]=i[r]);s&&s(__webpack_require__)}for(n&&n(t);l<o.length;l++)a=o[l],__webpack_require__.o(e,a)&&e[a]&&e[a][0](),e[a]=0},t=globalThis.webpackChunk_kenyaemr_esm_care_panel_app=globalThis.webpackChunk_kenyaemr_esm_care_panel_app||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))})(),(()=>{__webpack_require__.ruid="bundler=rspack@1.5.8"})();var __webpack_exports__=__webpack_require__.x()})();
|