@openmrs/esm-react-utils 5.0.1-pre.813 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see openmrs-esm-react-utils.js.LICENSE.txt */
2
- var _openmrs_esm_react_utils;(()=>{var e={840:(e,t,n)=>{function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}(()=>{var e={151:()=>{(()=>{var e={758:()=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{dispatchActionableNotificationShown:()=>p,dispatchConnectivityChanged:()=>r,dispatchNotificationShown:()=>d,dispatchPrecacheStaticDependencies:()=>s,subscribeActionableNotificationShown:()=>y,subscribeConnectivity:()=>i,subscribeConnectivityChanged:()=>o,subscribeNotificationShown:()=>h,subscribePrecacheStaticDependencies:()=>u,subscribeToastShown:()=>m});const n="openmrs:connectivity-changed";function r(e){window.dispatchEvent(new CustomEvent(n,{detail:{online:e}}))}function o(e){const t=t=>e(t.detail);return window.addEventListener(n,t),()=>window.removeEventListener(n,t)}function i(e){return e({online:navigator.onLine}),o(e)}const a="openmrs:precache-static-dependencies";function s(e={}){window.dispatchEvent(new CustomEvent(a,{detail:e}))}function u(e){const t=t=>e(t.detail);return window.addEventListener(a,t),()=>window.removeEventListener(a,t)}const c="openmrs:notification-shown",l="openmrs:actionable-notification-shown",f="openmrs:toast-shown";function d(e){window.dispatchEvent(new CustomEvent(c,{detail:e}))}function p(e){window.dispatchEvent(new CustomEvent(l,{detail:e}))}function h(e){const t=t=>e(t.detail);return window.addEventListener(c,t),()=>window.removeEventListener(c,t)}function y(e){const t=t=>e(t.detail);return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}function m(e){const t=t=>e(t.detail);return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}})()}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{createErrorHandler:()=>o,reportError:()=>t});var e=n(758);function t(e){const t=i(e);setTimeout((()=>{throw t}))}function o(){const e=Error();return n=>{i(n).stack+=`\nAsync stacktrace:\n${e.stack}`,t(n)}}function i(e){let t;if(e instanceof Error)return e;if(null===e)return Error("'null' was thrown as an error");if("object"==typeof e){try{t=`Object thrown as error: ${JSON.stringify(e)}`}catch(n){t=`Object thrown as error with the following properties: ${Object.keys(e)}`}return Error(t)}return void 0===e?Error("'undefined' was thrown as an error"):Error(e.toString())}window.onerror=function(t){return console.error("Unexpected error: ",t),(0,e.dispatchNotificationShown)({description:null!=t?t:"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(t){var n;console.error("Unhandled rejection: ",t.reason),(0,e.dispatchNotificationShown)({description:null!==(n=t.reason)&&void 0!==n?n:"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})}})()})()},403:()=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{createAppState:()=>s,createGlobalStore:()=>i,getAppState:()=>u,getGlobalStore:()=>a,subscribeTo:()=>c});const n=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.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."),n.clear()}};return t=e(r,o,i),i},r=e=>e?n(e):n,o={};function i(e,t){const n=o[e];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(t,!0),n.active=!0,n.value;{const n=r()((()=>t));return o[e]={value:n,active:!0},n}}function a(e,t){const n=o[e];if(!n){const n=r()((()=>null!=t?t:{}));return o[e]={value:n,active:!1},n}return n.value}function s(e){return i("app",e)}function u(){return a("app",{})}function c(e,t,n){let r=t(e.getState());return e.subscribe((e=>{const o=t(e);o!==r&&(r=o,n(o))}))}})()}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};(()=>{"use strict";r.r(a),r.d(a,{OpenmrsFetchError:()=>lr,VisitMode:()=>iu,VisitStatus:()=>au,backendDependencies:()=>fu,clearCurrentUser:()=>br,defaultVisitCustomRepresentation:()=>eu,fetchCurrentPatient:()=>Ms,fhirBaseUrl:()=>ir,getCurrentUser:()=>mr,getLocations:()=>lu,getLoggedInUser:()=>_r,getSessionLocation:()=>Sr,getSessionStore:()=>gr,getStartedVisit:()=>ou,getVisitTypes:()=>uu,getVisitsForPatient:()=>tu,makeUrl:()=>sr,openmrsFetch:()=>ur,openmrsObservableFetch:()=>cr,refetchCurrentUser:()=>vr,restBaseUrl:()=>or,saveVisit:()=>nu,sessionEndpoint:()=>ar,setSessionLocation:()=>Or,setupApiModule:()=>kr,toLocationObject:()=>cu,toVisitTypeObject:()=>su,updateVisit:()=>ru,userHasAccess:()=>wr});var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};function t(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function s(e){return"function"==typeof e}var u=!1,c={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack,u=e},get useDeprecatedSynchronousErrorHandling(){return u}};function l(e){setTimeout((function(){throw e}),0)}var f={closed:!0,next:function(e){},error:function(e){if(c.useDeprecatedSynchronousErrorHandling)throw e;l(e)},complete:function(){}},d=Array.isArray||function(e){return e&&"number"==typeof e.length};function p(e){return null!==e&&"object"==typeof e}var h=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),y=h,m=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var n=this,r=n._parentOrParents,o=n._ctorUnsubscribe,i=n._unsubscribe,a=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof e)r.remove(this);else if(null!==r)for(var u=0;u<r.length;++u)r[u].remove(this);if(s(i)){o&&(this._unsubscribe=void 0);try{i.call(this)}catch(e){t=e instanceof y?g(e.errors):[e]}}if(d(a)){u=-1;for(var c=a.length;++u<c;){var l=a[u];if(p(l))try{l.unsubscribe()}catch(e){t=t||[],e instanceof y?t=t.concat(g(e.errors)):t.push(e)}}}if(t)throw new y(t)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(typeof t){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof e)){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof e){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.push(n),n},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function g(e){return e.reduce((function(e,t){return e.concat(t instanceof y?t.errors:t)}),[])}var v="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),b=function(e){function n(t,r,o){var i=e.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=f;break;case 1:if(!t){i.destination=f;break}if("object"==typeof t){t instanceof n?(i.syncErrorThrowable=t.syncErrorThrowable,i.destination=t,t.add(i)):(i.syncErrorThrowable=!0,i.destination=new w(i,t));break}default:i.syncErrorThrowable=!0,i.destination=new w(i,t,r,o)}return i}return t(n,e),n.prototype[v]=function(){return this},n.create=function(e,t,r){var o=new n(e,t,r);return o.syncErrorThrowable=!1,o},n.prototype.next=function(e){this.isStopped||this._next(e)},n.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},n.prototype._next=function(e){this.destination.next(e)},n.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},n}(m),w=function(e){function n(t,n,r,o){var i,a=e.call(this)||this;a._parentSubscriber=t;var u=a;return s(n)?i=n:n&&(i=n.next,r=n.error,o=n.complete,n!==f&&(s((u=Object.create(n)).unsubscribe)&&a.add(u.unsubscribe.bind(u)),u.unsubscribe=a.unsubscribe.bind(a))),a._context=u,a._next=i,a._error=r,a._complete=o,a}return t(n,e),n.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;c.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},n.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=c.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):l(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;l(e)}}},n.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};c.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},n.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),c.useDeprecatedSynchronousErrorHandling)throw e;l(e)}},n.prototype.__tryOrSetError=function(e,t,n){if(!c.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return c.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(l(t),!0)}return!1},n.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},n}(b),S="function"==typeof Symbol&&Symbol.observable||"@@observable";function O(e){return e}var E=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,o=function(e,t,n){if(e){if(e instanceof b)return e;if(e[v])return e[v]()}return e||t||n?new b(e,t,n):new b(f)}(e,t,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||c.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),c.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){c.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){var t=e,n=t.closed,r=t.destination,o=t.isStopped;if(n||o)return!1;e=r&&r instanceof b?r:null}return!0}(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=k(t))((function(t,r){var o;o=n.subscribe((function(t){try{e(t)}catch(e){r(e),o&&o.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[S]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:(0===(n=e).length?O:1===n.length?n[0]:function(e){return n.reduce((function(e,t){return t(e)}),e)})(this);var n},e.prototype.toPromise=function(e){var t=this;return new(e=k(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function k(e){if(e||(e=c.Promise||Promise),!e)throw new Error("no Promise impl found");return e}const P="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;var x="object"==typeof self&&self&&self.Object===Object&&self;const j=(P||x||Function("return this")()).Symbol;var T=Object.prototype,A=T.hasOwnProperty,C=T.toString,N=j?j.toStringTag:void 0,D=Object.prototype.toString,R=j?j.toStringTag:void 0;const I=(M=Object.getPrototypeOf,L=Object,function(e){return M(L(e))});var M,L,U=Function.prototype,$=Object.prototype,B=U.toString,F=$.hasOwnProperty,K=B.call(Object);const z=function(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":R&&R in Object(e)?function(e){var t=A.call(e,N),n=e[N];try{e[N]=void 0;var r=!0}catch(e){}var o=C.call(e);return r&&(t?e[N]=n:delete e[N]),o}(e):function(e){return D.call(e)}(e)}(e))return!1;var t=I(e);if(null===t)return!0;var n=F.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&B.call(n)==K};function W(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function V(e){return function t(n){return 0===arguments.length||W(n)?t:e.apply(this,arguments)}}function q(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return W(n)?t:V((function(t){return e(n,t)}));default:return W(n)&&W(r)?t:W(n)?V((function(t){return e(t,r)})):W(r)?V((function(t){return e(n,t)})):e(n,r)}}}function H(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function G(e,t,n){for(var r=0,o=n.length;r<o;){if(e(t,n[r]))return!0;r+=1}return!1}function Q(e,t){return Object.prototype.hasOwnProperty.call(t,e)}const Y="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var J=Object.prototype.toString,X=function(){return"[object Arguments]"===J.call(arguments)?function(e){return"[object Arguments]"===J.call(e)}:function(e){return Q("callee",e)}}();const Z=X;var ee=!{toString:null}.propertyIsEnumerable("toString"),te=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],ne=function(){return arguments.propertyIsEnumerable("length")}(),re=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1};const oe="function"!=typeof Object.keys||ne?V((function(e){if(Object(e)!==e)return[];var t,n,r=[],o=ne&&Z(e);for(t in e)!Q(t,e)||o&&"length"===t||(r[r.length]=t);if(ee)for(n=te.length-1;n>=0;)Q(t=te[n],e)&&!re(r,t)&&(r[r.length]=t),n-=1;return r})):V((function(e){return Object(e)!==e?[]:Object.keys(e)})),ie=V((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function ae(e,t,n,r){var o=H(e);function i(e,t){return se(e,t,n.slice(),r.slice())}return!G((function(e,t){return!G(i,t,e)}),H(t),o)}function se(e,t,n,r){if(Y(e,t))return!0;var o=ie(e);if(o!==ie(t))return!1;if(null==e||null==t)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(o){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]}(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!Y(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!Y(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var i=n.length-1;i>=0;){if(n[i]===e)return r[i]===t;i-=1}switch(o){case"Map":return e.size===t.size&&ae(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&ae(e.values(),t.values(),n.concat([e]),r.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var a=oe(e);if(a.length!==oe(t).length)return!1;var s=n.concat([e]),u=r.concat([t]);for(i=a.length-1;i>=0;){var c=a[i];if(!Q(c,t)||!se(t[c],e[c],s,u))return!1;i-=1}return!0}var ue=q((function(e,t){return se(e,t,[],[])}));const ce=ue;function le(e){return function t(n,r,o){switch(arguments.length){case 0:return t;case 1:return W(n)?t:q((function(t,r){return e(n,t,r)}));case 2:return W(n)&&W(r)?t:W(n)?q((function(t,n){return e(t,r,n)})):W(r)?q((function(t,r){return e(n,t,r)})):V((function(t){return e(n,r,t)}));default:return W(n)&&W(r)&&W(o)?t:W(n)&&W(r)?q((function(t,n){return e(t,n,o)})):W(n)&&W(o)?q((function(t,n){return e(t,r,n)})):W(r)&&W(o)?q((function(t,r){return e(n,t,r)})):W(n)?V((function(t){return e(t,r,o)})):W(r)?V((function(t){return e(n,t,o)})):W(o)?V((function(t){return e(n,r,t)})):e(n,r,o)}}}function fe(e){return"[object Object]"===Object.prototype.toString.call(e)}var de=le((function(e,t,n){var r,o={};for(r in t)Q(r,t)&&(o[r]=Q(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)Q(r,n)&&!Q(r,o)&&(o[r]=n[r]);return o}));const pe=de;var he=le((function e(t,n,r){return pe((function(n,r,o){return fe(r)&&fe(o)?e(t,r,o):t(n,r,o)}),n,r)}));const ye=he,me=q((function(e,t){return ye((function(e,t,n){return n}),e,t)})),ge=q((function(e,t){for(var n={},r={},o=0,i=e.length;o<i;)r[e[o]]=1,o+=1;for(var a in t)r.hasOwnProperty(a)||(n[a]=t[a]);return n}));function ve(e,t,n,r){var o,i=function(o){for(var i=t.length,a=0;a<i;){if(e===t[a])return n[a];a+=1}for(var s in t[a+1]=e,n[a+1]=o,e)o[s]=r?ve(e[s],t,n,!0):e[s];return o};switch(ie(e)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(e.valueOf());case"RegExp":return o=e,new RegExp(o.source,(o.global?"g":"")+(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.sticky?"y":"")+(o.unicode?"u":""));default:return e}}const be=V((function(e){return null!=e&&"function"==typeof e.clone?e.clone():ve(e,[],[],!0)})),we=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};var _e=V((function(e){return!!we(e)||!!e&&"object"==typeof e&&!function(e){return"[object String]"===Object.prototype.toString.call(e)}(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1))}));const Se=_e;var Oe=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}(),Ee=q((function(e,t){return function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,o){return t.apply(this,arguments)};case 5:return function(e,n,r,o,i){return t.apply(this,arguments)};case 6:return function(e,n,r,o,i,a){return t.apply(this,arguments)};case 7:return function(e,n,r,o,i,a,s){return t.apply(this,arguments)};case 8:return function(e,n,r,o,i,a,s,u){return t.apply(this,arguments)};case 9:return function(e,n,r,o,i,a,s,u,c){return t.apply(this,arguments)};case 10:return function(e,n,r,o,i,a,s,u,c,l){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}(e.length,(function(){return e.apply(t,arguments)}))}));const ke=Ee;function Pe(e,t,n){for(var r=n.next();!r.done;){if((t=e["@@transducer/step"](t,r.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r=n.next()}return e["@@transducer/result"](t)}function xe(e,t,n,r){return e["@@transducer/result"](n[r](ke(e["@@transducer/step"],e),t))}var je="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";const Te=le((function(e,t,n){if("function"==typeof e&&(e=function(e){return new Oe(e)}(e)),Se(n))return function(e,t,n){for(var r=0,o=n.length;r<o;){if((t=e["@@transducer/step"](t,n[r]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r+=1}return e["@@transducer/result"](t)}(e,t,n);if("function"==typeof n["fantasy-land/reduce"])return xe(e,t,n,"fantasy-land/reduce");if(null!=n[je])return Pe(e,t,n[je]());if("function"==typeof n.next)return Pe(e,t,n);if("function"==typeof n.reduce)return xe(e,t,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}));var Ae;function Ce(e,t){return n=>{if(!e(n))return"function"==typeof t?t(n):t}}!function(e){e.Array="Array",e.Boolean="Boolean",e.ConceptUuid="ConceptUuid",e.Number="Number",e.Object="Object",e.String="String",e.UUID="UUID",e.PersonAttributeTypeUuid="PersonAttributeTypeUuid",e.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid"}(Ae||(Ae={}));const Ne=Ce((e=>Array.isArray(e)),"must be an array"),De=Ce((e=>"boolean"==typeof e),"must be a boolean"),Re=Ce((e=>"number"==typeof e),"must be a number"),Ie=Ce((e=>"string"==typeof e),"must be a string"),Me=Ce((e=>"object"==typeof e&&!Array.isArray(e)&&null!==e),"must be an object (not an array or null)"),Le=Ce((e=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[0-9a-f]{36}$/i.test(e)),"must be a valid UUID or a 36-character hexadecimal string");var Ue=r(403);const $e=(0,Ue.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{}}),Be=(0,Ue.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});Be.subscribe((e=>{var t;t=e.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}));const Fe=(0,Ue.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]});function Ke(e){return(0,Ue.getGlobalStore)(`config-module-${e}`,{config:null,loaded:!1})}const ze=(0,Ue.createGlobalStore)("config-implementer-tools",{config:{}});function We(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){We(e,t,n[t])}))}return e}function qe(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function He(e,t){for(let n of Object.keys(e.schemas)){const r=rt(n,e,t);Ke(n).setState({loaded:!0,config:r})}}function Ge(e,t){const n=function(e,t){const n=it(tt(e,t)),r=Object.keys(n).reduce(((e,t)=>{var r,o;return(null===(r=n[t])||void 0===r?void 0:r.extensionSlots)&&(e[t]=null===(o=n[t])||void 0===o?void 0:o.extensionSlots),e}),{});return function(e){for(let[t,n]of Object.entries(e))for(let[e,r]of Object.entries(n))et(r,t,e)}(r),Object.keys(r).reduce(((e,t)=>Ve({},e,r[t])),{})}(e,t),r=Object.fromEntries(Object.entries(n).map((([e,t])=>[e,{loaded:!0,config:t}]))),o=(0,Ue.getGlobalStore)("config-extension-slots",{slots:{}}),i=o.getState(),a={slots:Ve({},i.slots,r)};ce(i,a)||o.setState(a)}function Qe(e,t){const n=function(e,t){let n=Xe(be(e.schemas));const r=[...e.providedConfigs.map((e=>[e.config,e.source])),[t.config,"temporary config"]];for(let[e,t]of r)n=it([n,Ze(e,t)]);return n}(e,t);ze.setState({config:n})}function Ye(e,t,n){const r={};for(let o of t.mountedExtensions){const t=Je(o.slotModuleName,o.extensionModuleName,o.slotName,o.extensionId,e,n);r[o.slotName]=qe(Ve({},r[o.slotName]),{[o.extensionId]:{config:t,loaded:!0}})}(0,Ue.getGlobalStore)("config-extensions",{configs:{}}).setState({configs:r})}function Je(e,t,n,r,o,i){var a,s,u;const c=function(e){const[t]=e.split("#");return t}(r),l=o.schemas[c],f=l?c:t,d=tt(o,i),p=ot(e,d);var h;const y=null!==(h=null==p||null===(a=p.extensionSlots)||void 0===a||null===(s=a[n])||void 0===s||null===(u=s.configure)||void 0===u?void 0:u[r])&&void 0!==h?h:{},m=it([ot(f,d),y]),g=null!=l?l:o.schemas[t];at(g,m,f);const v=ft(g,m);return ut(g,v,f),delete v.extensionSlots,v}function Xe(e){return e.hasOwnProperty("_default")?qe(Ve({},e),{_value:e._default,_source:"default"}):pt(e)?Object.keys(e).reduce(((t,n)=>(t[n]=Xe(e[n]),t)),{}):{}}function Ze(e,t){return pt(e)?Object.keys(e).reduce(((n,r)=>(n[r]=Ze(e[r],t),n)),{}):{_value:e,_source:t}}function et(e,t,n){const r=`Extension slot config '${t}.extensionSlots.${n}`,o=Object.keys(e).filter((e=>!["add","remove","order","configure"].includes(e)));o.length&&console.error(r+`' contains invalid keys '${o.join("', '")}'`),e.add&&(Array.isArray(e.add)&&e.add.every((e=>"string"==typeof e))||console.error(r+".add' is invalid. Must be an array of strings (extension IDs)")),e.remove&&(Array.isArray(e.remove)&&e.remove.every((e=>"string"==typeof e))||console.error(r+".remove' is invalid. Must be an array of strings (extension IDs)")),e.order&&(Array.isArray(e.order)&&e.order.every((e=>"string"==typeof e))||console.error(r+".order' is invalid. Must be an array of strings (extension IDs)")),e.configure&&(pt(e.configure)||console.error(r+".configure' is invalid. Must be an object with extension IDs for keys"))}function tt(e,t){return[...e.providedConfigs.map((e=>e.config)),t.config]}function nt(e,t,n=""){const r="Please verify that you are running the latest version and, if so, alert the maintainer.";for(const o of Object.keys(t).filter((e=>!e.startsWith("_")))){const i=n+(n&&".")+o,a=t[o];if("Display conditions"===i&&console.error(`${e} declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ${r}`),"Translation overrides"===i&&console.error(`${e} declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ${r}`),!pt(a)){console.error(`${e} has bad config schema definition for key '${i}'. ${r}`);continue}a.hasOwnProperty("_default")||nt(e,a,i);const s=a._elements;if(dt(s)&&nt(e,s,i+"._elements"),a._validators)for(let t of a._validators)"function"!=typeof t&&console.error(`${e} has invalid validator for key '${i}' ${r}.\n\nIf you're the maintainer: validators must be functions that return either undefined or an error string. Received ${t}.`);const u=a._type;u&&!Object.values(Ae).includes(u)&&console.error(`${e} has invalid type for key '${i}' ${r}.\n\nIf you're the maintainer: the allowed types are ${Object.values(Ae).join(", ")}. Received '${u}'`),Object.keys(a).every((e=>["_description","_validators","_elements","_type"].includes(e)))&&!n.includes("._elements")&&console.error(`${e} has bad config schema definition for key '${i}'. ${r}.\n\nIf you're the maintainer: all config elements must have a default. Received ${JSON.stringify(a)}`),s&&u&&![Ae.Array,Ae.Object].includes(u)&&console.error(`${e} has bad config schema definition for key '${i}'. ${r}.\n\nIf you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. Received ${JSON.stringify(u)}`)}}function rt(e,t,n){if(!t.schemas.hasOwnProperty(e))throw Error("No config schema has been defined for "+e);const r=t.schemas[e],o=ot(e,tt(t,n));at(r,o,e);const i=ft(r,o);return ut(r,i,e),delete i.extensionSlots,i}function ot(e,t){return it(t.map((({[e]:t})=>t)).filter((e=>!!e)))}function it(e){return Te(me)({},e)}function at(e,t,n=""){for(const r of Object.keys(t)){const o=t[r],i=n+"."+r,a=e[r];e.hasOwnProperty(r)?st(a,o,i):"extensionSlots"===r&&""!==n||console.error(`Unknown config key '${i}' provided. Ignoring.`)}}function st(e,t,n){ct(n,e._type,t),pt(t)?e._type===Ae.Object?function(e,t,n){if(e._elements)for(const r of Object.keys(t)){const o=t[r];at(e._elements,o,`${n}.${r}`)}}(e,t,n):e.hasOwnProperty("_default")||at(e,t,n):e._type===Ae.Array&&function(e,t,n){if(dt(e._elements))for(let r=0;r<t.length;r++)st(e._elements,t[r],`${n}[${r}]`);for(let o=0;o<t.length;o++){var r;ct(`${n}[${o}]`,null===(r=e._elements)||void 0===r?void 0:r._type,t[o])}}(e,t,n)}function ut(e,t,n=""){if(e)if(t!==e._default&&lt(n,e._validators,t),pt(t))for(const r of Object.keys(t)){const o=t[r],i=n+"."+r,a=e[r];e._type===Ae.Object&&e._elements?ut(e._elements,o,i):ut(a,o,i)}else if(Array.isArray(t)&&e._elements)for(let r=0;r<t.length;r++)ut(e._elements,t[r],`${n}[${r}]`)}function ct(e,t,n){t&&lt(e,[{Array:Ne,Boolean:De,ConceptUuid:Le,Number:Re,Object:Me,String:Ie,UUID:Le,PersonAttributeTypeUuid:Le,PatientIdentifierTypeUuid:Le}[t]],n)}function lt(e,t,n){if(t)try{for(let r of t){const t=r(n);"string"==typeof t&&("object"==typeof n?console.error(`Invalid configuration for ${e}: ${t}`):console.error(`Invalid configuration value ${n} for ${e}: ${t}`))}}catch(t){console.error(`Skipping invalid validator at "${e}". Encountered error\n\t${t}`)}}He($e.getState(),Be.getState()),$e.subscribe((e=>He(e,Be.getState()))),Be.subscribe((e=>He($e.getState(),e))),Qe($e.getState(),Be.getState()),$e.subscribe((e=>Qe(e,Be.getState()))),Be.subscribe((e=>Qe($e.getState(),e))),Ge($e.getState(),Be.getState()),$e.subscribe((e=>Ge(e,Be.getState()))),Be.subscribe((e=>Ge($e.getState(),e))),Ye($e.getState(),Fe.getState(),Be.getState()),$e.subscribe((e=>{Ye(e,Fe.getState(),Be.getState())})),Fe.subscribe((e=>{Ye($e.getState(),e,Be.getState())})),Be.subscribe((e=>{Ye($e.getState(),Fe.getState(),e)}));const ft=(e,t)=>{const n=be(t);if(!e)return n;for(const t of Object.keys(e)){const r=n[t],o=e[t];if(o&&o.hasOwnProperty("_default")){n.hasOwnProperty(t)||(n[t]=o._default);const e=o._elements;if(r&&dt(e))if(o._type===Ae.Array&&Array.isArray(r)){const o=r.map((t=>ft(e,t)));n[t]=o}else if(o._type===Ae.Object)for(let t of Object.keys(r))r[t]=ft(e,r[t])}else if(pt(o)){const e=n.hasOwnProperty(t)?r:{};pt(e)&&(n[t]=ft(o,e))}}return n};function dt(e){return!!e&&Object.keys(e).filter((e=>!["_default","_validators"].includes(e))).length>0}function pt(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}const ht={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:Ae.Array,_default:[]}},"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:Ae.Object,_default:{}}};var yt=Object.freeze({__proto__:null,get start(){return Yn},get ensureJQuerySupport(){return kn},get setBootstrapMaxTime(){return an},get setMountMaxTime(){return sn},get setUnmountMaxTime(){return un},get setUnloadMaxTime(){return cn},get registerApplication(){return Mn},get unregisterApplication(){return Un},get getMountedApps(){return Dn},get getAppStatus(){return In},get unloadApplication(){return $n},get checkActivityFunctions(){return Ln},get getAppNames(){return Rn},get pathToActiveWhen(){return Kn},get navigateToUrl(){return gn},get triggerAppChange(){return qn},get addErrorHandler(){return St},get removeErrorHandler(){return Ot},get mountRootParcel(){return en},get NOT_LOADED(){return Pt},get LOADING_SOURCE_CODE(){return xt},get NOT_BOOTSTRAPPED(){return jt},get BOOTSTRAPPING(){return Tt},get NOT_MOUNTED(){return At},get MOUNTING(){return Ct},get UPDATING(){return Dt},get LOAD_ERROR(){return It},get MOUNTED(){return Nt},get UNMOUNTING(){return Rt},get SKIP_BECAUSE_BROKEN(){return Mt}});function mt(e){return(mt="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)}function gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vt=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{}).CustomEvent,bt=function(){try{var e=new vt("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?vt:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},wt=[];function _t(e,t,n){var r=kt(e,t,n);wt.length?wt.forEach((function(e){return e(r)})):setTimeout((function(){throw r}))}function St(e){if("function"!=typeof e)throw Error(Et(28,!1));wt.push(e)}function Ot(e){if("function"!=typeof e)throw Error(Et(29,!1));var t=!1;return wt=wt.filter((function(n){var r=n===e;return t=t||r,!r})),t}function Et(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(e,": ").concat(t?t+" ":"","See https://single-spa.js.org/error/?code=").concat(e).concat(r.length?"&arg=".concat(r.join("&arg=")):"")}function kt(e,t,n){var r,o="".concat(Ft(t)," '").concat($t(t),"' died in status ").concat(t.status,": ");if(e instanceof Error){try{e.message=o+e.message}catch(e){}r=e}else{console.warn(Et(30,!1,t.status,$t(t)));try{r=Error(o+JSON.stringify(e))}catch(t){r=e}}return r.appOrParcelName=$t(t),t.status=n,r}var Pt="NOT_LOADED",xt="LOADING_SOURCE_CODE",jt="NOT_BOOTSTRAPPED",Tt="BOOTSTRAPPING",At="NOT_MOUNTED",Ct="MOUNTING",Nt="MOUNTED",Dt="UPDATING",Rt="UNMOUNTING",It="LOAD_ERROR",Mt="SKIP_BECAUSE_BROKEN";function Lt(e){return e.status===Nt}function Ut(e){try{return e.activeWhen(window.location)}catch(t){return _t(t,e,Mt),!1}}function $t(e){return e.name}function Bt(e){return Boolean(e.unmountThisParcel)}function Ft(e){return Bt(e)?"parcel":"application"}function Kt(){for(var e=arguments.length-1;e>0;e--)for(var t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]}function zt(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}function Wt(e){return e&&("function"==typeof e||(t=e,Array.isArray(t)&&!zt(t,(function(e){return"function"!=typeof e}))));var t}function Vt(e,t){var n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=Ft(e),o=$t(e);return function(e){return n.reduce((function(n,i,a){return n.then((function(){var n=i(e);return qt(n)?n:Promise.reject(Et(15,!1,r,o,t,a))}))}),Promise.resolve())}}function qt(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}function Ht(e,t){return Promise.resolve().then((function(){return e.status!==jt?e:(e.status=Tt,e.bootstrap?ln(e,"bootstrap").then(n).catch((function(n){if(t)throw kt(n,e,Mt);return _t(n,e,Mt),e})):Promise.resolve().then(n))}));function n(){return e.status=At,e}}function Gt(e,t){return Promise.resolve().then((function(){if(e.status!==Nt)return e;e.status=Rt;var n=Object.keys(e.parcels).map((function(t){return e.parcels[t].unmountThisParcel()}));return Promise.all(n).then(r,(function(n){return r().then((function(){var r=Error(n.message);if(t)throw kt(r,e,Mt);_t(r,e,Mt)}))})).then((function(){return e}));function r(){return ln(e,"unmount").then((function(){e.status=At})).catch((function(n){if(t)throw kt(n,e,Mt);_t(n,e,Mt)}))}}))}var Qt=!1,Yt=!1;function Jt(e,t){return Promise.resolve().then((function(){return e.status!==At?e:(Qt||(window.dispatchEvent(new bt("single-spa:before-first-mount")),Qt=!0),ln(e,"mount").then((function(){return e.status=Nt,Yt||(window.dispatchEvent(new bt("single-spa:first-mount")),Yt=!0),e})).catch((function(n){return e.status=Nt,Gt(e,!0).then(r,r);function r(){if(t)throw kt(n,e,Mt);return _t(n,e,Mt),e}})))}))}var Xt=0,Zt={parcels:{}};function en(){return tn.apply(Zt,arguments)}function tn(e,t){var n=this;if(!e||"object"!==mt(e)&&"function"!=typeof e)throw Error(Et(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(Et(3,!1,mt(e.name)));if("object"!==mt(t))throw Error(Et(4,!1,name,mt(t)));if(!t.domElement)throw Error(Et(5,!1,name));var r,o=Xt++,i="function"==typeof e,a=i?e:function(){return Promise.resolve(e)},s={id:o,parcels:{},status:i?xt:jt,customProps:t,parentName:$t(n),unmountThisParcel:function(){return d.then((function(){if(s.status!==Nt)throw Error(Et(6,!1,name,s.status));return Gt(s,!0)})).then((function(e){return s.parentName&&delete n.parcels[s.id],e})).then((function(e){return c(e),e})).catch((function(e){throw s.status=Mt,l(e),e}))}};n.parcels[o]=s;var u=a();if(!u||"function"!=typeof u.then)throw Error(Et(7,!1));var c,l,f=(u=u.then((function(e){if(!e)throw Error(Et(8,!1));var t=e.name||"parcel-".concat(o);if(Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!Wt(e.bootstrap))throw Error(Et(9,!1,t));if(!Wt(e.mount))throw Error(Et(10,!1,t));if(!Wt(e.unmount))throw Error(Et(11,!1,t));if(e.update&&!Wt(e.update))throw Error(Et(12,!1,t));var n=Vt(e,"bootstrap"),i=Vt(e,"mount"),a=Vt(e,"unmount");s.status=jt,s.name=t,s.bootstrap=n,s.mount=i,s.unmount=a,s.timeouts=fn(e.timeouts),e.update&&(s.update=Vt(e,"update"),r.update=function(e){return s.customProps=e,nn(function(e){return Promise.resolve().then((function(){if(e.status!==Nt)throw Error(Et(32,!1,$t(e)));return e.status=Dt,ln(e,"update").then((function(){return e.status=Nt,e})).catch((function(t){throw kt(t,e,Mt)}))}))}(s))})}))).then((function(){return Ht(s,!0)})),d=f.then((function(){return Jt(s,!0)})),p=new Promise((function(e,t){c=e,l=t}));return r={mount:function(){return nn(Promise.resolve().then((function(){if(s.status!==At)throw Error(Et(13,!1,name,s.status));return n.parcels[o]=s,Jt(s)})))},unmount:function(){return nn(s.unmountThisParcel())},getStatus:function(){return s.status},loadPromise:nn(u),bootstrapPromise:nn(f),mountPromise:nn(d),unmountPromise:nn(p)}}function nn(e){return e.then((function(){return null}))}function rn(e){var t=$t(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!==mt(n)||null===n||Array.isArray(n))&&(n={},console.warn(Et(40,!1),t,n));var r=Kt({},n,{name:t,mountParcel:tn.bind(e),singleSpa:yt});return Bt(e)&&(r.unmountSelf=e.unmountThisParcel),r}var on={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function an(e,t,n){if("number"!=typeof e||e<=0)throw Error(Et(16,!1));on.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function sn(e,t,n){if("number"!=typeof e||e<=0)throw Error(Et(17,!1));on.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function un(e,t,n){if("number"!=typeof e||e<=0)throw Error(Et(18,!1));on.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function cn(e,t,n){if("number"!=typeof e||e<=0)throw Error(Et(19,!1));on.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function ln(e,t){var n=e.timeouts[t],r=n.warningMillis,o=Ft(e);return new Promise((function(i,a){var s=!1,u=!1;e[t](rn(e)).then((function(e){s=!0,i(e)})).catch((function(e){s=!0,a(e)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=Et(31,!1,t,o,$t(e),n.millis);function l(e){if(!s)if(!0===e)u=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!u){var t=e,o=t*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(t+1)}),r)}}}))}function fn(e){var t={};for(var n in on)t[n]=Kt({},on[n],e&&e[n]||{});return t}function dn(e){return Promise.resolve().then((function(){return e.loadPromise?e.loadPromise:e.status!==Pt&&e.status!==It?e:(e.status=xt,e.loadPromise=Promise.resolve().then((function(){var r=e.loadApp(rn(e));if(!qt(r))throw n=!0,Error(Et(33,!1,$t(e)));return r.then((function(n){var r;e.loadErrorTime=null,"object"!==mt(t=n)&&(r=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!Wt(t.bootstrap)&&(r=35),Wt(t.mount)||(r=36),Wt(t.unmount)||(r=37);var o=Ft(t);if(r){var i;try{i=JSON.stringify(t)}catch(e){}return console.error(Et(r,!1,o,$t(e),i),t),_t(void 0,e,Mt),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=Kt({},e.devtools.overlays,t.devtools.overlays)),e.status=jt,e.bootstrap=Vt(t,"bootstrap"),e.mount=Vt(t,"mount"),e.unmount=Vt(t,"unmount"),e.unload=Vt(t,"unload"),e.timeouts=fn(t.timeouts),delete e.loadPromise,e}))})).catch((function(t){var r;return delete e.loadPromise,n?r=Mt:(r=It,e.loadErrorTime=(new Date).getTime()),_t(t,e,r),e})));var t,n}))}var pn,hn="undefined"!=typeof window,yn={hashchange:[],popstate:[]},mn=["hashchange","popstate"];function gn(e){var t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(Et(14,!1));t=e.currentTarget.href,e.preventDefault()}var n=On(window.location.href),r=On(t);0===t.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)}function vn(e){var t=this;if(e){var n=e[0].type;mn.indexOf(n)>=0&&yn[n].forEach((function(n){try{n.apply(t,e)}catch(e){setTimeout((function(){throw e}))}}))}}function bn(){Hn([],arguments)}function wn(e,t){return function(){var n=window.location.href,r=e.apply(this,arguments),o=window.location.href;return pn&&n===o||(Jn()?window.dispatchEvent(function(e,t){var n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)):Hn([])),r}}if(hn){window.addEventListener("hashchange",bn),window.addEventListener("popstate",bn);var _n=window.addEventListener,Sn=window.removeEventListener;window.addEventListener=function(e,t){if(!("function"==typeof t&&mn.indexOf(e)>=0)||zt(yn[e],(function(e){return e===t})))return _n.apply(this,arguments);yn[e].push(t)},window.removeEventListener=function(e,t){if(!("function"==typeof t&&mn.indexOf(e)>=0))return Sn.apply(this,arguments);yn[e]=yn[e].filter((function(e){return e!==t}))},window.history.pushState=wn(window.history.pushState,"pushState"),window.history.replaceState=wn(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn(Et(41,!1)):window.singleSpaNavigate=gn}function On(e){var t=document.createElement("a");return t.href=e,t}var En=!1;function kn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!En){var t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return Pn.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return Pn.call(this,n,window.removeEventListener,e,t,arguments)},En=!0}}function Pn(e,t,n,r,o){return"string"!=typeof n?e.apply(this,o):(n.split(/\s+/).forEach((function(e){mn.indexOf(e)>=0&&(t(e,r),n=n.replace(e,""))})),""===n.trim()?this:e.apply(this,o))}var xn={};function jn(e){return Promise.resolve().then((function(){var t=xn[$t(e)];if(!t)return e;if(e.status===Pt)return Tn(e,t),e;if("UNLOADING"===e.status)return t.promise.then((function(){return e}));if(e.status!==At&&e.status!==It)return e;var n=e.status===It?Promise.resolve():ln(e,"unload");return e.status="UNLOADING",n.then((function(){return Tn(e,t),e})).catch((function(n){return function(e,t,n){delete xn[$t(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,_t(n,e,Mt),t.reject(n)}(e,t,n),e}))}))}function Tn(e,t){delete xn[$t(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=Pt,t.resolve()}function An(e,t,n,r){xn[$t(e)]={app:e,resolve:n,reject:r},Object.defineProperty(xn[$t(e)],"promise",{get:t})}function Cn(e){return xn[e]}var Nn=[];function Dn(){return Nn.filter(Lt).map($t)}function Rn(){return Nn.map($t)}function In(e){var t=zt(Nn,(function(t){return $t(t)===e}));return t?t.status:null}function Mn(e,t,n,r){var o=function(e,t,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===mt(e)?(function(e){if(Array.isArray(e)||null===e)throw Error(Et(39,!1));var t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((function(e,n){return t.indexOf(n)>=0?e:e.concat(n)}),[]);if(0!==n.length)throw Error(Et(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length)throw Error(Et(20,!1));if("object"!==mt(e.app)&&"function"!=typeof e.app)throw Error(Et(20,!1));var r=function(e){return"string"==typeof e||"function"==typeof e};if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error(Et(24,!1));if(!Fn(e.customProps))throw Error(Et(22,!1))}(e),i.name=e.name,i.loadApp=e.app,i.activeWhen=e.activeWhen,i.customProps=e.customProps):(function(e,t,n,r){if("string"!=typeof e||0===e.length)throw Error(Et(20,!1));if(!t)throw Error(Et(23,!1));if("function"!=typeof n)throw Error(Et(24,!1));if(!Fn(r))throw Error(Et(22,!1))}(e,t,n,r),i.name=e,i.loadApp=t,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(e){return e||{}}(i.customProps),i.activeWhen=function(e){var t=Array.isArray(e)?e:[e];return t=t.map((function(e){return"function"==typeof e?e:Kn(e)})),function(e){return t.some((function(t){return t(e)}))}}(i.activeWhen),i}(e,t,n,r);if(-1!==Rn().indexOf(o.name))throw Error(Et(21,!1,o.name));Nn.push(Kt({loadErrorTime:null,status:Pt,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),hn&&(kn(),Hn())}function Ln(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return Nn.filter((function(t){return t.activeWhen(e)})).map($t)}function Un(e){if(0===Nn.filter((function(t){return $t(t)===e})).length)throw Error(Et(25,!1,e));return $n(e).then((function(){var t=Nn.map($t).indexOf(e);Nn.splice(t,1)}))}function $n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof e)throw Error(Et(26,!1));var n=zt(Nn,(function(t){return $t(t)===e}));if(!n)throw Error(Et(27,!1,e));var r,o=Cn($t(n));if(t&&t.waitForUnmount){if(o)return o.promise;var i=new Promise((function(e,t){An(n,(function(){return i}),e,t)}));return i}return o?(r=o.promise,Bn(n,o.resolve,o.reject)):r=new Promise((function(e,t){An(n,(function(){return r}),e,t),Bn(n,e,t)})),r}function Bn(e,t,n){Gt(e).then(jn).then((function(){t(),setTimeout((function(){Hn()}))})).catch(n)}function Fn(e){return!e||"function"==typeof e||"object"===mt(e)&&null!==e&&!Array.isArray(e)}function Kn(e,t){var n=function(e,t){var n=0,r=!1,o="^";"/"!==e[0]&&(e="/"+e);for(var i=0;i<e.length;i++){var a=e[i];(!r&&":"===a||r&&"/"===a)&&s(i)}return s(e.length),new RegExp(o,"i");function s(i){var a=e.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===e.length)if(r)t&&(o+="$");else{var s=t?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(s,"$"):"".concat(o,"(/").concat(s,")?(#.*)?$")}r=!r,n=i}}(e,t);return function(e){var t=e.origin;t||(t="".concat(e.protocol,"//").concat(e.host));var r=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(r)}}var zn=!1,Wn=[],Vn=hn&&window.location.href;function qn(){return Hn()}function Hn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if(zn)return new Promise((function(e,n){Wn.push({resolve:e,reject:n,eventArguments:t})}));var n,r=function(){var e=[],t=[],n=[],r=[],o=(new Date).getTime();return Nn.forEach((function(i){var a=i.status!==Mt&&Ut(i);switch(i.status){case It:a&&o-i.loadErrorTime>=200&&n.push(i);break;case Pt:case xt:a&&n.push(i);break;case jt:case At:!a&&Cn($t(i))?e.push(i):a&&r.push(i);break;case Nt:a||t.push(i)}})),{appsToUnload:e,appsToUnmount:t,appsToLoad:n,appsToMount:r}}(),o=r.appsToUnload,i=r.appsToUnmount,a=r.appsToLoad,s=r.appsToMount,u=!1,c=Vn,l=Vn=window.location.href;return Jn()?(zn=!0,n=o.concat(a,i,s),Promise.resolve().then((function(){if(window.dispatchEvent(new bt(0===n.length?"single-spa:before-no-app-change":"single-spa:before-app-change",h(!0))),window.dispatchEvent(new bt("single-spa:before-routing-event",h(!0,{cancelNavigation:f}))),u)return window.dispatchEvent(new bt("single-spa:before-mount-routing-event",h(!0))),d(),void gn(c);var t=o.map(jn),r=i.map(Gt).map((function(e){return e.then(jn)})).concat(t),l=Promise.all(r);l.then((function(){window.dispatchEvent(new bt("single-spa:before-mount-routing-event",h(!0)))}));var y=a.map((function(e){return dn(e).then((function(e){return Gn(e,l)}))})),m=s.filter((function(e){return a.indexOf(e)<0})).map((function(e){return Gn(e,l)}));return l.catch((function(e){throw p(),e})).then((function(){return p(),Promise.all(y.concat(m)).catch((function(t){throw e.forEach((function(e){return e.reject(t)})),t})).then(d)}))}))):(n=a,Promise.resolve().then((function(){var e=a.map(dn);return Promise.all(e).then(p).then((function(){return[]})).catch((function(e){throw p(),e}))})));function f(){u=!0}function d(){var t=Dn();e.forEach((function(e){return e.resolve(t)}));try{var r=0===n.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new bt(r,h())),window.dispatchEvent(new bt("single-spa:routing-event",h()))}catch(e){setTimeout((function(){throw e}))}if(zn=!1,Wn.length>0){var o=Wn;Wn=[],Hn(o)}return t}function p(){e.forEach((function(e){vn(e.eventArguments)})),vn(t)}function h(){var e,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],f=arguments.length>1?arguments[1]:void 0,d={},p=(gt(e={},Nt,[]),gt(e,At,[]),gt(e,Pt,[]),gt(e,Mt,[]),e);r?(a.concat(s).forEach((function(e,t){y(e,Nt)})),o.forEach((function(e){y(e,Pt)})),i.forEach((function(e){y(e,At)}))):n.forEach((function(e){y(e)}));var h={detail:{newAppStatuses:d,appsByNewStatus:p,totalAppChanges:n.length,originalEvent:null==t?void 0:t[0],oldUrl:c,newUrl:l,navigationIsCanceled:u}};return f&&Kt(h.detail,f),h;function y(e,t){var n=$t(e);t=t||In(n),d[n]=t,(p[t]=p[t]||[]).push(n)}}}function Gn(e,t){return Ut(e)?Ht(e).then((function(e){return t.then((function(){return Ut(e)?Jt(e):e}))})):t.then((function(){return e}))}var Qn=!1;function Yn(e){var t;Qn=!0,e&&e.urlRerouteOnly&&(t=e.urlRerouteOnly,pn=t),hn&&Hn()}function Jn(){return Qn}hn&&setTimeout((function(){Qn||console.warn(Et(1,!1))}),5e3);var Xn={getRawAppData:function(){return[].concat(Nn)},reroute:Hn,NOT_LOADED:Pt,toLoadPromise:dn,toBootstrapPromise:Ht,unregisterApplication:Un};function Zn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}hn&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Xn);const er=e=>{const t=e.concat(["openmrsBase","openmrsSpaBase"]);return Ce((e=>{if(!e||"string"!=typeof e)return!1;const n=/\${(.*?)}/g;let r=n.exec(e);for(;r;){if(!t.includes(r[1]))return!1;r=n.exec(e)}return!0}),"Should be a URL or path. The allowed template parameters are "+t.map((e=>"${"+e+"}")).join(", "))},tr={inRange:(e,t)=>Ce((n=>e<=n&&n<=t),`must be between ${e} and ${t}`),isUrl:er([]),isUrlWithTemplateParameters:er,oneOf:e=>Ce((t=>e.includes(t)),`Must be one of the following: '${e.join("', '")}'.`)};function nr(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function rr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const or="/ws/rest/v1/",ir="/ws/fhir2/R4",ar=`${or}session`;function sr(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)}function ur(e,t={}){if("string"!=typeof e)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof t)throw Error("The second argument to @openmrs/api's openmrsFetch function must be a plain object.");if(!window.openmrsBase)throw Error("@openmrs/api is running in a browser that doesn't have window.openmrsBase, which is provided by openmrs-module-spa's HTML file.");let n=sr(e);if(t.headers||(t.headers={}),z(t.body)&&(t.body=JSON.stringify(t.body)),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),null===t.headers.Accept&&delete t.headers.Accept,e.startsWith(or)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(ir)){const e=new URL(n,window.location.toString());e.searchParams.has("_summary")||(e.searchParams.set("_summary","data"),n=e.toString())}const r=Error();return window.fetch(n,t).then((o=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){nr(i,r,o,a,s,"next",e)}function s(e){nr(i,r,o,a,s,"throw",e)}a(void 0)}))}}((function*(e){const t=e;if(t.ok)return 204===t.status?(t.data=null,t):t.clone().text().then((e=>{try{e&&(t.data=JSON.parse(e))}catch(e){}return t}));{const{redirectAuthFailure:e}=yield new Promise((e=>{const t=Ke("@openmrs/esm-api");function n(t){if(t.loaded&&t.config){const n=ge(["Display conditions","Translation overrides"],t.config);e(n),r&&r()}}n(t.getState());const r=t.subscribe(n)}));return n===sr(ar)&&403===t.status||e.enabled&&e.errors.includes(t.status)?(function({to:e,templateParams:t}){const n=window.getOpenmrsSpaBase().replace(/\/$/,""),r=function(e,t){const n=window.getOpenmrsSpaBase().replace(/\/$/,"");return function(e,t){return Object.keys(t).reduce(((e,n)=>e.split("${"+n+"}").join(t[n])),e)}(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Zn(e,t,n[t])}))}return e}({openmrsBase:window.openmrsBase,openmrsSpaBase:n},t)).replace(/^\/\//,"/")}(e,t);r.startsWith(n)?gn(r):window.location.assign(r)}({to:e.url}),e.resolvePromise?Promise.resolve():new Promise((()=>{}))):t.clone().text().then((e=>{let o=e;try{o=JSON.parse(e)}catch(e){}throw new lr(n,t,o,r)}),(e=>{throw new lr(n,t,null,r)}))}})),function(e){return o.apply(this,arguments)}));var o}function cr(e,t={}){if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");const n=new AbortController;return t.signal=n.signal,new E((r=>{let o=!1;return ur(e,t).then((e=>{o=!0,r.next(e),r.complete()}),(e=>{o=!0,r.error(e)})),()=>{o||n.abort()}}))}let lr=class extends Error{constructor(e,t,n,r){super(),rr(this,"response",void 0),rr(this,"responseBody",void 0),this.message=`Server responded with ${t.status} (${t.statusText}) for url ${e}. Check err.responseBody or network tab in dev tools for more info`,r.message=this.message,this.responseBody=n,this.response=t,this.stack=`Stacktrace for outgoing request:\n${r.stack}\nStacktrace for incoming response:\n${this.stack}`}};var fr=r(151);const dr=function(e){return void 0===e};function pr(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}const hr=(0,Ue.createGlobalStore)("session",{loaded:!1,session:null});let yr=0;function mr(e={includeAuthStatus:!0}){return(yr<Date.now()-6e4||!hr.getState().loaded)&&vr(),new E((t=>{const n=n=>{var r;n.loaded&&(e.includeAuthStatus?t.next(n.session):t.next(null===(r=n.session)||void 0===r?void 0:r.user))};return n(hr.getState()),hr.subscribe(n)}))}function gr(){return(yr<Date.now()-6e4||!hr.getState().loaded)&&vr(),hr}function vr(){return new Promise(((e,t)=>{yr=Date.now(),ur(ar).then((n=>{if("object"!=typeof(null==n?void 0:n.data))return t(),Promise.reject();!function(e){var t,n,r;const o=null!==(r=null==e||null===(t=e.user)||void 0===t||null===(n=t.userProperties)||void 0===n?void 0:n.defaultLocale)&&void 0!==r?r:e.locale;o!==document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",o)}(n.data),e(n.data),hr.setState({loaded:!0,session:n.data})})).catch((e=>((0,fr.reportError)(`Failed to fetch new session information: ${e}`),t(e),{sessionId:"",authenticated:!1})))}))}function br(){hr.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})}function wr(e,t){return void 0===t?Boolean(e):!Boolean(e)||function(e,t){return"string"==typeof e?!dr(t.privileges.find((t=>e===t.display))):Array.isArray(e)?e.every((e=>!dr(t.privileges.find((t=>e===t.display))))):(dr(e)||console.error(`Could not understand privileges "${e}"`),!0)}(e,t)||function(e){return!dr(e.roles.find((e=>"System Developer"===e.display)))}(t)}function _r(){let e,t;return new Promise(((n,r)=>{const o=r=>{r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};o(hr.getState()),e||(t=hr.subscribe(o))}))}function Sr(){return new Promise(((e,t)=>{mr().subscribe((t=>{e(t.sessionLocation)}),t).unsubscribe()}))}function Or(e,t){return Er.apply(this,arguments)}function Er(){return Er=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){pr(i,r,o,a,s,"next",e)}function s(e){pr(i,r,o,a,s,"throw",e)}a(void 0)}))}}((function*(e,t){yield ur(ar,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal}),yield vr()})),Er.apply(this,arguments)}function kr(){!function(e,t){nt(e,t);const n=me(t,ht),r=$e.getState();$e.setState({schemas:qe(Ve({},r.schemas),{[e]:n})})}("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:Ae.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:Ae.String,_default:"${openmrsSpaBase}/login",_validators:[tr.isUrl]},errors:{_type:Ae.Array,_default:[401],_elements:{_type:Ae.Number,_validators:[tr.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:Ae.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}}}),vr()}try{self["workbox:window:6.5.3"]&&_()}catch(mt){}function Pr(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))}function xr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}try{self["workbox:core:6.5.3"]&&_()}catch(mt){}var jr=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))};function Tr(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href}var Ar=function(e,t){this.type=e,Object.assign(this,t)};function Cr(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Nr(){}var Dr={type:"SKIP_WAITING"};function Rr(e,t){if(!t)return e&&e.then?e.then(Nr):Promise.resolve()}!function(e){var t,n;function r(t,n){var r,o;return void 0===n&&(n={}),(r=e.call(this)||this).nn={},r.tn=0,r.rn=new jr,r.en=new jr,r.on=new jr,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!Tr(t.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=t,e.removeEventListener("updatefound",r.cn)):(r.hn=t,r.an.add(t),r.rn.resolve(t)),++r.tn,t.addEventListener("statechange",r.ln)},r.ln=function(e){var t=r.fn,n=e.target,o=n.state,i=n===r.vn,a={sw:n,isExternal:i,originalEvent:e};!i&&r.mn&&(a.isUpdate=!0),r.dispatchEvent(new Ar(o,a)),"installed"===o?r.wn=self.setTimeout((function(){"installed"===o&&t.waiting===n&&r.dispatchEvent(new Ar("waiting",a))}),200):"activating"===o&&(clearTimeout(r.wn),i||r.en.resolve(n))},r.dn=function(e){var t=r.hn,n=t!==navigator.serviceWorker.controller;r.dispatchEvent(new Ar("controlling",{isExternal:n,originalEvent:e,sw:t,isUpdate:r.mn})),n||r.on.resolve(t)},r.gn=(o=function(e){var t=e.data,n=e.ports,o=e.source;return Cr(r.getSW(),(function(){r.an.has(o)&&r.dispatchEvent(new Ar("message",{data:t,originalEvent:e,ports:n,sw:o}))}))},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(o.apply(this,e))}catch(e){return Promise.reject(e)}}),r.sn=t,r.nn=n,navigator.serviceWorker.addEventListener("message",r.gn),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o,i=r.prototype;i.register=function(e){var t=(void 0===e?{}:e).immediate,n=void 0!==t&&t;try{var r=this;return function(e,t){var n=e();return n&&n.then?n.then(t):t()}((function(){if(!n&&"complete"!==document.readyState)return Rr(new Promise((function(e){return window.addEventListener("load",e)})))}),(function(){return r.mn=Boolean(navigator.serviceWorker.controller),r.yn=r.pn(),Cr(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 t=r.fn.waiting;return t&&Tr(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then((function(){r.dispatchEvent(new Ar("waiting",{sw:t,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)}},i.update=function(){try{return this.fn?Rr(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},i.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},i.messageSW=function(e){try{return Cr(this.getSW(),(function(t){return Pr(t,e)}))}catch(e){return Promise.reject(e)}},i.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&Pr(this.fn.waiting,Dr)},i.pn=function(){var e=navigator.serviceWorker.controller;return e&&Tr(e.scriptURL,this.sn.toString())?e:void 0},i.bn=function(){try{var e=this;return function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return Cr(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}),(function(e){throw e}))}catch(e){return Promise.reject(e)}},(o=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,o)}(function(){function e(){this.Pn=new Map}var t=e.prototype;return t.addEventListener=function(e,t){this.Sn(e).add(t)},t.removeEventListener=function(e,t){this.Sn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,n=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return xr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xr(e,t):void 0}}(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(this.Sn(e.type));!(t=n()).done;)(0,t.value)(e)},t.Sn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}());const Ir="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,Mr=Object.keys,Lr=Array.isArray;function Ur(e,t){return"object"!=typeof t||Mr(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||Ir.Promise||(Ir.Promise=Promise);const $r=Object.getPrototypeOf,Br={}.hasOwnProperty;function Fr(e,t){return Br.call(e,t)}function Kr(e,t){"function"==typeof t&&(t=t($r(e))),("undefined"==typeof Reflect?Mr:Reflect.ownKeys)(t).forEach((n=>{Wr(e,n,t[n])}))}const zr=Object.defineProperty;function Wr(e,t,n,r){zr(e,t,Ur(n&&Fr(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function Vr(e){return{from:function(t){return e.prototype=Object.create(t.prototype),Wr(e.prototype,"constructor",e),{extend:Kr.bind(null,e.prototype)}}}}const qr=Object.getOwnPropertyDescriptor;function Hr(e,t){let n;return qr(e,t)||(n=$r(e))&&Hr(n,t)}const Gr=[].slice;function Qr(e,t,n){return Gr.call(e,t,n)}function Yr(e,t){return t(e)}function Jr(e){if(!e)throw new Error("Assertion Failed")}function Xr(e){Ir.setImmediate?setImmediate(e):setTimeout(e,0)}function Zr(e,t){return e.reduce(((e,n,r)=>{var o=t(n,r);return o&&(e[o[0]]=o[1]),e}),{})}function eo(e,t){if(Fr(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,o=t.length;r<o;++r){var i=eo(e,t[r]);n.push(i)}return n}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return void 0===s?void 0:eo(s,t.substr(a+1))}}function to(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){Jr("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)to(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var a=t.substr(0,i),s=t.substr(i+1);if(""===s)void 0===n?Lr(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n;else{var u=e[a];u&&Fr(e,a)||(u=e[a]={}),to(u,s,n)}}else void 0===n?Lr(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function no(e){var t={};for(var n in e)Fr(e,n)&&(t[n]=e[n]);return t}const ro=[].concat;function oo(e){return ro.apply([],e)}const io="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(oo([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>Ir[e])),ao=io.map((e=>Ir[e]));Zr(io,(e=>[e,!0]));let so=null;function uo(e){so="undefined"!=typeof WeakMap&&new WeakMap;const t=co(e);return so=null,t}function co(e){if(!e||"object"!=typeof e)return e;let t=so&&so.get(e);if(t)return t;if(Lr(e)){t=[],so&&so.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(co(e[n]))}else if(ao.indexOf(e.constructor)>=0)t=e;else{const n=$r(e);for(var o in t=n===Object.prototype?{}:Object.create(n),so&&so.set(e,t),e)Fr(e,o)&&(t[o]=co(e[o]))}return t}const{toString:lo}={};function fo(e){return lo.call(e).slice(8,-1)}const po="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",ho="symbol"==typeof po?function(e){var t;return null!=e&&(t=e[po])&&t.apply(e)}:function(){return null},yo={};function mo(e){var t,n,r,o;if(1===arguments.length){if(Lr(e))return e.slice();if(this===yo&&"string"==typeof e)return[e];if(o=ho(e)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}const go="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var vo="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function bo(e,t){vo=e,wo=t}var wo=()=>!0;const _o=!new Error("").stack;function So(){if(_o)try{throw So.arguments,new Error}catch(e){return e}return new Error}function Oo(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(wo).map((e=>"\n"+e)).join("")):""}var Eo=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ko=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Eo),Po={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 xo(e,t){this._e=So(),this.name=e,this.message=t}function jo(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,n)=>n.indexOf(e)===t)).join("\n")}function To(e,t,n,r){this._e=So(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=jo(e,t)}function Ao(e,t){this._e=So(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=jo(e,t)}Vr(xo).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+Oo(this._e,2))}},toString:function(){return this.name+": "+this.message}}),Vr(To).from(xo),Vr(Ao).from(xo);var Co=ko.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const No=xo;var Do=ko.reduce(((e,t)=>{var n=t+"Error";function r(e,r){this._e=So(),this.name=n,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=Po[t]||n,this.inner=null)}return Vr(r).from(No),e[t]=r,e}),{});Do.Syntax=SyntaxError,Do.Type=TypeError,Do.Range=RangeError;var Ro=Eo.reduce(((e,t)=>(e[t+"Error"]=Do[t],e)),{}),Io=ko.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Do[t]),e)),{});function Mo(){}function Lo(e){return e}function Uo(e,t){return null==e||e===Lo?t:function(n){return t(e(n))}}function $o(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Bo(e,t){return e===Mo?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?$o(r,this.onsuccess):r),o&&(this.onerror=this.onerror?$o(o,this.onerror):o),void 0!==i?i:n}}function Fo(e,t){return e===Mo?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?$o(n,this.onsuccess):n),r&&(this.onerror=this.onerror?$o(r,this.onerror):r)}}function Ko(e,t){return e===Mo?t:function(n){var r=e.apply(this,arguments);Ur(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?$o(o,this.onsuccess):o),i&&(this.onerror=this.onerror?$o(i,this.onerror):i),void 0===r?void 0===a?void 0:a:Ur(r,a)}}function zo(e,t){return e===Mo?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function Wo(e,t){return e===Mo?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,o=arguments.length,i=new Array(o);o--;)i[o]=arguments[o];return n.then((function(){return t.apply(r,i)}))}return t.apply(this,arguments)}}Io.ModifyError=To,Io.DexieError=xo,Io.BulkError=Ao;var Vo={};const[qo,Ho,Go]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,$r(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,$r(t),e]})(),Qo=Ho&&Ho.then,Yo=qo&&qo.constructor,Jo=!!Go;var Xo=!1,Zo=Go?()=>{Go.then(Si)}:Ir.setImmediate?setImmediate.bind(null,Si):Ir.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{Si(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(Si,0)},ei=function(e,t){ci.push([e,t]),ni&&(Zo(),ni=!1)},ti=!0,ni=!0,ri=[],oi=[],ii=null,ai=Lo,si={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:qi,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{qi(e[0],e[1])}catch(e){}}))}},ui=si,ci=[],li=0,fi=[];function di(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=Mo,this._lib=!1;var t=this._PSD=ui;if(vo&&(this._stackHolder=So(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Vo)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&mi(this,this._value))}this._state=null,this._value=null,++t.ref,yi(this,e)}const pi={get:function(){var e=ui,t=Ni;function n(n,r){var o=!e.global&&(e!==ui||t!==Ni);const i=o&&!Mi();var a=new di(((t,a)=>{vi(this,new hi(Wi(n,e,o,i),Wi(r,e,o,i),t,a,e))}));return vo&&_i(a,this),a}return n.prototype=Vo,n},set:function(e){Wr(this,"then",e&&e.prototype===Vo?pi:{get:function(){return e},set:pi.set})}};function hi(e,t,n,r,o){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=o}function yi(e,t){try{t((t=>{if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&Oi();t&&"function"==typeof t.then?yi(e,((e,n)=>{t instanceof di?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,gi(e)),n&&Ei()}}),mi.bind(null,e))}catch(t){mi(e,t)}}function mi(e,t){if(oi.push(t),null===e._state){var n=e._lib&&Oi();t=ai(t),e._state=!1,e._value=t,vo&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){}}((()=>{var n=Hr(t,"stack");t._promise=e,Wr(t,"stack",{get:()=>Xo?n&&(n.get?n.get.apply(t):n.value):e.stack})})),function(e){ri.some((t=>t._value===e._value))||ri.push(e)}(e),gi(e),n&&Ei()}}function gi(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)vi(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===li&&(++li,ei((()=>{0==--li&&ki()}),[]))}function vi(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++li,ei(bi,[n,e,t])}else e._listeners.push(t)}function bi(e,t,n){try{ii=t;var r,o=t._value;t._state?r=e(o):(oi.length&&(oi=[]),r=e(o),-1===oi.indexOf(o)&&function(e){for(var t=ri.length;t;)if(ri[--t]._value===e._value)return void ri.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{ii=null,0==--li&&ki(),--n.psd.ref||n.psd.finalize()}}function wi(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var o,i,a=e._value;null!=a?(o=a.name||"Error",i=a.message||a,r=Oo(a,0)):(o=a,i=""),t.push(o+(i?": "+i:"")+r)}return vo&&((r=Oo(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&wi(e._prev,t,n)),t}function _i(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function Si(){Oi()&&Ei()}function Oi(){var e=ti;return ti=!1,ni=!1,e}function Ei(){var e,t,n;do{for(;ci.length>0;)for(e=ci,ci=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(ci.length>0);ti=!0,ni=!0}function ki(){var e=ri;ri=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=fi.slice(0),n=t.length;n;)t[--n]()}function Pi(e){return new di(Vo,!1,e)}function xi(e,t){var n=ui;return function(){var r=Oi(),o=ui;try{return Bi(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Bi(o,!1),r&&Ei()}}}Kr(di.prototype,{then:pi,_then:function(e,t){vi(this,new hi(null,null,e,t,ui))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(e=>e instanceof t?n(e):Pi(e))):this.then(null,(e=>e&&e.name===t?n(e):Pi(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),Pi(t))))},stack:{get:function(){if(this._stack)return this._stack;try{Xo=!0;var e=wi(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Xo=!1}}},timeout:function(e,t){return e<1/0?new di(((n,r)=>{var o=setTimeout((()=>r(new Do.Timeout(t))),e);this.then(n,r).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&Wr(di.prototype,Symbol.toStringTag,"Dexie.Promise"),si.env=Fi(),Kr(di,{all:function(){var e=mo.apply(null,arguments).map(Li);return new di((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(((o,i)=>di.resolve(o).then((n=>{e[i]=n,--r||t(e)}),n)))}))},resolve:e=>{if(e instanceof di)return e;if(e&&"function"==typeof e.then)return new di(((t,n)=>{e.then(t,n)}));var t=new di(Vo,!0,e);return _i(t,ii),t},reject:Pi,race:function(){var e=mo.apply(null,arguments).map(Li);return new di(((t,n)=>{e.map((e=>di.resolve(e).then(t,n)))}))},PSD:{get:()=>ui,set:e=>ui=e},totalEchoes:{get:()=>Ni},newPSD:Ri,usePSD:Ki,scheduler:{get:()=>ei,set:e=>{ei=e}},rejectionMapper:{get:()=>ai,set:e=>{ai=e}},follow:(e,t)=>new di(((n,r)=>Ri(((t,n)=>{var r=ui;r.unhandleds=[],r.onunhandled=n,r.finalize=$o((function(){!function(e){fi.push((function t(){e(),fi.splice(fi.indexOf(t),1)})),++li,ei((()=>{0==--li&&ki()}),[])}((()=>{0===this.unhandleds.length?t():n(this.unhandleds[0])}))}),r.finalize),e()}),t,n,r)))}),Yo&&(Yo.allSettled&&Wr(di,"allSettled",(function(){const e=mo.apply(null,arguments).map(Li);return new di((t=>{0===e.length&&t([]);let n=e.length;const r=new Array(n);e.forEach(((e,o)=>di.resolve(e).then((e=>r[o]={status:"fulfilled",value:e}),(e=>r[o]={status:"rejected",reason:e})).then((()=>--n||t(r)))))}))})),Yo.any&&"undefined"!=typeof AggregateError&&Wr(di,"any",(function(){const e=mo.apply(null,arguments).map(Li);return new di(((t,n)=>{0===e.length&&n(new AggregateError([]));let r=e.length;const o=new Array(r);e.forEach(((e,i)=>di.resolve(e).then((e=>t(e)),(e=>{o[i]=e,--r||n(new AggregateError(o))}))))}))})));const ji={awaits:0,echoes:0,id:0};var Ti=0,Ai=[],Ci=0,Ni=0,Di=0;function Ri(e,t,n,r){var o=ui,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++Di;var a=si.env;i.env=Jo?{Promise:di,PromiseProp:{value:di,configurable:!0,writable:!0},all:di.all,race:di.race,allSettled:di.allSettled,any:di.any,resolve:di.resolve,reject:di.reject,nthen:Vi(a.nthen,i),gthen:Vi(a.gthen,i)}:{},t&&Ur(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=Ki(i,e,n,r);return 0===i.ref&&i.finalize(),s}function Ii(){return ji.id||(ji.id=++Ti),++ji.awaits,ji.echoes+=100,ji.id}function Mi(){return!!ji.awaits&&(0==--ji.awaits&&(ji.id=0),ji.echoes=100*ji.awaits,!0)}function Li(e){return ji.echoes&&e&&e.constructor===Yo?(Ii(),e.then((e=>(Mi(),e)),(e=>(Mi(),Hi(e))))):e}function Ui(e){++Ni,ji.echoes&&0!=--ji.echoes||(ji.echoes=ji.id=0),Ai.push(ui),Bi(e,!0)}function $i(){var e=Ai[Ai.length-1];Ai.pop(),Bi(e,!1)}function Bi(e,t){var n=ui;if((t?!ji.echoes||Ci++&&e===ui:!Ci||--Ci&&e===ui)||zi(t?Ui.bind(null,e):$i),e!==ui&&(ui=e,n===si&&(si.env=Fi()),Jo)){var r=si.env.Promise,o=e.env;Ho.then=o.nthen,r.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(Ir,"Promise",o.PromiseProp),r.all=o.all,r.race=o.race,r.resolve=o.resolve,r.reject=o.reject,o.allSettled&&(r.allSettled=o.allSettled),o.any&&(r.any=o.any))}}function Fi(){var e=Ir.Promise;return Jo?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(Ir,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Ho.then,gthen:e.prototype.then}:{}}function Ki(e,t,n,r,o){var i=ui;try{return Bi(e,!0),t(n,r,o)}finally{Bi(i,!1)}}function zi(e){Qo.call(qo,e)}function Wi(e,t,n,r){return"function"!=typeof e?e:function(){var o=ui;n&&Ii(),Bi(t,!0);try{return e.apply(this,arguments)}finally{Bi(o,!1),r&&zi(Mi)}}}function Vi(e,t){return function(n,r){return e.call(this,Wi(n,t),Wi(r,t))}}function qi(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,o={promise:t,reason:e};if(Ir.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),Ur(r,o)):Ir.CustomEvent&&Ur(r=new CustomEvent("unhandledrejection",{detail:o}),o),r&&Ir.dispatchEvent&&(dispatchEvent(r),!Ir.PromiseRejectionEvent&&Ir.onunhandledrejection))try{Ir.onunhandledrejection(r)}catch(e){}vo&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+Qo).indexOf("[native code]")&&(Ii=Mi=Mo);var Hi=di.reject;function Gi(e,t,n,r){if(e.idbdb&&(e._state.openComplete||ui.letThrough||e._vip)){var o=e._createTransaction(t,n,e._dbSchema);try{o.create(),e._state.PR1398_maxLoop=3}catch(o){return o.name===Co.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Gi(e,t,n,r)))):Hi(o)}return o._promise(t,((e,t)=>Ri((()=>(ui.trans=o,r(e,t,o)))))).then((e=>o._completion.then((()=>e))))}if(e._state.openComplete)return Hi(new Do.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return Hi(new Do.DatabaseClosed);e.open().catch(Mo)}return e._state.dbReadyPromise.then((()=>Gi(e,t,n,r)))}const Qi=String.fromCharCode(65535),Yi="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Ji=[],Xi="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Zi=Xi,ea=Xi,ta=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function na(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const ra={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function oa(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=uo(t))[e],t)}let ia=class{_trans(e,t,n){const r=this._tx||ui.trans,o=this.name;function i(e,n,r){if(!r.schema[o])throw new Do.NotFound("Table "+o+" not part of transaction");return t(r.idbtrans,r)}const a=Oi();try{return r&&r.db===this.db?r===ui.trans?r._promise(e,i,n):Ri((()=>r._promise(e,i,n)),{trans:r,transless:ui.transless||ui}):Gi(this.db,e,[this.name],i)}finally{a&&Ei()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(t=>this.core.get({trans:t,key:e}).then((e=>this.hook.reading.fire(e))))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(Lr(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=Mr(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);const n=this.schema.indexes.concat(this.schema.primKey).filter((e=>e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))&&e.keyPath.every((e=>t.indexOf(e)>=0))))[0];if(n&&this.db._maxKey!==Qi)return this.where(n.name).equals(n.keyPath.map((t=>e[t])));!n&&vo&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);const{idxByName:r}=this.schema,o=this.db._deps.indexedDB;function i(e,t){try{return 0===o.cmp(e,t)}catch(e){return!1}}const[a,s]=t.reduce((([t,n],o)=>{const a=r[o],s=e[o];return[t||a,t||!a?na(n,a&&a.multi?e=>{const t=eo(e,o);return Lr(t)&&t.some((e=>i(s,e)))}:e=>i(s,eo(e,o))):n]}),[null,null]);return a?this.where(a.name).equals(e[a.keyPath]).filter(s):n?this.filter(s):this.where(t).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,Lr(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const t=t=>{if(!t)return t;const n=Object.create(e.prototype);for(var r in t)if(Fr(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}defineClass(){return this.mapToClass((function(e){Ur(this,e)}))}add(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let o=e;return r&&n&&(o=oa(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[o]}))).then((e=>e.numFailures?di.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{to(e,r,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||Lr(e))return this.where(":id").equals(e).modify(t);{const n=eo(e,this.schema.primKey.keyPath);if(void 0===n)return Hi(new Do.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?Mr(t).forEach((n=>{to(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}}put(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let o=e;return r&&n&&(o=oa(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[o],keys:null!=t?[t]:null}))).then((e=>e.numFailures?di.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{to(e,r,t)}catch(e){}return t}))}delete(e){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:[e]}))).then((e=>e.numFailures?di.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:ra}))).then((e=>e.numFailures?di.reject(e.failures[0]):void 0))}bulkGet(e){return this._trans("readonly",(t=>this.core.getMany({keys:e,trans:t}).then((e=>e.map((e=>this.hook.reading.fire(e)))))))}bulkAdd(e,t,n){const r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new Do.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new Do.InvalidArgument("Arguments objects and keys must have the same length");const a=e.length;let s=i&&n?e.map(oa(i)):e;return this.core.mutate({trans:t,type:"add",keys:r,values:s,wantResults:o}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new Ao(`${this.name}.bulkAdd(): ${e} of ${a} operations failed`,r)}))}))}bulkPut(e,t,n){const r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new Do.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new Do.InvalidArgument("Arguments objects and keys must have the same length");const a=e.length;let s=i&&n?e.map(oa(i)):e;return this.core.mutate({trans:t,type:"put",keys:r,values:s,wantResults:o}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new Ao(`${this.name}.bulkPut(): ${e} of ${a} operations failed`,r)}))}))}bulkDelete(e){const t=e.length;return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:e}))).then((({numFailures:e,lastResult:n,failures:r})=>{if(0===e)return n;throw new Ao(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,r)}))}};function aa(e){var t={},n=function(n,r){if(r){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return t[n].subscribe.apply(null,i),e}if("string"==typeof n)return t[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(e,r,o){if("object"==typeof e)return function(e){Mr(e).forEach((function(t){var n=e[t];if(Lr(n))i(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new Do.InvalidArgument("Invalid event config");var r=i(t,Lo,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){Xr((function(){e.apply(null,t)}))}))}))}}))}(e);r||(r=zo),o||(o=Mo);var a={subscribers:[],fire:o,subscribe:function(e){-1===a.subscribers.indexOf(e)&&(a.subscribers.push(e),a.fire=r(a.fire,e))},unsubscribe:function(e){a.subscribers=a.subscribers.filter((function(t){return t!==e})),a.fire=a.subscribers.reduce(r,o)}};return t[e]=n[e]=a,a}}function sa(e,t){return Vr(t).from({prototype:e}),t}function ua(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function ca(e,t){e.filter=na(e.filter,t)}function la(e,t,n){var r=e.replayFilter;e.replayFilter=r?()=>na(r(),t()):t,e.justLimit=n&&!r}function fa(e,t){if(e.isPrimKey)return t.primaryKey;const n=t.getIndexByKeyPath(e.index);if(!n)throw new Do.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function da(e,t,n){const r=fa(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function pa(e,t,n,r){const o=e.replayFilter?na(e.filter,e.replayFilter()):e.filter;if(e.or){const i={},a=(e,n,r)=>{if(!o||o(n,r,(e=>n.stop(e)),(e=>n.fail(e)))){var a=n.primaryKey,s=""+a;"[object ArrayBuffer]"===s&&(s=""+new Uint8Array(a)),Fr(i,s)||(i[s]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(a,n),ha(da(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return ha(da(e,r,n),na(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function ha(e,t,n,r){var o=xi(r?(e,t,o)=>n(r(e),t,o):n);return e.then((e=>{if(e)return e.start((()=>{var n=()=>e.continue();t&&!t(e,(e=>n=e),(t=>{e.stop(t),n=Mo}),(t=>{e.fail(t),n=Mo}))||o(e.value,e,(e=>n=e)),n()}))}))}function ya(e,t){try{const n=ma(e),r=ma(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){const n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return n===r?0:n<r?-1:1}(ga(e),ga(t));case"Array":return function(e,t){const n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n){const r=ya(e[n],t[n]);if(0!==r)return r}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function ma(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const n=fo(e);return"ArrayBuffer"===n?"binary":n}function ga(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}let va=class{_read(e,t){var n=this._ctx;return n.error?n.table._trans(null,Hi.bind(null,n.error)):n.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,Hi.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=na(t.algorithm,e)}_iterate(e,t){return pa(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&Ur(n,e),t._ctx=n,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((n=>pa(t,e,n,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,n=t.table.core;if(ua(t,!0))return n.count({trans:e,query:{index:fa(t,n.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var r=0;return pa(t,(()=>(++r,!1)),e,n).then((()=>r))})).then(e)}sortBy(e,t){const n=e.split(".").reverse(),r=n[0],o=n.length-1;function i(e,t){return t?i(e[n[t]],t-1):e[r]}var a="next"===this._ctx.dir?1:-1;function s(e,t){var n=i(e,o),r=i(t,o);return n<r?-a:n>r?a:0}return this.toArray((function(e){return e.sort(s)})).then(t)}toArray(e){return this._read((e=>{var t=this._ctx;if("next"===t.dir&&ua(t,!0)&&t.limit>0){const{valueMapper:n}=t,r=fa(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:r,range:t.range}}).then((({result:e})=>n?e.map(n):e))}{const n=[];return pa(t,(e=>n.push(e)),e,t.table.core).then((()=>n))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,ua(t)?la(t,(()=>{var t=e;return(e,n)=>0===t||(1===t?(--t,!1):(n((()=>{e.advance(t),t=0})),!1))})):la(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),la(this._ctx,(()=>{var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}until(e,t){return ca(this._ctx,(function(n,r,o){return!e(n.value)||(r(o),t)})),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 t,n;return ca(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=na(t.isMatch,n),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 t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}keys(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&ua(t,!0)&&t.limit>0)return this._read((e=>{var n=fa(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((({result:e})=>e)).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).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,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return ca(this._ctx,(function(e){var t=e.primaryKey.toString(),r=Fr(n,t);return n[t]=!0,!r})),this}modify(e){var t=this._ctx;return this._write((n=>{var r;if("function"==typeof e)r=e;else{var o=Mr(e),i=o.length;r=function(t){for(var n=!1,r=0;r<i;++r){var a=o[r],s=e[a];eo(t,a)!==s&&(to(t,a,s),n=!0)}return n}}const a=t.table.core,{outbound:s,extractKey:u}=a.schema.primaryKey,c=this.db._options.modifyChunkSize||200,l=[];let f=0;const d=[],p=(e,t)=>{const{failures:n,numFailures:r}=t;f+=e-r;for(let e of Mr(n))l.push(n[e])};return this.clone().primaryKeys().then((o=>{const i=l=>{const f=Math.min(c,o.length-l);return a.getMany({trans:n,keys:o.slice(l,l+f),cache:"immutable"}).then((d=>{const h=[],y=[],m=s?[]:null,g=[];for(let e=0;e<f;++e){const t=d[e],n={value:uo(t),primKey:o[l+e]};!1!==r.call(n,n.value,n)&&(null==n.value?g.push(o[l+e]):s||0===ya(u(t),u(n.value))?(y.push(n.value),s&&m.push(o[l+e])):(g.push(o[l+e]),h.push(n.value)))}const v=ua(t)&&t.limit===1/0&&("function"!=typeof e||e===ba)&&{index:t.index,range:t.range};return Promise.resolve(h.length>0&&a.mutate({trans:n,type:"add",values:h}).then((e=>{for(let t in e.failures)g.splice(parseInt(t),1);p(h.length,e)}))).then((()=>(y.length>0||v&&"object"==typeof e)&&a.mutate({trans:n,type:"put",keys:m,values:y,criteria:v,changeSpec:"function"!=typeof e&&e}).then((e=>p(y.length,e))))).then((()=>(g.length>0||v&&e===ba)&&a.mutate({trans:n,type:"delete",keys:g,criteria:v}).then((e=>p(g.length,e))))).then((()=>o.length>l+f&&i(l+c)))}))};return i(0).then((()=>{if(l.length>0)throw new To("Error modifying one or more objects",l,f,d);return o.length}))}))}))}delete(){var e=this._ctx,t=e.range;return ua(e)&&(e.isPrimKey&&!ea||3===t.type)?this._write((n=>{const{primaryKey:r}=e.table.core.schema,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then((t=>e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((({failures:e,lastResult:n,results:r,numFailures:o})=>{if(o)throw new To("Could not delete some values",Object.keys(e).map((t=>e[t])),t-o);return t-o}))))})):this.modify(ba)}};const ba=(e,t)=>t.value=null;function wa(e,t){return e<t?-1:e===t?0:1}function _a(e,t){return e>t?-1:e===t?0:1}function Sa(e,t,n){var r=e instanceof ja?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function Oa(e){return new e.Collection(e,(()=>xa(""))).limit(0)}function Ea(e,t,n,r,o,i){for(var a=Math.min(e.length,r.length),s=-1,u=0;u<a;++u){var c=t[u];if(c!==r[u])return o(e[u],n[u])<0?e.substr(0,u)+n[u]+n.substr(u+1):o(e[u],r[u])<0?e.substr(0,u)+r[u]+n.substr(u+1):s>=0?e.substr(0,s)+t[s]+n.substr(s+1):null;o(e[u],c)<0&&(s=u)}return a<r.length&&"next"===i?e+n.substr(e.length):a<e.length&&"prev"===i?e.substr(0,n.length):s<0?null:e.substr(0,s)+r[s]+n.substr(s+1)}function ka(e,t,n,r){var o,i,a,s,u,c,l,f=n.length;if(!n.every((e=>"string"==typeof e)))return Sa(e,"String expected.");function d(e){o=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),i=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),a="next"===e?wa:_a;var t=n.map((function(e){return{lower:i(e),upper:o(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));s=t.map((function(e){return e.upper})),u=t.map((function(e){return e.lower})),c=e,l="next"===e?"":r}d("next");var p=new e.Collection(e,(()=>Pa(s[0],u[f-1]+r)));p._ondirectionchange=function(e){d(e)};var h=0;return p._addAlgorithm((function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var d=i(o);if(t(d,u,h))return!0;for(var p=null,y=h;y<f;++y){var m=Ea(o,d,s[y],u[y],a,c);null===m&&null===p?h=y+1:(null===p||a(p,m)>0)&&(p=m)}return n(null!==p?function(){e.continue(p+l)}:r),!1})),p}function Pa(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function xa(e){return{type:1,lower:e,upper:e}}let ja=class{get Collection(){return this._ctx.table.db.Collection}between(e,t,n,r){n=!1!==n,r=!0===r;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Oa(this):new this.Collection(this,(()=>Pa(e,t,!n,!r)))}catch(e){return Sa(this,Yi)}}equals(e){return null==e?Sa(this,Yi):new this.Collection(this,(()=>xa(e)))}above(e){return null==e?Sa(this,Yi):new this.Collection(this,(()=>Pa(e,void 0,!0)))}aboveOrEqual(e){return null==e?Sa(this,Yi):new this.Collection(this,(()=>Pa(e,void 0,!1)))}below(e){return null==e?Sa(this,Yi):new this.Collection(this,(()=>Pa(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?Sa(this,Yi):new this.Collection(this,(()=>Pa(void 0,e)))}startsWith(e){return"string"!=typeof e?Sa(this,"String expected."):this.between(e,e+Qi,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):ka(this,((e,t)=>0===e.indexOf(t[0])),[e],Qi)}equalsIgnoreCase(e){return ka(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=mo.apply(yo,arguments);return 0===e.length?Oa(this):ka(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=mo.apply(yo,arguments);return 0===e.length?Oa(this):ka(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,Qi)}anyOf(){const e=mo.apply(yo,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return Sa(this,Yi)}if(0===e.length)return Oa(this);const n=new this.Collection(this,(()=>Pa(e[0],e[e.length-1])));n._ondirectionchange=n=>{t="next"===n?this._ascending:this._descending,e.sort(t)};let r=0;return n._addAlgorithm(((n,o,i)=>{const a=n.key;for(;t(a,e[r])>0;)if(++r,r===e.length)return o(i),!1;return 0===t(a,e[r])||(o((()=>{n.continue(e[r])})),!1)})),n}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=mo.apply(yo,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Sa(this,Yi)}const t=e.reduce(((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,t){const n=this._cmp,r=this._ascending,o=this._descending,i=this._min,a=this._max;if(0===e.length)return Oa(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&r(e[0],e[1])<=0)))return Sa(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Do.InvalidArgument);const s=!t||!1!==t.includeLowers,u=t&&!0===t.includeUppers;let c,l=r;function f(e,t){return l(e[0],t[0])}try{c=e.reduce((function(e,t){let r=0,o=e.length;for(;r<o;++r){const o=e[r];if(n(t[0],o[1])<0&&n(t[1],o[0])>0){o[0]=i(o[0],t[0]),o[1]=a(o[1],t[1]);break}}return r===o&&e.push(t),e}),[]),c.sort(f)}catch(e){return Sa(this,Yi)}let d=0;const p=u?e=>r(e,c[d][1])>0:e=>r(e,c[d][1])>=0,h=s?e=>o(e,c[d][0])>0:e=>o(e,c[d][0])>=0;let y=p;const m=new this.Collection(this,(()=>Pa(c[0][0],c[c.length-1][1],!s,!u)));return m._ondirectionchange=e=>{"next"===e?(y=p,l=r):(y=h,l=o),c.sort(f)},m._addAlgorithm(((e,t,n)=>{for(var o=e.key;y(o);)if(++d,d===c.length)return t(n),!1;return!!function(e){return!p(e)&&!h(e)}(o)||(0===this._cmp(o,c[d][1])||0===this._cmp(o,c[d][0])||t((()=>{l===r?e.continue(c[d][0]):e.continue(c[d][1])})),!1)})),m}startsWithAnyOf(){const e=mo.apply(yo,arguments);return e.every((e=>"string"==typeof e))?0===e.length?Oa(this):this.inAnyRange(e.map((e=>[e,e+Qi]))):Sa(this,"startsWithAnyOf() only works with strings")}};function Ta(e){return xi((function(t){return Aa(t),e(t.target.error),!1}))}function Aa(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const Ca=aa(null,"storagemutated");let Na=class{_lock(){return Jr(!ui.global),++this._reculock,1!==this._reculock||ui.global||(ui.lockOwnerFor=this),this}_unlock(){if(Jr(!ui.global),0==--this._reculock)for(ui.global||(ui.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{Ki(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&ui.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,n=this.db._state.dbOpenError;if(Jr(!this.idbtrans),!e&&!t)switch(n&&n.name){case"DatabaseClosedError":throw new Do.DatabaseClosed(n);case"MissingAPIError":throw new Do.MissingAPI(n.message,n);default:throw new Do.OpenFailed(n)}if(!this.active)throw new Do.TransactionInactive;return Jr(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=xi((t=>{Aa(t),this._reject(e.error)})),e.onabort=xi((t=>{Aa(t),this.active&&this._reject(new Do.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=xi((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&Ca.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,n){if("readwrite"===e&&"readwrite"!==this.mode)return Hi(new Do.ReadOnly("Transaction is readonly"));if(!this.active)return Hi(new Do.TransactionInactive);if(this._locked())return new di(((r,o)=>{this._blockedFuncs.push([()=>{this._promise(e,t,n).then(r,o)},ui])}));if(n)return Ri((()=>{var e=new di(((e,n)=>{this._lock();const r=t(e,n,this);r&&r.then&&r.then(e,n)}));return e.finally((()=>this._unlock())),e._lib=!0,e}));var r=new di(((e,n)=>{var r=t(e,n,this);r&&r.then&&r.then(e,n)}));return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();const n=di.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((()=>n));else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var o=t._waitingFor;return new di(((e,r)=>{n.then((n=>t._waitingQueue.push(xi(e.bind(null,n)))),(e=>t._waitingQueue.push(xi(r.bind(null,e))))).finally((()=>{t._waitingFor===o&&(t._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Do.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if(Fr(t,e))return t[e];const n=this.schema[e];if(!n)throw new Do.NotFound("Table "+e+" not part of transaction");const r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}};function Da(e,t,n,r,o,i,a){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+Ra(t)}}function Ra(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Ia(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:Zr(n,(e=>[e.name,e]))}}let Ma=e=>{try{return e.only([[]]),Ma=()=>[[]],[[]]}catch(e){return Ma=()=>Qi,Qi}};function La(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>eo(t,e)}(e):t=>eo(t,e)}function Ua(e){return[].slice.call(e)}let $a=0;function Ba(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function Fa({_novip:e},t){const n=t.db,r=function(e,t,{IDBKeyRange:n,indexedDB:r},i){const a=function(e,t){return t.reduce(((e,{create:t})=>o({},e,t(e))),e)}(function(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:n,upper:r,lowerOpen:o,upperOpen:i}=e;return void 0===n?void 0===r?null:t.upperBound(r,!!i):void 0===r?t.lowerBound(n,!!o):t.bound(n,r,!!o,!!i)}const{schema:o,hasGetAll:i}=function(e,t){const n=Ua(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:n}=e,r=Lr(t),o=null==t,i={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:La(t)},indexes:Ua(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:n,multiEntry:r,keyPath:o}=e,a={name:t,compound:Lr(o),keyPath:o,unique:n,multiEntry:r,extractKey:La(o)};return i[Ba(o)]=a,a})),getIndexByKeyPath:e=>i[Ba(e)]};return i[":id"]=a.primaryKey,null!=t&&(i[Ba(t)]=a.primaryKey),a}))},hasGetAll:n.length>0&&"getAll"in t.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,n),a=o.tables.map((e=>function(e){const t=e.name;return{name:t,schema:e,mutate:function({trans:e,type:n,keys:o,values:i,range:a}){return new Promise(((s,u)=>{s=xi(s);const c=e.objectStore(t),l=null==c.keyPath,f="put"===n||"add"===n;if(!f&&"delete"!==n&&"deleteRange"!==n)throw new Error("Invalid operation type: "+n);const{length:d}=o||i||{length:1};if(o&&i&&o.length!==i.length)throw new Error("Given keys array must have same length as given values array.");if(0===d)return s({numFailures:0,failures:{},results:[],lastResult:void 0});let p;const h=[],y=[];let m=0;const g=e=>{++m,Aa(e)};if("deleteRange"===n){if(4===a.type)return s({numFailures:m,failures:y,results:[],lastResult:void 0});3===a.type?h.push(p=c.clear()):h.push(p=c.delete(r(a)))}else{const[e,t]=f?l?[i,o]:[i,null]:[o,null];if(f)for(let r=0;r<d;++r)h.push(p=t&&void 0!==t[r]?c[n](e[r],t[r]):c[n](e[r])),p.onerror=g;else for(let t=0;t<d;++t)h.push(p=c[n](e[t])),p.onerror=g}const v=e=>{const t=e.target.result;h.forEach(((e,t)=>null!=e.error&&(y[t]=e.error))),s({numFailures:m,failures:y,results:"delete"===n?o:h.map((e=>e.result)),lastResult:t})};p.onerror=e=>{g(e),v(e)},p.onsuccess=v}))},getMany:({trans:e,keys:n})=>new Promise(((r,o)=>{r=xi(r);const i=e.objectStore(t),a=n.length,s=new Array(a);let u,c=0,l=0;const f=e=>{const t=e.target;s[t._pos]=t.result,++l===c&&r(s)},d=Ta(o);for(let e=0;e<a;++e)null!=n[e]&&(u=i.get(n[e]),u._pos=e,u.onsuccess=f,u.onerror=d,++c);0===c&&r(s)})),get:({trans:e,key:n})=>new Promise(((r,o)=>{r=xi(r);const i=e.objectStore(t).get(n);i.onsuccess=e=>r(e.target.result),i.onerror=Ta(o)})),query:function(e){return n=>new Promise(((o,i)=>{o=xi(o);const{trans:a,values:s,limit:u,query:c}=n,l=u===1/0?void 0:u,{index:f,range:d}=c,p=a.objectStore(t),h=f.isPrimaryKey?p:p.index(f.name),y=r(d);if(0===u)return o({result:[]});if(e){const e=s?h.getAll(y,l):h.getAllKeys(y,l);e.onsuccess=e=>o({result:e.target.result}),e.onerror=Ta(i)}else{let e=0;const t=s||!("openKeyCursor"in h)?h.openCursor(y):h.openKeyCursor(y),n=[];t.onsuccess=r=>{const i=t.result;return i?(n.push(s?i.value:i.primaryKey),++e===u?o({result:n}):void i.continue()):o({result:n})},t.onerror=Ta(i)}}))}(i),openCursor:function({trans:e,values:n,query:o,reverse:i,unique:a}){return new Promise(((s,u)=>{s=xi(s);const{index:c,range:l}=o,f=e.objectStore(t),d=c.isPrimaryKey?f:f.index(c.name),p=i?a?"prevunique":"prev":a?"nextunique":"next",h=n||!("openKeyCursor"in d)?d.openCursor(r(l),p):d.openKeyCursor(r(l),p);h.onerror=Ta(u),h.onsuccess=xi((t=>{const n=h.result;if(!n)return void s(null);n.___id=++$a,n.done=!1;const r=n.continue.bind(n);let o=n.continuePrimaryKey;o&&(o=o.bind(n));const i=n.advance.bind(n),a=()=>{throw new Error("Cursor not stopped")};n.trans=e,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw new Error("Cursor not started")},n.fail=xi(u),n.next=function(){let e=1;return this.start((()=>e--?this.continue():this.stop())).then((()=>this))},n.start=e=>{const t=new Promise(((e,t)=>{e=xi(e),h.onerror=Ta(t),n.fail=t,n.stop=t=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=a,e(t)}})),s=()=>{if(h.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=()=>{throw new Error("Cursor behind last entry")},n.stop()};return h.onsuccess=xi((e=>{h.onsuccess=s,s()})),n.continue=r,n.continuePrimaryKey=o,n.advance=i,s(),t},s(n)}),u)}))},count({query:e,trans:n}){const{index:o,range:i}=e;return new Promise(((e,a)=>{const s=n.objectStore(t),u=o.isPrimaryKey?s:s.index(o.name),c=r(i),l=c?u.count(c):u.count();l.onsuccess=xi((t=>e(t.target.result))),l.onerror=Ta(a)}))}}}(e))),s={};return a.forEach((e=>s[e.name]=e)),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!s[e])throw new Error(`Table '${e}' not found`);return s[e]},MIN_KEY:-1/0,MAX_KEY:Ma(t),schema:o}}(t,n,i),e.dbcore);return{dbcore:a}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach((t=>{const n=t.name;e.core.schema.tables.some((e=>e.name===n))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function Ka({_novip:e},t,n,r){n.forEach((n=>{const o=r[n];t.forEach((t=>{const r=Hr(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?Wr(t,n,{get(){return this.table(n)},set(e){zr(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,o))}))}))}function za({_novip:e},t){t.forEach((t=>{for(let n in t)t[n]instanceof e.Table&&delete t[n]}))}function Wa(e,t){return e._cfg.version-t._cfg.version}function Va(e,t){const n={del:[],add:[],change:[]};let r;for(r in e)t[r]||n.del.push(r);for(r in t){const o=e[r],i=t[r];if(o){const e={name:r,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!Xi)e.recreate=!0,n.change.push(e);else{const t=o.idxByName,r=i.idxByName;let a;for(a in t)r[a]||e.del.push(a);for(a in r){const n=t[a],o=r[a];n?n.src!==o.src&&e.change.push(o):e.add.push(o)}(e.del.length>0||e.add.length>0||e.change.length>0)&&n.change.push(e)}}else n.add.push([r,i])}return n}function qa(e,t,n,r){const o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((e=>Ha(o,e))),o}function Ha(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function Ga(e,t,n){const r={};return Qr(t.objectStoreNames,0).forEach((e=>{const t=n.objectStore(e);let o=t.keyPath;const i=Da(Ra(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),a=[];for(let e=0;e<t.indexNames.length;++e){const n=t.index(t.indexNames[e]);o=n.keyPath;var s=Da(n.name,o,!!n.unique,!!n.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(s)}r[e]=Ia(e,i,a)})),r}function Qa({_novip:e},t,n){const r=n.db.objectStoreNames;for(let o=0;o<r.length;++o){const i=r[o],a=n.objectStore(i);e._hasGetAll="getAll"in a;for(let e=0;e<a.indexNames.length;++e){const n=a.indexNames[e],r=a.index(n).keyPath,o="string"==typeof r?r:"["+Qr(r).join("+")+"]";if(t[i]){const e=t[i].idxByName[o];e&&(e.name=n,delete t[i].idxByName[o],t[i].idxByName[n]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Ir.WorkerGlobalScope&&Ir instanceof Ir.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}let Ya=class{_parseStoresSpec(e,t){Mr(e).forEach((n=>{if(null!==e[n]){var r=e[n].split(",").map(((e,t)=>{const n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Da(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),Lr(r),0===t)})),o=r.shift();if(o.multi)throw new Do.Schema("Primary key cannot be multi-valued");r.forEach((e=>{if(e.auto)throw new Do.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Do.Schema("Index must have a name and cannot be an empty string")})),t[n]=Ia(n,o,r)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?Ur(this._cfg.storesSource,e):e;const n=t._versions,r={};let o={};return n.forEach((e=>{Ur(r,e._cfg.storesSource),o=e._cfg.dbschema={},e._parseStoresSpec(r,o)})),t._dbSchema=o,za(t,[t._allTables,t,t.Transaction.prototype]),Ka(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],Mr(o),o),t._storeNames=Mr(o),this}upgrade(e){return this._cfg.contentUpgrade=Wo(this._cfg.contentUpgrade||Mo,e),this}};function Ja(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new vs("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function Xa(e){return e&&"function"==typeof e.databases}function Za(e){return Ri((function(){return ui.letThrough=!0,e()}))}function es(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()})).finally((function(){return clearInterval(e)})):Promise.resolve()}function ts(e){var t=t=>e.next(t),n=o(t),r=o((t=>e.throw(t)));function o(e){return t=>{var o=e(t),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):Lr(i)?Promise.all(i).then(n,r):n(i)}}return o(t)()}function ns(e,t,n){var r=arguments.length;if(r<2)throw new Do.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[e,oo(o),n]}function rs(e,t,n,r,o){return di.resolve().then((()=>{const i=ui.transless||ui,a=e._createTransaction(t,n,e._dbSchema,r),s={trans:a,transless:i};if(r)a.idbtrans=r.idbtrans;else try{a.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===Co.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>rs(e,t,n,null,o)))):Hi(r)}const u=go(o);let c;u&&Ii();const l=di.follow((()=>{if(c=o.call(a,a),c)if(u){var e=Mi.bind(null,null);c.then(e,e)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=ts(c))}),s);return(c&&"function"==typeof c.then?di.resolve(c).then((e=>a.active?e:Hi(new Do.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):l.then((()=>c))).then((e=>(r&&a._resolve(),a._completion.then((()=>e))))).catch((e=>(a._reject(e),Hi(e))))}))}function os(e,t,n){const r=Lr(e)?e.slice():[e];for(let e=0;e<n;++e)r.push(t);return r}const is={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return i(o({},e),{table(t){const n=e.table(t),{schema:r}=n,a={},s=[];function u(e,t,n){const r=Ba(e),c=a[r]=a[r]||[],l=null==e?0:"string"==typeof e?1:e.length,f=t>0,d=i(o({},n),{isVirtual:f,keyTail:t,keyLength:l,extractKey:La(e),unique:!f&&n.unique});return c.push(d),d.isPrimaryKey||s.push(d),l>1&&u(2===l?e[0]:e.slice(0,l-1),t+1,n),c.sort(((e,t)=>e.keyTail-t.keyTail)),d}const c=u(r.primaryKey.keyPath,0,r.primaryKey);a[":id"]=[c];for(const e of r.indexes)u(e.keyPath,0,e);function l(t){const n=t.query.index;return n.isVirtual?i(o({},t),{query:{index:n,range:(r=t.query.range,a=n.keyTail,{type:1===r.type?2:r.type,lower:os(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,a),lowerOpen:!0,upper:os(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,a),upperOpen:!0})}}):t;var r,a}const f=i(o({},n),{schema:i(o({},r),{primaryKey:c,indexes:s,getIndexByKeyPath:function(e){const t=a[Ba(e)];return t&&t[0]}}),count:e=>n.count(l(e)),query:e=>n.query(l(e)),openCursor(t){const{keyTail:r,isVirtual:o,keyLength:i}=t.query.index;return o?n.openCursor(l(t)).then((n=>n&&function(n){const o=Object.create(n,{continue:{value:function(o){null!=o?n.continue(os(o,t.reverse?e.MAX_KEY:e.MIN_KEY,r)):t.unique?n.continue(n.key.slice(0,i).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,r)):n.continue()}},continuePrimaryKey:{value(t,o){n.continuePrimaryKey(os(t,e.MAX_KEY,r),o)}},primaryKey:{get:()=>n.primaryKey},key:{get(){const e=n.key;return 1===i?e[0]:e.slice(0,i)}},value:{get:()=>n.value}});return o}(n))):n.openCursor(t)}});return f}})}};function as(e,t,n,r){return n=n||{},r=r||"",Mr(e).forEach((o=>{if(Fr(t,o)){var i=e[o],a=t[o];if("object"==typeof i&&"object"==typeof a&&i&&a){const e=fo(i);e!==fo(a)?n[r+o]=t[o]:"Object"===e?as(i,a,n,r+o+"."):i!==a&&(n[r+o]=t[o])}else i!==a&&(n[r+o]=t[o])}else n[r+o]=void 0})),Mr(t).forEach((o=>{Fr(e,o)||(n[r+o]=t[o])})),n}const ss={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>i(o({},e),{table(t){const n=e.table(t),{primaryKey:r}=n.schema,a=i(o({},n),{mutate(e){const a=ui.trans,{deleting:s,creating:u,updating:c}=a.table(t).hook;switch(e.type){case"add":if(u.fire===Mo)break;return a._promise("readwrite",(()=>l(e)),!0);case"put":if(u.fire===Mo&&c.fire===Mo)break;return a._promise("readwrite",(()=>l(e)),!0);case"delete":if(s.fire===Mo)break;return a._promise("readwrite",(()=>l(e)),!0);case"deleteRange":if(s.fire===Mo)break;return a._promise("readwrite",(()=>function(e){return f(e.trans,e.range,1e4)}(e)),!0)}return n.mutate(e);function l(e){const t=ui.trans,a=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(r,e);if(!a)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?i(o({},e),{keys:a}):o({},e)).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),function(e,t,n){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}(n,e,a).then((o=>{const i=a.map(((n,i)=>{const a=o[i],l={onerror:null,onsuccess:null};if("delete"===e.type)s.fire.call(l,n,a,t);else if("add"===e.type||void 0===a){const o=u.fire.call(l,n,e.values[i],t);null==n&&null!=o&&(n=o,e.keys[i]=n,r.outbound||to(e.values[i],r.keyPath,n))}else{const r=as(a,e.values[i]),o=c.fire.call(l,r,n,a,t);if(o){const t=e.values[i];Object.keys(o).forEach((e=>{Fr(t,e)?t[e]=o[e]:to(t,e,o[e])}))}}return l}));return n.mutate(e).then((({failures:t,results:n,numFailures:r,lastResult:s})=>{for(let r=0;r<a.length;++r){const s=n?n[r]:a[r],u=i[r];null==s?u.onerror&&u.onerror(t[r]):u.onsuccess&&u.onsuccess("put"===e.type&&o[r]?e.values[r]:s)}return{failures:t,results:n,numFailures:r,lastResult:s}})).catch((e=>(i.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function f(e,t,a){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:a}).then((({result:n})=>l({type:"delete",keys:n,trans:e}).then((r=>r.numFailures>0?Promise.reject(r.failures[0]):n.length<a?{failures:[],numFailures:0,lastResult:void 0}:f(e,i(o({},t),{lower:n[n.length-1],lowerOpen:!0}),a)))))}}});return a}})};function us(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;const r=[];for(let o=0,i=0;o<t.keys.length&&i<e.length;++o)0===ya(t.keys[o],e[i])&&(r.push(n?uo(t.values[o]):t.values[o]),++i);return r.length===e.length?r:null}catch(e){return null}}const cs={stack:"dbcore",level:-1,create:e=>({table:t=>{const n=e.table(t);return i(o({},n),{getMany:e=>{if(!e.cache)return n.getMany(e);const t=us(e.keys,e.trans._cache,"clone"===e.cache);return t?di.resolve(t):n.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?uo(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),n.mutate(e))})}})};function ls(e){return!("from"in e)}const fs=function(e,t){if(!this){const t=new fs;return e&&"d"in e&&Ur(t,e),t}Ur(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function ds(e,t,n){const r=ya(t,n);if(isNaN(r))return;if(r>0)throw RangeError();if(ls(e))return Ur(e,{from:t,to:n,d:1});const o=e.l,i=e.r;if(ya(n,e.from)<0)return o?ds(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},ys(e);if(ya(t,e.to)>0)return i?ds(i,t,n):e.r={from:t,to:n,d:1,l:null,r:null},ys(e);ya(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),ya(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);const a=!e.r;o&&!e.l&&ps(e,o),i&&a&&ps(e,i)}function ps(e,t){ls(t)||function e(t,{from:n,to:r,l:o,r:i}){ds(t,n,r),o&&e(t,o),i&&e(t,i)}(e,t)}function hs(e){let t=ls(e)?null:{s:0,n:e};return{next(e){const n=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&ya(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||ya(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function ys(e){var t,n;const r=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(n=e.l)||void 0===n?void 0:n.d)||0),i=r>1?"r":r<-1?"l":"";if(i){const t="r"===i?"l":"r",n=o({},e),r=e[i];e.from=r.from,e.to=r.to,e[i]=r[i],n[i]=r[t],e[t]=n,n.d=ms(n)}e.d=ms(e)}function ms({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}Kr(fs.prototype,{add(e){return ps(this,e),this},addKey(e){return ds(this,e,e),this},addKeys(e){return e.forEach((e=>ds(this,e,e))),this},[po](){return hs(this)}});const gs={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,n=new fs(e.MIN_KEY,e.MAX_KEY);return i(o({},e),{table:r=>{const a=e.table(r),{schema:s}=a,{primaryKey:u}=s,{extractKey:c,outbound:l}=u,f=i(o({},a),{mutate:e=>{const o=e.trans,i=o.mutatedParts||(o.mutatedParts={}),u=e=>{const n=`idb://${t}/${r}/${e}`;return i[n]||(i[n]=new fs)},c=u(""),l=u(":dels"),{type:f}=e;let[d,p]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[];const h=e.trans._cache;return a.mutate(e).then((e=>{if(Lr(d)){"delete"!==f&&(d=e.results),c.addKeys(d);const t=us(d,h);t||"add"===f||l.addKeys(d),(t||p)&&function(e,t,n,r){t.indexes.forEach((function(t){const o=e(t.name||"");function i(e){return null!=e?t.extractKey(e):null}const a=e=>t.multiEntry&&Lr(e)?e.forEach((e=>o.addKey(e))):o.addKey(e);(n||r).forEach(((e,t)=>{const o=n&&i(n[t]),s=r&&i(r[t]);0!==ya(o,s)&&(null!=o&&a(o),null!=s&&a(s))}))}))}(u,s,t,p)}else if(d){const e={from:d.lower,to:d.upper};l.add(e),c.add(e)}else c.add(n),l.add(n),s.indexes.forEach((e=>u(e.name).add(n)));return e}))}}),d=({query:{index:t,range:n}})=>{var r,o;return[t,new fs(null!==(r=n.lower)&&void 0!==r?r:e.MIN_KEY,null!==(o=n.upper)&&void 0!==o?o:e.MAX_KEY)]},p={get:e=>[u,new fs(e.key)],getMany:e=>[u,(new fs).addKeys(e.keys)],count:d,query:d,openCursor:d};return Mr(p).forEach((e=>{f[e]=function(s){const{subscr:u}=ui;if(u){const f=e=>{const n=`idb://${t}/${r}/${e}`;return u[n]||(u[n]=new fs)},d=f(""),h=f(":dels"),[y,m]=p[e](s);if(f(y.name||"").add(m),!y.isPrimaryKey){if("count"!==e){const t="query"===e&&l&&s.values&&a.query(i(o({},s),{values:!1}));return a[e].apply(this,arguments).then((n=>{if("query"===e){if(l&&s.values)return t.then((({result:e})=>(d.addKeys(e),n)));const e=s.values?n.result.map(c):n.result;s.values?d.addKeys(e):h.addKeys(e)}else if("openCursor"===e){const e=n,t=s.values;return e&&Object.create(e,{key:{get:()=>(h.addKey(e.primaryKey),e.key)},primaryKey:{get(){const t=e.primaryKey;return h.addKey(t),t}},value:{get:()=>(t&&d.addKey(e.primaryKey),e.value)}})}return n}))}h.add(n)}}return a[e].apply(this,arguments)}})),f}})}};let vs=class e{version(e){if(isNaN(e)||e<.1)throw new Do.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Do.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const t=this._versions;var n=t.filter((t=>t._cfg.version===e))[0];return n||(n=new this.Version(e),t.push(n),t.sort(Wa),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(e){return this.idbdb&&(this._state.openComplete||ui.letThrough||this._vip)?e():new di(((e,t)=>{if(this._state.openComplete)return t(new Do.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new Do.DatabaseClosed);this.open().catch(Mo)}this._state.dbReadyPromise.then(e,t)})).then(e)}use({stack:e,create:t,level:n,name:r}){r&&this.unuse({stack:e,name:r});const o=this._middlewares[e]||(this._middlewares[e]=[]);return o.push({stack:e,create:t,level:null==n?10:n,name:r}),o.sort(((e,t)=>e.level-t.level)),this}unuse({stack:e,name:t,create:n}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((e=>n?e.create!==n:!!t&&e.name!==t))),this}open(){return function(e){const t=e._state,{indexedDB:n}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((()=>t.dbOpenError?Hi(t.dbOpenError):e));vo&&(t.openCanceller._stackHolder=So()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const r=t.openCanceller;function o(){if(t.openCanceller!==r)throw new Do.DatabaseClosed("db.open() was cancelled")}let i=t.dbReadyResolve,a=null,s=!1;return di.race([r,("undefined"==typeof navigator?di.resolve():es()).then((()=>new di(((r,i)=>{if(o(),!n)throw new Do.MissingAPI;const u=e.name,c=t.autoSchema?n.open(u):n.open(u,Math.round(10*e.verno));if(!c)throw new Do.MissingAPI;c.onerror=Ta(i),c.onblocked=xi(e._fireOnBlocked),c.onupgradeneeded=xi((r=>{if(a=c.transaction,t.autoSchema&&!e._options.allowEmptyDB){c.onerror=Aa,a.abort(),c.result.close();const e=n.deleteDatabase(u);e.onsuccess=e.onerror=xi((()=>{i(new Do.NoSuchDatabase(`Database ${u} doesnt exist`))}))}else{a.onerror=Ta(i);var o=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;s=o<1,e._novip.idbdb=c.result,function(e,t,n,r){const o=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,o);i.create(n),i._completion.catch(r);const a=i._reject.bind(i),s=ui.transless||ui;Ri((()=>{ui.trans=i,ui.transless=s,0===t?(Mr(o).forEach((e=>{qa(n,e,o[e].primKey,o[e].indexes)})),Fa(e,n),di.follow((()=>e.on.populate.fire(i))).catch(a)):function({_novip:e},t,n,r){const o=[],i=e._versions;let a=e._dbSchema=Ga(0,e.idbdb,r),s=!1;return i.filter((e=>e._cfg.version>=t)).forEach((i=>{o.push((()=>{const o=a,u=i._cfg.dbschema;Qa(e,o,r),Qa(e,u,r),a=e._dbSchema=u;const c=Va(o,u);c.add.forEach((e=>{qa(r,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((e=>{if(e.recreate)throw new Do.Upgrade("Not yet support for changing primary key");{const t=r.objectStore(e.name);e.add.forEach((e=>Ha(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),Ha(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const l=i._cfg.contentUpgrade;if(l&&i._cfg.version>t){Fa(e,r),n._memoizedTables={},s=!0;let t=no(u);c.del.forEach((e=>{t[e]=o[e]})),za(e,[e.Transaction.prototype]),Ka(e,[e.Transaction.prototype],Mr(t),t),n.schema=t;const i=go(l);let a;i&&Ii();const f=di.follow((()=>{if(a=l(n),a&&i){var e=Mi.bind(null,null);a.then(e,e)}}));return a&&"function"==typeof a.then?di.resolve(a):f.then((()=>a))}})),o.push((t=>{s&&Zi||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((n=>null==e[n]&&t.db.deleteObjectStore(n)))}(i._cfg.dbschema,t),za(e,[e.Transaction.prototype]),Ka(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),function e(){return o.length?di.resolve(o.shift()(n.idbtrans)).then(e):di.resolve()}().then((()=>{var e,t;t=r,Mr(e=a).forEach((n=>{t.db.objectStoreNames.contains(n)||qa(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,i,n).catch(a)}))}(e,o/10,a,i)}}),i),c.onsuccess=xi((()=>{a=null;const n=e._novip.idbdb=c.result,o=Qr(n.objectStoreNames);if(o.length>0)try{const r=n.transaction(1===(i=o).length?i[0]:i,"readonly");t.autoSchema?function({_novip:e},t,n){e.verno=t.version/10;const r=e._dbSchema=Ga(0,t,n);e._storeNames=Qr(t.objectStoreNames,0),Ka(e,[e._allTables],Mr(r),r)}(e,n,r):(Qa(e,e._dbSchema,r),function(e,t){const n=Va(Ga(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.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.")),Fa(e,r)}catch(e){}var i;Ji.push(e),n.onversionchange=xi((n=>{t.vcFired=!0,e.on("versionchange").fire(n)})),n.onclose=xi((t=>{e.on("close").fire(t)})),s&&function({indexedDB:e,IDBKeyRange:t},n){!Xa(e)&&"__dbnames"!==n&&Ja(e,t).put({name:n}).catch(Mo)}(e._deps,u),r()}),i)}))))]).then((()=>(o(),t.onReadyBeingFired=[],di.resolve(Za((()=>e.on.ready.fire(e.vip)))).then((function n(){if(t.onReadyBeingFired.length>0){let r=t.onReadyBeingFired.reduce(Wo,Mo);return t.onReadyBeingFired=[],di.resolve(Za((()=>r(e.vip)))).then(n)}}))))).finally((()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((()=>e)).catch((n=>{t.dbOpenError=n;try{a&&a.abort()}catch(e){}return r===t.openCanceller&&e._close(),Hi(n)})).finally((()=>{t.openComplete=!0,i()}))}(this)}_close(){const e=this._state,t=Ji.indexOf(this);if(t>=0&&Ji.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new di((t=>{e.dbReadyResolve=t})),e.openCanceller=new di(((t,n)=>{e.cancelOpen=n}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new Do.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new di(((n,r)=>{const o=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=xi((()=>{!function({indexedDB:e,IDBKeyRange:t},n){!Xa(e)&&"__dbnames"!==n&&Ja(e,t).delete(n).catch(Mo)}(this._deps,this.name),n()})),e.onerror=Ta(r),e.onblocked=this._fireOnBlocked};if(e)throw new Do.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(o):o()}))}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return Mr(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=ns.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,n){let r=ui.trans;r&&r.db===this&&-1===e.indexOf("!")||(r=null);const o=-1!==e.indexOf("?");let i,a;e=e.replace("!","").replace("?","");try{if(a=t.map((e=>{var t=e instanceof this.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||"readonly"===e)i="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new Do.InvalidArgument("Invalid transaction mode: "+e);i="readwrite"}if(r){if("readonly"===r.mode&&"readwrite"===i){if(!o)throw new Do.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&a.forEach((e=>{if(r&&-1===r.storeNames.indexOf(e)){if(!o)throw new Do.SubTransaction("Table "+e+" not included in parent transaction.");r=null}})),o&&r&&!r.active&&(r=null)}}catch(e){return r?r._promise(null,((t,n)=>{n(e)})):Hi(e)}const s=rs.bind(null,this,i,a,r,n);return r?r._promise(i,s,"lock"):ui.trans?Ki(ui.transless,(()=>this._whenReady(s))):this._whenReady(s)}table(e){if(!Fr(this._allTables,e))throw new Do.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}constructor(t,n){this._middlewares={},this.verno=0;const r=e.dependencies;this._options=n=o({addons:e.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};const{addons:i}=n;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const a={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Mo,dbReadyPromise:null,cancelOpen:Mo,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var s;a.dbReadyPromise=new di((e=>{a.dbReadyResolve=e})),a.openCanceller=new di(((e,t)=>{a.cancelOpen=t})),this._state=a,this.name=t,this.on=aa(this,"populate","blocked","versionchange","close",{ready:[Wo,Mo]}),this.on.ready.subscribe=Yr(this.on.ready.subscribe,(t=>(n,r)=>{e.vip((()=>{const e=this._state;if(e.openComplete)e.dbOpenError||di.resolve().then(n),r&&t(n);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(n),r&&t(n);else{t(n);const e=this;r||t((function t(){e.on.ready.unsubscribe(n),e.on.ready.unsubscribe(t)}))}}))})),this.Collection=(s=this,sa(va.prototype,(function(e,t){this.db=s;let n=ra,r=null;if(t)try{n=t()}catch(e){r=e}const o=e._ctx,i=o.table,a=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:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:o.or,valueMapper:a!==Lo?a:null}}))),this.Table=function(e){return sa(ia.prototype,(function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:aa(null,{creating:[Bo,Mo],reading:[Uo,Lo],updating:[Ko,Mo],deleting:[Fo,Mo]})}))}(this),this.Transaction=function(e){return sa(Na.prototype,(function(t,n,r,o,i){this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=aa(this,"complete","error","abort"),this.parent=i||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 di(((e,t)=>{this._resolve=e,this._reject=t})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),Hi(e)}))}))}(this),this.Version=function(e){return sa(Ya.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return sa(ja.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};const o=e._deps.indexedDB;if(!o)throw new Do.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=(e,t)=>o.cmp(t,e),this._max=(e,t)=>o.cmp(e,t)>0?e:t,this._min=(e,t)=>o.cmp(e,t)<0?e:t,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=Ma(n.IDBKeyRange),this._createTransaction=(e,t,n,r)=>new this.Transaction(e,t,n,this._options.chromeTransactionDurability,r),this._fireOnBlocked=e=>{this.on("blocked").fire(e),Ji.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(is),this.use(ss),this.use(gs),this.use(cs),this.vip=Object.create(this,{_vip:{value:!0}}),i.forEach((e=>e(this)))}};const bs="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";let ws,_s=class{subscribe(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}[bs](){return this}constructor(e){this._subscribe=e}};function Ss(e,t){return Mr(t).forEach((n=>{ps(e[n]||(e[n]=new fs),t[n])})),e}try{ws={indexedDB:Ir.indexedDB||Ir.mozIndexedDB||Ir.webkitIndexedDB||Ir.msIndexedDB,IDBKeyRange:Ir.IDBKeyRange||Ir.webkitIDBKeyRange}}catch(gt){ws={indexedDB:null,IDBKeyRange:null}}const Os=vs;function Es(e){let t=ks;try{ks=!0,Ca.storagemutated.fire(e)}finally{ks=t}}Kr(Os,i(o({},Io),{delete:e=>new Os(e,{addons:[]}).delete(),exists:e=>new Os(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return Xa(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>"__dbnames"!==e)))):Ja(e,t).toCollection().primaryKeys()}(Os.dependencies).then(e)}catch(e){return Hi(new Do.MissingAPI)}},defineClass:()=>function(e){Ur(this,e)},ignoreTransaction:e=>ui.trans?Ki(ui.transless,e):e(),vip:Za,async:function(e){return function(){try{var t=ts(e.apply(this,arguments));return t&&"function"==typeof t.then?t:di.resolve(t)}catch(e){return Hi(e)}}},spawn:function(e,t,n){try{var r=ts(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:di.resolve(r)}catch(e){return Hi(e)}},currentTransaction:{get:()=>ui.trans||null},waitFor:function(e,t){const n=di.resolve("function"==typeof e?Os.ignoreTransaction(e):e).timeout(t||6e4);return ui.trans?ui.trans.waitFor(n):n},Promise:di,debug:{get:()=>vo,set:e=>{bo(e,"dexie"===e?()=>!0:ta)}},derive:Vr,extend:Ur,props:Kr,override:Yr,Events:aa,on:Ca,liveQuery:function(e){return new _s((t=>{const n=go(e);let r=!1,o={},i={};const a={get closed(){return r},unsubscribe:()=>{r=!0,Ca.storagemutated.unsubscribe(l)}};t.start&&t.start(a);let s=!1,u=!1;function c(){return Mr(i).some((e=>o[e]&&function(e,t){const n=hs(t);let r=n.next();if(r.done)return!1;let o=r.value;const i=hs(e);let a=i.next(o.from),s=a.value;for(;!r.done&&!a.done;){if(ya(s.from,o.to)<=0&&ya(s.to,o.from)>=0)return!0;ya(o.from,s.from)<0?o=(r=n.next(s.from)).value:s=(a=i.next(o.from)).value}return!1}(o[e],i[e])))}const l=e=>{Ss(o,e),c()&&f()},f=()=>{if(s||r)return;o={};const d={},p=function(t){n&&Ii();const r=()=>Ri(e,{subscr:t,trans:null}),o=ui.trans?Ki(ui.transless,r):r();return n&&o.then(Mi,Mi),o}(d);u||(Ca("storagemutated",l),u=!0),s=!0,Promise.resolve(p).then((e=>{s=!1,r||(c()?f():(o={},i=d,t.next&&t.next(e)))}),(e=>{s=!1,t.error&&t.error(e),a.unsubscribe()}))};return f(),a}))},extendObservabilitySet:Ss,getByKeyPath:eo,setByKeyPath:to,delByKeyPath:function(e,t){"string"==typeof t?to(e,t,void 0):"length"in t&&[].map.call(t,(function(t){to(e,t,void 0)}))},shallowClone:no,deepClone:uo,getObjectDiff:as,cmp:ya,asap:Xr,minKey:-1/0,addons:[],connections:Ji,errnames:Co,dependencies:ws,semVer:"3.2.3",version:"3.2.3".split(".").map((e=>parseInt(e))).reduce(((e,t,n)=>e+t/Math.pow(10,2*n)))})),Os.maxKey=Ma(Os.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(Ca("storagemutated",(e=>{if(!ks){let t;Xi?(t=document.createEvent("CustomEvent"),t.initCustomEvent("x-storagemutated-1",!0,!0,e)):t=new CustomEvent("x-storagemutated-1",{detail:e}),ks=!0,dispatchEvent(t),ks=!1}})),addEventListener("x-storagemutated-1",(({detail:e})=>{ks||Es(e)})));let ks=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel("x-storagemutated-1");"function"==typeof e.unref&&e.unref(),Ca("storagemutated",(t=>{ks||e.postMessage(t)})),e.onmessage=e=>{e.data&&Es(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){Ca("storagemutated",(e=>{try{ks||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:"x-storagemutated-1",changedParts:e}))))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(e=>{if("x-storagemutated-1"===e.key){const t=JSON.parse(e.newValue);t&&Es(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&"x-storagemutated-1"===e.type&&Es(e.changedParts)}))}function Ps(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xs(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function js(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){xs(i,r,o,a,s,"next",e)}function s(e){xs(i,r,o,a,s,"throw",e)}a(void 0)}))}}di.rejectionMapper=function(e,t){if(!e||e instanceof xo||e instanceof TypeError||e instanceof SyntaxError||!e.name||!Ro[e.name])return e;var n=new Ro[e.name](t||e.message,e);return"stack"in e&&Wr(n,"stack",{get:function(){return this.inner.stack}}),n},bo(vo,ta);const Ts=new class extends vs{constructor(){super("EsmOffline"),Ps(this,"syncQueue",void 0),Ps(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 As(){return(As=js((function*(){const e=yield _r();return(null==e?void 0:e.uuid)||"*"}))).apply(this,arguments)}function Cs(){return Cs=js((function*(e,t){return(yield function(e,t){return Ns.apply(this,arguments)}(e,t)).map((e=>e.content))})),Cs.apply(this,arguments)}function Ns(){return(Ns=js((function*(e,t){const n=t?{type:t,userId:e}:{userId:e};return yield Ts.syncQueue.where(n).toArray().catch(vs.errnames.DatabaseClosed,(()=>[]))}))).apply(this,arguments)}function Ds(){return Ds=js((function*(e){const t=yield function(){return As.apply(this,arguments)}();return yield function(e,t){return Cs.apply(this,arguments)}(t,e)})),Ds.apply(this,arguments)}function Rs(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function Is(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Rs(i,r,o,a,s,"next",e)}function s(e){Rs(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Ms(e,t){return Ls.apply(this,arguments)}function Ls(){return Ls=Is((function*(e,t,n=!0){if(e){let r=null;const[o,i]=yield Promise.all([ur(`${ir}/Patient/${e}`,t).catch((e=>r=e)),n?Us(e):Promise.resolve(null)]);if(o.ok)return o.data;if(i)return i;if(r)throw r}return null})),Ls.apply(this,arguments)}function Us(e){return $s.apply(this,arguments)}function $s(){return $s=Is((function*(e){const t=yield function(e){return Ds.apply(this,arguments)}("patient-registration"),n=t.find((t=>t.fhirPatient.id===e));var r;return null!==(r=null==n?void 0:n.fhirPatient)&&void 0!==r?r:null})),$s.apply(this,arguments)}(0,Ue.createGlobalStore)("offline-synchronization",{}),(0,Ue.createGlobalStore)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});var Bs=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),Fs=function(e){function n(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return t(n,e),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},n}(m),Ks=function(e){function n(t){var n=e.call(this,t)||this;return n.destination=t,n}return t(n,e),n}(b),zs=function(e){function n(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t(n,e),n.prototype[v]=function(){return new Ks(this)},n.prototype.lift=function(e){var t=new Ws(this,this);return t.operator=e,t},n.prototype.next=function(e){if(this.closed)throw new Bs;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].next(e)},n.prototype.error=function(e){if(this.closed)throw new Bs;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].error(e);this.observers.length=0},n.prototype.complete=function(){if(this.closed)throw new Bs;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;r++)n[r].complete();this.observers.length=0},n.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},n.prototype._trySubscribe=function(t){if(this.closed)throw new Bs;return e.prototype._trySubscribe.call(this,t)},n.prototype._subscribe=function(e){if(this.closed)throw new Bs;return this.hasError?(e.error(this.thrownError),m.EMPTY):this.isStopped?(e.complete(),m.EMPTY):(this.observers.push(e),new Fs(this,e))},n.prototype.asObservable=function(){var e=new E;return e.source=this,e},n.create=function(e,t){return new Ws(e,t)},n}(E),Ws=function(e){function n(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t(n,e),n.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},n.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},n.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},n.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):m.EMPTY},n}(zs),Vs=function(e){function n(t){var n=e.call(this)||this;return n._value=t,n}return t(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Bs;return this._value},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(zs),qs=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}(),Hs=new E((function(e){return e.complete()}));function Gs(e){return function(t){return 0===e?Hs:t.lift(new Qs(e))}}var Qs=function(){function e(e){if(this.total=e,this.total<0)throw new qs}return e.prototype.call=function(e,t){return t.subscribe(new Ys(e,this.total))},e}(),Ys=function(e){function n(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return t(n,e),n.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},n}(b);function Js(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new Xs(e,t))}}var Xs=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new Zs(e,this.project,this.thisArg))},e}(),Zs=function(e){function n(t,n,r){var o=e.call(this,t)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return t(n,e),n.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},n}(b);const eu="custom:(uuid,encounters:(uuid,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,uuid),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display),startDatetime,stopDatetime)";function tu(e,t,n){return cr(`/ws/rest/v1/visit?patient=${e}&v=${null!=n?n:eu}`,{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}}).pipe(Gs(1)).pipe(Js((e=>e)))}function nu(e,t){return cr("/ws/rest/v1/visit",{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function ru(e,t,n){return cr(`/ws/rest/v1/visit/${e}`,{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}const ou=new Vs(null);var iu,au;function su(e){return{uuid:e.uuid,display:e.display,name:e.name}}function uu(){return cr("/ws/rest/v1/visittype").pipe(Js((e=>e.data.results.map(su)))).pipe(Gs(1))}function cu(e){return{uuid:e.uuid,display:e.display}}function lu(){return cr("/ws/rest/v1/location").pipe(Js((e=>e.data.results.map(cu)))).pipe(Gs(1))}!function(e){e.NEWVISIT="startVisit",e.EDITVISIT="editVisit",e.LOADING="loadingVisit"}(iu||(iu={})),function(e){e.NOTSTARTED="notStarted",e.ONGOING="ongoing"}(au||(au={}));const fu={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}})()})()},196:(e,t,n)=>{e=n.nmd(e),(()=>{var r={840:(e,t,n)=>{function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}(()=>{var e={151:()=>{(()=>{var e={758:()=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{dispatchActionableNotificationShown:()=>p,dispatchConnectivityChanged:()=>r,dispatchNotificationShown:()=>d,dispatchPrecacheStaticDependencies:()=>s,subscribeActionableNotificationShown:()=>y,subscribeConnectivity:()=>i,subscribeConnectivityChanged:()=>o,subscribeNotificationShown:()=>h,subscribePrecacheStaticDependencies:()=>u,subscribeToastShown:()=>m});const n="openmrs:connectivity-changed";function r(e){window.dispatchEvent(new CustomEvent(n,{detail:{online:e}}))}function o(e){const t=t=>e(t.detail);return window.addEventListener(n,t),()=>window.removeEventListener(n,t)}function i(e){return e({online:navigator.onLine}),o(e)}const a="openmrs:precache-static-dependencies";function s(e={}){window.dispatchEvent(new CustomEvent(a,{detail:e}))}function u(e){const t=t=>e(t.detail);return window.addEventListener(a,t),()=>window.removeEventListener(a,t)}const c="openmrs:notification-shown",l="openmrs:actionable-notification-shown",f="openmrs:toast-shown";function d(e){window.dispatchEvent(new CustomEvent(c,{detail:e}))}function p(e){window.dispatchEvent(new CustomEvent(l,{detail:e}))}function h(e){const t=t=>e(t.detail);return window.addEventListener(c,t),()=>window.removeEventListener(c,t)}function y(e){const t=t=>e(t.detail);return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}function m(e){const t=t=>e(t.detail);return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}})()}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{createErrorHandler:()=>o,reportError:()=>t});var e=n(758);function t(e){const t=i(e);setTimeout((()=>{throw t}))}function o(){const e=Error();return n=>{i(n).stack+=`\nAsync stacktrace:\n${e.stack}`,t(n)}}function i(e){let t;if(e instanceof Error)return e;if(null===e)return Error("'null' was thrown as an error");if("object"==typeof e){try{t=`Object thrown as error: ${JSON.stringify(e)}`}catch(n){t=`Object thrown as error with the following properties: ${Object.keys(e)}`}return Error(t)}return void 0===e?Error("'undefined' was thrown as an error"):Error(e.toString())}window.onerror=function(t){return console.error("Unexpected error: ",t),(0,e.dispatchNotificationShown)({description:null!=t?t:"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(t){var n;console.error("Unhandled rejection: ",t.reason),(0,e.dispatchNotificationShown)({description:null!==(n=t.reason)&&void 0!==n?n:"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})}})()})()},403:()=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{createAppState:()=>s,createGlobalStore:()=>i,getAppState:()=>u,getGlobalStore:()=>a,subscribeTo:()=>c});const n=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.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."),n.clear()}};return t=e(r,o,i),i},r=e=>e?n(e):n,o={};function i(e,t){const n=o[e];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(t,!0),n.active=!0,n.value;{const n=r()((()=>t));return o[e]={value:n,active:!0},n}}function a(e,t){const n=o[e];if(!n){const n=r()((()=>null!=t?t:{}));return o[e]={value:n,active:!1},n}return n.value}function s(e){return i("app",e)}function u(){return a("app",{})}function c(e,t,n){let r=t(e.getState());return e.subscribe((e=>{const o=t(e);o!==r&&(r=o,n(o))}))}})()}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};(()=>{"use strict";r.r(a),r.d(a,{OpenmrsFetchError:()=>lr,VisitMode:()=>iu,VisitStatus:()=>au,backendDependencies:()=>fu,clearCurrentUser:()=>br,defaultVisitCustomRepresentation:()=>eu,fetchCurrentPatient:()=>Ms,fhirBaseUrl:()=>ir,getCurrentUser:()=>mr,getLocations:()=>lu,getLoggedInUser:()=>_r,getSessionLocation:()=>Sr,getSessionStore:()=>gr,getStartedVisit:()=>ou,getVisitTypes:()=>uu,getVisitsForPatient:()=>tu,makeUrl:()=>sr,openmrsFetch:()=>ur,openmrsObservableFetch:()=>cr,refetchCurrentUser:()=>vr,restBaseUrl:()=>or,saveVisit:()=>nu,sessionEndpoint:()=>ar,setSessionLocation:()=>Or,setupApiModule:()=>kr,toLocationObject:()=>cu,toVisitTypeObject:()=>su,updateVisit:()=>ru,userHasAccess:()=>wr});var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};function t(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function s(e){return"function"==typeof e}var u=!1,c={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack,u=e},get useDeprecatedSynchronousErrorHandling(){return u}};function l(e){setTimeout((function(){throw e}),0)}var f={closed:!0,next:function(e){},error:function(e){if(c.useDeprecatedSynchronousErrorHandling)throw e;l(e)},complete:function(){}},d=Array.isArray||function(e){return e&&"number"==typeof e.length};function p(e){return null!==e&&"object"==typeof e}var h=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),y=h,m=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var n=this,r=n._parentOrParents,o=n._ctorUnsubscribe,i=n._unsubscribe,a=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof e)r.remove(this);else if(null!==r)for(var u=0;u<r.length;++u)r[u].remove(this);if(s(i)){o&&(this._unsubscribe=void 0);try{i.call(this)}catch(e){t=e instanceof y?g(e.errors):[e]}}if(d(a)){u=-1;for(var c=a.length;++u<c;){var l=a[u];if(p(l))try{l.unsubscribe()}catch(e){t=t||[],e instanceof y?t=t.concat(g(e.errors)):t.push(e)}}}if(t)throw new y(t)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(typeof t){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof e)){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof e){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.push(n),n},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function g(e){return e.reduce((function(e,t){return e.concat(t instanceof y?t.errors:t)}),[])}var v="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),b=function(e){function n(t,r,o){var i=e.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=f;break;case 1:if(!t){i.destination=f;break}if("object"==typeof t){t instanceof n?(i.syncErrorThrowable=t.syncErrorThrowable,i.destination=t,t.add(i)):(i.syncErrorThrowable=!0,i.destination=new w(i,t));break}default:i.syncErrorThrowable=!0,i.destination=new w(i,t,r,o)}return i}return t(n,e),n.prototype[v]=function(){return this},n.create=function(e,t,r){var o=new n(e,t,r);return o.syncErrorThrowable=!1,o},n.prototype.next=function(e){this.isStopped||this._next(e)},n.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},n.prototype._next=function(e){this.destination.next(e)},n.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},n}(m),w=function(e){function n(t,n,r,o){var i,a=e.call(this)||this;a._parentSubscriber=t;var u=a;return s(n)?i=n:n&&(i=n.next,r=n.error,o=n.complete,n!==f&&(s((u=Object.create(n)).unsubscribe)&&a.add(u.unsubscribe.bind(u)),u.unsubscribe=a.unsubscribe.bind(a))),a._context=u,a._next=i,a._error=r,a._complete=o,a}return t(n,e),n.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;c.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},n.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=c.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):l(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;l(e)}}},n.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};c.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},n.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),c.useDeprecatedSynchronousErrorHandling)throw e;l(e)}},n.prototype.__tryOrSetError=function(e,t,n){if(!c.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return c.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(l(t),!0)}return!1},n.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},n}(b),S="function"==typeof Symbol&&Symbol.observable||"@@observable";function O(e){return e}var E=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,o=function(e,t,n){if(e){if(e instanceof b)return e;if(e[v])return e[v]()}return e||t||n?new b(e,t,n):new b(f)}(e,t,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||c.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),c.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){c.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){var t=e,n=t.closed,r=t.destination,o=t.isStopped;if(n||o)return!1;e=r&&r instanceof b?r:null}return!0}(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=k(t))((function(t,r){var o;o=n.subscribe((function(t){try{e(t)}catch(e){r(e),o&&o.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[S]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:(0===(n=e).length?O:1===n.length?n[0]:function(e){return n.reduce((function(e,t){return t(e)}),e)})(this);var n},e.prototype.toPromise=function(e){var t=this;return new(e=k(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function k(e){if(e||(e=c.Promise||Promise),!e)throw new Error("no Promise impl found");return e}const P="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;var x="object"==typeof self&&self&&self.Object===Object&&self;const j=(P||x||Function("return this")()).Symbol;var T=Object.prototype,A=T.hasOwnProperty,C=T.toString,N=j?j.toStringTag:void 0,D=Object.prototype.toString,R=j?j.toStringTag:void 0;const I=(M=Object.getPrototypeOf,L=Object,function(e){return M(L(e))});var M,L,U=Function.prototype,$=Object.prototype,B=U.toString,F=$.hasOwnProperty,K=B.call(Object);const z=function(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":R&&R in Object(e)?function(e){var t=A.call(e,N),n=e[N];try{e[N]=void 0;var r=!0}catch(e){}var o=C.call(e);return r&&(t?e[N]=n:delete e[N]),o}(e):function(e){return D.call(e)}(e)}(e))return!1;var t=I(e);if(null===t)return!0;var n=F.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&B.call(n)==K};function W(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function V(e){return function t(n){return 0===arguments.length||W(n)?t:e.apply(this,arguments)}}function q(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return W(n)?t:V((function(t){return e(n,t)}));default:return W(n)&&W(r)?t:W(n)?V((function(t){return e(t,r)})):W(r)?V((function(t){return e(n,t)})):e(n,r)}}}function H(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function G(e,t,n){for(var r=0,o=n.length;r<o;){if(e(t,n[r]))return!0;r+=1}return!1}function Q(e,t){return Object.prototype.hasOwnProperty.call(t,e)}const Y="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var J=Object.prototype.toString,X=function(){return"[object Arguments]"===J.call(arguments)?function(e){return"[object Arguments]"===J.call(e)}:function(e){return Q("callee",e)}}();const Z=X;var ee=!{toString:null}.propertyIsEnumerable("toString"),te=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],ne=function(){return arguments.propertyIsEnumerable("length")}(),re=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1};const oe="function"!=typeof Object.keys||ne?V((function(e){if(Object(e)!==e)return[];var t,n,r=[],o=ne&&Z(e);for(t in e)!Q(t,e)||o&&"length"===t||(r[r.length]=t);if(ee)for(n=te.length-1;n>=0;)Q(t=te[n],e)&&!re(r,t)&&(r[r.length]=t),n-=1;return r})):V((function(e){return Object(e)!==e?[]:Object.keys(e)})),ie=V((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function ae(e,t,n,r){var o=H(e);function i(e,t){return se(e,t,n.slice(),r.slice())}return!G((function(e,t){return!G(i,t,e)}),H(t),o)}function se(e,t,n,r){if(Y(e,t))return!0;var o=ie(e);if(o!==ie(t))return!1;if(null==e||null==t)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(o){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]}(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!Y(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!Y(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var i=n.length-1;i>=0;){if(n[i]===e)return r[i]===t;i-=1}switch(o){case"Map":return e.size===t.size&&ae(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&ae(e.values(),t.values(),n.concat([e]),r.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var a=oe(e);if(a.length!==oe(t).length)return!1;var s=n.concat([e]),u=r.concat([t]);for(i=a.length-1;i>=0;){var c=a[i];if(!Q(c,t)||!se(t[c],e[c],s,u))return!1;i-=1}return!0}var ue=q((function(e,t){return se(e,t,[],[])}));const ce=ue;function le(e){return function t(n,r,o){switch(arguments.length){case 0:return t;case 1:return W(n)?t:q((function(t,r){return e(n,t,r)}));case 2:return W(n)&&W(r)?t:W(n)?q((function(t,n){return e(t,r,n)})):W(r)?q((function(t,r){return e(n,t,r)})):V((function(t){return e(n,r,t)}));default:return W(n)&&W(r)&&W(o)?t:W(n)&&W(r)?q((function(t,n){return e(t,n,o)})):W(n)&&W(o)?q((function(t,n){return e(t,r,n)})):W(r)&&W(o)?q((function(t,r){return e(n,t,r)})):W(n)?V((function(t){return e(t,r,o)})):W(r)?V((function(t){return e(n,t,o)})):W(o)?V((function(t){return e(n,r,t)})):e(n,r,o)}}}function fe(e){return"[object Object]"===Object.prototype.toString.call(e)}var de=le((function(e,t,n){var r,o={};for(r in t)Q(r,t)&&(o[r]=Q(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)Q(r,n)&&!Q(r,o)&&(o[r]=n[r]);return o}));const pe=de;var he=le((function e(t,n,r){return pe((function(n,r,o){return fe(r)&&fe(o)?e(t,r,o):t(n,r,o)}),n,r)}));const ye=he,me=q((function(e,t){return ye((function(e,t,n){return n}),e,t)})),ge=q((function(e,t){for(var n={},r={},o=0,i=e.length;o<i;)r[e[o]]=1,o+=1;for(var a in t)r.hasOwnProperty(a)||(n[a]=t[a]);return n}));function ve(e,t,n,r){var o,i=function(o){for(var i=t.length,a=0;a<i;){if(e===t[a])return n[a];a+=1}for(var s in t[a+1]=e,n[a+1]=o,e)o[s]=r?ve(e[s],t,n,!0):e[s];return o};switch(ie(e)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(e.valueOf());case"RegExp":return o=e,new RegExp(o.source,(o.global?"g":"")+(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.sticky?"y":"")+(o.unicode?"u":""));default:return e}}const be=V((function(e){return null!=e&&"function"==typeof e.clone?e.clone():ve(e,[],[],!0)})),we=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};var _e=V((function(e){return!!we(e)||!!e&&"object"==typeof e&&!function(e){return"[object String]"===Object.prototype.toString.call(e)}(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1))}));const Se=_e;var Oe=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}(),Ee=q((function(e,t){return function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,o){return t.apply(this,arguments)};case 5:return function(e,n,r,o,i){return t.apply(this,arguments)};case 6:return function(e,n,r,o,i,a){return t.apply(this,arguments)};case 7:return function(e,n,r,o,i,a,s){return t.apply(this,arguments)};case 8:return function(e,n,r,o,i,a,s,u){return t.apply(this,arguments)};case 9:return function(e,n,r,o,i,a,s,u,c){return t.apply(this,arguments)};case 10:return function(e,n,r,o,i,a,s,u,c,l){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}(e.length,(function(){return e.apply(t,arguments)}))}));const ke=Ee;function Pe(e,t,n){for(var r=n.next();!r.done;){if((t=e["@@transducer/step"](t,r.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r=n.next()}return e["@@transducer/result"](t)}function xe(e,t,n,r){return e["@@transducer/result"](n[r](ke(e["@@transducer/step"],e),t))}var je="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";const Te=le((function(e,t,n){if("function"==typeof e&&(e=function(e){return new Oe(e)}(e)),Se(n))return function(e,t,n){for(var r=0,o=n.length;r<o;){if((t=e["@@transducer/step"](t,n[r]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r+=1}return e["@@transducer/result"](t)}(e,t,n);if("function"==typeof n["fantasy-land/reduce"])return xe(e,t,n,"fantasy-land/reduce");if(null!=n[je])return Pe(e,t,n[je]());if("function"==typeof n.next)return Pe(e,t,n);if("function"==typeof n.reduce)return xe(e,t,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}));var Ae;function Ce(e,t){return n=>{if(!e(n))return"function"==typeof t?t(n):t}}!function(e){e.Array="Array",e.Boolean="Boolean",e.ConceptUuid="ConceptUuid",e.Number="Number",e.Object="Object",e.String="String",e.UUID="UUID",e.PersonAttributeTypeUuid="PersonAttributeTypeUuid",e.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid"}(Ae||(Ae={}));const Ne=Ce((e=>Array.isArray(e)),"must be an array"),De=Ce((e=>"boolean"==typeof e),"must be a boolean"),Re=Ce((e=>"number"==typeof e),"must be a number"),Ie=Ce((e=>"string"==typeof e),"must be a string"),Me=Ce((e=>"object"==typeof e&&!Array.isArray(e)&&null!==e),"must be an object (not an array or null)"),Le=Ce((e=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[0-9a-f]{36}$/i.test(e)),"must be a valid UUID or a 36-character hexadecimal string");var Ue=r(403);const $e=(0,Ue.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{}}),Be=(0,Ue.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});Be.subscribe((e=>{var t;t=e.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}));const Fe=(0,Ue.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]});function Ke(e){return(0,Ue.getGlobalStore)(`config-module-${e}`,{config:null,loaded:!1})}const ze=(0,Ue.createGlobalStore)("config-implementer-tools",{config:{}});function We(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){We(e,t,n[t])}))}return e}function qe(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function He(e,t){for(let n of Object.keys(e.schemas)){const r=rt(n,e,t);Ke(n).setState({loaded:!0,config:r})}}function Ge(e,t){const n=function(e,t){const n=it(tt(e,t)),r=Object.keys(n).reduce(((e,t)=>{var r,o;return(null===(r=n[t])||void 0===r?void 0:r.extensionSlots)&&(e[t]=null===(o=n[t])||void 0===o?void 0:o.extensionSlots),e}),{});return function(e){for(let[t,n]of Object.entries(e))for(let[e,r]of Object.entries(n))et(r,t,e)}(r),Object.keys(r).reduce(((e,t)=>Ve({},e,r[t])),{})}(e,t),r=Object.fromEntries(Object.entries(n).map((([e,t])=>[e,{loaded:!0,config:t}]))),o=(0,Ue.getGlobalStore)("config-extension-slots",{slots:{}}),i=o.getState(),a={slots:Ve({},i.slots,r)};ce(i,a)||o.setState(a)}function Qe(e,t){const n=function(e,t){let n=Xe(be(e.schemas));const r=[...e.providedConfigs.map((e=>[e.config,e.source])),[t.config,"temporary config"]];for(let[e,t]of r)n=it([n,Ze(e,t)]);return n}(e,t);ze.setState({config:n})}function Ye(e,t,n){const r={};for(let o of t.mountedExtensions){const t=Je(o.slotModuleName,o.extensionModuleName,o.slotName,o.extensionId,e,n);r[o.slotName]=qe(Ve({},r[o.slotName]),{[o.extensionId]:{config:t,loaded:!0}})}(0,Ue.getGlobalStore)("config-extensions",{configs:{}}).setState({configs:r})}function Je(e,t,n,r,o,i){var a,s,u;const c=function(e){const[t]=e.split("#");return t}(r),l=o.schemas[c],f=l?c:t,d=tt(o,i),p=ot(e,d);var h;const y=null!==(h=null==p||null===(a=p.extensionSlots)||void 0===a||null===(s=a[n])||void 0===s||null===(u=s.configure)||void 0===u?void 0:u[r])&&void 0!==h?h:{},m=it([ot(f,d),y]),g=null!=l?l:o.schemas[t];at(g,m,f);const v=ft(g,m);return ut(g,v,f),delete v.extensionSlots,v}function Xe(e){return e.hasOwnProperty("_default")?qe(Ve({},e),{_value:e._default,_source:"default"}):pt(e)?Object.keys(e).reduce(((t,n)=>(t[n]=Xe(e[n]),t)),{}):{}}function Ze(e,t){return pt(e)?Object.keys(e).reduce(((n,r)=>(n[r]=Ze(e[r],t),n)),{}):{_value:e,_source:t}}function et(e,t,n){const r=`Extension slot config '${t}.extensionSlots.${n}`,o=Object.keys(e).filter((e=>!["add","remove","order","configure"].includes(e)));o.length&&console.error(r+`' contains invalid keys '${o.join("', '")}'`),e.add&&(Array.isArray(e.add)&&e.add.every((e=>"string"==typeof e))||console.error(r+".add' is invalid. Must be an array of strings (extension IDs)")),e.remove&&(Array.isArray(e.remove)&&e.remove.every((e=>"string"==typeof e))||console.error(r+".remove' is invalid. Must be an array of strings (extension IDs)")),e.order&&(Array.isArray(e.order)&&e.order.every((e=>"string"==typeof e))||console.error(r+".order' is invalid. Must be an array of strings (extension IDs)")),e.configure&&(pt(e.configure)||console.error(r+".configure' is invalid. Must be an object with extension IDs for keys"))}function tt(e,t){return[...e.providedConfigs.map((e=>e.config)),t.config]}function nt(e,t,n=""){const r="Please verify that you are running the latest version and, if so, alert the maintainer.";for(const o of Object.keys(t).filter((e=>!e.startsWith("_")))){const i=n+(n&&".")+o,a=t[o];if("Display conditions"===i&&console.error(`${e} declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ${r}`),"Translation overrides"===i&&console.error(`${e} declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ${r}`),!pt(a)){console.error(`${e} has bad config schema definition for key '${i}'. ${r}`);continue}a.hasOwnProperty("_default")||nt(e,a,i);const s=a._elements;if(dt(s)&&nt(e,s,i+"._elements"),a._validators)for(let t of a._validators)"function"!=typeof t&&console.error(`${e} has invalid validator for key '${i}' ${r}.\n\nIf you're the maintainer: validators must be functions that return either undefined or an error string. Received ${t}.`);const u=a._type;u&&!Object.values(Ae).includes(u)&&console.error(`${e} has invalid type for key '${i}' ${r}.\n\nIf you're the maintainer: the allowed types are ${Object.values(Ae).join(", ")}. Received '${u}'`),Object.keys(a).every((e=>["_description","_validators","_elements","_type"].includes(e)))&&!n.includes("._elements")&&console.error(`${e} has bad config schema definition for key '${i}'. ${r}.\n\nIf you're the maintainer: all config elements must have a default. Received ${JSON.stringify(a)}`),s&&u&&![Ae.Array,Ae.Object].includes(u)&&console.error(`${e} has bad config schema definition for key '${i}'. ${r}.\n\nIf you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. Received ${JSON.stringify(u)}`)}}function rt(e,t,n){if(!t.schemas.hasOwnProperty(e))throw Error("No config schema has been defined for "+e);const r=t.schemas[e],o=ot(e,tt(t,n));at(r,o,e);const i=ft(r,o);return ut(r,i,e),delete i.extensionSlots,i}function ot(e,t){return it(t.map((({[e]:t})=>t)).filter((e=>!!e)))}function it(e){return Te(me)({},e)}function at(e,t,n=""){for(const r of Object.keys(t)){const o=t[r],i=n+"."+r,a=e[r];e.hasOwnProperty(r)?st(a,o,i):"extensionSlots"===r&&""!==n||console.error(`Unknown config key '${i}' provided. Ignoring.`)}}function st(e,t,n){ct(n,e._type,t),pt(t)?e._type===Ae.Object?function(e,t,n){if(e._elements)for(const r of Object.keys(t)){const o=t[r];at(e._elements,o,`${n}.${r}`)}}(e,t,n):e.hasOwnProperty("_default")||at(e,t,n):e._type===Ae.Array&&function(e,t,n){if(dt(e._elements))for(let r=0;r<t.length;r++)st(e._elements,t[r],`${n}[${r}]`);for(let o=0;o<t.length;o++){var r;ct(`${n}[${o}]`,null===(r=e._elements)||void 0===r?void 0:r._type,t[o])}}(e,t,n)}function ut(e,t,n=""){if(e)if(t!==e._default&&lt(n,e._validators,t),pt(t))for(const r of Object.keys(t)){const o=t[r],i=n+"."+r,a=e[r];e._type===Ae.Object&&e._elements?ut(e._elements,o,i):ut(a,o,i)}else if(Array.isArray(t)&&e._elements)for(let r=0;r<t.length;r++)ut(e._elements,t[r],`${n}[${r}]`)}function ct(e,t,n){t&&lt(e,[{Array:Ne,Boolean:De,ConceptUuid:Le,Number:Re,Object:Me,String:Ie,UUID:Le,PersonAttributeTypeUuid:Le,PatientIdentifierTypeUuid:Le}[t]],n)}function lt(e,t,n){if(t)try{for(let r of t){const t=r(n);"string"==typeof t&&("object"==typeof n?console.error(`Invalid configuration for ${e}: ${t}`):console.error(`Invalid configuration value ${n} for ${e}: ${t}`))}}catch(t){console.error(`Skipping invalid validator at "${e}". Encountered error\n\t${t}`)}}He($e.getState(),Be.getState()),$e.subscribe((e=>He(e,Be.getState()))),Be.subscribe((e=>He($e.getState(),e))),Qe($e.getState(),Be.getState()),$e.subscribe((e=>Qe(e,Be.getState()))),Be.subscribe((e=>Qe($e.getState(),e))),Ge($e.getState(),Be.getState()),$e.subscribe((e=>Ge(e,Be.getState()))),Be.subscribe((e=>Ge($e.getState(),e))),Ye($e.getState(),Fe.getState(),Be.getState()),$e.subscribe((e=>{Ye(e,Fe.getState(),Be.getState())})),Fe.subscribe((e=>{Ye($e.getState(),e,Be.getState())})),Be.subscribe((e=>{Ye($e.getState(),Fe.getState(),e)}));const ft=(e,t)=>{const n=be(t);if(!e)return n;for(const t of Object.keys(e)){const r=n[t],o=e[t];if(o&&o.hasOwnProperty("_default")){n.hasOwnProperty(t)||(n[t]=o._default);const e=o._elements;if(r&&dt(e))if(o._type===Ae.Array&&Array.isArray(r)){const o=r.map((t=>ft(e,t)));n[t]=o}else if(o._type===Ae.Object)for(let t of Object.keys(r))r[t]=ft(e,r[t])}else if(pt(o)){const e=n.hasOwnProperty(t)?r:{};pt(e)&&(n[t]=ft(o,e))}}return n};function dt(e){return!!e&&Object.keys(e).filter((e=>!["_default","_validators"].includes(e))).length>0}function pt(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}const ht={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:Ae.Array,_default:[]}},"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:Ae.Object,_default:{}}};var yt=Object.freeze({__proto__:null,get start(){return Yn},get ensureJQuerySupport(){return kn},get setBootstrapMaxTime(){return an},get setMountMaxTime(){return sn},get setUnmountMaxTime(){return un},get setUnloadMaxTime(){return cn},get registerApplication(){return Mn},get unregisterApplication(){return Un},get getMountedApps(){return Dn},get getAppStatus(){return In},get unloadApplication(){return $n},get checkActivityFunctions(){return Ln},get getAppNames(){return Rn},get pathToActiveWhen(){return Kn},get navigateToUrl(){return gn},get triggerAppChange(){return qn},get addErrorHandler(){return St},get removeErrorHandler(){return Ot},get mountRootParcel(){return en},get NOT_LOADED(){return Pt},get LOADING_SOURCE_CODE(){return xt},get NOT_BOOTSTRAPPED(){return jt},get BOOTSTRAPPING(){return Tt},get NOT_MOUNTED(){return At},get MOUNTING(){return Ct},get UPDATING(){return Dt},get LOAD_ERROR(){return It},get MOUNTED(){return Nt},get UNMOUNTING(){return Rt},get SKIP_BECAUSE_BROKEN(){return Mt}});function mt(e){return(mt="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)}function gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vt=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{}).CustomEvent,bt=function(){try{var e=new vt("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?vt:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},wt=[];function _t(e,t,n){var r=kt(e,t,n);wt.length?wt.forEach((function(e){return e(r)})):setTimeout((function(){throw r}))}function St(e){if("function"!=typeof e)throw Error(Et(28,!1));wt.push(e)}function Ot(e){if("function"!=typeof e)throw Error(Et(29,!1));var t=!1;return wt=wt.filter((function(n){var r=n===e;return t=t||r,!r})),t}function Et(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(e,": ").concat(t?t+" ":"","See https://single-spa.js.org/error/?code=").concat(e).concat(r.length?"&arg=".concat(r.join("&arg=")):"")}function kt(e,t,n){var r,o="".concat(Ft(t)," '").concat($t(t),"' died in status ").concat(t.status,": ");if(e instanceof Error){try{e.message=o+e.message}catch(e){}r=e}else{console.warn(Et(30,!1,t.status,$t(t)));try{r=Error(o+JSON.stringify(e))}catch(t){r=e}}return r.appOrParcelName=$t(t),t.status=n,r}var Pt="NOT_LOADED",xt="LOADING_SOURCE_CODE",jt="NOT_BOOTSTRAPPED",Tt="BOOTSTRAPPING",At="NOT_MOUNTED",Ct="MOUNTING",Nt="MOUNTED",Dt="UPDATING",Rt="UNMOUNTING",It="LOAD_ERROR",Mt="SKIP_BECAUSE_BROKEN";function Lt(e){return e.status===Nt}function Ut(e){try{return e.activeWhen(window.location)}catch(t){return _t(t,e,Mt),!1}}function $t(e){return e.name}function Bt(e){return Boolean(e.unmountThisParcel)}function Ft(e){return Bt(e)?"parcel":"application"}function Kt(){for(var e=arguments.length-1;e>0;e--)for(var t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]}function zt(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}function Wt(e){return e&&("function"==typeof e||(t=e,Array.isArray(t)&&!zt(t,(function(e){return"function"!=typeof e}))));var t}function Vt(e,t){var n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=Ft(e),o=$t(e);return function(e){return n.reduce((function(n,i,a){return n.then((function(){var n=i(e);return qt(n)?n:Promise.reject(Et(15,!1,r,o,t,a))}))}),Promise.resolve())}}function qt(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}function Ht(e,t){return Promise.resolve().then((function(){return e.status!==jt?e:(e.status=Tt,e.bootstrap?ln(e,"bootstrap").then(n).catch((function(n){if(t)throw kt(n,e,Mt);return _t(n,e,Mt),e})):Promise.resolve().then(n))}));function n(){return e.status=At,e}}function Gt(e,t){return Promise.resolve().then((function(){if(e.status!==Nt)return e;e.status=Rt;var n=Object.keys(e.parcels).map((function(t){return e.parcels[t].unmountThisParcel()}));return Promise.all(n).then(r,(function(n){return r().then((function(){var r=Error(n.message);if(t)throw kt(r,e,Mt);_t(r,e,Mt)}))})).then((function(){return e}));function r(){return ln(e,"unmount").then((function(){e.status=At})).catch((function(n){if(t)throw kt(n,e,Mt);_t(n,e,Mt)}))}}))}var Qt=!1,Yt=!1;function Jt(e,t){return Promise.resolve().then((function(){return e.status!==At?e:(Qt||(window.dispatchEvent(new bt("single-spa:before-first-mount")),Qt=!0),ln(e,"mount").then((function(){return e.status=Nt,Yt||(window.dispatchEvent(new bt("single-spa:first-mount")),Yt=!0),e})).catch((function(n){return e.status=Nt,Gt(e,!0).then(r,r);function r(){if(t)throw kt(n,e,Mt);return _t(n,e,Mt),e}})))}))}var Xt=0,Zt={parcels:{}};function en(){return tn.apply(Zt,arguments)}function tn(e,t){var n=this;if(!e||"object"!==mt(e)&&"function"!=typeof e)throw Error(Et(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(Et(3,!1,mt(e.name)));if("object"!==mt(t))throw Error(Et(4,!1,name,mt(t)));if(!t.domElement)throw Error(Et(5,!1,name));var r,o=Xt++,i="function"==typeof e,a=i?e:function(){return Promise.resolve(e)},s={id:o,parcels:{},status:i?xt:jt,customProps:t,parentName:$t(n),unmountThisParcel:function(){return d.then((function(){if(s.status!==Nt)throw Error(Et(6,!1,name,s.status));return Gt(s,!0)})).then((function(e){return s.parentName&&delete n.parcels[s.id],e})).then((function(e){return c(e),e})).catch((function(e){throw s.status=Mt,l(e),e}))}};n.parcels[o]=s;var u=a();if(!u||"function"!=typeof u.then)throw Error(Et(7,!1));var c,l,f=(u=u.then((function(e){if(!e)throw Error(Et(8,!1));var t=e.name||"parcel-".concat(o);if(Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!Wt(e.bootstrap))throw Error(Et(9,!1,t));if(!Wt(e.mount))throw Error(Et(10,!1,t));if(!Wt(e.unmount))throw Error(Et(11,!1,t));if(e.update&&!Wt(e.update))throw Error(Et(12,!1,t));var n=Vt(e,"bootstrap"),i=Vt(e,"mount"),a=Vt(e,"unmount");s.status=jt,s.name=t,s.bootstrap=n,s.mount=i,s.unmount=a,s.timeouts=fn(e.timeouts),e.update&&(s.update=Vt(e,"update"),r.update=function(e){return s.customProps=e,nn(function(e){return Promise.resolve().then((function(){if(e.status!==Nt)throw Error(Et(32,!1,$t(e)));return e.status=Dt,ln(e,"update").then((function(){return e.status=Nt,e})).catch((function(t){throw kt(t,e,Mt)}))}))}(s))})}))).then((function(){return Ht(s,!0)})),d=f.then((function(){return Jt(s,!0)})),p=new Promise((function(e,t){c=e,l=t}));return r={mount:function(){return nn(Promise.resolve().then((function(){if(s.status!==At)throw Error(Et(13,!1,name,s.status));return n.parcels[o]=s,Jt(s)})))},unmount:function(){return nn(s.unmountThisParcel())},getStatus:function(){return s.status},loadPromise:nn(u),bootstrapPromise:nn(f),mountPromise:nn(d),unmountPromise:nn(p)}}function nn(e){return e.then((function(){return null}))}function rn(e){var t=$t(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!==mt(n)||null===n||Array.isArray(n))&&(n={},console.warn(Et(40,!1),t,n));var r=Kt({},n,{name:t,mountParcel:tn.bind(e),singleSpa:yt});return Bt(e)&&(r.unmountSelf=e.unmountThisParcel),r}var on={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function an(e,t,n){if("number"!=typeof e||e<=0)throw Error(Et(16,!1));on.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function sn(e,t,n){if("number"!=typeof e||e<=0)throw Error(Et(17,!1));on.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function un(e,t,n){if("number"!=typeof e||e<=0)throw Error(Et(18,!1));on.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function cn(e,t,n){if("number"!=typeof e||e<=0)throw Error(Et(19,!1));on.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function ln(e,t){var n=e.timeouts[t],r=n.warningMillis,o=Ft(e);return new Promise((function(i,a){var s=!1,u=!1;e[t](rn(e)).then((function(e){s=!0,i(e)})).catch((function(e){s=!0,a(e)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=Et(31,!1,t,o,$t(e),n.millis);function l(e){if(!s)if(!0===e)u=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!u){var t=e,o=t*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(t+1)}),r)}}}))}function fn(e){var t={};for(var n in on)t[n]=Kt({},on[n],e&&e[n]||{});return t}function dn(e){return Promise.resolve().then((function(){return e.loadPromise?e.loadPromise:e.status!==Pt&&e.status!==It?e:(e.status=xt,e.loadPromise=Promise.resolve().then((function(){var r=e.loadApp(rn(e));if(!qt(r))throw n=!0,Error(Et(33,!1,$t(e)));return r.then((function(n){var r;e.loadErrorTime=null,"object"!==mt(t=n)&&(r=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!Wt(t.bootstrap)&&(r=35),Wt(t.mount)||(r=36),Wt(t.unmount)||(r=37);var o=Ft(t);if(r){var i;try{i=JSON.stringify(t)}catch(e){}return console.error(Et(r,!1,o,$t(e),i),t),_t(void 0,e,Mt),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=Kt({},e.devtools.overlays,t.devtools.overlays)),e.status=jt,e.bootstrap=Vt(t,"bootstrap"),e.mount=Vt(t,"mount"),e.unmount=Vt(t,"unmount"),e.unload=Vt(t,"unload"),e.timeouts=fn(t.timeouts),delete e.loadPromise,e}))})).catch((function(t){var r;return delete e.loadPromise,n?r=Mt:(r=It,e.loadErrorTime=(new Date).getTime()),_t(t,e,r),e})));var t,n}))}var pn,hn="undefined"!=typeof window,yn={hashchange:[],popstate:[]},mn=["hashchange","popstate"];function gn(e){var t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(Et(14,!1));t=e.currentTarget.href,e.preventDefault()}var n=On(window.location.href),r=On(t);0===t.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)}function vn(e){var t=this;if(e){var n=e[0].type;mn.indexOf(n)>=0&&yn[n].forEach((function(n){try{n.apply(t,e)}catch(e){setTimeout((function(){throw e}))}}))}}function bn(){Hn([],arguments)}function wn(e,t){return function(){var n=window.location.href,r=e.apply(this,arguments),o=window.location.href;return pn&&n===o||(Jn()?window.dispatchEvent(function(e,t){var n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)):Hn([])),r}}if(hn){window.addEventListener("hashchange",bn),window.addEventListener("popstate",bn);var _n=window.addEventListener,Sn=window.removeEventListener;window.addEventListener=function(e,t){if(!("function"==typeof t&&mn.indexOf(e)>=0)||zt(yn[e],(function(e){return e===t})))return _n.apply(this,arguments);yn[e].push(t)},window.removeEventListener=function(e,t){if(!("function"==typeof t&&mn.indexOf(e)>=0))return Sn.apply(this,arguments);yn[e]=yn[e].filter((function(e){return e!==t}))},window.history.pushState=wn(window.history.pushState,"pushState"),window.history.replaceState=wn(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn(Et(41,!1)):window.singleSpaNavigate=gn}function On(e){var t=document.createElement("a");return t.href=e,t}var En=!1;function kn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!En){var t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return Pn.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return Pn.call(this,n,window.removeEventListener,e,t,arguments)},En=!0}}function Pn(e,t,n,r,o){return"string"!=typeof n?e.apply(this,o):(n.split(/\s+/).forEach((function(e){mn.indexOf(e)>=0&&(t(e,r),n=n.replace(e,""))})),""===n.trim()?this:e.apply(this,o))}var xn={};function jn(e){return Promise.resolve().then((function(){var t=xn[$t(e)];if(!t)return e;if(e.status===Pt)return Tn(e,t),e;if("UNLOADING"===e.status)return t.promise.then((function(){return e}));if(e.status!==At&&e.status!==It)return e;var n=e.status===It?Promise.resolve():ln(e,"unload");return e.status="UNLOADING",n.then((function(){return Tn(e,t),e})).catch((function(n){return function(e,t,n){delete xn[$t(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,_t(n,e,Mt),t.reject(n)}(e,t,n),e}))}))}function Tn(e,t){delete xn[$t(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=Pt,t.resolve()}function An(e,t,n,r){xn[$t(e)]={app:e,resolve:n,reject:r},Object.defineProperty(xn[$t(e)],"promise",{get:t})}function Cn(e){return xn[e]}var Nn=[];function Dn(){return Nn.filter(Lt).map($t)}function Rn(){return Nn.map($t)}function In(e){var t=zt(Nn,(function(t){return $t(t)===e}));return t?t.status:null}function Mn(e,t,n,r){var o=function(e,t,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===mt(e)?(function(e){if(Array.isArray(e)||null===e)throw Error(Et(39,!1));var t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((function(e,n){return t.indexOf(n)>=0?e:e.concat(n)}),[]);if(0!==n.length)throw Error(Et(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length)throw Error(Et(20,!1));if("object"!==mt(e.app)&&"function"!=typeof e.app)throw Error(Et(20,!1));var r=function(e){return"string"==typeof e||"function"==typeof e};if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error(Et(24,!1));if(!Fn(e.customProps))throw Error(Et(22,!1))}(e),i.name=e.name,i.loadApp=e.app,i.activeWhen=e.activeWhen,i.customProps=e.customProps):(function(e,t,n,r){if("string"!=typeof e||0===e.length)throw Error(Et(20,!1));if(!t)throw Error(Et(23,!1));if("function"!=typeof n)throw Error(Et(24,!1));if(!Fn(r))throw Error(Et(22,!1))}(e,t,n,r),i.name=e,i.loadApp=t,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(e){return e||{}}(i.customProps),i.activeWhen=function(e){var t=Array.isArray(e)?e:[e];return t=t.map((function(e){return"function"==typeof e?e:Kn(e)})),function(e){return t.some((function(t){return t(e)}))}}(i.activeWhen),i}(e,t,n,r);if(-1!==Rn().indexOf(o.name))throw Error(Et(21,!1,o.name));Nn.push(Kt({loadErrorTime:null,status:Pt,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),hn&&(kn(),Hn())}function Ln(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return Nn.filter((function(t){return t.activeWhen(e)})).map($t)}function Un(e){if(0===Nn.filter((function(t){return $t(t)===e})).length)throw Error(Et(25,!1,e));return $n(e).then((function(){var t=Nn.map($t).indexOf(e);Nn.splice(t,1)}))}function $n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof e)throw Error(Et(26,!1));var n=zt(Nn,(function(t){return $t(t)===e}));if(!n)throw Error(Et(27,!1,e));var r,o=Cn($t(n));if(t&&t.waitForUnmount){if(o)return o.promise;var i=new Promise((function(e,t){An(n,(function(){return i}),e,t)}));return i}return o?(r=o.promise,Bn(n,o.resolve,o.reject)):r=new Promise((function(e,t){An(n,(function(){return r}),e,t),Bn(n,e,t)})),r}function Bn(e,t,n){Gt(e).then(jn).then((function(){t(),setTimeout((function(){Hn()}))})).catch(n)}function Fn(e){return!e||"function"==typeof e||"object"===mt(e)&&null!==e&&!Array.isArray(e)}function Kn(e,t){var n=function(e,t){var n=0,r=!1,o="^";"/"!==e[0]&&(e="/"+e);for(var i=0;i<e.length;i++){var a=e[i];(!r&&":"===a||r&&"/"===a)&&s(i)}return s(e.length),new RegExp(o,"i");function s(i){var a=e.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===e.length)if(r)t&&(o+="$");else{var s=t?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(s,"$"):"".concat(o,"(/").concat(s,")?(#.*)?$")}r=!r,n=i}}(e,t);return function(e){var t=e.origin;t||(t="".concat(e.protocol,"//").concat(e.host));var r=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(r)}}var zn=!1,Wn=[],Vn=hn&&window.location.href;function qn(){return Hn()}function Hn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if(zn)return new Promise((function(e,n){Wn.push({resolve:e,reject:n,eventArguments:t})}));var n,r=function(){var e=[],t=[],n=[],r=[],o=(new Date).getTime();return Nn.forEach((function(i){var a=i.status!==Mt&&Ut(i);switch(i.status){case It:a&&o-i.loadErrorTime>=200&&n.push(i);break;case Pt:case xt:a&&n.push(i);break;case jt:case At:!a&&Cn($t(i))?e.push(i):a&&r.push(i);break;case Nt:a||t.push(i)}})),{appsToUnload:e,appsToUnmount:t,appsToLoad:n,appsToMount:r}}(),o=r.appsToUnload,i=r.appsToUnmount,a=r.appsToLoad,s=r.appsToMount,u=!1,c=Vn,l=Vn=window.location.href;return Jn()?(zn=!0,n=o.concat(a,i,s),Promise.resolve().then((function(){if(window.dispatchEvent(new bt(0===n.length?"single-spa:before-no-app-change":"single-spa:before-app-change",h(!0))),window.dispatchEvent(new bt("single-spa:before-routing-event",h(!0,{cancelNavigation:f}))),u)return window.dispatchEvent(new bt("single-spa:before-mount-routing-event",h(!0))),d(),void gn(c);var t=o.map(jn),r=i.map(Gt).map((function(e){return e.then(jn)})).concat(t),l=Promise.all(r);l.then((function(){window.dispatchEvent(new bt("single-spa:before-mount-routing-event",h(!0)))}));var y=a.map((function(e){return dn(e).then((function(e){return Gn(e,l)}))})),m=s.filter((function(e){return a.indexOf(e)<0})).map((function(e){return Gn(e,l)}));return l.catch((function(e){throw p(),e})).then((function(){return p(),Promise.all(y.concat(m)).catch((function(t){throw e.forEach((function(e){return e.reject(t)})),t})).then(d)}))}))):(n=a,Promise.resolve().then((function(){var e=a.map(dn);return Promise.all(e).then(p).then((function(){return[]})).catch((function(e){throw p(),e}))})));function f(){u=!0}function d(){var t=Dn();e.forEach((function(e){return e.resolve(t)}));try{var r=0===n.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new bt(r,h())),window.dispatchEvent(new bt("single-spa:routing-event",h()))}catch(e){setTimeout((function(){throw e}))}if(zn=!1,Wn.length>0){var o=Wn;Wn=[],Hn(o)}return t}function p(){e.forEach((function(e){vn(e.eventArguments)})),vn(t)}function h(){var e,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],f=arguments.length>1?arguments[1]:void 0,d={},p=(gt(e={},Nt,[]),gt(e,At,[]),gt(e,Pt,[]),gt(e,Mt,[]),e);r?(a.concat(s).forEach((function(e,t){y(e,Nt)})),o.forEach((function(e){y(e,Pt)})),i.forEach((function(e){y(e,At)}))):n.forEach((function(e){y(e)}));var h={detail:{newAppStatuses:d,appsByNewStatus:p,totalAppChanges:n.length,originalEvent:null==t?void 0:t[0],oldUrl:c,newUrl:l,navigationIsCanceled:u}};return f&&Kt(h.detail,f),h;function y(e,t){var n=$t(e);t=t||In(n),d[n]=t,(p[t]=p[t]||[]).push(n)}}}function Gn(e,t){return Ut(e)?Ht(e).then((function(e){return t.then((function(){return Ut(e)?Jt(e):e}))})):t.then((function(){return e}))}var Qn=!1;function Yn(e){var t;Qn=!0,e&&e.urlRerouteOnly&&(t=e.urlRerouteOnly,pn=t),hn&&Hn()}function Jn(){return Qn}hn&&setTimeout((function(){Qn||console.warn(Et(1,!1))}),5e3);var Xn={getRawAppData:function(){return[].concat(Nn)},reroute:Hn,NOT_LOADED:Pt,toLoadPromise:dn,toBootstrapPromise:Ht,unregisterApplication:Un};function Zn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}hn&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Xn);const er=e=>{const t=e.concat(["openmrsBase","openmrsSpaBase"]);return Ce((e=>{if(!e||"string"!=typeof e)return!1;const n=/\${(.*?)}/g;let r=n.exec(e);for(;r;){if(!t.includes(r[1]))return!1;r=n.exec(e)}return!0}),"Should be a URL or path. The allowed template parameters are "+t.map((e=>"${"+e+"}")).join(", "))},tr={inRange:(e,t)=>Ce((n=>e<=n&&n<=t),`must be between ${e} and ${t}`),isUrl:er([]),isUrlWithTemplateParameters:er,oneOf:e=>Ce((t=>e.includes(t)),`Must be one of the following: '${e.join("', '")}'.`)};function nr(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function rr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const or="/ws/rest/v1/",ir="/ws/fhir2/R4",ar=`${or}session`;function sr(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)}function ur(e,t={}){if("string"!=typeof e)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof t)throw Error("The second argument to @openmrs/api's openmrsFetch function must be a plain object.");if(!window.openmrsBase)throw Error("@openmrs/api is running in a browser that doesn't have window.openmrsBase, which is provided by openmrs-module-spa's HTML file.");let n=sr(e);if(t.headers||(t.headers={}),z(t.body)&&(t.body=JSON.stringify(t.body)),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),null===t.headers.Accept&&delete t.headers.Accept,e.startsWith(or)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(ir)){const e=new URL(n,window.location.toString());e.searchParams.has("_summary")||(e.searchParams.set("_summary","data"),n=e.toString())}const r=Error();return window.fetch(n,t).then((o=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){nr(i,r,o,a,s,"next",e)}function s(e){nr(i,r,o,a,s,"throw",e)}a(void 0)}))}}((function*(e){const t=e;if(t.ok)return 204===t.status?(t.data=null,t):t.clone().text().then((e=>{try{e&&(t.data=JSON.parse(e))}catch(e){}return t}));{const{redirectAuthFailure:e}=yield new Promise((e=>{const t=Ke("@openmrs/esm-api");function n(t){if(t.loaded&&t.config){const n=ge(["Display conditions","Translation overrides"],t.config);e(n),r&&r()}}n(t.getState());const r=t.subscribe(n)}));return n===sr(ar)&&403===t.status||e.enabled&&e.errors.includes(t.status)?(function({to:e,templateParams:t}){const n=window.getOpenmrsSpaBase().replace(/\/$/,""),r=function(e,t){const n=window.getOpenmrsSpaBase().replace(/\/$/,"");return function(e,t){return Object.keys(t).reduce(((e,n)=>e.split("${"+n+"}").join(t[n])),e)}(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Zn(e,t,n[t])}))}return e}({openmrsBase:window.openmrsBase,openmrsSpaBase:n},t)).replace(/^\/\//,"/")}(e,t);r.startsWith(n)?gn(r):window.location.assign(r)}({to:e.url}),e.resolvePromise?Promise.resolve():new Promise((()=>{}))):t.clone().text().then((e=>{let o=e;try{o=JSON.parse(e)}catch(e){}throw new lr(n,t,o,r)}),(e=>{throw new lr(n,t,null,r)}))}})),function(e){return o.apply(this,arguments)}));var o}function cr(e,t={}){if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");const n=new AbortController;return t.signal=n.signal,new E((r=>{let o=!1;return ur(e,t).then((e=>{o=!0,r.next(e),r.complete()}),(e=>{o=!0,r.error(e)})),()=>{o||n.abort()}}))}let lr=class extends Error{constructor(e,t,n,r){super(),rr(this,"response",void 0),rr(this,"responseBody",void 0),this.message=`Server responded with ${t.status} (${t.statusText}) for url ${e}. Check err.responseBody or network tab in dev tools for more info`,r.message=this.message,this.responseBody=n,this.response=t,this.stack=`Stacktrace for outgoing request:\n${r.stack}\nStacktrace for incoming response:\n${this.stack}`}};var fr=r(151);const dr=function(e){return void 0===e};function pr(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}const hr=(0,Ue.createGlobalStore)("session",{loaded:!1,session:null});let yr=0;function mr(e={includeAuthStatus:!0}){return(yr<Date.now()-6e4||!hr.getState().loaded)&&vr(),new E((t=>{const n=n=>{var r;n.loaded&&(e.includeAuthStatus?t.next(n.session):t.next(null===(r=n.session)||void 0===r?void 0:r.user))};return n(hr.getState()),hr.subscribe(n)}))}function gr(){return(yr<Date.now()-6e4||!hr.getState().loaded)&&vr(),hr}function vr(){return new Promise(((e,t)=>{yr=Date.now(),ur(ar).then((n=>{if("object"!=typeof(null==n?void 0:n.data))return t(),Promise.reject();!function(e){var t,n,r;const o=null!==(r=null==e||null===(t=e.user)||void 0===t||null===(n=t.userProperties)||void 0===n?void 0:n.defaultLocale)&&void 0!==r?r:e.locale;o!==document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",o)}(n.data),e(n.data),hr.setState({loaded:!0,session:n.data})})).catch((e=>((0,fr.reportError)(`Failed to fetch new session information: ${e}`),t(e),{sessionId:"",authenticated:!1})))}))}function br(){hr.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})}function wr(e,t){return void 0===t?Boolean(e):!Boolean(e)||function(e,t){return"string"==typeof e?!dr(t.privileges.find((t=>e===t.display))):Array.isArray(e)?e.every((e=>!dr(t.privileges.find((t=>e===t.display))))):(dr(e)||console.error(`Could not understand privileges "${e}"`),!0)}(e,t)||function(e){return!dr(e.roles.find((e=>"System Developer"===e.display)))}(t)}function _r(){let e,t;return new Promise(((n,r)=>{const o=r=>{r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};o(hr.getState()),e||(t=hr.subscribe(o))}))}function Sr(){return new Promise(((e,t)=>{mr().subscribe((t=>{e(t.sessionLocation)}),t).unsubscribe()}))}function Or(e,t){return Er.apply(this,arguments)}function Er(){return Er=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){pr(i,r,o,a,s,"next",e)}function s(e){pr(i,r,o,a,s,"throw",e)}a(void 0)}))}}((function*(e,t){yield ur(ar,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal}),yield vr()})),Er.apply(this,arguments)}function kr(){!function(e,t){nt(e,t);const n=me(t,ht),r=$e.getState();$e.setState({schemas:qe(Ve({},r.schemas),{[e]:n})})}("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:Ae.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:Ae.String,_default:"${openmrsSpaBase}/login",_validators:[tr.isUrl]},errors:{_type:Ae.Array,_default:[401],_elements:{_type:Ae.Number,_validators:[tr.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:Ae.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}}}),vr()}try{self["workbox:window:6.5.3"]&&_()}catch(mt){}function Pr(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))}function xr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}try{self["workbox:core:6.5.3"]&&_()}catch(mt){}var jr=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))};function Tr(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href}var Ar=function(e,t){this.type=e,Object.assign(this,t)};function Cr(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Nr(){}var Dr={type:"SKIP_WAITING"};function Rr(e,t){if(!t)return e&&e.then?e.then(Nr):Promise.resolve()}!function(e){var t,n;function r(t,n){var r,o;return void 0===n&&(n={}),(r=e.call(this)||this).nn={},r.tn=0,r.rn=new jr,r.en=new jr,r.on=new jr,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!Tr(t.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=t,e.removeEventListener("updatefound",r.cn)):(r.hn=t,r.an.add(t),r.rn.resolve(t)),++r.tn,t.addEventListener("statechange",r.ln)},r.ln=function(e){var t=r.fn,n=e.target,o=n.state,i=n===r.vn,a={sw:n,isExternal:i,originalEvent:e};!i&&r.mn&&(a.isUpdate=!0),r.dispatchEvent(new Ar(o,a)),"installed"===o?r.wn=self.setTimeout((function(){"installed"===o&&t.waiting===n&&r.dispatchEvent(new Ar("waiting",a))}),200):"activating"===o&&(clearTimeout(r.wn),i||r.en.resolve(n))},r.dn=function(e){var t=r.hn,n=t!==navigator.serviceWorker.controller;r.dispatchEvent(new Ar("controlling",{isExternal:n,originalEvent:e,sw:t,isUpdate:r.mn})),n||r.on.resolve(t)},r.gn=(o=function(e){var t=e.data,n=e.ports,o=e.source;return Cr(r.getSW(),(function(){r.an.has(o)&&r.dispatchEvent(new Ar("message",{data:t,originalEvent:e,ports:n,sw:o}))}))},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(o.apply(this,e))}catch(e){return Promise.reject(e)}}),r.sn=t,r.nn=n,navigator.serviceWorker.addEventListener("message",r.gn),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o,i=r.prototype;i.register=function(e){var t=(void 0===e?{}:e).immediate,n=void 0!==t&&t;try{var r=this;return function(e,t){var n=e();return n&&n.then?n.then(t):t()}((function(){if(!n&&"complete"!==document.readyState)return Rr(new Promise((function(e){return window.addEventListener("load",e)})))}),(function(){return r.mn=Boolean(navigator.serviceWorker.controller),r.yn=r.pn(),Cr(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 t=r.fn.waiting;return t&&Tr(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then((function(){r.dispatchEvent(new Ar("waiting",{sw:t,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)}},i.update=function(){try{return this.fn?Rr(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},i.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},i.messageSW=function(e){try{return Cr(this.getSW(),(function(t){return Pr(t,e)}))}catch(e){return Promise.reject(e)}},i.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&Pr(this.fn.waiting,Dr)},i.pn=function(){var e=navigator.serviceWorker.controller;return e&&Tr(e.scriptURL,this.sn.toString())?e:void 0},i.bn=function(){try{var e=this;return function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return Cr(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}),(function(e){throw e}))}catch(e){return Promise.reject(e)}},(o=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,o)}(function(){function e(){this.Pn=new Map}var t=e.prototype;return t.addEventListener=function(e,t){this.Sn(e).add(t)},t.removeEventListener=function(e,t){this.Sn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,n=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return xr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xr(e,t):void 0}}(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(this.Sn(e.type));!(t=n()).done;)(0,t.value)(e)},t.Sn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}());const Ir="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,Mr=Object.keys,Lr=Array.isArray;function Ur(e,t){return"object"!=typeof t||Mr(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||Ir.Promise||(Ir.Promise=Promise);const $r=Object.getPrototypeOf,Br={}.hasOwnProperty;function Fr(e,t){return Br.call(e,t)}function Kr(e,t){"function"==typeof t&&(t=t($r(e))),("undefined"==typeof Reflect?Mr:Reflect.ownKeys)(t).forEach((n=>{Wr(e,n,t[n])}))}const zr=Object.defineProperty;function Wr(e,t,n,r){zr(e,t,Ur(n&&Fr(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function Vr(e){return{from:function(t){return e.prototype=Object.create(t.prototype),Wr(e.prototype,"constructor",e),{extend:Kr.bind(null,e.prototype)}}}}const qr=Object.getOwnPropertyDescriptor;function Hr(e,t){let n;return qr(e,t)||(n=$r(e))&&Hr(n,t)}const Gr=[].slice;function Qr(e,t,n){return Gr.call(e,t,n)}function Yr(e,t){return t(e)}function Jr(e){if(!e)throw new Error("Assertion Failed")}function Xr(e){Ir.setImmediate?setImmediate(e):setTimeout(e,0)}function Zr(e,t){return e.reduce(((e,n,r)=>{var o=t(n,r);return o&&(e[o[0]]=o[1]),e}),{})}function eo(e,t){if(Fr(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,o=t.length;r<o;++r){var i=eo(e,t[r]);n.push(i)}return n}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return void 0===s?void 0:eo(s,t.substr(a+1))}}function to(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){Jr("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)to(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var a=t.substr(0,i),s=t.substr(i+1);if(""===s)void 0===n?Lr(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n;else{var u=e[a];u&&Fr(e,a)||(u=e[a]={}),to(u,s,n)}}else void 0===n?Lr(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function no(e){var t={};for(var n in e)Fr(e,n)&&(t[n]=e[n]);return t}const ro=[].concat;function oo(e){return ro.apply([],e)}const io="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(oo([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>Ir[e])),ao=io.map((e=>Ir[e]));Zr(io,(e=>[e,!0]));let so=null;function uo(e){so="undefined"!=typeof WeakMap&&new WeakMap;const t=co(e);return so=null,t}function co(e){if(!e||"object"!=typeof e)return e;let t=so&&so.get(e);if(t)return t;if(Lr(e)){t=[],so&&so.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(co(e[n]))}else if(ao.indexOf(e.constructor)>=0)t=e;else{const n=$r(e);for(var o in t=n===Object.prototype?{}:Object.create(n),so&&so.set(e,t),e)Fr(e,o)&&(t[o]=co(e[o]))}return t}const{toString:lo}={};function fo(e){return lo.call(e).slice(8,-1)}const po="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",ho="symbol"==typeof po?function(e){var t;return null!=e&&(t=e[po])&&t.apply(e)}:function(){return null},yo={};function mo(e){var t,n,r,o;if(1===arguments.length){if(Lr(e))return e.slice();if(this===yo&&"string"==typeof e)return[e];if(o=ho(e)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}const go="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var vo="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function bo(e,t){vo=e,wo=t}var wo=()=>!0;const _o=!new Error("").stack;function So(){if(_o)try{throw So.arguments,new Error}catch(e){return e}return new Error}function Oo(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(wo).map((e=>"\n"+e)).join("")):""}var Eo=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ko=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Eo),Po={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 xo(e,t){this._e=So(),this.name=e,this.message=t}function jo(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,n)=>n.indexOf(e)===t)).join("\n")}function To(e,t,n,r){this._e=So(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=jo(e,t)}function Ao(e,t){this._e=So(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=jo(e,t)}Vr(xo).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+Oo(this._e,2))}},toString:function(){return this.name+": "+this.message}}),Vr(To).from(xo),Vr(Ao).from(xo);var Co=ko.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const No=xo;var Do=ko.reduce(((e,t)=>{var n=t+"Error";function r(e,r){this._e=So(),this.name=n,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=Po[t]||n,this.inner=null)}return Vr(r).from(No),e[t]=r,e}),{});Do.Syntax=SyntaxError,Do.Type=TypeError,Do.Range=RangeError;var Ro=Eo.reduce(((e,t)=>(e[t+"Error"]=Do[t],e)),{}),Io=ko.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Do[t]),e)),{});function Mo(){}function Lo(e){return e}function Uo(e,t){return null==e||e===Lo?t:function(n){return t(e(n))}}function $o(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Bo(e,t){return e===Mo?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?$o(r,this.onsuccess):r),o&&(this.onerror=this.onerror?$o(o,this.onerror):o),void 0!==i?i:n}}function Fo(e,t){return e===Mo?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?$o(n,this.onsuccess):n),r&&(this.onerror=this.onerror?$o(r,this.onerror):r)}}function Ko(e,t){return e===Mo?t:function(n){var r=e.apply(this,arguments);Ur(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?$o(o,this.onsuccess):o),i&&(this.onerror=this.onerror?$o(i,this.onerror):i),void 0===r?void 0===a?void 0:a:Ur(r,a)}}function zo(e,t){return e===Mo?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function Wo(e,t){return e===Mo?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,o=arguments.length,i=new Array(o);o--;)i[o]=arguments[o];return n.then((function(){return t.apply(r,i)}))}return t.apply(this,arguments)}}Io.ModifyError=To,Io.DexieError=xo,Io.BulkError=Ao;var Vo={};const[qo,Ho,Go]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,$r(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,$r(t),e]})(),Qo=Ho&&Ho.then,Yo=qo&&qo.constructor,Jo=!!Go;var Xo=!1,Zo=Go?()=>{Go.then(Si)}:Ir.setImmediate?setImmediate.bind(null,Si):Ir.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{Si(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(Si,0)},ei=function(e,t){ci.push([e,t]),ni&&(Zo(),ni=!1)},ti=!0,ni=!0,ri=[],oi=[],ii=null,ai=Lo,si={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:qi,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{qi(e[0],e[1])}catch(e){}}))}},ui=si,ci=[],li=0,fi=[];function di(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=Mo,this._lib=!1;var t=this._PSD=ui;if(vo&&(this._stackHolder=So(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Vo)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&mi(this,this._value))}this._state=null,this._value=null,++t.ref,yi(this,e)}const pi={get:function(){var e=ui,t=Ni;function n(n,r){var o=!e.global&&(e!==ui||t!==Ni);const i=o&&!Mi();var a=new di(((t,a)=>{vi(this,new hi(Wi(n,e,o,i),Wi(r,e,o,i),t,a,e))}));return vo&&_i(a,this),a}return n.prototype=Vo,n},set:function(e){Wr(this,"then",e&&e.prototype===Vo?pi:{get:function(){return e},set:pi.set})}};function hi(e,t,n,r,o){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=o}function yi(e,t){try{t((t=>{if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&Oi();t&&"function"==typeof t.then?yi(e,((e,n)=>{t instanceof di?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,gi(e)),n&&Ei()}}),mi.bind(null,e))}catch(t){mi(e,t)}}function mi(e,t){if(oi.push(t),null===e._state){var n=e._lib&&Oi();t=ai(t),e._state=!1,e._value=t,vo&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){}}((()=>{var n=Hr(t,"stack");t._promise=e,Wr(t,"stack",{get:()=>Xo?n&&(n.get?n.get.apply(t):n.value):e.stack})})),function(e){ri.some((t=>t._value===e._value))||ri.push(e)}(e),gi(e),n&&Ei()}}function gi(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)vi(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===li&&(++li,ei((()=>{0==--li&&ki()}),[]))}function vi(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++li,ei(bi,[n,e,t])}else e._listeners.push(t)}function bi(e,t,n){try{ii=t;var r,o=t._value;t._state?r=e(o):(oi.length&&(oi=[]),r=e(o),-1===oi.indexOf(o)&&function(e){for(var t=ri.length;t;)if(ri[--t]._value===e._value)return void ri.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{ii=null,0==--li&&ki(),--n.psd.ref||n.psd.finalize()}}function wi(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var o,i,a=e._value;null!=a?(o=a.name||"Error",i=a.message||a,r=Oo(a,0)):(o=a,i=""),t.push(o+(i?": "+i:"")+r)}return vo&&((r=Oo(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&wi(e._prev,t,n)),t}function _i(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function Si(){Oi()&&Ei()}function Oi(){var e=ti;return ti=!1,ni=!1,e}function Ei(){var e,t,n;do{for(;ci.length>0;)for(e=ci,ci=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(ci.length>0);ti=!0,ni=!0}function ki(){var e=ri;ri=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=fi.slice(0),n=t.length;n;)t[--n]()}function Pi(e){return new di(Vo,!1,e)}function xi(e,t){var n=ui;return function(){var r=Oi(),o=ui;try{return Bi(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Bi(o,!1),r&&Ei()}}}Kr(di.prototype,{then:pi,_then:function(e,t){vi(this,new hi(null,null,e,t,ui))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(e=>e instanceof t?n(e):Pi(e))):this.then(null,(e=>e&&e.name===t?n(e):Pi(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),Pi(t))))},stack:{get:function(){if(this._stack)return this._stack;try{Xo=!0;var e=wi(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Xo=!1}}},timeout:function(e,t){return e<1/0?new di(((n,r)=>{var o=setTimeout((()=>r(new Do.Timeout(t))),e);this.then(n,r).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&Wr(di.prototype,Symbol.toStringTag,"Dexie.Promise"),si.env=Fi(),Kr(di,{all:function(){var e=mo.apply(null,arguments).map(Li);return new di((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(((o,i)=>di.resolve(o).then((n=>{e[i]=n,--r||t(e)}),n)))}))},resolve:e=>{if(e instanceof di)return e;if(e&&"function"==typeof e.then)return new di(((t,n)=>{e.then(t,n)}));var t=new di(Vo,!0,e);return _i(t,ii),t},reject:Pi,race:function(){var e=mo.apply(null,arguments).map(Li);return new di(((t,n)=>{e.map((e=>di.resolve(e).then(t,n)))}))},PSD:{get:()=>ui,set:e=>ui=e},totalEchoes:{get:()=>Ni},newPSD:Ri,usePSD:Ki,scheduler:{get:()=>ei,set:e=>{ei=e}},rejectionMapper:{get:()=>ai,set:e=>{ai=e}},follow:(e,t)=>new di(((n,r)=>Ri(((t,n)=>{var r=ui;r.unhandleds=[],r.onunhandled=n,r.finalize=$o((function(){!function(e){fi.push((function t(){e(),fi.splice(fi.indexOf(t),1)})),++li,ei((()=>{0==--li&&ki()}),[])}((()=>{0===this.unhandleds.length?t():n(this.unhandleds[0])}))}),r.finalize),e()}),t,n,r)))}),Yo&&(Yo.allSettled&&Wr(di,"allSettled",(function(){const e=mo.apply(null,arguments).map(Li);return new di((t=>{0===e.length&&t([]);let n=e.length;const r=new Array(n);e.forEach(((e,o)=>di.resolve(e).then((e=>r[o]={status:"fulfilled",value:e}),(e=>r[o]={status:"rejected",reason:e})).then((()=>--n||t(r)))))}))})),Yo.any&&"undefined"!=typeof AggregateError&&Wr(di,"any",(function(){const e=mo.apply(null,arguments).map(Li);return new di(((t,n)=>{0===e.length&&n(new AggregateError([]));let r=e.length;const o=new Array(r);e.forEach(((e,i)=>di.resolve(e).then((e=>t(e)),(e=>{o[i]=e,--r||n(new AggregateError(o))}))))}))})));const ji={awaits:0,echoes:0,id:0};var Ti=0,Ai=[],Ci=0,Ni=0,Di=0;function Ri(e,t,n,r){var o=ui,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++Di;var a=si.env;i.env=Jo?{Promise:di,PromiseProp:{value:di,configurable:!0,writable:!0},all:di.all,race:di.race,allSettled:di.allSettled,any:di.any,resolve:di.resolve,reject:di.reject,nthen:Vi(a.nthen,i),gthen:Vi(a.gthen,i)}:{},t&&Ur(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=Ki(i,e,n,r);return 0===i.ref&&i.finalize(),s}function Ii(){return ji.id||(ji.id=++Ti),++ji.awaits,ji.echoes+=100,ji.id}function Mi(){return!!ji.awaits&&(0==--ji.awaits&&(ji.id=0),ji.echoes=100*ji.awaits,!0)}function Li(e){return ji.echoes&&e&&e.constructor===Yo?(Ii(),e.then((e=>(Mi(),e)),(e=>(Mi(),Hi(e))))):e}function Ui(e){++Ni,ji.echoes&&0!=--ji.echoes||(ji.echoes=ji.id=0),Ai.push(ui),Bi(e,!0)}function $i(){var e=Ai[Ai.length-1];Ai.pop(),Bi(e,!1)}function Bi(e,t){var n=ui;if((t?!ji.echoes||Ci++&&e===ui:!Ci||--Ci&&e===ui)||zi(t?Ui.bind(null,e):$i),e!==ui&&(ui=e,n===si&&(si.env=Fi()),Jo)){var r=si.env.Promise,o=e.env;Ho.then=o.nthen,r.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(Ir,"Promise",o.PromiseProp),r.all=o.all,r.race=o.race,r.resolve=o.resolve,r.reject=o.reject,o.allSettled&&(r.allSettled=o.allSettled),o.any&&(r.any=o.any))}}function Fi(){var e=Ir.Promise;return Jo?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(Ir,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Ho.then,gthen:e.prototype.then}:{}}function Ki(e,t,n,r,o){var i=ui;try{return Bi(e,!0),t(n,r,o)}finally{Bi(i,!1)}}function zi(e){Qo.call(qo,e)}function Wi(e,t,n,r){return"function"!=typeof e?e:function(){var o=ui;n&&Ii(),Bi(t,!0);try{return e.apply(this,arguments)}finally{Bi(o,!1),r&&zi(Mi)}}}function Vi(e,t){return function(n,r){return e.call(this,Wi(n,t),Wi(r,t))}}function qi(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,o={promise:t,reason:e};if(Ir.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),Ur(r,o)):Ir.CustomEvent&&Ur(r=new CustomEvent("unhandledrejection",{detail:o}),o),r&&Ir.dispatchEvent&&(dispatchEvent(r),!Ir.PromiseRejectionEvent&&Ir.onunhandledrejection))try{Ir.onunhandledrejection(r)}catch(e){}vo&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+Qo).indexOf("[native code]")&&(Ii=Mi=Mo);var Hi=di.reject;function Gi(e,t,n,r){if(e.idbdb&&(e._state.openComplete||ui.letThrough||e._vip)){var o=e._createTransaction(t,n,e._dbSchema);try{o.create(),e._state.PR1398_maxLoop=3}catch(o){return o.name===Co.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Gi(e,t,n,r)))):Hi(o)}return o._promise(t,((e,t)=>Ri((()=>(ui.trans=o,r(e,t,o)))))).then((e=>o._completion.then((()=>e))))}if(e._state.openComplete)return Hi(new Do.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return Hi(new Do.DatabaseClosed);e.open().catch(Mo)}return e._state.dbReadyPromise.then((()=>Gi(e,t,n,r)))}const Qi=String.fromCharCode(65535),Yi="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Ji=[],Xi="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Zi=Xi,ea=Xi,ta=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function na(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const ra={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function oa(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=uo(t))[e],t)}let ia=class{_trans(e,t,n){const r=this._tx||ui.trans,o=this.name;function i(e,n,r){if(!r.schema[o])throw new Do.NotFound("Table "+o+" not part of transaction");return t(r.idbtrans,r)}const a=Oi();try{return r&&r.db===this.db?r===ui.trans?r._promise(e,i,n):Ri((()=>r._promise(e,i,n)),{trans:r,transless:ui.transless||ui}):Gi(this.db,e,[this.name],i)}finally{a&&Ei()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(t=>this.core.get({trans:t,key:e}).then((e=>this.hook.reading.fire(e))))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(Lr(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=Mr(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);const n=this.schema.indexes.concat(this.schema.primKey).filter((e=>e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))&&e.keyPath.every((e=>t.indexOf(e)>=0))))[0];if(n&&this.db._maxKey!==Qi)return this.where(n.name).equals(n.keyPath.map((t=>e[t])));!n&&vo&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);const{idxByName:r}=this.schema,o=this.db._deps.indexedDB;function i(e,t){try{return 0===o.cmp(e,t)}catch(e){return!1}}const[a,s]=t.reduce((([t,n],o)=>{const a=r[o],s=e[o];return[t||a,t||!a?na(n,a&&a.multi?e=>{const t=eo(e,o);return Lr(t)&&t.some((e=>i(s,e)))}:e=>i(s,eo(e,o))):n]}),[null,null]);return a?this.where(a.name).equals(e[a.keyPath]).filter(s):n?this.filter(s):this.where(t).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,Lr(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const t=t=>{if(!t)return t;const n=Object.create(e.prototype);for(var r in t)if(Fr(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}defineClass(){return this.mapToClass((function(e){Ur(this,e)}))}add(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let o=e;return r&&n&&(o=oa(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[o]}))).then((e=>e.numFailures?di.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{to(e,r,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||Lr(e))return this.where(":id").equals(e).modify(t);{const n=eo(e,this.schema.primKey.keyPath);if(void 0===n)return Hi(new Do.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?Mr(t).forEach((n=>{to(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}}put(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let o=e;return r&&n&&(o=oa(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[o],keys:null!=t?[t]:null}))).then((e=>e.numFailures?di.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{to(e,r,t)}catch(e){}return t}))}delete(e){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:[e]}))).then((e=>e.numFailures?di.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:ra}))).then((e=>e.numFailures?di.reject(e.failures[0]):void 0))}bulkGet(e){return this._trans("readonly",(t=>this.core.getMany({keys:e,trans:t}).then((e=>e.map((e=>this.hook.reading.fire(e)))))))}bulkAdd(e,t,n){const r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new Do.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new Do.InvalidArgument("Arguments objects and keys must have the same length");const a=e.length;let s=i&&n?e.map(oa(i)):e;return this.core.mutate({trans:t,type:"add",keys:r,values:s,wantResults:o}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new Ao(`${this.name}.bulkAdd(): ${e} of ${a} operations failed`,r)}))}))}bulkPut(e,t,n){const r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new Do.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new Do.InvalidArgument("Arguments objects and keys must have the same length");const a=e.length;let s=i&&n?e.map(oa(i)):e;return this.core.mutate({trans:t,type:"put",keys:r,values:s,wantResults:o}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new Ao(`${this.name}.bulkPut(): ${e} of ${a} operations failed`,r)}))}))}bulkDelete(e){const t=e.length;return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:e}))).then((({numFailures:e,lastResult:n,failures:r})=>{if(0===e)return n;throw new Ao(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,r)}))}};function aa(e){var t={},n=function(n,r){if(r){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return t[n].subscribe.apply(null,i),e}if("string"==typeof n)return t[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(e,r,o){if("object"==typeof e)return function(e){Mr(e).forEach((function(t){var n=e[t];if(Lr(n))i(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new Do.InvalidArgument("Invalid event config");var r=i(t,Lo,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){Xr((function(){e.apply(null,t)}))}))}))}}))}(e);r||(r=zo),o||(o=Mo);var a={subscribers:[],fire:o,subscribe:function(e){-1===a.subscribers.indexOf(e)&&(a.subscribers.push(e),a.fire=r(a.fire,e))},unsubscribe:function(e){a.subscribers=a.subscribers.filter((function(t){return t!==e})),a.fire=a.subscribers.reduce(r,o)}};return t[e]=n[e]=a,a}}function sa(e,t){return Vr(t).from({prototype:e}),t}function ua(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function ca(e,t){e.filter=na(e.filter,t)}function la(e,t,n){var r=e.replayFilter;e.replayFilter=r?()=>na(r(),t()):t,e.justLimit=n&&!r}function fa(e,t){if(e.isPrimKey)return t.primaryKey;const n=t.getIndexByKeyPath(e.index);if(!n)throw new Do.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function da(e,t,n){const r=fa(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function pa(e,t,n,r){const o=e.replayFilter?na(e.filter,e.replayFilter()):e.filter;if(e.or){const i={},a=(e,n,r)=>{if(!o||o(n,r,(e=>n.stop(e)),(e=>n.fail(e)))){var a=n.primaryKey,s=""+a;"[object ArrayBuffer]"===s&&(s=""+new Uint8Array(a)),Fr(i,s)||(i[s]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(a,n),ha(da(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return ha(da(e,r,n),na(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function ha(e,t,n,r){var o=xi(r?(e,t,o)=>n(r(e),t,o):n);return e.then((e=>{if(e)return e.start((()=>{var n=()=>e.continue();t&&!t(e,(e=>n=e),(t=>{e.stop(t),n=Mo}),(t=>{e.fail(t),n=Mo}))||o(e.value,e,(e=>n=e)),n()}))}))}function ya(e,t){try{const n=ma(e),r=ma(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){const n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return n===r?0:n<r?-1:1}(ga(e),ga(t));case"Array":return function(e,t){const n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n){const r=ya(e[n],t[n]);if(0!==r)return r}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function ma(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const n=fo(e);return"ArrayBuffer"===n?"binary":n}function ga(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}let va=class{_read(e,t){var n=this._ctx;return n.error?n.table._trans(null,Hi.bind(null,n.error)):n.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,Hi.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=na(t.algorithm,e)}_iterate(e,t){return pa(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&Ur(n,e),t._ctx=n,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((n=>pa(t,e,n,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,n=t.table.core;if(ua(t,!0))return n.count({trans:e,query:{index:fa(t,n.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var r=0;return pa(t,(()=>(++r,!1)),e,n).then((()=>r))})).then(e)}sortBy(e,t){const n=e.split(".").reverse(),r=n[0],o=n.length-1;function i(e,t){return t?i(e[n[t]],t-1):e[r]}var a="next"===this._ctx.dir?1:-1;function s(e,t){var n=i(e,o),r=i(t,o);return n<r?-a:n>r?a:0}return this.toArray((function(e){return e.sort(s)})).then(t)}toArray(e){return this._read((e=>{var t=this._ctx;if("next"===t.dir&&ua(t,!0)&&t.limit>0){const{valueMapper:n}=t,r=fa(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:r,range:t.range}}).then((({result:e})=>n?e.map(n):e))}{const n=[];return pa(t,(e=>n.push(e)),e,t.table.core).then((()=>n))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,ua(t)?la(t,(()=>{var t=e;return(e,n)=>0===t||(1===t?(--t,!1):(n((()=>{e.advance(t),t=0})),!1))})):la(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),la(this._ctx,(()=>{var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}until(e,t){return ca(this._ctx,(function(n,r,o){return!e(n.value)||(r(o),t)})),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 t,n;return ca(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=na(t.isMatch,n),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 t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}keys(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&ua(t,!0)&&t.limit>0)return this._read((e=>{var n=fa(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((({result:e})=>e)).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).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,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return ca(this._ctx,(function(e){var t=e.primaryKey.toString(),r=Fr(n,t);return n[t]=!0,!r})),this}modify(e){var t=this._ctx;return this._write((n=>{var r;if("function"==typeof e)r=e;else{var o=Mr(e),i=o.length;r=function(t){for(var n=!1,r=0;r<i;++r){var a=o[r],s=e[a];eo(t,a)!==s&&(to(t,a,s),n=!0)}return n}}const a=t.table.core,{outbound:s,extractKey:u}=a.schema.primaryKey,c=this.db._options.modifyChunkSize||200,l=[];let f=0;const d=[],p=(e,t)=>{const{failures:n,numFailures:r}=t;f+=e-r;for(let e of Mr(n))l.push(n[e])};return this.clone().primaryKeys().then((o=>{const i=l=>{const f=Math.min(c,o.length-l);return a.getMany({trans:n,keys:o.slice(l,l+f),cache:"immutable"}).then((d=>{const h=[],y=[],m=s?[]:null,g=[];for(let e=0;e<f;++e){const t=d[e],n={value:uo(t),primKey:o[l+e]};!1!==r.call(n,n.value,n)&&(null==n.value?g.push(o[l+e]):s||0===ya(u(t),u(n.value))?(y.push(n.value),s&&m.push(o[l+e])):(g.push(o[l+e]),h.push(n.value)))}const v=ua(t)&&t.limit===1/0&&("function"!=typeof e||e===ba)&&{index:t.index,range:t.range};return Promise.resolve(h.length>0&&a.mutate({trans:n,type:"add",values:h}).then((e=>{for(let t in e.failures)g.splice(parseInt(t),1);p(h.length,e)}))).then((()=>(y.length>0||v&&"object"==typeof e)&&a.mutate({trans:n,type:"put",keys:m,values:y,criteria:v,changeSpec:"function"!=typeof e&&e}).then((e=>p(y.length,e))))).then((()=>(g.length>0||v&&e===ba)&&a.mutate({trans:n,type:"delete",keys:g,criteria:v}).then((e=>p(g.length,e))))).then((()=>o.length>l+f&&i(l+c)))}))};return i(0).then((()=>{if(l.length>0)throw new To("Error modifying one or more objects",l,f,d);return o.length}))}))}))}delete(){var e=this._ctx,t=e.range;return ua(e)&&(e.isPrimKey&&!ea||3===t.type)?this._write((n=>{const{primaryKey:r}=e.table.core.schema,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then((t=>e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((({failures:e,lastResult:n,results:r,numFailures:o})=>{if(o)throw new To("Could not delete some values",Object.keys(e).map((t=>e[t])),t-o);return t-o}))))})):this.modify(ba)}};const ba=(e,t)=>t.value=null;function wa(e,t){return e<t?-1:e===t?0:1}function _a(e,t){return e>t?-1:e===t?0:1}function Sa(e,t,n){var r=e instanceof ja?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function Oa(e){return new e.Collection(e,(()=>xa(""))).limit(0)}function Ea(e,t,n,r,o,i){for(var a=Math.min(e.length,r.length),s=-1,u=0;u<a;++u){var c=t[u];if(c!==r[u])return o(e[u],n[u])<0?e.substr(0,u)+n[u]+n.substr(u+1):o(e[u],r[u])<0?e.substr(0,u)+r[u]+n.substr(u+1):s>=0?e.substr(0,s)+t[s]+n.substr(s+1):null;o(e[u],c)<0&&(s=u)}return a<r.length&&"next"===i?e+n.substr(e.length):a<e.length&&"prev"===i?e.substr(0,n.length):s<0?null:e.substr(0,s)+r[s]+n.substr(s+1)}function ka(e,t,n,r){var o,i,a,s,u,c,l,f=n.length;if(!n.every((e=>"string"==typeof e)))return Sa(e,"String expected.");function d(e){o=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),i=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),a="next"===e?wa:_a;var t=n.map((function(e){return{lower:i(e),upper:o(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));s=t.map((function(e){return e.upper})),u=t.map((function(e){return e.lower})),c=e,l="next"===e?"":r}d("next");var p=new e.Collection(e,(()=>Pa(s[0],u[f-1]+r)));p._ondirectionchange=function(e){d(e)};var h=0;return p._addAlgorithm((function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var d=i(o);if(t(d,u,h))return!0;for(var p=null,y=h;y<f;++y){var m=Ea(o,d,s[y],u[y],a,c);null===m&&null===p?h=y+1:(null===p||a(p,m)>0)&&(p=m)}return n(null!==p?function(){e.continue(p+l)}:r),!1})),p}function Pa(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function xa(e){return{type:1,lower:e,upper:e}}let ja=class{get Collection(){return this._ctx.table.db.Collection}between(e,t,n,r){n=!1!==n,r=!0===r;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Oa(this):new this.Collection(this,(()=>Pa(e,t,!n,!r)))}catch(e){return Sa(this,Yi)}}equals(e){return null==e?Sa(this,Yi):new this.Collection(this,(()=>xa(e)))}above(e){return null==e?Sa(this,Yi):new this.Collection(this,(()=>Pa(e,void 0,!0)))}aboveOrEqual(e){return null==e?Sa(this,Yi):new this.Collection(this,(()=>Pa(e,void 0,!1)))}below(e){return null==e?Sa(this,Yi):new this.Collection(this,(()=>Pa(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?Sa(this,Yi):new this.Collection(this,(()=>Pa(void 0,e)))}startsWith(e){return"string"!=typeof e?Sa(this,"String expected."):this.between(e,e+Qi,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):ka(this,((e,t)=>0===e.indexOf(t[0])),[e],Qi)}equalsIgnoreCase(e){return ka(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=mo.apply(yo,arguments);return 0===e.length?Oa(this):ka(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=mo.apply(yo,arguments);return 0===e.length?Oa(this):ka(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,Qi)}anyOf(){const e=mo.apply(yo,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return Sa(this,Yi)}if(0===e.length)return Oa(this);const n=new this.Collection(this,(()=>Pa(e[0],e[e.length-1])));n._ondirectionchange=n=>{t="next"===n?this._ascending:this._descending,e.sort(t)};let r=0;return n._addAlgorithm(((n,o,i)=>{const a=n.key;for(;t(a,e[r])>0;)if(++r,r===e.length)return o(i),!1;return 0===t(a,e[r])||(o((()=>{n.continue(e[r])})),!1)})),n}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=mo.apply(yo,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Sa(this,Yi)}const t=e.reduce(((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,t){const n=this._cmp,r=this._ascending,o=this._descending,i=this._min,a=this._max;if(0===e.length)return Oa(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&r(e[0],e[1])<=0)))return Sa(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Do.InvalidArgument);const s=!t||!1!==t.includeLowers,u=t&&!0===t.includeUppers;let c,l=r;function f(e,t){return l(e[0],t[0])}try{c=e.reduce((function(e,t){let r=0,o=e.length;for(;r<o;++r){const o=e[r];if(n(t[0],o[1])<0&&n(t[1],o[0])>0){o[0]=i(o[0],t[0]),o[1]=a(o[1],t[1]);break}}return r===o&&e.push(t),e}),[]),c.sort(f)}catch(e){return Sa(this,Yi)}let d=0;const p=u?e=>r(e,c[d][1])>0:e=>r(e,c[d][1])>=0,h=s?e=>o(e,c[d][0])>0:e=>o(e,c[d][0])>=0;let y=p;const m=new this.Collection(this,(()=>Pa(c[0][0],c[c.length-1][1],!s,!u)));return m._ondirectionchange=e=>{"next"===e?(y=p,l=r):(y=h,l=o),c.sort(f)},m._addAlgorithm(((e,t,n)=>{for(var o=e.key;y(o);)if(++d,d===c.length)return t(n),!1;return!!function(e){return!p(e)&&!h(e)}(o)||(0===this._cmp(o,c[d][1])||0===this._cmp(o,c[d][0])||t((()=>{l===r?e.continue(c[d][0]):e.continue(c[d][1])})),!1)})),m}startsWithAnyOf(){const e=mo.apply(yo,arguments);return e.every((e=>"string"==typeof e))?0===e.length?Oa(this):this.inAnyRange(e.map((e=>[e,e+Qi]))):Sa(this,"startsWithAnyOf() only works with strings")}};function Ta(e){return xi((function(t){return Aa(t),e(t.target.error),!1}))}function Aa(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const Ca=aa(null,"storagemutated");let Na=class{_lock(){return Jr(!ui.global),++this._reculock,1!==this._reculock||ui.global||(ui.lockOwnerFor=this),this}_unlock(){if(Jr(!ui.global),0==--this._reculock)for(ui.global||(ui.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{Ki(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&ui.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,n=this.db._state.dbOpenError;if(Jr(!this.idbtrans),!e&&!t)switch(n&&n.name){case"DatabaseClosedError":throw new Do.DatabaseClosed(n);case"MissingAPIError":throw new Do.MissingAPI(n.message,n);default:throw new Do.OpenFailed(n)}if(!this.active)throw new Do.TransactionInactive;return Jr(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=xi((t=>{Aa(t),this._reject(e.error)})),e.onabort=xi((t=>{Aa(t),this.active&&this._reject(new Do.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=xi((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&Ca.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,n){if("readwrite"===e&&"readwrite"!==this.mode)return Hi(new Do.ReadOnly("Transaction is readonly"));if(!this.active)return Hi(new Do.TransactionInactive);if(this._locked())return new di(((r,o)=>{this._blockedFuncs.push([()=>{this._promise(e,t,n).then(r,o)},ui])}));if(n)return Ri((()=>{var e=new di(((e,n)=>{this._lock();const r=t(e,n,this);r&&r.then&&r.then(e,n)}));return e.finally((()=>this._unlock())),e._lib=!0,e}));var r=new di(((e,n)=>{var r=t(e,n,this);r&&r.then&&r.then(e,n)}));return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();const n=di.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((()=>n));else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var o=t._waitingFor;return new di(((e,r)=>{n.then((n=>t._waitingQueue.push(xi(e.bind(null,n)))),(e=>t._waitingQueue.push(xi(r.bind(null,e))))).finally((()=>{t._waitingFor===o&&(t._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Do.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if(Fr(t,e))return t[e];const n=this.schema[e];if(!n)throw new Do.NotFound("Table "+e+" not part of transaction");const r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}};function Da(e,t,n,r,o,i,a){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+Ra(t)}}function Ra(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Ia(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:Zr(n,(e=>[e.name,e]))}}let Ma=e=>{try{return e.only([[]]),Ma=()=>[[]],[[]]}catch(e){return Ma=()=>Qi,Qi}};function La(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>eo(t,e)}(e):t=>eo(t,e)}function Ua(e){return[].slice.call(e)}let $a=0;function Ba(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function Fa({_novip:e},t){const n=t.db,r=function(e,t,{IDBKeyRange:n,indexedDB:r},i){const a=function(e,t){return t.reduce(((e,{create:t})=>o({},e,t(e))),e)}(function(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:n,upper:r,lowerOpen:o,upperOpen:i}=e;return void 0===n?void 0===r?null:t.upperBound(r,!!i):void 0===r?t.lowerBound(n,!!o):t.bound(n,r,!!o,!!i)}const{schema:o,hasGetAll:i}=function(e,t){const n=Ua(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:n}=e,r=Lr(t),o=null==t,i={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:La(t)},indexes:Ua(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:n,multiEntry:r,keyPath:o}=e,a={name:t,compound:Lr(o),keyPath:o,unique:n,multiEntry:r,extractKey:La(o)};return i[Ba(o)]=a,a})),getIndexByKeyPath:e=>i[Ba(e)]};return i[":id"]=a.primaryKey,null!=t&&(i[Ba(t)]=a.primaryKey),a}))},hasGetAll:n.length>0&&"getAll"in t.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,n),a=o.tables.map((e=>function(e){const t=e.name;return{name:t,schema:e,mutate:function({trans:e,type:n,keys:o,values:i,range:a}){return new Promise(((s,u)=>{s=xi(s);const c=e.objectStore(t),l=null==c.keyPath,f="put"===n||"add"===n;if(!f&&"delete"!==n&&"deleteRange"!==n)throw new Error("Invalid operation type: "+n);const{length:d}=o||i||{length:1};if(o&&i&&o.length!==i.length)throw new Error("Given keys array must have same length as given values array.");if(0===d)return s({numFailures:0,failures:{},results:[],lastResult:void 0});let p;const h=[],y=[];let m=0;const g=e=>{++m,Aa(e)};if("deleteRange"===n){if(4===a.type)return s({numFailures:m,failures:y,results:[],lastResult:void 0});3===a.type?h.push(p=c.clear()):h.push(p=c.delete(r(a)))}else{const[e,t]=f?l?[i,o]:[i,null]:[o,null];if(f)for(let r=0;r<d;++r)h.push(p=t&&void 0!==t[r]?c[n](e[r],t[r]):c[n](e[r])),p.onerror=g;else for(let t=0;t<d;++t)h.push(p=c[n](e[t])),p.onerror=g}const v=e=>{const t=e.target.result;h.forEach(((e,t)=>null!=e.error&&(y[t]=e.error))),s({numFailures:m,failures:y,results:"delete"===n?o:h.map((e=>e.result)),lastResult:t})};p.onerror=e=>{g(e),v(e)},p.onsuccess=v}))},getMany:({trans:e,keys:n})=>new Promise(((r,o)=>{r=xi(r);const i=e.objectStore(t),a=n.length,s=new Array(a);let u,c=0,l=0;const f=e=>{const t=e.target;s[t._pos]=t.result,++l===c&&r(s)},d=Ta(o);for(let e=0;e<a;++e)null!=n[e]&&(u=i.get(n[e]),u._pos=e,u.onsuccess=f,u.onerror=d,++c);0===c&&r(s)})),get:({trans:e,key:n})=>new Promise(((r,o)=>{r=xi(r);const i=e.objectStore(t).get(n);i.onsuccess=e=>r(e.target.result),i.onerror=Ta(o)})),query:function(e){return n=>new Promise(((o,i)=>{o=xi(o);const{trans:a,values:s,limit:u,query:c}=n,l=u===1/0?void 0:u,{index:f,range:d}=c,p=a.objectStore(t),h=f.isPrimaryKey?p:p.index(f.name),y=r(d);if(0===u)return o({result:[]});if(e){const e=s?h.getAll(y,l):h.getAllKeys(y,l);e.onsuccess=e=>o({result:e.target.result}),e.onerror=Ta(i)}else{let e=0;const t=s||!("openKeyCursor"in h)?h.openCursor(y):h.openKeyCursor(y),n=[];t.onsuccess=r=>{const i=t.result;return i?(n.push(s?i.value:i.primaryKey),++e===u?o({result:n}):void i.continue()):o({result:n})},t.onerror=Ta(i)}}))}(i),openCursor:function({trans:e,values:n,query:o,reverse:i,unique:a}){return new Promise(((s,u)=>{s=xi(s);const{index:c,range:l}=o,f=e.objectStore(t),d=c.isPrimaryKey?f:f.index(c.name),p=i?a?"prevunique":"prev":a?"nextunique":"next",h=n||!("openKeyCursor"in d)?d.openCursor(r(l),p):d.openKeyCursor(r(l),p);h.onerror=Ta(u),h.onsuccess=xi((t=>{const n=h.result;if(!n)return void s(null);n.___id=++$a,n.done=!1;const r=n.continue.bind(n);let o=n.continuePrimaryKey;o&&(o=o.bind(n));const i=n.advance.bind(n),a=()=>{throw new Error("Cursor not stopped")};n.trans=e,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw new Error("Cursor not started")},n.fail=xi(u),n.next=function(){let e=1;return this.start((()=>e--?this.continue():this.stop())).then((()=>this))},n.start=e=>{const t=new Promise(((e,t)=>{e=xi(e),h.onerror=Ta(t),n.fail=t,n.stop=t=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=a,e(t)}})),s=()=>{if(h.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=()=>{throw new Error("Cursor behind last entry")},n.stop()};return h.onsuccess=xi((e=>{h.onsuccess=s,s()})),n.continue=r,n.continuePrimaryKey=o,n.advance=i,s(),t},s(n)}),u)}))},count({query:e,trans:n}){const{index:o,range:i}=e;return new Promise(((e,a)=>{const s=n.objectStore(t),u=o.isPrimaryKey?s:s.index(o.name),c=r(i),l=c?u.count(c):u.count();l.onsuccess=xi((t=>e(t.target.result))),l.onerror=Ta(a)}))}}}(e))),s={};return a.forEach((e=>s[e.name]=e)),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!s[e])throw new Error(`Table '${e}' not found`);return s[e]},MIN_KEY:-1/0,MAX_KEY:Ma(t),schema:o}}(t,n,i),e.dbcore);return{dbcore:a}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach((t=>{const n=t.name;e.core.schema.tables.some((e=>e.name===n))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function Ka({_novip:e},t,n,r){n.forEach((n=>{const o=r[n];t.forEach((t=>{const r=Hr(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?Wr(t,n,{get(){return this.table(n)},set(e){zr(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,o))}))}))}function za({_novip:e},t){t.forEach((t=>{for(let n in t)t[n]instanceof e.Table&&delete t[n]}))}function Wa(e,t){return e._cfg.version-t._cfg.version}function Va(e,t){const n={del:[],add:[],change:[]};let r;for(r in e)t[r]||n.del.push(r);for(r in t){const o=e[r],i=t[r];if(o){const e={name:r,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!Xi)e.recreate=!0,n.change.push(e);else{const t=o.idxByName,r=i.idxByName;let a;for(a in t)r[a]||e.del.push(a);for(a in r){const n=t[a],o=r[a];n?n.src!==o.src&&e.change.push(o):e.add.push(o)}(e.del.length>0||e.add.length>0||e.change.length>0)&&n.change.push(e)}}else n.add.push([r,i])}return n}function qa(e,t,n,r){const o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((e=>Ha(o,e))),o}function Ha(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function Ga(e,t,n){const r={};return Qr(t.objectStoreNames,0).forEach((e=>{const t=n.objectStore(e);let o=t.keyPath;const i=Da(Ra(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),a=[];for(let e=0;e<t.indexNames.length;++e){const n=t.index(t.indexNames[e]);o=n.keyPath;var s=Da(n.name,o,!!n.unique,!!n.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(s)}r[e]=Ia(e,i,a)})),r}function Qa({_novip:e},t,n){const r=n.db.objectStoreNames;for(let o=0;o<r.length;++o){const i=r[o],a=n.objectStore(i);e._hasGetAll="getAll"in a;for(let e=0;e<a.indexNames.length;++e){const n=a.indexNames[e],r=a.index(n).keyPath,o="string"==typeof r?r:"["+Qr(r).join("+")+"]";if(t[i]){const e=t[i].idxByName[o];e&&(e.name=n,delete t[i].idxByName[o],t[i].idxByName[n]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Ir.WorkerGlobalScope&&Ir instanceof Ir.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}let Ya=class{_parseStoresSpec(e,t){Mr(e).forEach((n=>{if(null!==e[n]){var r=e[n].split(",").map(((e,t)=>{const n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Da(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),Lr(r),0===t)})),o=r.shift();if(o.multi)throw new Do.Schema("Primary key cannot be multi-valued");r.forEach((e=>{if(e.auto)throw new Do.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Do.Schema("Index must have a name and cannot be an empty string")})),t[n]=Ia(n,o,r)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?Ur(this._cfg.storesSource,e):e;const n=t._versions,r={};let o={};return n.forEach((e=>{Ur(r,e._cfg.storesSource),o=e._cfg.dbschema={},e._parseStoresSpec(r,o)})),t._dbSchema=o,za(t,[t._allTables,t,t.Transaction.prototype]),Ka(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],Mr(o),o),t._storeNames=Mr(o),this}upgrade(e){return this._cfg.contentUpgrade=Wo(this._cfg.contentUpgrade||Mo,e),this}};function Ja(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new vs("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function Xa(e){return e&&"function"==typeof e.databases}function Za(e){return Ri((function(){return ui.letThrough=!0,e()}))}function es(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()})).finally((function(){return clearInterval(e)})):Promise.resolve()}function ts(e){var t=t=>e.next(t),n=o(t),r=o((t=>e.throw(t)));function o(e){return t=>{var o=e(t),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):Lr(i)?Promise.all(i).then(n,r):n(i)}}return o(t)()}function ns(e,t,n){var r=arguments.length;if(r<2)throw new Do.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[e,oo(o),n]}function rs(e,t,n,r,o){return di.resolve().then((()=>{const i=ui.transless||ui,a=e._createTransaction(t,n,e._dbSchema,r),s={trans:a,transless:i};if(r)a.idbtrans=r.idbtrans;else try{a.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===Co.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>rs(e,t,n,null,o)))):Hi(r)}const u=go(o);let c;u&&Ii();const l=di.follow((()=>{if(c=o.call(a,a),c)if(u){var e=Mi.bind(null,null);c.then(e,e)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=ts(c))}),s);return(c&&"function"==typeof c.then?di.resolve(c).then((e=>a.active?e:Hi(new Do.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):l.then((()=>c))).then((e=>(r&&a._resolve(),a._completion.then((()=>e))))).catch((e=>(a._reject(e),Hi(e))))}))}function os(e,t,n){const r=Lr(e)?e.slice():[e];for(let e=0;e<n;++e)r.push(t);return r}const is={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return i(o({},e),{table(t){const n=e.table(t),{schema:r}=n,a={},s=[];function u(e,t,n){const r=Ba(e),c=a[r]=a[r]||[],l=null==e?0:"string"==typeof e?1:e.length,f=t>0,d=i(o({},n),{isVirtual:f,keyTail:t,keyLength:l,extractKey:La(e),unique:!f&&n.unique});return c.push(d),d.isPrimaryKey||s.push(d),l>1&&u(2===l?e[0]:e.slice(0,l-1),t+1,n),c.sort(((e,t)=>e.keyTail-t.keyTail)),d}const c=u(r.primaryKey.keyPath,0,r.primaryKey);a[":id"]=[c];for(const e of r.indexes)u(e.keyPath,0,e);function l(t){const n=t.query.index;return n.isVirtual?i(o({},t),{query:{index:n,range:(r=t.query.range,a=n.keyTail,{type:1===r.type?2:r.type,lower:os(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,a),lowerOpen:!0,upper:os(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,a),upperOpen:!0})}}):t;var r,a}const f=i(o({},n),{schema:i(o({},r),{primaryKey:c,indexes:s,getIndexByKeyPath:function(e){const t=a[Ba(e)];return t&&t[0]}}),count:e=>n.count(l(e)),query:e=>n.query(l(e)),openCursor(t){const{keyTail:r,isVirtual:o,keyLength:i}=t.query.index;return o?n.openCursor(l(t)).then((n=>n&&function(n){const o=Object.create(n,{continue:{value:function(o){null!=o?n.continue(os(o,t.reverse?e.MAX_KEY:e.MIN_KEY,r)):t.unique?n.continue(n.key.slice(0,i).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,r)):n.continue()}},continuePrimaryKey:{value(t,o){n.continuePrimaryKey(os(t,e.MAX_KEY,r),o)}},primaryKey:{get:()=>n.primaryKey},key:{get(){const e=n.key;return 1===i?e[0]:e.slice(0,i)}},value:{get:()=>n.value}});return o}(n))):n.openCursor(t)}});return f}})}};function as(e,t,n,r){return n=n||{},r=r||"",Mr(e).forEach((o=>{if(Fr(t,o)){var i=e[o],a=t[o];if("object"==typeof i&&"object"==typeof a&&i&&a){const e=fo(i);e!==fo(a)?n[r+o]=t[o]:"Object"===e?as(i,a,n,r+o+"."):i!==a&&(n[r+o]=t[o])}else i!==a&&(n[r+o]=t[o])}else n[r+o]=void 0})),Mr(t).forEach((o=>{Fr(e,o)||(n[r+o]=t[o])})),n}const ss={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>i(o({},e),{table(t){const n=e.table(t),{primaryKey:r}=n.schema,a=i(o({},n),{mutate(e){const a=ui.trans,{deleting:s,creating:u,updating:c}=a.table(t).hook;switch(e.type){case"add":if(u.fire===Mo)break;return a._promise("readwrite",(()=>l(e)),!0);case"put":if(u.fire===Mo&&c.fire===Mo)break;return a._promise("readwrite",(()=>l(e)),!0);case"delete":if(s.fire===Mo)break;return a._promise("readwrite",(()=>l(e)),!0);case"deleteRange":if(s.fire===Mo)break;return a._promise("readwrite",(()=>function(e){return f(e.trans,e.range,1e4)}(e)),!0)}return n.mutate(e);function l(e){const t=ui.trans,a=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(r,e);if(!a)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?i(o({},e),{keys:a}):o({},e)).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),function(e,t,n){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}(n,e,a).then((o=>{const i=a.map(((n,i)=>{const a=o[i],l={onerror:null,onsuccess:null};if("delete"===e.type)s.fire.call(l,n,a,t);else if("add"===e.type||void 0===a){const o=u.fire.call(l,n,e.values[i],t);null==n&&null!=o&&(n=o,e.keys[i]=n,r.outbound||to(e.values[i],r.keyPath,n))}else{const r=as(a,e.values[i]),o=c.fire.call(l,r,n,a,t);if(o){const t=e.values[i];Object.keys(o).forEach((e=>{Fr(t,e)?t[e]=o[e]:to(t,e,o[e])}))}}return l}));return n.mutate(e).then((({failures:t,results:n,numFailures:r,lastResult:s})=>{for(let r=0;r<a.length;++r){const s=n?n[r]:a[r],u=i[r];null==s?u.onerror&&u.onerror(t[r]):u.onsuccess&&u.onsuccess("put"===e.type&&o[r]?e.values[r]:s)}return{failures:t,results:n,numFailures:r,lastResult:s}})).catch((e=>(i.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function f(e,t,a){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:a}).then((({result:n})=>l({type:"delete",keys:n,trans:e}).then((r=>r.numFailures>0?Promise.reject(r.failures[0]):n.length<a?{failures:[],numFailures:0,lastResult:void 0}:f(e,i(o({},t),{lower:n[n.length-1],lowerOpen:!0}),a)))))}}});return a}})};function us(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;const r=[];for(let o=0,i=0;o<t.keys.length&&i<e.length;++o)0===ya(t.keys[o],e[i])&&(r.push(n?uo(t.values[o]):t.values[o]),++i);return r.length===e.length?r:null}catch(e){return null}}const cs={stack:"dbcore",level:-1,create:e=>({table:t=>{const n=e.table(t);return i(o({},n),{getMany:e=>{if(!e.cache)return n.getMany(e);const t=us(e.keys,e.trans._cache,"clone"===e.cache);return t?di.resolve(t):n.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?uo(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),n.mutate(e))})}})};function ls(e){return!("from"in e)}const fs=function(e,t){if(!this){const t=new fs;return e&&"d"in e&&Ur(t,e),t}Ur(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function ds(e,t,n){const r=ya(t,n);if(isNaN(r))return;if(r>0)throw RangeError();if(ls(e))return Ur(e,{from:t,to:n,d:1});const o=e.l,i=e.r;if(ya(n,e.from)<0)return o?ds(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},ys(e);if(ya(t,e.to)>0)return i?ds(i,t,n):e.r={from:t,to:n,d:1,l:null,r:null},ys(e);ya(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),ya(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);const a=!e.r;o&&!e.l&&ps(e,o),i&&a&&ps(e,i)}function ps(e,t){ls(t)||function e(t,{from:n,to:r,l:o,r:i}){ds(t,n,r),o&&e(t,o),i&&e(t,i)}(e,t)}function hs(e){let t=ls(e)?null:{s:0,n:e};return{next(e){const n=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&ya(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||ya(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function ys(e){var t,n;const r=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(n=e.l)||void 0===n?void 0:n.d)||0),i=r>1?"r":r<-1?"l":"";if(i){const t="r"===i?"l":"r",n=o({},e),r=e[i];e.from=r.from,e.to=r.to,e[i]=r[i],n[i]=r[t],e[t]=n,n.d=ms(n)}e.d=ms(e)}function ms({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}Kr(fs.prototype,{add(e){return ps(this,e),this},addKey(e){return ds(this,e,e),this},addKeys(e){return e.forEach((e=>ds(this,e,e))),this},[po](){return hs(this)}});const gs={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,n=new fs(e.MIN_KEY,e.MAX_KEY);return i(o({},e),{table:r=>{const a=e.table(r),{schema:s}=a,{primaryKey:u}=s,{extractKey:c,outbound:l}=u,f=i(o({},a),{mutate:e=>{const o=e.trans,i=o.mutatedParts||(o.mutatedParts={}),u=e=>{const n=`idb://${t}/${r}/${e}`;return i[n]||(i[n]=new fs)},c=u(""),l=u(":dels"),{type:f}=e;let[d,p]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[];const h=e.trans._cache;return a.mutate(e).then((e=>{if(Lr(d)){"delete"!==f&&(d=e.results),c.addKeys(d);const t=us(d,h);t||"add"===f||l.addKeys(d),(t||p)&&function(e,t,n,r){t.indexes.forEach((function(t){const o=e(t.name||"");function i(e){return null!=e?t.extractKey(e):null}const a=e=>t.multiEntry&&Lr(e)?e.forEach((e=>o.addKey(e))):o.addKey(e);(n||r).forEach(((e,t)=>{const o=n&&i(n[t]),s=r&&i(r[t]);0!==ya(o,s)&&(null!=o&&a(o),null!=s&&a(s))}))}))}(u,s,t,p)}else if(d){const e={from:d.lower,to:d.upper};l.add(e),c.add(e)}else c.add(n),l.add(n),s.indexes.forEach((e=>u(e.name).add(n)));return e}))}}),d=({query:{index:t,range:n}})=>{var r,o;return[t,new fs(null!==(r=n.lower)&&void 0!==r?r:e.MIN_KEY,null!==(o=n.upper)&&void 0!==o?o:e.MAX_KEY)]},p={get:e=>[u,new fs(e.key)],getMany:e=>[u,(new fs).addKeys(e.keys)],count:d,query:d,openCursor:d};return Mr(p).forEach((e=>{f[e]=function(s){const{subscr:u}=ui;if(u){const f=e=>{const n=`idb://${t}/${r}/${e}`;return u[n]||(u[n]=new fs)},d=f(""),h=f(":dels"),[y,m]=p[e](s);if(f(y.name||"").add(m),!y.isPrimaryKey){if("count"!==e){const t="query"===e&&l&&s.values&&a.query(i(o({},s),{values:!1}));return a[e].apply(this,arguments).then((n=>{if("query"===e){if(l&&s.values)return t.then((({result:e})=>(d.addKeys(e),n)));const e=s.values?n.result.map(c):n.result;s.values?d.addKeys(e):h.addKeys(e)}else if("openCursor"===e){const e=n,t=s.values;return e&&Object.create(e,{key:{get:()=>(h.addKey(e.primaryKey),e.key)},primaryKey:{get(){const t=e.primaryKey;return h.addKey(t),t}},value:{get:()=>(t&&d.addKey(e.primaryKey),e.value)}})}return n}))}h.add(n)}}return a[e].apply(this,arguments)}})),f}})}};let vs=class{version(e){if(isNaN(e)||e<.1)throw new Do.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Do.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const t=this._versions;var n=t.filter((t=>t._cfg.version===e))[0];return n||(n=new this.Version(e),t.push(n),t.sort(Wa),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(e){return this.idbdb&&(this._state.openComplete||ui.letThrough||this._vip)?e():new di(((e,t)=>{if(this._state.openComplete)return t(new Do.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new Do.DatabaseClosed);this.open().catch(Mo)}this._state.dbReadyPromise.then(e,t)})).then(e)}use({stack:e,create:t,level:n,name:r}){r&&this.unuse({stack:e,name:r});const o=this._middlewares[e]||(this._middlewares[e]=[]);return o.push({stack:e,create:t,level:null==n?10:n,name:r}),o.sort(((e,t)=>e.level-t.level)),this}unuse({stack:e,name:t,create:n}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((e=>n?e.create!==n:!!t&&e.name!==t))),this}open(){return function(e){const t=e._state,{indexedDB:n}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((()=>t.dbOpenError?Hi(t.dbOpenError):e));vo&&(t.openCanceller._stackHolder=So()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const r=t.openCanceller;function o(){if(t.openCanceller!==r)throw new Do.DatabaseClosed("db.open() was cancelled")}let i=t.dbReadyResolve,a=null,s=!1;return di.race([r,("undefined"==typeof navigator?di.resolve():es()).then((()=>new di(((r,i)=>{if(o(),!n)throw new Do.MissingAPI;const u=e.name,c=t.autoSchema?n.open(u):n.open(u,Math.round(10*e.verno));if(!c)throw new Do.MissingAPI;c.onerror=Ta(i),c.onblocked=xi(e._fireOnBlocked),c.onupgradeneeded=xi((r=>{if(a=c.transaction,t.autoSchema&&!e._options.allowEmptyDB){c.onerror=Aa,a.abort(),c.result.close();const e=n.deleteDatabase(u);e.onsuccess=e.onerror=xi((()=>{i(new Do.NoSuchDatabase(`Database ${u} doesnt exist`))}))}else{a.onerror=Ta(i);var o=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;s=o<1,e._novip.idbdb=c.result,function(e,t,n,r){const o=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,o);i.create(n),i._completion.catch(r);const a=i._reject.bind(i),s=ui.transless||ui;Ri((()=>{ui.trans=i,ui.transless=s,0===t?(Mr(o).forEach((e=>{qa(n,e,o[e].primKey,o[e].indexes)})),Fa(e,n),di.follow((()=>e.on.populate.fire(i))).catch(a)):function({_novip:e},t,n,r){const o=[],i=e._versions;let a=e._dbSchema=Ga(0,e.idbdb,r),s=!1;return i.filter((e=>e._cfg.version>=t)).forEach((i=>{o.push((()=>{const o=a,u=i._cfg.dbschema;Qa(e,o,r),Qa(e,u,r),a=e._dbSchema=u;const c=Va(o,u);c.add.forEach((e=>{qa(r,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((e=>{if(e.recreate)throw new Do.Upgrade("Not yet support for changing primary key");{const t=r.objectStore(e.name);e.add.forEach((e=>Ha(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),Ha(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const l=i._cfg.contentUpgrade;if(l&&i._cfg.version>t){Fa(e,r),n._memoizedTables={},s=!0;let t=no(u);c.del.forEach((e=>{t[e]=o[e]})),za(e,[e.Transaction.prototype]),Ka(e,[e.Transaction.prototype],Mr(t),t),n.schema=t;const i=go(l);let a;i&&Ii();const f=di.follow((()=>{if(a=l(n),a&&i){var e=Mi.bind(null,null);a.then(e,e)}}));return a&&"function"==typeof a.then?di.resolve(a):f.then((()=>a))}})),o.push((t=>{s&&Zi||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((n=>null==e[n]&&t.db.deleteObjectStore(n)))}(i._cfg.dbschema,t),za(e,[e.Transaction.prototype]),Ka(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),function e(){return o.length?di.resolve(o.shift()(n.idbtrans)).then(e):di.resolve()}().then((()=>{var e,t;t=r,Mr(e=a).forEach((n=>{t.db.objectStoreNames.contains(n)||qa(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,i,n).catch(a)}))}(e,o/10,a,i)}}),i),c.onsuccess=xi((()=>{a=null;const n=e._novip.idbdb=c.result,o=Qr(n.objectStoreNames);if(o.length>0)try{const r=n.transaction(1===(i=o).length?i[0]:i,"readonly");t.autoSchema?function({_novip:e},t,n){e.verno=t.version/10;const r=e._dbSchema=Ga(0,t,n);e._storeNames=Qr(t.objectStoreNames,0),Ka(e,[e._allTables],Mr(r),r)}(e,n,r):(Qa(e,e._dbSchema,r),function(e,t){const n=Va(Ga(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.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.")),Fa(e,r)}catch(e){}var i;Ji.push(e),n.onversionchange=xi((n=>{t.vcFired=!0,e.on("versionchange").fire(n)})),n.onclose=xi((t=>{e.on("close").fire(t)})),s&&function({indexedDB:e,IDBKeyRange:t},n){!Xa(e)&&"__dbnames"!==n&&Ja(e,t).put({name:n}).catch(Mo)}(e._deps,u),r()}),i)}))))]).then((()=>(o(),t.onReadyBeingFired=[],di.resolve(Za((()=>e.on.ready.fire(e.vip)))).then((function n(){if(t.onReadyBeingFired.length>0){let r=t.onReadyBeingFired.reduce(Wo,Mo);return t.onReadyBeingFired=[],di.resolve(Za((()=>r(e.vip)))).then(n)}}))))).finally((()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((()=>e)).catch((n=>{t.dbOpenError=n;try{a&&a.abort()}catch(e){}return r===t.openCanceller&&e._close(),Hi(n)})).finally((()=>{t.openComplete=!0,i()}))}(this)}_close(){const e=this._state,t=Ji.indexOf(this);if(t>=0&&Ji.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new di((t=>{e.dbReadyResolve=t})),e.openCanceller=new di(((t,n)=>{e.cancelOpen=n}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new Do.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new di(((n,r)=>{const o=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=xi((()=>{!function({indexedDB:e,IDBKeyRange:t},n){!Xa(e)&&"__dbnames"!==n&&Ja(e,t).delete(n).catch(Mo)}(this._deps,this.name),n()})),e.onerror=Ta(r),e.onblocked=this._fireOnBlocked};if(e)throw new Do.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(o):o()}))}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return Mr(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=ns.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,n){let r=ui.trans;r&&r.db===this&&-1===e.indexOf("!")||(r=null);const o=-1!==e.indexOf("?");let i,a;e=e.replace("!","").replace("?","");try{if(a=t.map((e=>{var t=e instanceof this.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||"readonly"===e)i="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new Do.InvalidArgument("Invalid transaction mode: "+e);i="readwrite"}if(r){if("readonly"===r.mode&&"readwrite"===i){if(!o)throw new Do.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&a.forEach((e=>{if(r&&-1===r.storeNames.indexOf(e)){if(!o)throw new Do.SubTransaction("Table "+e+" not included in parent transaction.");r=null}})),o&&r&&!r.active&&(r=null)}}catch(e){return r?r._promise(null,((t,n)=>{n(e)})):Hi(e)}const s=rs.bind(null,this,i,a,r,n);return r?r._promise(i,s,"lock"):ui.trans?Ki(ui.transless,(()=>this._whenReady(s))):this._whenReady(s)}table(e){if(!Fr(this._allTables,e))throw new Do.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}constructor(t,n){this._middlewares={},this.verno=0;const r=e.dependencies;this._options=n=o({addons:e.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};const{addons:i}=n;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const a={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Mo,dbReadyPromise:null,cancelOpen:Mo,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var s;a.dbReadyPromise=new di((e=>{a.dbReadyResolve=e})),a.openCanceller=new di(((e,t)=>{a.cancelOpen=t})),this._state=a,this.name=t,this.on=aa(this,"populate","blocked","versionchange","close",{ready:[Wo,Mo]}),this.on.ready.subscribe=Yr(this.on.ready.subscribe,(t=>(n,r)=>{e.vip((()=>{const e=this._state;if(e.openComplete)e.dbOpenError||di.resolve().then(n),r&&t(n);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(n),r&&t(n);else{t(n);const e=this;r||t((function t(){e.on.ready.unsubscribe(n),e.on.ready.unsubscribe(t)}))}}))})),this.Collection=(s=this,sa(va.prototype,(function(e,t){this.db=s;let n=ra,r=null;if(t)try{n=t()}catch(e){r=e}const o=e._ctx,i=o.table,a=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:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:o.or,valueMapper:a!==Lo?a:null}}))),this.Table=function(e){return sa(ia.prototype,(function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:aa(null,{creating:[Bo,Mo],reading:[Uo,Lo],updating:[Ko,Mo],deleting:[Fo,Mo]})}))}(this),this.Transaction=function(e){return sa(Na.prototype,(function(t,n,r,o,i){this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=aa(this,"complete","error","abort"),this.parent=i||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 di(((e,t)=>{this._resolve=e,this._reject=t})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),Hi(e)}))}))}(this),this.Version=function(e){return sa(Ya.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return sa(ja.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};const o=e._deps.indexedDB;if(!o)throw new Do.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=(e,t)=>o.cmp(t,e),this._max=(e,t)=>o.cmp(e,t)>0?e:t,this._min=(e,t)=>o.cmp(e,t)<0?e:t,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=Ma(n.IDBKeyRange),this._createTransaction=(e,t,n,r)=>new this.Transaction(e,t,n,this._options.chromeTransactionDurability,r),this._fireOnBlocked=e=>{this.on("blocked").fire(e),Ji.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(is),this.use(ss),this.use(gs),this.use(cs),this.vip=Object.create(this,{_vip:{value:!0}}),i.forEach((e=>e(this)))}};const bs="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";let ws,_s=class{subscribe(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}[bs](){return this}constructor(e){this._subscribe=e}};function Ss(e,t){return Mr(t).forEach((n=>{ps(e[n]||(e[n]=new fs),t[n])})),e}try{ws={indexedDB:Ir.indexedDB||Ir.mozIndexedDB||Ir.webkitIndexedDB||Ir.msIndexedDB,IDBKeyRange:Ir.IDBKeyRange||Ir.webkitIDBKeyRange}}catch(gt){ws={indexedDB:null,IDBKeyRange:null}}const Os=vs;function Es(e){let t=ks;try{ks=!0,Ca.storagemutated.fire(e)}finally{ks=t}}Kr(Os,i(o({},Io),{delete:e=>new Os(e,{addons:[]}).delete(),exists:e=>new Os(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return Xa(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>"__dbnames"!==e)))):Ja(e,t).toCollection().primaryKeys()}(Os.dependencies).then(e)}catch(e){return Hi(new Do.MissingAPI)}},defineClass:()=>function(e){Ur(this,e)},ignoreTransaction:e=>ui.trans?Ki(ui.transless,e):e(),vip:Za,async:function(e){return function(){try{var t=ts(e.apply(this,arguments));return t&&"function"==typeof t.then?t:di.resolve(t)}catch(e){return Hi(e)}}},spawn:function(e,t,n){try{var r=ts(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:di.resolve(r)}catch(e){return Hi(e)}},currentTransaction:{get:()=>ui.trans||null},waitFor:function(e,t){const n=di.resolve("function"==typeof e?Os.ignoreTransaction(e):e).timeout(t||6e4);return ui.trans?ui.trans.waitFor(n):n},Promise:di,debug:{get:()=>vo,set:e=>{bo(e,"dexie"===e?()=>!0:ta)}},derive:Vr,extend:Ur,props:Kr,override:Yr,Events:aa,on:Ca,liveQuery:function(e){return new _s((t=>{const n=go(e);let r=!1,o={},i={};const a={get closed(){return r},unsubscribe:()=>{r=!0,Ca.storagemutated.unsubscribe(l)}};t.start&&t.start(a);let s=!1,u=!1;function c(){return Mr(i).some((e=>o[e]&&function(e,t){const n=hs(t);let r=n.next();if(r.done)return!1;let o=r.value;const i=hs(e);let a=i.next(o.from),s=a.value;for(;!r.done&&!a.done;){if(ya(s.from,o.to)<=0&&ya(s.to,o.from)>=0)return!0;ya(o.from,s.from)<0?o=(r=n.next(s.from)).value:s=(a=i.next(o.from)).value}return!1}(o[e],i[e])))}const l=e=>{Ss(o,e),c()&&f()},f=()=>{if(s||r)return;o={};const d={},p=function(t){n&&Ii();const r=()=>Ri(e,{subscr:t,trans:null}),o=ui.trans?Ki(ui.transless,r):r();return n&&o.then(Mi,Mi),o}(d);u||(Ca("storagemutated",l),u=!0),s=!0,Promise.resolve(p).then((e=>{s=!1,r||(c()?f():(o={},i=d,t.next&&t.next(e)))}),(e=>{s=!1,t.error&&t.error(e),a.unsubscribe()}))};return f(),a}))},extendObservabilitySet:Ss,getByKeyPath:eo,setByKeyPath:to,delByKeyPath:function(e,t){"string"==typeof t?to(e,t,void 0):"length"in t&&[].map.call(t,(function(t){to(e,t,void 0)}))},shallowClone:no,deepClone:uo,getObjectDiff:as,cmp:ya,asap:Xr,minKey:-1/0,addons:[],connections:Ji,errnames:Co,dependencies:ws,semVer:"3.2.3",version:"3.2.3".split(".").map((e=>parseInt(e))).reduce(((e,t,n)=>e+t/Math.pow(10,2*n)))})),Os.maxKey=Ma(Os.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(Ca("storagemutated",(e=>{if(!ks){let t;Xi?(t=document.createEvent("CustomEvent"),t.initCustomEvent("x-storagemutated-1",!0,!0,e)):t=new CustomEvent("x-storagemutated-1",{detail:e}),ks=!0,dispatchEvent(t),ks=!1}})),addEventListener("x-storagemutated-1",(({detail:e})=>{ks||Es(e)})));let ks=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel("x-storagemutated-1");"function"==typeof e.unref&&e.unref(),Ca("storagemutated",(t=>{ks||e.postMessage(t)})),e.onmessage=e=>{e.data&&Es(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){Ca("storagemutated",(e=>{try{ks||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:"x-storagemutated-1",changedParts:e}))))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(e=>{if("x-storagemutated-1"===e.key){const t=JSON.parse(e.newValue);t&&Es(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&"x-storagemutated-1"===e.type&&Es(e.changedParts)}))}function Ps(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xs(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function js(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){xs(i,r,o,a,s,"next",e)}function s(e){xs(i,r,o,a,s,"throw",e)}a(void 0)}))}}di.rejectionMapper=function(e,t){if(!e||e instanceof xo||e instanceof TypeError||e instanceof SyntaxError||!e.name||!Ro[e.name])return e;var n=new Ro[e.name](t||e.message,e);return"stack"in e&&Wr(n,"stack",{get:function(){return this.inner.stack}}),n},bo(vo,ta);const Ts=new class extends vs{constructor(){super("EsmOffline"),Ps(this,"syncQueue",void 0),Ps(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 As(){return(As=js((function*(){const e=yield _r();return(null==e?void 0:e.uuid)||"*"}))).apply(this,arguments)}function Cs(){return Cs=js((function*(e,t){return(yield function(e,t){return Ns.apply(this,arguments)}(e,t)).map((e=>e.content))})),Cs.apply(this,arguments)}function Ns(){return(Ns=js((function*(e,t){const n=t?{type:t,userId:e}:{userId:e};return yield Ts.syncQueue.where(n).toArray().catch(vs.errnames.DatabaseClosed,(()=>[]))}))).apply(this,arguments)}function Ds(){return Ds=js((function*(e){const t=yield function(){return As.apply(this,arguments)}();return yield function(e,t){return Cs.apply(this,arguments)}(t,e)})),Ds.apply(this,arguments)}function Rs(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function Is(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Rs(i,r,o,a,s,"next",e)}function s(e){Rs(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Ms(e,t){return Ls.apply(this,arguments)}function Ls(){return Ls=Is((function*(e,t,n=!0){if(e){let r=null;const[o,i]=yield Promise.all([ur(`${ir}/Patient/${e}`,t).catch((e=>r=e)),n?Us(e):Promise.resolve(null)]);if(o.ok)return o.data;if(i)return i;if(r)throw r}return null})),Ls.apply(this,arguments)}function Us(e){return $s.apply(this,arguments)}function $s(){return $s=Is((function*(e){const t=yield function(e){return Ds.apply(this,arguments)}("patient-registration"),n=t.find((t=>t.fhirPatient.id===e));var r;return null!==(r=null==n?void 0:n.fhirPatient)&&void 0!==r?r:null})),$s.apply(this,arguments)}(0,Ue.createGlobalStore)("offline-synchronization",{}),(0,Ue.createGlobalStore)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});var Bs=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),Fs=function(e){function n(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return t(n,e),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},n}(m),Ks=function(e){function n(t){var n=e.call(this,t)||this;return n.destination=t,n}return t(n,e),n}(b),zs=function(e){function n(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t(n,e),n.prototype[v]=function(){return new Ks(this)},n.prototype.lift=function(e){var t=new Ws(this,this);return t.operator=e,t},n.prototype.next=function(e){if(this.closed)throw new Bs;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].next(e)},n.prototype.error=function(e){if(this.closed)throw new Bs;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].error(e);this.observers.length=0},n.prototype.complete=function(){if(this.closed)throw new Bs;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;r++)n[r].complete();this.observers.length=0},n.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},n.prototype._trySubscribe=function(t){if(this.closed)throw new Bs;return e.prototype._trySubscribe.call(this,t)},n.prototype._subscribe=function(e){if(this.closed)throw new Bs;return this.hasError?(e.error(this.thrownError),m.EMPTY):this.isStopped?(e.complete(),m.EMPTY):(this.observers.push(e),new Fs(this,e))},n.prototype.asObservable=function(){var e=new E;return e.source=this,e},n.create=function(e,t){return new Ws(e,t)},n}(E),Ws=function(e){function n(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t(n,e),n.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},n.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},n.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},n.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):m.EMPTY},n}(zs),Vs=function(e){function n(t){var n=e.call(this)||this;return n._value=t,n}return t(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Bs;return this._value},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(zs),qs=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}(),Hs=new E((function(e){return e.complete()}));function Gs(e){return function(t){return 0===e?Hs:t.lift(new Qs(e))}}var Qs=function(){function e(e){if(this.total=e,this.total<0)throw new qs}return e.prototype.call=function(e,t){return t.subscribe(new Ys(e,this.total))},e}(),Ys=function(e){function n(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return t(n,e),n.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},n}(b);function Js(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new Xs(e,t))}}var Xs=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new Zs(e,this.project,this.thisArg))},e}(),Zs=function(e){function n(t,n,r){var o=e.call(this,t)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return t(n,e),n.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},n}(b);const eu="custom:(uuid,encounters:(uuid,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,uuid),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display),startDatetime,stopDatetime)";function tu(e,t,n){return cr(`/ws/rest/v1/visit?patient=${e}&v=${null!=n?n:eu}`,{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}}).pipe(Gs(1)).pipe(Js((e=>e)))}function nu(e,t){return cr("/ws/rest/v1/visit",{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function ru(e,t,n){return cr(`/ws/rest/v1/visit/${e}`,{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}const ou=new Vs(null);var iu,au;function su(e){return{uuid:e.uuid,display:e.display,name:e.name}}function uu(){return cr("/ws/rest/v1/visittype").pipe(Js((e=>e.data.results.map(su)))).pipe(Gs(1))}function cu(e){return{uuid:e.uuid,display:e.display}}function lu(){return cr("/ws/rest/v1/location").pipe(Js((e=>e.data.results.map(cu)))).pipe(Gs(1))}!function(e){e.NEWVISIT="startVisit",e.EDITVISIT="editVisit",e.LOADING="loadingVisit"}(iu||(iu={})),function(e){e.NOTSTARTED="notStarted",e.ONGOING="ongoing"}(au||(au={}));const fu={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}})()})()},403:()=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{createAppState:()=>s,createGlobalStore:()=>i,getAppState:()=>u,getGlobalStore:()=>a,subscribeTo:()=>c});const n=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.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."),n.clear()}};return t=e(r,o,i),i},r=e=>e?n(e):n,o={};function i(e,t){const n=o[e];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(t,!0),n.active=!0,n.value;{const n=r()((()=>t));return o[e]={value:n,active:!0},n}}function a(e,t){const n=o[e];if(!n){const n=r()((()=>null!=t?t:{}));return o[e]={value:n,active:!1},n}return n.value}function s(e){return i("app",e)}function u(){return a("app",{})}function c(e,t,n){let r=t(e.getState());return e.subscribe((e=>{const o=t(e);o!==r&&(r=o,n(o))}))}})()}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e](n,n.exports,i),n.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};(()=>{"use strict";i.r(a),i.d(a,{attach:()=>Ro,checkStatus:()=>zo,checkStatusFor:()=>Wo,detach:()=>Io,detachAll:()=>Mo,extensionStore:()=>Jo,getAssignedExtensions:()=>Bo,getConnectedExtensions:()=>Uo,getExtensionInternalStore:()=>yo,getExtensionNameFromId:()=>Ao,getExtensionRegistration:()=>No,getExtensionRegistrationFrom:()=>Co,getExtensionStore:()=>go,registerExtension:()=>Do,registerExtensionSlot:()=>Fo,renderExtension:()=>Qo,reset:()=>Ko,updateInternalExtensionStore:()=>mo});const r=function(e,t){return e===t||e!=e&&t!=t},o=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1};var s=Array.prototype.splice;function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=function(){this.__data__=[],this.size=0},u.prototype.delete=function(e){var t=this.__data__,n=o(t,e);return!(n<0||(n==t.length-1?t.pop():s.call(t,n,1),--this.size,0))},u.prototype.get=function(e){var t=this.__data__,n=o(t,e);return n<0?void 0:t[n][1]},u.prototype.has=function(e){return o(this.__data__,e)>-1},u.prototype.set=function(e,t){var n=this.__data__,r=o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const c=u,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;var f="object"==typeof self&&self&&self.Object===Object&&self;const d=l||f||Function("return this")(),p=d.Symbol;var h=Object.prototype,y=h.hasOwnProperty,m=h.toString,g=p?p.toStringTag:void 0,v=Object.prototype.toString,b=p?p.toStringTag:void 0;const w=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":b&&b in Object(e)?function(e){var t=y.call(e,g),n=e[g];try{e[g]=void 0;var r=!0}catch(e){}var o=m.call(e);return r&&(t?e[g]=n:delete e[g]),o}(e):function(e){return v.call(e)}(e)},_=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},S=function(e){if(!_(e))return!1;var t=w(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},O=d["__core-js_shared__"];var E,k=(E=/[^.]+$/.exec(O&&O.keys&&O.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",P=Function.prototype.toString;const x=function(e){if(null!=e){try{return P.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var j=/^\[object .+?Constructor\]$/,T=Function.prototype,A=Object.prototype,C=T.toString,N=A.hasOwnProperty,D=RegExp("^"+C.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const R=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!_(e)||(t=e,k&&k in t))&&(S(e)?D:j).test(x(e));var t}(n)?n:void 0},I=R(d,"Map"),M=R(Object,"create");var L=Object.prototype.hasOwnProperty,U=Object.prototype.hasOwnProperty;function $(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}$.prototype.clear=function(){this.__data__=M?M(null):{},this.size=0},$.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},$.prototype.get=function(e){var t=this.__data__;if(M){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return L.call(t,e)?t[e]:void 0},$.prototype.has=function(e){var t=this.__data__;return M?void 0!==t[e]:U.call(t,e)},$.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=M&&void 0===t?"__lodash_hash_undefined__":t,this};const B=$,F=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function K(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}K.prototype.clear=function(){this.size=0,this.__data__={hash:new B,map:new(I||c),string:new B}},K.prototype.delete=function(e){var t=F(this,e).delete(e);return this.size-=t?1:0,t},K.prototype.get=function(e){return F(this,e).get(e)},K.prototype.has=function(e){return F(this,e).has(e)},K.prototype.set=function(e,t){var n=F(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};const z=K;function W(e){var t=this.__data__=new c(e);this.size=t.size}W.prototype.clear=function(){this.__data__=new c,this.size=0},W.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},W.prototype.get=function(e){return this.__data__.get(e)},W.prototype.has=function(e){return this.__data__.has(e)},W.prototype.set=function(e,t){var n=this.__data__;if(n instanceof c){var r=n.__data__;if(!I||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new z(r)}return n.set(e,t),this.size=n.size,this};const V=W;function q(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new z;++t<n;)this.add(e[t])}q.prototype.add=q.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},q.prototype.has=function(e){return this.__data__.has(e)};const H=q,G=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},Q=function(e,t,n,r,o,i){var a=1&n,s=e.length,u=t.length;if(s!=u&&!(a&&u>s))return!1;var c=i.get(e),l=i.get(t);if(c&&l)return c==t&&l==e;var f=-1,d=!0,p=2&n?new H:void 0;for(i.set(e,t),i.set(t,e);++f<s;){var h=e[f],y=t[f];if(r)var m=a?r(y,h,f,t,e,i):r(h,y,f,e,t,i);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!G(t,(function(e,t){if(a=t,!p.has(a)&&(h===e||o(h,e,n,r,i)))return p.push(t);var a}))){d=!1;break}}else if(h!==y&&!o(h,y,n,r,i)){d=!1;break}}return i.delete(e),i.delete(t),d},Y=d.Uint8Array,J=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},X=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var Z=p?p.prototype:void 0,ee=Z?Z.valueOf:void 0;const te=Array.isArray;var ne=Object.prototype.propertyIsEnumerable,re=Object.getOwnPropertySymbols;const oe=re?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a)&&(i[o++]=a)}return i}(re(e),(function(t){return ne.call(e,t)})))}:function(){return[]},ie=function(e){return null!=e&&"object"==typeof e},ae=function(e){return ie(e)&&"[object Arguments]"==w(e)};var se=Object.prototype,ue=se.hasOwnProperty,ce=se.propertyIsEnumerable;const le=ae(function(){return arguments}())?ae:function(e){return ie(e)&&ue.call(e,"callee")&&!ce.call(e,"callee")};var fe=t&&!t.nodeType&&t,de=fe&&e&&!e.nodeType&&e,pe=de&&de.exports===fe?d.Buffer:void 0;const he=(pe?pe.isBuffer:void 0)||function(){return!1};var ye=/^(?:0|[1-9]\d*)$/;const me=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t},ge=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ve={};ve["[object Float32Array]"]=ve["[object Float64Array]"]=ve["[object Int8Array]"]=ve["[object Int16Array]"]=ve["[object Int32Array]"]=ve["[object Uint8Array]"]=ve["[object Uint8ClampedArray]"]=ve["[object Uint16Array]"]=ve["[object Uint32Array]"]=!0,ve["[object Arguments]"]=ve["[object Array]"]=ve["[object ArrayBuffer]"]=ve["[object Boolean]"]=ve["[object DataView]"]=ve["[object Date]"]=ve["[object Error]"]=ve["[object Function]"]=ve["[object Map]"]=ve["[object Number]"]=ve["[object Object]"]=ve["[object RegExp]"]=ve["[object Set]"]=ve["[object String]"]=ve["[object WeakMap]"]=!1;var be=t&&!t.nodeType&&t,we=be&&e&&!e.nodeType&&e,_e=we&&we.exports===be&&l.process,Se=function(){try{return we&&we.require&&we.require("util").types||_e&&_e.binding&&_e.binding("util")}catch(e){}}(),Oe=Se&&Se.isTypedArray;const Ee=Oe?(ke=Oe,function(e){return ke(e)}):function(e){return ie(e)&&ge(e.length)&&!!ve[w(e)]};var ke,Pe=Object.prototype.hasOwnProperty,xe=Object.prototype;const je=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object);var Te=Object.prototype.hasOwnProperty;const Ae=function(e){return null!=(t=e)&&ge(t.length)&&!S(t)?function(e,t){var n=te(e),r=!n&&le(e),o=!n&&!r&&he(e),i=!n&&!r&&!o&&Ee(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],u=s.length;for(var c in e)!Pe.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||me(c,u))||s.push(c);return s}(e):function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||xe))return je(e);var t,n,r=[];for(var o in Object(e))Te.call(e,o)&&"constructor"!=o&&r.push(o);return r}(e);var t},Ce=function(e){return function(e,t,n){var r=t(e);return te(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Ae,oe)};var Ne=Object.prototype.hasOwnProperty;const De=R(d,"DataView"),Re=R(d,"Promise"),Ie=R(d,"Set"),Me=R(d,"WeakMap");var Le="[object Map]",Ue="[object Promise]",$e="[object Set]",Be="[object WeakMap]",Fe="[object DataView]",Ke=x(De),ze=x(I),We=x(Re),Ve=x(Ie),qe=x(Me),He=w;(De&&He(new De(new ArrayBuffer(1)))!=Fe||I&&He(new I)!=Le||Re&&He(Re.resolve())!=Ue||Ie&&He(new Ie)!=$e||Me&&He(new Me)!=Be)&&(He=function(e){var t=w(e),n="[object Object]"==t?e.constructor:void 0,r=n?x(n):"";if(r)switch(r){case Ke:return Fe;case ze:return Le;case We:return Ue;case Ve:return $e;case qe:return Be}return t});const Ge=He;var Qe="[object Arguments]",Ye="[object Array]",Je="[object Object]",Xe=Object.prototype.hasOwnProperty;const Ze=function(e,t,n,o,i,a){var s=te(e),u=te(t),c=s?Ye:Ge(e),l=u?Ye:Ge(t),f=(c=c==Qe?Je:c)==Je,d=(l=l==Qe?Je:l)==Je,p=c==l;if(p&&he(e)){if(!he(t))return!1;s=!0,f=!1}if(p&&!f)return a||(a=new V),s||Ee(e)?Q(e,t,n,o,i,a):function(e,t,n,o,i,a,s){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new Y(e),new Y(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return r(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var u=J;case"[object Set]":var c=1&o;if(u||(u=X),e.size!=t.size&&!c)return!1;var l=s.get(e);if(l)return l==t;o|=2,s.set(e,t);var f=Q(u(e),u(t),o,i,a,s);return s.delete(e),f;case"[object Symbol]":if(ee)return ee.call(e)==ee.call(t)}return!1}(e,t,c,n,o,i,a);if(!(1&n)){var h=f&&Xe.call(e,"__wrapped__"),y=d&&Xe.call(t,"__wrapped__");if(h||y){var m=h?e.value():e,g=y?t.value():t;return a||(a=new V),i(m,g,n,o,a)}}return!!p&&(a||(a=new V),function(e,t,n,r,o,i){var a=1&n,s=Ce(e),u=s.length;if(u!=Ce(t).length&&!a)return!1;for(var c=u;c--;){var l=s[c];if(!(a?l in t:Ne.call(t,l)))return!1}var f=i.get(e),d=i.get(t);if(f&&d)return f==t&&d==e;var p=!0;i.set(e,t),i.set(t,e);for(var h=a;++c<u;){var y=e[l=s[c]],m=t[l];if(r)var g=a?r(m,y,l,t,e,i):r(y,m,l,e,t,i);if(!(void 0===g?y===m||o(y,m,n,r,i):g)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var v=e.constructor,b=t.constructor;v==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b||(p=!1)}return i.delete(e),i.delete(t),p}(e,t,n,o,i,a))},et=function e(t,n,r,o,i){return t===n||(null==t||null==n||!ie(t)&&!ie(n)?t!=t&&n!=n:Ze(t,n,r,o,e,i))},tt=function(e,t){return et(e,t)};function nt(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function rt(e){return function t(n){return 0===arguments.length||nt(n)?t:e.apply(this,arguments)}}function ot(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return nt(n)?t:rt((function(t){return e(n,t)}));default:return nt(n)&&nt(r)?t:nt(n)?rt((function(t){return e(t,r)})):nt(r)?rt((function(t){return e(n,t)})):e(n,r)}}}function it(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function at(e,t,n){for(var r=0,o=n.length;r<o;){if(e(t,n[r]))return!0;r+=1}return!1}function st(e,t){return Object.prototype.hasOwnProperty.call(t,e)}const ut="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var ct=Object.prototype.toString,lt=function(){return"[object Arguments]"===ct.call(arguments)?function(e){return"[object Arguments]"===ct.call(e)}:function(e){return st("callee",e)}}();const ft=lt;var dt=!{toString:null}.propertyIsEnumerable("toString"),pt=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],ht=function(){return arguments.propertyIsEnumerable("length")}(),yt=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1};const mt="function"!=typeof Object.keys||ht?rt((function(e){if(Object(e)!==e)return[];var t,n,r=[],o=ht&&ft(e);for(t in e)!st(t,e)||o&&"length"===t||(r[r.length]=t);if(dt)for(n=pt.length-1;n>=0;)st(t=pt[n],e)&&!yt(r,t)&&(r[r.length]=t),n-=1;return r})):rt((function(e){return Object(e)!==e?[]:Object.keys(e)})),gt=rt((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function vt(e,t,n,r){var o=it(e);function i(e,t){return bt(e,t,n.slice(),r.slice())}return!at((function(e,t){return!at(i,t,e)}),it(t),o)}function bt(e,t,n,r){if(ut(e,t))return!0;var o=gt(e);if(o!==gt(t))return!1;if(null==e||null==t)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(o){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]}(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!ut(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!ut(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var i=n.length-1;i>=0;){if(n[i]===e)return r[i]===t;i-=1}switch(o){case"Map":return e.size===t.size&&vt(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&vt(e.values(),t.values(),n.concat([e]),r.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var a=mt(e);if(a.length!==mt(t).length)return!1;var s=n.concat([e]),u=r.concat([t]);for(i=a.length-1;i>=0;){var c=a[i];if(!st(c,t)||!bt(t[c],e[c],s,u))return!1;i-=1}return!0}var wt=ot((function(e,t){return bt(e,t,[],[])}));const _t=wt;function St(e,t,n,r){var o,i=function(o){for(var i=t.length,a=0;a<i;){if(e===t[a])return n[a];a+=1}for(var s in t[a+1]=e,n[a+1]=o,e)o[s]=r?St(e[s],t,n,!0):e[s];return o};switch(gt(e)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(e.valueOf());case"RegExp":return o=e,new RegExp(o.source,(o.global?"g":"")+(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.sticky?"y":"")+(o.unicode?"u":""));default:return e}}const Ot=rt((function(e){return null!=e&&"function"==typeof e.clone?e.clone():St(e,[],[],!0)}));function Et(e){return function t(n,r,o){switch(arguments.length){case 0:return t;case 1:return nt(n)?t:ot((function(t,r){return e(n,t,r)}));case 2:return nt(n)&&nt(r)?t:nt(n)?ot((function(t,n){return e(t,r,n)})):nt(r)?ot((function(t,r){return e(n,t,r)})):rt((function(t){return e(n,r,t)}));default:return nt(n)&&nt(r)&&nt(o)?t:nt(n)&&nt(r)?ot((function(t,n){return e(t,n,o)})):nt(n)&&nt(o)?ot((function(t,n){return e(t,r,n)})):nt(r)&&nt(o)?ot((function(t,r){return e(n,t,r)})):nt(n)?rt((function(t){return e(t,r,o)})):nt(r)?rt((function(t){return e(n,t,o)})):nt(o)?rt((function(t){return e(n,r,t)})):e(n,r,o)}}}const kt=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};var Pt=rt((function(e){return!!kt(e)||!!e&&"object"==typeof e&&!function(e){return"[object String]"===Object.prototype.toString.call(e)}(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1))}));const xt=Pt;var jt=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}(),Tt=ot((function(e,t){return function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,o){return t.apply(this,arguments)};case 5:return function(e,n,r,o,i){return t.apply(this,arguments)};case 6:return function(e,n,r,o,i,a){return t.apply(this,arguments)};case 7:return function(e,n,r,o,i,a,s){return t.apply(this,arguments)};case 8:return function(e,n,r,o,i,a,s,u){return t.apply(this,arguments)};case 9:return function(e,n,r,o,i,a,s,u,c){return t.apply(this,arguments)};case 10:return function(e,n,r,o,i,a,s,u,c,l){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}(e.length,(function(){return e.apply(t,arguments)}))}));const At=Tt;function Ct(e,t,n){for(var r=n.next();!r.done;){if((t=e["@@transducer/step"](t,r.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r=n.next()}return e["@@transducer/result"](t)}function Nt(e,t,n,r){return e["@@transducer/result"](n[r](At(e["@@transducer/step"],e),t))}var Dt="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";const Rt=Et((function(e,t,n){if("function"==typeof e&&(e=function(e){return new jt(e)}(e)),xt(n))return function(e,t,n){for(var r=0,o=n.length;r<o;){if((t=e["@@transducer/step"](t,n[r]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r+=1}return e["@@transducer/result"](t)}(e,t,n);if("function"==typeof n["fantasy-land/reduce"])return Nt(e,t,n,"fantasy-land/reduce");if(null!=n[Dt])return Ct(e,t,n[Dt]());if("function"==typeof n.next)return Ct(e,t,n);if("function"==typeof n.reduce)return Nt(e,t,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}));function It(e){return"[object Object]"===Object.prototype.toString.call(e)}var Mt=Et((function(e,t,n){var r,o={};for(r in t)st(r,t)&&(o[r]=st(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)st(r,n)&&!st(r,o)&&(o[r]=n[r]);return o}));const Lt=Mt;var Ut=Et((function e(t,n,r){return Lt((function(n,r,o){return It(r)&&It(o)?e(t,r,o):t(n,r,o)}),n,r)}));const $t=Ut,Bt=ot((function(e,t){return $t((function(e,t,n){return n}),e,t)}));var Ft,Kt;function zt(e,t){return n=>{if(!e(n))return"function"==typeof t?t(n):t}}(Kt=Ft||(Ft={})).Array="Array",Kt.Boolean="Boolean",Kt.ConceptUuid="ConceptUuid",Kt.Number="Number",Kt.Object="Object",Kt.String="String",Kt.UUID="UUID",Kt.PersonAttributeTypeUuid="PersonAttributeTypeUuid",Kt.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid";const Wt=zt((e=>Array.isArray(e)),"must be an array"),Vt=zt((e=>"boolean"==typeof e),"must be a boolean"),qt=zt((e=>"number"==typeof e),"must be a number"),Ht=zt((e=>"string"==typeof e),"must be a string"),Gt=zt((e=>"object"==typeof e&&!Array.isArray(e)&&null!==e),"must be an object (not an array or null)"),Qt=zt((e=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[0-9a-f]{36}$/i.test(e)),"must be a valid UUID or a 36-character hexadecimal string");var Yt=i(403);const Jt=(0,Yt.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{}}),Xt=(0,Yt.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});Xt.subscribe((e=>{var t;t=e.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}));const Zt=(0,Yt.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]});function en(e){return(0,Yt.getGlobalStore)(`config-module-${e}`,{config:null,loaded:!1})}function tn(){return(0,Yt.getGlobalStore)("config-extension-slots",{slots:{}})}function nn(e,t){const n=e.slots[t];return null!=n?n:{loaded:!1,config:{}}}function rn(){return(0,Yt.getGlobalStore)("config-extensions",{configs:{}})}function on(e,t,n){var r;const o=null===(r=e.configs[t])||void 0===r?void 0:r[n];return null!=o?o:{loaded:!1,config:null}}const an=(0,Yt.createGlobalStore)("config-implementer-tools",{config:{}});function sn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function un(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){sn(e,t,n[t])}))}return e}function cn(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function ln(e,t){for(let n of Object.keys(e.schemas)){const r=bn(n,e,t);en(n).setState({loaded:!0,config:r})}}function fn(e,t){const n=function(e,t){const n=_n(vn(e,t)),r=Object.keys(n).reduce(((e,t)=>{var r,o;return(null===(r=n[t])||void 0===r?void 0:r.extensionSlots)&&(e[t]=null===(o=n[t])||void 0===o?void 0:o.extensionSlots),e}),{});return function(e){for(let[t,n]of Object.entries(e))for(let[e,r]of Object.entries(n))gn(r,t,e)}(r),Object.keys(r).reduce(((e,t)=>un({},e,r[t])),{})}(e,t),r=Object.fromEntries(Object.entries(n).map((([e,t])=>[e,{loaded:!0,config:t}]))),o=tn(),i=o.getState(),a={slots:un({},i.slots,r)};_t(i,a)||o.setState(a)}function dn(e,t){const n=function(e,t){let n=yn(Ot(e.schemas));const r=[...e.providedConfigs.map((e=>[e.config,e.source])),[t.config,"temporary config"]];for(let[e,t]of r)n=_n([n,mn(e,t)]);return n}(e,t);an.setState({config:n})}function pn(e,t,n){const r={};for(let o of t.mountedExtensions){const t=hn(o.slotModuleName,o.extensionModuleName,o.slotName,o.extensionId,e,n);r[o.slotName]=cn(un({},r[o.slotName]),{[o.extensionId]:{config:t,loaded:!0}})}rn().setState({configs:r})}function hn(e,t,n,r,o,i){var a,s,u;const c=function(e){const[t]=e.split("#");return t}(r),l=o.schemas[c],f=l?c:t,d=vn(o,i),p=wn(e,d);var h;const y=null!==(h=null==p||null===(a=p.extensionSlots)||void 0===a||null===(s=a[n])||void 0===s||null===(u=s.configure)||void 0===u?void 0:u[r])&&void 0!==h?h:{},m=_n([wn(f,d),y]),g=null!=l?l:o.schemas[t];Sn(g,m,f);const v=xn(g,m);return En(g,v,f),delete v.extensionSlots,v}function yn(e){return e.hasOwnProperty("_default")?cn(un({},e),{_value:e._default,_source:"default"}):Tn(e)?Object.keys(e).reduce(((t,n)=>(t[n]=yn(e[n]),t)),{}):{}}function mn(e,t){return Tn(e)?Object.keys(e).reduce(((n,r)=>(n[r]=mn(e[r],t),n)),{}):{_value:e,_source:t}}function gn(e,t,n){const r=`Extension slot config '${t}.extensionSlots.${n}`,o=Object.keys(e).filter((e=>!["add","remove","order","configure"].includes(e)));o.length&&console.error(r+`' contains invalid keys '${o.join("', '")}'`),e.add&&(Array.isArray(e.add)&&e.add.every((e=>"string"==typeof e))||console.error(r+".add' is invalid. Must be an array of strings (extension IDs)")),e.remove&&(Array.isArray(e.remove)&&e.remove.every((e=>"string"==typeof e))||console.error(r+".remove' is invalid. Must be an array of strings (extension IDs)")),e.order&&(Array.isArray(e.order)&&e.order.every((e=>"string"==typeof e))||console.error(r+".order' is invalid. Must be an array of strings (extension IDs)")),e.configure&&(Tn(e.configure)||console.error(r+".configure' is invalid. Must be an object with extension IDs for keys"))}function vn(e,t){return[...e.providedConfigs.map((e=>e.config)),t.config]}function bn(e,t,n){if(!t.schemas.hasOwnProperty(e))throw Error("No config schema has been defined for "+e);const r=t.schemas[e],o=wn(e,vn(t,n));Sn(r,o,e);const i=xn(r,o);return En(r,i,e),delete i.extensionSlots,i}function wn(e,t){return _n(t.map((({[e]:t})=>t)).filter((e=>!!e)))}function _n(e){return Rt(Bt)({},e)}function Sn(e,t,n=""){for(const r of Object.keys(t)){const o=t[r],i=n+"."+r,a=e[r];e.hasOwnProperty(r)?On(a,o,i):"extensionSlots"===r&&""!==n||console.error(`Unknown config key '${i}' provided. Ignoring.`)}}function On(e,t,n){kn(n,e._type,t),Tn(t)?e._type===Ft.Object?function(e,t,n){if(e._elements)for(const r of Object.keys(t)){const o=t[r];Sn(e._elements,o,`${n}.${r}`)}}(e,t,n):e.hasOwnProperty("_default")||Sn(e,t,n):e._type===Ft.Array&&function(e,t,n){if(jn(e._elements))for(let r=0;r<t.length;r++)On(e._elements,t[r],`${n}[${r}]`);for(let o=0;o<t.length;o++){var r;kn(`${n}[${o}]`,null===(r=e._elements)||void 0===r?void 0:r._type,t[o])}}(e,t,n)}function En(e,t,n=""){if(e)if(t!==e._default&&Pn(n,e._validators,t),Tn(t))for(const r of Object.keys(t)){const o=t[r],i=n+"."+r,a=e[r];e._type===Ft.Object&&e._elements?En(e._elements,o,i):En(a,o,i)}else if(Array.isArray(t)&&e._elements)for(let r=0;r<t.length;r++)En(e._elements,t[r],`${n}[${r}]`)}function kn(e,t,n){t&&Pn(e,[{Array:Wt,Boolean:Vt,ConceptUuid:Qt,Number:qt,Object:Gt,String:Ht,UUID:Qt,PersonAttributeTypeUuid:Qt,PatientIdentifierTypeUuid:Qt}[t]],n)}function Pn(e,t,n){if(t)try{for(let r of t){const t=r(n);"string"==typeof t&&("object"==typeof n?console.error(`Invalid configuration for ${e}: ${t}`):console.error(`Invalid configuration value ${n} for ${e}: ${t}`))}}catch(t){console.error(`Skipping invalid validator at "${e}". Encountered error\n\t${t}`)}}ln(Jt.getState(),Xt.getState()),Jt.subscribe((e=>ln(e,Xt.getState()))),Xt.subscribe((e=>ln(Jt.getState(),e))),dn(Jt.getState(),Xt.getState()),Jt.subscribe((e=>dn(e,Xt.getState()))),Xt.subscribe((e=>dn(Jt.getState(),e))),fn(Jt.getState(),Xt.getState()),Jt.subscribe((e=>fn(e,Xt.getState()))),Xt.subscribe((e=>fn(Jt.getState(),e))),pn(Jt.getState(),Zt.getState(),Xt.getState()),Jt.subscribe((e=>{pn(e,Zt.getState(),Xt.getState())})),Zt.subscribe((e=>{pn(Jt.getState(),e,Xt.getState())})),Xt.subscribe((e=>{pn(Jt.getState(),Zt.getState(),e)}));const xn=(e,t)=>{const n=Ot(t);if(!e)return n;for(const t of Object.keys(e)){const r=n[t],o=e[t];if(o&&o.hasOwnProperty("_default")){n.hasOwnProperty(t)||(n[t]=o._default);const e=o._elements;if(r&&jn(e))if(o._type===Ft.Array&&Array.isArray(r)){const o=r.map((t=>xn(e,t)));n[t]=o}else if(o._type===Ft.Object)for(let t of Object.keys(r))r[t]=xn(e,r[t])}else if(Tn(o)){const e=n.hasOwnProperty(t)?r:{};Tn(e)&&(n[t]=xn(o,e))}}return n};function jn(e){return!!e&&Object.keys(e).filter((e=>!["_default","_validators"].includes(e))).length>0}function Tn(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}Ft.Array,Ft.Object;var An=Object.freeze({__proto__:null,get start(){return lo},get ensureJQuerySupport(){return $r},get setBootstrapMaxTime(){return wr},get setMountMaxTime(){return _r},get setUnmountMaxTime(){return Sr},get setUnloadMaxTime(){return Or},get registerApplication(){return Yr},get unregisterApplication(){return Xr},get getMountedApps(){return Hr},get getAppStatus(){return Qr},get unloadApplication(){return Zr},get checkActivityFunctions(){return Jr},get getAppNames(){return Gr},get pathToActiveWhen(){return no},get navigateToUrl(){return Cr},get triggerAppChange(){return ao},get addErrorHandler(){return Ln},get removeErrorHandler(){return Un},get mountRootParcel(){return yr},get NOT_LOADED(){return Fn},get LOADING_SOURCE_CODE(){return Kn},get NOT_BOOTSTRAPPED(){return zn},get BOOTSTRAPPING(){return Wn},get NOT_MOUNTED(){return Vn},get MOUNTING(){return qn},get UPDATING(){return Gn},get LOAD_ERROR(){return Yn},get MOUNTED(){return Hn},get UNMOUNTING(){return Qn},get SKIP_BECAUSE_BROKEN(){return Jn}});function Cn(e){return(Cn="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)}function Nn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Dn=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{}).CustomEvent,Rn=function(){try{var e=new Dn("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?Dn:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},In=[];function Mn(e,t,n){var r=Bn(e,t,n);In.length?In.forEach((function(e){return e(r)})):setTimeout((function(){throw r}))}function Ln(e){if("function"!=typeof e)throw Error($n(28,!1));In.push(e)}function Un(e){if("function"!=typeof e)throw Error($n(29,!1));var t=!1;return In=In.filter((function(n){var r=n===e;return t=t||r,!r})),t}function $n(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(e,": ").concat(t?t+" ":"","See https://single-spa.js.org/error/?code=").concat(e).concat(r.length?"&arg=".concat(r.join("&arg=")):"")}function Bn(e,t,n){var r,o="".concat(nr(t)," '").concat(er(t),"' died in status ").concat(t.status,": ");if(e instanceof Error){try{e.message=o+e.message}catch(e){}r=e}else{console.warn($n(30,!1,t.status,er(t)));try{r=Error(o+JSON.stringify(e))}catch(t){r=e}}return r.appOrParcelName=er(t),t.status=n,r}var Fn="NOT_LOADED",Kn="LOADING_SOURCE_CODE",zn="NOT_BOOTSTRAPPED",Wn="BOOTSTRAPPING",Vn="NOT_MOUNTED",qn="MOUNTING",Hn="MOUNTED",Gn="UPDATING",Qn="UNMOUNTING",Yn="LOAD_ERROR",Jn="SKIP_BECAUSE_BROKEN";function Xn(e){return e.status===Hn}function Zn(e){try{return e.activeWhen(window.location)}catch(t){return Mn(t,e,Jn),!1}}function er(e){return e.name}function tr(e){return Boolean(e.unmountThisParcel)}function nr(e){return tr(e)?"parcel":"application"}function rr(){for(var e=arguments.length-1;e>0;e--)for(var t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]}function or(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}function ir(e){return e&&("function"==typeof e||(t=e,Array.isArray(t)&&!or(t,(function(e){return"function"!=typeof e}))));var t}function ar(e,t){var n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=nr(e),o=er(e);return function(e){return n.reduce((function(n,i,a){return n.then((function(){var n=i(e);return sr(n)?n:Promise.reject($n(15,!1,r,o,t,a))}))}),Promise.resolve())}}function sr(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}function ur(e,t){return Promise.resolve().then((function(){return e.status!==zn?e:(e.status=Wn,e.bootstrap?Er(e,"bootstrap").then(n).catch((function(n){if(t)throw Bn(n,e,Jn);return Mn(n,e,Jn),e})):Promise.resolve().then(n))}));function n(){return e.status=Vn,e}}function cr(e,t){return Promise.resolve().then((function(){if(e.status!==Hn)return e;e.status=Qn;var n=Object.keys(e.parcels).map((function(t){return e.parcels[t].unmountThisParcel()}));return Promise.all(n).then(r,(function(n){return r().then((function(){var r=Error(n.message);if(t)throw Bn(r,e,Jn);Mn(r,e,Jn)}))})).then((function(){return e}));function r(){return Er(e,"unmount").then((function(){e.status=Vn})).catch((function(n){if(t)throw Bn(n,e,Jn);Mn(n,e,Jn)}))}}))}var lr=!1,fr=!1;function dr(e,t){return Promise.resolve().then((function(){return e.status!==Vn?e:(lr||(window.dispatchEvent(new Rn("single-spa:before-first-mount")),lr=!0),Er(e,"mount").then((function(){return e.status=Hn,fr||(window.dispatchEvent(new Rn("single-spa:first-mount")),fr=!0),e})).catch((function(n){return e.status=Hn,cr(e,!0).then(r,r);function r(){if(t)throw Bn(n,e,Jn);return Mn(n,e,Jn),e}})))}))}var pr=0,hr={parcels:{}};function yr(){return mr.apply(hr,arguments)}function mr(e,t){var n=this;if(!e||"object"!==Cn(e)&&"function"!=typeof e)throw Error($n(2,!1));if(e.name&&"string"!=typeof e.name)throw Error($n(3,!1,Cn(e.name)));if("object"!==Cn(t))throw Error($n(4,!1,name,Cn(t)));if(!t.domElement)throw Error($n(5,!1,name));var r,o=pr++,i="function"==typeof e,a=i?e:function(){return Promise.resolve(e)},s={id:o,parcels:{},status:i?Kn:zn,customProps:t,parentName:er(n),unmountThisParcel:function(){return d.then((function(){if(s.status!==Hn)throw Error($n(6,!1,name,s.status));return cr(s,!0)})).then((function(e){return s.parentName&&delete n.parcels[s.id],e})).then((function(e){return c(e),e})).catch((function(e){throw s.status=Jn,l(e),e}))}};n.parcels[o]=s;var u=a();if(!u||"function"!=typeof u.then)throw Error($n(7,!1));var c,l,f=(u=u.then((function(e){if(!e)throw Error($n(8,!1));var t=e.name||"parcel-".concat(o);if(Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!ir(e.bootstrap))throw Error($n(9,!1,t));if(!ir(e.mount))throw Error($n(10,!1,t));if(!ir(e.unmount))throw Error($n(11,!1,t));if(e.update&&!ir(e.update))throw Error($n(12,!1,t));var n=ar(e,"bootstrap"),i=ar(e,"mount"),a=ar(e,"unmount");s.status=zn,s.name=t,s.bootstrap=n,s.mount=i,s.unmount=a,s.timeouts=kr(e.timeouts),e.update&&(s.update=ar(e,"update"),r.update=function(e){return s.customProps=e,gr(function(e){return Promise.resolve().then((function(){if(e.status!==Hn)throw Error($n(32,!1,er(e)));return e.status=Gn,Er(e,"update").then((function(){return e.status=Hn,e})).catch((function(t){throw Bn(t,e,Jn)}))}))}(s))})}))).then((function(){return ur(s,!0)})),d=f.then((function(){return dr(s,!0)})),p=new Promise((function(e,t){c=e,l=t}));return r={mount:function(){return gr(Promise.resolve().then((function(){if(s.status!==Vn)throw Error($n(13,!1,name,s.status));return n.parcels[o]=s,dr(s)})))},unmount:function(){return gr(s.unmountThisParcel())},getStatus:function(){return s.status},loadPromise:gr(u),bootstrapPromise:gr(f),mountPromise:gr(d),unmountPromise:gr(p)}}function gr(e){return e.then((function(){return null}))}function vr(e){var t=er(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!==Cn(n)||null===n||Array.isArray(n))&&(n={},console.warn($n(40,!1),t,n));var r=rr({},n,{name:t,mountParcel:mr.bind(e),singleSpa:An});return tr(e)&&(r.unmountSelf=e.unmountThisParcel),r}var br={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function wr(e,t,n){if("number"!=typeof e||e<=0)throw Error($n(16,!1));br.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function _r(e,t,n){if("number"!=typeof e||e<=0)throw Error($n(17,!1));br.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function Sr(e,t,n){if("number"!=typeof e||e<=0)throw Error($n(18,!1));br.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function Or(e,t,n){if("number"!=typeof e||e<=0)throw Error($n(19,!1));br.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function Er(e,t){var n=e.timeouts[t],r=n.warningMillis,o=nr(e);return new Promise((function(i,a){var s=!1,u=!1;e[t](vr(e)).then((function(e){s=!0,i(e)})).catch((function(e){s=!0,a(e)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=$n(31,!1,t,o,er(e),n.millis);function l(e){if(!s)if(!0===e)u=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!u){var t=e,o=t*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(t+1)}),r)}}}))}function kr(e){var t={};for(var n in br)t[n]=rr({},br[n],e&&e[n]||{});return t}function Pr(e){return Promise.resolve().then((function(){return e.loadPromise?e.loadPromise:e.status!==Fn&&e.status!==Yn?e:(e.status=Kn,e.loadPromise=Promise.resolve().then((function(){var r=e.loadApp(vr(e));if(!sr(r))throw n=!0,Error($n(33,!1,er(e)));return r.then((function(n){var r;e.loadErrorTime=null,"object"!==Cn(t=n)&&(r=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!ir(t.bootstrap)&&(r=35),ir(t.mount)||(r=36),ir(t.unmount)||(r=37);var o=nr(t);if(r){var i;try{i=JSON.stringify(t)}catch(e){}return console.error($n(r,!1,o,er(e),i),t),Mn(void 0,e,Jn),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=rr({},e.devtools.overlays,t.devtools.overlays)),e.status=zn,e.bootstrap=ar(t,"bootstrap"),e.mount=ar(t,"mount"),e.unmount=ar(t,"unmount"),e.unload=ar(t,"unload"),e.timeouts=kr(t.timeouts),delete e.loadPromise,e}))})).catch((function(t){var r;return delete e.loadPromise,n?r=Jn:(r=Yn,e.loadErrorTime=(new Date).getTime()),Mn(t,e,r),e})));var t,n}))}var xr,jr="undefined"!=typeof window,Tr={hashchange:[],popstate:[]},Ar=["hashchange","popstate"];function Cr(e){var t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error($n(14,!1));t=e.currentTarget.href,e.preventDefault()}var n=Lr(window.location.href),r=Lr(t);0===t.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)}function Nr(e){var t=this;if(e){var n=e[0].type;Ar.indexOf(n)>=0&&Tr[n].forEach((function(n){try{n.apply(t,e)}catch(e){setTimeout((function(){throw e}))}}))}}function Dr(){so([],arguments)}function Rr(e,t){return function(){var n=window.location.href,r=e.apply(this,arguments),o=window.location.href;return xr&&n===o||(fo()?window.dispatchEvent(function(e,t){var n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)):so([])),r}}if(jr){window.addEventListener("hashchange",Dr),window.addEventListener("popstate",Dr);var Ir=window.addEventListener,Mr=window.removeEventListener;window.addEventListener=function(e,t){if(!("function"==typeof t&&Ar.indexOf(e)>=0)||or(Tr[e],(function(e){return e===t})))return Ir.apply(this,arguments);Tr[e].push(t)},window.removeEventListener=function(e,t){if(!("function"==typeof t&&Ar.indexOf(e)>=0))return Mr.apply(this,arguments);Tr[e]=Tr[e].filter((function(e){return e!==t}))},window.history.pushState=Rr(window.history.pushState,"pushState"),window.history.replaceState=Rr(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn($n(41,!1)):window.singleSpaNavigate=Cr}function Lr(e){var t=document.createElement("a");return t.href=e,t}var Ur=!1;function $r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!Ur){var t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return Br.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return Br.call(this,n,window.removeEventListener,e,t,arguments)},Ur=!0}}function Br(e,t,n,r,o){return"string"!=typeof n?e.apply(this,o):(n.split(/\s+/).forEach((function(e){Ar.indexOf(e)>=0&&(t(e,r),n=n.replace(e,""))})),""===n.trim()?this:e.apply(this,o))}var Fr={};function Kr(e){return Promise.resolve().then((function(){var t=Fr[er(e)];if(!t)return e;if(e.status===Fn)return zr(e,t),e;if("UNLOADING"===e.status)return t.promise.then((function(){return e}));if(e.status!==Vn&&e.status!==Yn)return e;var n=e.status===Yn?Promise.resolve():Er(e,"unload");return e.status="UNLOADING",n.then((function(){return zr(e,t),e})).catch((function(n){return function(e,t,n){delete Fr[er(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,Mn(n,e,Jn),t.reject(n)}(e,t,n),e}))}))}function zr(e,t){delete Fr[er(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=Fn,t.resolve()}function Wr(e,t,n,r){Fr[er(e)]={app:e,resolve:n,reject:r},Object.defineProperty(Fr[er(e)],"promise",{get:t})}function Vr(e){return Fr[e]}var qr=[];function Hr(){return qr.filter(Xn).map(er)}function Gr(){return qr.map(er)}function Qr(e){var t=or(qr,(function(t){return er(t)===e}));return t?t.status:null}function Yr(e,t,n,r){var o=function(e,t,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===Cn(e)?(function(e){if(Array.isArray(e)||null===e)throw Error($n(39,!1));var t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((function(e,n){return t.indexOf(n)>=0?e:e.concat(n)}),[]);if(0!==n.length)throw Error($n(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length)throw Error($n(20,!1));if("object"!==Cn(e.app)&&"function"!=typeof e.app)throw Error($n(20,!1));var r=function(e){return"string"==typeof e||"function"==typeof e};if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error($n(24,!1));if(!to(e.customProps))throw Error($n(22,!1))}(e),i.name=e.name,i.loadApp=e.app,i.activeWhen=e.activeWhen,i.customProps=e.customProps):(function(e,t,n,r){if("string"!=typeof e||0===e.length)throw Error($n(20,!1));if(!t)throw Error($n(23,!1));if("function"!=typeof n)throw Error($n(24,!1));if(!to(r))throw Error($n(22,!1))}(e,t,n,r),i.name=e,i.loadApp=t,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(e){return e||{}}(i.customProps),i.activeWhen=function(e){var t=Array.isArray(e)?e:[e];return t=t.map((function(e){return"function"==typeof e?e:no(e)})),function(e){return t.some((function(t){return t(e)}))}}(i.activeWhen),i}(e,t,n,r);if(-1!==Gr().indexOf(o.name))throw Error($n(21,!1,o.name));qr.push(rr({loadErrorTime:null,status:Fn,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),jr&&($r(),so())}function Jr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return qr.filter((function(t){return t.activeWhen(e)})).map(er)}function Xr(e){if(0===qr.filter((function(t){return er(t)===e})).length)throw Error($n(25,!1,e));return Zr(e).then((function(){var t=qr.map(er).indexOf(e);qr.splice(t,1)}))}function Zr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof e)throw Error($n(26,!1));var n=or(qr,(function(t){return er(t)===e}));if(!n)throw Error($n(27,!1,e));var r,o=Vr(er(n));if(t&&t.waitForUnmount){if(o)return o.promise;var i=new Promise((function(e,t){Wr(n,(function(){return i}),e,t)}));return i}return o?(r=o.promise,eo(n,o.resolve,o.reject)):r=new Promise((function(e,t){Wr(n,(function(){return r}),e,t),eo(n,e,t)})),r}function eo(e,t,n){cr(e).then(Kr).then((function(){t(),setTimeout((function(){so()}))})).catch(n)}function to(e){return!e||"function"==typeof e||"object"===Cn(e)&&null!==e&&!Array.isArray(e)}function no(e,t){var n=function(e,t){var n=0,r=!1,o="^";"/"!==e[0]&&(e="/"+e);for(var i=0;i<e.length;i++){var a=e[i];(!r&&":"===a||r&&"/"===a)&&s(i)}return s(e.length),new RegExp(o,"i");function s(i){var a=e.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===e.length)if(r)t&&(o+="$");else{var s=t?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(s,"$"):"".concat(o,"(/").concat(s,")?(#.*)?$")}r=!r,n=i}}(e,t);return function(e){var t=e.origin;t||(t="".concat(e.protocol,"//").concat(e.host));var r=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(r)}}var ro=!1,oo=[],io=jr&&window.location.href;function ao(){return so()}function so(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if(ro)return new Promise((function(e,n){oo.push({resolve:e,reject:n,eventArguments:t})}));var n,r=function(){var e=[],t=[],n=[],r=[],o=(new Date).getTime();return qr.forEach((function(i){var a=i.status!==Jn&&Zn(i);switch(i.status){case Yn:a&&o-i.loadErrorTime>=200&&n.push(i);break;case Fn:case Kn:a&&n.push(i);break;case zn:case Vn:!a&&Vr(er(i))?e.push(i):a&&r.push(i);break;case Hn:a||t.push(i)}})),{appsToUnload:e,appsToUnmount:t,appsToLoad:n,appsToMount:r}}(),o=r.appsToUnload,i=r.appsToUnmount,a=r.appsToLoad,s=r.appsToMount,u=!1,c=io,l=io=window.location.href;return fo()?(ro=!0,n=o.concat(a,i,s),Promise.resolve().then((function(){if(window.dispatchEvent(new Rn(0===n.length?"single-spa:before-no-app-change":"single-spa:before-app-change",h(!0))),window.dispatchEvent(new Rn("single-spa:before-routing-event",h(!0,{cancelNavigation:f}))),u)return window.dispatchEvent(new Rn("single-spa:before-mount-routing-event",h(!0))),d(),void Cr(c);var t=o.map(Kr),r=i.map(cr).map((function(e){return e.then(Kr)})).concat(t),l=Promise.all(r);l.then((function(){window.dispatchEvent(new Rn("single-spa:before-mount-routing-event",h(!0)))}));var y=a.map((function(e){return Pr(e).then((function(e){return uo(e,l)}))})),m=s.filter((function(e){return a.indexOf(e)<0})).map((function(e){return uo(e,l)}));return l.catch((function(e){throw p(),e})).then((function(){return p(),Promise.all(y.concat(m)).catch((function(t){throw e.forEach((function(e){return e.reject(t)})),t})).then(d)}))}))):(n=a,Promise.resolve().then((function(){var e=a.map(Pr);return Promise.all(e).then(p).then((function(){return[]})).catch((function(e){throw p(),e}))})));function f(){u=!0}function d(){var t=Hr();e.forEach((function(e){return e.resolve(t)}));try{var r=0===n.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new Rn(r,h())),window.dispatchEvent(new Rn("single-spa:routing-event",h()))}catch(e){setTimeout((function(){throw e}))}if(ro=!1,oo.length>0){var o=oo;oo=[],so(o)}return t}function p(){e.forEach((function(e){Nr(e.eventArguments)})),Nr(t)}function h(){var e,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],f=arguments.length>1?arguments[1]:void 0,d={},p=(Nn(e={},Hn,[]),Nn(e,Vn,[]),Nn(e,Fn,[]),Nn(e,Jn,[]),e);r?(a.concat(s).forEach((function(e,t){y(e,Hn)})),o.forEach((function(e){y(e,Fn)})),i.forEach((function(e){y(e,Vn)}))):n.forEach((function(e){y(e)}));var h={detail:{newAppStatuses:d,appsByNewStatus:p,totalAppChanges:n.length,originalEvent:null==t?void 0:t[0],oldUrl:c,newUrl:l,navigationIsCanceled:u}};return f&&rr(h.detail,f),h;function y(e,t){var n=er(e);t=t||Qr(n),d[n]=t,(p[t]=p[t]||[]).push(n)}}}function uo(e,t){return Zn(e)?ur(e).then((function(e){return t.then((function(){return Zn(e)?dr(e):e}))})):t.then((function(){return e}))}var co=!1;function lo(e){var t;co=!0,e&&e.urlRerouteOnly&&(t=e.urlRerouteOnly,xr=t),jr&&so()}function fo(){return co}jr&&setTimeout((function(){co||console.warn($n(1,!1))}),5e3);var po={getRawAppData:function(){return[].concat(qr)},reroute:so,NOT_LOADED:Fn,toLoadPromise:Pr,toBootstrapPromise:ur,unregisterApplication:Xr};jr&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=po);const ho=((e=>{const t=[].concat(["openmrsBase","openmrsSpaBase"]);zt((e=>{if(!e||"string"!=typeof e)return!1;const n=/\${(.*?)}/g;let r=n.exec(e);for(;r;){if(!t.includes(r[1]))return!1;r=n.exec(e)}return!0}),"Should be a URL or path. The allowed template parameters are "+t.map((e=>"${"+e+"}")).join(", "))})(),(0,Yt.createGlobalStore)("extensionsInternal",{slots:{},extensions:{}})),yo=()=>(0,Yt.getGlobalStore)("extensionsInternal",{slots:{},extensions:{}});function mo(e){const t=ho.getState(),n=e(t);n!==t&&ho.setState(n)}const go=()=>(0,Yt.getGlobalStore)("extensions",{slots:{}});function vo(e){const t=[];for(let n of Object.values(e.extensions))for(let e of n.instances)t.push({slotModuleName:e.slotModuleName,extensionModuleName:n.moduleName,slotName:e.slotName,extensionId:e.id});tt(Zt.getState().mountedExtensions,t)||Zt.setState({mountedExtensions:t})}vo(ho.getState()),ho.subscribe(vo);var bo=i(840);const wo=function(e){return void 0===e};function _o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function So(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){_o(e,t,n[t])}))}return e}function Oo(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}const Eo=yo(),ko=go(),Po=tn(),xo=rn();function jo(e,t,n){const r={};for(let[o,i]of Object.entries(e.slots)){const{config:a}=nn(t,i.name),s=$o(o,e,a,n);r[o]={moduleName:i.moduleName,assignedExtensions:s}}tt(ko.getState().slots,r)||ko.setState({slots:r})}function To(e,t){return{moduleName:t,name:e,attachedIds:[],config:null}}function Ao(e){const[t]=e.split("#");return t}function Co(e,t){const n=Ao(t);return e.extensions[n]}function No(e){return Co(Eo.getState(),e)}Eo.subscribe((e=>{jo(e,Po.getState(),xo.getState())})),Po.subscribe((e=>{jo(Eo.getState(),e,xo.getState())})),xo.subscribe((e=>{jo(Eo.getState(),Po.getState(),e)}));const Do=e=>Eo.setState((t=>(t.extensions[e.name]=Oo(So({},e),{instances:[]}),t)));function Ro(e,t){mo((n=>{const r=n.slots[e];return Oo(So({},n),r?{slots:Oo(So({},n.slots),{[e]:Oo(So({},r),{attachedIds:[...r.attachedIds,t]})})}:{slots:Oo(So({},n.slots),{[e]:Oo(So({},To(e)),{attachedIds:[t]})})})}))}function Io(e,t){mo((n=>{const r=n.slots[e];return r&&r.attachedIds.includes(t)?Oo(So({},n),{slots:Oo(So({},n.slots),{[e]:Oo(So({},r),{attachedIds:r.attachedIds.filter((e=>e!==t))})})}):n}))}function Mo(e){mo((t=>{const n=t.slots[e];return n?Oo(So({},t),{slots:Oo(So({},t.slots),{[e]:Oo(So({},n),{attachedIds:[]})})}):t}))}function Lo(e,t,n,r){const o=t.indexOf(e);if(-1!==o)return o;if(void 0!==n)return 1e3+n;{const t=r.indexOf(e);return-1!==t?2e3+t:-1}}function Uo(e,t=null){const n=null!=t?t:navigator.onLine;return e.filter((e=>Wo(n,e.online,e.offline)))}function $o(e,t,n,r){const o=function(e,t){const n=e.add||[],r=e.remove||[],o=e.order||[],{extensions:i}=Eo.getState();return[...t,...n].filter((e=>!r.includes(e))).sort(((e,n)=>{var r,a;const s=Lo(e,o,null===(r=i[Ao(e)])||void 0===r?void 0:r.order,t),u=Lo(n,o,null===(a=i[Ao(n)])||void 0===a?void 0:a.order,t);return-1===u?-1:-1===s?1:s-u}))}(n,t.slots[e].attachedIds),i=[];let a;for(let n of o){const{config:o}=on(r,e,n),f=Ao(n),d=t.extensions[f];if(d){var s,u,c;const e=null!==(c=null!==(u=null==o||null===(s=o["Display conditions"])||void 0===s?void 0:s.privileges)&&void 0!==u?u:d.privileges)&&void 0!==c?c:[];if(e&&("string"==typeof e||Array.isArray(e)&&e.length>0)){var l;if(wo(a)&&(a=null===(l=(0,bo.getSessionStore)().getState().session)||void 0===l?void 0:l.user),!a)continue;if(!(0,bo.userHasAccess)(e,a))continue}i.push({id:n,name:f,moduleName:d.moduleName,config:o,meta:d.meta})}}return i}function Bo(e){const t=Eo.getState(),{config:n}=function(e){return nn(tn().getState(),e)}(e);return $o(e,t,n,xo.getState())}const Fo=(e,t)=>Eo.setState((n=>{var r;const o=null===(r=n.slots[t])||void 0===r?void 0:r.moduleName;if(o&&o!=e)return console.warn(`An extension slot with the name '${t}' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ${o}.`),n;if(o&&o==e)return n;if(n.slots[t])return Oo(So({},n),{slots:Oo(So({},n.slots),{[t]:Oo(So({},n.slots[t]),{moduleName:e})})});const i=To(t,e);return Oo(So({},n),{slots:Oo(So({},n.slots),{[t]:i})})})),Ko=()=>ko.setState((()=>({slots:{},extensions:{}})));function zo(e=!0,t=!1){return Wo(navigator.onLine,e,t)}function Wo(e,t=!0,n=!1){return Boolean(e?t:n)}function Vo(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function qo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ho(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){qo(e,t,n[t])}))}return e}function Go(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function Qo(e,t,n,r){return Yo.apply(this,arguments)}function Yo(){var e;return e=function*(e,t,n,r,o=(e=>e),i={}){const a=Ao(r),s=No(r);let u=null;if(e){if(!s)throw Error(`Couldn't find extension '${a}' to attach to '${t}'`);const{load:c,meta:l,moduleName:f,online:d,offline:p}=s;if(zo(d,p)){mo((o=>{const i={domElement:e,id:r,slotName:t,slotModuleName:n};return Go(Ho({},o),{extensions:Go(Ho({},o.extensions),{[a]:Go(Ho({},o.extensions[a]),{instances:[...o.extensions[a].instances,i]})})})}));const s=yield c(),{default:d}=s,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(s,["default"]);u=yr(o(null!=d?d:p),Go(Ho({},i),{_meta:l,_extensionContext:{extensionId:r,extensionSlotName:t,extensionSlotModuleName:n,extensionModuleName:f},domElement:e}))}}else console.warn(`Tried to render ${r} into ${t} but no DOM element was available.`);return u},Yo=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Vo(i,r,o,a,s,"next",e)}function s(e){Vo(i,r,o,a,s,"throw",e)}a(void 0)}))},Yo.apply(this,arguments)}const Jo=yo()})()})()},758:()=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{dispatchActionableNotificationShown:()=>p,dispatchConnectivityChanged:()=>r,dispatchNotificationShown:()=>d,dispatchPrecacheStaticDependencies:()=>s,subscribeActionableNotificationShown:()=>y,subscribeConnectivity:()=>i,subscribeConnectivityChanged:()=>o,subscribeNotificationShown:()=>h,subscribePrecacheStaticDependencies:()=>u,subscribeToastShown:()=>m});const n="openmrs:connectivity-changed";function r(e){window.dispatchEvent(new CustomEvent(n,{detail:{online:e}}))}function o(e){const t=t=>e(t.detail);return window.addEventListener(n,t),()=>window.removeEventListener(n,t)}function i(e){return e({online:navigator.onLine}),o(e)}const a="openmrs:precache-static-dependencies";function s(e={}){window.dispatchEvent(new CustomEvent(a,{detail:e}))}function u(e){const t=t=>e(t.detail);return window.addEventListener(a,t),()=>window.removeEventListener(a,t)}const c="openmrs:notification-shown",l="openmrs:actionable-notification-shown",f="openmrs:toast-shown";function d(e){window.dispatchEvent(new CustomEvent(c,{detail:e}))}function p(e){window.dispatchEvent(new CustomEvent(l,{detail:e}))}function h(e){const t=t=>e(t.detail);return window.addEventListener(c,t),()=>window.removeEventListener(c,t)}function y(e){const t=t=>e(t.detail);return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}function m(e){const t=t=>e(t.detail);return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}})()},403:()=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{createAppState:()=>s,createGlobalStore:()=>i,getAppState:()=>u,getGlobalStore:()=>a,subscribeTo:()=>c});const n=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.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."),n.clear()}};return t=e(r,o,i),i},r=e=>e?n(e):n,o={};function i(e,t){const n=o[e];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(t,!0),n.active=!0,n.value;{const n=r()((()=>t));return o[e]={value:n,active:!0},n}}function a(e,t){const n=o[e];if(!n){const n=r()((()=>null!=t?t:{}));return o[e]={value:n,active:!1},n}return n.value}function s(e){return i("app",e)}function u(){return a("app",{})}function c(e,t,n){let r=t(e.getState());return e.subscribe((e=>{const o=t(e);o!==r&&(r=o,n(o))}))}})()},530:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",o="minute",i="hour",a="day",s="week",u="month",c="quarter",l="year",f="date",d="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},g={s:m,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+m(r,2,"0")+":"+m(o,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),o=t.clone().add(r,u),i=n-o<0,a=t.clone().add(r+(i?-1:1),u);return+(-(r+(n-o)/(i?o-a:a-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:l,w:s,d:a,D:f,h:i,m:o,s:r,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",b={};b[v]=y;var w=function(e){return e instanceof E},_=function e(t,n,r){var o;if(!t)return v;if("string"==typeof t){var i=t.toLowerCase();b[i]&&(o=i),n&&(b[i]=n,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var s=t.name;b[s]=t,o=s}return!r&&o&&(v=o),o||!r&&v},S=function(e,t){if(w(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new E(n)},O=g;O.l=_,O.i=w,O.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function y(e){this.$L=_(e.locale,null,!0),this.parse(e)}var m=y.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(O.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===d)},m.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},m.isAfter=function(e,t){return S(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<S(e)},m.$g=function(e,t,n){return O.u(e)?this[t]:this.set(n,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,t){var n=this,c=!!O.u(t)||t,d=O.p(e),p=function(e,t){var r=O.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return c?r:r.endOf(a)},h=function(e,t){return O.w(n.toDate()[e].apply(n.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},y=this.$W,m=this.$M,g=this.$D,v="set"+(this.$u?"UTC":"");switch(d){case l:return c?p(1,0):p(31,11);case u:return c?p(1,m):p(0,m+1);case s:var b=this.$locale().weekStart||0,w=(y<b?y+7:y)-b;return p(c?g-w:g+(6-w),m);case a:case f:return h(v+"Hours",0);case i:return h(v+"Minutes",1);case o:return h(v+"Seconds",2);case r:return h(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(e,t){var s,c=O.p(e),d="set"+(this.$u?"UTC":""),p=(s={},s[a]=d+"Date",s[f]=d+"Date",s[u]=d+"Month",s[l]=d+"FullYear",s[i]=d+"Hours",s[o]=d+"Minutes",s[r]=d+"Seconds",s[n]=d+"Milliseconds",s)[c],h=c===a?this.$D+(t-this.$W):t;if(c===u||c===l){var y=this.clone().set(f,1);y.$d[p](h),y.init(),this.$d=y.set(f,Math.min(this.$D,y.daysInMonth())).$d}else p&&this.$d[p](h);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[O.p(e)]()},m.add=function(n,c){var f,d=this;n=Number(n);var p=O.p(c),h=function(e){var t=S(d);return O.w(t.date(t.date()+Math.round(e*n)),d)};if(p===u)return this.set(u,this.$M+n);if(p===l)return this.set(l,this.$y+n);if(p===a)return h(1);if(p===s)return h(7);var y=(f={},f[o]=e,f[i]=t,f[r]=1e3,f)[p]||1,m=this.$d.getTime()+n*y;return O.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||d;var r=e||"YYYY-MM-DDTHH:mm:ssZ",o=O.z(this),i=this.$H,a=this.$m,s=this.$M,u=n.weekdays,c=n.months,l=function(e,n,o,i){return e&&(e[n]||e(t,r))||o[n].slice(0,i)},f=function(e){return O.s(i%12||12,e,"0")},p=n.meridiem||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r},y={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:O.s(s+1,2,"0"),MMM:l(n.monthsShort,s,c,3),MMMM:l(c,s),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:l(n.weekdaysMin,this.$W,u,2),ddd:l(n.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(i),HH:O.s(i,2,"0"),h:f(1),hh:f(2),a:p(i,a,!0),A:p(i,a,!1),m:String(a),mm:O.s(a,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:o};return r.replace(h,(function(e,t){return t||y[e]||o.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(n,f,d){var p,h=O.p(f),y=S(n),m=(y.utcOffset()-this.utcOffset())*e,g=this-y,v=O.m(this,y);return v=(p={},p[l]=v/12,p[u]=v,p[c]=v/3,p[s]=(g-m)/6048e5,p[a]=(g-m)/864e5,p[i]=g/t,p[o]=g/e,p[r]=g/1e3,p)[h]||g,d?v:O.a(v)},m.daysInMonth=function(){return this.endOf(u).$D},m.$locale=function(){return b[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=_(e,t,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},y}(),k=E.prototype;return S.prototype=k,[["$ms",n],["$s",r],["$m",o],["$H",i],["$W",a],["$M",u],["$y",l],["$D",f]].forEach((function(e){k[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||(e(t,E,S),e.$i=!0),S},S.locale=_,S.isDayjs=w,S.unix=function(e){return S(1e3*e)},S.en=b[v],S.Ls=b,S.p={},S}()},332:function(e){e.exports=function(){"use strict";return function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}}()},975:(e,t,n)=>{"use strict";var r=n(735),o=n(146);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,s={};function u(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(s[e]=t,e=0;e<t.length;e++)a.add(t[e])}var l=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),f=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},h={};function y(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){m[e]=new y(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];m[t]=new y(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){m[e]=new y(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){m[e]=new y(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){m[e]=new y(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){m[e]=new y(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){m[e]=new y(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){m[e]=new y(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){m[e]=new y(e,5,!1,e.toLowerCase(),null,!1,!1)}));var g=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function b(e,t,n,r){var o=m.hasOwnProperty(t)?m[t]:null;(null!==o?0!==o.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!f.call(h,e)||!f.call(p,e)&&(d.test(e)?h[e]=!0:(p[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(g,v);m[t]=new y(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(g,v);m[t]=new y(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(g,v);m[t]=new y(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){m[e]=new y(e,1,!1,e.toLowerCase(),null,!1,!1)})),m.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){m[e]=new y(e,1,!1,e.toLowerCase(),null,!0,!0)}));var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_=Symbol.for("react.element"),S=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),x=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),N=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var D=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var R=Symbol.iterator;function I(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=R&&e[R]||e["@@iterator"])?e:null}var M,L=Object.assign;function U(e){if(void 0===M)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);M=t&&t[1]||""}return"\n"+M+e}var $=!1;function B(e,t){if(!e||$)return"";$=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var o=t.stack.split("\n"),i=r.stack.split("\n"),a=o.length-1,s=i.length-1;1<=a&&0<=s&&o[a]!==i[s];)s--;for(;1<=a&&0<=s;a--,s--)if(o[a]!==i[s]){if(1!==a||1!==s)do{if(a--,0>--s||o[a]!==i[s]){var u="\n"+o[a].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=a&&0<=s);break}}}finally{$=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?U(e):""}function F(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return B(e.type,!1);case 11:return B(e.type.render,!1);case 1:return B(e.type,!0);default:return""}}function K(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case O:return"Fragment";case S:return"Portal";case k:return"Profiler";case E:return"StrictMode";case T:return"Suspense";case A:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case x:return(e.displayName||"Context")+".Consumer";case P:return(e._context.displayName||"Context")+".Provider";case j:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case C:return null!==(t=e.displayName||null)?t:K(e.type)||"Memo";case N:t=e._payload,e=e._init;try{return K(e(t))}catch(e){}}return null}function z(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return K(t);case 8:return t===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function W(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function V(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function q(e){e._valueTracker||(e._valueTracker=function(e){var t=V(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function H(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=V(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function G(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Q(e,t){var n=t.checked;return L({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Y(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=W(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function J(e,t){null!=(t=t.checked)&&b(e,"checked",t,!1)}function X(e,t){J(e,t);var n=W(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,W(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Z(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&G(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+W(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function re(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(i(91));return L({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function oe(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(i(92));if(te(n)){if(1<n.length)throw Error(i(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:W(n)}}function ie(e,t){var n=W(t.value),r=W(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ae(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function se(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ue(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?se(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,le,fe=(le=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return le(e,t)}))}:le);function de(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},he=["Webkit","ms","Moz","O"];function ye(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||pe.hasOwnProperty(e)&&pe[e]?(""+t).trim():t+"px"}function me(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=ye(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(pe).forEach((function(e){he.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pe[t]=pe[e]}))}));var ge=L({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ve(e,t){if(t){if(ge[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(i(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(i(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(i(62))}}function be(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var we=null;function _e(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Se=null,Oe=null,Ee=null;function ke(e){if(e=wo(e)){if("function"!=typeof Se)throw Error(i(280));var t=e.stateNode;t&&(t=So(t),Se(e.stateNode,e.type,t))}}function Pe(e){Oe?Ee?Ee.push(e):Ee=[e]:Oe=e}function xe(){if(Oe){var e=Oe,t=Ee;if(Ee=Oe=null,ke(e),t)for(e=0;e<t.length;e++)ke(t[e])}}function je(e,t){return e(t)}function Te(){}var Ae=!1;function Ce(e,t,n){if(Ae)return e(t,n);Ae=!0;try{return je(e,t,n)}finally{Ae=!1,(null!==Oe||null!==Ee)&&(Te(),xe())}}function Ne(e,t){var n=e.stateNode;if(null===n)return null;var r=So(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(i(231,t,typeof n));return n}var De=!1;if(l)try{var Re={};Object.defineProperty(Re,"passive",{get:function(){De=!0}}),window.addEventListener("test",Re,Re),window.removeEventListener("test",Re,Re)}catch(le){De=!1}function Ie(e,t,n,r,o,i,a,s,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this.onError(e)}}var Me=!1,Le=null,Ue=!1,$e=null,Be={onError:function(e){Me=!0,Le=e}};function Fe(e,t,n,r,o,i,a,s,u){Me=!1,Le=null,Ie.apply(Be,arguments)}function Ke(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function ze(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function We(e){if(Ke(e)!==e)throw Error(i(188))}function Ve(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ke(e)))throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var a=o.alternate;if(null===a){if(null!==(r=o.return)){n=r;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===n)return We(o),e;if(a===r)return We(o),t;a=a.sibling}throw Error(i(188))}if(n.return!==r.return)n=o,r=a;else{for(var s=!1,u=o.child;u;){if(u===n){s=!0,n=o,r=a;break}if(u===r){s=!0,r=o,n=a;break}u=u.sibling}if(!s){for(u=a.child;u;){if(u===n){s=!0,n=a,r=o;break}if(u===r){s=!0,r=a,n=o;break}u=u.sibling}if(!s)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(3!==n.tag)throw Error(i(188));return n.stateNode.current===n?e:t}(e))?qe(e):null}function qe(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=qe(e);if(null!==t)return t;e=e.sibling}return null}var He=o.unstable_scheduleCallback,Ge=o.unstable_cancelCallback,Qe=o.unstable_shouldYield,Ye=o.unstable_requestPaint,Je=o.unstable_now,Xe=o.unstable_getCurrentPriorityLevel,Ze=o.unstable_ImmediatePriority,et=o.unstable_UserBlockingPriority,tt=o.unstable_NormalPriority,nt=o.unstable_LowPriority,rt=o.unstable_IdlePriority,ot=null,it=null,at=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(st(e)/ut|0)|0},st=Math.log,ut=Math.LN2,ct=64,lt=4194304;function ft(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function dt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=ft(s):0!=(i&=a)&&(r=ft(i))}else 0!=(a=n&~o)?r=ft(a):0!==i&&(r=ft(i));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&0!=(4194240&i)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-at(t)),r|=e[n],t&=~o;return r}function pt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function ht(e){return 0!=(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function yt(){var e=ct;return 0==(4194240&(ct<<=1))&&(ct=64),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function gt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-at(t)]=n}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-at(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var bt=0;function wt(e){return 1<(e&=-e)?4<e?0!=(268435455&e)?16:536870912:4:1}var _t,St,Ot,Et,kt,Pt=!1,xt=[],jt=null,Tt=null,At=null,Ct=new Map,Nt=new Map,Dt=[],Rt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function It(e,t){switch(e){case"focusin":case"focusout":jt=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":At=null;break;case"pointerover":case"pointerout":Ct.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nt.delete(t.pointerId)}}function Mt(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},null!==t&&null!==(t=wo(t))&&St(t),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function Lt(e){var t=bo(e.target);if(null!==t){var n=Ke(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=ze(n)))return e.blockedOn=t,void kt(e.priority,(function(){Ot(n)}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Ut(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Qt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=wo(n))&&St(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);we=r,n.target.dispatchEvent(r),we=null,t.shift()}return!0}function $t(e,t,n){Ut(e)&&n.delete(t)}function Bt(){Pt=!1,null!==jt&&Ut(jt)&&(jt=null),null!==Tt&&Ut(Tt)&&(Tt=null),null!==At&&Ut(At)&&(At=null),Ct.forEach($t),Nt.forEach($t)}function Ft(e,t){e.blockedOn===t&&(e.blockedOn=null,Pt||(Pt=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,Bt)))}function Kt(e){function t(t){return Ft(t,e)}if(0<xt.length){Ft(xt[0],e);for(var n=1;n<xt.length;n++){var r=xt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==jt&&Ft(jt,e),null!==Tt&&Ft(Tt,e),null!==At&&Ft(At,e),Ct.forEach(t),Nt.forEach(t),n=0;n<Dt.length;n++)(r=Dt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Dt.length&&null===(n=Dt[0]).blockedOn;)Lt(n),null===n.blockedOn&&Dt.shift()}var zt=w.ReactCurrentBatchConfig,Wt=!0;function Vt(e,t,n,r){var o=bt,i=zt.transition;zt.transition=null;try{bt=1,Ht(e,t,n,r)}finally{bt=o,zt.transition=i}}function qt(e,t,n,r){var o=bt,i=zt.transition;zt.transition=null;try{bt=4,Ht(e,t,n,r)}finally{bt=o,zt.transition=i}}function Ht(e,t,n,r){if(Wt){var o=Qt(e,t,n,r);if(null===o)Wr(e,t,r,Gt,n),It(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return jt=Mt(jt,e,t,n,r,o),!0;case"dragenter":return Tt=Mt(Tt,e,t,n,r,o),!0;case"mouseover":return At=Mt(At,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Ct.set(i,Mt(Ct.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Nt.set(i,Mt(Nt.get(i)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(It(e,r),4&t&&-1<Rt.indexOf(e)){for(;null!==o;){var i=wo(o);if(null!==i&&_t(i),null===(i=Qt(e,t,n,r))&&Wr(e,t,r,Gt,n),i===o)break;o=i}null!==o&&r.stopPropagation()}else Wr(e,t,r,null,n)}}var Gt=null;function Qt(e,t,n,r){if(Gt=null,null!==(e=bo(e=_e(r))))if(null===(t=Ke(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=ze(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Gt=e,null}function Yt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Xe()){case Ze:return 1;case et:return 4;case tt:case nt:return 16;case rt:return 536870912;default:return 16}default:return 16}}var Jt=null,Xt=null,Zt=null;function en(){if(Zt)return Zt;var e,t,n=Xt,r=n.length,o="value"in Jt?Jt.value:Jt.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return Zt=o.slice(e,1<t?1-t:void 0)}function tn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nn(){return!0}function rn(){return!1}function on(e){function t(t,n,r,o,i){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?nn:rn,this.isPropagationStopped=rn,this}return L(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var an,sn,un,cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ln=on(cn),fn=L({},cn,{view:0,detail:0}),dn=on(fn),pn=L({},fn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==un&&(un&&"mousemove"===e.type?(an=e.screenX-un.screenX,sn=e.screenY-un.screenY):sn=an=0,un=e),an)},movementY:function(e){return"movementY"in e?e.movementY:sn}}),hn=on(pn),yn=on(L({},pn,{dataTransfer:0})),mn=on(L({},fn,{relatedTarget:0})),gn=on(L({},cn,{animationName:0,elapsedTime:0,pseudoElement:0})),vn=L({},cn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bn=on(vn),wn=on(L({},cn,{data:0})),_n={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},On={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function En(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=On[e])&&!!t[e]}function kn(){return En}var Pn=L({},fn,{key:function(e){if(e.key){var t=_n[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Sn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kn,charCode:function(e){return"keypress"===e.type?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),xn=on(Pn),jn=on(L({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Tn=on(L({},fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kn})),An=on(L({},cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Cn=L({},pn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Nn=on(Cn),Dn=[9,13,27,32],Rn=l&&"CompositionEvent"in window,In=null;l&&"documentMode"in document&&(In=document.documentMode);var Mn=l&&"TextEvent"in window&&!In,Ln=l&&(!Rn||In&&8<In&&11>=In),Un=String.fromCharCode(32),$n=!1;function Bn(e,t){switch(e){case"keyup":return-1!==Dn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Kn=!1,zn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Wn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!zn[e.type]:"textarea"===t}function Vn(e,t,n,r){Pe(r),0<(t=qr(t,"onChange")).length&&(n=new ln("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var qn=null,Hn=null;function Gn(e){Ur(e,0)}function Qn(e){if(H(_o(e)))return e}function Yn(e,t){if("change"===e)return t}var Jn=!1;if(l){var Xn;if(l){var Zn="oninput"in document;if(!Zn){var er=document.createElement("div");er.setAttribute("oninput","return;"),Zn="function"==typeof er.oninput}Xn=Zn}else Xn=!1;Jn=Xn&&(!document.documentMode||9<document.documentMode)}function tr(){qn&&(qn.detachEvent("onpropertychange",nr),Hn=qn=null)}function nr(e){if("value"===e.propertyName&&Qn(Hn)){var t=[];Vn(t,Hn,e,_e(e)),Ce(Gn,t)}}function rr(e,t,n){"focusin"===e?(tr(),Hn=n,(qn=t).attachEvent("onpropertychange",nr)):"focusout"===e&&tr()}function or(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Qn(Hn)}function ir(e,t){if("click"===e)return Qn(t)}function ar(e,t){if("input"===e||"change"===e)return Qn(t)}var sr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function ur(e,t){if(sr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!f.call(t,o)||!sr(e[o],t[o]))return!1}return!0}function cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lr(e,t){var n,r=cr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=cr(r)}}function fr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?fr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function dr(){for(var e=window,t=G();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=G((e=t.contentWindow).document)}return t}function pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function hr(e){var t=dr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&fr(n.ownerDocument.documentElement,n)){if(null!==r&&pr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=void 0===r.end?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=lr(n,i);var a=lr(n,r);o&&a&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var yr=l&&"documentMode"in document&&11>=document.documentMode,mr=null,gr=null,vr=null,br=!1;function wr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;br||null==mr||mr!==G(r)||(r="selectionStart"in(r=mr)&&pr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},vr&&ur(vr,r)||(vr=r,0<(r=qr(gr,"onSelect")).length&&(t=new ln("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=mr)))}function _r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Sr={animationend:_r("Animation","AnimationEnd"),animationiteration:_r("Animation","AnimationIteration"),animationstart:_r("Animation","AnimationStart"),transitionend:_r("Transition","TransitionEnd")},Or={},Er={};function kr(e){if(Or[e])return Or[e];if(!Sr[e])return e;var t,n=Sr[e];for(t in n)if(n.hasOwnProperty(t)&&t in Er)return Or[e]=n[t];return e}l&&(Er=document.createElement("div").style,"AnimationEvent"in window||(delete Sr.animationend.animation,delete Sr.animationiteration.animation,delete Sr.animationstart.animation),"TransitionEvent"in window||delete Sr.transitionend.transition);var Pr=kr("animationend"),xr=kr("animationiteration"),jr=kr("animationstart"),Tr=kr("transitionend"),Ar=new Map,Cr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Nr(e,t){Ar.set(e,t),u(t,[e])}for(var Dr=0;Dr<Cr.length;Dr++){var Rr=Cr[Dr];Nr(Rr.toLowerCase(),"on"+(Rr[0].toUpperCase()+Rr.slice(1)))}Nr(Pr,"onAnimationEnd"),Nr(xr,"onAnimationIteration"),Nr(jr,"onAnimationStart"),Nr("dblclick","onDoubleClick"),Nr("focusin","onFocus"),Nr("focusout","onBlur"),Nr(Tr,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ir="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Mr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ir));function Lr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,o,a,s,u,c){if(Fe.apply(this,arguments),Me){if(!Me)throw Error(i(198));var l=Le;Me=!1,Le=null,Ue||(Ue=!0,$e=l)}}(r,t,void 0,e),e.currentTarget=null}function Ur(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],u=s.instance,c=s.currentTarget;if(s=s.listener,u!==i&&o.isPropagationStopped())break e;Lr(o,s,c),i=u}else for(a=0;a<r.length;a++){if(u=(s=r[a]).instance,c=s.currentTarget,s=s.listener,u!==i&&o.isPropagationStopped())break e;Lr(o,s,c),i=u}}}if(Ue)throw e=$e,Ue=!1,$e=null,e}function $r(e,t){var n=t[mo];void 0===n&&(n=t[mo]=new Set);var r=e+"__bubble";n.has(r)||(zr(t,e,2,!1),n.add(r))}function Br(e,t,n){var r=0;t&&(r|=4),zr(n,e,r,t)}var Fr="_reactListening"+Math.random().toString(36).slice(2);function Kr(e){if(!e[Fr]){e[Fr]=!0,a.forEach((function(t){"selectionchange"!==t&&(Mr.has(t)||Br(t,!1,e),Br(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Fr]||(t[Fr]=!0,Br("selectionchange",!1,t))}}function zr(e,t,n,r){switch(Yt(t)){case 1:var o=Vt;break;case 4:o=qt;break;default:o=Ht}n=o.bind(null,t,n,e),o=void 0,!De||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Wr(e,t,n,r,o){var i=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===o||8===s.nodeType&&s.parentNode===o)break;if(4===a)for(a=r.return;null!==a;){var u=a.tag;if((3===u||4===u)&&((u=a.stateNode.containerInfo)===o||8===u.nodeType&&u.parentNode===o))return;a=a.return}for(;null!==s;){if(null===(a=bo(s)))return;if(5===(u=a.tag)||6===u){r=i=a;continue e}s=s.parentNode}}r=r.return}Ce((function(){var r=i,o=_e(n),a=[];e:{var s=Ar.get(e);if(void 0!==s){var u=ln,c=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":u=xn;break;case"focusin":c="focus",u=mn;break;case"focusout":c="blur",u=mn;break;case"beforeblur":case"afterblur":u=mn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":u=hn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":u=yn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":u=Tn;break;case Pr:case xr:case jr:u=gn;break;case Tr:u=An;break;case"scroll":u=dn;break;case"wheel":u=Nn;break;case"copy":case"cut":case"paste":u=bn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":u=jn}var l=0!=(4&t),f=!l&&"scroll"===e,d=l?null!==s?s+"Capture":null:s;l=[];for(var p,h=r;null!==h;){var y=(p=h).stateNode;if(5===p.tag&&null!==y&&(p=y,null!==d&&null!=(y=Ne(h,d))&&l.push(Vr(h,y,p))),f)break;h=h.return}0<l.length&&(s=new u(s,c,null,n,o),a.push({event:s,listeners:l}))}}if(0==(7&t)){if(u="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===we||!(c=n.relatedTarget||n.fromElement)||!bo(c)&&!c[yo])&&(u||s)&&(s=o.window===o?o:(s=o.ownerDocument)?s.defaultView||s.parentWindow:window,u?(u=r,null!==(c=(c=n.relatedTarget||n.toElement)?bo(c):null)&&(c!==(f=Ke(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(u=null,c=r),u!==c)){if(l=hn,y="onMouseLeave",d="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(l=jn,y="onPointerLeave",d="onPointerEnter",h="pointer"),f=null==u?s:_o(u),p=null==c?s:_o(c),(s=new l(y,h+"leave",u,n,o)).target=f,s.relatedTarget=p,y=null,bo(o)===r&&((l=new l(d,h+"enter",c,n,o)).target=p,l.relatedTarget=f,y=l),f=y,u&&c)e:{for(d=c,h=0,p=l=u;p;p=Hr(p))h++;for(p=0,y=d;y;y=Hr(y))p++;for(;0<h-p;)l=Hr(l),h--;for(;0<p-h;)d=Hr(d),p--;for(;h--;){if(l===d||null!==d&&l===d.alternate)break e;l=Hr(l),d=Hr(d)}l=null}else l=null;null!==u&&Gr(a,s,u,l,!1),null!==c&&null!==f&&Gr(a,f,c,l,!0)}if("select"===(u=(s=r?_o(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===u&&"file"===s.type)var m=Yn;else if(Wn(s))if(Jn)m=ar;else{m=or;var g=rr}else(u=s.nodeName)&&"input"===u.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(m=ir);switch(m&&(m=m(e,r))?Vn(a,m,n,o):(g&&g(e,s,r),"focusout"===e&&(g=s._wrapperState)&&g.controlled&&"number"===s.type&&ee(s,"number",s.value)),g=r?_o(r):window,e){case"focusin":(Wn(g)||"true"===g.contentEditable)&&(mr=g,gr=r,vr=null);break;case"focusout":vr=gr=mr=null;break;case"mousedown":br=!0;break;case"contextmenu":case"mouseup":case"dragend":br=!1,wr(a,n,o);break;case"selectionchange":if(yr)break;case"keydown":case"keyup":wr(a,n,o)}var v;if(Rn)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Kn?Bn(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(Ln&&"ko"!==n.locale&&(Kn||"onCompositionStart"!==b?"onCompositionEnd"===b&&Kn&&(v=en()):(Xt="value"in(Jt=o)?Jt.value:Jt.textContent,Kn=!0)),0<(g=qr(r,b)).length&&(b=new wn(b,e,null,n,o),a.push({event:b,listeners:g}),(v||null!==(v=Fn(n)))&&(b.data=v))),(v=Mn?function(e,t){switch(e){case"compositionend":return Fn(t);case"keypress":return 32!==t.which?null:($n=!0,Un);case"textInput":return(e=t.data)===Un&&$n?null:e;default:return null}}(e,n):function(e,t){if(Kn)return"compositionend"===e||!Rn&&Bn(e,t)?(e=en(),Zt=Xt=Jt=null,Kn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ln&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(r=qr(r,"onBeforeInput")).length&&(o=new wn("onBeforeInput","beforeinput",null,n,o),a.push({event:o,listeners:r}),o.data=v)}Ur(a,t)}))}function Vr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qr(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,i=o.stateNode;5===o.tag&&null!==i&&(o=i,null!=(i=Ne(e,n))&&r.unshift(Vr(e,i,o)),null!=(i=Ne(e,t))&&r.push(Vr(e,i,o))),e=e.return}return r}function Hr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Gr(e,t,n,r,o){for(var i=t._reactName,a=[];null!==n&&n!==r;){var s=n,u=s.alternate,c=s.stateNode;if(null!==u&&u===r)break;5===s.tag&&null!==c&&(s=c,o?null!=(u=Ne(n,i))&&a.unshift(Vr(n,u,s)):o||null!=(u=Ne(n,i))&&a.push(Vr(n,u,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var Qr=/\r\n?/g,Yr=/\u0000|\uFFFD/g;function Jr(e){return("string"==typeof e?e:""+e).replace(Qr,"\n").replace(Yr,"")}function Xr(e,t,n){if(t=Jr(t),Jr(e)!==t&&n)throw Error(i(425))}function Zr(){}var eo=null,to=null;function no(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ro="function"==typeof setTimeout?setTimeout:void 0,oo="function"==typeof clearTimeout?clearTimeout:void 0,io="function"==typeof Promise?Promise:void 0,ao="function"==typeof queueMicrotask?queueMicrotask:void 0!==io?function(e){return io.resolve(null).then(e).catch(so)}:ro;function so(e){setTimeout((function(){throw e}))}function uo(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)){if(0===r)return e.removeChild(o),void Kt(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=o}while(n);Kt(t)}function co(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function lo(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var fo=Math.random().toString(36).slice(2),po="__reactFiber$"+fo,ho="__reactProps$"+fo,yo="__reactContainer$"+fo,mo="__reactEvents$"+fo,go="__reactListeners$"+fo,vo="__reactHandles$"+fo;function bo(e){var t=e[po];if(t)return t;for(var n=e.parentNode;n;){if(t=n[yo]||n[po]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=lo(e);null!==e;){if(n=e[po])return n;e=lo(e)}return t}n=(e=n).parentNode}return null}function wo(e){return!(e=e[po]||e[yo])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function _o(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(i(33))}function So(e){return e[ho]||null}var Oo=[],Eo=-1;function ko(e){return{current:e}}function Po(e){0>Eo||(e.current=Oo[Eo],Oo[Eo]=null,Eo--)}function xo(e,t){Eo++,Oo[Eo]=e.current,e.current=t}var jo={},To=ko(jo),Ao=ko(!1),Co=jo;function No(e,t){var n=e.type.contextTypes;if(!n)return jo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Do(e){return null!=e.childContextTypes}function Ro(){Po(Ao),Po(To)}function Io(e,t,n){if(To.current!==jo)throw Error(i(168));xo(To,t),xo(Ao,n)}function Mo(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in t))throw Error(i(108,z(e)||"Unknown",o));return L({},n,r)}function Lo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||jo,Co=To.current,xo(To,e),xo(Ao,Ao.current),!0}function Uo(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=Mo(e,t,Co),r.__reactInternalMemoizedMergedChildContext=e,Po(Ao),Po(To),xo(To,e)):Po(Ao),xo(Ao,n)}var $o=null,Bo=!1,Fo=!1;function Ko(e){null===$o?$o=[e]:$o.push(e)}function zo(){if(!Fo&&null!==$o){Fo=!0;var e=0,t=bt;try{var n=$o;for(bt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}$o=null,Bo=!1}catch(t){throw null!==$o&&($o=$o.slice(e+1)),He(Ze,zo),t}finally{bt=t,Fo=!1}}return null}var Wo=[],Vo=0,qo=null,Ho=0,Go=[],Qo=0,Yo=null,Jo=1,Xo="";function Zo(e,t){Wo[Vo++]=Ho,Wo[Vo++]=qo,qo=e,Ho=t}function ei(e,t,n){Go[Qo++]=Jo,Go[Qo++]=Xo,Go[Qo++]=Yo,Yo=e;var r=Jo;e=Xo;var o=32-at(r)-1;r&=~(1<<o),n+=1;var i=32-at(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Jo=1<<32-at(t)+o|n<<o|r,Xo=i+e}else Jo=1<<i|n<<o|r,Xo=e}function ti(e){null!==e.return&&(Zo(e,1),ei(e,1,0))}function ni(e){for(;e===qo;)qo=Wo[--Vo],Wo[Vo]=null,Ho=Wo[--Vo],Wo[Vo]=null;for(;e===Yo;)Yo=Go[--Qo],Go[Qo]=null,Xo=Go[--Qo],Go[Qo]=null,Jo=Go[--Qo],Go[Qo]=null}var ri=null,oi=null,ii=!1,ai=null;function si(e,t){var n=Nc(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function ui(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ri=e,oi=co(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ri=e,oi=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Yo?{id:Jo,overflow:Xo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Nc(18,null,null,0)).stateNode=t,n.return=e,e.child=n,ri=e,oi=null,!0);default:return!1}}function ci(e){return 0!=(1&e.mode)&&0==(128&e.flags)}function li(e){if(ii){var t=oi;if(t){var n=t;if(!ui(e,t)){if(ci(e))throw Error(i(418));t=co(n.nextSibling);var r=ri;t&&ui(e,t)?si(r,n):(e.flags=-4097&e.flags|2,ii=!1,ri=e)}}else{if(ci(e))throw Error(i(418));e.flags=-4097&e.flags|2,ii=!1,ri=e}}}function fi(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ri=e}function di(e){if(e!==ri)return!1;if(!ii)return fi(e),ii=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!no(e.type,e.memoizedProps)),t&&(t=oi)){if(ci(e))throw pi(),Error(i(418));for(;t;)si(e,t),t=co(t.nextSibling)}if(fi(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){oi=co(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}oi=null}}else oi=ri?co(e.stateNode.nextSibling):null;return!0}function pi(){for(var e=oi;e;)e=co(e.nextSibling)}function hi(){oi=ri=null,ii=!1}function yi(e){null===ai?ai=[e]:ai.push(e)}var mi=w.ReactCurrentBatchConfig;function gi(e,t){if(e&&e.defaultProps){for(var n in t=L({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var vi=ko(null),bi=null,wi=null,_i=null;function Si(){_i=wi=bi=null}function Oi(e){var t=vi.current;Po(vi),e._currentValue=t}function Ei(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ki(e,t){bi=e,_i=wi=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(ws=!0),e.firstContext=null)}function Pi(e){var t=e._currentValue;if(_i!==e)if(e={context:e,memoizedValue:t,next:null},null===wi){if(null===bi)throw Error(i(308));wi=e,bi.dependencies={lanes:0,firstContext:e}}else wi=wi.next=e;return t}var xi=null;function ji(e){null===xi?xi=[e]:xi.push(e)}function Ti(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,ji(t)):(n.next=o.next,o.next=n),t.interleaved=n,Ai(e,r)}function Ai(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Ci=!1;function Ni(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Di(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ri(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ii(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!=(2&Tu)){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Ai(e,n)}return null===(o=r.interleaved)?(t.next=t,ji(r)):(t.next=o.next,o.next=t),r.interleaved=t,Ai(e,n)}function Mi(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,vt(e,n)}}function Li(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===i?o=i=a:i=i.next=a,n=n.next}while(null!==n);null===i?o=i=t:i=i.next=t}else o=i=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ui(e,t,n,r){var o=e.updateQueue;Ci=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var u=s,c=u.next;u.next=null,null===a?i=c:a.next=c,a=u;var l=e.alternate;null!==l&&(s=(l=l.updateQueue).lastBaseUpdate)!==a&&(null===s?l.firstBaseUpdate=c:s.next=c,l.lastBaseUpdate=u)}if(null!==i){var f=o.baseState;for(a=0,l=c=u=null,s=i;;){var d=s.lane,p=s.eventTime;if((r&d)===d){null!==l&&(l=l.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var h=e,y=s;switch(d=t,p=n,y.tag){case 1:if("function"==typeof(h=y.payload)){f=h.call(p,f,d);break e}f=h;break e;case 3:h.flags=-65537&h.flags|128;case 0:if(null==(d="function"==typeof(h=y.payload)?h.call(p,f,d):h))break e;f=L({},f,d);break e;case 2:Ci=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(d=o.effects)?o.effects=[s]:d.push(s))}else p={eventTime:p,lane:d,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===l?(c=l=p,u=f):l=l.next=p,a|=d;if(null===(s=s.next)){if(null===(s=o.shared.pending))break;s=(d=s).next,d.next=null,o.lastBaseUpdate=d,o.shared.pending=null}}if(null===l&&(u=f),o.baseState=u,o.firstBaseUpdate=c,o.lastBaseUpdate=l,null!==(t=o.shared.interleaved)){o=t;do{a|=o.lane,o=o.next}while(o!==t)}else null===i&&(o.shared.lanes=0);Lu|=a,e.lanes=a,e.memoizedState=f}}function $i(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(null!==o){if(r.callback=null,r=n,"function"!=typeof o)throw Error(i(191,o));o.call(r)}}}var Bi=(new r.Component).refs;function Fi(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:L({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Ki={isMounted:function(e){return!!(e=e._reactInternals)&&Ke(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=tc(),o=nc(e),i=Ri(r,o);i.payload=t,null!=n&&(i.callback=n),null!==(t=Ii(e,i,o))&&(rc(t,e,o,r),Mi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=tc(),o=nc(e),i=Ri(r,o);i.tag=1,i.payload=t,null!=n&&(i.callback=n),null!==(t=Ii(e,i,o))&&(rc(t,e,o,r),Mi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=tc(),r=nc(e),o=Ri(n,r);o.tag=2,null!=t&&(o.callback=t),null!==(t=Ii(e,o,r))&&(rc(t,e,r,n),Mi(t,e,r))}};function zi(e,t,n,r,o,i,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!(t.prototype&&t.prototype.isPureReactComponent&&ur(n,r)&&ur(o,i))}function Wi(e,t,n){var r=!1,o=jo,i=t.contextType;return"object"==typeof i&&null!==i?i=Pi(i):(o=Do(t)?Co:To.current,i=(r=null!=(r=t.contextTypes))?No(e,o):jo),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Ki,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Vi(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ki.enqueueReplaceState(t,t.state,null)}function qi(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=Bi,Ni(e);var i=t.contextType;"object"==typeof i&&null!==i?o.context=Pi(i):(i=Do(t)?Co:To.current,o.context=No(e,i)),o.state=e.memoizedState,"function"==typeof(i=t.getDerivedStateFromProps)&&(Fi(e,t,i,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&Ki.enqueueReplaceState(o,o.state,null),Ui(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4194308)}function Hi(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(i(309));var r=n.stateNode}if(!r)throw Error(i(147,e));var o=r,a=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=o.refs;t===Bi&&(t=o.refs={}),null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!=typeof e)throw Error(i(284));if(!n._owner)throw Error(i(290,e))}return e}function Gi(e,t){throw e=Object.prototype.toString.call(t),Error(i(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Qi(e){return(0,e._init)(e._payload)}function Yi(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=Rc(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function u(e,t,n,r){return null===t||6!==t.tag?((t=Uc(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function c(e,t,n,r){var i=n.type;return i===O?f(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===i||"object"==typeof i&&null!==i&&i.$$typeof===N&&Qi(i)===t.type)?((r=o(t,n.props)).ref=Hi(e,t,n),r.return=e,r):((r=Ic(n.type,n.key,n.props,null,e.mode,r)).ref=Hi(e,t,n),r.return=e,r)}function l(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=$c(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function f(e,t,n,r,i){return null===t||7!==t.tag?((t=Mc(n,e.mode,r,i)).return=e,t):((t=o(t,n)).return=e,t)}function d(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Uc(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case _:return(n=Ic(t.type,t.key,t.props,null,e.mode,n)).ref=Hi(e,null,t),n.return=e,n;case S:return(t=$c(t,e.mode,n)).return=e,t;case N:return d(e,(0,t._init)(t._payload),n)}if(te(t)||I(t))return(t=Mc(t,e.mode,n,null)).return=e,t;Gi(e,t)}return null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==o?null:u(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case _:return n.key===o?c(e,t,n,r):null;case S:return n.key===o?l(e,t,n,r):null;case N:return p(e,t,(o=n._init)(n._payload),r)}if(te(n)||I(n))return null!==o?null:f(e,t,n,r,null);Gi(e,n)}return null}function h(e,t,n,r,o){if("string"==typeof r&&""!==r||"number"==typeof r)return u(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case _:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o);case S:return l(t,e=e.get(null===r.key?n:r.key)||null,r,o);case N:return h(e,t,n,(0,r._init)(r._payload),o)}if(te(r)||I(r))return f(t,e=e.get(n)||null,r,o,null);Gi(t,r)}return null}function y(o,i,s,u){for(var c=null,l=null,f=i,y=i=0,m=null;null!==f&&y<s.length;y++){f.index>y?(m=f,f=null):m=f.sibling;var g=p(o,f,s[y],u);if(null===g){null===f&&(f=m);break}e&&f&&null===g.alternate&&t(o,f),i=a(g,i,y),null===l?c=g:l.sibling=g,l=g,f=m}if(y===s.length)return n(o,f),ii&&Zo(o,y),c;if(null===f){for(;y<s.length;y++)null!==(f=d(o,s[y],u))&&(i=a(f,i,y),null===l?c=f:l.sibling=f,l=f);return ii&&Zo(o,y),c}for(f=r(o,f);y<s.length;y++)null!==(m=h(f,o,y,s[y],u))&&(e&&null!==m.alternate&&f.delete(null===m.key?y:m.key),i=a(m,i,y),null===l?c=m:l.sibling=m,l=m);return e&&f.forEach((function(e){return t(o,e)})),ii&&Zo(o,y),c}function m(o,s,u,c){var l=I(u);if("function"!=typeof l)throw Error(i(150));if(null==(u=l.call(u)))throw Error(i(151));for(var f=l=null,y=s,m=s=0,g=null,v=u.next();null!==y&&!v.done;m++,v=u.next()){y.index>m?(g=y,y=null):g=y.sibling;var b=p(o,y,v.value,c);if(null===b){null===y&&(y=g);break}e&&y&&null===b.alternate&&t(o,y),s=a(b,s,m),null===f?l=b:f.sibling=b,f=b,y=g}if(v.done)return n(o,y),ii&&Zo(o,m),l;if(null===y){for(;!v.done;m++,v=u.next())null!==(v=d(o,v.value,c))&&(s=a(v,s,m),null===f?l=v:f.sibling=v,f=v);return ii&&Zo(o,m),l}for(y=r(o,y);!v.done;m++,v=u.next())null!==(v=h(y,o,m,v.value,c))&&(e&&null!==v.alternate&&y.delete(null===v.key?m:v.key),s=a(v,s,m),null===f?l=v:f.sibling=v,f=v);return e&&y.forEach((function(e){return t(o,e)})),ii&&Zo(o,m),l}return function e(r,i,a,u){if("object"==typeof a&&null!==a&&a.type===O&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case _:e:{for(var c=a.key,l=i;null!==l;){if(l.key===c){if((c=a.type)===O){if(7===l.tag){n(r,l.sibling),(i=o(l,a.props.children)).return=r,r=i;break e}}else if(l.elementType===c||"object"==typeof c&&null!==c&&c.$$typeof===N&&Qi(c)===l.type){n(r,l.sibling),(i=o(l,a.props)).ref=Hi(r,l,a),i.return=r,r=i;break e}n(r,l);break}t(r,l),l=l.sibling}a.type===O?((i=Mc(a.props.children,r.mode,u,a.key)).return=r,r=i):((u=Ic(a.type,a.key,a.props,null,r.mode,u)).ref=Hi(r,i,a),u.return=r,r=u)}return s(r);case S:e:{for(l=a.key;null!==i;){if(i.key===l){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){n(r,i.sibling),(i=o(i,a.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=$c(a,r.mode,u)).return=r,r=i}return s(r);case N:return e(r,i,(l=a._init)(a._payload),u)}if(te(a))return y(r,i,a,u);if(I(a))return m(r,i,a,u);Gi(r,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==i&&6===i.tag?(n(r,i.sibling),(i=o(i,a)).return=r,r=i):(n(r,i),(i=Uc(a,r.mode,u)).return=r,r=i),s(r)):n(r,i)}}var Ji=Yi(!0),Xi=Yi(!1),Zi={},ea=ko(Zi),ta=ko(Zi),na=ko(Zi);function ra(e){if(e===Zi)throw Error(i(174));return e}function oa(e,t){switch(xo(na,t),xo(ta,e),xo(ea,Zi),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ue(null,"");break;default:t=ue(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Po(ea),xo(ea,t)}function ia(){Po(ea),Po(ta),Po(na)}function aa(e){ra(na.current);var t=ra(ea.current),n=ue(t,e.type);t!==n&&(xo(ta,e),xo(ea,n))}function sa(e){ta.current===e&&(Po(ea),Po(ta))}var ua=ko(0);function ca(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var la=[];function fa(){for(var e=0;e<la.length;e++)la[e]._workInProgressVersionPrimary=null;la.length=0}var da=w.ReactCurrentDispatcher,pa=w.ReactCurrentBatchConfig,ha=0,ya=null,ma=null,ga=null,va=!1,ba=!1,wa=0,_a=0;function Sa(){throw Error(i(321))}function Oa(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sr(e[n],t[n]))return!1;return!0}function Ea(e,t,n,r,o,a){if(ha=a,ya=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,da.current=null===e||null===e.memoizedState?ss:us,e=n(r,o),ba){a=0;do{if(ba=!1,wa=0,25<=a)throw Error(i(301));a+=1,ga=ma=null,t.updateQueue=null,da.current=cs,e=n(r,o)}while(ba)}if(da.current=as,t=null!==ma&&null!==ma.next,ha=0,ga=ma=ya=null,va=!1,t)throw Error(i(300));return e}function ka(){var e=0!==wa;return wa=0,e}function Pa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ga?ya.memoizedState=ga=e:ga=ga.next=e,ga}function xa(){if(null===ma){var e=ya.alternate;e=null!==e?e.memoizedState:null}else e=ma.next;var t=null===ga?ya.memoizedState:ga.next;if(null!==t)ga=t,ma=e;else{if(null===e)throw Error(i(310));e={memoizedState:(ma=e).memoizedState,baseState:ma.baseState,baseQueue:ma.baseQueue,queue:ma.queue,next:null},null===ga?ya.memoizedState=ga=e:ga=ga.next=e}return ga}function ja(e,t){return"function"==typeof t?t(e):t}function Ta(e){var t=xa(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=ma,o=r.baseQueue,a=n.pending;if(null!==a){if(null!==o){var s=o.next;o.next=a.next,a.next=s}r.baseQueue=o=a,n.pending=null}if(null!==o){a=o.next,r=r.baseState;var u=s=null,c=null,l=a;do{var f=l.lane;if((ha&f)===f)null!==c&&(c=c.next={lane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),r=l.hasEagerState?l.eagerState:e(r,l.action);else{var d={lane:f,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null};null===c?(u=c=d,s=r):c=c.next=d,ya.lanes|=f,Lu|=f}l=l.next}while(null!==l&&l!==a);null===c?s=r:c.next=u,sr(r,t.memoizedState)||(ws=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(null!==(e=n.interleaved)){o=e;do{a=o.lane,ya.lanes|=a,Lu|=a,o=o.next}while(o!==e)}else null===o&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Aa(e){var t=xa(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,a=t.memoizedState;if(null!==o){n.pending=null;var s=o=o.next;do{a=e(a,s.action),s=s.next}while(s!==o);sr(a,t.memoizedState)||(ws=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Ca(){}function Na(e,t){var n=ya,r=xa(),o=t(),a=!sr(r.memoizedState,o);if(a&&(r.memoizedState=o,ws=!0),r=r.queue,Wa(Ia.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||null!==ga&&1&ga.memoizedState.tag){if(n.flags|=2048,$a(9,Ra.bind(null,n,r,o,t),void 0,null),null===Au)throw Error(i(349));0!=(30&ha)||Da(n,t,o)}return o}function Da(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ya.updateQueue)?(t={lastEffect:null,stores:null},ya.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ra(e,t,n,r){t.value=n,t.getSnapshot=r,Ma(t)&&La(e)}function Ia(e,t,n){return n((function(){Ma(t)&&La(e)}))}function Ma(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sr(e,n)}catch(e){return!0}}function La(e){var t=Ai(e,1);null!==t&&rc(t,e,1,-1)}function Ua(e){var t=Pa();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:e},t.queue=e,e=e.dispatch=ns.bind(null,ya,e),[t.memoizedState,e]}function $a(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ya.updateQueue)?(t={lastEffect:null,stores:null},ya.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ba(){return xa().memoizedState}function Fa(e,t,n,r){var o=Pa();ya.flags|=e,o.memoizedState=$a(1|t,n,void 0,void 0===r?null:r)}function Ka(e,t,n,r){var o=xa();r=void 0===r?null:r;var i=void 0;if(null!==ma){var a=ma.memoizedState;if(i=a.destroy,null!==r&&Oa(r,a.deps))return void(o.memoizedState=$a(t,n,i,r))}ya.flags|=e,o.memoizedState=$a(1|t,n,i,r)}function za(e,t){return Fa(8390656,8,e,t)}function Wa(e,t){return Ka(2048,8,e,t)}function Va(e,t){return Ka(4,2,e,t)}function qa(e,t){return Ka(4,4,e,t)}function Ha(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ga(e,t,n){return n=null!=n?n.concat([e]):null,Ka(4,4,Ha.bind(null,t,e),n)}function Qa(){}function Ya(e,t){var n=xa();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Oa(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ja(e,t){var n=xa();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Oa(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Xa(e,t,n){return 0==(21&ha)?(e.baseState&&(e.baseState=!1,ws=!0),e.memoizedState=n):(sr(n,t)||(n=yt(),ya.lanes|=n,Lu|=n,e.baseState=!0),t)}function Za(e,t){var n=bt;bt=0!==n&&4>n?n:4,e(!0);var r=pa.transition;pa.transition={};try{e(!1),t()}finally{bt=n,pa.transition=r}}function es(){return xa().memoizedState}function ts(e,t,n){var r=nc(e);n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},rs(e)?os(t,n):null!==(n=Ti(e,t,n,r))&&(rc(n,e,r,tc()),is(n,t,r))}function ns(e,t,n){var r=nc(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(rs(e))os(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,sr(s,a)){var u=t.interleaved;return null===u?(o.next=o,ji(t)):(o.next=u.next,u.next=o),void(t.interleaved=o)}}catch(e){}null!==(n=Ti(e,t,o,r))&&(rc(n,e,r,o=tc()),is(n,t,r))}}function rs(e){var t=e.alternate;return e===ya||null!==t&&t===ya}function os(e,t){ba=va=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function is(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,vt(e,n)}}var as={readContext:Pi,useCallback:Sa,useContext:Sa,useEffect:Sa,useImperativeHandle:Sa,useInsertionEffect:Sa,useLayoutEffect:Sa,useMemo:Sa,useReducer:Sa,useRef:Sa,useState:Sa,useDebugValue:Sa,useDeferredValue:Sa,useTransition:Sa,useMutableSource:Sa,useSyncExternalStore:Sa,useId:Sa,unstable_isNewReconciler:!1},ss={readContext:Pi,useCallback:function(e,t){return Pa().memoizedState=[e,void 0===t?null:t],e},useContext:Pi,useEffect:za,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Fa(4194308,4,Ha.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fa(4194308,4,e,t)},useInsertionEffect:function(e,t){return Fa(4,2,e,t)},useMemo:function(e,t){var n=Pa();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Pa();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ts.bind(null,ya,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Pa().memoizedState=e},useState:Ua,useDebugValue:Qa,useDeferredValue:function(e){return Pa().memoizedState=e},useTransition:function(){var e=Ua(!1),t=e[0];return e=Za.bind(null,e[1]),Pa().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ya,o=Pa();if(ii){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===Au)throw Error(i(349));0!=(30&ha)||Da(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,za(Ia.bind(null,r,a,e),[e]),r.flags|=2048,$a(9,Ra.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Pa(),t=Au.identifierPrefix;if(ii){var n=Xo;t=":"+t+"R"+(n=(Jo&~(1<<32-at(Jo)-1)).toString(32)+n),0<(n=wa++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=_a++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},us={readContext:Pi,useCallback:Ya,useContext:Pi,useEffect:Wa,useImperativeHandle:Ga,useInsertionEffect:Va,useLayoutEffect:qa,useMemo:Ja,useReducer:Ta,useRef:Ba,useState:function(){return Ta(ja)},useDebugValue:Qa,useDeferredValue:function(e){return Xa(xa(),ma.memoizedState,e)},useTransition:function(){return[Ta(ja)[0],xa().memoizedState]},useMutableSource:Ca,useSyncExternalStore:Na,useId:es,unstable_isNewReconciler:!1},cs={readContext:Pi,useCallback:Ya,useContext:Pi,useEffect:Wa,useImperativeHandle:Ga,useInsertionEffect:Va,useLayoutEffect:qa,useMemo:Ja,useReducer:Aa,useRef:Ba,useState:function(){return Aa(ja)},useDebugValue:Qa,useDeferredValue:function(e){var t=xa();return null===ma?t.memoizedState=e:Xa(t,ma.memoizedState,e)},useTransition:function(){return[Aa(ja)[0],xa().memoizedState]},useMutableSource:Ca,useSyncExternalStore:Na,useId:es,unstable_isNewReconciler:!1};function ls(e,t){try{var n="",r=t;do{n+=F(r),r=r.return}while(r);var o=n}catch(e){o="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:o,digest:null}}function fs(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ds(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}var ps="function"==typeof WeakMap?WeakMap:Map;function hs(e,t,n){(n=Ri(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Vu||(Vu=!0,qu=r),ds(0,t)},n}function ys(e,t,n){(n=Ri(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){ds(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){ds(0,t),"function"!=typeof r&&(null===Hu?Hu=new Set([this]):Hu.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function ms(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new ps;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Pc.bind(null,e,t,n),t.then(e,e))}function gs(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function vs(e,t,n,r,o){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Ri(-1,1)).tag=2,Ii(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var bs=w.ReactCurrentOwner,ws=!1;function _s(e,t,n,r){t.child=null===e?Xi(t,null,n,r):Ji(t,e.child,n,r)}function Ss(e,t,n,r,o){n=n.render;var i=t.ref;return ki(t,o),r=Ea(e,t,n,r,i,o),n=ka(),null===e||ws?(ii&&n&&ti(t),t.flags|=1,_s(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Vs(e,t,o))}function Os(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||Dc(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Ic(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Es(e,t,i,r,o))}if(i=e.child,0==(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:ur)(a,r)&&e.ref===t.ref)return Vs(e,t,o)}return t.flags|=1,(e=Rc(i,r)).ref=t.ref,e.return=t,t.child=e}function Es(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(ur(i,r)&&e.ref===t.ref){if(ws=!1,t.pendingProps=r=i,0==(e.lanes&o))return t.lanes=e.lanes,Vs(e,t,o);0!=(131072&e.flags)&&(ws=!0)}}return xs(e,t,n,r,o)}function ks(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},xo(Ru,Du),Du|=n;else{if(0==(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,xo(Ru,Du),Du|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,xo(Ru,Du),Du|=r}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,xo(Ru,Du),Du|=r;return _s(e,t,o,n),t.child}function Ps(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function xs(e,t,n,r,o){var i=Do(n)?Co:To.current;return i=No(t,i),ki(t,o),n=Ea(e,t,n,r,i,o),r=ka(),null===e||ws?(ii&&r&&ti(t),t.flags|=1,_s(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Vs(e,t,o))}function js(e,t,n,r,o){if(Do(n)){var i=!0;Lo(t)}else i=!1;if(ki(t,o),null===t.stateNode)Ws(e,t),Wi(t,n,r),qi(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var u=a.context,c=n.contextType;c="object"==typeof c&&null!==c?Pi(c):No(t,c=Do(n)?Co:To.current);var l=n.getDerivedStateFromProps,f="function"==typeof l||"function"==typeof a.getSnapshotBeforeUpdate;f||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||u!==c)&&Vi(t,a,r,c),Ci=!1;var d=t.memoizedState;a.state=d,Ui(t,r,a,o),u=t.memoizedState,s!==r||d!==u||Ao.current||Ci?("function"==typeof l&&(Fi(t,n,l,r),u=t.memoizedState),(s=Ci||zi(t,n,s,r,d,u,c))?(f||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=c,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Di(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:gi(t.type,s),a.props=c,f=t.pendingProps,d=a.context,u="object"==typeof(u=n.contextType)&&null!==u?Pi(u):No(t,u=Do(n)?Co:To.current);var p=n.getDerivedStateFromProps;(l="function"==typeof p||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==f||d!==u)&&Vi(t,a,r,u),Ci=!1,d=t.memoizedState,a.state=d,Ui(t,r,a,o);var h=t.memoizedState;s!==f||d!==h||Ao.current||Ci?("function"==typeof p&&(Fi(t,n,p,r),h=t.memoizedState),(c=Ci||zi(t,n,c,r,d,h,u)||!1)?(l||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,h,u),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,h,u)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=u,r=c):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return Ts(e,t,n,r,i,o)}function Ts(e,t,n,r,o,i){Ps(e,t);var a=0!=(128&t.flags);if(!r&&!a)return o&&Uo(t,n,!1),Vs(e,t,i);r=t.stateNode,bs.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=Ji(t,e.child,null,i),t.child=Ji(t,null,s,i)):_s(e,t,s,i),t.memoizedState=r.state,o&&Uo(t,n,!0),t.child}function As(e){var t=e.stateNode;t.pendingContext?Io(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Io(0,t.context,!1),oa(e,t.containerInfo)}function Cs(e,t,n,r,o){return hi(),yi(o),t.flags|=256,_s(e,t,n,r),t.child}var Ns,Ds,Rs,Is,Ms={dehydrated:null,treeContext:null,retryLane:0};function Ls(e){return{baseLanes:e,cachePool:null,transitions:null}}function Us(e,t,n){var r,o=t.pendingProps,a=ua.current,s=!1,u=0!=(128&t.flags);if((r=u)||(r=(null===e||null!==e.memoizedState)&&0!=(2&a)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),xo(ua,1&a),null===e)return li(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(u=o.children,e=o.fallback,s?(o=t.mode,s=t.child,u={mode:"hidden",children:u},0==(1&o)&&null!==s?(s.childLanes=0,s.pendingProps=u):s=Lc(u,o,0,null),e=Mc(e,o,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Ls(n),t.memoizedState=Ms,e):$s(t,u));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return function(e,t,n,r,o,a,s){if(n)return 256&t.flags?(t.flags&=-257,Bs(e,t,s,r=fs(Error(i(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=r.fallback,o=t.mode,r=Lc({mode:"visible",children:r.children},o,0,null),(a=Mc(a,o,s,null)).flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,0!=(1&t.mode)&&Ji(t,e.child,null,s),t.child.memoizedState=Ls(s),t.memoizedState=Ms,a);if(0==(1&t.mode))return Bs(e,t,s,null);if("$!"===o.data){if(r=o.nextSibling&&o.nextSibling.dataset)var u=r.dgst;return r=u,Bs(e,t,s,r=fs(a=Error(i(419)),r,void 0))}if(u=0!=(s&e.childLanes),ws||u){if(null!==(r=Au)){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!=(o&(r.suspendedLanes|s))?0:o)&&o!==a.retryLane&&(a.retryLane=o,Ai(e,o),rc(r,e,o,-1))}return mc(),Bs(e,t,s,r=fs(Error(i(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=jc.bind(null,e),o._reactRetry=t,null):(e=a.treeContext,oi=co(o.nextSibling),ri=t,ii=!0,ai=null,null!==e&&(Go[Qo++]=Jo,Go[Qo++]=Xo,Go[Qo++]=Yo,Jo=e.id,Xo=e.overflow,Yo=t),(t=$s(t,r.children)).flags|=4096,t)}(e,t,u,o,r,a,n);if(s){s=o.fallback,u=t.mode,r=(a=e.child).sibling;var c={mode:"hidden",children:o.children};return 0==(1&u)&&t.child!==a?((o=t.child).childLanes=0,o.pendingProps=c,t.deletions=null):(o=Rc(a,c)).subtreeFlags=14680064&a.subtreeFlags,null!==r?s=Rc(r,s):(s=Mc(s,u,n,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,o=s,s=t.child,u=null===(u=e.child.memoizedState)?Ls(n):{baseLanes:u.baseLanes|n,cachePool:null,transitions:u.transitions},s.memoizedState=u,s.childLanes=e.childLanes&~n,t.memoizedState=Ms,o}return e=(s=e.child).sibling,o=Rc(s,{mode:"visible",children:o.children}),0==(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function $s(e,t){return(t=Lc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Bs(e,t,n,r){return null!==r&&yi(r),Ji(t,e.child,null,n),(e=$s(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Fs(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ei(e.return,t,n)}function Ks(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function zs(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(_s(e,t,r.children,n),0!=(2&(r=ua.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Fs(e,n,t);else if(19===e.tag)Fs(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(xo(ua,r),0==(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===ca(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ks(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===ca(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ks(t,!0,n,null,i);break;case"together":Ks(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ws(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Vs(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Lu|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=Rc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Rc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function qs(e,t){if(!ii)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Hs(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Gs(e,t,n){var r=t.pendingProps;switch(ni(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Hs(t),null;case 1:case 17:return Do(t.type)&&Ro(),Hs(t),null;case 3:return r=t.stateNode,ia(),Po(Ao),Po(To),fa(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(di(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==ai&&(sc(ai),ai=null))),Ds(e,t),Hs(t),null;case 5:sa(t);var o=ra(na.current);if(n=t.type,null!==e&&null!=t.stateNode)Rs(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(i(166));return Hs(t),null}if(e=ra(ea.current),di(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[po]=t,r[ho]=a,e=0!=(1&t.mode),n){case"dialog":$r("cancel",r),$r("close",r);break;case"iframe":case"object":case"embed":$r("load",r);break;case"video":case"audio":for(o=0;o<Ir.length;o++)$r(Ir[o],r);break;case"source":$r("error",r);break;case"img":case"image":case"link":$r("error",r),$r("load",r);break;case"details":$r("toggle",r);break;case"input":Y(r,a),$r("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},$r("invalid",r);break;case"textarea":oe(r,a),$r("invalid",r)}for(var u in ve(n,a),o=null,a)if(a.hasOwnProperty(u)){var c=a[u];"children"===u?"string"==typeof c?r.textContent!==c&&(!0!==a.suppressHydrationWarning&&Xr(r.textContent,c,e),o=["children",c]):"number"==typeof c&&r.textContent!==""+c&&(!0!==a.suppressHydrationWarning&&Xr(r.textContent,c,e),o=["children",""+c]):s.hasOwnProperty(u)&&null!=c&&"onScroll"===u&&$r("scroll",r)}switch(n){case"input":q(r),Z(r,a,!0);break;case"textarea":q(r),ae(r);break;case"select":case"option":break;default:"function"==typeof a.onClick&&(r.onclick=Zr)}r=o,t.updateQueue=r,null!==r&&(t.flags|=4)}else{u=9===o.nodeType?o:o.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=se(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=u.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=u.createElement(n,{is:r.is}):(e=u.createElement(n),"select"===n&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,n),e[po]=t,e[ho]=r,Ns(e,t,!1,!1),t.stateNode=e;e:{switch(u=be(n,r),n){case"dialog":$r("cancel",e),$r("close",e),o=r;break;case"iframe":case"object":case"embed":$r("load",e),o=r;break;case"video":case"audio":for(o=0;o<Ir.length;o++)$r(Ir[o],e);o=r;break;case"source":$r("error",e),o=r;break;case"img":case"image":case"link":$r("error",e),$r("load",e),o=r;break;case"details":$r("toggle",e),o=r;break;case"input":Y(e,r),o=Q(e,r),$r("invalid",e);break;case"option":default:o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=L({},r,{value:void 0}),$r("invalid",e);break;case"textarea":oe(e,r),o=re(e,r),$r("invalid",e)}for(a in ve(n,o),c=o)if(c.hasOwnProperty(a)){var l=c[a];"style"===a?me(e,l):"dangerouslySetInnerHTML"===a?null!=(l=l?l.__html:void 0)&&fe(e,l):"children"===a?"string"==typeof l?("textarea"!==n||""!==l)&&de(e,l):"number"==typeof l&&de(e,""+l):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(s.hasOwnProperty(a)?null!=l&&"onScroll"===a&&$r("scroll",e):null!=l&&b(e,a,l,u))}switch(n){case"input":q(e),Z(e,r,!1);break;case"textarea":q(e),ae(e);break;case"option":null!=r.value&&e.setAttribute("value",""+W(r.value));break;case"select":e.multiple=!!r.multiple,null!=(a=r.value)?ne(e,!!r.multiple,a,!1):null!=r.defaultValue&&ne(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof o.onClick&&(e.onclick=Zr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Hs(t),null;case 6:if(e&&null!=t.stateNode)Is(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(n=ra(na.current),ra(ea.current),di(t)){if(r=t.stateNode,n=t.memoizedProps,r[po]=t,(a=r.nodeValue!==n)&&null!==(e=ri))switch(e.tag){case 3:Xr(r.nodeValue,n,0!=(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Xr(r.nodeValue,n,0!=(1&e.mode))}a&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[po]=t,t.stateNode=r}return Hs(t),null;case 13:if(Po(ua),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ii&&null!==oi&&0!=(1&t.mode)&&0==(128&t.flags))pi(),hi(),t.flags|=98560,a=!1;else if(a=di(t),null!==r&&null!==r.dehydrated){if(null===e){if(!a)throw Error(i(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(i(317));a[po]=t}else hi(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Hs(t),a=!1}else null!==ai&&(sc(ai),ai=null),a=!0;if(!a)return 65536&t.flags?t:null}return 0!=(128&t.flags)?(t.lanes=n,t):((r=null!==r)!=(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&ua.current)?0===Iu&&(Iu=3):mc())),null!==t.updateQueue&&(t.flags|=4),Hs(t),null);case 4:return ia(),Ds(e,t),null===e&&Kr(t.stateNode.containerInfo),Hs(t),null;case 10:return Oi(t.type._context),Hs(t),null;case 19:if(Po(ua),null===(a=t.memoizedState))return Hs(t),null;if(r=0!=(128&t.flags),null===(u=a.rendering))if(r)qs(a,!1);else{if(0!==Iu||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(u=ca(e))){for(t.flags|=128,qs(a,!1),null!==(r=u.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(a=n).flags&=14680066,null===(u=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,e=u.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return xo(ua,1&ua.current|2),t.child}e=e.sibling}null!==a.tail&&Je()>zu&&(t.flags|=128,r=!0,qs(a,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=ca(u))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),qs(a,!0),null===a.tail&&"hidden"===a.tailMode&&!u.alternate&&!ii)return Hs(t),null}else 2*Je()-a.renderingStartTime>zu&&1073741824!==n&&(t.flags|=128,r=!0,qs(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(null!==(n=a.last)?n.sibling=u:t.child=u,a.last=u)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Je(),t.sibling=null,n=ua.current,xo(ua,r?1&n|2:1&n),t):(Hs(t),null);case 22:case 23:return dc(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(1073741824&Du)&&(Hs(t),6&t.subtreeFlags&&(t.flags|=8192)):Hs(t),null;case 24:case 25:return null}throw Error(i(156,t.tag))}function Qs(e,t){switch(ni(t),t.tag){case 1:return Do(t.type)&&Ro(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return ia(),Po(Ao),Po(To),fa(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return sa(t),null;case 13:if(Po(ua),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));hi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Po(ua),null;case 4:return ia(),null;case 10:return Oi(t.type._context),null;case 22:case 23:return dc(),null;default:return null}}Ns=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ds=function(){},Rs=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ra(ea.current);var i,a=null;switch(n){case"input":o=Q(e,o),r=Q(e,r),a=[];break;case"select":o=L({},o,{value:void 0}),r=L({},r,{value:void 0}),a=[];break;case"textarea":o=re(e,o),r=re(e,r),a=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=Zr)}for(l in ve(n,r),n=null,o)if(!r.hasOwnProperty(l)&&o.hasOwnProperty(l)&&null!=o[l])if("style"===l){var u=o[l];for(i in u)u.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(s.hasOwnProperty(l)?a||(a=[]):(a=a||[]).push(l,null));for(l in r){var c=r[l];if(u=null!=o?o[l]:void 0,r.hasOwnProperty(l)&&c!==u&&(null!=c||null!=u))if("style"===l)if(u){for(i in u)!u.hasOwnProperty(i)||c&&c.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in c)c.hasOwnProperty(i)&&u[i]!==c[i]&&(n||(n={}),n[i]=c[i])}else n||(a||(a=[]),a.push(l,n)),n=c;else"dangerouslySetInnerHTML"===l?(c=c?c.__html:void 0,u=u?u.__html:void 0,null!=c&&u!==c&&(a=a||[]).push(l,c)):"children"===l?"string"!=typeof c&&"number"!=typeof c||(a=a||[]).push(l,""+c):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(s.hasOwnProperty(l)?(null!=c&&"onScroll"===l&&$r("scroll",e),a||u===c||(a=[])):(a=a||[]).push(l,c))}n&&(a=a||[]).push("style",n);var l=a;(t.updateQueue=l)&&(t.flags|=4)}},Is=function(e,t,n,r){n!==r&&(t.flags|=4)};var Ys=!1,Js=!1,Xs="function"==typeof WeakSet?WeakSet:Set,Zs=null;function eu(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){kc(e,t,n)}else n.current=null}function tu(e,t,n){try{n()}catch(n){kc(e,t,n)}}var nu=!1;function ru(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&tu(t,n,i)}o=o.next}while(o!==r)}}function ou(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function iu(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function au(e){var t=e.alternate;null!==t&&(e.alternate=null,au(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&(delete t[po],delete t[ho],delete t[mo],delete t[go],delete t[vo]),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function su(e){return 5===e.tag||3===e.tag||4===e.tag}function uu(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||su(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function cu(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Zr));else if(4!==r&&null!==(e=e.child))for(cu(e,t,n),e=e.sibling;null!==e;)cu(e,t,n),e=e.sibling}function lu(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(lu(e,t,n),e=e.sibling;null!==e;)lu(e,t,n),e=e.sibling}var fu=null,du=!1;function pu(e,t,n){for(n=n.child;null!==n;)hu(e,t,n),n=n.sibling}function hu(e,t,n){if(it&&"function"==typeof it.onCommitFiberUnmount)try{it.onCommitFiberUnmount(ot,n)}catch(e){}switch(n.tag){case 5:Js||eu(n,t);case 6:var r=fu,o=du;fu=null,pu(e,t,n),du=o,null!==(fu=r)&&(du?(e=fu,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):fu.removeChild(n.stateNode));break;case 18:null!==fu&&(du?(e=fu,n=n.stateNode,8===e.nodeType?uo(e.parentNode,n):1===e.nodeType&&uo(e,n),Kt(e)):uo(fu,n.stateNode));break;case 4:r=fu,o=du,fu=n.stateNode.containerInfo,du=!0,pu(e,t,n),fu=r,du=o;break;case 0:case 11:case 14:case 15:if(!Js&&null!==(r=n.updateQueue)&&null!==(r=r.lastEffect)){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(0!=(2&i)||0!=(4&i))&&tu(n,t,a),o=o.next}while(o!==r)}pu(e,t,n);break;case 1:if(!Js&&(eu(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){kc(n,t,e)}pu(e,t,n);break;case 21:pu(e,t,n);break;case 22:1&n.mode?(Js=(r=Js)||null!==n.memoizedState,pu(e,t,n),Js=r):pu(e,t,n);break;default:pu(e,t,n)}}function yu(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Xs),t.forEach((function(t){var r=Tc.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function mu(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var o=n[r];try{var a=e,s=t,u=s;e:for(;null!==u;){switch(u.tag){case 5:fu=u.stateNode,du=!1;break e;case 3:case 4:fu=u.stateNode.containerInfo,du=!0;break e}u=u.return}if(null===fu)throw Error(i(160));hu(a,s,o),fu=null,du=!1;var c=o.alternate;null!==c&&(c.return=null),o.return=null}catch(e){kc(o,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)gu(t,e),t=t.sibling}function gu(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(mu(t,e),vu(e),4&r){try{ru(3,e,e.return),ou(3,e)}catch(t){kc(e,e.return,t)}try{ru(5,e,e.return)}catch(t){kc(e,e.return,t)}}break;case 1:mu(t,e),vu(e),512&r&&null!==n&&eu(n,n.return);break;case 5:if(mu(t,e),vu(e),512&r&&null!==n&&eu(n,n.return),32&e.flags){var o=e.stateNode;try{de(o,"")}catch(t){kc(e,e.return,t)}}if(4&r&&null!=(o=e.stateNode)){var a=e.memoizedProps,s=null!==n?n.memoizedProps:a,u=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===u&&"radio"===a.type&&null!=a.name&&J(o,a),be(u,s);var l=be(u,a);for(s=0;s<c.length;s+=2){var f=c[s],d=c[s+1];"style"===f?me(o,d):"dangerouslySetInnerHTML"===f?fe(o,d):"children"===f?de(o,d):b(o,f,d,l)}switch(u){case"input":X(o,a);break;case"textarea":ie(o,a);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!a.multiple;var h=a.value;null!=h?ne(o,!!a.multiple,h,!1):p!==!!a.multiple&&(null!=a.defaultValue?ne(o,!!a.multiple,a.defaultValue,!0):ne(o,!!a.multiple,a.multiple?[]:"",!1))}o[ho]=a}catch(t){kc(e,e.return,t)}}break;case 6:if(mu(t,e),vu(e),4&r){if(null===e.stateNode)throw Error(i(162));o=e.stateNode,a=e.memoizedProps;try{o.nodeValue=a}catch(t){kc(e,e.return,t)}}break;case 3:if(mu(t,e),vu(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Kt(t.containerInfo)}catch(t){kc(e,e.return,t)}break;case 4:default:mu(t,e),vu(e);break;case 13:mu(t,e),vu(e),8192&(o=e.child).flags&&(a=null!==o.memoizedState,o.stateNode.isHidden=a,!a||null!==o.alternate&&null!==o.alternate.memoizedState||(Ku=Je())),4&r&&yu(e);break;case 22:if(f=null!==n&&null!==n.memoizedState,1&e.mode?(Js=(l=Js)||f,mu(t,e),Js=l):mu(t,e),vu(e),8192&r){if(l=null!==e.memoizedState,(e.stateNode.isHidden=l)&&!f&&0!=(1&e.mode))for(Zs=e,f=e.child;null!==f;){for(d=Zs=f;null!==Zs;){switch(h=(p=Zs).child,p.tag){case 0:case 11:case 14:case 15:ru(4,p,p.return);break;case 1:eu(p,p.return);var y=p.stateNode;if("function"==typeof y.componentWillUnmount){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(e){kc(r,n,e)}}break;case 5:eu(p,p.return);break;case 22:if(null!==p.memoizedState){Su(d);continue}}null!==h?(h.return=p,Zs=h):Su(d)}f=f.sibling}e:for(f=null,d=e;;){if(5===d.tag){if(null===f){f=d;try{o=d.stateNode,l?"function"==typeof(a=o.style).setProperty?a.setProperty("display","none","important"):a.display="none":(u=d.stateNode,s=null!=(c=d.memoizedProps.style)&&c.hasOwnProperty("display")?c.display:null,u.style.display=ye("display",s))}catch(t){kc(e,e.return,t)}}}else if(6===d.tag){if(null===f)try{d.stateNode.nodeValue=l?"":d.memoizedProps}catch(t){kc(e,e.return,t)}}else if((22!==d.tag&&23!==d.tag||null===d.memoizedState||d===e)&&null!==d.child){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;null===d.sibling;){if(null===d.return||d.return===e)break e;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:mu(t,e),vu(e),4&r&&yu(e);case 21:}}function vu(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(su(n)){var r=n;break e}n=n.return}throw Error(i(160))}switch(r.tag){case 5:var o=r.stateNode;32&r.flags&&(de(o,""),r.flags&=-33),lu(e,uu(e),o);break;case 3:case 4:var a=r.stateNode.containerInfo;cu(e,uu(e),a);break;default:throw Error(i(161))}}catch(t){kc(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function bu(e,t,n){Zs=e,wu(e,t,n)}function wu(e,t,n){for(var r=0!=(1&e.mode);null!==Zs;){var o=Zs,i=o.child;if(22===o.tag&&r){var a=null!==o.memoizedState||Ys;if(!a){var s=o.alternate,u=null!==s&&null!==s.memoizedState||Js;s=Ys;var c=Js;if(Ys=a,(Js=u)&&!c)for(Zs=o;null!==Zs;)u=(a=Zs).child,22===a.tag&&null!==a.memoizedState?Ou(o):null!==u?(u.return=a,Zs=u):Ou(o);for(;null!==i;)Zs=i,wu(i,t,n),i=i.sibling;Zs=o,Ys=s,Js=c}_u(e)}else 0!=(8772&o.subtreeFlags)&&null!==i?(i.return=o,Zs=i):_u(e)}}function _u(e){for(;null!==Zs;){var t=Zs;if(0!=(8772&t.flags)){var n=t.alternate;try{if(0!=(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Js||ou(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!Js)if(null===n)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:gi(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&$i(t,a,r);break;case 3:var s=t.updateQueue;if(null!==s){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}$i(t,s,n)}break;case 5:var u=t.stateNode;if(null===n&&4&t.flags){n=u;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var l=t.alternate;if(null!==l){var f=l.memoizedState;if(null!==f){var d=f.dehydrated;null!==d&&Kt(d)}}}break;default:throw Error(i(163))}Js||512&t.flags&&iu(t)}catch(e){kc(t,t.return,e)}}if(t===e){Zs=null;break}if(null!==(n=t.sibling)){n.return=t.return,Zs=n;break}Zs=t.return}}function Su(e){for(;null!==Zs;){var t=Zs;if(t===e){Zs=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Zs=n;break}Zs=t.return}}function Ou(e){for(;null!==Zs;){var t=Zs;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ou(4,t)}catch(e){kc(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var o=t.return;try{r.componentDidMount()}catch(e){kc(t,o,e)}}var i=t.return;try{iu(t)}catch(e){kc(t,i,e)}break;case 5:var a=t.return;try{iu(t)}catch(e){kc(t,a,e)}}}catch(e){kc(t,t.return,e)}if(t===e){Zs=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Zs=s;break}Zs=t.return}}var Eu,ku=Math.ceil,Pu=w.ReactCurrentDispatcher,xu=w.ReactCurrentOwner,ju=w.ReactCurrentBatchConfig,Tu=0,Au=null,Cu=null,Nu=0,Du=0,Ru=ko(0),Iu=0,Mu=null,Lu=0,Uu=0,$u=0,Bu=null,Fu=null,Ku=0,zu=1/0,Wu=null,Vu=!1,qu=null,Hu=null,Gu=!1,Qu=null,Yu=0,Ju=0,Xu=null,Zu=-1,ec=0;function tc(){return 0!=(6&Tu)?Je():-1!==Zu?Zu:Zu=Je()}function nc(e){return 0==(1&e.mode)?1:0!=(2&Tu)&&0!==Nu?Nu&-Nu:null!==mi.transition?(0===ec&&(ec=yt()),ec):0!==(e=bt)?e:e=void 0===(e=window.event)?16:Yt(e.type)}function rc(e,t,n,r){if(50<Ju)throw Ju=0,Xu=null,Error(i(185));gt(e,n,r),0!=(2&Tu)&&e===Au||(e===Au&&(0==(2&Tu)&&(Uu|=n),4===Iu&&uc(e,Nu)),oc(e,r),1===n&&0===Tu&&0==(1&t.mode)&&(zu=Je()+500,Bo&&zo()))}function oc(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-at(i),s=1<<a,u=o[a];-1===u?0!=(s&n)&&0==(s&r)||(o[a]=pt(s,t)):u<=t&&(e.expiredLanes|=s),i&=~s}}(e,t);var r=dt(e,e===Au?Nu:0);if(0===r)null!==n&&Ge(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Ge(n),1===t)0===e.tag?function(e){Bo=!0,Ko(e)}(cc.bind(null,e)):Ko(cc.bind(null,e)),ao((function(){0==(6&Tu)&&zo()})),n=null;else{switch(wt(r)){case 1:n=Ze;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=rt}n=Ac(n,ic.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ic(e,t){if(Zu=-1,ec=0,0!=(6&Tu))throw Error(i(327));var n=e.callbackNode;if(Oc()&&e.callbackNode!==n)return null;var r=dt(e,e===Au?Nu:0);if(0===r)return null;if(0!=(30&r)||0!=(r&e.expiredLanes)||t)t=gc(e,r);else{t=r;var o=Tu;Tu|=2;var a=yc();for(Au===e&&Nu===t||(Wu=null,zu=Je()+500,pc(e,t));;)try{bc();break}catch(t){hc(e,t)}Si(),Pu.current=a,Tu=o,null!==Cu?t=0:(Au=null,Nu=0,t=Iu)}if(0!==t){if(2===t&&0!==(o=ht(e))&&(r=o,t=ac(e,o)),1===t)throw n=Mu,pc(e,0),uc(e,r),oc(e,Je()),n;if(6===t)uc(e,r);else{if(o=e.current.alternate,0==(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!sr(i(),o))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(o)&&(2===(t=gc(e,r))&&0!==(a=ht(e))&&(r=a,t=ac(e,a)),1===t))throw n=Mu,pc(e,0),uc(e,r),oc(e,Je()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(i(345));case 2:case 5:Sc(e,Fu,Wu);break;case 3:if(uc(e,r),(130023424&r)===r&&10<(t=Ku+500-Je())){if(0!==dt(e,0))break;if(((o=e.suspendedLanes)&r)!==r){tc(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ro(Sc.bind(null,e,Fu,Wu),t);break}Sc(e,Fu,Wu);break;case 4:if(uc(e,r),(4194240&r)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-at(r);a=1<<s,(s=t[s])>o&&(o=s),r&=~a}if(r=o,10<(r=(120>(r=Je()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ku(r/1960))-r)){e.timeoutHandle=ro(Sc.bind(null,e,Fu,Wu),r);break}Sc(e,Fu,Wu);break;default:throw Error(i(329))}}}return oc(e,Je()),e.callbackNode===n?ic.bind(null,e):null}function ac(e,t){var n=Bu;return e.current.memoizedState.isDehydrated&&(pc(e,t).flags|=256),2!==(e=gc(e,t))&&(t=Fu,Fu=n,null!==t&&sc(t)),e}function sc(e){null===Fu?Fu=e:Fu.push.apply(Fu,e)}function uc(e,t){for(t&=~$u,t&=~Uu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-at(t),r=1<<n;e[n]=-1,t&=~r}}function cc(e){if(0!=(6&Tu))throw Error(i(327));Oc();var t=dt(e,0);if(0==(1&t))return oc(e,Je()),null;var n=gc(e,t);if(0!==e.tag&&2===n){var r=ht(e);0!==r&&(t=r,n=ac(e,r))}if(1===n)throw n=Mu,pc(e,0),uc(e,t),oc(e,Je()),n;if(6===n)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Sc(e,Fu,Wu),oc(e,Je()),null}function lc(e,t){var n=Tu;Tu|=1;try{return e(t)}finally{0===(Tu=n)&&(zu=Je()+500,Bo&&zo())}}function fc(e){null!==Qu&&0===Qu.tag&&0==(6&Tu)&&Oc();var t=Tu;Tu|=1;var n=ju.transition,r=bt;try{if(ju.transition=null,bt=1,e)return e()}finally{bt=r,ju.transition=n,0==(6&(Tu=t))&&zo()}}function dc(){Du=Ru.current,Po(Ru)}function pc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,oo(n)),null!==Cu)for(n=Cu.return;null!==n;){var r=n;switch(ni(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Ro();break;case 3:ia(),Po(Ao),Po(To),fa();break;case 5:sa(r);break;case 4:ia();break;case 13:case 19:Po(ua);break;case 10:Oi(r.type._context);break;case 22:case 23:dc()}n=n.return}if(Au=e,Cu=e=Rc(e.current,null),Nu=Du=t,Iu=0,Mu=null,$u=Uu=Lu=0,Fu=Bu=null,null!==xi){for(t=0;t<xi.length;t++)if(null!==(r=(n=xi[t]).interleaved)){n.interleaved=null;var o=r.next,i=n.pending;if(null!==i){var a=i.next;i.next=o,r.next=a}n.pending=r}xi=null}return e}function hc(e,t){for(;;){var n=Cu;try{if(Si(),da.current=as,va){for(var r=ya.memoizedState;null!==r;){var o=r.queue;null!==o&&(o.pending=null),r=r.next}va=!1}if(ha=0,ga=ma=ya=null,ba=!1,wa=0,xu.current=null,null===n||null===n.return){Iu=1,Mu=t,Cu=null;break}e:{var a=e,s=n.return,u=n,c=t;if(t=Nu,u.flags|=32768,null!==c&&"object"==typeof c&&"function"==typeof c.then){var l=c,f=u,d=f.tag;if(0==(1&f.mode)&&(0===d||11===d||15===d)){var p=f.alternate;p?(f.updateQueue=p.updateQueue,f.memoizedState=p.memoizedState,f.lanes=p.lanes):(f.updateQueue=null,f.memoizedState=null)}var h=gs(s);if(null!==h){h.flags&=-257,vs(h,s,u,0,t),1&h.mode&&ms(a,l,t),c=l;var y=(t=h).updateQueue;if(null===y){var m=new Set;m.add(c),t.updateQueue=m}else y.add(c);break e}if(0==(1&t)){ms(a,l,t),mc();break e}c=Error(i(426))}else if(ii&&1&u.mode){var g=gs(s);if(null!==g){0==(65536&g.flags)&&(g.flags|=256),vs(g,s,u,0,t),yi(ls(c,u));break e}}a=c=ls(c,u),4!==Iu&&(Iu=2),null===Bu?Bu=[a]:Bu.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t,Li(a,hs(0,c,t));break e;case 1:u=c;var v=a.type,b=a.stateNode;if(0==(128&a.flags)&&("function"==typeof v.getDerivedStateFromError||null!==b&&"function"==typeof b.componentDidCatch&&(null===Hu||!Hu.has(b)))){a.flags|=65536,t&=-t,a.lanes|=t,Li(a,ys(a,u,t));break e}}a=a.return}while(null!==a)}_c(n)}catch(e){t=e,Cu===n&&null!==n&&(Cu=n=n.return);continue}break}}function yc(){var e=Pu.current;return Pu.current=as,null===e?as:e}function mc(){0!==Iu&&3!==Iu&&2!==Iu||(Iu=4),null===Au||0==(268435455&Lu)&&0==(268435455&Uu)||uc(Au,Nu)}function gc(e,t){var n=Tu;Tu|=2;var r=yc();for(Au===e&&Nu===t||(Wu=null,pc(e,t));;)try{vc();break}catch(t){hc(e,t)}if(Si(),Tu=n,Pu.current=r,null!==Cu)throw Error(i(261));return Au=null,Nu=0,Iu}function vc(){for(;null!==Cu;)wc(Cu)}function bc(){for(;null!==Cu&&!Qe();)wc(Cu)}function wc(e){var t=Eu(e.alternate,e,Du);e.memoizedProps=e.pendingProps,null===t?_c(e):Cu=t,xu.current=null}function _c(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(32768&t.flags)){if(null!==(n=Gs(n,t,Du)))return void(Cu=n)}else{if(null!==(n=Qs(n,t)))return n.flags&=32767,void(Cu=n);if(null===e)return Iu=6,void(Cu=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Cu=t);Cu=t=e}while(null!==t);0===Iu&&(Iu=5)}function Sc(e,t,n){var r=bt,o=ju.transition;try{ju.transition=null,bt=1,function(e,t,n,r){do{Oc()}while(null!==Qu);if(0!=(6&Tu))throw Error(i(327));n=e.finishedWork;var o=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-at(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}(e,a),e===Au&&(Cu=Au=null,Nu=0),0==(2064&n.subtreeFlags)&&0==(2064&n.flags)||Gu||(Gu=!0,Ac(tt,(function(){return Oc(),null}))),a=0!=(15990&n.flags),0!=(15990&n.subtreeFlags)||a){a=ju.transition,ju.transition=null;var s=bt;bt=1;var u=Tu;Tu|=4,xu.current=null,function(e,t){if(eo=Wt,pr(e=dr())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var o=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch(e){n=null;break e}var s=0,u=-1,c=-1,l=0,f=0,d=e,p=null;t:for(;;){for(var h;d!==n||0!==o&&3!==d.nodeType||(u=s+o),d!==a||0!==r&&3!==d.nodeType||(c=s+r),3===d.nodeType&&(s+=d.nodeValue.length),null!==(h=d.firstChild);)p=d,d=h;for(;;){if(d===e)break t;if(p===n&&++l===o&&(u=s),p===a&&++f===r&&(c=s),null!==(h=d.nextSibling))break;p=(d=p).parentNode}d=h}n=-1===u||-1===c?null:{start:u,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(to={focusedElem:e,selectionRange:n},Wt=!1,Zs=t;null!==Zs;)if(e=(t=Zs).child,0!=(1028&t.subtreeFlags)&&null!==e)e.return=t,Zs=e;else for(;null!==Zs;){t=Zs;try{var y=t.alternate;if(0!=(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==y){var m=y.memoizedProps,g=y.memoizedState,v=t.stateNode,b=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:gi(t.type,m),g);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;1===w.nodeType?w.textContent="":9===w.nodeType&&w.documentElement&&w.removeChild(w.documentElement);break;default:throw Error(i(163))}}catch(e){kc(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,Zs=e;break}Zs=t.return}y=nu,nu=!1}(e,n),gu(n,e),hr(to),Wt=!!eo,to=eo=null,e.current=n,bu(n,e,o),Ye(),Tu=u,bt=s,ju.transition=a}else e.current=n;if(Gu&&(Gu=!1,Qu=e,Yu=o),0===(a=e.pendingLanes)&&(Hu=null),function(e){if(it&&"function"==typeof it.onCommitFiberRoot)try{it.onCommitFiberRoot(ot,e,void 0,128==(128&e.current.flags))}catch(e){}}(n.stateNode),oc(e,Je()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)r((o=t[n]).value,{componentStack:o.stack,digest:o.digest});if(Vu)throw Vu=!1,e=qu,qu=null,e;0!=(1&Yu)&&0!==e.tag&&Oc(),0!=(1&(a=e.pendingLanes))?e===Xu?Ju++:(Ju=0,Xu=e):Ju=0,zo()}(e,t,n,r)}finally{ju.transition=o,bt=r}return null}function Oc(){if(null!==Qu){var e=wt(Yu),t=ju.transition,n=bt;try{if(ju.transition=null,bt=16>e?16:e,null===Qu)var r=!1;else{if(e=Qu,Qu=null,Yu=0,0!=(6&Tu))throw Error(i(331));var o=Tu;for(Tu|=4,Zs=e.current;null!==Zs;){var a=Zs,s=a.child;if(0!=(16&Zs.flags)){var u=a.deletions;if(null!==u){for(var c=0;c<u.length;c++){var l=u[c];for(Zs=l;null!==Zs;){var f=Zs;switch(f.tag){case 0:case 11:case 15:ru(8,f,a)}var d=f.child;if(null!==d)d.return=f,Zs=d;else for(;null!==Zs;){var p=(f=Zs).sibling,h=f.return;if(au(f),f===l){Zs=null;break}if(null!==p){p.return=h,Zs=p;break}Zs=h}}}var y=a.alternate;if(null!==y){var m=y.child;if(null!==m){y.child=null;do{var g=m.sibling;m.sibling=null,m=g}while(null!==m)}}Zs=a}}if(0!=(2064&a.subtreeFlags)&&null!==s)s.return=a,Zs=s;else e:for(;null!==Zs;){if(0!=(2048&(a=Zs).flags))switch(a.tag){case 0:case 11:case 15:ru(9,a,a.return)}var v=a.sibling;if(null!==v){v.return=a.return,Zs=v;break e}Zs=a.return}}var b=e.current;for(Zs=b;null!==Zs;){var w=(s=Zs).child;if(0!=(2064&s.subtreeFlags)&&null!==w)w.return=s,Zs=w;else e:for(s=b;null!==Zs;){if(0!=(2048&(u=Zs).flags))try{switch(u.tag){case 0:case 11:case 15:ou(9,u)}}catch(e){kc(u,u.return,e)}if(u===s){Zs=null;break e}var _=u.sibling;if(null!==_){_.return=u.return,Zs=_;break e}Zs=u.return}}if(Tu=o,zo(),it&&"function"==typeof it.onPostCommitFiberRoot)try{it.onPostCommitFiberRoot(ot,e)}catch(e){}r=!0}return r}finally{bt=n,ju.transition=t}}return!1}function Ec(e,t,n){e=Ii(e,t=hs(0,t=ls(n,t),1),1),t=tc(),null!==e&&(gt(e,1,t),oc(e,t))}function kc(e,t,n){if(3===e.tag)Ec(e,e,n);else for(;null!==t;){if(3===t.tag){Ec(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Hu||!Hu.has(r))){t=Ii(t,e=ys(t,e=ls(n,e),1),1),e=tc(),null!==t&&(gt(t,1,e),oc(t,e));break}}t=t.return}}function Pc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=tc(),e.pingedLanes|=e.suspendedLanes&n,Au===e&&(Nu&n)===n&&(4===Iu||3===Iu&&(130023424&Nu)===Nu&&500>Je()-Ku?pc(e,0):$u|=n),oc(e,t)}function xc(e,t){0===t&&(0==(1&e.mode)?t=1:(t=lt,0==(130023424&(lt<<=1))&&(lt=4194304)));var n=tc();null!==(e=Ai(e,t))&&(gt(e,t,n),oc(e,n))}function jc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),xc(e,n)}function Tc(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(i(314))}null!==r&&r.delete(t),xc(e,n)}function Ac(e,t){return He(e,t)}function Cc(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nc(e,t,n,r){return new Cc(e,t,n,r)}function Dc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Rc(e,t){var n=e.alternate;return null===n?((n=Nc(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ic(e,t,n,r,o,a){var s=2;if(r=e,"function"==typeof e)Dc(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case O:return Mc(n.children,o,a,t);case E:s=8,o|=8;break;case k:return(e=Nc(12,n,t,2|o)).elementType=k,e.lanes=a,e;case T:return(e=Nc(13,n,t,o)).elementType=T,e.lanes=a,e;case A:return(e=Nc(19,n,t,o)).elementType=A,e.lanes=a,e;case D:return Lc(n,o,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case P:s=10;break e;case x:s=9;break e;case j:s=11;break e;case C:s=14;break e;case N:s=16,r=null;break e}throw Error(i(130,null==e?e:typeof e,""))}return(t=Nc(s,n,t,o)).elementType=e,t.type=r,t.lanes=a,t}function Mc(e,t,n,r){return(e=Nc(7,e,r,t)).lanes=n,e}function Lc(e,t,n,r){return(e=Nc(22,e,r,t)).elementType=D,e.lanes=n,e.stateNode={isHidden:!1},e}function Uc(e,t,n){return(e=Nc(6,e,null,t)).lanes=n,e}function $c(e,t,n){return(t=Nc(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bc(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mt(0),this.expirationTimes=mt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Fc(e,t,n,r,o,i,a,s,u){return e=new Bc(e,t,n,s,u),1===t?(t=1,!0===i&&(t|=8)):t=0,i=Nc(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ni(i),e}function Kc(e){if(!e)return jo;e:{if(Ke(e=e._reactInternals)!==e||1!==e.tag)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Do(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(i(171))}if(1===e.tag){var n=e.type;if(Do(n))return Mo(e,n,t)}return t}function zc(e,t,n,r,o,i,a,s,u){return(e=Fc(n,r,!0,e,0,i,0,s,u)).context=Kc(null),n=e.current,(i=Ri(r=tc(),o=nc(n))).callback=null!=t?t:null,Ii(n,i,o),e.current.lanes=o,gt(e,o,r),oc(e,r),e}function Wc(e,t,n,r){var o=t.current,i=tc(),a=nc(o);return n=Kc(n),null===t.context?t.context=n:t.pendingContext=n,(t=Ri(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Ii(o,t,a))&&(rc(e,o,a,i),Mi(e,o,a)),a}function Vc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function qc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Hc(e,t){qc(e,t),(e=e.alternate)&&qc(e,t)}Eu=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Ao.current)ws=!0;else{if(0==(e.lanes&n)&&0==(128&t.flags))return ws=!1,function(e,t,n){switch(t.tag){case 3:As(t),hi();break;case 5:aa(t);break;case 1:Do(t.type)&&Lo(t);break;case 4:oa(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;xo(vi,r._currentValue),r._currentValue=o;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(xo(ua,1&ua.current),t.flags|=128,null):0!=(n&t.child.childLanes)?Us(e,t,n):(xo(ua,1&ua.current),null!==(e=Vs(e,t,n))?e.sibling:null);xo(ua,1&ua.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(128&e.flags)){if(r)return zs(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),xo(ua,ua.current),r)break;return null;case 22:case 23:return t.lanes=0,ks(e,t,n)}return Vs(e,t,n)}(e,t,n);ws=0!=(131072&e.flags)}else ws=!1,ii&&0!=(1048576&t.flags)&&ei(t,Ho,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ws(e,t),e=t.pendingProps;var o=No(t,To.current);ki(t,n),o=Ea(null,t,r,e,o,n);var a=ka();return t.flags|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Do(r)?(a=!0,Lo(t)):a=!1,t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,Ni(t),o.updater=Ki,t.stateNode=o,o._reactInternals=t,qi(t,r,e,n),t=Ts(null,t,r,!0,a,n)):(t.tag=0,ii&&a&&ti(t),_s(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ws(e,t),e=t.pendingProps,r=(o=r._init)(r._payload),t.type=r,o=t.tag=function(e){if("function"==typeof e)return Dc(e)?1:0;if(null!=e){if((e=e.$$typeof)===j)return 11;if(e===C)return 14}return 2}(r),e=gi(r,e),o){case 0:t=xs(null,t,r,e,n);break e;case 1:t=js(null,t,r,e,n);break e;case 11:t=Ss(null,t,r,e,n);break e;case 14:t=Os(null,t,r,gi(r.type,e),n);break e}throw Error(i(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,xs(e,t,r,o=t.elementType===r?o:gi(r,o),n);case 1:return r=t.type,o=t.pendingProps,js(e,t,r,o=t.elementType===r?o:gi(r,o),n);case 3:e:{if(As(t),null===e)throw Error(i(387));r=t.pendingProps,o=(a=t.memoizedState).element,Di(e,t),Ui(t,r,null,n);var s=t.memoizedState;if(r=s.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Cs(e,t,r,n,o=ls(Error(i(423)),t));break e}if(r!==o){t=Cs(e,t,r,n,o=ls(Error(i(424)),t));break e}for(oi=co(t.stateNode.containerInfo.firstChild),ri=t,ii=!0,ai=null,n=Xi(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(hi(),r===o){t=Vs(e,t,n);break e}_s(e,t,r,n)}t=t.child}return t;case 5:return aa(t),null===e&&li(t),r=t.type,o=t.pendingProps,a=null!==e?e.memoizedProps:null,s=o.children,no(r,o)?s=null:null!==a&&no(r,a)&&(t.flags|=32),Ps(e,t),_s(e,t,s,n),t.child;case 6:return null===e&&li(t),null;case 13:return Us(e,t,n);case 4:return oa(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Ji(t,null,r,n):_s(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,Ss(e,t,r,o=t.elementType===r?o:gi(r,o),n);case 7:return _s(e,t,t.pendingProps,n),t.child;case 8:case 12:return _s(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,a=t.memoizedProps,s=o.value,xo(vi,r._currentValue),r._currentValue=s,null!==a)if(sr(a.value,s)){if(a.children===o.children&&!Ao.current){t=Vs(e,t,n);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var u=a.dependencies;if(null!==u){s=a.child;for(var c=u.firstContext;null!==c;){if(c.context===r){if(1===a.tag){(c=Ri(-1,n&-n)).tag=2;var l=a.updateQueue;if(null!==l){var f=(l=l.shared).pending;null===f?c.next=c:(c.next=f.next,f.next=c),l.pending=c}}a.lanes|=n,null!==(c=a.alternate)&&(c.lanes|=n),Ei(a.return,n,t),u.lanes|=n;break}c=c.next}}else if(10===a.tag)s=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(s=a.return))throw Error(i(341));s.lanes|=n,null!==(u=s.alternate)&&(u.lanes|=n),Ei(s,n,t),s=a.sibling}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===t){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}_s(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ki(t,n),r=r(o=Pi(o)),t.flags|=1,_s(e,t,r,n),t.child;case 14:return o=gi(r=t.type,t.pendingProps),Os(e,t,r,o=gi(r.type,o),n);case 15:return Es(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:gi(r,o),Ws(e,t),t.tag=1,Do(r)?(e=!0,Lo(t)):e=!1,ki(t,n),Wi(t,r,o),qi(t,r,o,n),Ts(null,t,r,!0,e,n);case 19:return zs(e,t,n);case 22:return ks(e,t,n)}throw Error(i(156,t.tag))};var Gc="function"==typeof reportError?reportError:function(e){console.error(e)};function Qc(e){this._internalRoot=e}function Yc(e){this._internalRoot=e}function Jc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Xc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Zc(){}function el(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if("function"==typeof o){var s=o;o=function(){var e=Vc(a);s.call(e)}}Wc(t,a,e,o)}else a=function(e,t,n,r,o){if(o){if("function"==typeof r){var i=r;r=function(){var e=Vc(a);i.call(e)}}var a=zc(t,r,e,0,null,!1,0,"",Zc);return e._reactRootContainer=a,e[yo]=a.current,Kr(8===e.nodeType?e.parentNode:e),fc(),a}for(;o=e.lastChild;)e.removeChild(o);if("function"==typeof r){var s=r;r=function(){var e=Vc(u);s.call(e)}}var u=Fc(e,0,!1,null,0,!1,0,"",Zc);return e._reactRootContainer=u,e[yo]=u.current,Kr(8===e.nodeType?e.parentNode:e),fc((function(){Wc(t,u,n,r)})),u}(n,t,e,o,r);return Vc(a)}Yc.prototype.render=Qc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(i(409));Wc(e,t,null,null)},Yc.prototype.unmount=Qc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;fc((function(){Wc(null,e,null,null)})),t[yo]=null}},Yc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dt.length&&0!==t&&t<Dt[n].priority;n++);Dt.splice(n,0,e),0===n&&Lt(e)}},_t=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ft(t.pendingLanes);0!==n&&(vt(t,1|n),oc(t,Je()),0==(6&Tu)&&(zu=Je()+500,zo()))}break;case 13:fc((function(){var t=Ai(e,1);if(null!==t){var n=tc();rc(t,e,1,n)}})),Hc(e,1)}},St=function(e){if(13===e.tag){var t=Ai(e,134217728);null!==t&&rc(t,e,134217728,tc()),Hc(e,134217728)}},Ot=function(e){if(13===e.tag){var t=nc(e),n=Ai(e,t);null!==n&&rc(n,e,t,tc()),Hc(e,t)}},Et=function(){return bt},kt=function(e,t){var n=bt;try{return bt=e,t()}finally{bt=n}},Se=function(e,t,n){switch(t){case"input":if(X(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=So(r);if(!o)throw Error(i(90));H(r),X(r,o)}}}break;case"textarea":ie(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},je=lc,Te=fc;var tl={usingClientEntryPoint:!1,Events:[wo,_o,So,Pe,xe,lc]},nl={findFiberByHostInstance:bo,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},rl={bundleType:nl.bundleType,version:nl.version,rendererPackageName:nl.rendererPackageName,rendererConfig:nl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ve(e))?null:e.stateNode},findFiberByHostInstance:nl.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var ol=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ol.isDisabled&&ol.supportsFiber)try{ot=ol.inject(rl),it=ol}catch(le){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tl,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Jc(t))throw Error(i(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:S,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!Jc(e))throw Error(i(299));var n=!1,r="",o=Gc;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(o=t.onRecoverableError)),t=Fc(e,1,!1,null,0,n,0,r,o),e[yo]=t.current,Kr(8===e.nodeType?e.parentNode:e),new Qc(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(i(188));throw e=Object.keys(e).join(","),Error(i(268,e))}return null===(e=Ve(t))?null:e.stateNode},t.flushSync=function(e){return fc(e)},t.hydrate=function(e,t,n){if(!Xc(t))throw Error(i(200));return el(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!Jc(e))throw Error(i(405));var r=null!=n&&n.hydratedSources||null,o=!1,a="",s=Gc;if(null!=n&&(!0===n.unstable_strictMode&&(o=!0),void 0!==n.identifierPrefix&&(a=n.identifierPrefix),void 0!==n.onRecoverableError&&(s=n.onRecoverableError)),t=zc(t,null,e,1,null!=n?n:null,o,0,a,s),e[yo]=t.current,Kr(e),r)for(e=0;e<r.length;e++)o=(o=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Yc(t)},t.render=function(e,t,n){if(!Xc(t))throw Error(i(200));return el(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Xc(e))throw Error(i(40));return!!e._reactRootContainer&&(fc((function(){el(null,null,e,!1,(function(){e._reactRootContainer=null,e[yo]=null}))})),!0)},t.unstable_batchedUpdates=lc,t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Xc(n))throw Error(i(200));if(null==e||void 0===e._reactInternals)throw Error(i(38));return el(e,t,n,!1,r)},t.version="18.2.0-next-9e3b772b8-20220608"},645:(e,t,n)=>{"use strict";var r=n(788);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},788:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(975)},447:(e,t)=>{"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator,h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,m={};function g(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}function v(){}function b(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=g.prototype;var w=b.prototype=new v;w.constructor=b,y(w,g.prototype),w.isPureReactComponent=!0;var _=Array.isArray,S=Object.prototype.hasOwnProperty,O={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function k(e,t,r){var o,i={},a=null,s=null;if(null!=t)for(o in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)S.call(t,o)&&!E.hasOwnProperty(o)&&(i[o]=t[o]);var u=arguments.length-2;if(1===u)i.children=r;else if(1<u){for(var c=Array(u),l=0;l<u;l++)c[l]=arguments[l+2];i.children=c}if(e&&e.defaultProps)for(o in u=e.defaultProps)void 0===i[o]&&(i[o]=u[o]);return{$$typeof:n,type:e,key:a,ref:s,props:i,_owner:O.current}}function P(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var x=/\/+/g;function j(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function T(e,t,o,i,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var u=!1;if(null===e)u=!0;else switch(s){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case n:case r:u=!0}}if(u)return a=a(u=e),e=""===i?"."+j(u,0):i,_(a)?(o="",null!=e&&(o=e.replace(x,"$&/")+"/"),T(a,t,o,"",(function(e){return e}))):null!=a&&(P(a)&&(a=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,o+(!a.key||u&&u.key===a.key?"":(""+a.key).replace(x,"$&/")+"/")+e)),t.push(a)),1;if(u=0,i=""===i?".":i+":",_(e))for(var c=0;c<e.length;c++){var l=i+j(s=e[c],c);u+=T(s,t,o,l,a)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"==typeof l)for(e=l.call(e),c=0;!(s=e.next()).done;)u+=T(s=s.value,t,o,l=i+j(s,c++),a);else if("object"===s)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return u}function A(e,t,n){if(null==e)return e;var r=[],o=0;return T(e,r,"","",(function(e){return t.call(n,e,o++)})),r}function C(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var N={current:null},D={transition:null},R={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:D,ReactCurrentOwner:O};t.Children={map:A,forEach:function(e,t,n){A(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return A(e,(function(){t++})),t},toArray:function(e){return A(e,(function(e){return e}))||[]},only:function(e){if(!P(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=g,t.Fragment=o,t.Profiler=a,t.PureComponent=b,t.StrictMode=i,t.Suspense=l,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R,t.cloneElement=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=y({},e.props),i=e.key,a=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,s=O.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(c in t)S.call(t,c)&&!E.hasOwnProperty(c)&&(o[c]=void 0===t[c]&&void 0!==u?u[c]:t[c])}var c=arguments.length-2;if(1===c)o.children=r;else if(1<c){u=Array(c);for(var l=0;l<c;l++)u[l]=arguments[l+2];o.children=u}return{$$typeof:n,type:e.type,key:i,ref:a,props:o,_owner:s}},t.createContext=function(e){return(e={$$typeof:u,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=k,t.createFactory=function(e){var t=k.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=P,t.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:C}},t.memo=function(e,t){return{$$typeof:f,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=D.transition;D.transition={};try{e()}finally{D.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return N.current.useCallback(e,t)},t.useContext=function(e){return N.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return N.current.useDeferredValue(e)},t.useEffect=function(e,t){return N.current.useEffect(e,t)},t.useId=function(){return N.current.useId()},t.useImperativeHandle=function(e,t,n){return N.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return N.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return N.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return N.current.useMemo(e,t)},t.useReducer=function(e,t,n){return N.current.useReducer(e,t,n)},t.useRef=function(e){return N.current.useRef(e)},t.useState=function(e){return N.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return N.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return N.current.useTransition()},t.version="18.2.0"},735:(e,t,n)=>{"use strict";e.exports=n(447)},666:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function r(e){return 0===e.length?null:e[0]}function o(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,a=o>>>1;r<a;){var s=2*(r+1)-1,u=e[s],c=s+1,l=e[c];if(0>i(u,n))c<o&&0>i(l,u)?(e[r]=l,e[c]=n,r=c):(e[r]=u,e[s]=n,r=s);else{if(!(c<o&&0>i(l,n)))break e;e[r]=l,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,u=s.now();t.unstable_now=function(){return s.now()-u}}var c=[],l=[],f=1,d=null,p=3,h=!1,y=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var t=r(l);null!==t;){if(null===t.callback)o(l);else{if(!(t.startTime<=e))break;o(l),t.sortIndex=t.expirationTime,n(c,t)}t=r(l)}}function _(e){if(m=!1,w(e),!y)if(null!==r(c))y=!0,D(S);else{var t=r(l);null!==t&&R(_,t.startTime-e)}}function S(e,n){y=!1,m&&(m=!1,v(P),P=-1),h=!0;var i=p;try{for(w(n),d=r(c);null!==d&&(!(d.expirationTime>n)||e&&!T());){var a=d.callback;if("function"==typeof a){d.callback=null,p=d.priorityLevel;var s=a(d.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?d.callback=s:d===r(c)&&o(c),w(n)}else o(c);d=r(c)}if(null!==d)var u=!0;else{var f=r(l);null!==f&&R(_,f.startTime-n),u=!1}return u}finally{d=null,p=i,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var O,E=!1,k=null,P=-1,x=5,j=-1;function T(){return!(t.unstable_now()-j<x)}function A(){if(null!==k){var e=t.unstable_now();j=e;var n=!0;try{n=k(!0,e)}finally{n?O():(E=!1,k=null)}}else E=!1}if("function"==typeof b)O=function(){b(A)};else if("undefined"!=typeof MessageChannel){var C=new MessageChannel,N=C.port2;C.port1.onmessage=A,O=function(){N.postMessage(null)}}else O=function(){g(A,0)};function D(e){k=e,E||(E=!0,O())}function R(e,n){P=g((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){y||h||(y=!0,D(S))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,o,i){var a=t.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?a+i:a,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:f++,callback:o,priorityLevel:e,startTime:i,expirationTime:s=i+s,sortIndex:-1},i>a?(e.sortIndex=i,n(l,e),null===r(c)&&e===r(l)&&(m?(v(P),P=-1):m=!0,R(_,i-a))):(e.sortIndex=s,n(c,e),y||h||(y=!0,D(S))),e},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},146:(e,t,n)=>{"use strict";e.exports=n(666)},173:(e,t,n)=>{"use strict";var r=n(735),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,a=r.useEffect,s=r.useLayoutEffect,u=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,l=r[1];return s((function(){o.value=n,o.getSnapshot=t,c(o)&&l({inst:o})}),[e,n,t]),a((function(){return c(o)&&l({inst:o}),e((function(){c(o)&&l({inst:o})}))}),[e]),u(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:l},374:(e,t,n)=>{"use strict";e.exports=n(173)}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};(()=>{"use strict";n.r(r),n.d(r,{ComponentContext:()=>t,ConfigurableLink:()=>vn,Extension:()=>En,ExtensionSlot:()=>Io,UserHasAccess:()=>wa,createUseStore:()=>wn,getAsyncExtensionLifecycle:()=>Gi,getAsyncLifecycle:()=>qi,getLifecycle:()=>Vi,getSyncLifecycle:()=>Hi,isDesktop:()=>ga,openmrsComponentDecorator:()=>Wi,useAssignedExtensionIds:()=>Qi,useAssignedExtensions:()=>To,useBodyScrollLock:()=>Yi,useConfig:()=>ta,useConnectedExtensions:()=>Ao,useConnectivity:()=>Pn,useExtensionInternalStore:()=>fa,useExtensionSlot:()=>Co,useExtensionSlotMeta:()=>da,useExtensionStore:()=>pa,useForceUpdate:()=>ha,useLayoutType:()=>ma,useLocations:()=>va,useOnClickOutside:()=>ba,usePagination:()=>Es,usePatient:()=>la,useSession:()=>Oa,useStore:()=>Pa,useStoreWithActions:()=>xa,useVisit:()=>_s,useVisitTypes:()=>Ss});var e=n(735);const t=e.createContext({moduleName:""});function o(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function i(e){return function t(n){return 0===arguments.length||o(n)?t:e.apply(this,arguments)}}function a(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return o(n)?t:i((function(t){return e(n,t)}));default:return o(n)&&o(r)?t:o(n)?i((function(t){return e(t,r)})):o(r)?i((function(t){return e(n,t)})):e(n,r)}}}function s(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function u(e,t,n){for(var r=0,o=n.length;r<o;){if(e(t,n[r]))return!0;r+=1}return!1}function c(e,t){return Object.prototype.hasOwnProperty.call(t,e)}const l="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var f=Object.prototype.toString,d=function(){return"[object Arguments]"===f.call(arguments)?function(e){return"[object Arguments]"===f.call(e)}:function(e){return c("callee",e)}}();const p=d;var h=!{toString:null}.propertyIsEnumerable("toString"),y=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=function(){return arguments.propertyIsEnumerable("length")}(),g=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1};const v="function"!=typeof Object.keys||m?i((function(e){if(Object(e)!==e)return[];var t,n,r=[],o=m&&p(e);for(t in e)!c(t,e)||o&&"length"===t||(r[r.length]=t);if(h)for(n=y.length-1;n>=0;)c(t=y[n],e)&&!g(r,t)&&(r[r.length]=t),n-=1;return r})):i((function(e){return Object(e)!==e?[]:Object.keys(e)})),b=i((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function w(e,t,n,r){var o=s(e);function i(e,t){return _(e,t,n.slice(),r.slice())}return!u((function(e,t){return!u(i,t,e)}),s(t),o)}function _(e,t,n,r){if(l(e,t))return!0;var o=b(e);if(o!==b(t))return!1;if(null==e||null==t)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(o){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]}(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!l(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!l(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var i=n.length-1;i>=0;){if(n[i]===e)return r[i]===t;i-=1}switch(o){case"Map":return e.size===t.size&&w(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&w(e.values(),t.values(),n.concat([e]),r.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var a=v(e);if(a.length!==v(t).length)return!1;var s=n.concat([e]),u=r.concat([t]);for(i=a.length-1;i>=0;){var f=a[i];if(!c(f,t)||!_(t[f],e[f],s,u))return!1;i-=1}return!0}var S=a((function(e,t){return _(e,t,[],[])}));const O=S;function E(e,t,n,r){var o,i=function(o){for(var i=t.length,a=0;a<i;){if(e===t[a])return n[a];a+=1}for(var s in t[a+1]=e,n[a+1]=o,e)o[s]=r?E(e[s],t,n,!0):e[s];return o};switch(b(e)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(e.valueOf());case"RegExp":return o=e,new RegExp(o.source,(o.global?"g":"")+(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.sticky?"y":"")+(o.unicode?"u":""));default:return e}}const k=i((function(e){return null!=e&&"function"==typeof e.clone?e.clone():E(e,[],[],!0)}));function P(e){return function t(n,r,s){switch(arguments.length){case 0:return t;case 1:return o(n)?t:a((function(t,r){return e(n,t,r)}));case 2:return o(n)&&o(r)?t:o(n)?a((function(t,n){return e(t,r,n)})):o(r)?a((function(t,r){return e(n,t,r)})):i((function(t){return e(n,r,t)}));default:return o(n)&&o(r)&&o(s)?t:o(n)&&o(r)?a((function(t,n){return e(t,n,s)})):o(n)&&o(s)?a((function(t,n){return e(t,r,n)})):o(r)&&o(s)?a((function(t,r){return e(n,t,r)})):o(n)?i((function(t){return e(t,r,s)})):o(r)?i((function(t){return e(n,t,s)})):o(s)?i((function(t){return e(n,r,t)})):e(n,r,s)}}}const x=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};var j=i((function(e){return!!x(e)||!!e&&"object"==typeof e&&!function(e){return"[object String]"===Object.prototype.toString.call(e)}(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1))}));const T=j;var A=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}(),C=a((function(e,t){return function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,o){return t.apply(this,arguments)};case 5:return function(e,n,r,o,i){return t.apply(this,arguments)};case 6:return function(e,n,r,o,i,a){return t.apply(this,arguments)};case 7:return function(e,n,r,o,i,a,s){return t.apply(this,arguments)};case 8:return function(e,n,r,o,i,a,s,u){return t.apply(this,arguments)};case 9:return function(e,n,r,o,i,a,s,u,c){return t.apply(this,arguments)};case 10:return function(e,n,r,o,i,a,s,u,c,l){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}(e.length,(function(){return e.apply(t,arguments)}))}));const N=C;function D(e,t,n){for(var r=n.next();!r.done;){if((t=e["@@transducer/step"](t,r.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r=n.next()}return e["@@transducer/result"](t)}function R(e,t,n,r){return e["@@transducer/result"](n[r](N(e["@@transducer/step"],e),t))}var I="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function M(e,t,n){if("function"==typeof e&&(e=function(e){return new A(e)}(e)),T(n))return function(e,t,n){for(var r=0,o=n.length;r<o;){if((t=e["@@transducer/step"](t,n[r]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r+=1}return e["@@transducer/result"](t)}(e,t,n);if("function"==typeof n["fantasy-land/reduce"])return R(e,t,n,"fantasy-land/reduce");if(null!=n[I])return D(e,t,n[I]());if("function"==typeof n.next)return D(e,t,n);if("function"==typeof n.reduce)return R(e,t,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}const L=P(M);function U(e){return"[object Object]"===Object.prototype.toString.call(e)}var $=P((function(e,t,n){var r,o={};for(r in t)c(r,t)&&(o[r]=c(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)c(r,n)&&!c(r,o)&&(o[r]=n[r]);return o}));const B=$;var F=P((function e(t,n,r){return B((function(n,r,o){return U(r)&&U(o)?e(t,r,o):t(n,r,o)}),n,r)}));const K=F,z=a((function(e,t){return K((function(e,t,n){return n}),e,t)}));var W,V;function q(e,t){return n=>{if(!e(n))return"function"==typeof t?t(n):t}}(V=W||(W={})).Array="Array",V.Boolean="Boolean",V.ConceptUuid="ConceptUuid",V.Number="Number",V.Object="Object",V.String="String",V.UUID="UUID",V.PersonAttributeTypeUuid="PersonAttributeTypeUuid",V.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid";const H=q((e=>Array.isArray(e)),"must be an array"),G=q((e=>"boolean"==typeof e),"must be a boolean"),Q=q((e=>"number"==typeof e),"must be a number"),Y=q((e=>"string"==typeof e),"must be a string"),J=q((e=>"object"==typeof e&&!Array.isArray(e)&&null!==e),"must be an object (not an array or null)"),X=q((e=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[0-9a-f]{36}$/i.test(e)),"must be a valid UUID or a 36-character hexadecimal string");var Z=n(403);const ee=(0,Z.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{}}),te=(0,Z.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});te.subscribe((e=>{var t;t=e.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}));const ne=(0,Z.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]});function re(e){return(0,Z.getGlobalStore)(`config-module-${e}`,{config:null,loaded:!1})}function oe(){return(0,Z.getGlobalStore)("config-extensions",{configs:{}})}function ie(e,t,n){var r;const o=null===(r=e.configs[t])||void 0===r?void 0:r[n];return null!=o?o:{loaded:!1,config:null}}const ae=(0,Z.createGlobalStore)("config-implementer-tools",{config:{}});function se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){se(e,t,n[t])}))}return e}function ce(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function le(e,t){for(let n of Object.keys(e.schemas)){const r=be(n,e,t);re(n).setState({loaded:!0,config:r})}}function fe(e,t){const n=function(e,t){const n=_e(ve(e,t)),r=Object.keys(n).reduce(((e,t)=>{var r,o;return(null===(r=n[t])||void 0===r?void 0:r.extensionSlots)&&(e[t]=null===(o=n[t])||void 0===o?void 0:o.extensionSlots),e}),{});!function(e){for(let[t,n]of Object.entries(e))for(let[e,r]of Object.entries(n))ge(r,t,e)}(r);return Object.keys(r).reduce(((e,t)=>ue({},e,r[t])),{})}(e,t),r=Object.fromEntries(Object.entries(n).map((([e,t])=>[e,{loaded:!0,config:t}]))),o=(0,Z.getGlobalStore)("config-extension-slots",{slots:{}}),i=o.getState(),a={slots:ue({},i.slots,r)};O(i,a)||o.setState(a)}function de(e,t){const n=function(e,t){let n=ye(k(e.schemas));const r=[...e.providedConfigs.map((e=>[e.config,e.source])),[t.config,"temporary config"]];for(let[e,t]of r)n=_e([n,me(e,t)]);return n}(e,t);ae.setState({config:n})}function pe(e,t,n){const r={};for(let o of t.mountedExtensions){const t=he(o.slotModuleName,o.extensionModuleName,o.slotName,o.extensionId,e,n);r[o.slotName]=ce(ue({},r[o.slotName]),{[o.extensionId]:{config:t,loaded:!0}})}oe().setState({configs:r})}function he(e,t,n,r,o,i){var a,s,u;const c=function(e){const[t]=e.split("#");return t}(r),l=o.schemas[c],f=l?c:t,d=ve(o,i),p=we(e,d);var h;const y=null!==(h=null==p||null===(a=p.extensionSlots)||void 0===a||null===(s=a[n])||void 0===s||null===(u=s.configure)||void 0===u?void 0:u[r])&&void 0!==h?h:{},m=_e([we(f,d),y]),g=null!=l?l:o.schemas[t];Se(g,m,f);const v=xe(g,m);return Ee(g,v,f),delete v.extensionSlots,v}function ye(e){return e.hasOwnProperty("_default")?ce(ue({},e),{_value:e._default,_source:"default"}):Te(e)?Object.keys(e).reduce(((t,n)=>(t[n]=ye(e[n]),t)),{}):{}}function me(e,t){return Te(e)?Object.keys(e).reduce(((n,r)=>(n[r]=me(e[r],t),n)),{}):{_value:e,_source:t}}function ge(e,t,n){const r=`Extension slot config '${t}.extensionSlots.${n}`,o=Object.keys(e).filter((e=>!["add","remove","order","configure"].includes(e)));o.length&&console.error(r+`' contains invalid keys '${o.join("', '")}'`),e.add&&(Array.isArray(e.add)&&e.add.every((e=>"string"==typeof e))||console.error(r+".add' is invalid. Must be an array of strings (extension IDs)")),e.remove&&(Array.isArray(e.remove)&&e.remove.every((e=>"string"==typeof e))||console.error(r+".remove' is invalid. Must be an array of strings (extension IDs)")),e.order&&(Array.isArray(e.order)&&e.order.every((e=>"string"==typeof e))||console.error(r+".order' is invalid. Must be an array of strings (extension IDs)")),e.configure&&(Te(e.configure)||console.error(r+".configure' is invalid. Must be an object with extension IDs for keys"))}function ve(e,t){return[...e.providedConfigs.map((e=>e.config)),t.config]}function be(e,t,n){if(!t.schemas.hasOwnProperty(e))throw Error("No config schema has been defined for "+e);const r=t.schemas[e],o=we(e,ve(t,n));Se(r,o,e);const i=xe(r,o);return Ee(r,i,e),delete i.extensionSlots,i}function we(e,t){const n=t.map((({[e]:t})=>t)).filter((e=>!!e));return _e(n)}function _e(e){return L(z)({},e)}function Se(e,t,n=""){for(const r of Object.keys(t)){const o=t[r],i=n+"."+r,a=e[r];e.hasOwnProperty(r)?Oe(a,o,i):"extensionSlots"===r&&""!==n||console.error(`Unknown config key '${i}' provided. Ignoring.`)}}function Oe(e,t,n){ke(n,e._type,t),Te(t)?e._type===W.Object?function(e,t,n){if(e._elements)for(const r of Object.keys(t)){const o=t[r];Se(e._elements,o,`${n}.${r}`)}}(e,t,n):e.hasOwnProperty("_default")||Se(e,t,n):e._type===W.Array&&function(e,t,n){if(je(e._elements))for(let r=0;r<t.length;r++)Oe(e._elements,t[r],`${n}[${r}]`);for(let o=0;o<t.length;o++){var r;ke(`${n}[${o}]`,null===(r=e._elements)||void 0===r?void 0:r._type,t[o])}}(e,t,n)}function Ee(e,t,n=""){if(e)if(t!==e._default&&Pe(n,e._validators,t),Te(t))for(const r of Object.keys(t)){const o=t[r],i=n+"."+r,a=e[r];e._type===W.Object&&e._elements?Ee(e._elements,o,i):Ee(a,o,i)}else if(Array.isArray(t)&&e._elements)for(let r=0;r<t.length;r++)Ee(e._elements,t[r],`${n}[${r}]`)}function ke(e,t,n){t&&Pe(e,[{Array:H,Boolean:G,ConceptUuid:X,Number:Q,Object:J,String:Y,UUID:X,PersonAttributeTypeUuid:X,PatientIdentifierTypeUuid:X}[t]],n)}function Pe(e,t,n){if(t)try{for(let r of t){const t=r(n);"string"==typeof t&&("object"==typeof n?console.error(`Invalid configuration for ${e}: ${t}`):console.error(`Invalid configuration value ${n} for ${e}: ${t}`))}}catch(t){console.error(`Skipping invalid validator at "${e}". Encountered error\n\t${t}`)}}le(ee.getState(),te.getState()),ee.subscribe((e=>le(e,te.getState()))),te.subscribe((e=>le(ee.getState(),e))),de(ee.getState(),te.getState()),ee.subscribe((e=>de(e,te.getState()))),te.subscribe((e=>de(ee.getState(),e))),fe(ee.getState(),te.getState()),ee.subscribe((e=>fe(e,te.getState()))),te.subscribe((e=>fe(ee.getState(),e))),pe(ee.getState(),ne.getState(),te.getState()),ee.subscribe((e=>{pe(e,ne.getState(),te.getState())})),ne.subscribe((e=>{pe(ee.getState(),e,te.getState())})),te.subscribe((e=>{pe(ee.getState(),ne.getState(),e)}));const xe=(e,t)=>{const n=k(t);if(!e)return n;for(const t of Object.keys(e)){const r=n[t],o=e[t];if(o&&o.hasOwnProperty("_default")){n.hasOwnProperty(t)||(n[t]=o._default);const e=o._elements;if(r&&je(e))if(o._type===W.Array&&Array.isArray(r)){const o=r.map((t=>xe(e,t)));n[t]=o}else if(o._type===W.Object)for(let t of Object.keys(r))r[t]=xe(e,r[t])}else if(Te(o)){const e=n.hasOwnProperty(t)?r:{};Te(e)&&(n[t]=xe(o,e))}}return n};function je(e){return!!e&&Object.keys(e).filter((e=>!["_default","_validators"].includes(e))).length>0}function Te(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}W.Array,W.Object;var Ae=Object.freeze({__proto__:null,get start(){return dn},get ensureJQuerySupport(){return $t},get setBootstrapMaxTime(){return wt},get setMountMaxTime(){return _t},get setUnmountMaxTime(){return St},get setUnloadMaxTime(){return Ot},get registerApplication(){return Jt},get unregisterApplication(){return Zt},get getMountedApps(){return Gt},get getAppStatus(){return Yt},get unloadApplication(){return en},get checkActivityFunctions(){return Xt},get getAppNames(){return Qt},get pathToActiveWhen(){return rn},get navigateToUrl(){return Ct},get triggerAppChange(){return un},get addErrorHandler(){return Le},get removeErrorHandler(){return Ue},get mountRootParcel(){return yt},get NOT_LOADED(){return Fe},get LOADING_SOURCE_CODE(){return Ke},get NOT_BOOTSTRAPPED(){return ze},get BOOTSTRAPPING(){return We},get NOT_MOUNTED(){return Ve},get MOUNTING(){return qe},get UPDATING(){return Ge},get LOAD_ERROR(){return Ye},get MOUNTED(){return He},get UNMOUNTING(){return Qe},get SKIP_BECAUSE_BROKEN(){return Je}});function Ce(e){return(Ce="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)}function Ne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var De=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).CustomEvent,Re=function(){try{var e=new De("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?De:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},Ie=[];function Me(e,t,n){var r=Be(e,t,n);Ie.length?Ie.forEach((function(e){return e(r)})):setTimeout((function(){throw r}))}function Le(e){if("function"!=typeof e)throw Error($e(28,!1));Ie.push(e)}function Ue(e){if("function"!=typeof e)throw Error($e(29,!1));var t=!1;return Ie=Ie.filter((function(n){var r=n===e;return t=t||r,!r})),t}function $e(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(e,": ").concat(t?t+" ":"","See https://single-spa.js.org/error/?code=").concat(e).concat(r.length?"&arg=".concat(r.join("&arg=")):"")}function Be(e,t,n){var r,o="".concat(nt(t)," '").concat(et(t),"' died in status ").concat(t.status,": ");if(e instanceof Error){try{e.message=o+e.message}catch(e){}r=e}else{console.warn($e(30,!1,t.status,et(t)));try{r=Error(o+JSON.stringify(e))}catch(t){r=e}}return r.appOrParcelName=et(t),t.status=n,r}var Fe="NOT_LOADED",Ke="LOADING_SOURCE_CODE",ze="NOT_BOOTSTRAPPED",We="BOOTSTRAPPING",Ve="NOT_MOUNTED",qe="MOUNTING",He="MOUNTED",Ge="UPDATING",Qe="UNMOUNTING",Ye="LOAD_ERROR",Je="SKIP_BECAUSE_BROKEN";function Xe(e){return e.status===He}function Ze(e){try{return e.activeWhen(window.location)}catch(t){return Me(t,e,Je),!1}}function et(e){return e.name}function tt(e){return Boolean(e.unmountThisParcel)}function nt(e){return tt(e)?"parcel":"application"}function rt(){for(var e=arguments.length-1;e>0;e--)for(var t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]}function ot(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}function it(e){return e&&("function"==typeof e||(t=e,Array.isArray(t)&&!ot(t,(function(e){return"function"!=typeof e}))));var t}function at(e,t){var n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=nt(e),o=et(e);return function(e){return n.reduce((function(n,i,a){return n.then((function(){var n=i(e);return st(n)?n:Promise.reject($e(15,!1,r,o,t,a))}))}),Promise.resolve())}}function st(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}function ut(e,t){return Promise.resolve().then((function(){return e.status!==ze?e:(e.status=We,e.bootstrap?Et(e,"bootstrap").then(n).catch((function(n){if(t)throw Be(n,e,Je);return Me(n,e,Je),e})):Promise.resolve().then(n))}));function n(){return e.status=Ve,e}}function ct(e,t){return Promise.resolve().then((function(){if(e.status!==He)return e;e.status=Qe;var n=Object.keys(e.parcels).map((function(t){return e.parcels[t].unmountThisParcel()}));return Promise.all(n).then(r,(function(n){return r().then((function(){var r=Error(n.message);if(t)throw Be(r,e,Je);Me(r,e,Je)}))})).then((function(){return e}));function r(){return Et(e,"unmount").then((function(){e.status=Ve})).catch((function(n){if(t)throw Be(n,e,Je);Me(n,e,Je)}))}}))}var lt=!1,ft=!1;function dt(e,t){return Promise.resolve().then((function(){return e.status!==Ve?e:(lt||(window.dispatchEvent(new Re("single-spa:before-first-mount")),lt=!0),Et(e,"mount").then((function(){return e.status=He,ft||(window.dispatchEvent(new Re("single-spa:first-mount")),ft=!0),e})).catch((function(n){return e.status=He,ct(e,!0).then(r,r);function r(){if(t)throw Be(n,e,Je);return Me(n,e,Je),e}})))}))}var pt=0,ht={parcels:{}};function yt(){return mt.apply(ht,arguments)}function mt(e,t){var n=this;if(!e||"object"!==Ce(e)&&"function"!=typeof e)throw Error($e(2,!1));if(e.name&&"string"!=typeof e.name)throw Error($e(3,!1,Ce(e.name)));if("object"!==Ce(t))throw Error($e(4,!1,name,Ce(t)));if(!t.domElement)throw Error($e(5,!1,name));var r,o=pt++,i="function"==typeof e,a=i?e:function(){return Promise.resolve(e)},s={id:o,parcels:{},status:i?Ke:ze,customProps:t,parentName:et(n),unmountThisParcel:function(){return d.then((function(){if(s.status!==He)throw Error($e(6,!1,name,s.status));return ct(s,!0)})).then((function(e){return s.parentName&&delete n.parcels[s.id],e})).then((function(e){return c(e),e})).catch((function(e){throw s.status=Je,l(e),e}))}};n.parcels[o]=s;var u=a();if(!u||"function"!=typeof u.then)throw Error($e(7,!1));var c,l,f=(u=u.then((function(e){if(!e)throw Error($e(8,!1));var t=e.name||"parcel-".concat(o);if(Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!it(e.bootstrap))throw Error($e(9,!1,t));if(!it(e.mount))throw Error($e(10,!1,t));if(!it(e.unmount))throw Error($e(11,!1,t));if(e.update&&!it(e.update))throw Error($e(12,!1,t));var n=at(e,"bootstrap"),i=at(e,"mount"),a=at(e,"unmount");s.status=ze,s.name=t,s.bootstrap=n,s.mount=i,s.unmount=a,s.timeouts=kt(e.timeouts),e.update&&(s.update=at(e,"update"),r.update=function(e){return s.customProps=e,gt(function(e){return Promise.resolve().then((function(){if(e.status!==He)throw Error($e(32,!1,et(e)));return e.status=Ge,Et(e,"update").then((function(){return e.status=He,e})).catch((function(t){throw Be(t,e,Je)}))}))}(s))})}))).then((function(){return ut(s,!0)})),d=f.then((function(){return dt(s,!0)})),p=new Promise((function(e,t){c=e,l=t}));return r={mount:function(){return gt(Promise.resolve().then((function(){if(s.status!==Ve)throw Error($e(13,!1,name,s.status));return n.parcels[o]=s,dt(s)})))},unmount:function(){return gt(s.unmountThisParcel())},getStatus:function(){return s.status},loadPromise:gt(u),bootstrapPromise:gt(f),mountPromise:gt(d),unmountPromise:gt(p)}}function gt(e){return e.then((function(){return null}))}function vt(e){var t=et(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!==Ce(n)||null===n||Array.isArray(n))&&(n={},console.warn($e(40,!1),t,n));var r=rt({},n,{name:t,mountParcel:mt.bind(e),singleSpa:Ae});return tt(e)&&(r.unmountSelf=e.unmountThisParcel),r}var bt={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function wt(e,t,n){if("number"!=typeof e||e<=0)throw Error($e(16,!1));bt.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function _t(e,t,n){if("number"!=typeof e||e<=0)throw Error($e(17,!1));bt.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function St(e,t,n){if("number"!=typeof e||e<=0)throw Error($e(18,!1));bt.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function Ot(e,t,n){if("number"!=typeof e||e<=0)throw Error($e(19,!1));bt.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function Et(e,t){var n=e.timeouts[t],r=n.warningMillis,o=nt(e);return new Promise((function(i,a){var s=!1,u=!1;e[t](vt(e)).then((function(e){s=!0,i(e)})).catch((function(e){s=!0,a(e)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=$e(31,!1,t,o,et(e),n.millis);function l(e){if(!s)if(!0===e)u=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!u){var t=e,o=t*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(t+1)}),r)}}}))}function kt(e){var t={};for(var n in bt)t[n]=rt({},bt[n],e&&e[n]||{});return t}function Pt(e){return Promise.resolve().then((function(){return e.loadPromise?e.loadPromise:e.status!==Fe&&e.status!==Ye?e:(e.status=Ke,e.loadPromise=Promise.resolve().then((function(){var r=e.loadApp(vt(e));if(!st(r))throw n=!0,Error($e(33,!1,et(e)));return r.then((function(n){var r;e.loadErrorTime=null,"object"!==Ce(t=n)&&(r=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!it(t.bootstrap)&&(r=35),it(t.mount)||(r=36),it(t.unmount)||(r=37);var o=nt(t);if(r){var i;try{i=JSON.stringify(t)}catch(e){}return console.error($e(r,!1,o,et(e),i),t),Me(void 0,e,Je),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=rt({},e.devtools.overlays,t.devtools.overlays)),e.status=ze,e.bootstrap=at(t,"bootstrap"),e.mount=at(t,"mount"),e.unmount=at(t,"unmount"),e.unload=at(t,"unload"),e.timeouts=kt(t.timeouts),delete e.loadPromise,e}))})).catch((function(t){var r;return delete e.loadPromise,n?r=Je:(r=Ye,e.loadErrorTime=(new Date).getTime()),Me(t,e,r),e})));var t,n}))}var xt,jt="undefined"!=typeof window,Tt={hashchange:[],popstate:[]},At=["hashchange","popstate"];function Ct(e){var t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error($e(14,!1));t=e.currentTarget.href,e.preventDefault()}var n=Lt(window.location.href),r=Lt(t);0===t.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)}function Nt(e){var t=this;if(e){var n=e[0].type;At.indexOf(n)>=0&&Tt[n].forEach((function(n){try{n.apply(t,e)}catch(e){setTimeout((function(){throw e}))}}))}}function Dt(){cn([],arguments)}function Rt(e,t){return function(){var n=window.location.href,r=e.apply(this,arguments),o=window.location.href;return xt&&n===o||(pn()?window.dispatchEvent(function(e,t){var n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)):cn([])),r}}if(jt){window.addEventListener("hashchange",Dt),window.addEventListener("popstate",Dt);var It=window.addEventListener,Mt=window.removeEventListener;window.addEventListener=function(e,t){if(!("function"==typeof t&&At.indexOf(e)>=0)||ot(Tt[e],(function(e){return e===t})))return It.apply(this,arguments);Tt[e].push(t)},window.removeEventListener=function(e,t){if(!("function"==typeof t&&At.indexOf(e)>=0))return Mt.apply(this,arguments);Tt[e]=Tt[e].filter((function(e){return e!==t}))},window.history.pushState=Rt(window.history.pushState,"pushState"),window.history.replaceState=Rt(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn($e(41,!1)):window.singleSpaNavigate=Ct}function Lt(e){var t=document.createElement("a");return t.href=e,t}var Ut=!1;function $t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!Ut){var t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return Bt.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return Bt.call(this,n,window.removeEventListener,e,t,arguments)},Ut=!0}}function Bt(e,t,n,r,o){return"string"!=typeof n?e.apply(this,o):(n.split(/\s+/).forEach((function(e){At.indexOf(e)>=0&&(t(e,r),n=n.replace(e,""))})),""===n.trim()?this:e.apply(this,o))}var Ft={};function Kt(e){return Promise.resolve().then((function(){var t=Ft[et(e)];if(!t)return e;if(e.status===Fe)return zt(e,t),e;if("UNLOADING"===e.status)return t.promise.then((function(){return e}));if(e.status!==Ve&&e.status!==Ye)return e;var n=e.status===Ye?Promise.resolve():Et(e,"unload");return e.status="UNLOADING",n.then((function(){return zt(e,t),e})).catch((function(n){return function(e,t,n){delete Ft[et(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,Me(n,e,Je),t.reject(n)}(e,t,n),e}))}))}function zt(e,t){delete Ft[et(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=Fe,t.resolve()}function Wt(e,t,n,r){Ft[et(e)]={app:e,resolve:n,reject:r},Object.defineProperty(Ft[et(e)],"promise",{get:t})}function Vt(e){return Ft[e]}var qt=[];function Ht(){var e=[],t=[],n=[],r=[],o=(new Date).getTime();return qt.forEach((function(i){var a=i.status!==Je&&Ze(i);switch(i.status){case Ye:a&&o-i.loadErrorTime>=200&&n.push(i);break;case Fe:case Ke:a&&n.push(i);break;case ze:case Ve:!a&&Vt(et(i))?e.push(i):a&&r.push(i);break;case He:a||t.push(i)}})),{appsToUnload:e,appsToUnmount:t,appsToLoad:n,appsToMount:r}}function Gt(){return qt.filter(Xe).map(et)}function Qt(){return qt.map(et)}function Yt(e){var t=ot(qt,(function(t){return et(t)===e}));return t?t.status:null}function Jt(e,t,n,r){var o=function(e,t,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===Ce(e)?(function(e){if(Array.isArray(e)||null===e)throw Error($e(39,!1));var t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((function(e,n){return t.indexOf(n)>=0?e:e.concat(n)}),[]);if(0!==n.length)throw Error($e(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length)throw Error($e(20,!1));if("object"!==Ce(e.app)&&"function"!=typeof e.app)throw Error($e(20,!1));var r=function(e){return"string"==typeof e||"function"==typeof e};if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error($e(24,!1));if(!nn(e.customProps))throw Error($e(22,!1))}(e),i.name=e.name,i.loadApp=e.app,i.activeWhen=e.activeWhen,i.customProps=e.customProps):(function(e,t,n,r){if("string"!=typeof e||0===e.length)throw Error($e(20,!1));if(!t)throw Error($e(23,!1));if("function"!=typeof n)throw Error($e(24,!1));if(!nn(r))throw Error($e(22,!1))}(e,t,n,r),i.name=e,i.loadApp=t,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(e){return e||{}}(i.customProps),i.activeWhen=function(e){var t=Array.isArray(e)?e:[e];return t=t.map((function(e){return"function"==typeof e?e:rn(e)})),function(e){return t.some((function(t){return t(e)}))}}(i.activeWhen),i}(e,t,n,r);if(-1!==Qt().indexOf(o.name))throw Error($e(21,!1,o.name));qt.push(rt({loadErrorTime:null,status:Fe,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),jt&&($t(),cn())}function Xt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return qt.filter((function(t){return t.activeWhen(e)})).map(et)}function Zt(e){if(0===qt.filter((function(t){return et(t)===e})).length)throw Error($e(25,!1,e));return en(e).then((function(){var t=qt.map(et).indexOf(e);qt.splice(t,1)}))}function en(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof e)throw Error($e(26,!1));var n=ot(qt,(function(t){return et(t)===e}));if(!n)throw Error($e(27,!1,e));var r,o=Vt(et(n));if(t&&t.waitForUnmount){if(o)return o.promise;var i=new Promise((function(e,t){Wt(n,(function(){return i}),e,t)}));return i}return o?(r=o.promise,tn(n,o.resolve,o.reject)):r=new Promise((function(e,t){Wt(n,(function(){return r}),e,t),tn(n,e,t)})),r}function tn(e,t,n){ct(e).then(Kt).then((function(){t(),setTimeout((function(){cn()}))})).catch(n)}function nn(e){return!e||"function"==typeof e||"object"===Ce(e)&&null!==e&&!Array.isArray(e)}function rn(e,t){var n=function(e,t){var n=0,r=!1,o="^";"/"!==e[0]&&(e="/"+e);for(var i=0;i<e.length;i++){var a=e[i];(!r&&":"===a||r&&"/"===a)&&s(i)}return s(e.length),new RegExp(o,"i");function s(i){var a=e.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===e.length)if(r)t&&(o+="$");else{var s=t?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(s,"$"):"".concat(o,"(/").concat(s,")?(#.*)?$")}r=!r,n=i}}(e,t);return function(e){var t=e.origin;t||(t="".concat(e.protocol,"//").concat(e.host));var r=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(r)}}var on=!1,an=[],sn=jt&&window.location.href;function un(){return cn()}function cn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if(on)return new Promise((function(e,n){an.push({resolve:e,reject:n,eventArguments:t})}));var n,r=Ht(),o=r.appsToUnload,i=r.appsToUnmount,a=r.appsToLoad,s=r.appsToMount,u=!1,c=sn,l=sn=window.location.href;return pn()?(on=!0,n=o.concat(a,i,s),Promise.resolve().then((function(){if(window.dispatchEvent(new Re(0===n.length?"single-spa:before-no-app-change":"single-spa:before-app-change",h(!0))),window.dispatchEvent(new Re("single-spa:before-routing-event",h(!0,{cancelNavigation:f}))),u)return window.dispatchEvent(new Re("single-spa:before-mount-routing-event",h(!0))),d(),void Ct(c);var t=o.map(Kt),r=i.map(ct).map((function(e){return e.then(Kt)})).concat(t),l=Promise.all(r);l.then((function(){window.dispatchEvent(new Re("single-spa:before-mount-routing-event",h(!0)))}));var y=a.map((function(e){return Pt(e).then((function(e){return ln(e,l)}))})),m=s.filter((function(e){return a.indexOf(e)<0})).map((function(e){return ln(e,l)}));return l.catch((function(e){throw p(),e})).then((function(){return p(),Promise.all(y.concat(m)).catch((function(t){throw e.forEach((function(e){return e.reject(t)})),t})).then(d)}))}))):(n=a,Promise.resolve().then((function(){var e=a.map(Pt);return Promise.all(e).then(p).then((function(){return[]})).catch((function(e){throw p(),e}))})));function f(){u=!0}function d(){var t=Gt();e.forEach((function(e){return e.resolve(t)}));try{var r=0===n.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new Re(r,h())),window.dispatchEvent(new Re("single-spa:routing-event",h()))}catch(e){setTimeout((function(){throw e}))}if(on=!1,an.length>0){var o=an;an=[],cn(o)}return t}function p(){e.forEach((function(e){Nt(e.eventArguments)})),Nt(t)}function h(){var e,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],f=arguments.length>1?arguments[1]:void 0,d={},p=(Ne(e={},He,[]),Ne(e,Ve,[]),Ne(e,Fe,[]),Ne(e,Je,[]),e);r?(a.concat(s).forEach((function(e,t){y(e,He)})),o.forEach((function(e){y(e,Fe)})),i.forEach((function(e){y(e,Ve)}))):n.forEach((function(e){y(e)}));var h={detail:{newAppStatuses:d,appsByNewStatus:p,totalAppChanges:n.length,originalEvent:null==t?void 0:t[0],oldUrl:c,newUrl:l,navigationIsCanceled:u}};return f&&rt(h.detail,f),h;function y(e,t){var n=et(e);t=t||Yt(n),d[n]=t,(p[t]=p[t]||[]).push(n)}}}function ln(e,t){return Ze(e)?ut(e).then((function(e){return t.then((function(){return Ze(e)?dt(e):e}))})):t.then((function(){return e}))}var fn=!1;function dn(e){var t;fn=!0,e&&e.urlRerouteOnly&&(t=e.urlRerouteOnly,xt=t),jt&&cn()}function pn(){return fn}jt&&setTimeout((function(){fn||console.warn($e(1,!1))}),5e3);var hn={getRawAppData:function(){return[].concat(qt)},reroute:cn,NOT_LOADED:Fe,toLoadPromise:Pt,toBootstrapPromise:ut,unregisterApplication:Zt};function yn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mn(e,t){const n=window.getOpenmrsSpaBase().replace(/\/$/,"");return function(e,t){return Object.keys(t).reduce(((e,n)=>e.split("${"+n+"}").join(t[n])),e)}(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){yn(e,t,n[t])}))}return e}({openmrsBase:window.openmrsBase,openmrsSpaBase:n},t)).replace(/^\/\//,"/")}jt&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=hn);function gn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vn(t){var{to:n,templateParams:r,children:o}=t,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["to","templateParams","children"]);return e.createElement("a",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){gn(e,t,n[t])}))}return e}({onClick:e=>function(e,t,n){e.metaKey||e.ctrlKey||e.shiftKey||0!=e.button||(e.preventDefault(),function({to:e,templateParams:t}){const n=window.getOpenmrsSpaBase().replace(/\/$/,""),r=mn(e,t);r.startsWith(n)?Ct(r):window.location.assign(r)}({to:t,templateParams:n}))}(e,n,r),href:mn(n,r)},i),o)}function bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wn(t){return function(n){const[r,o]=(0,e.useState)(t.getState());(0,e.useEffect)((()=>t.subscribe((e=>o(e)))),[]);let i=(0,e.useMemo)((()=>n?function(e,t){"function"==typeof t&&(t=t(e));const n={};for(let r in t)n[r]=()=>{const n=arguments;e.setState((e=>{let o=[e];for(let e=0;e<n.length;e++)o.push(n[e]);return t[r](o)}))};return n}(t,n):{}),[n]);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){bn(e,t,n[t])}))}return e}({},r,i)}}(e=>{const t=e.concat(["openmrsBase","openmrsSpaBase"]);q((e=>{if(!e||"string"!=typeof e)return!1;const n=/\${(.*?)}/g;let r=n.exec(e);for(;r;){if(!t.includes(r[1]))return!1;r=n.exec(e)}return!0}),"Should be a URL or path. The allowed template parameters are "+t.map((e=>"${"+e+"}")).join(", "))})([]);var _n=n(196);function Sn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function On(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Sn(e,t,n[t])}))}return e}const En=n=>{var{state:r,children:o,wrap:i}=n,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,["state","children","wrap"]);const[s,u]=(0,e.useState)(),{extension:c}=(0,e.useContext)(t),l=(0,e.useRef)(null),f=(0,e.useRef)(null);(0,e.useEffect)((()=>{i&&console.warn(`'wrap' prop of Extension is being used ${(null==c?void 0:c.extensionId)?`by ${c.extensionId} in ${c.extensionSlotName}`:""}. This will be removed in a future release.`)}),[]);const d=(0,e.useCallback)((e=>{u(e)}),[u]);(0,e.useEffect)((()=>{if(null!=s&&c&&!l.current)return(0,_n.renderExtension)(s,c.extensionSlotName,c.extensionSlotModuleName,c.extensionId,void 0,r).then((e=>{l.current=e})),()=>{if(l&&l.current)switch(l.current.getStatus()){case"MOUNTING":l.current.mountPromise.then(l.current.unmount);break;case"MOUNTED":l.current.unmount();break;case"UPDATING":f.current&&f.current.then((()=>{l.current&&"MOUNTED"===l.current.getStatus()&&l.current.unmount()}))}}}),[null==c?void 0:c.extensionSlotName,null==c?void 0:c.extensionId,null==c?void 0:c.extensionSlotModuleName,s]),(0,e.useEffect)((()=>(l.current&&l.current.update&&("MOUNTED"===l.current.getStatus()?l.current.update(On({},r)):"MOUNTING"===l.current.getStatus()&&l.current.mountPromise.then((()=>{l.current&&l.current.update&&(f.current=l.current.update(On({},r)))}))),()=>{f.current=null})),[r]);const p=e.createElement("div",On({ref:d,"data-extension-id":null==c?void 0:c.extensionId,style:{position:"relative"}},a));return"function"!=typeof o||e.isValidElement(o)?c&&i?i(p,c):p:e.createElement(e.Fragment,null,o(p,c))};var kn=n(758);function Pn(){let[t,n]=(0,e.useState)(window.navigator.onLine);return(0,e.useEffect)((()=>(0,kn.subscribeConnectivityChanged)((({online:e})=>n(e)))),[]),t}const xn=function(e,t){return e===t||e!=e&&t!=t},jn=function(e,t){for(var n=e.length;n--;)if(xn(e[n][0],t))return n;return-1};var Tn=Array.prototype.splice;function An(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}An.prototype.clear=function(){this.__data__=[],this.size=0},An.prototype.delete=function(e){var t=this.__data__,n=jn(t,e);return!(n<0||(n==t.length-1?t.pop():Tn.call(t,n,1),--this.size,0))},An.prototype.get=function(e){var t=this.__data__,n=jn(t,e);return n<0?void 0:t[n][1]},An.prototype.has=function(e){return jn(this.__data__,e)>-1},An.prototype.set=function(e,t){var n=this.__data__,r=jn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const Cn=An,Nn="object"==typeof global&&global&&global.Object===Object&&global;var Dn="object"==typeof self&&self&&self.Object===Object&&self;const Rn=Nn||Dn||Function("return this")(),In=Rn.Symbol;var Mn=Object.prototype,Ln=Mn.hasOwnProperty,Un=Mn.toString,$n=In?In.toStringTag:void 0;var Bn=Object.prototype.toString;var Fn=In?In.toStringTag:void 0;const Kn=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Fn&&Fn in Object(e)?function(e){var t=Ln.call(e,$n),n=e[$n];try{e[$n]=void 0;var r=!0}catch(e){}var o=Un.call(e);return r&&(t?e[$n]=n:delete e[$n]),o}(e):function(e){return Bn.call(e)}(e)},zn=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Wn=function(e){if(!zn(e))return!1;var t=Kn(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Vn=Rn["__core-js_shared__"];var qn,Hn=(qn=/[^.]+$/.exec(Vn&&Vn.keys&&Vn.keys.IE_PROTO||""))?"Symbol(src)_1."+qn:"";var Gn=Function.prototype.toString;const Qn=function(e){if(null!=e){try{return Gn.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var Yn=/^\[object .+?Constructor\]$/,Jn=Function.prototype,Xn=Object.prototype,Zn=Jn.toString,er=Xn.hasOwnProperty,tr=RegExp("^"+Zn.call(er).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const nr=function(e){return!(!zn(e)||(t=e,Hn&&Hn in t))&&(Wn(e)?tr:Yn).test(Qn(e));var t},rr=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return nr(n)?n:void 0},or=rr(Rn,"Map"),ir=rr(Object,"create");var ar=Object.prototype.hasOwnProperty;var sr=Object.prototype.hasOwnProperty;function ur(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ur.prototype.clear=function(){this.__data__=ir?ir(null):{},this.size=0},ur.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ur.prototype.get=function(e){var t=this.__data__;if(ir){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ar.call(t,e)?t[e]:void 0},ur.prototype.has=function(e){var t=this.__data__;return ir?void 0!==t[e]:sr.call(t,e)},ur.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ir&&void 0===t?"__lodash_hash_undefined__":t,this};const cr=ur,lr=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function fr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}fr.prototype.clear=function(){this.size=0,this.__data__={hash:new cr,map:new(or||Cn),string:new cr}},fr.prototype.delete=function(e){var t=lr(this,e).delete(e);return this.size-=t?1:0,t},fr.prototype.get=function(e){return lr(this,e).get(e)},fr.prototype.has=function(e){return lr(this,e).has(e)},fr.prototype.set=function(e,t){var n=lr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};const dr=fr;function pr(e){var t=this.__data__=new Cn(e);this.size=t.size}pr.prototype.clear=function(){this.__data__=new Cn,this.size=0},pr.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},pr.prototype.get=function(e){return this.__data__.get(e)},pr.prototype.has=function(e){return this.__data__.has(e)},pr.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Cn){var r=n.__data__;if(!or||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new dr(r)}return n.set(e,t),this.size=n.size,this};const hr=pr;function yr(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new dr;++t<n;)this.add(e[t])}yr.prototype.add=yr.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},yr.prototype.has=function(e){return this.__data__.has(e)};const mr=yr,gr=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},vr=function(e,t){return e.has(t)},br=function(e,t,n,r,o,i){var a=1&n,s=e.length,u=t.length;if(s!=u&&!(a&&u>s))return!1;var c=i.get(e),l=i.get(t);if(c&&l)return c==t&&l==e;var f=-1,d=!0,p=2&n?new mr:void 0;for(i.set(e,t),i.set(t,e);++f<s;){var h=e[f],y=t[f];if(r)var m=a?r(y,h,f,t,e,i):r(h,y,f,e,t,i);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!gr(t,(function(e,t){if(!vr(p,t)&&(h===e||o(h,e,n,r,i)))return p.push(t)}))){d=!1;break}}else if(h!==y&&!o(h,y,n,r,i)){d=!1;break}}return i.delete(e),i.delete(t),d},wr=Rn.Uint8Array,_r=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},Sr=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var Or=In?In.prototype:void 0,Er=Or?Or.valueOf:void 0;const kr=Array.isArray;var Pr=Object.prototype.propertyIsEnumerable,xr=Object.getOwnPropertySymbols;const jr=xr?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}(xr(e),(function(t){return Pr.call(e,t)})))}:function(){return[]},Tr=function(e){return null!=e&&"object"==typeof e},Ar=function(e){return Tr(e)&&"[object Arguments]"==Kn(e)};var Cr=Object.prototype,Nr=Cr.hasOwnProperty,Dr=Cr.propertyIsEnumerable;const Rr=Ar(function(){return arguments}())?Ar:function(e){return Tr(e)&&Nr.call(e,"callee")&&!Dr.call(e,"callee")};var Ir="object"==typeof exports&&exports&&!exports.nodeType&&exports,Mr=Ir&&"object"==typeof module&&module&&!module.nodeType&&module,Lr=Mr&&Mr.exports===Ir?Rn.Buffer:void 0;const Ur=(Lr?Lr.isBuffer:void 0)||function(){return!1};var $r=/^(?:0|[1-9]\d*)$/;const Br=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&$r.test(e))&&e>-1&&e%1==0&&e<t},Fr=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var Kr={};Kr["[object Float32Array]"]=Kr["[object Float64Array]"]=Kr["[object Int8Array]"]=Kr["[object Int16Array]"]=Kr["[object Int32Array]"]=Kr["[object Uint8Array]"]=Kr["[object Uint8ClampedArray]"]=Kr["[object Uint16Array]"]=Kr["[object Uint32Array]"]=!0,Kr["[object Arguments]"]=Kr["[object Array]"]=Kr["[object ArrayBuffer]"]=Kr["[object Boolean]"]=Kr["[object DataView]"]=Kr["[object Date]"]=Kr["[object Error]"]=Kr["[object Function]"]=Kr["[object Map]"]=Kr["[object Number]"]=Kr["[object Object]"]=Kr["[object RegExp]"]=Kr["[object Set]"]=Kr["[object String]"]=Kr["[object WeakMap]"]=!1;var zr="object"==typeof exports&&exports&&!exports.nodeType&&exports,Wr=zr&&"object"==typeof module&&module&&!module.nodeType&&module,Vr=Wr&&Wr.exports===zr&&Nn.process,qr=function(){try{return Wr&&Wr.require&&Wr.require("util").types||Vr&&Vr.binding&&Vr.binding("util")}catch(e){}}(),Hr=qr&&qr.isTypedArray;const Gr=Hr?(Qr=Hr,function(e){return Qr(e)}):function(e){return Tr(e)&&Fr(e.length)&&!!Kr[Kn(e)]};var Qr,Yr=Object.prototype.hasOwnProperty;const Jr=function(e,t){var n=kr(e),r=!n&&Rr(e),o=!n&&!r&&Ur(e),i=!n&&!r&&!o&&Gr(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],u=s.length;for(var c in e)!t&&!Yr.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Br(c,u))||s.push(c);return s};var Xr=Object.prototype;const Zr=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object);var eo=Object.prototype.hasOwnProperty;const to=function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||Xr))return Zr(e);var t,n,r=[];for(var o in Object(e))eo.call(e,o)&&"constructor"!=o&&r.push(o);return r},no=function(e){return null!=(t=e)&&Fr(t.length)&&!Wn(t)?Jr(e):to(e);var t},ro=function(e){return function(e,t,n){var r=t(e);return kr(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,no,jr)};var oo=Object.prototype.hasOwnProperty;const io=rr(Rn,"DataView"),ao=rr(Rn,"Promise"),so=rr(Rn,"Set"),uo=rr(Rn,"WeakMap");var co="[object Map]",lo="[object Promise]",fo="[object Set]",po="[object WeakMap]",ho="[object DataView]",yo=Qn(io),mo=Qn(or),go=Qn(ao),vo=Qn(so),bo=Qn(uo),wo=Kn;(io&&wo(new io(new ArrayBuffer(1)))!=ho||or&&wo(new or)!=co||ao&&wo(ao.resolve())!=lo||so&&wo(new so)!=fo||uo&&wo(new uo)!=po)&&(wo=function(e){var t=Kn(e),n="[object Object]"==t?e.constructor:void 0,r=n?Qn(n):"";if(r)switch(r){case yo:return ho;case mo:return co;case go:return lo;case vo:return fo;case bo:return po}return t});const _o=wo;var So="[object Arguments]",Oo="[object Array]",Eo="[object Object]",ko=Object.prototype.hasOwnProperty;const Po=function(e,t,n,r,o,i){var a=kr(e),s=kr(t),u=a?Oo:_o(e),c=s?Oo:_o(t),l=(u=u==So?Eo:u)==Eo,f=(c=c==So?Eo:c)==Eo,d=u==c;if(d&&Ur(e)){if(!Ur(t))return!1;a=!0,l=!1}if(d&&!l)return i||(i=new hr),a||Gr(e)?br(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new wr(e),new wr(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return xn(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=_r;case"[object Set]":var u=1&r;if(s||(s=Sr),e.size!=t.size&&!u)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var l=br(s(e),s(t),r,o,i,a);return a.delete(e),l;case"[object Symbol]":if(Er)return Er.call(e)==Er.call(t)}return!1}(e,t,u,n,r,o,i);if(!(1&n)){var p=l&&ko.call(e,"__wrapped__"),h=f&&ko.call(t,"__wrapped__");if(p||h){var y=p?e.value():e,m=h?t.value():t;return i||(i=new hr),o(y,m,n,r,i)}}return!!d&&(i||(i=new hr),function(e,t,n,r,o,i){var a=1&n,s=ro(e),u=s.length;if(u!=ro(t).length&&!a)return!1;for(var c=u;c--;){var l=s[c];if(!(a?l in t:oo.call(t,l)))return!1}var f=i.get(e),d=i.get(t);if(f&&d)return f==t&&d==e;var p=!0;i.set(e,t),i.set(t,e);for(var h=a;++c<u;){var y=e[l=s[c]],m=t[l];if(r)var g=a?r(m,y,l,t,e,i):r(y,m,l,e,t,i);if(!(void 0===g?y===m||o(y,m,n,r,i):g)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var v=e.constructor,b=t.constructor;v==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b||(p=!1)}return i.delete(e),i.delete(t),p}(e,t,n,r,o,i))},xo=function e(t,n,r,o,i){return t===n||(null==t||null==n||!Tr(t)&&!Tr(n)?t!=t&&n!=n:Po(t,n,r,o,e,i))},jo=function(e,t){return xo(e,t)};function To(t){const[n,r]=(0,e.useState)([]);return(0,e.useEffect)((()=>{function e(e){var o,i;const a=null!==(i=null===(o=e.slots[t])||void 0===o?void 0:o.assignedExtensions)&&void 0!==i?i:[];jo(a,n)||r(a)}return e((0,_n.getExtensionStore)().getState()),(0,_n.getExtensionStore)().subscribe(e)}),[t,n]),n}function Ao(t){const n=Pn(),r=To(t);return(0,e.useMemo)((()=>(0,_n.getConnectedExtensions)(r,n)),[r,n])}function Co(n){const{moduleName:r}=(0,e.useContext)(t);if(!r)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,e.useEffect)((()=>{(0,_n.registerExtensionSlot)(r,n)}),[]),{extensions:Ao(n),extensionSlotName:n,extensionSlotModuleName:r}}function No(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Do(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){No(e,t,n[t])}))}return e}function Ro(e){return e}function Io(n){var{name:r,extensionSlotName:o,select:i=Ro,children:a,state:s,style:u}=n,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,["name","extensionSlotName","select","children","state","style"]);if(a&&s)throw new Error("Both children and state have been provided. If children are provided, the state must be passed as a prop to the `Extension` component.");const l=null!=r?r:o,f=(0,e.useRef)(null),{extensions:d,extensionSlotModuleName:p}=Co(l),h=(0,e.useMemo)((()=>i(d)),[i,d]),y=(0,e.useMemo)((()=>{if("function"==typeof a&&!e.isValidElement(a))return h.map((e=>a(e)))}),[a,h]);var m,g,v,b;return e.createElement("div",Do({ref:f,"data-extension-slot-name":l,"data-extension-slot-module-name":p,style:(v=Do({},u),b={position:"relative"},b=null!=b?b:{},Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(b)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(b)).forEach((function(e){Object.defineProperty(v,e,Object.getOwnPropertyDescriptor(b,e))})),v)},c),l&&h.map(((n,r)=>e.createElement(t.Provider,{key:n.id,value:{moduleName:p,extension:{extensionId:n.id,extensionSlotName:l,extensionSlotModuleName:p}}},null!==(g=null!==(m=null==y?void 0:y[r])&&void 0!==m?m:"function"!=typeof a?a:null)&&void 0!==g?g:e.createElement(En,{state:s})))))}var Mo=n(645);function Lo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Uo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lo(Object(n),!0).forEach((function(t){Bo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $o(e){return($o="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)}function Bo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fo(e){return(Fo="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)}function Ko(e,t){var n;if("function"!=typeof(n=t.domElement?function(){return t.domElement}:t.domElementGetter?t.domElementGetter:e.domElementGetter?e.domElementGetter:function(e){var t=e.appName||e.name;if(!t)throw Error("single-spa's dom-element-getter-helpers was not given an application name as a prop, so it can't make a unique dom element container for the react application");var n="single-spa-application:".concat(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)))throw Error("single-spa's dom-element-getter-helpers was given an invalid domElementGetter for application or parcel '".concat(t.name,"'. Expected a function, received ").concat(Fo(n)));return function(){var e=n(t);if(!(e instanceof HTMLElement))throw Error("single-spa's dom-element-getter-helpers: domElementGetter returned an invalid dom element for application or parcel '".concat(t.name,"'. Expected HTMLElement, received ").concat(Fo(e)));return e}}var zo=null;try{zo=require("react").createContext()}catch(Ne){}var Wo={React:null,ReactDOM:null,ReactDOMClient:null,rootComponent:null,loadRootComponent:null,renderType:"createRoot",errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{},unmountResolves:{}};function Vo(e){if("object"!==$o(e))throw new Error("single-spa-react requires a configuration object");var t=Uo(Uo({},Wo),e);if(!t.React)throw new Error("single-spa-react must be passed opts.React");if(!t.ReactDOM&&!t.ReactDOMClient)throw new Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(!t.rootComponent&&!t.loadRootComponent)throw new Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(t.errorBoundary&&"function"!=typeof t.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!zo&&t.React.createContext&&(zo=t.React.createContext()),t.SingleSpaRoot=function(e){function t(e){t.displayName="SingleSpaRoot(".concat(e.name,")")}return t.prototype=Object.create(e.React.Component.prototype),t.prototype.componentDidMount=function(){setTimeout(this.props.mountFinished)},t.prototype.componentWillUnmount=function(){setTimeout(this.props.unmountFinished)},t.prototype.render=function(){return setTimeout(this.props.updateFinished),this.props.children},t}(t);var n={bootstrap:qo.bind(null,t),mount:Ho.bind(null,t),unmount:Go.bind(null,t)};return t.parcelCanUpdate&&(n.update=Qo.bind(null,t)),n}function qo(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then((function(t){e.rootComponent=t}))}function Ho(e,t){return new Promise((function(n,r){e.suppressComponentDidCatchWarning||!function(e){if(!(e&&"string"==typeof e.version&&e.version.indexOf(".")>=0))return!1;var t=e.version.slice(0,e.version.indexOf("."));try{return Number(t)>=16}catch(e){return!1}}(e.React)||e.errorBoundary||e.errorBoundaryClass||(e.rootComponent.prototype?e.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var o=Xo(e,t,(function(){n(this)})),i=Ko(e,t)(),a=function(e){var t=e.renderType,n=e.elementToRender,r=e.domElement,o=e.reactDom[t];if("function"!=typeof o)throw new Error('renderType "'.concat(t,'" did not return a function.'));switch(t){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var i=o(r);return i.render(n),i;case"hydrateRoot":return o(r,n);default:return o(n,r),null}}({elementToRender:o,domElement:i,reactDom:Yo(e),renderType:Jo(e)});e.domElements[t.name]=i,e.renderResults[t.name]=a}))}function Go(e,t){return new Promise((function(n){e.unmountResolves[t.name]=n;var r=e.renderResults[t.name];r&&r.unmount?r.unmount():Yo(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]}))}function Qo(e,t){return new Promise((function(n){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(n);var r=Xo(e,t,null),o=e.renderResults[t.name];if(o&&o.render)o.render(r);else{var i=Ko(e,t)();Yo(e).render(r,i)}}))}function Yo(e){return e.ReactDOMClient||e.ReactDOM}function Jo(e){return"function"==typeof e.renderType?e.renderType():e.renderType}function Xo(e,t,n){var r=e.React.createElement(e.rootComponent,t),o=zo?e.React.createElement(zo.Provider,{value:t},r):r;return(e.errorBoundary||t.errorBoundary||e.errorBoundaryClass||t.errorBoundaryClass)&&(e.errorBoundaryClass=e.errorBoundaryClass||t.errorBoundaryClass||function(e,t){function n(t){e.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},n.displayName="SingleSpaReactErrorBoundary(".concat(t.name,")")}return n.prototype=Object.create(e.React.Component.prototype),n.prototype.render=function(){return this.state.caughtError?(e.errorBoundary||t.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},n.prototype.componentDidCatch=function(e,t){this.setState({caughtError:e,caughtErrorInfo:t})},n}(e,t),o=e.React.createElement(e.errorBoundaryClass,t,o)),e.React.createElement(e.SingleSpaRoot,Uo(Uo({},t),{},{mountFinished:n,updateFinished:function(){e.updateResolves[t.name]&&(e.updateResolves[t.name].forEach((function(e){return e()})),delete e.updateResolves[t.name])},unmountFinished:function(){e.unmountResolves[t.name]&&(e.unmountResolves[t.name](),delete e.unmountResolves[t.name])}}),o)}function Zo(e){return Zo="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},Zo(e)}function ei(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ti(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){ei(e,t,n[t])}))}return e}function ni(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ri(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function oi(e,t,n){return t&&ri(e.prototype,t),n&&ri(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ii(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ai(e,t){if(t&&("object"===Zo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ii(e)}function si(e){return si=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},si(e)}function ui(e,t){return ui=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ui(e,t)}function ci(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ui(e,t)}var li={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,t){console&&console[e]&&console[e].apply(console,t)}},fi=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ni(this,e),this.init(t,n)}return oi(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||li,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,ti({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),di=function(){function e(){ni(this,e),this.observers={}}return oi(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,n)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(n))}))}}]),e}();function pi(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function hi(e){return null==e?"":""+e}function yi(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function mi(e,t,n){var r=yi(e,t,Object);r.obj[r.k]=n}function gi(e,t){var n=yi(e,t),r=n.obj,o=n.k;if(r)return r[o]}function vi(e,t,n){var r=gi(e,n);return void 0!==r?r:gi(t,n)}function bi(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):bi(e[r],t[r],n):e[r]=t[r]);return e}function wi(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function Si(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return _i[e]})):e}var Oi="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Ei=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return ni(this,t),n=ai(this,si(t).call(this)),Oi&&di.call(ii(n)),n.data=e||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return ci(t,e),oi(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=[e,t];return n&&"string"!=typeof n&&(i=i.concat(n)),n&&"string"==typeof n&&(i=i.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(i=e.split(".")),gi(this.data,i)}},{key:"addResource",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),mi(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=gi(this.data,a)||{};r?bi(s,n,o):s=ti({},s,n),mi(this.data,a,s),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?ti({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(di),ki={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,o))})),t}},Pi={},xi=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ni(this,t),n=ai(this,si(t).call(this)),Oi&&di.call(ii(n)),function(e,t,n){["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((function(e){t[e]&&(n[e]=t[e])}))}(0,e,ii(n)),n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=fi.create("translator"),n}return ci(t,e),oi(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var i=e.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:e,namespaces:o};var a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(o=a.shift()),e=a.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(e,n,r){var o=this;if("object"!==Zo(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],n),s=a.key,u=a.namespaces,c=u[u.length-1],l=n.lng||this.language,f=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(f){var d=n.nsSeparator||this.options.nsSeparator;return c+d+s}return s}var p=this.resolve(e,n),h=p&&p.res,y=p&&p.usedKey||s,m=p&&p.exactUsedKey||s,g=Object.prototype.toString.apply(h),v=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject;if(b&&h&&"string"!=typeof h&&"boolean"!=typeof h&&"number"!=typeof h&&["[object Number]","[object Function]","[object RegExp]"].indexOf(g)<0&&("string"!=typeof v||"[object Array]"!==g)){if(!n.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,h,n):"key '".concat(s," (").concat(this.language,")' returned an object instead of string.");if(i){var w="[object Array]"===g,_=w?[]:{},S=w?m:y;for(var O in h)if(Object.prototype.hasOwnProperty.call(h,O)){var E="".concat(S).concat(i).concat(O);_[O]=this.translate(E,ti({},n,{joinArrays:!1,ns:u})),_[O]===E&&(_[O]=h[O])}h=_}}else if(b&&"string"==typeof v&&"[object Array]"===g)(h=h.join(v))&&(h=this.extendTranslation(h,e,n,r));else{var k=!1,P=!1,x=void 0!==n.count&&"string"!=typeof n.count,j=t.hasDefaultValue(n),T=x?this.pluralResolver.getSuffix(l,n.count):"",A=n["defaultValue".concat(T)]||n.defaultValue;!this.isValidLookup(h)&&j&&(k=!0,h=A),this.isValidLookup(h)||(P=!0,h=s);var C=j&&A!==h&&this.options.updateMissing;if(P||k||C){if(this.logger.log(C?"updateKey":"missingKey",l,c,s,C?A:h),i){var N=this.resolve(s,ti({},n,{keySeparator:!1}));N&&N.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 D=[],R=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&R&&R[0])for(var I=0;I<R.length;I++)D.push(R[I]);else"all"===this.options.saveMissingTo?D=this.languageUtils.toResolveHierarchy(n.lng||this.language):D.push(n.lng||this.language);var M=function(e,t,r){o.options.missingKeyHandler?o.options.missingKeyHandler(e,c,t,C?r:h,C,n):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(e,c,t,C?r:h,C,n),o.emit("missingKey",e,c,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?D.forEach((function(e){o.pluralResolver.getSuffixes(e).forEach((function(t){M([e],s+t,n["defaultValue".concat(t)]||A)}))})):M(D,s,A))}h=this.extendTranslation(h,e,n,p,r),P&&h===s&&this.options.appendNamespaceToMissingKey&&(h="".concat(c,":").concat(s)),P&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(h))}return h}},{key:"extendTranslation",value:function(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,n,r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(ti({},n,{interpolation:ti({},this.options.interpolation,n.interpolation)}));var a,s=n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(s){var u=e.match(this.interpolator.nestingRegexp);a=u&&u.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=ti({},this.options.interpolation.defaultVariables,c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),s){var l=e.match(this.interpolator.nestingRegexp);a<(l&&l.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):i.translate.apply(i,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var f=n.postProcess||this.options.postProcess,d="string"==typeof f?[f]:f;return null!=e&&d&&d.length&&!1!==n.applyPostProcessor&&(e=ki.handle(d,e,t,this.options&&this.options.postProcessPassResolved?ti({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,o,i,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var u=a.extractFromKey(e,s),c=u.key;n=c;var l=u.namespaces;a.options.fallbackNS&&(l=l.concat(a.options.fallbackNS));var f=void 0!==s.count&&"string"!=typeof s.count,d=void 0!==s.context&&"string"==typeof s.context&&""!==s.context,p=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);l.forEach((function(e){a.isValidLookup(t)||(i=e,!Pi["".concat(p[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(Pi["".concat(p[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(i,'" 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!!!")),p.forEach((function(n){if(!a.isValidLookup(t)){o=n;var i,u,l=c,p=[l];for(a.i18nFormat&&a.i18nFormat.addLookupKeys?a.i18nFormat.addLookupKeys(p,c,n,e,s):(f&&(i=a.pluralResolver.getSuffix(n,s.count)),f&&d&&p.push(l+i),d&&p.push(l+="".concat(a.options.contextSeparator).concat(s.context)),f&&p.push(l+=i));u=p.pop();)a.isValidLookup(t)||(r=u,t=a.getResource(n,e,u,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}]),t}(di);function ji(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ti=function(){function e(t){ni(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=fi.create("languageUtils")}return oi(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=ji(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=ji(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=ji(n[2].toLowerCase()))),n.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 t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(n.isSupportedCode(e)?o.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&i(n.formatLanguageCode(e))})),o}}]),e}(),Ai=[{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}],Ci={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?0:1)},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:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},Ni=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ni(this,e),this.languageUtils=t,this.options=r,this.logger=fi.create("pluralResolver"),this.rules=(n={},Ai.forEach((function(e){e.lngs.forEach((function(t){n[t]={numbers:e.nr,plurals:Ci[e.fc]}}))})),n)}return oi(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map((function(e){return t+e}))}},{key:"getSuffixes",value:function(e){var t=this,n=this.getRule(e);return n?n.numbers.map((function(n){return t.getSuffix(e,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=this,r=this.getRule(e);if(r){var o=r.noAbs?r.plurals(t):r.plurals(Math.abs(t)),i=r.numbers[o];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var a=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),Di=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ni(this,e),this.logger=fi.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return oi(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:Si,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?wi(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?wi(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?wi(t.nestingPrefix):t.nestingPrefixEscaped||wi("$t("),this.nestingSuffix=t.nestingSuffix?wi(t.nestingSuffix):t.nestingSuffixEscaped||wi(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.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=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var o,i,a,s=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(s.formatSeparator)<0){var o=vi(t,u,e);return s.alwaysFormat?s.format(o,void 0,n):o}var i=e.split(s.formatSeparator),a=i.shift().trim(),c=i.join(s.formatSeparator).trim();return s.format(vi(t,u,a),c,n,r)};this.resetRegExp();var f=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,d=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(t){for(a=0;o=t.regex.exec(e);){if(void 0===(i=l(o[1].trim())))if("function"==typeof f){var n=f(e,o,r);i="string"==typeof n?n:""}else{if(d){i=o[0];continue}s.logger.warn("missed to pass in variable ".concat(o[1]," for interpolating ").concat(e)),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=hi(i));if(e=e.replace(o[0],t.safeValue(i)),t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,o=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=ti({},i);function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(r[1]);e=r[0],o=(o=this.interpolate(o,a)).replace(/'/g,'"');try{a=JSON.parse(o),t&&(a=ti({},t,a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(o)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var u=[],c=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var l=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=l.shift(),u=l,c=!0}if((r=t(s.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=hi(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=u.reduce((function(e,t){return o.format(e,t,i.lng,i)}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}(),Ri=function(e){function t(e,n,r){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return ni(this,t),o=ai(this,si(t).call(this)),Oi&&di.call(ii(o)),o.backend=e,o.store=n,o.services=r,o.languageUtils=r.languageUtils,o.options=i,o.logger=fi.create("backendConnector"),o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(r,i.backend,i),o}return ci(t,e),oi(t,[{key:"queueLoad",value:function(e,t,n,r){var o=this,i=[],a=[],s=[],u=[];return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&o.store.hasResourceBundle(e,t)?o.state[s]=2:o.state[s]<0||(1===o.state[s]?a.indexOf(s)<0&&a.push(s):(o.state[s]=1,r=!1,a.indexOf(s)<0&&a.push(s),i.indexOf(s)<0&&i.push(s),u.indexOf(t)<0&&u.push(t)))})),r||s.push(e)})),(i.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:r}),{toLoad:i,pending:a,toLoadLanguages:s,toLoadNamespaces:u}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){!function(e,t,n,r){var o=yi(e,t,Object),i=o.obj,a=o.k;i[a]=i[a]||[],i[a].push(n)}(n.loaded,[o],i),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){a[e].indexOf(t)<0&&a[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(s,u){s&&u&&o<5?setTimeout((function(){r.read.call(r,e,t,n,o+1,2*i,a)}),i):a(s,u)})):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=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."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" 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!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,ti({},i,{isUpdate:o})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),t}(di);function Ii(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&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Mi(){}var Li=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(ni(this,t),e=ai(this,si(t).call(this)),Oi&&di.call(ii(e)),e.options=Ii(n),e.services={},e.logger=fi,e.modules={external:[]},r&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,r),ai(e,ii(e));setTimeout((function(){e.init(n,r)}),0)}return e}return ci(t,e),oi(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function r(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.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=ti({},{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 t={};if("object"===Zo(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===Zo(e[2])||"object"===Zo(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}},this.options,Ii(t)),this.format=this.options.interpolation.format,n||(n=Mi),!this.options.isClone){this.modules.logger?fi.init(r(this.modules.logger),this.options):fi.init(null,this.options);var o=new Ti(this.options);this.store=new Ei(this.options.resources,this.options);var i=this.services;i.logger=fi,i.resourceStore=this.store,i.languageUtils=o,i.pluralResolver=new Ni(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),i.interpolator=new Di(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Ri(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new xi(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.length>0&&"dev"!==a[0]&&(this.options.lng=a[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(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var s=pi(),u=function(){var t=function(t,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),s.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),s}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mi,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return n();var o=[],i=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};r?i(r):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,n)}else n(null)}},{key:"reloadResources",value:function(e,t,n){var r=pi();return e||(e=this.languages),t||(t=this.options.ns),n||(n=Mi),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new 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&&ki.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=pi();this.emit("languageChanging",e);var o=function(e){var o="string"==typeof e?e:n.services.languageUtils.getBestMatchFromCodes(e);o&&(n.language||(n.language=o,n.languages=n.services.languageUtils.toResolveHierarchy(o)),n.translator.language||n.translator.changeLanguage(o),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(o)),n.loadResources(o,(function(e){!function(e,o){o?(n.language=o,n.languages=n.services.languageUtils.toResolveHierarchy(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,o)}))};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,t){var n=this,r=function e(t,r){var o;if("object"!==Zo(r)){for(var i=arguments.length,a=new Array(i>2?i-2:0),s=2;s<i;s++)a[s-2]=arguments[s];o=n.options.overloadTranslationOptionHandler([t,r].concat(a))}else o=ti({},r);return o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,n.t(t,o)};return"string"==typeof e?r.lng=e:r.lngs=e,r.ns=t,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 t=this,n=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],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||!(!a(r,e)||o&&!a(i,e))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=pi();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=pi();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],o=e.filter((function(e){return r.indexOf(e)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),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(){return new t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mi,o=ti({},this.options,n,{isClone:!0}),i=new t(o);return["store","services","language"].forEach((function(t){i[t]=e[t]})),i.services=ti({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new xi(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i.emit.apply(i,[e].concat(n))})),i.init(o,r),i.translator.options=i.options,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}}]),t}(di);const Ui=new Li;var $i=(0,e.createContext)();function Bi(t){var n=t.i18n,r=t.defaultNS,o=t.children,i=(0,e.useMemo)((function(){return{i18n:n,defaultNS:r}}),[n,r]);return(0,e.createElement)($i.Provider,{value:i},o)}oi((function e(){ni(this,e),this.usedNamespaces={}}),[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]);const Fi=Ui.default||Ui,Ki={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},zi=t=>{(0,e.useEffect)((()=>(Fi.on("languageChanged",t.forceUpdate),()=>Fi.off("languageChanged",t.forceUpdate))),[t.forceUpdate]);const n=(0,e.useRef)(null);if(n.current)throw n.current;if(!Fi.hasLoadedNamespace(t.ns)){const e=setTimeout((()=>{console.warn(`openmrsComponentDecorator: the React suspense promise for i18next.loadNamespaces(['${t.ns}']) did not resolve nor reject after three seconds. This could mean you have multiple versions of i18next and haven't made i18next a webpack external in all projects.`)}),3e3);throw Fi.loadNamespaces([t.ns]).then((()=>clearTimeout(e))).catch((t=>{clearTimeout(e),n.current=t}))}return e.createElement(e.Fragment,null,t.children)};function Wi(n){if("object"!=typeof n||"string"!=typeof n.featureName||"string"!=typeof n.moduleName)throw new Error("Invalid options");const r=Object.assign({},Ki,n);return function(n){var o,i,a,s;return i=o=class extends e.Component{componentDidCatch(e,t){t&&t.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:t.componentStack})),r.throwErrorsToConsole&&setTimeout((()=>{throw e})),this.setState({caughtError:e,caughtErrorInfo:t})}render(){if(this.state.caughtError)return e.createElement("div",null,"An error has occurred. Please try reloading the page.");{const o=e.createElement(t.Provider,{value:this.state.config},e.createElement(e.Suspense,{fallback:null},r.disableTranslations?e.createElement(n,this.props):e.createElement(zi,{ns:r.moduleName,forceUpdate:()=>this.forceUpdate()},e.createElement(Bi,{i18n:Fi,defaultNS:r.moduleName},e.createElement(n,this.props)))));return r.strictMode||!e.StrictMode?o:e.createElement(e.StrictMode,null,o)}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:r.moduleName,extension:e._extensionContext}}}},a="displayName",s=`OpenmrsReactComponent(${r.featureName})`,a in i?Object.defineProperty(i,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[a]=s,o}}function Vi(t,n){return Vo({React:e,ReactDOMClient:Mo,rootComponent:Wi(n)(t)})}function qi(e,t){return()=>e().then((({default:e})=>Vi(e,t)))}function Hi(e,t){return()=>Promise.resolve(Vi(e,t))}const Gi=qi;function Qi(t){const[n,r]=(0,e.useState)([]);return(0,e.useEffect)((()=>(0,_n.getExtensionStore)().subscribe((e=>{var o,i;const a=null!==(i=null===(o=e.slots[t])||void 0===o?void 0:o.assignedExtensions.map((e=>e.id)))&&void 0!==i?i:[];jo(a,n)||r(a)}))),[]),n}function Yi(t){(0,e.useEffect)((()=>{if(t){const e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}}),[t])}function Ji(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xi={},Zi='No ComponentContext has been provided. This should come from "openmrsComponentDecorator".\nUsually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".';function ea(t){const n=(0,e.useMemo)(oe,[]),r=function(t,n){const[r,o]=(0,e.useState)(function(e,t){return t?()=>{const n=ie(e.getState(),t.extensionSlotName,t.extensionId);if(n.loaded&&n.config)return n.config}:null}(t,n));return(0,e.useEffect)((()=>{if(n)return t.subscribe((e=>{const t=ie(e,n.extensionSlotName,n.extensionId);t.loaded&&t.config&&!jo(t.config,r)&&o(t.config)}))}),[t,n,r]),r}(n,t);if(!r&&t){const e=`${t.extensionSlotName}-${t.extensionId}`;throw!Xi[e]&&n&&(Xi[e]=function(e,t){return new Promise((n=>{const r=e.subscribe((e=>{const o=ie(e,t.extensionSlotName,t.extensionId);o.loaded&&o.config&&(n(o.config),r())}))}))}(n,t)),Xi[e]}return r||{}}function ta(){const{moduleName:n,extension:r}=(0,e.useContext)(t);if(!n&&!r)throw Error(Zi);const o=function(t){const n=(0,e.useMemo)((()=>re(t)),[t]),r=t,o=function(t){const[n,r]=(0,e.useState)(function(e){return()=>{const t=e.getState();return t.loaded&&t.config?t.config:null}}(t));return(0,e.useEffect)((()=>null==t?void 0:t.subscribe((e=>{e.loaded&&e.config&&r(e.config)}))),[t]),n}(n);if(!o)throw Xi[r]||(Xi[r]=function(e){return new Promise((t=>{const n=e.subscribe((e=>{e.loaded&&e.config&&(t(e.config),n())}))}))}(n)),Xi[r];return o}(n),i=ea(r),a=(0,e.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ji(e,t,n[t])}))}return e}({},o,i)),[o,i]);return a}var na,ra=n(840);function oa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ia(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){oa(e,t,n[t])}))}return e}function aa(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}!function(e){e.loadPatient="loadPatient",e.newPatient="newPatient",e.loadError="patientLoadError"}(na||(na={}));const sa={patientUuid:null,patient:null,isPendingUuid:!0,isLoadingPatient:!1,err:null};function ua(){const e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function ca(e,t){switch(t.type){case na.loadPatient:return aa(ia({},e),{patientUuid:t.patientUuid,patient:null,isPendingUuid:!1,isLoadingPatient:!0,err:null});case na.newPatient:return aa(ia({},e),{patient:t.patient,isPendingUuid:!1,isLoadingPatient:!1,err:null});case na.loadError:return aa(ia({},e),{patient:null,isPendingUuid:!1,isLoadingPatient:!1,err:t.err});default:return e}}function la(t){const[n,r]=(0,e.useReducer)(ca,aa(ia({},sa),{patientUuid:null!=t?t:null,isPendingUuid:!t,isLoadingPatient:!!t}));return(0,e.useEffect)((()=>{if(n.isPendingUuid){const e=ua();r(e?{type:na.loadPatient,patientUuid:e}:{type:na.newPatient,patient:null})}let e=!0;return n.isLoadingPatient&&n.patientUuid&&(0,ra.fetchCurrentPatient)(n.patientUuid).then((t=>e&&r({patient:t,type:na.newPatient})),(t=>e&&r({err:t,type:na.loadError}))),()=>{e=!1}}),[n.isPendingUuid,n.isLoadingPatient,n.patientUuid]),(0,e.useEffect)((()=>{const e=e=>{const t=ua();t!=n.patientUuid&&r({type:na.loadPatient,patientUuid:t})};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)}),[n.patientUuid]),{isLoading:n.isPendingUuid||n.isLoadingPatient,patient:n.patient,patientUuid:null!=t?t:n.patientUuid,error:n.err}}const fa=wn((0,_n.getExtensionInternalStore)());function da(t){const n=Ao(t);return(0,e.useMemo)((()=>Object.fromEntries(n.map((e=>[e.name,e.meta])))),[n])}const pa=wn((0,_n.getExtensionStore)());function ha(){const[,t]=(0,e.useState)(0);return(0,e.useCallback)((()=>{t((e=>e+1))}),[])}function ya(){let e="tablet";return document.body.classList.forEach((t=>{switch(t){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 ma(){const[t,n]=(0,e.useState)(ya);return(0,e.useEffect)((()=>{const e=()=>{n(ya())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),t}const ga=e=>"small-desktop"===e||"large-desktop"===e;function va(){const[t,n]=(0,e.useState)([]);return(0,e.useEffect)((()=>{const e=(0,ra.getLocations)().subscribe((e=>{n(e)}),(e=>{console.error(e)}));return()=>e.unsubscribe()}),[]),t}function ba(t,n=!0){const r=(0,e.useRef)(null);return(0,e.useEffect)((()=>{if(n){const e=e=>{var n;(null==r||null===(n=r.current)||void 0===n?void 0:n.contains(e.target))||t(e)};return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}}),[t,n]),r}const wa=({privilege:t,fallback:n,children:r})=>{const[o,i]=(0,e.useState)(null);return(0,e.useEffect)((()=>{const e=(0,ra.getCurrentUser)({includeAuthStatus:!1}).subscribe(i);return()=>e.unsubscribe()}),[]),o&&(0,ra.userHasAccess)(t,o)?e.createElement(e.Fragment,null,r):n?e.createElement(e.Fragment,null,n):null};let _a,Sa;function Oa(){const[t,n]=(0,e.useState)(null);let r=null;if(!t){if(_a){const e=(0,ra.getSessionStore)().getState();e.loaded&&(r=e.session)}else _a=new Promise((e=>{const t=({loaded:t,session:n})=>{t&&(e(n),r=n,Sa&&Sa(),Sa=void 0)};t((0,ra.getSessionStore)().getState()),r||(Sa=(0,ra.getSessionStore)().subscribe(t))}));if(!r)throw _a;n(r)}(0,e.useEffect)((()=>(Sa||(Sa=(0,ra.getSessionStore)().subscribe((({loaded:e,session:t})=>{e&&(r=t,n(t))}))),()=>{Sa&&Sa(),Sa=void 0})),[]);const o=t||r;if(!o)throw _a?(console.warn("useSession is in an unexpected state. Attempting to recover."),_a):Error("useSession is in an invalid state.");return o}function Ea(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ka=e=>e;function Pa(t,n=ka,r){const[o,i]=(0,e.useState)((()=>n(t.getState())));(0,e.useEffect)((()=>(0,Z.subscribeTo)(t,n,i)),[t,n]);let a=(0,e.useMemo)((()=>r?function(e,t){"function"==typeof t&&(t=t(e));const n={};for(let r in t)n[r]=()=>{const n=arguments;e.setState((e=>{let o=[e];for(let e=0;e<n.length;e++)o.push(n[e]);return t[r](...o)}))};return n}(t,r):{}),[t,r]);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ea(e,t,n[t])}))}return e}({},o,a)}function xa(e,t){return Pa(e,ka,t)}var ja=n(374);const Ta=new WeakMap,Aa={},Ca=()=>{},Na=Ca(),Da=Object,Ra=e=>e===Na,Ia=e=>"function"==typeof e,Ma=(e,t)=>({...e,...t}),La="undefined",Ua=typeof window!=La,$a=typeof document!=La,Ba=(e,t)=>{const n=Ta.get(e);return[()=>e.get(t)||Aa,r=>{const o=e.get(t);n[5](t,Ma(o,r),o||Aa)},n[6]]},Fa=new WeakMap;let Ka=0;const za=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(Da(e)!==e||r||n==RegExp)o=r?e.toJSON():"symbol"==t?e.toString():"string"==t?JSON.stringify(e):""+e;else{if(o=Fa.get(e),o)return o;if(o=++Ka+"~",Fa.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=za(e[i])+",";Fa.set(e,o)}if(n==Da){o="#";const t=Da.keys(e).sort();for(;!Ra(i=t.pop());)Ra(e[i])||(o+=i+":"+za(e[i])+",");Fa.set(e,o)}}return o};let Wa=!0;const[Va,qa]=Ua&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Ca,Ca],Ha={isOnline:()=>Wa,isVisible:()=>{const e=$a&&document.visibilityState;return Ra(e)||"hidden"!==e}},Ga={initFocus:e=>($a&&document.addEventListener("visibilitychange",e),Va("focus",e),()=>{$a&&document.removeEventListener("visibilitychange",e),qa("focus",e)}),initReconnect:e=>{const t=()=>{Wa=!0,e()},n=()=>{Wa=!1};return Va("online",t),Va("offline",n),()=>{qa("online",t),qa("offline",n)}}},Qa=!e.useId,Ya=!Ua||"Deno"in window,Ja=Ya?e.useEffect:e.useLayoutEffect,Xa="undefined"!=typeof navigator&&navigator.connection,Za=!Ya&&Xa&&(["slow-2g","2g"].includes(Xa.effectiveType)||Xa.saveData),es=e=>{if(Ia(e))try{e=e()}catch(t){e=""}const t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?za(e):"",t]};let ts=0;const ns=()=>++ts;async function rs(...e){const[t,n,r,o]=e,i=Ma({populateCache:!0,throwOnError:!0},"boolean"==typeof o?{revalidate:o}:o||{});let a=i.populateCache;const s=i.rollbackOnError;let u=i.optimisticData;const c=!1!==i.revalidate,l=i.throwOnError;if(Ia(n)){const e=n,r=[],o=t.keys();for(let n=o.next();!n.done;n=o.next()){const o=n.value;!o.startsWith("$inf$")&&e(t.get(o)._k)&&r.push(o)}return Promise.all(r.map(f))}return f(n);async function f(n){const[o]=es(n);if(!o)return;const[i,f]=Ba(t,o),[d,p,h]=Ta.get(t),y=d[o],m=()=>c&&(delete h[o],y&&y[0])?y[0](2).then((()=>i().data)):i().data;if(e.length<3)return m();let g,v=r;const b=ns();p[o]=[b,0];const w=!Ra(u),_=i(),S=_.data,O=_._c,E=Ra(O)?S:O;if(w&&(u=Ia(u)?u(E):u,f({data:u,_c:E})),Ia(v))try{v=v(E)}catch(e){g=e}if(v&&Ia(v.then)){if(v=await v.catch((e=>{g=e})),b!==p[o][0]){if(g)throw g;return v}g&&w&&(e=>"function"==typeof s?s(e):!1!==s)(g)&&(a=!0,v=E,f({data:v,_c:Na}))}a&&(g||(Ia(a)&&(v=a(v,E)),f({data:v,_c:Na}))),p[o][1]=ns();const k=await m();if(f({_c:Na}),!g)return a?k:v;if(l)throw g}}const os=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},is=(e,t)=>{if(!Ta.has(e)){const n=Ma(Ga,t),r={},o=rs.bind(Na,e);let i=Ca;const a={},s=(e,t)=>{const n=a[e]||[];return a[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},u=(t,n,r)=>{e.set(t,n);const o=a[t];if(o)for(let e=o.length;e--;)o[e](r,n)},c=()=>{if(!Ta.has(e)&&(Ta.set(e,[r,{},{},{},o,u,s]),!Ya)){const t=n.initFocus(setTimeout.bind(Na,os.bind(Na,r,0))),o=n.initReconnect(setTimeout.bind(Na,os.bind(Na,r,1)));i=()=>{t&&t(),o&&o(),Ta.delete(e)}}};return c(),[e,o,c,i]}return[e,Ta.get(e)[4]]},[as,ss]=is(new Map),us=Ma({onLoadingSlow:Ca,onSuccess:Ca,onError:Ca,onErrorRetry:(e,t,n,r,o)=>{const i=n.errorRetryCount,a=o.retryCount,s=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!Ra(i)&&a>i||setTimeout(r,s,o)},onDiscarded:Ca,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Za?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:Za?5e3:3e3,compare:(e,t)=>za(e)==za(t),isPaused:()=>!1,cache:as,mutate:ss,fallback:{}},Ha),cs=(e,t)=>{const n=Ma(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:a}=t;r&&i&&(n.use=r.concat(i)),o&&a&&(n.fallback=Ma(o,a))}return n},ls=(0,e.createContext)({}),fs=Ua&&window.__SWR_DEVTOOLS_USE__,ds=fs?window.__SWR_DEVTOOLS_USE__:[],ps=ds.concat((e=>(t,n,r)=>e(t,n&&((...e)=>{const r=es(t)[0],[,,,o]=Ta.get(as),i=o[r];return i?(delete o[r],i):n(...e)}),r)));fs&&(window.__SWR_DEVTOOLS_REACT__=e);const hs={dedupe:!0};Da.defineProperty((t=>{const{value:n}=t,r=(0,e.useContext)(ls),o=Ia(n),i=(0,e.useMemo)((()=>o?n(r):n),[o,r,n]),a=(0,e.useMemo)((()=>o?i:cs(r,i)),[o,r,i]),s=i&&i.provider,[u]=(0,e.useState)((()=>s?is(s(a.cache||as),i):Na));return u&&(a.cache=u[0],a.mutate=u[1]),Ja((()=>{if(u)return u[2]&&u[2](),u[3]}),[]),(0,e.createElement)(ls.Provider,Ma(t,{value:a}))}),"defaultValue",{value:us});var ys,ms=(ys=(t,n,r)=>{const{cache:o,compare:i,suspense:a,fallbackData:s,revalidateOnMount:u,refreshInterval:c,refreshWhenHidden:l,refreshWhenOffline:f,keepPreviousData:d}=r,[p,h,y]=Ta.get(o),[m,g]=es(t),v=(0,e.useRef)(!1),b=(0,e.useRef)(!1),w=(0,e.useRef)(m),_=(0,e.useRef)(n),S=(0,e.useRef)(r),O=()=>S.current,E=()=>O().isVisible()&&O().isOnline(),[k,P,x]=Ba(o,m),j=(0,e.useRef)({}).current,T=Ra(s)?r.fallback[m]:s,A=(e,t)=>{let n=!0;for(const r in j){const o=r;i(t[o],e[o])||"data"===o&&Ra(e[o])&&i(t[o],U)||(n=!1)}return n},C=(0,e.useMemo)((()=>{const e=!!m&&!!n&&(Ra(u)?!O().isPaused()&&!a:u),t=()=>{const t=k(),n=Ma(t);return delete n._k,e?{isValidating:!0,isLoading:!0,...n}:n};let r=t();return()=>{const e=t();return A(e,r)?r:r=e}}),[o,m]),N=(0,ja.useSyncExternalStore)((0,e.useCallback)((e=>x(m,((t,n)=>{A(t,n)||e()}))),[o,m]),C,C),D=!v.current,R=N.data,I=Ra(R)?T:R,M=N.error,L=(0,e.useRef)(I),U=d?Ra(R)?L.current:R:I,$=D&&!Ra(u)?u:!O().isPaused()&&(a?!Ra(I)&&r.revalidateIfStale:Ra(I)||r.revalidateIfStale),B=!!(m&&n&&D&&$),F=Ra(N.isValidating)?B:N.isValidating,K=Ra(N.isLoading)?B:N.isLoading,z=(0,e.useCallback)((async e=>{const t=_.current;if(!m||!t||b.current||O().isPaused())return!1;let n,o,a=!0;const s=e||{},u=!y[m]||!s.dedupe,c=()=>Qa?!b.current&&m===w.current&&v.current:m===w.current,l={isValidating:!1,isLoading:!1},f=()=>{P(l)},d=()=>{const e=y[m];e&&e[1]===o&&delete y[m]},p={isValidating:!0};Ra(k().data)&&(p.isLoading=!0);try{if(u&&(P(p),r.loadingTimeout&&Ra(k().data)&&setTimeout((()=>{a&&c()&&O().onLoadingSlow(m,r)}),r.loadingTimeout),y[m]=[t(g),ns()]),[n,o]=y[m],n=await n,u&&setTimeout(d,r.dedupingInterval),!y[m]||y[m][1]!==o)return u&&c()&&O().onDiscarded(m),!1;l.error=Na;const e=h[m];if(!Ra(e)&&(o<=e[0]||o<=e[1]||0===e[1]))return f(),u&&c()&&O().onDiscarded(m),!1;const s=k().data;l.data=i(s,n)?s:n,u&&c()&&O().onSuccess(n,m,r)}catch(e){d();const t=O(),{shouldRetryOnError:n}=t;t.isPaused()||(l.error=e,u&&c()&&(t.onError(e,m,t),(!0===n||Ia(n)&&n(e))&&E()&&t.onErrorRetry(e,m,t,z,{retryCount:(s.retryCount||0)+1,dedupe:!0})))}return a=!1,f(),!0}),[m,o]),W=(0,e.useCallback)(((...e)=>rs(o,w.current,...e)),[]);if(Ja((()=>{_.current=n,S.current=r,Ra(R)||(L.current=R)})),Ja((()=>{if(!m)return;const e=z.bind(Na,hs);let t=0;const n=((e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}})(m,p,(n=>{if(0==n){const n=Date.now();O().revalidateOnFocus&&n>t&&E()&&(t=n+O().focusThrottleInterval,e())}else if(1==n)O().revalidateOnReconnect&&E()&&e();else if(2==n)return z()}));return b.current=!1,w.current=m,v.current=!0,P({_k:g}),$&&(Ra(I)||Ya?e():(e=>{Ua&&typeof window.requestAnimationFrame!=La?window.requestAnimationFrame(e):setTimeout(e,1)})(e)),()=>{b.current=!0,n()}}),[m]),Ja((()=>{let e;function t(){const t=Ia(c)?c(I):c;t&&-1!==e&&(e=setTimeout(n,t))}function n(){k().error||!l&&!O().isVisible()||!f&&!O().isOnline()?t():z(hs).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[c,l,f,m]),(0,e.useDebugValue)(U),a&&Ra(I)&&m){if(!Qa&&Ya)throw new Error("Fallback data is required when using suspense in SSR.");throw _.current=n,S.current=r,b.current=!1,Ra(M)?z(hs):M}return{mutate:W,get data(){return j.data=!0,U},get error(){return j.error=!0,M},get isValidating(){return j.isValidating=!0,F},get isLoading(){return j.isLoading=!0,K}}},function(...t){const n=Ma(us,(0,e.useContext)(ls)),[r,o,i]=(e=>Ia(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}])(t),a=cs(n,i);let s=ys;const{use:u}=a,c=(u||[]).concat(ps);for(let e=c.length;e--;)s=c[e](s);return s(r,o||a.fetcher||null,a)}),gs=n(530),vs=n.n(gs),bs=n(332),ws=n.n(bs);function _s(t){const{data:n,error:r,mutate:o,isValidating:i}=ms(t?`/ws/rest/v1/visit?patient=${t}&v=${ra.defaultVisitCustomRepresentation}&includeInactive=false`:null,ra.openmrsFetch);var a;return{error:r,mutate:o,isValidating:i,currentVisit:(0,e.useMemo)((()=>null!==(a=null==n?void 0:n.data.results.find((e=>null===e.stopDatetime)))&&void 0!==a?a:null),[null==n?void 0:n.data.results]),isLoading:!n&&!r}}function Ss(){const[t,n]=(0,e.useState)([]);return(0,e.useEffect)((()=>{const e=(0,ra.getVisitTypes)().subscribe((e=>{n(e)}),(e=>console.error(e)));return()=>e.unsubscribe()}),[]),t}vs().extend(ws());const Os=10;function Es(t=[],n=Os){const[r,o]=(0,e.useState)(1),i=(0,e.useMemo)((()=>"number"==typeof n&&n>0?Math.max(1,Math.ceil(t.length/n)):1),[t.length,n]);return{results:(0,e.useMemo)((()=>{const e=(r-1)*n,o=(r+0)*n;return t.slice(e,o)}),[t,r,n]),totalPages:i,currentPage:r,paginated:t.length>n,showNextButton:r<i,showPreviousButton:r>1,goTo(e){o(Math.max(1,Math.min(i,e)))},goToNext(){r<i&&o(r+1)},goToPrevious(){r>1&&o(r-1)}}}})(),_openmrs_esm_react_utils=r})();
2
+ System.register(["react","@openmrs/esm-config","@openmrs/esm-extensions","@openmrs/esm-globals","react-dom","i18next","react-i18next","@openmrs/esm-api","dayjs"],(function(e,t){var n={},r={},o={},i={},a={},s={},u={},c={},l={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(a,"__esModule",{value:!0}),{setters:[function(e){Object.keys(e).forEach((function(t){n[t]=e[t]}))},function(e){r.getConfigStore=e.getConfigStore,r.getExtensionConfigFromStore=e.getExtensionConfigFromStore,r.getExtensionsConfigStore=e.getExtensionsConfigStore,r.interpolateUrl=e.interpolateUrl,r.navigate=e.navigate},function(e){o.getConnectedExtensions=e.getConnectedExtensions,o.getExtensionInternalStore=e.getExtensionInternalStore,o.getExtensionStore=e.getExtensionStore,o.registerExtensionSlot=e.registerExtensionSlot,o.renderExtension=e.renderExtension},function(e){i.subscribeConnectivityChanged=e.subscribeConnectivityChanged},function(e){Object.keys(e).forEach((function(t){a[t]=e[t]}))},function(e){s.default=e.default},function(e){u.I18nextProvider=e.I18nextProvider},function(e){c.defaultVisitCustomRepresentation=e.defaultVisitCustomRepresentation,c.fetchCurrentPatient=e.fetchCurrentPatient,c.getCurrentUser=e.getCurrentUser,c.getLocations=e.getLocations,c.getSessionStore=e.getSessionStore,c.getVisitTypes=e.getVisitTypes,c.openmrsFetch=e.openmrsFetch,c.userHasAccess=e.userHasAccess},function(e){l.default=e.default}],execute:function(){e((()=>{var e={403:()=>{System.register([],(function(e,t){return{execute:function(){e((()=>{var e={968:(e,t,n)=>{const r=n(577).R;t.s=function(e){if(e||(e=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=r(n.y.meta.url,e)}},577:(e,t,n)=>{t.R=function(e,t){var n=document.createElement("a");n.href=e;for(var r="/"===n.pathname[0]?n.pathname:"/"+n.pathname,o=0,i=r.length;o!==t&&i>=0;)"/"===r[--i]&&o++;if(o!==t)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+t+") is greater than the number of directories ("+o+") in the URL path "+e);var a=r.slice(0,i+1);return n.protocol+"//"+n.host+a},Number.isInteger}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,r),i.exports}r.y=t,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&!e;)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})();var o={};return(0,r(968).s)(1),(()=>{"use strict";r.r(o),r.d(o,{createAppState:()=>s,createGlobalStore:()=>i,getAppState:()=>u,getGlobalStore:()=>a,subscribeTo:()=>c});const e=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.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."),n.clear()}};return t=e(r,o,i),i},t=t=>t?e(t):e,n={};function i(e,r){const o=n[e];if(o)return o.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):o.value.setState(r,!0),o.active=!0,o.value;{const o=t()((()=>r));return n[e]={value:o,active:!0},o}}function a(e,r){const o=n[e];if(!o){const o=t()((()=>null!=r?r:{}));return n[e]={value:o,active:!1},o}return o.value}function s(e){return i("app",e)}function u(){return a("app",{})}function c(e,t,n){let r=t(e.getState());return e.subscribe((e=>{const o=t(e);o!==r&&(r=o,n(o))}))}})(),o})())}}}))},332:function(e){e.exports=function(){"use strict";return function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}}()},645:(e,t,n)=>{"use strict";var r=n(493);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},968:(e,t,n)=>{const r=n(577).R;t.s=function(e){if(e||(e=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=r(n.y.meta.url,e)}},577:(e,t,n)=>{t.R=function(e,t){var n=document.createElement("a");n.href=e;for(var r="/"===n.pathname[0]?n.pathname:"/"+n.pathname,o=0,i=r.length;o!==t&&i>=0;)"/"===r[--i]&&o++;if(o!==t)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+t+") is greater than the number of directories ("+o+") in the URL path "+e);var a=r.slice(0,i+1);return n.protocol+"//"+n.host+a};Number.isInteger},173:(e,t,n)=>{"use strict";var r=n(954),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,a=r.useEffect,s=r.useLayoutEffect,u=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,l=r[1];return s((function(){o.value=n,o.getSnapshot=t,c(o)&&l({inst:o})}),[e,n,t]),a((function(){return c(o)&&l({inst:o}),e((function(){c(o)&&l({inst:o})}))}),[e]),u(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:l},374:(e,t,n)=>{"use strict";e.exports=n(173)},766:e=>{"use strict";e.exports=c},824:e=>{"use strict";e.exports=r},45:e=>{"use strict";e.exports=o},728:e=>{"use strict";e.exports=i},688:e=>{"use strict";e.exports=l},64:e=>{"use strict";e.exports=s},954:e=>{"use strict";e.exports=n},493:e=>{"use strict";e.exports=a},281:e=>{"use strict";e.exports=u}},f={};function d(t){var n=f[t];if(void 0!==n)return n.exports;var r=f[t]={exports:{}};return e[t].call(r.exports,r,r.exports,d),r.exports}d.y=t,d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},d.d=(e,t)=>{for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;d.g.importScripts&&(e=d.g.location+"");var t=d.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&!e;)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),d.p=e})();var p={};return(0,d(968).s)(1),(()=>{"use strict";d.r(p),d.d(p,{ComponentContext:()=>t,ConfigurableLink:()=>o,Extension:()=>l,ExtensionSlot:()=>Et,UserHasAccess:()=>En,createUseStore:()=>a,getAsyncExtensionLifecycle:()=>Kt,getAsyncLifecycle:()=>Jt,getLifecycle:()=>Ht,getSyncLifecycle:()=>Yt,isDesktop:()=>wn,openmrsComponentDecorator:()=>qt,useAssignedExtensionIds:()=>Zt,useAssignedExtensions:()=>gt,useBodyScrollLock:()=>Qt,useConfig:()=>rn,useConnectedExtensions:()=>ht,useConnectivity:()=>m,useExtensionInternalStore:()=>mn,useExtensionSlot:()=>vt,useExtensionSlotMeta:()=>yn,useExtensionStore:()=>bn,useForceUpdate:()=>gn,useLayoutType:()=>vn,useLocations:()=>On,useOnClickOutside:()=>Sn,usePagination:()=>Pr,usePatient:()=>pn,useSession:()=>xn,useStore:()=>kn,useStoreWithActions:()=>Tn,useVisit:()=>jr,useVisitTypes:()=>_r});var e=d(954);const t=e.default.createContext({moduleName:""});var n=d(824);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(t){var{to:o,templateParams:i,children:a}=t,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["to","templateParams","children"]);return e.default.createElement("a",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}({onClick:e=>function(e,t,r){e.metaKey||e.ctrlKey||e.shiftKey||0!=e.button||(e.preventDefault(),(0,n.navigate)({to:t,templateParams:r}))}(e,o,i),href:(0,n.interpolateUrl)(o,i)},s),a)}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(t){return function(n){const[r,o]=(0,e.useState)(t.getState());(0,e.useEffect)((()=>t.subscribe((e=>o(e)))),[]);let a=(0,e.useMemo)((()=>n?function(e,t){"function"==typeof t&&(t=t(e));const n={};for(let r in t)n[r]=()=>{const n=arguments;e.setState((e=>{let o=[e];for(let e=0;e<n.length;e++)o.push(n[e]);return t[r](o)}))};return n}(t,n):{}),[n]);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){i(e,t,n[t])}))}return e}({},r,a)}}var s=d(45);function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){u(e,t,n[t])}))}return e}const l=n=>{var{state:r,children:o,wrap:i}=n,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,["state","children","wrap"]);const[u,l]=(0,e.useState)(),{extension:f}=(0,e.useContext)(t),d=(0,e.useRef)(null),p=(0,e.useRef)(null);(0,e.useEffect)((()=>{i&&console.warn(`'wrap' prop of Extension is being used ${(null==f?void 0:f.extensionId)?`by ${f.extensionId} in ${f.extensionSlotName}`:""}. This will be removed in a future release.`)}),[]);const m=(0,e.useCallback)((e=>{l(e)}),[l]);(0,e.useEffect)((()=>{if(null!=u&&f&&!d.current)return(0,s.renderExtension)(u,f.extensionSlotName,f.extensionSlotModuleName,f.extensionId,void 0,r).then((e=>{d.current=e})),()=>{if(d&&d.current)switch(d.current.getStatus()){case"MOUNTING":d.current.mountPromise.then(d.current.unmount);break;case"MOUNTED":d.current.unmount();break;case"UPDATING":p.current&&p.current.then((()=>{d.current&&"MOUNTED"===d.current.getStatus()&&d.current.unmount()}))}}}),[null==f?void 0:f.extensionSlotName,null==f?void 0:f.extensionId,null==f?void 0:f.extensionSlotModuleName,u]),(0,e.useEffect)((()=>(d.current&&d.current.update&&("MOUNTED"===d.current.getStatus()?d.current.update(c({},r)):"MOUNTING"===d.current.getStatus()&&d.current.mountPromise.then((()=>{d.current&&d.current.update&&(p.current=d.current.update(c({},r)))}))),()=>{p.current=null})),[r]);const y=e.default.createElement("div",c({ref:m,"data-extension-id":null==f?void 0:f.extensionId,style:{position:"relative"}},a));return"function"!=typeof o||e.default.isValidElement(o)?f&&i?i(y,f):y:e.default.createElement(e.default.Fragment,null,o(y,f))};var f=d(728);function m(){let[t,n]=(0,e.useState)(window.navigator.onLine);return(0,e.useEffect)((()=>(0,f.subscribeConnectivityChanged)((({online:e})=>n(e)))),[]),t}const y=function(e,t){return e===t||e!=e&&t!=t},b=function(e,t){for(var n=e.length;n--;)if(y(e[n][0],t))return n;return-1};var g=Array.prototype.splice;function h(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}h.prototype.clear=function(){this.__data__=[],this.size=0},h.prototype.delete=function(e){var t=this.__data__,n=b(t,e);return!(n<0||(n==t.length-1?t.pop():g.call(t,n,1),--this.size,0))},h.prototype.get=function(e){var t=this.__data__,n=b(t,e);return n<0?void 0:t[n][1]},h.prototype.has=function(e){return b(this.__data__,e)>-1},h.prototype.set=function(e,t){var n=this.__data__,r=b(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const v=h,w="object"==typeof global&&global&&global.Object===Object&&global;var O="object"==typeof self&&self&&self.Object===Object&&self;const S=w||O||Function("return this")(),E=S.Symbol;var j=Object.prototype,_=j.hasOwnProperty,x=j.toString,P=E?E.toStringTag:void 0;var C=Object.prototype.toString;var R=E?E.toStringTag:void 0;const k=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":R&&R in Object(e)?function(e){var t=_.call(e,P),n=e[P];try{e[P]=void 0;var r=!0}catch(e){}var o=x.call(e);return r&&(t?e[P]=n:delete e[P]),o}(e):function(e){return C.call(e)}(e)},T=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},D=function(e){if(!T(e))return!1;var t=k(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},M=S["__core-js_shared__"];var L,N=(L=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"";var A=Function.prototype.toString;const U=function(e){if(null!=e){try{return A.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var I=/^\[object .+?Constructor\]$/,F=Function.prototype,B=Object.prototype,V=F.toString,z=B.hasOwnProperty,$=RegExp("^"+V.call(z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const W=function(e){return!(!T(e)||(t=e,N&&N in t))&&(D(e)?$:I).test(U(e));var t},G=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return W(n)?n:void 0},q=G(S,"Map"),H=G(Object,"create");var J=Object.prototype.hasOwnProperty;var Y=Object.prototype.hasOwnProperty;function K(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}K.prototype.clear=function(){this.__data__=H?H(null):{},this.size=0},K.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},K.prototype.get=function(e){var t=this.__data__;if(H){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return J.call(t,e)?t[e]:void 0},K.prototype.has=function(e){var t=this.__data__;return H?void 0!==t[e]:Y.call(t,e)},K.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=H&&void 0===t?"__lodash_hash_undefined__":t,this};const Z=K,Q=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}X.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(q||v),string:new Z}},X.prototype.delete=function(e){var t=Q(this,e).delete(e);return this.size-=t?1:0,t},X.prototype.get=function(e){return Q(this,e).get(e)},X.prototype.has=function(e){return Q(this,e).has(e)},X.prototype.set=function(e,t){var n=Q(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};const ee=X;function te(e){var t=this.__data__=new v(e);this.size=t.size}te.prototype.clear=function(){this.__data__=new v,this.size=0},te.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},te.prototype.get=function(e){return this.__data__.get(e)},te.prototype.has=function(e){return this.__data__.has(e)},te.prototype.set=function(e,t){var n=this.__data__;if(n instanceof v){var r=n.__data__;if(!q||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ee(r)}return n.set(e,t),this.size=n.size,this};const ne=te;function re(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ee;++t<n;)this.add(e[t])}re.prototype.add=re.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},re.prototype.has=function(e){return this.__data__.has(e)};const oe=re,ie=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},ae=function(e,t){return e.has(t)},se=function(e,t,n,r,o,i){var a=1&n,s=e.length,u=t.length;if(s!=u&&!(a&&u>s))return!1;var c=i.get(e),l=i.get(t);if(c&&l)return c==t&&l==e;var f=-1,d=!0,p=2&n?new oe:void 0;for(i.set(e,t),i.set(t,e);++f<s;){var m=e[f],y=t[f];if(r)var b=a?r(y,m,f,t,e,i):r(m,y,f,e,t,i);if(void 0!==b){if(b)continue;d=!1;break}if(p){if(!ie(t,(function(e,t){if(!ae(p,t)&&(m===e||o(m,e,n,r,i)))return p.push(t)}))){d=!1;break}}else if(m!==y&&!o(m,y,n,r,i)){d=!1;break}}return i.delete(e),i.delete(t),d},ue=S.Uint8Array,ce=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},le=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var fe=E?E.prototype:void 0,de=fe?fe.valueOf:void 0;const pe=Array.isArray;var me=Object.prototype.propertyIsEnumerable,ye=Object.getOwnPropertySymbols;const be=ye?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}(ye(e),(function(t){return me.call(e,t)})))}:function(){return[]},ge=function(e){return null!=e&&"object"==typeof e},he=function(e){return ge(e)&&"[object Arguments]"==k(e)};var ve=Object.prototype,we=ve.hasOwnProperty,Oe=ve.propertyIsEnumerable,Se=he(function(){return arguments}())?he:function(e){return ge(e)&&we.call(e,"callee")&&!Oe.call(e,"callee")};const Ee=Se;var je="object"==typeof exports&&exports&&!exports.nodeType&&exports,_e=je&&"object"==typeof module&&module&&!module.nodeType&&module,xe=_e&&_e.exports===je?S.Buffer:void 0;const Pe=(xe?xe.isBuffer:void 0)||function(){return!1};var Ce=/^(?:0|[1-9]\d*)$/;const Re=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Ce.test(e))&&e>-1&&e%1==0&&e<t},ke=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var Te={};Te["[object Float32Array]"]=Te["[object Float64Array]"]=Te["[object Int8Array]"]=Te["[object Int16Array]"]=Te["[object Int32Array]"]=Te["[object Uint8Array]"]=Te["[object Uint8ClampedArray]"]=Te["[object Uint16Array]"]=Te["[object Uint32Array]"]=!0,Te["[object Arguments]"]=Te["[object Array]"]=Te["[object ArrayBuffer]"]=Te["[object Boolean]"]=Te["[object DataView]"]=Te["[object Date]"]=Te["[object Error]"]=Te["[object Function]"]=Te["[object Map]"]=Te["[object Number]"]=Te["[object Object]"]=Te["[object RegExp]"]=Te["[object Set]"]=Te["[object String]"]=Te["[object WeakMap]"]=!1;var De="object"==typeof exports&&exports&&!exports.nodeType&&exports,Me=De&&"object"==typeof module&&module&&!module.nodeType&&module,Le=Me&&Me.exports===De&&w.process,Ne=function(){try{return Me&&Me.require&&Me.require("util").types||Le&&Le.binding&&Le.binding("util")}catch(e){}}(),Ae=Ne&&Ne.isTypedArray;const Ue=Ae?(Ie=Ae,function(e){return Ie(e)}):function(e){return ge(e)&&ke(e.length)&&!!Te[k(e)]};var Ie,Fe=Object.prototype.hasOwnProperty;const Be=function(e,t){var n=pe(e),r=!n&&Ee(e),o=!n&&!r&&Pe(e),i=!n&&!r&&!o&&Ue(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],u=s.length;for(var c in e)!t&&!Fe.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Re(c,u))||s.push(c);return s};var Ve=Object.prototype;const ze=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object);var $e=Object.prototype.hasOwnProperty;const We=function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||Ve))return ze(e);var t,n,r=[];for(var o in Object(e))$e.call(e,o)&&"constructor"!=o&&r.push(o);return r},Ge=function(e){return null!=(t=e)&&ke(t.length)&&!D(t)?Be(e):We(e);var t},qe=function(e){return function(e,t,n){var r=t(e);return pe(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Ge,be)};var He=Object.prototype.hasOwnProperty;const Je=G(S,"DataView"),Ye=G(S,"Promise"),Ke=G(S,"Set"),Ze=G(S,"WeakMap");var Qe="[object Map]",Xe="[object Promise]",et="[object Set]",tt="[object WeakMap]",nt="[object DataView]",rt=U(Je),ot=U(q),it=U(Ye),at=U(Ke),st=U(Ze),ut=k;(Je&&ut(new Je(new ArrayBuffer(1)))!=nt||q&&ut(new q)!=Qe||Ye&&ut(Ye.resolve())!=Xe||Ke&&ut(new Ke)!=et||Ze&&ut(new Ze)!=tt)&&(ut=function(e){var t=k(e),n="[object Object]"==t?e.constructor:void 0,r=n?U(n):"";if(r)switch(r){case rt:return nt;case ot:return Qe;case it:return Xe;case at:return et;case st:return tt}return t});const ct=ut;var lt="[object Arguments]",ft="[object Array]",dt="[object Object]",pt=Object.prototype.hasOwnProperty;const mt=function(e,t,n,r,o,i){var a=pe(e),s=pe(t),u=a?ft:ct(e),c=s?ft:ct(t),l=(u=u==lt?dt:u)==dt,f=(c=c==lt?dt:c)==dt,d=u==c;if(d&&Pe(e)){if(!Pe(t))return!1;a=!0,l=!1}if(d&&!l)return i||(i=new ne),a||Ue(e)?se(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new ue(e),new ue(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return y(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=ce;case"[object Set]":var u=1&r;if(s||(s=le),e.size!=t.size&&!u)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var l=se(s(e),s(t),r,o,i,a);return a.delete(e),l;case"[object Symbol]":if(de)return de.call(e)==de.call(t)}return!1}(e,t,u,n,r,o,i);if(!(1&n)){var p=l&&pt.call(e,"__wrapped__"),m=f&&pt.call(t,"__wrapped__");if(p||m){var b=p?e.value():e,g=m?t.value():t;return i||(i=new ne),o(b,g,n,r,i)}}return!!d&&(i||(i=new ne),function(e,t,n,r,o,i){var a=1&n,s=qe(e),u=s.length;if(u!=qe(t).length&&!a)return!1;for(var c=u;c--;){var l=s[c];if(!(a?l in t:He.call(t,l)))return!1}var f=i.get(e),d=i.get(t);if(f&&d)return f==t&&d==e;var p=!0;i.set(e,t),i.set(t,e);for(var m=a;++c<u;){var y=e[l=s[c]],b=t[l];if(r)var g=a?r(b,y,l,t,e,i):r(y,b,l,e,t,i);if(!(void 0===g?y===b||o(y,b,n,r,i):g)){p=!1;break}m||(m="constructor"==l)}if(p&&!m){var h=e.constructor,v=t.constructor;h==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof h&&h instanceof h&&"function"==typeof v&&v instanceof v||(p=!1)}return i.delete(e),i.delete(t),p}(e,t,n,r,o,i))},yt=function e(t,n,r,o,i){return t===n||(null==t||null==n||!ge(t)&&!ge(n)?t!=t&&n!=n:mt(t,n,r,o,e,i))},bt=function(e,t){return yt(e,t)};function gt(t){const[n,r]=(0,e.useState)([]);return(0,e.useEffect)((()=>{function e(e){var o,i;const a=null!==(i=null===(o=e.slots[t])||void 0===o?void 0:o.assignedExtensions)&&void 0!==i?i:[];bt(a,n)||r(a)}return e((0,s.getExtensionStore)().getState()),(0,s.getExtensionStore)().subscribe(e)}),[t,n]),n}function ht(t){const n=m(),r=gt(t);return(0,e.useMemo)((()=>(0,s.getConnectedExtensions)(r,n)),[r,n])}function vt(n){const{moduleName:r}=(0,e.useContext)(t);if(!r)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,e.useEffect)((()=>{(0,s.registerExtensionSlot)(r,n)}),[]),{extensions:ht(n),extensionSlotName:n,extensionSlotModuleName:r}}function wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){wt(e,t,n[t])}))}return e}function St(e){return e}function Et(n){var{name:r,extensionSlotName:o,select:i=St,children:a,state:s,style:u}=n,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,["name","extensionSlotName","select","children","state","style"]);if(a&&s)throw new Error("Both children and state have been provided. If children are provided, the state must be passed as a prop to the `Extension` component.");const f=null!=r?r:o,d=(0,e.useRef)(null),{extensions:p,extensionSlotModuleName:m}=vt(f),y=(0,e.useMemo)((()=>i(p)),[i,p]),b=(0,e.useMemo)((()=>{if("function"==typeof a&&!e.default.isValidElement(a))return y.map((e=>a(e)))}),[a,y]);var g,h,v,w;return e.default.createElement("div",Ot({ref:d,"data-extension-slot-name":f,"data-extension-slot-module-name":m,style:(v=Ot({},u),w={position:"relative"},w=null!=w?w:{},Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(w)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(w)).forEach((function(e){Object.defineProperty(v,e,Object.getOwnPropertyDescriptor(w,e))})),v)},c),f&&y.map(((n,r)=>e.default.createElement(t.Provider,{key:n.id,value:{moduleName:m,extension:{extensionId:n.id,extensionSlotName:f,extensionSlotModuleName:m}}},null!==(h=null!==(g=null==b?void 0:b[r])&&void 0!==g?g:"function"!=typeof a?a:null)&&void 0!==h?h:e.default.createElement(l,{state:s})))))}var jt=d(645);function _t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_t(Object(n),!0).forEach((function(t){Ct(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pt(e){return(Pt="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)}function Ct(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rt(e){return(Rt="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)}function kt(e,t){var n;if("function"!=typeof(n=t.domElement?function(){return t.domElement}:t.domElementGetter?t.domElementGetter:e.domElementGetter?e.domElementGetter:function(e){var t=e.appName||e.name;if(!t)throw Error("single-spa's dom-element-getter-helpers was not given an application name as a prop, so it can't make a unique dom element container for the react application");var n="single-spa-application:".concat(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)))throw Error("single-spa's dom-element-getter-helpers was given an invalid domElementGetter for application or parcel '".concat(t.name,"'. Expected a function, received ").concat(Rt(n)));return function(){var e=n(t);if(!(e instanceof HTMLElement))throw Error("single-spa's dom-element-getter-helpers: domElementGetter returned an invalid dom element for application or parcel '".concat(t.name,"'. Expected HTMLElement, received ").concat(Rt(e)));return e}}var Tt=null;try{Tt=require("react").createContext()}catch(_t){}var Dt={React:null,ReactDOM:null,ReactDOMClient:null,rootComponent:null,loadRootComponent:null,renderType:"createRoot",errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{},unmountResolves:{}};function Mt(e){if("object"!==Pt(e))throw new Error("single-spa-react requires a configuration object");var t=xt(xt({},Dt),e);if(!t.React)throw new Error("single-spa-react must be passed opts.React");if(!t.ReactDOM&&!t.ReactDOMClient)throw new Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(!t.rootComponent&&!t.loadRootComponent)throw new Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(t.errorBoundary&&"function"!=typeof t.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!Tt&&t.React.createContext&&(Tt=t.React.createContext()),t.SingleSpaRoot=function(e){function t(e){t.displayName="SingleSpaRoot(".concat(e.name,")")}return t.prototype=Object.create(e.React.Component.prototype),t.prototype.componentDidMount=function(){setTimeout(this.props.mountFinished)},t.prototype.componentWillUnmount=function(){setTimeout(this.props.unmountFinished)},t.prototype.render=function(){return setTimeout(this.props.updateFinished),this.props.children},t}(t);var n={bootstrap:Lt.bind(null,t),mount:Nt.bind(null,t),unmount:At.bind(null,t)};return t.parcelCanUpdate&&(n.update=Ut.bind(null,t)),n}function Lt(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then((function(t){e.rootComponent=t}))}function Nt(e,t){return new Promise((function(n,r){e.suppressComponentDidCatchWarning||!function(e){if(!(e&&"string"==typeof e.version&&e.version.indexOf(".")>=0))return!1;var t=e.version.slice(0,e.version.indexOf("."));try{return Number(t)>=16}catch(e){return!1}}(e.React)||e.errorBoundary||e.errorBoundaryClass||(e.rootComponent.prototype?e.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var o=Bt(e,t,(function(){n(this)})),i=kt(e,t)(),a=function(e){var t=e.renderType,n=e.elementToRender,r=e.domElement,o=e.reactDom[t];if("function"!=typeof o)throw new Error('renderType "'.concat(t,'" did not return a function.'));switch(t){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var i=o(r);return i.render(n),i;case"hydrateRoot":return o(r,n);default:return o(n,r),null}}({elementToRender:o,domElement:i,reactDom:It(e),renderType:Ft(e)});e.domElements[t.name]=i,e.renderResults[t.name]=a}))}function At(e,t){return new Promise((function(n){e.unmountResolves[t.name]=n;var r=e.renderResults[t.name];r&&r.unmount?r.unmount():It(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]}))}function Ut(e,t){return new Promise((function(n){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(n);var r=Bt(e,t,null),o=e.renderResults[t.name];if(o&&o.render)o.render(r);else{var i=kt(e,t)();It(e).render(r,i)}}))}function It(e){return e.ReactDOMClient||e.ReactDOM}function Ft(e){return"function"==typeof e.renderType?e.renderType():e.renderType}function Bt(e,t,n){var r=e.React.createElement(e.rootComponent,t),o=Tt?e.React.createElement(Tt.Provider,{value:t},r):r;return(e.errorBoundary||t.errorBoundary||e.errorBoundaryClass||t.errorBoundaryClass)&&(e.errorBoundaryClass=e.errorBoundaryClass||t.errorBoundaryClass||function(e,t){function n(t){e.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},n.displayName="SingleSpaReactErrorBoundary(".concat(t.name,")")}return n.prototype=Object.create(e.React.Component.prototype),n.prototype.render=function(){return this.state.caughtError?(e.errorBoundary||t.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},n.prototype.componentDidCatch=function(e,t){this.setState({caughtError:e,caughtErrorInfo:t})},n}(e,t),o=e.React.createElement(e.errorBoundaryClass,t,o)),e.React.createElement(e.SingleSpaRoot,xt(xt({},t),{},{mountFinished:n,updateFinished:function(){e.updateResolves[t.name]&&(e.updateResolves[t.name].forEach((function(e){return e()})),delete e.updateResolves[t.name])},unmountFinished:function(){e.unmountResolves[t.name]&&(e.unmountResolves[t.name](),delete e.unmountResolves[t.name])}}),o)}var Vt=d(64),zt=d(281);const $t=Vt.default.default||Vt.default,Wt={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},Gt=t=>{(0,e.useEffect)((()=>($t.on("languageChanged",t.forceUpdate),()=>$t.off("languageChanged",t.forceUpdate))),[t.forceUpdate]);const n=(0,e.useRef)(null);if(n.current)throw n.current;if(!$t.hasLoadedNamespace(t.ns)){const e=setTimeout((()=>{console.warn(`openmrsComponentDecorator: the React suspense promise for i18next.loadNamespaces(['${t.ns}']) did not resolve nor reject after three seconds. This could mean you have multiple versions of i18next and haven't made i18next a webpack external in all projects.`)}),3e3);throw $t.loadNamespaces([t.ns]).then((()=>clearTimeout(e))).catch((t=>{clearTimeout(e),n.current=t}))}return e.default.createElement(e.default.Fragment,null,t.children)};function qt(n){if("object"!=typeof n||"string"!=typeof n.featureName||"string"!=typeof n.moduleName)throw new Error("Invalid options");const r=Object.assign({},Wt,n);return function(n){var o,i,a,s;return i=o=class extends e.default.Component{componentDidCatch(e,t){t&&t.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:t.componentStack})),r.throwErrorsToConsole&&setTimeout((()=>{throw e})),this.setState({caughtError:e,caughtErrorInfo:t})}render(){if(this.state.caughtError)return e.default.createElement("div",null,"An error has occurred. Please try reloading the page.");{const o=e.default.createElement(t.Provider,{value:this.state.config},e.default.createElement(e.default.Suspense,{fallback:null},r.disableTranslations?e.default.createElement(n,this.props):e.default.createElement(Gt,{ns:r.moduleName,forceUpdate:()=>this.forceUpdate()},e.default.createElement(zt.I18nextProvider,{i18n:$t,defaultNS:r.moduleName},e.default.createElement(n,this.props)))));return r.strictMode||!e.default.StrictMode?o:e.default.createElement(e.default.StrictMode,null,o)}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:r.moduleName,extension:e._extensionContext}}}},a="displayName",s=`OpenmrsReactComponent(${r.featureName})`,a in i?Object.defineProperty(i,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[a]=s,o}}function Ht(t,n){return Mt({React:e.default,ReactDOMClient:jt,rootComponent:qt(n)(t)})}function Jt(e,t){return()=>e().then((({default:e})=>Ht(e,t)))}function Yt(e,t){return()=>Promise.resolve(Ht(e,t))}const Kt=Jt;function Zt(t){const[n,r]=(0,e.useState)([]);return(0,e.useEffect)((()=>(0,s.getExtensionStore)().subscribe((e=>{var o,i;const a=null!==(i=null===(o=e.slots[t])||void 0===o?void 0:o.assignedExtensions.map((e=>e.id)))&&void 0!==i?i:[];bt(a,n)||r(a)}))),[]),n}function Qt(t){(0,e.useEffect)((()=>{if(t){const e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}}),[t])}function Xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const en={},tn='No ComponentContext has been provided. This should come from "openmrsComponentDecorator".\nUsually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".';function nn(t){const r=(0,e.useMemo)(n.getExtensionsConfigStore,[]),o=function(t,r){const[o,i]=(0,e.useState)(function(e,t){return t?()=>{const r=e.getState(),o=(0,n.getExtensionConfigFromStore)(r,t.extensionSlotName,t.extensionId);if(o.loaded&&o.config)return o.config}:null}(t,r));return(0,e.useEffect)((()=>{if(r)return t.subscribe((e=>{const t=(0,n.getExtensionConfigFromStore)(e,r.extensionSlotName,r.extensionId);t.loaded&&t.config&&!bt(t.config,o)&&i(t.config)}))}),[t,r,o]),o}(r,t);if(!o&&t){const e=`${t.extensionSlotName}-${t.extensionId}`;throw!en[e]&&r&&(en[e]=function(e,t){return new Promise((r=>{const o=e.subscribe((e=>{const i=(0,n.getExtensionConfigFromStore)(e,t.extensionSlotName,t.extensionId);i.loaded&&i.config&&(r(i.config),o())}))}))}(r,t)),en[e]}return o||{}}function rn(){const{moduleName:r,extension:o}=(0,e.useContext)(t);if(!r&&!o)throw Error(tn);const i=function(t){const r=(0,e.useMemo)((()=>(0,n.getConfigStore)(t)),[t]),o=t,i=function(t){const[n,r]=(0,e.useState)(function(e){return()=>{const t=e.getState();return t.loaded&&t.config?t.config:null}}(t));return(0,e.useEffect)((()=>null==t?void 0:t.subscribe((e=>{e.loaded&&e.config&&r(e.config)}))),[t]),n}(r);if(!i)throw en[o]||(en[o]=function(e){return new Promise((t=>{const n=e.subscribe((e=>{e.loaded&&e.config&&(t(e.config),n())}))}))}(r)),en[o];return i}(r),a=nn(o),s=(0,e.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Xt(e,t,n[t])}))}return e}({},i,a)),[i,a]);return s}var on,an=d(766);function sn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function un(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){sn(e,t,n[t])}))}return e}function cn(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}!function(e){e.loadPatient="loadPatient",e.newPatient="newPatient",e.loadError="patientLoadError"}(on||(on={}));const ln={patientUuid:null,patient:null,isPendingUuid:!0,isLoadingPatient:!1,err:null};function fn(){const e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function dn(e,t){switch(t.type){case on.loadPatient:return cn(un({},e),{patientUuid:t.patientUuid,patient:null,isPendingUuid:!1,isLoadingPatient:!0,err:null});case on.newPatient:return cn(un({},e),{patient:t.patient,isPendingUuid:!1,isLoadingPatient:!1,err:null});case on.loadError:return cn(un({},e),{patient:null,isPendingUuid:!1,isLoadingPatient:!1,err:t.err});default:return e}}function pn(t){const[n,r]=(0,e.useReducer)(dn,cn(un({},ln),{patientUuid:null!=t?t:null,isPendingUuid:!t,isLoadingPatient:!!t}));return(0,e.useEffect)((()=>{if(n.isPendingUuid){const e=fn();r(e?{type:on.loadPatient,patientUuid:e}:{type:on.newPatient,patient:null})}let e=!0;return n.isLoadingPatient&&n.patientUuid&&(0,an.fetchCurrentPatient)(n.patientUuid).then((t=>e&&r({patient:t,type:on.newPatient})),(t=>e&&r({err:t,type:on.loadError}))),()=>{e=!1}}),[n.isPendingUuid,n.isLoadingPatient,n.patientUuid]),(0,e.useEffect)((()=>{const e=e=>{const t=fn();t!=n.patientUuid&&r({type:on.loadPatient,patientUuid:t})};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)}),[n.patientUuid]),{isLoading:n.isPendingUuid||n.isLoadingPatient,patient:n.patient,patientUuid:null!=t?t:n.patientUuid,error:n.err}}const mn=a((0,s.getExtensionInternalStore)());function yn(t){const n=ht(t);return(0,e.useMemo)((()=>Object.fromEntries(n.map((e=>[e.name,e.meta])))),[n])}const bn=a((0,s.getExtensionStore)());function gn(){const[,t]=(0,e.useState)(0);return(0,e.useCallback)((()=>{t((e=>e+1))}),[])}function hn(){let e="tablet";return document.body.classList.forEach((t=>{switch(t){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 vn(){const[t,n]=(0,e.useState)(hn);return(0,e.useEffect)((()=>{const e=()=>{n(hn())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),t}const wn=e=>"small-desktop"===e||"large-desktop"===e;function On(){const[t,n]=(0,e.useState)([]);return(0,e.useEffect)((()=>{const e=(0,an.getLocations)().subscribe((e=>{n(e)}),(e=>{console.error(e)}));return()=>e.unsubscribe()}),[]),t}function Sn(t,n=!0){const r=(0,e.useRef)(null);return(0,e.useEffect)((()=>{if(n){const e=e=>{var n;(null==r||null===(n=r.current)||void 0===n?void 0:n.contains(e.target))||t(e)};return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}}),[t,n]),r}const En=({privilege:t,fallback:n,children:r})=>{const[o,i]=(0,e.useState)(null);return(0,e.useEffect)((()=>{const e=(0,an.getCurrentUser)({includeAuthStatus:!1}).subscribe(i);return()=>e.unsubscribe()}),[]),o&&(0,an.userHasAccess)(t,o)?e.default.createElement(e.default.Fragment,null,r):n?e.default.createElement(e.default.Fragment,null,n):null};let jn,_n;function xn(){const[t,n]=(0,e.useState)(null);let r=null;if(!t){if(jn){const e=(0,an.getSessionStore)().getState();e.loaded&&(r=e.session)}else jn=new Promise((e=>{const t=({loaded:t,session:n})=>{t&&(e(n),r=n,_n&&_n(),_n=void 0)};t((0,an.getSessionStore)().getState()),r||(_n=(0,an.getSessionStore)().subscribe(t))}));if(!r)throw jn;n(r)}(0,e.useEffect)((()=>(_n||(_n=(0,an.getSessionStore)().subscribe((({loaded:e,session:t})=>{e&&(r=t,n(t))}))),()=>{_n&&_n(),_n=void 0})),[]);const o=t||r;if(!o)throw jn?(console.warn("useSession is in an unexpected state. Attempting to recover."),jn):Error("useSession is in an invalid state.");return o}var Pn=d(403);function Cn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Rn=e=>e;function kn(t,n=Rn,r){const[o,i]=(0,e.useState)((()=>n(t.getState())));(0,e.useEffect)((()=>(0,Pn.subscribeTo)(t,n,i)),[t,n]);let a=(0,e.useMemo)((()=>r?function(e,t){"function"==typeof t&&(t=t(e));const n={};for(let r in t)n[r]=()=>{const n=arguments;e.setState((e=>{let o=[e];for(let e=0;e<n.length;e++)o.push(n[e]);return t[r](...o)}))};return n}(t,r):{}),[t,r]);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Cn(e,t,n[t])}))}return e}({},o,a)}function Tn(e,t){return kn(e,Rn,t)}var Dn=d(374);const Mn=new WeakMap,Ln={},Nn=()=>{},An=Nn(),Un=Object,In=e=>e===An,Fn=e=>"function"==typeof e,Bn=(e,t)=>({...e,...t}),Vn="undefined",zn=typeof window!=Vn,$n=typeof document!=Vn,Wn=(e,t)=>{const n=Mn.get(e);return[()=>e.get(t)||Ln,r=>{const o=e.get(t);n[5](t,Bn(o,r),o||Ln)},n[6]]},Gn=new WeakMap;let qn=0;const Hn=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(Un(e)!==e||r||n==RegExp)o=r?e.toJSON():"symbol"==t?e.toString():"string"==t?JSON.stringify(e):""+e;else{if(o=Gn.get(e),o)return o;if(o=++qn+"~",Gn.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=Hn(e[i])+",";Gn.set(e,o)}if(n==Un){o="#";const t=Un.keys(e).sort();for(;!In(i=t.pop());)In(e[i])||(o+=i+":"+Hn(e[i])+",");Gn.set(e,o)}}return o};let Jn=!0;const[Yn,Kn]=zn&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Nn,Nn],Zn={isOnline:()=>Jn,isVisible:()=>{const e=$n&&document.visibilityState;return In(e)||"hidden"!==e}},Qn={initFocus:e=>($n&&document.addEventListener("visibilitychange",e),Yn("focus",e),()=>{$n&&document.removeEventListener("visibilitychange",e),Kn("focus",e)}),initReconnect:e=>{const t=()=>{Jn=!0,e()},n=()=>{Jn=!1};return Yn("online",t),Yn("offline",n),()=>{Kn("online",t),Kn("offline",n)}}},Xn=!e.default.useId,er=!zn||"Deno"in window,tr=er?e.useEffect:e.useLayoutEffect,nr="undefined"!=typeof navigator&&navigator.connection,rr=!er&&nr&&(["slow-2g","2g"].includes(nr.effectiveType)||nr.saveData),or=e=>{if(Fn(e))try{e=e()}catch(t){e=""}const t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?Hn(e):"",t]};let ir=0;const ar=()=>++ir;async function sr(...e){const[t,n,r,o]=e,i=Bn({populateCache:!0,throwOnError:!0},"boolean"==typeof o?{revalidate:o}:o||{});let a=i.populateCache;const s=i.rollbackOnError;let u=i.optimisticData;const c=!1!==i.revalidate,l=i.throwOnError;if(Fn(n)){const e=n,r=[],o=t.keys();for(let n=o.next();!n.done;n=o.next()){const o=n.value;!o.startsWith("$inf$")&&e(t.get(o)._k)&&r.push(o)}return Promise.all(r.map(f))}return f(n);async function f(n){const[o]=or(n);if(!o)return;const[i,f]=Wn(t,o),[d,p,m]=Mn.get(t),y=d[o],b=()=>c&&(delete m[o],y&&y[0])?y[0](2).then((()=>i().data)):i().data;if(e.length<3)return b();let g,h=r;const v=ar();p[o]=[v,0];const w=!In(u),O=i(),S=O.data,E=O._c,j=In(E)?S:E;if(w&&(u=Fn(u)?u(j):u,f({data:u,_c:j})),Fn(h))try{h=h(j)}catch(e){g=e}if(h&&Fn(h.then)){if(h=await h.catch((e=>{g=e})),v!==p[o][0]){if(g)throw g;return h}g&&w&&(e=>"function"==typeof s?s(e):!1!==s)(g)&&(a=!0,h=j,f({data:h,_c:An}))}a&&(g||(Fn(a)&&(h=a(h,j)),f({data:h,_c:An}))),p[o][1]=ar();const _=await b();if(f({_c:An}),!g)return a?_:h;if(l)throw g}}const ur=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},cr=(e,t)=>{if(!Mn.has(e)){const n=Bn(Qn,t),r={},o=sr.bind(An,e);let i=Nn;const a={},s=(e,t)=>{const n=a[e]||[];return a[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},u=(t,n,r)=>{e.set(t,n);const o=a[t];if(o)for(let e=o.length;e--;)o[e](r,n)},c=()=>{if(!Mn.has(e)&&(Mn.set(e,[r,{},{},{},o,u,s]),!er)){const t=n.initFocus(setTimeout.bind(An,ur.bind(An,r,0))),o=n.initReconnect(setTimeout.bind(An,ur.bind(An,r,1)));i=()=>{t&&t(),o&&o(),Mn.delete(e)}}};return c(),[e,o,c,i]}return[e,Mn.get(e)[4]]},[lr,fr]=cr(new Map),dr=Bn({onLoadingSlow:Nn,onSuccess:Nn,onError:Nn,onErrorRetry:(e,t,n,r,o)=>{const i=n.errorRetryCount,a=o.retryCount,s=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!In(i)&&a>i||setTimeout(r,s,o)},onDiscarded:Nn,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:rr?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:rr?5e3:3e3,compare:(e,t)=>Hn(e)==Hn(t),isPaused:()=>!1,cache:lr,mutate:fr,fallback:{}},Zn),pr=(e,t)=>{const n=Bn(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:a}=t;r&&i&&(n.use=r.concat(i)),o&&a&&(n.fallback=Bn(o,a))}return n},mr=(0,e.createContext)({}),yr=zn&&window.__SWR_DEVTOOLS_USE__,br=yr?window.__SWR_DEVTOOLS_USE__:[],gr=br.concat((e=>(t,n,r)=>e(t,n&&((...e)=>{const r=or(t)[0],[,,,o]=Mn.get(lr),i=o[r];return i?(delete o[r],i):n(...e)}),r)));yr&&(window.__SWR_DEVTOOLS_REACT__=e.default);const hr={dedupe:!0};Un.defineProperty((t=>{const{value:n}=t,r=(0,e.useContext)(mr),o=Fn(n),i=(0,e.useMemo)((()=>o?n(r):n),[o,r,n]),a=(0,e.useMemo)((()=>o?i:pr(r,i)),[o,r,i]),s=i&&i.provider,[u]=(0,e.useState)((()=>s?cr(s(a.cache||lr),i):An));return u&&(a.cache=u[0],a.mutate=u[1]),tr((()=>{if(u)return u[2]&&u[2](),u[3]}),[]),(0,e.createElement)(mr.Provider,Bn(t,{value:a}))}),"defaultValue",{value:dr});var vr,wr=(vr=(t,n,r)=>{const{cache:o,compare:i,suspense:a,fallbackData:s,revalidateOnMount:u,refreshInterval:c,refreshWhenHidden:l,refreshWhenOffline:f,keepPreviousData:d}=r,[p,m,y]=Mn.get(o),[b,g]=or(t),h=(0,e.useRef)(!1),v=(0,e.useRef)(!1),w=(0,e.useRef)(b),O=(0,e.useRef)(n),S=(0,e.useRef)(r),E=()=>S.current,j=()=>E().isVisible()&&E().isOnline(),[_,x,P]=Wn(o,b),C=(0,e.useRef)({}).current,R=In(s)?r.fallback[b]:s,k=(e,t)=>{let n=!0;for(const r in C){const o=r;i(t[o],e[o])||"data"===o&&In(e[o])&&i(t[o],I)||(n=!1)}return n},T=(0,e.useMemo)((()=>{const e=!!b&&!!n&&(In(u)?!E().isPaused()&&!a:u),t=()=>{const t=_(),n=Bn(t);return delete n._k,e?{isValidating:!0,isLoading:!0,...n}:n};let r=t();return()=>{const e=t();return k(e,r)?r:r=e}}),[o,b]),D=(0,Dn.useSyncExternalStore)((0,e.useCallback)((e=>P(b,((t,n)=>{k(t,n)||e()}))),[o,b]),T,T),M=!h.current,L=D.data,N=In(L)?R:L,A=D.error,U=(0,e.useRef)(N),I=d?In(L)?U.current:L:N,F=M&&!In(u)?u:!E().isPaused()&&(a?!In(N)&&r.revalidateIfStale:In(N)||r.revalidateIfStale),B=!!(b&&n&&M&&F),V=In(D.isValidating)?B:D.isValidating,z=In(D.isLoading)?B:D.isLoading,$=(0,e.useCallback)((async e=>{const t=O.current;if(!b||!t||v.current||E().isPaused())return!1;let n,o,a=!0;const s=e||{},u=!y[b]||!s.dedupe,c=()=>Xn?!v.current&&b===w.current&&h.current:b===w.current,l={isValidating:!1,isLoading:!1},f=()=>{x(l)},d=()=>{const e=y[b];e&&e[1]===o&&delete y[b]},p={isValidating:!0};In(_().data)&&(p.isLoading=!0);try{if(u&&(x(p),r.loadingTimeout&&In(_().data)&&setTimeout((()=>{a&&c()&&E().onLoadingSlow(b,r)}),r.loadingTimeout),y[b]=[t(g),ar()]),[n,o]=y[b],n=await n,u&&setTimeout(d,r.dedupingInterval),!y[b]||y[b][1]!==o)return u&&c()&&E().onDiscarded(b),!1;l.error=An;const e=m[b];if(!In(e)&&(o<=e[0]||o<=e[1]||0===e[1]))return f(),u&&c()&&E().onDiscarded(b),!1;const s=_().data;l.data=i(s,n)?s:n,u&&c()&&E().onSuccess(n,b,r)}catch(e){d();const t=E(),{shouldRetryOnError:n}=t;t.isPaused()||(l.error=e,u&&c()&&(t.onError(e,b,t),(!0===n||Fn(n)&&n(e))&&j()&&t.onErrorRetry(e,b,t,$,{retryCount:(s.retryCount||0)+1,dedupe:!0})))}return a=!1,f(),!0}),[b,o]),W=(0,e.useCallback)(((...e)=>sr(o,w.current,...e)),[]);if(tr((()=>{O.current=n,S.current=r,In(L)||(U.current=L)})),tr((()=>{if(!b)return;const e=$.bind(An,hr);let t=0;const n=((e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}})(b,p,(n=>{if(0==n){const n=Date.now();E().revalidateOnFocus&&n>t&&j()&&(t=n+E().focusThrottleInterval,e())}else if(1==n)E().revalidateOnReconnect&&j()&&e();else if(2==n)return $()}));return v.current=!1,w.current=b,h.current=!0,x({_k:g}),F&&(In(N)||er?e():(e=>{zn&&typeof window.requestAnimationFrame!=Vn?window.requestAnimationFrame(e):setTimeout(e,1)})(e)),()=>{v.current=!0,n()}}),[b]),tr((()=>{let e;function t(){const t=Fn(c)?c(N):c;t&&-1!==e&&(e=setTimeout(n,t))}function n(){_().error||!l&&!E().isVisible()||!f&&!E().isOnline()?t():$(hr).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[c,l,f,b]),(0,e.useDebugValue)(I),a&&In(N)&&b){if(!Xn&&er)throw new Error("Fallback data is required when using suspense in SSR.");throw O.current=n,S.current=r,v.current=!1,In(A)?$(hr):A}return{mutate:W,get data(){return C.data=!0,I},get error(){return C.error=!0,A},get isValidating(){return C.isValidating=!0,V},get isLoading(){return C.isLoading=!0,z}}},function(...t){const n=Bn(dr,(0,e.useContext)(mr)),[r,o,i]=(e=>Fn(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}])(t),a=pr(n,i);let s=vr;const{use:u}=a,c=(u||[]).concat(gr);for(let e=c.length;e--;)s=c[e](s);return s(r,o||a.fetcher||null,a)}),Or=d(688),Sr=d(332),Er=d.n(Sr);function jr(t){const{data:n,error:r,mutate:o,isValidating:i}=wr(t?`/ws/rest/v1/visit?patient=${t}&v=${an.defaultVisitCustomRepresentation}&includeInactive=false`:null,an.openmrsFetch);var a;return{error:r,mutate:o,isValidating:i,currentVisit:(0,e.useMemo)((()=>null!==(a=null==n?void 0:n.data.results.find((e=>null===e.stopDatetime)))&&void 0!==a?a:null),[null==n?void 0:n.data.results]),isLoading:!n&&!r}}function _r(){const[t,n]=(0,e.useState)([]);return(0,e.useEffect)((()=>{const e=(0,an.getVisitTypes)().subscribe((e=>{n(e)}),(e=>console.error(e)));return()=>e.unsubscribe()}),[]),t}Or.default.extend(Er());const xr=10;function Pr(t=[],n=xr){const[r,o]=(0,e.useState)(1),i=(0,e.useMemo)((()=>"number"==typeof n&&n>0?Math.max(1,Math.ceil(t.length/n)):1),[t.length,n]);return{results:(0,e.useMemo)((()=>{const e=(r-1)*n,o=(r+0)*n;return t.slice(e,o)}),[t,r,n]),totalPages:i,currentPage:r,paginated:t.length>n,showNextButton:r<i,showPreviousButton:r>1,goTo(e){o(Math.max(1,Math.min(i,e)))},goToNext(){r<i&&o(r+1)},goToPrevious(){r>1&&o(r-1)}}}})(),p})())}}}));
3
3
  //# sourceMappingURL=openmrs-esm-react-utils.js.map