UNPKG

@kenyaemr/esm-dispensing-app

Version:
2 lines 639 kB
/*! For license information please see 800.js.LICENSE.txt */ (globalThis.webpackChunk_kenyaemr_esm_dispensing_app=globalThis.webpackChunk_kenyaemr_esm_dispensing_app||[]).push([[800],{5666:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,i=Object.create(o.prototype),a=new C(r||[]);return i._invoke=function(e,t,n){var r=f;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return A()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=x(a,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=l(e,t,n);if("normal"===c.type){if(r=n.done?h:d,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var f="suspendedStart",d="suspendedYield",p="executing",h="completed",y={};function v(){}function b(){}function m(){}var g={};c(g,i,(function(){return this}));var w=Object.getPrototypeOf,S=w&&w(w(k([])));S&&S!==n&&r.call(S,i)&&(g=S);var O=m.prototype=v.prototype=Object.create(g);function _(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(o,i,a,u){var c=l(e[o],e,i);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(f).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function x(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method))return y;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=l(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function k(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:A}}function A(){return{value:t,done:!0}}return b.prototype=m,c(O,"constructor",m),c(m,"constructor",b),b.displayName=c(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},e.awrap=function(e){return{__await:e}},_(E.prototype),c(E.prototype,a,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new E(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(O),c(O,u,"Generator"),c(O,i,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=k,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},154:(e,t,n)=>{function r(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var o=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};System.register(["@openmrs/esm-config","@openmrs/esm-error-handling","@openmrs/esm-offline"],(function(e,t){var i={},a={},u={};return{setters:[function(e){i.Type=e.Type,i.defineConfigSchema=e.defineConfigSchema,i.getConfig=e.getConfig,i.navigate=e.navigate,i.validators=e.validators},function(e){a.reportError=e.reportError},function(e){u.getSynchronizationItems=e.getSynchronizationItems}],execute:function(){e(function(){var e={385:function(){System.register([],(function(e,t){return{execute:function(){e(function(){"use strict";var e=function(e,t){var n=u[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;var r=a()((function(){return t}));return u[e]={value:r,active:!0},r},t=function(e,t){var n=u[e];if(!n){var r=a()((function(){return null!=t?t:{}}));return u[e]={value:r,active:!1},r}return n.value},n=function(e,t,n){var r=t(e.getState());return e.subscribe((function(e){var o=t(e);o!==r&&(r=o,n(o))}))},r={d:function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};r.r(o),r.d(o,{createGlobalStore:function(){return e},getGlobalStore:function(){return t},subscribeTo:function(){return n}});var i=function(e){var t,n=new Set,r=function(e,r){var o="function"==typeof e?e(t):e;if(!Object.is(o,t)){var i=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((function(e){return e(t,i)}))}},o=function(){return t},i={setState:r,getState:o,subscribe:function(e){return n.add(e),function(){return n.delete(e)}},destroy:function(){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},a=function(e){return e?i(e):i},u={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=u)}),1e3),o}())}}}))},824:function(e){"use strict";e.exports=i},254:function(e){"use strict";e.exports=a},738:function(e){"use strict";e.exports=u}},t={};function c(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,c),o.exports}c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return function(){"use strict";var e=function(e,t){function n(){this.constructor=e}Y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},t=function(e){return"function"==typeof e},i=function(e){setTimeout((function(){throw e}),0)},a=function(e){return e.reduce((function(e,t){return e.concat(r(t,ee)?t.errors:t)}),[])},u=function(e){return e},l=function(e){if(e||(e=X.Promise||Promise),!e)throw new Error("no Promise impl found");return e},f=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},d=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},p=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},h=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},y=function(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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.");var n=y(e);if(t.headers||(t.headers={}),Oe(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(Ce)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(ke)){var r=new URL(n,window.location.toString());r.searchParams.has("_summary")||(r.searchParams.set("_summary","data"),n=r.toString())}var o,i,a=Error();return window.fetch(n,t).then((o=function(e){var t,r;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(o){switch(o.label){case 0:return(t=e).ok?204===t.status?(t.data=null,[2,t]):[2,t.clone().text().then((function(e){try{e&&(t.data=JSON.parse(e))}catch(e){}return t}))]:[3,1];case 1:return[4,(0,_e.getConfig)("@openmrs/esm-api")];case 2:return r=o.sent().redirectAuthFailure,n===y(Ae)&&403===t.status||r.enabled&&r.errors.includes(t.status)?((0,_e.navigate)({to:r.url}),[2,r.resolvePromise?Promise.resolve():new Promise((function(){}))]):[2,t.clone().text().then((function(e){var r=e;try{r=JSON.parse(e)}catch(e){}throw new Te(n,t,r,a)}),(function(e){throw new Te(n,t,null,a)}))];case 3:return[2]}}))},i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){d(i,n,r,a,u,"next",e)}function u(e){d(i,n,r,a,u,"throw",e)}a(void 0)}))},function(e){return i.apply(this,arguments)}))},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");var n=new AbortController;return t.signal=n.signal,new ae((function(r){var o=!1;return v(e,t).then((function(e){o=!0,r.next(e),r.complete()}),(function(e){o=!0,r.error(e)})),function(){o||n.abort()}}))},m=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeAuthStatus:!0};return(Ne<Date.now()-6e4||!Re.getState().loaded)&&O(),new ae((function(t){var n=function(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(Re.getState()),Re.subscribe(n)}))},w=function(){return(Ne<Date.now()-6e4||!Re.getState().loaded)&&O(),Re},S=function(e){var t,n,r,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,i=document.documentElement.getAttribute("lang");(function(e){if(void 0===e||"string"!=typeof e)return!1;try{new Intl.Locale(e)}catch(e){return!1}return!0})(o)&&o!==i&&document.documentElement.setAttribute("lang",o)},O=function(){return new Promise((function(e,t){Ne=Date.now(),v(Ae).then((function(n){if("object"!=typeof(null==n?void 0:n.data))return t(),Promise.reject();S(n.data),e(n.data),Re.setState({loaded:!0,session:n.data})})).catch((function(e){return(0,Ie.reportError)("Failed to fetch new session information: ".concat(e)),t(e),{sessionId:"",authenticated:!1}}))}))},_=function(){Re.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})},E=function(e,t){return void 0===t?Boolean(e):!Boolean(e)||function(e,t){return"string"==typeof e?!Me(t.privileges.find((function(t){return e===t.display}))):Array.isArray(e)?e.every((function(e){return!Me(t.privileges.find((function(t){return e===t.display})))})):(Me(e)||console.error('Could not understand privileges "'.concat(e,'"')),!0)}(e,t)||function(e){return!Me(e.roles.find((function(e){return"System Developer"===e.display})))}(t)},x=function(){var e,t;return new Promise((function(n,r){var o=function(r){r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};o(Re.getState()),e||(t=Re.subscribe(o))}))},j=function(){return new Promise((function(e,t){g().subscribe((function(t){e(t.sessionLocation)}),t).unsubscribe()}))},P=function(e,t){return Le.apply(this,arguments)},C=function(){(0,_e.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:_e.Type.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:_e.Type.String,_default:"${openmrsSpaBase}/login",_validators:[_e.validators.isUrl]},errors:{_type:_e.Type.Array,_default:[401],_elements:{_type:_e.Type.Number,_validators:[_e.validators.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:_e.Type.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."}}}),O()},k=function(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},A=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},T=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){A(i,r,o,a,u,"next",e)}function u(e){A(i,r,o,a,u,"throw",e)}a(void 0)}))}},I=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return k(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(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},D=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},M=function(e,t){return Be.apply(this,arguments)},R=function(e){return Fe.apply(this,arguments)},N=function(e){return function(t){return 0===e?We:t.lift(new Ye(e))}},L=function(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 Xe(e,t))}},U=function(){return(0,De.getGlobalStore)("visit",et)},B=function(e,t){U().setState({patientUuid:e,manuallySetVisitUuid:t})},F=function(e,t,n){var r=null!=n?n:Qe;return b("/ws/rest/v1/visit?patient=".concat(e,"&v=").concat(r),{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}}).pipe(N(1)).pipe(L((function(e){return e})))},V=function(e,t){return b("/ws/rest/v1/visit",{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})},K=function(e,t,n){return b("/ws/rest/v1/visit/".concat(e),{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})},H=function(e){return{uuid:e.uuid,display:e.display,name:e.name}},$=function(){return b("/ws/rest/v1/visittype").pipe(L((function(e){return e.data.results.map(H)}))).pipe(N(1))},G=function(e){return{uuid:e.uuid,display:e.display}},z=function(){return b("/ws/rest/v1/location").pipe(L((function(e){return e.data.results.map(G)}))).pipe(N(1))};c.r(s),c.d(s,{OpenmrsFetchError:function(){return Te},VisitMode:function(){return tt},VisitStatus:function(){return nt},backendDependencies:function(){return ot},clearCurrentUser:function(){return _},defaultVisitCustomRepresentation:function(){return Qe},fetchCurrentPatient:function(){return M},fhirBaseUrl:function(){return ke},getCurrentUser:function(){return g},getLocations:function(){return z},getLoggedInUser:function(){return x},getSessionLocation:function(){return j},getSessionStore:function(){return w},getStartedVisit:function(){return rt},getVisitStore:function(){return U},getVisitTypes:function(){return $},getVisitsForPatient:function(){return F},makeUrl:function(){return y},openmrsFetch:function(){return v},openmrsObservableFetch:function(){return b},refetchCurrentUser:function(){return O},restBaseUrl:function(){return Ce},saveVisit:function(){return V},sessionEndpoint:function(){return Ae},setCurrentVisit:function(){return B},setSessionLocation:function(){return P},setUserLanguage:function(){return S},setupApiModule:function(){return C},toLocationObject:function(){return G},toVisitTypeObject:function(){return H},updateVisit:function(){return K},userHasAccess:function(){return E}});var q,W,Y=function(e,t){return Y=Object.setPrototypeOf||r({__proto__:[]},Array)&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Y(e,t)},Z=!1,X={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack,Z=e},get useDeprecatedSynchronousErrorHandling(){return Z}},J={closed:!0,next:function(e){},error:function(e){if(X.useDeprecatedSynchronousErrorHandling)throw e;i(e)},complete:function(){}},Q=Array.isArray||function(e){return e&&"number"==typeof e.length},ee=function(){var e=function(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}(),te=function(){var e=function(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)};return e.prototype.unsubscribe=function(){var n;if(!this.closed){var o,i=this,u=i._parentOrParents,c=i._ctorUnsubscribe,s=i._unsubscribe,l=i._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r(u,e))u.remove(this);else if(null!==u)for(var f=0;f<u.length;++f)u[f].remove(this);if(t(s)){c&&(this._unsubscribe=void 0);try{s.call(this)}catch(e){n=r(e,ee)?a(e.errors):[e]}}if(Q(l)){f=-1;for(var d=l.length;++f<d;){var p=l[f];if(null!==(o=p)&&"object"==typeof o)try{p.unsubscribe()}catch(e){n=n||[],r(e,ee)?n=n.concat(a(e.errors)):n.push(e)}}}if(n)throw new ee(n)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(void 0===t?"undefined":o(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(!r(n,e)){var i=n;(n=new e)._subscriptions=[i]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var a=n._parentOrParents;if(null===a)n._parentOrParents=this;else if(r(a,e)){if(a===this)return n;n._parentOrParents=[a,this]}else{if(-1!==a.indexOf(this))return n;a.push(this)}var u=this._subscriptions;return null===u?this._subscriptions=[n]:u.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}(),ne="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),re=function(t){function n(e,o,i){var a=t.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,arguments.length){case 0:a.destination=J;break;case 1:if(!e){a.destination=J;break}if("object"==typeof e){r(e,n)?(a.syncErrorThrowable=e.syncErrorThrowable,a.destination=e,e.add(a)):(a.syncErrorThrowable=!0,a.destination=new oe(a,e));break}default:a.syncErrorThrowable=!0,a.destination=new oe(a,e,o,i)}return a}return e(n,t),n.prototype[ne]=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,t.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}(te),oe=function(n){var r=function(e,r,o,i){var a,u=n.call(this)||this;u._parentSubscriber=e;var c=u;return t(r)?a=r:r&&(a=r.next,o=r.error,i=r.complete,r!==J&&(t((c=Object.create(r)).unsubscribe)&&u.add(c.unsubscribe.bind(c)),c.unsubscribe=u.unsubscribe.bind(u))),u._context=c,u._next=a,u._error=o,u._complete=i,u};return e(r,n),r.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;X.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},r.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=X.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):i(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;i(e)}}},r.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)};X.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},r.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),X.useDeprecatedSynchronousErrorHandling)throw e;i(e)}},r.prototype.__tryOrSetError=function(e,t,n){if(!X.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return X.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(i(t),!0)}return!1},r.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},r}(re),ie="function"==typeof Symbol&&Symbol.observable||"@@observable",ae=function(){var e=function(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 o=this.operator,i=function(e,t,n){if(e){if(r(e,re))return e;if(e[ne])return e[ne]()}return e||t||n?new re(e,t,n):new re(J)}(e,t,n);if(o?i.add(o.call(i,this.source)):i.add(this.source||X.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),X.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){X.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){var t=e,n=t.closed,o=t.destination,i=t.isStopped;if(n||i)return!1;e=o&&r(o,re)?o:null}return!0}(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=l(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[ie]=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?u: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=l(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}(),ue="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ce="object"==typeof self&&self&&self.Object===Object&&self,se=(ue||ce||Function("return this")()).Symbol,le=Object.prototype,fe=le.hasOwnProperty,de=le.toString,pe=se?se.toStringTag:void 0,he=Object.prototype.toString,ye=se?se.toStringTag:void 0,ve=(q=Object.getPrototypeOf,W=Object,function(e){return q(W(e))}),be=Function.prototype,me=Object.prototype,ge=be.toString,we=me.hasOwnProperty,Se=ge.call(Object),Oe=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]":ye&&ye in Object(e)?function(e){var t=fe.call(e,pe),n=e[pe];try{e[pe]=void 0;var r=!0}catch(e){}var o=de.call(e);return r&&(t?e[pe]=n:delete e[pe]),o}(e):function(e){return he.call(e)}(e)}(e))return!1;var t=ve(e);if(null===t)return!0;var n=we.call(t,"constructor")&&t.constructor;return"function"==typeof n&&r(n,n)&&ge.call(n)==Se},_e=c(824);function Ee(e,t,n){return Ee=h()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&je(o,n.prototype),o},Ee.apply(null,arguments)}function xe(e){return xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},xe(e)}function je(e,t){return je=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},je(e,t)}function Pe(e){var t="function"==typeof Map?new Map:void 0;return Pe=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return Ee(e,arguments,xe(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),je(r,e)},Pe(e)}var Ce="/ws/rest/v1/",ke="/ws/fhir2/R4",Ae="".concat(Ce,"session"),Te=function(e){!function(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}}),t&&je(e,t)}(a,e);var t,n,i=(t=a,n=h(),function(){var e,r=xe(t);if(n){var i=xe(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":o(n))&&"function"!=typeof t?f(e):t;var n}(this,e)});function a(e,t,n,o){var u;return function(e,t){if(!r(e,t))throw new TypeError("Cannot call a class as a function")}(this,a),p(f(u=i.call(this)),"response",void 0),p(f(u),"responseBody",void 0),u.message="Server responded with ".concat(t.status," (").concat(t.statusText,") for url ").concat(e,". Check err.responseBody or network tab in dev tools for more info"),o.message=u.message,u.responseBody=n,u.response=t,u.stack="Stacktrace for outgoing request:\n".concat(o.stack,"\nStacktrace for incoming response:\n").concat(u.stack),u}return a}(Pe(Error)),Ie=c(254),De=c(385),Me=function(e){return void 0===e},Re=(0,De.createGlobalStore)("session",{loaded:!1,session:null}),Ne=0;function Le(){var e;return e=function(e,t){return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(n){switch(n.label){case 0:return[4,v(Ae,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal})];case 1:return n.sent(),[4,O()];case 2:return n.sent(),[2]}}))},Le=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){m(i,r,o,a,u,"next",e)}function u(e){m(i,r,o,a,u,"throw",e)}a(void 0)}))},Le.apply(this,arguments)}var Ue=c(738);function Be(){return Be=T((function(e,t){var n,r,o,i,a,u=arguments;return D(this,(function(c){switch(c.label){case 0:return n=!(u.length>2&&void 0!==u[2])||u[2],e?(r=null,[4,Promise.all([v("".concat(ke,"/Patient/").concat(e),t).catch((function(e){return r=e})),n?R(e):Promise.resolve(null)])]):[3,2];case 1:if(o=I.apply(void 0,[c.sent(),2]),i=o[0],a=o[1],i.ok)return[2,i.data];if(a)return[2,a];if(r)throw r;c.label=2;case 2:return[2,null]}}))})),Be.apply(this,arguments)}function Fe(){return(Fe=T((function(e){var t,n,r;return D(this,(function(o){switch(o.label){case 0:return[4,(0,Ue.getSynchronizationItems)("patient-registration")];case 1:return t=o.sent(),n=t.find((function(t){return t.fhirPatient.id===e})),[2,null!==(r=null==n?void 0:n.fhirPatient)&&void 0!==r?r:null]}}))}))).apply(this,arguments)}var Ve=function(){var e=function(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this};return e.prototype=Object.create(Error.prototype),e}(),Ke=function(t){var n=function(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r};return e(n,t),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}(te),He=function(t){var n=function(e){var n=t.call(this,e)||this;return n.destination=e,n};return e(n,t),n}(re),$e=function(t){var n=function(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e};return e(n,t),n.prototype[ne]=function(){return new He(this)},n.prototype.lift=function(e){var t=new Ge(this,this);return t.operator=e,t},n.prototype.next=function(e){if(this.closed)throw new Ve;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 Ve;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 Ve;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(e){if(this.closed)throw new Ve;return t.prototype._trySubscribe.call(this,e)},n.prototype._subscribe=function(e){if(this.closed)throw new Ve;return this.hasError?(e.error(this.thrownError),te.EMPTY):this.isStopped?(e.complete(),te.EMPTY):(this.observers.push(e),new Ke(this,e))},n.prototype.asObservable=function(){var e=new ae;return e.source=this,e},n.create=function(e,t){return new Ge(e,t)},n}(ae),Ge=function(t){var n=function(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r};return e(n,t),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):te.EMPTY},n}($e),ze=function(t){var n=function(e){var n=t.call(this)||this;return n._value=e,n};return e(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Ve;return this._value},n.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},n}($e),qe=function(){var e=function(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this};return e.prototype=Object.create(Error.prototype),e}(),We=new ae((function(e){return e.complete()})),Ye=function(){var e=function(e){if(this.total=e,this.total<0)throw new qe};return e.prototype.call=function(e,t){return t.subscribe(new Ze(e,this.total))},e}(),Ze=function(t){var n=function(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r};return e(n,t),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}(re),Xe=function(){var e=function(e,t){this.project=e,this.thisArg=t};return e.prototype.call=function(e,t){return t.subscribe(new Je(e,this.project,this.thisArg))},e}(),Je=function(t){var n=function(e,n,r){var o=t.call(this,e)||this;return o.project=n,o.count=0,o.thisArg=r||o,o};return e(n,t),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}(re),Qe="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)",et=function(){try{return JSON.parse(localStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};U().subscribe((function(e){var t;t=e,localStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))}));var tt,nt,rt=new ze(null);!function(e){e.NEWVISIT="startVisit",e.EDITVISIT="editVisit",e.LOADING="loadingVisit"}(tt||(tt={})),function(e){e.NOTSTARTED="notStarted",e.ONGOING="ongoing"}(nt||(nt={}));var ot={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}}(),s}())}}}))},1329:()=>{function e(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}System.register(["@openmrs/esm-state"],(function(t,n){var r={};return{setters:[function(e){r.createGlobalStore=e.createGlobalStore}],execute:function(){t(function(){"use strict";var t={685:function(e){e.exports=r}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return function(){var t=function(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")},n=function(e){return e&&e.sensitive?"":"i"},r=function(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},a=function(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(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(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},u=function(t){return n=t.matcher,(null!=(r=RegExp)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):e(n,r))?t.matcher:"string"==typeof t.matcher?h(t.matcher):h(t.path);var n,r},c=function(e){return s([e])},s=function(e){var t=l(),n=e.map((function(e){return{matcher:u(e),settings:e}})),r=a(t).concat(a(n));y.setState(r,!0)},l=function(){return y.getState()},f=function(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},d=function(e,t){if(e.length>0){var n=v(e,t);if(n){for(var r=[n],o=v(e,n.settings.parent);void 0!==o;)r.push(o),o=v(e,o.settings.parent);return r.reverse()}}return[]},p=function(e){return d(l(),e)};function h(r,o,i){return e(r,RegExp)?function(e,t){if(!t)return e;var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:"",suffix:"",modifier:"",pattern:""});return e}(r,o):Array.isArray(r)?function(e,t,r){var o=e.map((function(e){return h(e,t,r).source}));return new RegExp("(?:"+o.join("|")+")",n(r))}(r,o,i):function(e,r,o){return function(e,r,o){void 0===o&&(o={});for(var i=o.strict,a=void 0!==i&&i,u=o.start,c=void 0===u||u,s=o.end,l=void 0===s||s,f=o.encode,d=void 0===f?function(e){return e}:f,p="["+t(o.endsWith||"")+"]|$",h="["+t(o.delimiter||"/#?")+"]",y=c?"^":"",v=0,b=e;v<b.length;v++){var m=b[v];if("string"==typeof m)y+=t(d(m));else{var g=t(d(m.prefix)),w=t(d(m.suffix));if(m.pattern)if(r&&r.push(m),g||w)if("+"===m.modifier||"*"===m.modifier){var S="*"===m.modifier?"?":"";y+="(?:"+g+"((?:"+m.pattern+")(?:"+w+g+"(?:"+m.pattern+"))*)"+w+")"+S}else y+="(?:"+g+"("+m.pattern+")"+w+")"+m.modifier;else y+="("+m.pattern+")"+m.modifier;else y+="(?:"+g+w+")"+m.modifier}}if(l)a||(y+=h+"?"),y+=o.endsWith?"(?="+p+")":"$";else{var O=e[e.length-1],_="string"==typeof O?h.indexOf(O[O.length-1])>-1:void 0===O;a||(y+="(?:"+h+"(?="+p+"))?"),_||(y+="(?="+h+"|"+p+")")}return new RegExp(y,n(o))}(function(e,n){void 0===n&&(n={});for(var r=function(e){for(var t=[],n=0;n<e.length;){var r=e[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)t.push({type:"CHAR",index:n,value:e[n++]});else{var o=1,i="";if("?"===e[u=n+1])throw new TypeError('Pattern cannot start with "?" at '+u);for(;u<e.length;)if("\\"!==e[u]){if(")"===e[u]){if(0==--o){u++;break}}else if("("===e[u]&&(o++,"?"!==e[u+1]))throw new TypeError("Capturing groups are not allowed at "+u);i+=e[u++]}else i+=e[u++]+e[u++];if(o)throw new TypeError("Unbalanced pattern at "+n);if(!i)throw new TypeError("Missing pattern at "+n);t.push({type:"PATTERN",index:n,value:i}),n=u}else{for(var a="",u=n+1;u<e.length;){var c=e.charCodeAt(u);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;a+=e[u++]}if(!a)throw new TypeError("Missing parameter name at "+n);t.push({type:"NAME",index:n,value:a}),n=u}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),o=n.prefixes,i=void 0===o?"./":o,a="[^"+t(n.delimiter||"/#?")+"]+?",u=[],c=0,s=0,l="",f=function(e){if(s<r.length&&r[s].type===e)return r[s++].value},d=function(e){var t=f(e);if(void 0!==t)return t;var n=r[s],o=n.type,i=n.index;throw new TypeError("Unexpected "+o+" at "+i+", expected "+e)},p=function(){for(var e,t="";e=f("CHAR")||f("ESCAPED_CHAR");)t+=e;return t};s<r.length;){var h=f("CHAR"),y=f("NAME"),v=f("PATTERN");if(y||v){var b=h||"";-1===i.indexOf(b)&&(l+=b,b=""),l&&(u.push(l),l=""),u.push({name:y||c++,prefix:b,suffix:"",pattern:v||a,modifier:f("MODIFIER")||""})}else{var m=h||f("ESCAPED_CHAR");if(m)l+=m;else if(l&&(u.push(l),l=""),f("OPEN")){b=p();var g=f("NAME")||"",w=f("PATTERN")||"",S=p();d("CLOSE"),u.push({name:g||(w?c++:""),pattern:g&&!w?a:w,prefix:b,suffix:S,modifier:f("MODIFIER")||""})}else d("END")}}return u}(e,o),r,o)}(r,o,i)}o.r(i),o.d(i,{filterBreadcrumbs:function(){return d},getBreadcrumbs:function(){return l},getBreadcrumbsFor:function(){return p},registerBreadcrumb:function(){return c},registerBreadcrumbs:function(){return s}});var y=(0,o(685).createGlobalStore)("breadcrumbs",[]);function v(e,t){if(t)return function(e,t){return(n=e.filter((function(e){return e.matcher.test(t)})),function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(n)||function(e,t){if(e){if("string"==typeof e)return f(e,1);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(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,1):void 0}}(n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];var n}(e,t)||function(e,t){for(var n=t.split("/");n.length>1;){n.pop();var r=v(e,n.join("/"));if(r)return r}}(e,t)}}(),i}())}}}))},4611:()=>{var e=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};System.register(["@openmrs/esm-state","single-spa"],(function(t,n){var r={},o={};return{setters:[function(e){r.createGlobalStore=e.createGlobalStore,r.getGlobalStore=e.getGlobalStore},function(e){o.navigateToUrl=e.navigateToUrl}],execute:function(){t(function(){"use strict";var t={685:function(e){e.exports=r},645:function(e){e.exports=o}},n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,i),o.exports}i.d=function(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.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return function(){var t=function(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]},n=function(e){return function n(r){return 0===arguments.length||t(r)?n:e.apply(this,arguments)}},r=function(e){return function r(o,i){switch(arguments.length){case 0:return r;case 1:return t(o)?r:n((function(t){return e(o,t)}));default:return t(o)&&t(i)?r:t(o)?n((function(t){return e(t,i)})):t(i)?n((function(t){return e(o,t)})):e(o,i)}}},o=function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n},u=function(e,t,n){for(var r=0,o=n.length;r<o;){if(e(t,n[r]))return!0;r+=1}return!1},c=function(e,t){return Object.prototype.hasOwnProperty.call(t,e)},s=function(e,t,n,r){var i=o(e);function a(e,t){return le(e,t,n.slice(),r.slice())}return!u((function(e,t){return!u(a,t,e)}),o(t),i)},l=function(e){return function o(i,a,u){switch(arguments.length){case 0:return o;case 1:return t(i)?o:r((function(t,n){return e(i,t,n)}));case 2:return t(i)&&t(a)?o:t(i)?r((function(t,n){return e(t,a,n)})):t(a)?r((function(t,n){return e(i,t,n)})):n((function(t){return e(i,a,t)}));default:return t(i)&&t(a)&&t(u)?o:t(i)&&t(a)?r((function(t,n){return e(t,n,u)})):t(i)&&t(u)?r((function(t,n){return e(t,a,n)})):t(a)&&t(u)?r((function(t,n){return e(i,t,n)})):t(i)?n((function(t){return e(t,a,u)})):t(a)?n((function(t){return e(i,t,u)})):t(u)?n((function(t){return e(i,a,t)})):e(i,a,u)}}},f=function(e){return"[object Object]"===Object.prototype.toString.call(e)},d=function(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)},p=function(e,t,n,r){return e["@@transducer/result"](n[r](_e(e["@@transducer/step"],e),t))},h=function(e,t){return function(n){if(!e(n))return"function"==typeof t?t(n):t}},y=function(e){return(0,Ie.getGlobalStore)("config-module-".concat(e),{config:null,loaded:!1})},v=function(){return(0,Ie.getGlobalStore)("config-extension-slots",{slots:{}})},b=function(e){return m(v().getState(),e)},m=function(e,t){var n=e.slots[t];return null!=n?n:{loaded:!1,config:{}}},g=function(){return(0,Ie.getGlobalStore)("conf