@openmrs/esm-api
Advanced tools
Comparing version 3.0.8 to 3.1.0
@@ -16,3 +16,3 @@ System.register(["react","@openmrs/esm-config","@openmrs/esm-error-handling","single-spa"],(function(t){var e,n,r,i;return{setters:[function(t){e=t},function(t){n=t},function(t){r=t},function(t){i=t}],execute:function(){t(function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=41)}([function(t,e,n){"use strict";n.d(e,"a",(function(){return i})); | ||
***************************************************************************** */ | ||
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(2);var i=n(10),o=n(15);var u=n(6),c=n(21);function s(t){return 0===t.length?c.a:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var a=n(4),f=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var u=this.operator,c=function(t,e,n){if(t){if(t instanceof r.a)return t;if(t[i.a])return t[i.a]()}return t||e||n?new r.a(t,e,n):new r.a(o.a)}(t,e,n);if(u?c.add(u.call(c,this.source)):c.add(this.source||a.a.useDeprecatedSynchronousErrorHandling&&!c.syncErrorThrowable?this._subscribe(c):this._trySubscribe(c)),a.a.useDeprecatedSynchronousErrorHandling&&c.syncErrorThrowable&&(c.syncErrorThrowable=!1,c.syncErrorThrown))throw c.syncErrorValue;return c},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){a.a.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),!function(t){for(;t;){var e=t,n=e.closed,i=e.destination,o=e.isStopped;if(n||o)return!1;t=i&&i instanceof r.a?i:null}return!0}(t)?console.warn(e):t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=l(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(t){r(t),i&&i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[u.a]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:s(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=l(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function l(t){if(t||(t=a.a.Promise||Promise),!t)throw new Error("no Promise impl found");return t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(0),i=n(11),o=n(15),u=n(3),c=n(10),s=n(4),a=n(7),f=function(t){function e(n,r,i){var u=t.call(this)||this;switch(u.syncErrorValue=null,u.syncErrorThrown=!1,u.syncErrorThrowable=!1,u.isStopped=!1,arguments.length){case 0:u.destination=o.a;break;case 1:if(!n){u.destination=o.a;break}if("object"==typeof n){n instanceof e?(u.syncErrorThrowable=n.syncErrorThrowable,u.destination=n,n.add(u)):(u.syncErrorThrowable=!0,u.destination=new l(u,n));break}default:u.syncErrorThrowable=!0,u.destination=new l(u,n,r,i)}return u}return r.a(e,t),e.prototype[c.a]=function(){return this},e.create=function(t,n,r){var i=new e(t,n,r);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(u.a),l=function(t){function e(e,n,r,u){var c,s=t.call(this)||this;s._parentSubscriber=e;var a=s;return Object(i.a)(n)?c=n:n&&(c=n.next,r=n.error,u=n.complete,n!==o.a&&(a=Object.create(n),Object(i.a)(a.unsubscribe)&&s.add(a.unsubscribe.bind(a)),a.unsubscribe=s.unsubscribe.bind(s))),s._context=a,s._next=c,s._error=r,s._complete=u,s}return r.a(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;s.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=s.a.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):Object(a.a)(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;Object(a.a)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};s.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),s.a.useDeprecatedSynchronousErrorHandling)throw t;Object(a.a)(t)}},e.prototype.__tryOrSetError=function(t,e,n){if(!s.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return s.a.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(Object(a.a)(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(f)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}(),i=n(20),o=n(11),u=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),c=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var e;if(!this.closed){var n=this._parentOrParents,c=this._ctorUnsubscribe,a=this._unsubscribe,f=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(var l=0;l<n.length;++l){n[l].remove(this)}if(Object(o.a)(a)){c&&(this._unsubscribe=void 0);try{a.call(this)}catch(t){e=t instanceof u?s(t.errors):[t]}}if(r(f)){l=-1;for(var d=f.length;++l<d;){var h=f[l];if(Object(i.a)(h))try{h.unsubscribe()}catch(t){e=e||[],t instanceof u?e=e.concat(s(t.errors)):e.push(t)}}}if(e)throw new u(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=n._parentOrParents;if(null===i)n._parentOrParents=this;else if(i instanceof t){if(i===this)return n;n._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return n;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[n]:o.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=((e=new t).closed=!0,e),t}();function s(t){return t.reduce((function(t,e){return t.concat(e instanceof u?e.errors:e)}),[])}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;r=t},get useDeprecatedSynchronousErrorHandling(){return r}}},function(t,n){t.exports=e},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},function(t,e,n){"use strict";function r(t){setTimeout((function(){throw t}),0)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return v})),n.d(e,"b",(function(){return m})),n.d(e,"c",(function(){return w}));var r=n(39),i=n(60),o=n(0),u=n(2);function c(){}var s=n(11);var a=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new f(t,this.nextOrObserver,this.error,this.complete))},t}(),f=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o._tapNext=c,o._tapError=c,o._tapComplete=c,o._tapError=r||c,o._tapComplete=i||c,Object(s.a)(n)?(o._context=o,o._tapNext=n):n&&(o._context=n,o._tapNext=n.next||c,o._tapError=n.error||c,o._tapComplete=n.complete||c),o}return o.a(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(u.a),l=n(26),d=n(59),h=n(13);const p=new r.a(1);let b=0;function v(t={includeAuthStatus:!1}){return b<Date.now()-6e4&&m(),p.asObservable().pipe(Object(i.a)(),(e=y,function(t){return t.lift(new a(e,n,r))}),Object(l.a)(e=>t.includeAuthStatus?e.data:e.data.user),Object(d.a)(Boolean));var e,n,r}function y(t){var e,n,r;if(null==t||null===(e=t.data)||void 0===e||null===(n=e.user)||void 0===n||null===(r=n.userProperties)||void 0===r?void 0:r.defaultLocale){const e=t.data.user.userProperties.defaultLocale;e!=document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",e)}}function m(){b=Date.now(),p.next(Object(h.b)("/ws/rest/v1/session"))}function w(t,e){return function(t,e){return e.privileges.find(e=>t===e.display)}(t,e)||function(t){return t.roles.find(t=>"System Developer"===t.display)}(e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},function(t,e,n){"use strict";function r(t){return"function"==typeof t}n.d(e,"a",(function(){return r}))},function(t,e,n){(function(){var t=n(46),r=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,i=function(t){return t?t.toString().replace(r,""):""};e.trim=i;var o=function(t){return null==t&&void 0===t?String(t):{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"}[Object.prototype.toString.call(t)]};e.type=o;e.assertArray=function(t){if("array"!==o(t))throw"not array";return t};var u=function(t){if("object"!==o(t))throw"not object";return t};e.assertObject=u;var c=function(t,e,n){var r,i;return n||(n=[]),u(t),function(){var e;for(r in e=[],t)i=t[r],e.push([r,i]);return e}().reduce(e,n)};e.reduceMap=c;e.identity=function(t){return t};var s=function(){return Array.prototype.slice.call(arguments)};e.argsArray=s;e.mergeLists=function(){var e;return e=function(e,n){var r,i,o;for(r in i=t(!0,e),n)o=n[r],i[r]=(i[r]||[]).concat(o);return i},s.apply(null,arguments).reduce(e,{})};e.absoluteUrl=function(t,e){return e.match(/https?:\/\/./)?e:t+"/"+e};e.relativeUrl=function(t,e){return e.slice(e,t.length+1)===t+"/"?e.slice(t.length+1):e},e.resourceIdToUrl=function(t,e,n){return e=e.replace(/\/$/,""),(t=t.replace(/^\//,"")).indexOf("/")<0?e+"/"+n+"/"+t:0!==t.indexOf(e)?e+"/"+t:t};var a=function(t,e,n,r){var i;switch(o(n)){case"array":return e(n.map((function(e){return t(e,[n,r])})),r);case"object":return i=function(e,i){var o,u;return o=i[0],u=i[1],e[o]=t(u,[n].concat(r)),e},e(c(n,i,{}),r);default:return e(n,r)}};e.walk=a;var f=function(t,e,n){return e?a(f(t),t,e,n):function(e,n){return f(t,e,n)}};e.postwalk=f}).call(this)},function(t,e,n){"use strict";n.d(e,"b",(function(){return j})),n.d(e,"c",(function(){return P})),n.d(e,"a",(function(){return T}));var r=n(1),i=n(37),o=n(38),u="object"==typeof self&&self&&self.Object===Object&&self,c=(o.a||u||Function("return this")()).Symbol,s=Object.prototype,a=s.hasOwnProperty,f=s.toString,l=c?c.toStringTag:void 0;var d=function(t){var e=a.call(t,l),n=t[l];try{t[l]=void 0;var r=!0}catch(t){}var i=f.call(t);return r&&(e?t[l]=n:delete t[l]),i},h=Object.prototype.toString;var p=function(t){return h.call(t)},b=c?c.toStringTag:void 0;var v=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":b&&b in Object(t)?d(t):p(t)};var y=function(t,e){return function(n){return t(e(n))}}(Object.getPrototypeOf,Object);var m=function(t){return null!=t&&"object"==typeof t},w=Function.prototype,g=Object.prototype,_=w.toString,E=g.hasOwnProperty,x=_.call(Object);var O=function(t){if(!m(t)||"[object Object]"!=v(t))return!1;var e=y(t);if(null===e)return!0;var n=E.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&_.call(n)==x},S=n(19);function j(t,e={}){if("string"!=typeof t)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof e)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.");t=window.openmrsBase+t,e.headers||(e.headers={}),O(e.body)&&(e.body=JSON.stringify(e.body)),void 0===e.headers.Accept&&(e.headers.Accept="application/json"),null===e.headers.Accept&&delete e.headers.Accept;const n=Error();return window.fetch(t,e).then(async e=>{const r=e;if(r.ok)return 204===r.status?(r.data=null,r):r.json().then(t=>(r.data=t,r));{const{redirectAuthFailure:e}=await Object(S.getConfig)("@openmrs/esm-api");if(e.enabled&&e.errors.indexOf(r.status)>=0){return(t=>t.startsWith(window.getOpenmrsSpaBase()))(e.url)?Object(i.navigateToUrl)(e.url):location.assign(e.url),e.resolvePromise?Promise.resolve():new Promise(t=>{})}return r.text().then(e=>{let i=e;try{i=JSON.parse(e)}catch(t){}throw new T(t,r,i,n)},e=>{throw new T(t,r,null,n)})}})}function P(t,e={}){if("object"!=typeof e)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");const n=new AbortController;return e.signal=n.signal,new r.a(r=>{let i=!1;return j(t,e).then(t=>{i=!0,r.next(t),r.complete()},t=>{i=!0,r.error(t)}),()=>{i||n.abort()}})}class T extends Error{constructor(t,e,n,r){super(),this.message=`Server responded with ${e.status} (${e.statusText}) for url ${t}. Check err.responseBody or network tab in dev tools for more info`,r.message=this.message,this.responseBody=n,this.response=e,this.stack=`Stacktrace for outgoing request:\n${r.stack}\nStacktrace for incoming response:\n${this.stack}`}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(1),i=n(3);function o(t,e){return new r.a((function(n){var r=new i.a,o=0;return r.add(e.schedule((function(){o!==t.length?(n.next(t[o++]),n.closed||r.add(this.schedule())):n.complete()}))),r}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(4),i=n(7),o={closed:!0,next:function(t){},error:function(t){if(r.a.useDeprecatedSynchronousErrorHandling)throw t;Object(i.a)(t)},complete:function(){}}},function(t,e,n){(function(){var t=n(12),r=function(t){return t.and=function(e){return r((n=t,i=e,function(t){return n(i(t))}));var n,i},t.end=function(e){return t(e)},t};e.$$Simple=function(t){return function(e){return function(n){return e(t(n))}}};e.$$Attr=function(e,n){return r((function(r){return function(i){var o=null;return o="function"==t.type(n)?n(i):n,r(null==o&&null==o?i:function(t,e,n){for(var r=e.split("."),i=t,o=0;o<r.length-1;o++){var u=r[o];(i=t[u])||(i={},t[u]=i)}return i[r[r.length-1]]=n,t}(i,e,o))}}))};var i=function(t,e){return r((function(n){return function(r){return r[t]=e(r),n(r)}}))};e.Middleware=r,e.Attribute=i,e.Method=function(t){return i("method",(e=t,function(){return e}));var e}}).call(this)},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var r=n(13);const i="/ws/fhir2/R4",o=n(45)({baseUrl:i},{http:t=>Object(r.b)(t.url,{method:t.method,headers:t.headers}).then(e=>({status:e.status,headers:e.headers,data:e.data,config:t}),e=>({status:e.response.status,headers:e.response.headers,data:e.responseBody,config:t}))})},function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"c",(function(){return d})),n.d(e,"b",(function(){return h}));var r=n(39),i=n(17),o=n(60),u=n(26),c=n(59);let s;const a=new r.a(1),f=new r.a(1);function l(t={includeConfig:!1}){return f.asObservable().pipe(Object(o.a)(),Object(u.a)(e=>t.includeConfig?e:e.data),Object(c.a)(Boolean))}function d(){f.next(i.a.read({type:"Patient",patient:s}))}function h(){return a.asObservable()}window.addEventListener("single-spa:routing-event",()=>{const t=function(){const t=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return t&&t[1]}();t&&t!==s&&(s=t,a.next(t),t&&f.next(i.a.read({type:"Patient",patient:s})))})},function(t,e){t.exports=n},function(t,e,n){"use strict";function r(t){return null!==t&&"object"==typeof t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return r.a(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(n(3).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(0),i=n(1),o=n(2),u=n(3),c=n(8),s=n(22),a=n(10),f=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return r.a(e,t),e}(o.a),l=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return r.a(e,t),e.prototype[a.a]=function(){return new f(this)},e.prototype.lift=function(t){var e=new d(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new c.a;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new c.a;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new c.a;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new c.a;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new c.a;return this.hasError?(t.error(this.thrownError),u.a.EMPTY):this.isStopped?(t.complete(),u.a.EMPTY):(this.observers.push(t),new s.a(this,t))},e.prototype.asObservable=function(){var t=new i.a;return t.source=this,t},e.create=function(t,e){return new d(t,e)},e}(i.a),d=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return r.a(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):u.a.EMPTY},e}(l)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=n(2);function o(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new u(t,e))}}var u=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.project,this.thisArg))},t}(),c=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return r.a(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(i.a)},function(t,e){t.exports=r},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(5),i=n.n(r),o=n(9);const u=({privilege:t,children:e})=>{const[n,r]=i.a.useState(null);return i.a.useEffect(()=>{const t=Object(o.a)({includeAuthStatus:!1}).subscribe(r);return()=>t.unsubscribe()},[]),n&&Object(o.c)(t,n)?i.a.createElement(i.a.Fragment,null,e):null}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(5),i=n.n(r);const o=({name:t,params:e})=>{const n=i.a.useRef(null);return i.a.useEffect(()=>{if(n.current)return window.renderOpenmrsExtension(n.current,t,e)},[t,e]),i.a.createElement("slot",{ref:n})}},function(t,e){},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(19),i=n(9);function o(){Object(r.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{default:!0},url:{default:window.getOpenmrsSpaBase()+"login"},errors:{default:[401]},resolvePromise:{default:!1}}}),Object(i.b)()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(5),i=n.n(r),o=n(18),u=n(27);function c(){const[t,e]=i.a.useReducer(s,a);return i.a.useEffect(()=>{const t=Object(o.b)().subscribe(t=>e({type:f.newUuid,uuid:t}),Object(u.createErrorHandler)());return()=>{t.unsubscribe()}},[]),i.a.useEffect(()=>{const t=Object(o.a)().subscribe(t=>e({type:f.newPatient,patient:t}),t=>{e({type:f.patientLoadError,err:t}),Object(u.reportError)(t)});return()=>{t.unsubscribe()}},[]),[t.isLoadingPatient,t.patient,t.patientUuid,t.err]}function s(t,e){switch(e.type){case f.newUuid:return{...t,patientUuid:e.uuid,patient:null,isLoadingPatient:!0,err:null};case f.newPatient:return{...t,patient:e.patient,isLoadingPatient:!1,err:null};case f.patientLoadError:return{...t,patient:null,isLoadingPatient:!1,err:e.err};default:throw Error()}}const a={patientUuid:null,patient:null,isLoadingPatient:!0,err:null};var f;!function(t){t.newUuid="newUuid",t.newPatient="newPatient",t.patientLoadError="patientLoadError"}(f||(f={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));const r=new(n(25).a);function i(t){r.next(t)}function o(){return r.asObservable()}},function(t,e,n){"use strict";function r(t,e){for(var n in e)t[n]=e[n];return t}n.d(e,"b",(function(){return u})),n.d(e,"d",(function(){return c})),n.d(e,"a",(function(){return s})),n.d(e,"c",(function(){return a}));var i=function(t){var e=[];function n(t){for(var n=[],r=0;r<e.length;r++)e[r]===t?t=null:n.push(e[r]);e=n}function i(n,i,o){t=i?n:r(r({},t),n);for(var u=e,c=0;c<u.length;c++)u[c](t,o)}return t=t||{},{action:function(e){function n(t){i(t,!1,e)}return function(){for(var r=arguments,i=[t],o=0;o<arguments.length;o++)i.push(r[o]);var u=e.apply(this,i);if(null!=u)return u.then?u.then(n):n(u)}},setState:i,subscribe:function(t){return e.push(t),function(){n(t)}},unsubscribe:n,getState:function(){return t}}};const o={};function u(t,e){const n=o[t];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(e,!0),n.active=!0,n.value;{const n=i(e);return o[t]={value:n,active:!0},n}}function c(t,e){const n=o[t];if(!n){const n=i(e);return o[t]={value:n,active:!1},n}return n.value}function s(t){return u("app",t)}function a(){return c("app",{})}},function(t,e,n){function r(t,e){const n=document.createElement("a");n.href=t;const r="/"===n.pathname[0]?n.pathname:"/"+n.pathname;let i=0,o=r.length;for(;i!==e&&o>=0;){"/"===r[--o]&&i++}if(i!==e)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+e+") is greater than the number of directories ("+i+") in the URL path "+t);const u=r.slice(0,o+1);return n.protocol+"//"+n.host+u}e.setPublicPath=function(t,e){if(e||(e=1),"string"!=typeof t||0===t.trim().length)throw Error("systemjs-webpack-interop: setPublicPath(systemjsModuleName) must be called with a non-empty string 'systemjsModuleName'");if("number"!=typeof e||e<=0||!i(e))throw Error("systemjs-webpack-interop: setPublicPath(systemjsModuleName, rootDirectoryLevel) must be called with a positive integer 'rootDirectoryLevel'");let o;try{if(o=window.System.resolve(t),!o)throw Error()}catch(e){throw Error("systemjs-webpack-interop: There is no such module '"+t+"' in the SystemJS registry. Did you misspell the name of your module?")}n.p=r(o,e)},e.resolveDirectory=r;const i=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}},function(t,e){t.exports=i},function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.a=n}).call(this,n(44))},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var r=n(0),i=n(25),o=n(3),u=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return r.a(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return r.a(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,n){return t.call(this)||this}return r.a(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(o.a))),c=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}(),s=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e}(function(t){function e(n,r){void 0===r&&(r=c.now);var i=t.call(this,n,(function(){return e.delegate&&e.delegate!==i?e.delegate.now():r()}))||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return r.a(e,t),e.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,i):t.prototype.schedule.call(this,n,r,i)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(c)))(u),a=n(2),f=n(1),l=new f.a((function(t){return t.complete()}));function d(t){return t?function(t){return new f.a((function(e){return t.schedule((function(){return e.complete()}))}))}(t):l}function h(t){return t&&"function"==typeof t.schedule}var p,b=n(23),v=n(14);function y(t,e){return e?Object(v.a)(t,e):new f.a(Object(b.a)(t))}function m(t){var e=t.error;t.subscriber.error(e)}p||(p={});var w=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){var t,e;switch(this.kind){case"N":return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return h(n)?(t.pop(),Object(v.a)(t,n)):y(t)}(this.value);case"E":return t=this.error,e?new f.a((function(n){return e.schedule(m,0,{error:t,subscriber:n})})):new f.a((function(e){return e.error(t)}));case"C":return d()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();var g=function(t){function e(e,n,r){void 0===r&&(r=0);var i=t.call(this,e)||this;return i.scheduler=n,i.delay=r,i}return r.a(e,t),e.dispatch=function(t){var e=t.notification,n=t.destination;e.observe(n),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new _(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(w.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(w.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(w.createComplete()),this.unsubscribe()},e}(a.a),_=function(){return function(t,e){this.notification=t,this.destination=e}}(),E=n(8),x=n(22),O=function(t){function e(e,n,r){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var i=t.call(this)||this;return i.scheduler=r,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=e<1?1:e,i._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return r.a(e,t),e.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var n=this._events;n.push(e),n.length>this._bufferSize&&n.shift()}t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this.isStopped||(this._events.push(new S(this._getNow(),e)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,u=r.length;if(this.closed)throw new E.a;if(this.isStopped||this.hasError?e=o.a.EMPTY:(this.observers.push(t),e=new x.a(this,t)),i&&t.add(t=new g(t,i)),n)for(var c=0;c<u&&!t.closed;c++)t.next(r[c]);else for(c=0;c<u&&!t.closed;c++)t.next(r[c].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||s).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,i=r.length,o=0;o<i&&!(t-r[o].time<n);)o++;return i>e&&(o=Math.max(o,i-e)),o>0&&r.splice(0,o),r},e}(i.a),S=function(){return function(t,e){this.time=t,this.value=e}}()},,function(t,e,n){n(42),t.exports=n(43)},function(t,e,n){"use strict";n.r(e);var r=n(36);Object(r.setPublicPath)("@openmrs/esm-api")},function(t,e,n){"use strict";n.r(e);var r=n(28);n.d(e,"UserHasAccessReact",(function(){return r.a}));var i=n(29);n.d(e,"ExtensionSlotReact",(function(){return i.a}));var o=n(30);for(var u in o)["default","UserHasAccessReact","ExtensionSlotReact"].indexOf(u)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(u);var c=n(13);n.d(e,"openmrsFetch",(function(){return c.b})),n.d(e,"openmrsObservableFetch",(function(){return c.c})),n.d(e,"OpenmrsFetchError",(function(){return c.a}));var s=n(17);n.d(e,"fhirBaseUrl",(function(){return s.b})),n.d(e,"fhir",(function(){return s.a}));var a=n(31);n.d(e,"setupApiModule",(function(){return a.a}));var f=n(35);n.d(e,"createGlobalStore",(function(){return f.b})),n.d(e,"getGlobalStore",(function(){return f.d})),n.d(e,"createAppState",(function(){return f.a})),n.d(e,"getAppState",(function(){return f.c}));var l=n(9);n.d(e,"getCurrentUser",(function(){return l.a})),n.d(e,"refetchCurrentUser",(function(){return l.b})),n.d(e,"userHasAccess",(function(){return l.c}));var d=n(18);n.d(e,"getCurrentPatient",(function(){return d.a})),n.d(e,"refetchCurrentPatient",(function(){return d.c})),n.d(e,"getCurrentPatientUuid",(function(){return d.b}));var h=n(32);n.d(e,"useCurrentPatient",(function(){return h.a}));var p=n(33);n.d(e,"backendDependencies",(function(){return p.a}));var b=n(34);n.d(e,"newWorkspaceItem",(function(){return b.b})),n.d(e,"getNewWorkspaceItem",(function(){return b.a}))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){(function(){n(12);var e=n(16),r=n(48),i=n(49),o=n(51),u=n(52),c=n(53),s=n(54),a=n(55),f=n(56),l=n(57),d=n(58);t.exports=function(t,n){var h=e.Middleware,p=e.$$Attr,b=function(t){return p("method",t)},v=function(t,e){return p("headers."+t,e)},y=h(u),m=h(c(t,n)).and(y).and(i.$Basic).and(i.$Bearer).and(i.$Credentials).and(o.$JsonData).and(v("Accept",t.headers&&t.headers.Accept?t.headers.Accept:"application/json")).and(v("Content-Type",t.headers&&t.headers["Content-Type"]?t.headers["Content-Type"]:"application/json")),w=m.and(b("GET")),g=m.and(b("POST")),_=m.and(b("PUT")),E=m.and(b("DELETE")),x=m.and(b("PATCH")),O=o.Http(t,n),S=l.Path,j=S(t.baseUrl),P=j.slash(":type || :resource.resourceType"),T=P.slash("_history"),$=P.slash(":id || :resource.id"),A=$.slash("_history"),I=$.slash(":versionId || :resource.meta.versionId"),N=j.slash(":target.resourceType || :target.type").slash(":target.id").slash(":target.versionId"),C=v("Prefer","return=representation"),k=h(r.$Paging);return d({conformance:w.and(j.slash("metadata")).end(O),document:g.and(j.slash("Document")).end(O),profile:w.and(j.slash("Profile").slash(":type")).end(O),transaction:g.and(j).end(O),history:w.and(j.slash("_history")).and(k).end(O),typeHistory:w.and(T).and(k).end(O),resourceHistory:w.and(A).and(k).end(O),read:w.and(a.$WithPatient).and($).end(O),vread:w.and(I).end(O),delete:E.and($).and(C).end(O),create:g.and(P).and(C).end(O),validate:g.and(P.slash("_validate")).end(O),meta:{add:g.and(N.slash("$meta-add")).end(O),delete:g.and(N.slash("$meta-delete")).end(O),read:w.and(N.slash("$meta")).end(O)},search:w.and(P).and(a.$WithPatient).and(r.$SearchParams).and(k).end(O),update:_.and($).and(C).end(O),conditionalUpdate:_.and(P).and(r.$SearchParams).and(C).end(O),conditionalDelete:E.and(P).and(r.$SearchParams).and(C).end(O),nextPage:w.and(s.$$BundleLinkUrl("next")).end(O),prevPage:w.and(s.$$BundleLinkUrl("previous")).and(s.$$BundleLinkUrl("prev")).end(O),getBundleByUrl:w.and(S(":url")).end(O),resolve:w.and(f.resolve).end(O),patch:x.and($).and(v("Content-Type","application/json-patch+json")).end(O)},n)}}).call(this)},function(t,e,n){(function(t){!function(e){var n=function(t){return i(!0===t,!1,arguments)};function r(t,e){if("object"!==o(t))return e;for(var n in e)"object"===o(t[n])&&"object"===o(e[n])?t[n]=r(t[n],e[n]):t[n]=e[n];return t}function i(t,e,i){var u=i[0],c=i.length;(t||"object"!==o(u))&&(u={});for(var s=0;s<c;++s){var a=i[s];if("object"===o(a))for(var f in a)if("__proto__"!==f){var l=t?n.clone(a[f]):a[f];u[f]=e?r(u[f],l):l}}return u}function o(t){return{}.toString.call(t).slice(8,-1).toLowerCase()}n.recursive=function(t){return i(!0===t,!0,arguments)},n.clone=function(t){var e,r,i=t,u=o(t);if("array"===u)for(i=[],r=t.length,e=0;e<r;++e)i[e]=n.clone(t[e]);else if("object"===u)for(e in i={},t)i[e]=n.clone(t[e]);return i},e?t.exports=n:window.merge=n}(t&&"object"==typeof t.exports&&t.exports)}).call(this,n(47)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){(function(){var t=n(12),r=t.type,i=t.assertArray,o=(t.assertObject,t.reduceMap),u=t.identity,c={$gt:"gt",$lt:"lt",$lte:"lte",$gte:"gte",$ge:"ge",$le:"le"},s={$asc:":asc",$desc:":desc",$exact:":exact",$missing:":missing",$null:":missing",$text:":text"},a=function(t,e){if("$sort"===t)return function(t){var e,n,o,u;for(i(t),o=[],e=0,n=t.length;e<n;e++)switch(u=t[e],r(u)){case"array":o.push({param:"_sort",value:u[0],modifier:":"+u[1]});break;case"string":o.push({param:"_sort",value:u});break;default:o.push(void 0)}return o}(e);if("$has"===t)return o(e,(function(t,e){var n,i;return n=e[0],i=e[1],t.concat(function(){switch(r(i)){case"array":return i.map((function(t){return{param:"_has",value:n+"="+t}}));case"string":return[{param:"_has",value:n+"="+i}]}}())}));if("$include"===t||"$revInclude"===t)return function(t,e){return o(t,(function(t,n){var i,o;return i=n[0],o=n[1],t.concat(function(){switch(r(o)){case"array":return o.map((function(t){return{param:"$include"===e?"_include":"_revinclude",value:i+":"+t}}));case"string":return[{param:"$include"===e?"_include":"_revinclude",value:i+":"+o}]}}())}))}(e,t);switch(r(e)){case"object":return function(t,e){return o(e,(function(n,o){var u,f,l,d;return u=o[0],d=o[1],n.concat("$and"===u?i(d).reduce((function(e,n){return e.concat(a(t,n))}),[]):"$type"===u?[]:function(t){return 0===t.indexOf("$")}(u)?(f={param:t},"$or"===u?f.value=d:(c[u]&&(f.operator=c[u]),s[u]&&(f.modifier=s[u]),"object"===r(d)&&d.$or?f.value=d.$or:f.value=[d]),[f]):(e.$type&&(l=":"+e.$type),a(""+t+(l||"")+"."+u,d)))}))}(t,e);case"string":case"number":return[{param:t,value:[e]}];case"array":return[{param:t,value:[e.join("|")]}];default:throw"could not linearizeParams "+r(e)}},f=function(t){return o(t,(function(t,e){var n,r;return n=e[0],r=e[1],t.concat(a(n,r))}))},l=function(t){var e,n,r=["_include","_revinclude","_has"];return function(){var i,o,c,s;for(s=[],i=0,o=(c=f(t)).length;i<o;i++)e=c[i],n=-1===r.indexOf(e.param)?encodeURIComponent(e.value):e.value,s.push([e.param,e.modifier,"_has"==e.param?":":"=",e.operator,n].filter(u).join(""));return s}().join("&")};e._query=f,e.query=l;var d=n(16);e.$SearchParams=d.$$Attr("url",(function(t){var e=t.url;return t.query?e+"?"+l(t.query):e})),e.$Paging=function(t){return function(e){var n=e.params||{};return e.since&&(n._since=e.since),e.count&&(n._count=e.count),e.params=n,t(e)}}}).call(this)},function(t,e,n){(function(){var t,r=n(16),i=n(50).btoa;e.$Basic=r.$$Attr("headers.Authorization",(function(t){if(t.auth&&t.auth.user&&t.auth.pass)return"Basic "+i(t.auth.user+":"+t.auth.pass)})),e.$Bearer=r.$$Attr("headers.Authorization",(function(t){if(t.auth&&t.auth.bearer)return"Bearer "+t.auth.bearer})),e.$Credentials=r.Middleware(r.$$Attr("credentials",(function(e){return t=e.credentials,""}))).and(r.$$Attr("credentials",(function(e){if(["same-origin","include"].indexOf(t)>-1)return t})))}).call(this)},function(t,e,n){!function(){var t=e,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(t){this.message=t}r.prototype=new Error,r.prototype.name="InvalidCharacterError",t.btoa||(t.btoa=function(t){for(var e,i,o=String(t),u=0,c=n,s="";o.charAt(0|u)||(c="=",u%1);s+=c.charAt(63&e>>8-u%1*8)){if((i=o.charCodeAt(u+=3/4))>255)throw new r("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");e=e<<8|i}return s}),t.atob||(t.atob=function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var i,o,u=0,c=0,s="";o=e.charAt(c++);~o&&(i=u%4?64*i+o:o,u++%4)?s+=String.fromCharCode(255&i>>(-2*u&6)):0)o=n.indexOf(o);return s})}()},function(t,e,n){(function(){var t=n(12);e.Http=function(t,e){return function(n){n.debug&&console.log("\nDEBUG (request):",n.method,n.url,n);var r=(n.http||e.http||t.http)(n);return n.debug&&r&&r.then&&r.then((function(t){console.log("\nDEBUG: (responce)",t)})),r}};e.$JsonData=function(e){return function(n){var r,i=n.bundle||n.data||n.resource;return i&&(n.data=(r=i,"object"==t.type(r)||"array"==t.type(r)?JSON.stringify(r):r)),e(n)}}}).call(this)},function(t,e){t.exports=function(t){return function(e){try{return t(e)}catch(t){if(e.debug&&(console.log("\nDEBUG: (ERROR in middleware)"),console.log(t.message),console.log(t.stack)),!e.defer)throw console.log("\nDEBUG: (ERROR in middleware)"),console.log(t.message),console.log(t.stack),new Error("I need adapter.defer");var n=e.defer();return n.reject(t),n.promise}}}},function(t,e){(function(){var e=function(t,e,n){var r=t[n];return r&&!e[n]&&(e[n]=r),t};t.exports=function(t,n){return function(r){return function(i){return e(t,i,"baseUrl"),e(t,i,"cache"),e(t,i,"auth"),e(t,i,"patient"),e(t,i,"debug"),e(t,i,"credentials"),e(t,i,"headers"),e(t,i,"agentOptions"),e(n,i,"defer"),e(n,i,"http"),r(i)}}}}).call(this)},function(t,e){e.$$BundleLinkUrl=function(t){return function(e){return function(n){var r=n.bundle&&(n.bundle.link||[]).filter((function(e){return e.relation&&e.relation===t}))[0];return r&&r.url&&(n.url=r.url,n.data=null),e(n)}}}},function(t,e,n){(function(){var t=n(16),r=["Account","AllergyIntolerance","BodySite","CarePlan","Claim","ClinicalImpression","Communication","CommunicationRequest","Composition","Condition","Contract","DetectedIssue","Device","DeviceUseRequest","DeviceUseStatement","DiagnosticOrder","DiagnosticReport","DocumentManifest","DocumentReference","Encounter","EnrollmentRequest","EpisodeOfCare","FamilyMemberHistory","Flag","Goal","ImagingObjectSelection","ImagingStudy","Immunization","ImmunizationRecommendation","List","Media","MedicationAdministration","MedicationDispense","MedicationOrder","MedicationStatement","NutritionOrder","Observation","Order","Procedure","ProcedureRequest","QuestionnaireResponse","ReferralRequest","RelatedPerson","RiskAssessment","Specimen","SupplyDelivery","SupplyRequest","VisionPrescription"];e.$WithPatient=t.$$Simple((function(t){var e=t.type;return t.patient&&("Patient"===e?(t.query=t.query||{},t.query._id=t.patient,t.id=t.patient):r.indexOf(e)>=0&&(t.query=t.query||{},t.query.patient=t.patient)),t}))}).call(this)},function(t,e,n){(function(){var e=n(12),r=/^#(.*)/,i=function(t){var n=t.cache,i=t.reference,o=t.bundle,u=i;if(!u.reference)return null;if(u.reference.match(r))return function(t,e){var n=t.match(r)[1],i=(e.contained||[]).filter((function(t){return(t.id||t._id)==n}))[0];return i&&{content:i}||null}(u.reference,t.resource);var c=e.absoluteUrl(t.baseUrl,u.reference);return(o&&o.entry||[]).filter((function(t){return t.id===c}))[0]||(null!=n?n[c]:void 0)||null};t.exports.sync=i,t.exports.resolve=function(t){return function(n){var o=i(n),u=n.reference,c=n.defer();if(o){if(!n.defer)throw new Error("I need promise constructor 'adapter.defer' in adapter");return c.resolve(o),c.promise}if(!u)throw new Error("No reference found");if(u&&u.reference.match(r))throw new Error("Contained resource not found");return n.url=e.absoluteUrl(n.baseUrl,u.reference),n.data=null,t(n)}}}).call(this)},function(t,e,n){(function(){n(12);var t=n(16),r=function(e,n){var i=function(t){return n&&e.includes("target.versionId")&&!t.target.versionId?n(t):(n&&n(t)+"/"||"")+function(t,e){var n=function(t,e){return 0==t.indexOf(":")?function(t,e){for(var n,r=t.split("||").map((function(t){return t.trim().substring(1)})),i=0;i<r.length;i++){var o=(n=e,r[i].split(".").reduce((function(t,e){return"versionId"===e&&t[e]?"_history/"+t[e]:null==t||null==t?null:t[e]}),n));if(o)return o}return null}(t,e):t}(t.trim(),e);if((null==n||void 0===n)&&0==t.includes("target.versionId"))throw new Error("Parameter "+t+" is required: "+JSON.stringify(e));return n}(e,t)},o=t.Attribute("url",i);return o.slash=function(t){return r(t,i)},o};e.Path=r}).call(this)},function(t,e){(function(){var e,n;function r(t,r,i,o){n.defer();e.search(t).then((function(t){(function t(r,i){var o,u=r.data.entry||[],c=[];for(o=0;o<u.length;o++)c.push(u[o].resource);i(c);var s=n.defer();return e.nextPage({bundle:r.data}).then((function(e){t(e,i).then((function(t){s.resolve()}))}),(function(t){s.resolve()})),s.promise})(t,r).then((function(){i()}),(function(t){o(t)}))}),(function(t){o(t)}))}function i(t){var e=n.defer(),i=[];return r(t,(function(t){t.forEach((function(t){i.push(t)}))}),(function(){e.resolve(i)}),(function(t){e.reject(t)})),e.promise}function o(t,r){var i=n.defer();return e.search(t).then((function(t){var n={},o=[function(){i.resolve(t,n)}];function u(t,r,i){o.push((function(){!function(t,r,i){var o=i.reference;e.resolve({bundle:t,resource:r,reference:i}).then((function(t){var e=t.data||t.content;n[o]=e,c()}))}(t,r,i)}))}function c(){o.pop()()}var s=t.data;s.entry&&s.entry.forEach((function(t){var e=t.resource,i=e.resourceType;r&&r.forEach((function(t){var r=t.split("."),o=r[0],c=r[1],a=e[c];if(i===o&&a){var f=a.reference;n[f]||u(s,e,a)}}))})),c()}),(function(){i.reject("Could not fetch search results")})),i.promise}t.exports=function(t,u){return e=t,n=u,t.drain=r,t.fetchAll=i,t.fetchAllWithReferences=o,t}}).call(this)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=n(2);function o(t,e){return function(n){return n.lift(new u(t,e))}}var u=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.predicate,this.thisArg))},t}(),c=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.thisArg=r,i.count=0,i}return r.a(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return S}));var r=n(0),i=n(26),o=n(1),u=n(23),c=n(7);function s(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var a=s(),f=n(6),l=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function d(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var h=n(20),p=function(t){if(t&&"function"==typeof t[f.a])return r=t,function(t){var e=r[f.a]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(l(t))return Object(u.a)(t);if(d(t))return n=t,function(t){return n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,c.a),t};if(t&&"function"==typeof t[a])return e=t,function(t){for(var n=e[a]();;){var r=void 0;try{r=n.next()}catch(e){return t.error(e),t}if(r.done){t.complete();break}if(t.next(r.value),t.closed)break}return"function"==typeof n.return&&t.add((function(){n.return&&n.return()})),t};var e,n,r,i=Object(h.a)(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+i+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")},b=n(3);var v=n(14);function y(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[f.a]}(t))return function(t,e){return new o.a((function(n){var r=new b.a;return r.add(e.schedule((function(){var i=t[f.a]();r.add(i.subscribe({next:function(t){r.add(e.schedule((function(){return n.next(t)})))},error:function(t){r.add(e.schedule((function(){return n.error(t)})))},complete:function(){r.add(e.schedule((function(){return n.complete()})))}}))}))),r}))}(t,e);if(d(t))return function(t,e){return new o.a((function(n){var r=new b.a;return r.add(e.schedule((function(){return t.then((function(t){r.add(e.schedule((function(){n.next(t),r.add(e.schedule((function(){return n.complete()})))})))}),(function(t){r.add(e.schedule((function(){return n.error(t)})))}))}))),r}))}(t,e);if(l(t))return Object(v.a)(t,e);if(function(t){return t&&"function"==typeof t[a]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new o.a((function(n){var r,i=new b.a;return i.add((function(){r&&"function"==typeof r.return&&r.return()})),i.add(e.schedule((function(){r=t[a](),i.add(e.schedule((function(){if(!n.closed){var t,e;try{var i=r.next();t=i.value,e=i.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}})))}))),i}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}var m=n(2),w=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,n}return r.a(e,t),e.prototype._next=function(t){this.parent.notifyNext(t)},e.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(m.a),g=(m.a,function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(m.a));m.a;function _(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?function(r){return r.pipe(_((function(n,r){return(u=t(n,r),c?y(u,c):u instanceof o.a?u:new o.a(p(u))).pipe(Object(i.a)((function(t,i){return e(n,t,r,i)})));var u,c}),n))}:("number"==typeof e&&(n=e),function(e){return e.lift(new E(t,n))})}var E=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new x(t,this.project,this.concurrent))},t}(),x=function(t){function e(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,e)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new w(this),n=this.destination;n.add(e);var r=function(t,e){if(!e.closed)return t instanceof o.a?t.subscribe(e):p(t)(e)}(t,e);r!==e&&n.add(r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(g),O=n(21);function S(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),_(O.a,t)}}]))}}})); | ||
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(2);var i=n(11),o=n(16);var u=n(7),c=n(21);function s(t){return 0===t.length?c.a:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var a=n(4),f=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var u=this.operator,c=function(t,e,n){if(t){if(t instanceof r.a)return t;if(t[i.a])return t[i.a]()}return t||e||n?new r.a(t,e,n):new r.a(o.a)}(t,e,n);if(u?c.add(u.call(c,this.source)):c.add(this.source||a.a.useDeprecatedSynchronousErrorHandling&&!c.syncErrorThrowable?this._subscribe(c):this._trySubscribe(c)),a.a.useDeprecatedSynchronousErrorHandling&&c.syncErrorThrowable&&(c.syncErrorThrowable=!1,c.syncErrorThrown))throw c.syncErrorValue;return c},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){a.a.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),!function(t){for(;t;){var e=t,n=e.closed,i=e.destination,o=e.isStopped;if(n||o)return!1;t=i&&i instanceof r.a?i:null}return!0}(t)?console.warn(e):t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=l(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(t){r(t),i&&i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[u.a]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:s(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=l(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function l(t){if(t||(t=a.a.Promise||Promise),!t)throw new Error("no Promise impl found");return t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(0),i=n(12),o=n(16),u=n(3),c=n(11),s=n(4),a=n(8),f=function(t){function e(n,r,i){var u=t.call(this)||this;switch(u.syncErrorValue=null,u.syncErrorThrown=!1,u.syncErrorThrowable=!1,u.isStopped=!1,arguments.length){case 0:u.destination=o.a;break;case 1:if(!n){u.destination=o.a;break}if("object"==typeof n){n instanceof e?(u.syncErrorThrowable=n.syncErrorThrowable,u.destination=n,n.add(u)):(u.syncErrorThrowable=!0,u.destination=new l(u,n));break}default:u.syncErrorThrowable=!0,u.destination=new l(u,n,r,i)}return u}return r.a(e,t),e.prototype[c.a]=function(){return this},e.create=function(t,n,r){var i=new e(t,n,r);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(u.a),l=function(t){function e(e,n,r,u){var c,s=t.call(this)||this;s._parentSubscriber=e;var a=s;return Object(i.a)(n)?c=n:n&&(c=n.next,r=n.error,u=n.complete,n!==o.a&&(a=Object.create(n),Object(i.a)(a.unsubscribe)&&s.add(a.unsubscribe.bind(a)),a.unsubscribe=s.unsubscribe.bind(s))),s._context=a,s._next=c,s._error=r,s._complete=u,s}return r.a(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;s.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=s.a.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):Object(a.a)(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;Object(a.a)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};s.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),s.a.useDeprecatedSynchronousErrorHandling)throw t;Object(a.a)(t)}},e.prototype.__tryOrSetError=function(t,e,n){if(!s.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return s.a.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(Object(a.a)(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(f)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}(),i=n(20),o=n(12),u=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),c=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var e;if(!this.closed){var n=this._parentOrParents,c=this._ctorUnsubscribe,a=this._unsubscribe,f=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(var l=0;l<n.length;++l){n[l].remove(this)}if(Object(o.a)(a)){c&&(this._unsubscribe=void 0);try{a.call(this)}catch(t){e=t instanceof u?s(t.errors):[t]}}if(r(f)){l=-1;for(var d=f.length;++l<d;){var h=f[l];if(Object(i.a)(h))try{h.unsubscribe()}catch(t){e=e||[],t instanceof u?e=e.concat(s(t.errors)):e.push(t)}}}if(e)throw new u(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=n._parentOrParents;if(null===i)n._parentOrParents=this;else if(i instanceof t){if(i===this)return n;n._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return n;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[n]:o.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=((e=new t).closed=!0,e),t}();function s(t){return t.reduce((function(t,e){return t.concat(e instanceof u?e.errors:e)}),[])}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;r=t},get useDeprecatedSynchronousErrorHandling(){return r}}},function(t,n){t.exports=e},function(t,e){t.exports=n},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},function(t,e,n){"use strict";function r(t){setTimeout((function(){throw t}),0)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return v})),n.d(e,"b",(function(){return m})),n.d(e,"c",(function(){return w}));var r=n(39),i=n(60),o=n(0),u=n(2);function c(){}var s=n(12);var a=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new f(t,this.nextOrObserver,this.error,this.complete))},t}(),f=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o._tapNext=c,o._tapError=c,o._tapComplete=c,o._tapError=r||c,o._tapComplete=i||c,Object(s.a)(n)?(o._context=o,o._tapNext=n):n&&(o._context=n,o._tapNext=n.next||c,o._tapError=n.error||c,o._tapComplete=n.complete||c),o}return o.a(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(u.a),l=n(26),d=n(59),h=n(14);const p=new r.a(1);let b=0;function v(t={includeAuthStatus:!1}){return b<Date.now()-6e4&&m(),p.asObservable().pipe(Object(i.a)(),(e=y,function(t){return t.lift(new a(e,n,r))}),Object(l.a)(e=>t.includeAuthStatus?e.data:e.data.user),Object(d.a)(Boolean));var e,n,r}function y(t){var e,n,r;if(null==t||null===(e=t.data)||void 0===e||null===(n=e.user)||void 0===n||null===(r=n.userProperties)||void 0===r?void 0:r.defaultLocale){const e=t.data.user.userProperties.defaultLocale;e!=document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",e)}}function m(){b=Date.now(),p.next(Object(h.b)("/ws/rest/v1/session"))}function w(t,e){return function(t,e){return e.privileges.find(e=>t===e.display)}(t,e)||function(t){return t.roles.find(t=>"System Developer"===t.display)}(e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},function(t,e,n){"use strict";function r(t){return"function"==typeof t}n.d(e,"a",(function(){return r}))},function(t,e,n){(function(){var t=n(46),r=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,i=function(t){return t?t.toString().replace(r,""):""};e.trim=i;var o=function(t){return null==t&&void 0===t?String(t):{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"}[Object.prototype.toString.call(t)]};e.type=o;e.assertArray=function(t){if("array"!==o(t))throw"not array";return t};var u=function(t){if("object"!==o(t))throw"not object";return t};e.assertObject=u;var c=function(t,e,n){var r,i;return n||(n=[]),u(t),function(){var e;for(r in e=[],t)i=t[r],e.push([r,i]);return e}().reduce(e,n)};e.reduceMap=c;e.identity=function(t){return t};var s=function(){return Array.prototype.slice.call(arguments)};e.argsArray=s;e.mergeLists=function(){var e;return e=function(e,n){var r,i,o;for(r in i=t(!0,e),n)o=n[r],i[r]=(i[r]||[]).concat(o);return i},s.apply(null,arguments).reduce(e,{})};e.absoluteUrl=function(t,e){return e.match(/https?:\/\/./)?e:t+"/"+e};e.relativeUrl=function(t,e){return e.slice(e,t.length+1)===t+"/"?e.slice(t.length+1):e},e.resourceIdToUrl=function(t,e,n){return e=e.replace(/\/$/,""),(t=t.replace(/^\//,"")).indexOf("/")<0?e+"/"+n+"/"+t:0!==t.indexOf(e)?e+"/"+t:t};var a=function(t,e,n,r){var i;switch(o(n)){case"array":return e(n.map((function(e){return t(e,[n,r])})),r);case"object":return i=function(e,i){var o,u;return o=i[0],u=i[1],e[o]=t(u,[n].concat(r)),e},e(c(n,i,{}),r);default:return e(n,r)}};e.walk=a;var f=function(t,e,n){return e?a(f(t),t,e,n):function(e,n){return f(t,e,n)}};e.postwalk=f}).call(this)},function(t,e,n){"use strict";n.d(e,"b",(function(){return j})),n.d(e,"c",(function(){return P})),n.d(e,"a",(function(){return T}));var r=n(1),i=n(37),o=n(38),u="object"==typeof self&&self&&self.Object===Object&&self,c=(o.a||u||Function("return this")()).Symbol,s=Object.prototype,a=s.hasOwnProperty,f=s.toString,l=c?c.toStringTag:void 0;var d=function(t){var e=a.call(t,l),n=t[l];try{t[l]=void 0;var r=!0}catch(t){}var i=f.call(t);return r&&(e?t[l]=n:delete t[l]),i},h=Object.prototype.toString;var p=function(t){return h.call(t)},b=c?c.toStringTag:void 0;var v=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":b&&b in Object(t)?d(t):p(t)};var y=function(t,e){return function(n){return t(e(n))}}(Object.getPrototypeOf,Object);var m=function(t){return null!=t&&"object"==typeof t},w=Function.prototype,g=Object.prototype,_=w.toString,E=g.hasOwnProperty,x=_.call(Object);var O=function(t){if(!m(t)||"[object Object]"!=v(t))return!1;var e=y(t);if(null===e)return!0;var n=E.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&_.call(n)==x},S=n(6);function j(t,e={}){if("string"!=typeof t)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof e)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.");t=window.openmrsBase+t,e.headers||(e.headers={}),O(e.body)&&(e.body=JSON.stringify(e.body)),void 0===e.headers.Accept&&(e.headers.Accept="application/json"),null===e.headers.Accept&&delete e.headers.Accept;const n=Error();return window.fetch(t,e).then(async e=>{const r=e;if(r.ok)return 204===r.status?(r.data=null,r):r.json().then(t=>(r.data=t,r));{const{redirectAuthFailure:e}=await Object(S.getConfig)("@openmrs/esm-api");if(e.enabled&&e.errors.indexOf(r.status)>=0){return(t=>t.startsWith(window.getOpenmrsSpaBase()))(e.url)?Object(i.navigateToUrl)(e.url):location.assign(e.url),e.resolvePromise?Promise.resolve():new Promise(t=>{})}return r.text().then(e=>{let i=e;try{i=JSON.parse(e)}catch(t){}throw new T(t,r,i,n)},e=>{throw new T(t,r,null,n)})}})}function P(t,e={}){if("object"!=typeof e)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");const n=new AbortController;return e.signal=n.signal,new r.a(r=>{let i=!1;return j(t,e).then(t=>{i=!0,r.next(t),r.complete()},t=>{i=!0,r.error(t)}),()=>{i||n.abort()}})}class T extends Error{constructor(t,e,n,r){super(),this.message=`Server responded with ${e.status} (${e.statusText}) for url ${t}. Check err.responseBody or network tab in dev tools for more info`,r.message=this.message,this.responseBody=n,this.response=e,this.stack=`Stacktrace for outgoing request:\n${r.stack}\nStacktrace for incoming response:\n${this.stack}`}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(1),i=n(3);function o(t,e){return new r.a((function(n){var r=new i.a,o=0;return r.add(e.schedule((function(){o!==t.length?(n.next(t[o++]),n.closed||r.add(this.schedule())):n.complete()}))),r}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(4),i=n(8),o={closed:!0,next:function(t){},error:function(t){if(r.a.useDeprecatedSynchronousErrorHandling)throw t;Object(i.a)(t)},complete:function(){}}},function(t,e,n){(function(){var t=n(13),r=function(t){return t.and=function(e){return r((n=t,i=e,function(t){return n(i(t))}));var n,i},t.end=function(e){return t(e)},t};e.$$Simple=function(t){return function(e){return function(n){return e(t(n))}}};e.$$Attr=function(e,n){return r((function(r){return function(i){var o=null;return o="function"==t.type(n)?n(i):n,r(null==o&&null==o?i:function(t,e,n){for(var r=e.split("."),i=t,o=0;o<r.length-1;o++){var u=r[o];(i=t[u])||(i={},t[u]=i)}return i[r[r.length-1]]=n,t}(i,e,o))}}))};var i=function(t,e){return r((function(n){return function(r){return r[t]=e(r),n(r)}}))};e.Middleware=r,e.Attribute=i,e.Method=function(t){return i("method",(e=t,function(){return e}));var e}}).call(this)},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var r=n(14);const i="/ws/fhir2/R4",o=n(45)({baseUrl:i},{http:t=>Object(r.b)(t.url,{method:t.method,headers:t.headers}).then(e=>({status:e.status,headers:e.headers,data:e.data,config:t}),e=>({status:e.response.status,headers:e.response.headers,data:e.responseBody,config:t}))})},function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"c",(function(){return d})),n.d(e,"b",(function(){return h}));var r=n(39),i=n(18),o=n(60),u=n(26),c=n(59);let s;const a=new r.a(1),f=new r.a(1);function l(t={includeConfig:!1}){return f.asObservable().pipe(Object(o.a)(),Object(u.a)(e=>t.includeConfig?e:e.data),Object(c.a)(Boolean))}function d(){f.next(i.a.read({type:"Patient",patient:s}))}function h(){return a.asObservable()}window.addEventListener("single-spa:routing-event",()=>{const t=function(){const t=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return t&&t[1]}();t&&t!==s&&(s=t,a.next(t),t&&f.next(i.a.read({type:"Patient",patient:s})))})},function(t,e,n){"use strict";function r(t){return null!==t&&"object"==typeof t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return r.a(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(n(3).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(0),i=n(1),o=n(2),u=n(3),c=n(9),s=n(22),a=n(11),f=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return r.a(e,t),e}(o.a),l=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return r.a(e,t),e.prototype[a.a]=function(){return new f(this)},e.prototype.lift=function(t){var e=new d(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new c.a;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new c.a;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new c.a;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new c.a;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new c.a;return this.hasError?(t.error(this.thrownError),u.a.EMPTY):this.isStopped?(t.complete(),u.a.EMPTY):(this.observers.push(t),new s.a(this,t))},e.prototype.asObservable=function(){var t=new i.a;return t.source=this,t},e.create=function(t,e){return new d(t,e)},e}(i.a),d=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return r.a(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):u.a.EMPTY},e}(l)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=n(2);function o(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new u(t,e))}}var u=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.project,this.thisArg))},t}(),c=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return r.a(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(i.a)},function(t,e){t.exports=r},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(5),i=n.n(r),o=n(10);const u=({privilege:t,children:e})=>{const[n,r]=i.a.useState(null);return i.a.useEffect(()=>{const t=Object(o.a)({includeAuthStatus:!1}).subscribe(r);return()=>t.unsubscribe()},[]),n&&Object(o.c)(t,n)?i.a.createElement(i.a.Fragment,null,e):null}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(5),i=n.n(r);const o=({name:t,params:e})=>{const n=i.a.useRef(null);return i.a.useEffect(()=>{if(n.current)return window.renderOpenmrsExtension(n.current,t,e)},[t,e]),i.a.createElement("slot",{ref:n})}},function(t,e){},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(6),i=n(10);function o(){Object(r.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:r.Type.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:r.Type.String,_default:"${openmrsSpaBase}/login",_validators:[r.validators.isUrl]},errors:{_type:r.Type.Array,_default:[401],_elements:{_type:r.Type.Number,_validators:[r.validators.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:r.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."}}}),Object(i.b)()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(5),i=n.n(r),o=n(19),u=n(27);function c(){const[t,e]=i.a.useReducer(s,a);return i.a.useEffect(()=>{const t=Object(o.b)().subscribe(t=>e({type:f.newUuid,uuid:t}),Object(u.createErrorHandler)());return()=>{t.unsubscribe()}},[]),i.a.useEffect(()=>{const t=Object(o.a)().subscribe(t=>e({type:f.newPatient,patient:t}),t=>{e({type:f.patientLoadError,err:t}),Object(u.reportError)(t)});return()=>{t.unsubscribe()}},[]),[t.isLoadingPatient,t.patient,t.patientUuid,t.err]}function s(t,e){switch(e.type){case f.newUuid:return{...t,patientUuid:e.uuid,patient:null,isLoadingPatient:!0,err:null};case f.newPatient:return{...t,patient:e.patient,isLoadingPatient:!1,err:null};case f.patientLoadError:return{...t,patient:null,isLoadingPatient:!1,err:e.err};default:throw Error()}}const a={patientUuid:null,patient:null,isLoadingPatient:!0,err:null};var f;!function(t){t.newUuid="newUuid",t.newPatient="newPatient",t.patientLoadError="patientLoadError"}(f||(f={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));const r=new(n(25).a);function i(t){r.next(t)}function o(){return r.asObservable()}},function(t,e,n){"use strict";function r(t,e){for(var n in e)t[n]=e[n];return t}n.d(e,"b",(function(){return u})),n.d(e,"d",(function(){return c})),n.d(e,"a",(function(){return s})),n.d(e,"c",(function(){return a}));var i=function(t){var e=[];function n(t){for(var n=[],r=0;r<e.length;r++)e[r]===t?t=null:n.push(e[r]);e=n}function i(n,i,o){t=i?n:r(r({},t),n);for(var u=e,c=0;c<u.length;c++)u[c](t,o)}return t=t||{},{action:function(e){function n(t){i(t,!1,e)}return function(){for(var r=arguments,i=[t],o=0;o<arguments.length;o++)i.push(r[o]);var u=e.apply(this,i);if(null!=u)return u.then?u.then(n):n(u)}},setState:i,subscribe:function(t){return e.push(t),function(){n(t)}},unsubscribe:n,getState:function(){return t}}};const o={};function u(t,e){const n=o[t];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(e,!0),n.active=!0,n.value;{const n=i(e);return o[t]={value:n,active:!0},n}}function c(t,e){const n=o[t];if(!n){const n=i(e);return o[t]={value:n,active:!1},n}return n.value}function s(t){return u("app",t)}function a(){return c("app",{})}},function(t,e,n){function r(t,e){const n=document.createElement("a");n.href=t;const r="/"===n.pathname[0]?n.pathname:"/"+n.pathname;let i=0,o=r.length;for(;i!==e&&o>=0;){"/"===r[--o]&&i++}if(i!==e)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+e+") is greater than the number of directories ("+i+") in the URL path "+t);const u=r.slice(0,o+1);return n.protocol+"//"+n.host+u}e.setPublicPath=function(t,e){if(e||(e=1),"string"!=typeof t||0===t.trim().length)throw Error("systemjs-webpack-interop: setPublicPath(systemjsModuleName) must be called with a non-empty string 'systemjsModuleName'");if("number"!=typeof e||e<=0||!i(e))throw Error("systemjs-webpack-interop: setPublicPath(systemjsModuleName, rootDirectoryLevel) must be called with a positive integer 'rootDirectoryLevel'");let o;try{if(o=window.System.resolve(t),!o)throw Error()}catch(e){throw Error("systemjs-webpack-interop: There is no such module '"+t+"' in the SystemJS registry. Did you misspell the name of your module?")}n.p=r(o,e)},e.resolveDirectory=r;const i=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}},function(t,e){t.exports=i},function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.a=n}).call(this,n(44))},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var r=n(0),i=n(25),o=n(3),u=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return r.a(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return r.a(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,n){return t.call(this)||this}return r.a(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(o.a))),c=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}(),s=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e}(function(t){function e(n,r){void 0===r&&(r=c.now);var i=t.call(this,n,(function(){return e.delegate&&e.delegate!==i?e.delegate.now():r()}))||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return r.a(e,t),e.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,i):t.prototype.schedule.call(this,n,r,i)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(c)))(u),a=n(2),f=n(1),l=new f.a((function(t){return t.complete()}));function d(t){return t?function(t){return new f.a((function(e){return t.schedule((function(){return e.complete()}))}))}(t):l}function h(t){return t&&"function"==typeof t.schedule}var p,b=n(23),v=n(15);function y(t,e){return e?Object(v.a)(t,e):new f.a(Object(b.a)(t))}function m(t){var e=t.error;t.subscriber.error(e)}p||(p={});var w=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){var t,e;switch(this.kind){case"N":return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return h(n)?(t.pop(),Object(v.a)(t,n)):y(t)}(this.value);case"E":return t=this.error,e?new f.a((function(n){return e.schedule(m,0,{error:t,subscriber:n})})):new f.a((function(e){return e.error(t)}));case"C":return d()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();var g=function(t){function e(e,n,r){void 0===r&&(r=0);var i=t.call(this,e)||this;return i.scheduler=n,i.delay=r,i}return r.a(e,t),e.dispatch=function(t){var e=t.notification,n=t.destination;e.observe(n),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new _(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(w.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(w.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(w.createComplete()),this.unsubscribe()},e}(a.a),_=function(){return function(t,e){this.notification=t,this.destination=e}}(),E=n(9),x=n(22),O=function(t){function e(e,n,r){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var i=t.call(this)||this;return i.scheduler=r,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=e<1?1:e,i._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return r.a(e,t),e.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var n=this._events;n.push(e),n.length>this._bufferSize&&n.shift()}t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this.isStopped||(this._events.push(new S(this._getNow(),e)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,u=r.length;if(this.closed)throw new E.a;if(this.isStopped||this.hasError?e=o.a.EMPTY:(this.observers.push(t),e=new x.a(this,t)),i&&t.add(t=new g(t,i)),n)for(var c=0;c<u&&!t.closed;c++)t.next(r[c]);else for(c=0;c<u&&!t.closed;c++)t.next(r[c].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||s).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,i=r.length,o=0;o<i&&!(t-r[o].time<n);)o++;return i>e&&(o=Math.max(o,i-e)),o>0&&r.splice(0,o),r},e}(i.a),S=function(){return function(t,e){this.time=t,this.value=e}}()},,function(t,e,n){n(42),t.exports=n(43)},function(t,e,n){"use strict";n.r(e);var r=n(36);Object(r.setPublicPath)("@openmrs/esm-api")},function(t,e,n){"use strict";n.r(e);var r=n(28);n.d(e,"UserHasAccessReact",(function(){return r.a}));var i=n(29);n.d(e,"ExtensionSlotReact",(function(){return i.a}));var o=n(30);for(var u in o)["default","UserHasAccessReact","ExtensionSlotReact"].indexOf(u)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(u);var c=n(14);n.d(e,"openmrsFetch",(function(){return c.b})),n.d(e,"openmrsObservableFetch",(function(){return c.c})),n.d(e,"OpenmrsFetchError",(function(){return c.a}));var s=n(18);n.d(e,"fhirBaseUrl",(function(){return s.b})),n.d(e,"fhir",(function(){return s.a}));var a=n(31);n.d(e,"setupApiModule",(function(){return a.a}));var f=n(35);n.d(e,"createGlobalStore",(function(){return f.b})),n.d(e,"getGlobalStore",(function(){return f.d})),n.d(e,"createAppState",(function(){return f.a})),n.d(e,"getAppState",(function(){return f.c}));var l=n(10);n.d(e,"getCurrentUser",(function(){return l.a})),n.d(e,"refetchCurrentUser",(function(){return l.b})),n.d(e,"userHasAccess",(function(){return l.c}));var d=n(19);n.d(e,"getCurrentPatient",(function(){return d.a})),n.d(e,"refetchCurrentPatient",(function(){return d.c})),n.d(e,"getCurrentPatientUuid",(function(){return d.b}));var h=n(32);n.d(e,"useCurrentPatient",(function(){return h.a}));var p=n(33);n.d(e,"backendDependencies",(function(){return p.a}));var b=n(34);n.d(e,"newWorkspaceItem",(function(){return b.b})),n.d(e,"getNewWorkspaceItem",(function(){return b.a}))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){(function(){n(13);var e=n(17),r=n(48),i=n(49),o=n(51),u=n(52),c=n(53),s=n(54),a=n(55),f=n(56),l=n(57),d=n(58);t.exports=function(t,n){var h=e.Middleware,p=e.$$Attr,b=function(t){return p("method",t)},v=function(t,e){return p("headers."+t,e)},y=h(u),m=h(c(t,n)).and(y).and(i.$Basic).and(i.$Bearer).and(i.$Credentials).and(o.$JsonData).and(v("Accept",t.headers&&t.headers.Accept?t.headers.Accept:"application/json")).and(v("Content-Type",t.headers&&t.headers["Content-Type"]?t.headers["Content-Type"]:"application/json")),w=m.and(b("GET")),g=m.and(b("POST")),_=m.and(b("PUT")),E=m.and(b("DELETE")),x=m.and(b("PATCH")),O=o.Http(t,n),S=l.Path,j=S(t.baseUrl),P=j.slash(":type || :resource.resourceType"),T=P.slash("_history"),$=P.slash(":id || :resource.id"),A=$.slash("_history"),I=$.slash(":versionId || :resource.meta.versionId"),N=j.slash(":target.resourceType || :target.type").slash(":target.id").slash(":target.versionId"),C=v("Prefer","return=representation"),k=h(r.$Paging);return d({conformance:w.and(j.slash("metadata")).end(O),document:g.and(j.slash("Document")).end(O),profile:w.and(j.slash("Profile").slash(":type")).end(O),transaction:g.and(j).end(O),history:w.and(j.slash("_history")).and(k).end(O),typeHistory:w.and(T).and(k).end(O),resourceHistory:w.and(A).and(k).end(O),read:w.and(a.$WithPatient).and($).end(O),vread:w.and(I).end(O),delete:E.and($).and(C).end(O),create:g.and(P).and(C).end(O),validate:g.and(P.slash("_validate")).end(O),meta:{add:g.and(N.slash("$meta-add")).end(O),delete:g.and(N.slash("$meta-delete")).end(O),read:w.and(N.slash("$meta")).end(O)},search:w.and(P).and(a.$WithPatient).and(r.$SearchParams).and(k).end(O),update:_.and($).and(C).end(O),conditionalUpdate:_.and(P).and(r.$SearchParams).and(C).end(O),conditionalDelete:E.and(P).and(r.$SearchParams).and(C).end(O),nextPage:w.and(s.$$BundleLinkUrl("next")).end(O),prevPage:w.and(s.$$BundleLinkUrl("previous")).and(s.$$BundleLinkUrl("prev")).end(O),getBundleByUrl:w.and(S(":url")).end(O),resolve:w.and(f.resolve).end(O),patch:x.and($).and(v("Content-Type","application/json-patch+json")).end(O)},n)}}).call(this)},function(t,e,n){(function(t){!function(e){var n=function(t){return i(!0===t,!1,arguments)};function r(t,e){if("object"!==o(t))return e;for(var n in e)"object"===o(t[n])&&"object"===o(e[n])?t[n]=r(t[n],e[n]):t[n]=e[n];return t}function i(t,e,i){var u=i[0],c=i.length;(t||"object"!==o(u))&&(u={});for(var s=0;s<c;++s){var a=i[s];if("object"===o(a))for(var f in a)if("__proto__"!==f){var l=t?n.clone(a[f]):a[f];u[f]=e?r(u[f],l):l}}return u}function o(t){return{}.toString.call(t).slice(8,-1).toLowerCase()}n.recursive=function(t){return i(!0===t,!0,arguments)},n.clone=function(t){var e,r,i=t,u=o(t);if("array"===u)for(i=[],r=t.length,e=0;e<r;++e)i[e]=n.clone(t[e]);else if("object"===u)for(e in i={},t)i[e]=n.clone(t[e]);return i},e?t.exports=n:window.merge=n}(t&&"object"==typeof t.exports&&t.exports)}).call(this,n(47)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){(function(){var t=n(13),r=t.type,i=t.assertArray,o=(t.assertObject,t.reduceMap),u=t.identity,c={$gt:"gt",$lt:"lt",$lte:"lte",$gte:"gte",$ge:"ge",$le:"le"},s={$asc:":asc",$desc:":desc",$exact:":exact",$missing:":missing",$null:":missing",$text:":text"},a=function(t,e){if("$sort"===t)return function(t){var e,n,o,u;for(i(t),o=[],e=0,n=t.length;e<n;e++)switch(u=t[e],r(u)){case"array":o.push({param:"_sort",value:u[0],modifier:":"+u[1]});break;case"string":o.push({param:"_sort",value:u});break;default:o.push(void 0)}return o}(e);if("$has"===t)return o(e,(function(t,e){var n,i;return n=e[0],i=e[1],t.concat(function(){switch(r(i)){case"array":return i.map((function(t){return{param:"_has",value:n+"="+t}}));case"string":return[{param:"_has",value:n+"="+i}]}}())}));if("$include"===t||"$revInclude"===t)return function(t,e){return o(t,(function(t,n){var i,o;return i=n[0],o=n[1],t.concat(function(){switch(r(o)){case"array":return o.map((function(t){return{param:"$include"===e?"_include":"_revinclude",value:i+":"+t}}));case"string":return[{param:"$include"===e?"_include":"_revinclude",value:i+":"+o}]}}())}))}(e,t);switch(r(e)){case"object":return function(t,e){return o(e,(function(n,o){var u,f,l,d;return u=o[0],d=o[1],n.concat("$and"===u?i(d).reduce((function(e,n){return e.concat(a(t,n))}),[]):"$type"===u?[]:function(t){return 0===t.indexOf("$")}(u)?(f={param:t},"$or"===u?f.value=d:(c[u]&&(f.operator=c[u]),s[u]&&(f.modifier=s[u]),"object"===r(d)&&d.$or?f.value=d.$or:f.value=[d]),[f]):(e.$type&&(l=":"+e.$type),a(""+t+(l||"")+"."+u,d)))}))}(t,e);case"string":case"number":return[{param:t,value:[e]}];case"array":return[{param:t,value:[e.join("|")]}];default:throw"could not linearizeParams "+r(e)}},f=function(t){return o(t,(function(t,e){var n,r;return n=e[0],r=e[1],t.concat(a(n,r))}))},l=function(t){var e,n,r=["_include","_revinclude","_has"];return function(){var i,o,c,s;for(s=[],i=0,o=(c=f(t)).length;i<o;i++)e=c[i],n=-1===r.indexOf(e.param)?encodeURIComponent(e.value):e.value,s.push([e.param,e.modifier,"_has"==e.param?":":"=",e.operator,n].filter(u).join(""));return s}().join("&")};e._query=f,e.query=l;var d=n(17);e.$SearchParams=d.$$Attr("url",(function(t){var e=t.url;return t.query?e+"?"+l(t.query):e})),e.$Paging=function(t){return function(e){var n=e.params||{};return e.since&&(n._since=e.since),e.count&&(n._count=e.count),e.params=n,t(e)}}}).call(this)},function(t,e,n){(function(){var t,r=n(17),i=n(50).btoa;e.$Basic=r.$$Attr("headers.Authorization",(function(t){if(t.auth&&t.auth.user&&t.auth.pass)return"Basic "+i(t.auth.user+":"+t.auth.pass)})),e.$Bearer=r.$$Attr("headers.Authorization",(function(t){if(t.auth&&t.auth.bearer)return"Bearer "+t.auth.bearer})),e.$Credentials=r.Middleware(r.$$Attr("credentials",(function(e){return t=e.credentials,""}))).and(r.$$Attr("credentials",(function(e){if(["same-origin","include"].indexOf(t)>-1)return t})))}).call(this)},function(t,e,n){!function(){var t=e,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(t){this.message=t}r.prototype=new Error,r.prototype.name="InvalidCharacterError",t.btoa||(t.btoa=function(t){for(var e,i,o=String(t),u=0,c=n,s="";o.charAt(0|u)||(c="=",u%1);s+=c.charAt(63&e>>8-u%1*8)){if((i=o.charCodeAt(u+=3/4))>255)throw new r("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");e=e<<8|i}return s}),t.atob||(t.atob=function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var i,o,u=0,c=0,s="";o=e.charAt(c++);~o&&(i=u%4?64*i+o:o,u++%4)?s+=String.fromCharCode(255&i>>(-2*u&6)):0)o=n.indexOf(o);return s})}()},function(t,e,n){(function(){var t=n(13);e.Http=function(t,e){return function(n){n.debug&&console.log("\nDEBUG (request):",n.method,n.url,n);var r=(n.http||e.http||t.http)(n);return n.debug&&r&&r.then&&r.then((function(t){console.log("\nDEBUG: (responce)",t)})),r}};e.$JsonData=function(e){return function(n){var r,i=n.bundle||n.data||n.resource;return i&&(n.data=(r=i,"object"==t.type(r)||"array"==t.type(r)?JSON.stringify(r):r)),e(n)}}}).call(this)},function(t,e){t.exports=function(t){return function(e){try{return t(e)}catch(t){if(e.debug&&(console.log("\nDEBUG: (ERROR in middleware)"),console.log(t.message),console.log(t.stack)),!e.defer)throw console.log("\nDEBUG: (ERROR in middleware)"),console.log(t.message),console.log(t.stack),new Error("I need adapter.defer");var n=e.defer();return n.reject(t),n.promise}}}},function(t,e){(function(){var e=function(t,e,n){var r=t[n];return r&&!e[n]&&(e[n]=r),t};t.exports=function(t,n){return function(r){return function(i){return e(t,i,"baseUrl"),e(t,i,"cache"),e(t,i,"auth"),e(t,i,"patient"),e(t,i,"debug"),e(t,i,"credentials"),e(t,i,"headers"),e(t,i,"agentOptions"),e(n,i,"defer"),e(n,i,"http"),r(i)}}}}).call(this)},function(t,e){e.$$BundleLinkUrl=function(t){return function(e){return function(n){var r=n.bundle&&(n.bundle.link||[]).filter((function(e){return e.relation&&e.relation===t}))[0];return r&&r.url&&(n.url=r.url,n.data=null),e(n)}}}},function(t,e,n){(function(){var t=n(17),r=["Account","AllergyIntolerance","BodySite","CarePlan","Claim","ClinicalImpression","Communication","CommunicationRequest","Composition","Condition","Contract","DetectedIssue","Device","DeviceUseRequest","DeviceUseStatement","DiagnosticOrder","DiagnosticReport","DocumentManifest","DocumentReference","Encounter","EnrollmentRequest","EpisodeOfCare","FamilyMemberHistory","Flag","Goal","ImagingObjectSelection","ImagingStudy","Immunization","ImmunizationRecommendation","List","Media","MedicationAdministration","MedicationDispense","MedicationOrder","MedicationStatement","NutritionOrder","Observation","Order","Procedure","ProcedureRequest","QuestionnaireResponse","ReferralRequest","RelatedPerson","RiskAssessment","Specimen","SupplyDelivery","SupplyRequest","VisionPrescription"];e.$WithPatient=t.$$Simple((function(t){var e=t.type;return t.patient&&("Patient"===e?(t.query=t.query||{},t.query._id=t.patient,t.id=t.patient):r.indexOf(e)>=0&&(t.query=t.query||{},t.query.patient=t.patient)),t}))}).call(this)},function(t,e,n){(function(){var e=n(13),r=/^#(.*)/,i=function(t){var n=t.cache,i=t.reference,o=t.bundle,u=i;if(!u.reference)return null;if(u.reference.match(r))return function(t,e){var n=t.match(r)[1],i=(e.contained||[]).filter((function(t){return(t.id||t._id)==n}))[0];return i&&{content:i}||null}(u.reference,t.resource);var c=e.absoluteUrl(t.baseUrl,u.reference);return(o&&o.entry||[]).filter((function(t){return t.id===c}))[0]||(null!=n?n[c]:void 0)||null};t.exports.sync=i,t.exports.resolve=function(t){return function(n){var o=i(n),u=n.reference,c=n.defer();if(o){if(!n.defer)throw new Error("I need promise constructor 'adapter.defer' in adapter");return c.resolve(o),c.promise}if(!u)throw new Error("No reference found");if(u&&u.reference.match(r))throw new Error("Contained resource not found");return n.url=e.absoluteUrl(n.baseUrl,u.reference),n.data=null,t(n)}}}).call(this)},function(t,e,n){(function(){n(13);var t=n(17),r=function(e,n){var i=function(t){return n&&e.includes("target.versionId")&&!t.target.versionId?n(t):(n&&n(t)+"/"||"")+function(t,e){var n=function(t,e){return 0==t.indexOf(":")?function(t,e){for(var n,r=t.split("||").map((function(t){return t.trim().substring(1)})),i=0;i<r.length;i++){var o=(n=e,r[i].split(".").reduce((function(t,e){return"versionId"===e&&t[e]?"_history/"+t[e]:null==t||null==t?null:t[e]}),n));if(o)return o}return null}(t,e):t}(t.trim(),e);if((null==n||void 0===n)&&0==t.includes("target.versionId"))throw new Error("Parameter "+t+" is required: "+JSON.stringify(e));return n}(e,t)},o=t.Attribute("url",i);return o.slash=function(t){return r(t,i)},o};e.Path=r}).call(this)},function(t,e){(function(){var e,n;function r(t,r,i,o){n.defer();e.search(t).then((function(t){(function t(r,i){var o,u=r.data.entry||[],c=[];for(o=0;o<u.length;o++)c.push(u[o].resource);i(c);var s=n.defer();return e.nextPage({bundle:r.data}).then((function(e){t(e,i).then((function(t){s.resolve()}))}),(function(t){s.resolve()})),s.promise})(t,r).then((function(){i()}),(function(t){o(t)}))}),(function(t){o(t)}))}function i(t){var e=n.defer(),i=[];return r(t,(function(t){t.forEach((function(t){i.push(t)}))}),(function(){e.resolve(i)}),(function(t){e.reject(t)})),e.promise}function o(t,r){var i=n.defer();return e.search(t).then((function(t){var n={},o=[function(){i.resolve(t,n)}];function u(t,r,i){o.push((function(){!function(t,r,i){var o=i.reference;e.resolve({bundle:t,resource:r,reference:i}).then((function(t){var e=t.data||t.content;n[o]=e,c()}))}(t,r,i)}))}function c(){o.pop()()}var s=t.data;s.entry&&s.entry.forEach((function(t){var e=t.resource,i=e.resourceType;r&&r.forEach((function(t){var r=t.split("."),o=r[0],c=r[1],a=e[c];if(i===o&&a){var f=a.reference;n[f]||u(s,e,a)}}))})),c()}),(function(){i.reject("Could not fetch search results")})),i.promise}t.exports=function(t,u){return e=t,n=u,t.drain=r,t.fetchAll=i,t.fetchAllWithReferences=o,t}}).call(this)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=n(2);function o(t,e){return function(n){return n.lift(new u(t,e))}}var u=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.predicate,this.thisArg))},t}(),c=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.thisArg=r,i.count=0,i}return r.a(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return S}));var r=n(0),i=n(26),o=n(1),u=n(23),c=n(8);function s(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var a=s(),f=n(7),l=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function d(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var h=n(20),p=function(t){if(t&&"function"==typeof t[f.a])return r=t,function(t){var e=r[f.a]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(l(t))return Object(u.a)(t);if(d(t))return n=t,function(t){return n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,c.a),t};if(t&&"function"==typeof t[a])return e=t,function(t){for(var n=e[a]();;){var r=void 0;try{r=n.next()}catch(e){return t.error(e),t}if(r.done){t.complete();break}if(t.next(r.value),t.closed)break}return"function"==typeof n.return&&t.add((function(){n.return&&n.return()})),t};var e,n,r,i=Object(h.a)(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+i+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")},b=n(3);var v=n(15);function y(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[f.a]}(t))return function(t,e){return new o.a((function(n){var r=new b.a;return r.add(e.schedule((function(){var i=t[f.a]();r.add(i.subscribe({next:function(t){r.add(e.schedule((function(){return n.next(t)})))},error:function(t){r.add(e.schedule((function(){return n.error(t)})))},complete:function(){r.add(e.schedule((function(){return n.complete()})))}}))}))),r}))}(t,e);if(d(t))return function(t,e){return new o.a((function(n){var r=new b.a;return r.add(e.schedule((function(){return t.then((function(t){r.add(e.schedule((function(){n.next(t),r.add(e.schedule((function(){return n.complete()})))})))}),(function(t){r.add(e.schedule((function(){return n.error(t)})))}))}))),r}))}(t,e);if(l(t))return Object(v.a)(t,e);if(function(t){return t&&"function"==typeof t[a]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new o.a((function(n){var r,i=new b.a;return i.add((function(){r&&"function"==typeof r.return&&r.return()})),i.add(e.schedule((function(){r=t[a](),i.add(e.schedule((function(){if(!n.closed){var t,e;try{var i=r.next();t=i.value,e=i.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}})))}))),i}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}var m=n(2),w=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,n}return r.a(e,t),e.prototype._next=function(t){this.parent.notifyNext(t)},e.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(m.a),g=(m.a,function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(m.a));m.a;function _(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?function(r){return r.pipe(_((function(n,r){return(u=t(n,r),c?y(u,c):u instanceof o.a?u:new o.a(p(u))).pipe(Object(i.a)((function(t,i){return e(n,t,r,i)})));var u,c}),n))}:("number"==typeof e&&(n=e),function(e){return e.lift(new E(t,n))})}var E=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new x(t,this.project,this.concurrent))},t}(),x=function(t){function e(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,e)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new w(this),n=this.destination;n.add(e);var r=function(t,e){if(!e.closed)return t instanceof o.a?t.subscribe(e):p(t)(e)}(t,e);r!==e&&n.add(r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(g),O=n(21);function S(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),_(O.a,t)}}]))}}})); | ||
//# sourceMappingURL=openmrs-esm-api.js.map |
{ | ||
"name": "@openmrs/esm-api", | ||
"version": "3.0.8", | ||
"version": "3.1.0", | ||
"license": "MPL-2.0", | ||
@@ -13,3 +13,4 @@ "description": "The javascript module for interacting with the OpenMRS API", | ||
"typescript": "tsc", | ||
"lint": "eslint src --ext ts,tsx" | ||
"lint": "eslint src --ext ts,tsx", | ||
"format": "prettier --write src/**" | ||
}, | ||
@@ -48,4 +49,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"@openmrs/esm-config": "^3.0.8", | ||
"@openmrs/esm-error-handling": "^3.0.8", | ||
"@openmrs/esm-config": "^3.1.0", | ||
"@openmrs/esm-error-handling": "^3.1.0", | ||
"@types/fhir": "0.0.31", | ||
@@ -60,3 +61,3 @@ "@types/react": "^16.9.46", | ||
}, | ||
"gitHead": "28e5706199375c74c0368b348d0df9ca12b89a74" | ||
"gitHead": "8b912ff27d982ce4d2272490c21917778917e7f8" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { defineConfigSchema } from "@openmrs/esm-config"; | ||
import { defineConfigSchema, Type, validators } from "@openmrs/esm-config"; | ||
import { refetchCurrentUser } from "./shared-api-objects/current-user"; | ||
@@ -8,13 +8,26 @@ | ||
enabled: { | ||
default: true, | ||
_type: Type.Boolean, | ||
_default: true, | ||
_description: | ||
"Whether to redirect logged-out users to `redirectAuthFailure.url`", | ||
}, | ||
url: { | ||
//@ts-ignore | ||
default: window.getOpenmrsSpaBase() + "login", | ||
_type: Type.String, | ||
_default: "${openmrsSpaBase}/login", | ||
_validators: [validators.isUrl], | ||
}, | ||
errors: { | ||
default: [401], | ||
_type: Type.Array, | ||
_default: [401], | ||
_elements: { | ||
_type: Type.Number, | ||
_validators: [validators.inRange(100, 600)], | ||
}, | ||
_description: "The HTTP error codes for which users will be redirected", | ||
}, | ||
resolvePromise: { | ||
default: false, | ||
_type: Type.Boolean, | ||
_default: false, | ||
_description: | ||
"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly.", | ||
}, | ||
@@ -21,0 +34,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
358372
1564