@openmrs/esm-react-utils 3.2.1-pre.1033 → 3.2.1-pre.1036

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see openmrs-esm-react-utils.js.LICENSE.txt */
2
- System.register(["react","@openmrs/esm-config","@openmrs/esm-extensions","@openmrs/esm-globals","react-dom","i18next","react-i18next","@openmrs/esm-api","dayjs"],(function(t,n){var e={},r={},o={},u={},i={},a={},c={},f={},s={};return{setters:[function(t){e.createContext=t.createContext,e.createElement=t.createElement,e.default=t.default,e.useCallback=t.useCallback,e.useContext=t.useContext,e.useDebugValue=t.useDebugValue,e.useEffect=t.useEffect,e.useLayoutEffect=t.useLayoutEffect,e.useMemo=t.useMemo,e.useReducer=t.useReducer,e.useRef=t.useRef,e.useState=t.useState},function(t){r.getConfigStore=t.getConfigStore,r.getExtensionConfigStore=t.getExtensionConfigStore,r.interpolateUrl=t.interpolateUrl,r.navigate=t.navigate},function(t){o.getConnectedExtensions=t.getConnectedExtensions,o.getExtensionInternalStore=t.getExtensionInternalStore,o.getExtensionStore=t.getExtensionStore,o.pushNavigationContext=t.pushNavigationContext,o.registerExtensionSlot=t.registerExtensionSlot,o.renderExtension=t.renderExtension},function(t){u.subscribeConnectivityChanged=t.subscribeConnectivityChanged},function(t){i.default=t.default},function(t){a.default=t.default},function(t){c.I18nextProvider=t.I18nextProvider},function(t){f.defaultVisitCustomRepresentation=t.defaultVisitCustomRepresentation,f.fetchCurrentPatient=t.fetchCurrentPatient,f.getCurrentUser=t.getCurrentUser,f.getLocations=t.getLocations,f.getVisitTypes=t.getVisitTypes,f.openmrsFetch=t.openmrsFetch,f.openmrsObservableFetch=t.openmrsObservableFetch,f.userHasAccess=t.userHasAccess},function(t){s.default=t.default}],execute:function(){t((()=>{var t={748:()=>{System.register([],(function(t,n){return{execute:function(){t((()=>{var t={968:(t,n,e)=>{const r=e(577).R;n.s=function(t){if(t||(t=1),!e.y.meta||!e.y.meta.url)throw console.error("__system_context__",e.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");e.p=r(e.y.meta.url,t)}},577:(t,n,e)=>{n.R=function(t,n){var e=document.createElement("a");e.href=t;for(var r="/"===e.pathname[0]?e.pathname:"/"+e.pathname,o=0,u=r.length;o!==n&&u>=0;)"/"===r[--u]&&o++;if(o!==n)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+n+") is greater than the number of directories ("+o+") in the URL path "+t);var i=r.slice(0,u+1);return e.protocol+"//"+e.host+i},Number.isInteger}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var u=e[n]={exports:{}};return t[n](u,u.exports,r),u.exports}r.y=n,r.d=(t,n)=>{for(var e in n)r.o(n,e)&&!r.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;r.g.importScripts&&(t=r.g.location+"");var n=r.g.document;if(!t&&n&&(n.currentScript&&(t=n.currentScript.src),!t)){var e=n.getElementsByTagName("script");e.length&&(t=e[e.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=t})();var o={};return(0,r(968).s)(1),(()=>{"use strict";function t(t,n){for(var e in n)t[e]=n[e];return t}function n(n){var e=[];function r(t){for(var n=[],r=0;r<e.length;r++)e[r]===t?t=null:n.push(e[r]);e=n}function o(r,o,u){n=o?r:t(t({},n),r);for(var i=e,a=0;a<i.length;a++)i[a](n,u)}return n=n||{},{action:function(t){function e(n){o(n,!1,t)}return function(){for(var r=arguments,o=[n],u=0;u<arguments.length;u++)o.push(r[u]);var i=t.apply(this,o);if(null!=i)return i.then?i.then(e):e(i)}},setState:o,subscribe:function(t){return e.push(t),function(){r(t)}},unsubscribe:r,getState:function(){return n}}}r.r(o),r.d(o,{createAppState:()=>a,createGlobalStore:()=>u,getAppState:()=>c,getGlobalStore:()=>i,subscribeTo:()=>f,update:()=>s});const e={};function u(t,r){const o=e[t];if(o)return o.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):o.value.setState(r,!0),o.active=!0,o.value;{const o=n(r);return e[t]={value:o,active:!0},o}}function i(t,r){const o=e[t];if(!o){const o=n(r);return e[t]={value:o,active:!1},o}return o.value}function a(t){return u("app",t)}function c(){return i("app",{})}function f(t,n,e){let r=n(t.getState());return t.subscribe((t=>{const o=n(t);o!==r&&(r=o,e(o))}))}function s(t,n,e){let[r,...o]=n;return r?0===o.length?{...t,[r]:e}:{...t,[r]:s(t[r]||{},o,e)}:t}})(),o})())}}}))},891:function(t,n,e){var r;t=e.nmd(t),function(){var o,u="Expected a function",i="__lodash_hash_undefined__",a="__lodash_placeholder__",c=32,f=128,s=1/0,l=9007199254740991,p=NaN,h=4294967295,d=[["ary",f],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",c],["partialRight",64],["rearg",256]],v="[object Arguments]",g="[object Array]",y="[object Boolean]",_="[object Date]",m="[object Error]",b="[object Function]",w="[object GeneratorFunction]",x="[object Map]",E="[object Number]",S="[object Object]",C="[object Promise]",R="[object RegExp]",O="[object Set]",j="[object String]",P="[object Symbol]",k="[object WeakMap]",A="[object ArrayBuffer]",L="[object DataView]",T="[object Float32Array]",I="[object Float64Array]",U="[object Int8Array]",M="[object Int16Array]",N="[object Int32Array]",D="[object Uint8Array]",B="[object Uint8ClampedArray]",z="[object Uint16Array]",W="[object Uint32Array]",F=/\b__p \+= '';/g,$=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,Z=RegExp(q.source),H=RegExp(G.source),K=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(nt.source),rt=/^\s+/,ot=/\s/,ut=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,it=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ct=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ft=/[()=,{}\[\]\/\s]/,st=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,ht=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,_t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mt=/($^)/,bt=/['\n\r\u2028\u2029\\]/g,wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",St="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ct="["+St+"]",Rt="["+wt+"]",Ot="\\d+",jt="["+xt+"]",Pt="[^\\ud800-\\udfff"+St+Ot+"\\u2700-\\u27bf"+xt+Et+"]",kt="\\ud83c[\\udffb-\\udfff]",At="[^\\ud800-\\udfff]",Lt="(?:\\ud83c[\\udde6-\\uddff]){2}",Tt="[\\ud800-\\udbff][\\udc00-\\udfff]",It="["+Et+"]",Ut="(?:"+jt+"|"+Pt+")",Mt="(?:"+It+"|"+Pt+")",Nt="(?:['’](?:d|ll|m|re|s|t|ve))?",Dt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Bt="(?:"+Rt+"|"+kt+")?",zt="[\\ufe0e\\ufe0f]?",Wt=zt+Bt+"(?:\\u200d(?:"+[At,Lt,Tt].join("|")+")"+zt+Bt+")*",Ft="(?:"+["[\\u2700-\\u27bf]",Lt,Tt].join("|")+")"+Wt,$t="(?:"+[At+Rt+"?",Rt,Lt,Tt,"[\\ud800-\\udfff]"].join("|")+")",Vt=RegExp("['’]","g"),qt=RegExp(Rt,"g"),Gt=RegExp(kt+"(?="+kt+")|"+$t+Wt,"g"),Zt=RegExp([It+"?"+jt+"+"+Nt+"(?="+[Ct,It,"$"].join("|")+")",Mt+"+"+Dt+"(?="+[Ct,It+Ut,"$"].join("|")+")",It+"?"+Ut+"+"+Nt,It+"+"+Dt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ot,Ft].join("|"),"g"),Ht=RegExp("[\\u200d\\ud800-\\udfff"+wt+"\\ufe0e\\ufe0f]"),Kt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Jt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Yt=-1,Qt={};Qt[T]=Qt[I]=Qt[U]=Qt[M]=Qt[N]=Qt[D]=Qt[B]=Qt[z]=Qt[W]=!0,Qt[v]=Qt[g]=Qt[A]=Qt[y]=Qt[L]=Qt[_]=Qt[m]=Qt[b]=Qt[x]=Qt[E]=Qt[S]=Qt[R]=Qt[O]=Qt[j]=Qt[k]=!1;var Xt={};Xt[v]=Xt[g]=Xt[A]=Xt[L]=Xt[y]=Xt[_]=Xt[T]=Xt[I]=Xt[U]=Xt[M]=Xt[N]=Xt[x]=Xt[E]=Xt[S]=Xt[R]=Xt[O]=Xt[j]=Xt[P]=Xt[D]=Xt[B]=Xt[z]=Xt[W]=!0,Xt[m]=Xt[b]=Xt[k]=!1;var tn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},nn=parseFloat,en=parseInt,rn="object"==typeof e.g&&e.g&&e.g.Object===Object&&e.g,on="object"==typeof self&&self&&self.Object===Object&&self,un=rn||on||Function("return this")(),an=n&&!n.nodeType&&n,cn=an&&t&&!t.nodeType&&t,fn=cn&&cn.exports===an,sn=fn&&rn.process,ln=function(){try{return cn&&cn.require&&cn.require("util").types||sn&&sn.binding&&sn.binding("util")}catch(t){}}(),pn=ln&&ln.isArrayBuffer,hn=ln&&ln.isDate,dn=ln&&ln.isMap,vn=ln&&ln.isRegExp,gn=ln&&ln.isSet,yn=ln&&ln.isTypedArray;function _n(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)}function mn(t,n,e,r){for(var o=-1,u=null==t?0:t.length;++o<u;){var i=t[o];n(r,i,e(i),t)}return r}function bn(t,n){for(var e=-1,r=null==t?0:t.length;++e<r&&!1!==n(t[e],e,t););return t}function wn(t,n){for(var e=null==t?0:t.length;e--&&!1!==n(t[e],e,t););return t}function xn(t,n){for(var e=-1,r=null==t?0:t.length;++e<r;)if(!n(t[e],e,t))return!1;return!0}function En(t,n){for(var e=-1,r=null==t?0:t.length,o=0,u=[];++e<r;){var i=t[e];n(i,e,t)&&(u[o++]=i)}return u}function Sn(t,n){return!(null==t||!t.length)&&In(t,n,0)>-1}function Cn(t,n,e){for(var r=-1,o=null==t?0:t.length;++r<o;)if(e(n,t[r]))return!0;return!1}function Rn(t,n){for(var e=-1,r=null==t?0:t.length,o=Array(r);++e<r;)o[e]=n(t[e],e,t);return o}function On(t,n){for(var e=-1,r=n.length,o=t.length;++e<r;)t[o+e]=n[e];return t}function jn(t,n,e,r){var o=-1,u=null==t?0:t.length;for(r&&u&&(e=t[++o]);++o<u;)e=n(e,t[o],o,t);return e}function Pn(t,n,e,r){var o=null==t?0:t.length;for(r&&o&&(e=t[--o]);o--;)e=n(e,t[o],o,t);return e}function kn(t,n){for(var e=-1,r=null==t?0:t.length;++e<r;)if(n(t[e],e,t))return!0;return!1}var An=Dn("length");function Ln(t,n,e){var r;return e(t,(function(t,e,o){if(n(t,e,o))return r=e,!1})),r}function Tn(t,n,e,r){for(var o=t.length,u=e+(r?1:-1);r?u--:++u<o;)if(n(t[u],u,t))return u;return-1}function In(t,n,e){return n==n?function(t,n,e){for(var r=e-1,o=t.length;++r<o;)if(t[r]===n)return r;return-1}(t,n,e):Tn(t,Mn,e)}function Un(t,n,e,r){for(var o=e-1,u=t.length;++o<u;)if(r(t[o],n))return o;return-1}function Mn(t){return t!=t}function Nn(t,n){var e=null==t?0:t.length;return e?Wn(t,n)/e:p}function Dn(t){return function(n){return null==n?o:n[t]}}function Bn(t){return function(n){return null==t?o:t[n]}}function zn(t,n,e,r,o){return o(t,(function(t,o,u){e=r?(r=!1,t):n(e,t,o,u)})),e}function Wn(t,n){for(var e,r=-1,u=t.length;++r<u;){var i=n(t[r]);i!==o&&(e=e===o?i:e+i)}return e}function Fn(t,n){for(var e=-1,r=Array(t);++e<t;)r[e]=n(e);return r}function $n(t){return t?t.slice(0,ae(t)+1).replace(rt,""):t}function Vn(t){return function(n){return t(n)}}function qn(t,n){return Rn(n,(function(n){return t[n]}))}function Gn(t,n){return t.has(n)}function Zn(t,n){for(var e=-1,r=t.length;++e<r&&In(n,t[e],0)>-1;);return e}function Hn(t,n){for(var e=t.length;e--&&In(n,t[e],0)>-1;);return e}function Kn(t,n){for(var e=t.length,r=0;e--;)t[e]===n&&++r;return r}var Jn=Bn({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Yn=Bn({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Qn(t){return"\\"+tn[t]}function Xn(t){return Ht.test(t)}function te(t){var n=-1,e=Array(t.size);return t.forEach((function(t,r){e[++n]=[r,t]})),e}function ne(t,n){return function(e){return t(n(e))}}function ee(t,n){for(var e=-1,r=t.length,o=0,u=[];++e<r;){var i=t[e];i!==n&&i!==a||(t[e]=a,u[o++]=e)}return u}function re(t){var n=-1,e=Array(t.size);return t.forEach((function(t){e[++n]=t})),e}function oe(t){var n=-1,e=Array(t.size);return t.forEach((function(t){e[++n]=[t,t]})),e}function ue(t){return Xn(t)?function(t){for(var n=Gt.lastIndex=0;Gt.test(t);)++n;return n}(t):An(t)}function ie(t){return Xn(t)?function(t){return t.match(Gt)||[]}(t):function(t){return t.split("")}(t)}function ae(t){for(var n=t.length;n--&&ot.test(t.charAt(n)););return n}var ce=Bn({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),fe=function t(n){var e,r=(n=null==n?un:fe.defaults(un.Object(),n,fe.pick(un,Jt))).Array,ot=n.Date,wt=n.Error,xt=n.Function,Et=n.Math,St=n.Object,Ct=n.RegExp,Rt=n.String,Ot=n.TypeError,jt=r.prototype,Pt=xt.prototype,kt=St.prototype,At=n["__core-js_shared__"],Lt=Pt.toString,Tt=kt.hasOwnProperty,It=0,Ut=(e=/[^.]+$/.exec(At&&At.keys&&At.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"",Mt=kt.toString,Nt=Lt.call(St),Dt=un._,Bt=Ct("^"+Lt.call(Tt).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=fn?n.Buffer:o,Wt=n.Symbol,Ft=n.Uint8Array,$t=zt?zt.allocUnsafe:o,Gt=ne(St.getPrototypeOf,St),Ht=St.create,tn=kt.propertyIsEnumerable,rn=jt.splice,on=Wt?Wt.isConcatSpreadable:o,an=Wt?Wt.iterator:o,cn=Wt?Wt.toStringTag:o,sn=function(){try{var t=su(St,"defineProperty");return t({},"",{}),t}catch(t){}}(),ln=n.clearTimeout!==un.clearTimeout&&n.clearTimeout,An=ot&&ot.now!==un.Date.now&&ot.now,Bn=n.setTimeout!==un.setTimeout&&n.setTimeout,se=Et.ceil,le=Et.floor,pe=St.getOwnPropertySymbols,he=zt?zt.isBuffer:o,de=n.isFinite,ve=jt.join,ge=ne(St.keys,St),ye=Et.max,_e=Et.min,me=ot.now,be=n.parseInt,we=Et.random,xe=jt.reverse,Ee=su(n,"DataView"),Se=su(n,"Map"),Ce=su(n,"Promise"),Re=su(n,"Set"),Oe=su(n,"WeakMap"),je=su(St,"create"),Pe=Oe&&new Oe,ke={},Ae=Bu(Ee),Le=Bu(Se),Te=Bu(Ce),Ie=Bu(Re),Ue=Bu(Oe),Me=Wt?Wt.prototype:o,Ne=Me?Me.valueOf:o,De=Me?Me.toString:o;function Be(t){if(ea(t)&&!qi(t)&&!(t instanceof $e)){if(t instanceof Fe)return t;if(Tt.call(t,"__wrapped__"))return zu(t)}return new Fe(t)}var ze=function(){function t(){}return function(n){if(!na(n))return{};if(Ht)return Ht(n);t.prototype=n;var e=new t;return t.prototype=o,e}}();function We(){}function Fe(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=o}function $e(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Ve(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function qe(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function Ge(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function Ze(t){var n=-1,e=null==t?0:t.length;for(this.__data__=new Ge;++n<e;)this.add(t[n])}function He(t){var n=this.__data__=new qe(t);this.size=n.size}function Ke(t,n){var e=qi(t),r=!e&&Vi(t),o=!e&&!r&&Ki(t),u=!e&&!r&&!o&&sa(t),i=e||r||o||u,a=i?Fn(t.length,Rt):[],c=a.length;for(var f in t)!n&&!Tt.call(t,f)||i&&("length"==f||o&&("offset"==f||"parent"==f)||u&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||yu(f,c))||a.push(f);return a}function Je(t){var n=t.length;return n?t[Gr(0,n-1)]:o}function Ye(t,n){return Iu(jo(t),ir(n,0,t.length))}function Qe(t){return Iu(jo(t))}function Xe(t,n,e){(e!==o&&!Wi(t[n],e)||e===o&&!(n in t))&&or(t,n,e)}function tr(t,n,e){var r=t[n];Tt.call(t,n)&&Wi(r,e)&&(e!==o||n in t)||or(t,n,e)}function nr(t,n){for(var e=t.length;e--;)if(Wi(t[e][0],n))return e;return-1}function er(t,n,e,r){return lr(t,(function(t,o,u){n(r,t,e(t),u)})),r}function rr(t,n){return t&&Po(n,La(n),t)}function or(t,n,e){"__proto__"==n&&sn?sn(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}function ur(t,n){for(var e=-1,u=n.length,i=r(u),a=null==t;++e<u;)i[e]=a?o:Oa(t,n[e]);return i}function ir(t,n,e){return t==t&&(e!==o&&(t=t<=e?t:e),n!==o&&(t=t>=n?t:n)),t}function ar(t,n,e,r,u,i){var a,c=1&n,f=2&n,s=4&n;if(e&&(a=u?e(t,r,u,i):e(t)),a!==o)return a;if(!na(t))return t;var l=qi(t);if(l){if(a=function(t){var n=t.length,e=new t.constructor(n);return n&&"string"==typeof t[0]&&Tt.call(t,"index")&&(e.index=t.index,e.input=t.input),e}(t),!c)return jo(t,a)}else{var p=hu(t),h=p==b||p==w;if(Ki(t))return xo(t,c);if(p==S||p==v||h&&!u){if(a=f||h?{}:vu(t),!c)return f?function(t,n){return Po(t,pu(t),n)}(t,function(t,n){return t&&Po(n,Ta(n),t)}(a,t)):function(t,n){return Po(t,lu(t),n)}(t,rr(a,t))}else{if(!Xt[p])return u?t:{};a=function(t,n,e){var r,o=t.constructor;switch(n){case A:return Eo(t);case y:case _:return new o(+t);case L:return function(t,n){var e=n?Eo(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}(t,e);case T:case I:case U:case M:case N:case D:case B:case z:case W:return So(t,e);case x:return new o;case E:case j:return new o(t);case R:return function(t){var n=new t.constructor(t.source,pt.exec(t));return n.lastIndex=t.lastIndex,n}(t);case O:return new o;case P:return r=t,Ne?St(Ne.call(r)):{}}}(t,p,c)}}i||(i=new He);var d=i.get(t);if(d)return d;i.set(t,a),aa(t)?t.forEach((function(r){a.add(ar(r,n,e,r,t,i))})):ra(t)&&t.forEach((function(r,o){a.set(o,ar(r,n,e,o,t,i))}));var g=l?o:(s?f?ru:eu:f?Ta:La)(t);return bn(g||t,(function(r,o){g&&(r=t[o=r]),tr(a,o,ar(r,n,e,o,t,i))})),a}function cr(t,n,e){var r=e.length;if(null==t)return!r;for(t=St(t);r--;){var u=e[r],i=n[u],a=t[u];if(a===o&&!(u in t)||!i(a))return!1}return!0}function fr(t,n,e){if("function"!=typeof t)throw new Ot(u);return ku((function(){t.apply(o,e)}),n)}function sr(t,n,e,r){var o=-1,u=Sn,i=!0,a=t.length,c=[],f=n.length;if(!a)return c;e&&(n=Rn(n,Vn(e))),r?(u=Cn,i=!1):n.length>=200&&(u=Gn,i=!1,n=new Ze(n));t:for(;++o<a;){var s=t[o],l=null==e?s:e(s);if(s=r||0!==s?s:0,i&&l==l){for(var p=f;p--;)if(n[p]===l)continue t;c.push(s)}else u(n,l,r)||c.push(s)}return c}Be.templateSettings={escape:K,evaluate:J,interpolate:Y,variable:"",imports:{_:Be}},Be.prototype=We.prototype,Be.prototype.constructor=Be,Fe.prototype=ze(We.prototype),Fe.prototype.constructor=Fe,$e.prototype=ze(We.prototype),$e.prototype.constructor=$e,Ve.prototype.clear=function(){this.__data__=je?je(null):{},this.size=0},Ve.prototype.delete=function(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n},Ve.prototype.get=function(t){var n=this.__data__;if(je){var e=n[t];return e===i?o:e}return Tt.call(n,t)?n[t]:o},Ve.prototype.has=function(t){var n=this.__data__;return je?n[t]!==o:Tt.call(n,t)},Ve.prototype.set=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=je&&n===o?i:n,this},qe.prototype.clear=function(){this.__data__=[],this.size=0},qe.prototype.delete=function(t){var n=this.__data__,e=nr(n,t);return!(e<0||(e==n.length-1?n.pop():rn.call(n,e,1),--this.size,0))},qe.prototype.get=function(t){var n=this.__data__,e=nr(n,t);return e<0?o:n[e][1]},qe.prototype.has=function(t){return nr(this.__data__,t)>-1},qe.prototype.set=function(t,n){var e=this.__data__,r=nr(e,t);return r<0?(++this.size,e.push([t,n])):e[r][1]=n,this},Ge.prototype.clear=function(){this.size=0,this.__data__={hash:new Ve,map:new(Se||qe),string:new Ve}},Ge.prototype.delete=function(t){var n=cu(this,t).delete(t);return this.size-=n?1:0,n},Ge.prototype.get=function(t){return cu(this,t).get(t)},Ge.prototype.has=function(t){return cu(this,t).has(t)},Ge.prototype.set=function(t,n){var e=cu(this,t),r=e.size;return e.set(t,n),this.size+=e.size==r?0:1,this},Ze.prototype.add=Ze.prototype.push=function(t){return this.__data__.set(t,i),this},Ze.prototype.has=function(t){return this.__data__.has(t)},He.prototype.clear=function(){this.__data__=new qe,this.size=0},He.prototype.delete=function(t){var n=this.__data__,e=n.delete(t);return this.size=n.size,e},He.prototype.get=function(t){return this.__data__.get(t)},He.prototype.has=function(t){return this.__data__.has(t)},He.prototype.set=function(t,n){var e=this.__data__;if(e instanceof qe){var r=e.__data__;if(!Se||r.length<199)return r.push([t,n]),this.size=++e.size,this;e=this.__data__=new Ge(r)}return e.set(t,n),this.size=e.size,this};var lr=Lo(mr),pr=Lo(br,!0);function hr(t,n){var e=!0;return lr(t,(function(t,r,o){return e=!!n(t,r,o)})),e}function dr(t,n,e){for(var r=-1,u=t.length;++r<u;){var i=t[r],a=n(i);if(null!=a&&(c===o?a==a&&!fa(a):e(a,c)))var c=a,f=i}return f}function vr(t,n){var e=[];return lr(t,(function(t,r,o){n(t,r,o)&&e.push(t)})),e}function gr(t,n,e,r,o){var u=-1,i=t.length;for(e||(e=gu),o||(o=[]);++u<i;){var a=t[u];n>0&&e(a)?n>1?gr(a,n-1,e,r,o):On(o,a):r||(o[o.length]=a)}return o}var yr=To(),_r=To(!0);function mr(t,n){return t&&yr(t,n,La)}function br(t,n){return t&&_r(t,n,La)}function wr(t,n){return En(n,(function(n){return Qi(t[n])}))}function xr(t,n){for(var e=0,r=(n=_o(n,t)).length;null!=t&&e<r;)t=t[Du(n[e++])];return e&&e==r?t:o}function Er(t,n,e){var r=n(t);return qi(t)?r:On(r,e(t))}function Sr(t){return null==t?t===o?"[object Undefined]":"[object Null]":cn&&cn in St(t)?function(t){var n=Tt.call(t,cn),e=t[cn];try{t[cn]=o;var r=!0}catch(t){}var u=Mt.call(t);return r&&(n?t[cn]=e:delete t[cn]),u}(t):function(t){return Mt.call(t)}(t)}function Cr(t,n){return t>n}function Rr(t,n){return null!=t&&Tt.call(t,n)}function Or(t,n){return null!=t&&n in St(t)}function jr(t,n,e){for(var u=e?Cn:Sn,i=t[0].length,a=t.length,c=a,f=r(a),s=1/0,l=[];c--;){var p=t[c];c&&n&&(p=Rn(p,Vn(n))),s=_e(p.length,s),f[c]=!e&&(n||i>=120&&p.length>=120)?new Ze(c&&p):o}p=t[0];var h=-1,d=f[0];t:for(;++h<i&&l.length<s;){var v=p[h],g=n?n(v):v;if(v=e||0!==v?v:0,!(d?Gn(d,g):u(l,g,e))){for(c=a;--c;){var y=f[c];if(!(y?Gn(y,g):u(t[c],g,e)))continue t}d&&d.push(g),l.push(v)}}return l}function Pr(t,n,e){var r=null==(t=Ru(t,n=_o(n,t)))?t:t[Du(Yu(n))];return null==r?o:_n(r,t,e)}function kr(t){return ea(t)&&Sr(t)==v}function Ar(t,n,e,r,u){return t===n||(null==t||null==n||!ea(t)&&!ea(n)?t!=t&&n!=n:function(t,n,e,r,u,i){var a=qi(t),c=qi(n),f=a?g:hu(t),s=c?g:hu(n),l=(f=f==v?S:f)==S,p=(s=s==v?S:s)==S,h=f==s;if(h&&Ki(t)){if(!Ki(n))return!1;a=!0,l=!1}if(h&&!l)return i||(i=new He),a||sa(t)?tu(t,n,e,r,u,i):function(t,n,e,r,o,u,i){switch(e){case L:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return!1;t=t.buffer,n=n.buffer;case A:return!(t.byteLength!=n.byteLength||!u(new Ft(t),new Ft(n)));case y:case _:case E:return Wi(+t,+n);case m:return t.name==n.name&&t.message==n.message;case R:case j:return t==n+"";case x:var a=te;case O:var c=1&r;if(a||(a=re),t.size!=n.size&&!c)return!1;var f=i.get(t);if(f)return f==n;r|=2,i.set(t,n);var s=tu(a(t),a(n),r,o,u,i);return i.delete(t),s;case P:if(Ne)return Ne.call(t)==Ne.call(n)}return!1}(t,n,f,e,r,u,i);if(!(1&e)){var d=l&&Tt.call(t,"__wrapped__"),b=p&&Tt.call(n,"__wrapped__");if(d||b){var w=d?t.value():t,C=b?n.value():n;return i||(i=new He),u(w,C,e,r,i)}}return!!h&&(i||(i=new He),function(t,n,e,r,u,i){var a=1&e,c=eu(t),f=c.length;if(f!=eu(n).length&&!a)return!1;for(var s=f;s--;){var l=c[s];if(!(a?l in n:Tt.call(n,l)))return!1}var p=i.get(t),h=i.get(n);if(p&&h)return p==n&&h==t;var d=!0;i.set(t,n),i.set(n,t);for(var v=a;++s<f;){var g=t[l=c[s]],y=n[l];if(r)var _=a?r(y,g,l,n,t,i):r(g,y,l,t,n,i);if(!(_===o?g===y||u(g,y,e,r,i):_)){d=!1;break}v||(v="constructor"==l)}if(d&&!v){var m=t.constructor,b=n.constructor;m==b||!("constructor"in t)||!("constructor"in n)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(d=!1)}return i.delete(t),i.delete(n),d}(t,n,e,r,u,i))}(t,n,e,r,Ar,u))}function Lr(t,n,e,r){var u=e.length,i=u,a=!r;if(null==t)return!i;for(t=St(t);u--;){var c=e[u];if(a&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++u<i;){var f=(c=e[u])[0],s=t[f],l=c[1];if(a&&c[2]){if(s===o&&!(f in t))return!1}else{var p=new He;if(r)var h=r(s,l,f,t,n,p);if(!(h===o?Ar(l,s,3,r,p):h))return!1}}return!0}function Tr(t){return!(!na(t)||(n=t,Ut&&Ut in n))&&(Qi(t)?Bt:vt).test(Bu(t));var n}function Ir(t){return"function"==typeof t?t:null==t?oc:"object"==typeof t?qi(t)?Br(t[0],t[1]):Dr(t):hc(t)}function Ur(t){if(!xu(t))return ge(t);var n=[];for(var e in St(t))Tt.call(t,e)&&"constructor"!=e&&n.push(e);return n}function Mr(t,n){return t<n}function Nr(t,n){var e=-1,o=Zi(t)?r(t.length):[];return lr(t,(function(t,r,u){o[++e]=n(t,r,u)})),o}function Dr(t){var n=fu(t);return 1==n.length&&n[0][2]?Su(n[0][0],n[0][1]):function(e){return e===t||Lr(e,t,n)}}function Br(t,n){return mu(t)&&Eu(n)?Su(Du(t),n):function(e){var r=Oa(e,t);return r===o&&r===n?ja(e,t):Ar(n,r,3)}}function zr(t,n,e,r,u){t!==n&&yr(n,(function(i,a){if(u||(u=new He),na(i))!function(t,n,e,r,u,i,a){var c=ju(t,e),f=ju(n,e),s=a.get(f);if(s)Xe(t,e,s);else{var l=i?i(c,f,e+"",t,n,a):o,p=l===o;if(p){var h=qi(f),d=!h&&Ki(f),v=!h&&!d&&sa(f);l=f,h||d||v?qi(c)?l=c:Hi(c)?l=jo(c):d?(p=!1,l=xo(f,!0)):v?(p=!1,l=So(f,!0)):l=[]:ua(f)||Vi(f)?(l=c,Vi(c)?l=_a(c):na(c)&&!Qi(c)||(l=vu(f))):p=!1}p&&(a.set(f,l),u(l,f,r,i,a),a.delete(f)),Xe(t,e,l)}}(t,n,a,e,zr,r,u);else{var c=r?r(ju(t,a),i,a+"",t,n,u):o;c===o&&(c=i),Xe(t,a,c)}}),Ta)}function Wr(t,n){var e=t.length;if(e)return yu(n+=n<0?e:0,e)?t[n]:o}function Fr(t,n,e){n=n.length?Rn(n,(function(t){return qi(t)?function(n){return xr(n,1===t.length?t[0]:t)}:t})):[oc];var r=-1;n=Rn(n,Vn(au()));var o=Nr(t,(function(t,e,o){var u=Rn(n,(function(n){return n(t)}));return{criteria:u,index:++r,value:t}}));return function(t,n){var r=t.length;for(t.sort((function(t,n){return function(t,n,e){for(var r=-1,o=t.criteria,u=n.criteria,i=o.length,a=e.length;++r<i;){var c=Co(o[r],u[r]);if(c)return r>=a?c:c*("desc"==e[r]?-1:1)}return t.index-n.index}(t,n,e)}));r--;)t[r]=t[r].value;return t}(o)}function $r(t,n,e){for(var r=-1,o=n.length,u={};++r<o;){var i=n[r],a=xr(t,i);e(a,i)&&Yr(u,_o(i,t),a)}return u}function Vr(t,n,e,r){var o=r?Un:In,u=-1,i=n.length,a=t;for(t===n&&(n=jo(n)),e&&(a=Rn(t,Vn(e)));++u<i;)for(var c=0,f=n[u],s=e?e(f):f;(c=o(a,s,c,r))>-1;)a!==t&&rn.call(a,c,1),rn.call(t,c,1);return t}function qr(t,n){for(var e=t?n.length:0,r=e-1;e--;){var o=n[e];if(e==r||o!==u){var u=o;yu(o)?rn.call(t,o,1):fo(t,o)}}return t}function Gr(t,n){return t+le(we()*(n-t+1))}function Zr(t,n){var e="";if(!t||n<1||n>l)return e;do{n%2&&(e+=t),(n=le(n/2))&&(t+=t)}while(n);return e}function Hr(t,n){return Au(Cu(t,n,oc),t+"")}function Kr(t){return Je(Wa(t))}function Jr(t,n){var e=Wa(t);return Iu(e,ir(n,0,e.length))}function Yr(t,n,e,r){if(!na(t))return t;for(var u=-1,i=(n=_o(n,t)).length,a=i-1,c=t;null!=c&&++u<i;){var f=Du(n[u]),s=e;if("__proto__"===f||"constructor"===f||"prototype"===f)return t;if(u!=a){var l=c[f];(s=r?r(l,f,c):o)===o&&(s=na(l)?l:yu(n[u+1])?[]:{})}tr(c,f,s),c=c[f]}return t}var Qr=Pe?function(t,n){return Pe.set(t,n),t}:oc,Xr=sn?function(t,n){return sn(t,"toString",{configurable:!0,enumerable:!1,value:nc(n),writable:!0})}:oc;function to(t){return Iu(Wa(t))}function no(t,n,e){var o=-1,u=t.length;n<0&&(n=-n>u?0:u+n),(e=e>u?u:e)<0&&(e+=u),u=n>e?0:e-n>>>0,n>>>=0;for(var i=r(u);++o<u;)i[o]=t[o+n];return i}function eo(t,n){var e;return lr(t,(function(t,r,o){return!(e=n(t,r,o))})),!!e}function ro(t,n,e){var r=0,o=null==t?r:t.length;if("number"==typeof n&&n==n&&o<=2147483647){for(;r<o;){var u=r+o>>>1,i=t[u];null!==i&&!fa(i)&&(e?i<=n:i<n)?r=u+1:o=u}return o}return oo(t,n,oc,e)}function oo(t,n,e,r){var u=0,i=null==t?0:t.length;if(0===i)return 0;for(var a=(n=e(n))!=n,c=null===n,f=fa(n),s=n===o;u<i;){var l=le((u+i)/2),p=e(t[l]),h=p!==o,d=null===p,v=p==p,g=fa(p);if(a)var y=r||v;else y=s?v&&(r||h):c?v&&h&&(r||!d):f?v&&h&&!d&&(r||!g):!d&&!g&&(r?p<=n:p<n);y?u=l+1:i=l}return _e(i,4294967294)}function uo(t,n){for(var e=-1,r=t.length,o=0,u=[];++e<r;){var i=t[e],a=n?n(i):i;if(!e||!Wi(a,c)){var c=a;u[o++]=0===i?0:i}}return u}function io(t){return"number"==typeof t?t:fa(t)?p:+t}function ao(t){if("string"==typeof t)return t;if(qi(t))return Rn(t,ao)+"";if(fa(t))return De?De.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}function co(t,n,e){var r=-1,o=Sn,u=t.length,i=!0,a=[],c=a;if(e)i=!1,o=Cn;else if(u>=200){var f=n?null:Ho(t);if(f)return re(f);i=!1,o=Gn,c=new Ze}else c=n?[]:a;t:for(;++r<u;){var s=t[r],l=n?n(s):s;if(s=e||0!==s?s:0,i&&l==l){for(var p=c.length;p--;)if(c[p]===l)continue t;n&&c.push(l),a.push(s)}else o(c,l,e)||(c!==a&&c.push(l),a.push(s))}return a}function fo(t,n){return null==(t=Ru(t,n=_o(n,t)))||delete t[Du(Yu(n))]}function so(t,n,e,r){return Yr(t,n,e(xr(t,n)),r)}function lo(t,n,e,r){for(var o=t.length,u=r?o:-1;(r?u--:++u<o)&&n(t[u],u,t););return e?no(t,r?0:u,r?u+1:o):no(t,r?u+1:0,r?o:u)}function po(t,n){var e=t;return e instanceof $e&&(e=e.value()),jn(n,(function(t,n){return n.func.apply(n.thisArg,On([t],n.args))}),e)}function ho(t,n,e){var o=t.length;if(o<2)return o?co(t[0]):[];for(var u=-1,i=r(o);++u<o;)for(var a=t[u],c=-1;++c<o;)c!=u&&(i[u]=sr(i[u]||a,t[c],n,e));return co(gr(i,1),n,e)}function vo(t,n,e){for(var r=-1,u=t.length,i=n.length,a={};++r<u;){var c=r<i?n[r]:o;e(a,t[r],c)}return a}function go(t){return Hi(t)?t:[]}function yo(t){return"function"==typeof t?t:oc}function _o(t,n){return qi(t)?t:mu(t,n)?[t]:Nu(ma(t))}var mo=Hr;function bo(t,n,e){var r=t.length;return e=e===o?r:e,!n&&e>=r?t:no(t,n,e)}var wo=ln||function(t){return un.clearTimeout(t)};function xo(t,n){if(n)return t.slice();var e=t.length,r=$t?$t(e):new t.constructor(e);return t.copy(r),r}function Eo(t){var n=new t.constructor(t.byteLength);return new Ft(n).set(new Ft(t)),n}function So(t,n){var e=n?Eo(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}function Co(t,n){if(t!==n){var e=t!==o,r=null===t,u=t==t,i=fa(t),a=n!==o,c=null===n,f=n==n,s=fa(n);if(!c&&!s&&!i&&t>n||i&&a&&f&&!c&&!s||r&&a&&f||!e&&f||!u)return 1;if(!r&&!i&&!s&&t<n||s&&e&&u&&!r&&!i||c&&e&&u||!a&&u||!f)return-1}return 0}function Ro(t,n,e,o){for(var u=-1,i=t.length,a=e.length,c=-1,f=n.length,s=ye(i-a,0),l=r(f+s),p=!o;++c<f;)l[c]=n[c];for(;++u<a;)(p||u<i)&&(l[e[u]]=t[u]);for(;s--;)l[c++]=t[u++];return l}function Oo(t,n,e,o){for(var u=-1,i=t.length,a=-1,c=e.length,f=-1,s=n.length,l=ye(i-c,0),p=r(l+s),h=!o;++u<l;)p[u]=t[u];for(var d=u;++f<s;)p[d+f]=n[f];for(;++a<c;)(h||u<i)&&(p[d+e[a]]=t[u++]);return p}function jo(t,n){var e=-1,o=t.length;for(n||(n=r(o));++e<o;)n[e]=t[e];return n}function Po(t,n,e,r){var u=!e;e||(e={});for(var i=-1,a=n.length;++i<a;){var c=n[i],f=r?r(e[c],t[c],c,e,t):o;f===o&&(f=t[c]),u?or(e,c,f):tr(e,c,f)}return e}function ko(t,n){return function(e,r){var o=qi(e)?mn:er,u=n?n():{};return o(e,t,au(r,2),u)}}function Ao(t){return Hr((function(n,e){var r=-1,u=e.length,i=u>1?e[u-1]:o,a=u>2?e[2]:o;for(i=t.length>3&&"function"==typeof i?(u--,i):o,a&&_u(e[0],e[1],a)&&(i=u<3?o:i,u=1),n=St(n);++r<u;){var c=e[r];c&&t(n,c,r,i)}return n}))}function Lo(t,n){return function(e,r){if(null==e)return e;if(!Zi(e))return t(e,r);for(var o=e.length,u=n?o:-1,i=St(e);(n?u--:++u<o)&&!1!==r(i[u],u,i););return e}}function To(t){return function(n,e,r){for(var o=-1,u=St(n),i=r(n),a=i.length;a--;){var c=i[t?a:++o];if(!1===e(u[c],c,u))break}return n}}function Io(t){return function(n){var e=Xn(n=ma(n))?ie(n):o,r=e?e[0]:n.charAt(0),u=e?bo(e,1).join(""):n.slice(1);return r[t]()+u}}function Uo(t){return function(n){return jn(Qa(Va(n).replace(Vt,"")),t,"")}}function Mo(t){return function(){var n=arguments;switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3]);case 5:return new t(n[0],n[1],n[2],n[3],n[4]);case 6:return new t(n[0],n[1],n[2],n[3],n[4],n[5]);case 7:return new t(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}var e=ze(t.prototype),r=t.apply(e,n);return na(r)?r:e}}function No(t){return function(n,e,r){var u=St(n);if(!Zi(n)){var i=au(e,3);n=La(n),e=function(t){return i(u[t],t,u)}}var a=t(n,e,r);return a>-1?u[i?n[a]:a]:o}}function Do(t){return nu((function(n){var e=n.length,r=e,i=Fe.prototype.thru;for(t&&n.reverse();r--;){var a=n[r];if("function"!=typeof a)throw new Ot(u);if(i&&!c&&"wrapper"==uu(a))var c=new Fe([],!0)}for(r=c?r:e;++r<e;){var f=uu(a=n[r]),s="wrapper"==f?ou(a):o;c=s&&bu(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?c[uu(s[0])].apply(c,s[3]):1==a.length&&bu(a)?c[f]():c.thru(a)}return function(){var t=arguments,r=t[0];if(c&&1==t.length&&qi(r))return c.plant(r).value();for(var o=0,u=e?n[o].apply(this,t):r;++o<e;)u=n[o].call(this,u);return u}}))}function Bo(t,n,e,u,i,a,c,s,l,p){var h=n&f,d=1&n,v=2&n,g=24&n,y=512&n,_=v?o:Mo(t);return function o(){for(var f=arguments.length,m=r(f),b=f;b--;)m[b]=arguments[b];if(g)var w=iu(o),x=Kn(m,w);if(u&&(m=Ro(m,u,i,g)),a&&(m=Oo(m,a,c,g)),f-=x,g&&f<p){var E=ee(m,w);return Go(t,n,Bo,o.placeholder,e,m,E,s,l,p-f)}var S=d?e:this,C=v?S[t]:t;return f=m.length,s?m=Ou(m,s):y&&f>1&&m.reverse(),h&&l<f&&(m.length=l),this&&this!==un&&this instanceof o&&(C=_||Mo(C)),C.apply(S,m)}}function zo(t,n){return function(e,r){return function(t,n,e,r){return mr(t,(function(t,o,u){n(r,e(t),o,u)})),r}(e,t,n(r),{})}}function Wo(t,n){return function(e,r){var u;if(e===o&&r===o)return n;if(e!==o&&(u=e),r!==o){if(u===o)return r;"string"==typeof e||"string"==typeof r?(e=ao(e),r=ao(r)):(e=io(e),r=io(r)),u=t(e,r)}return u}}function Fo(t){return nu((function(n){return n=Rn(n,Vn(au())),Hr((function(e){var r=this;return t(n,(function(t){return _n(t,r,e)}))}))}))}function $o(t,n){var e=(n=n===o?" ":ao(n)).length;if(e<2)return e?Zr(n,t):n;var r=Zr(n,se(t/ue(n)));return Xn(n)?bo(ie(r),0,t).join(""):r.slice(0,t)}function Vo(t){return function(n,e,u){return u&&"number"!=typeof u&&_u(n,e,u)&&(e=u=o),n=da(n),e===o?(e=n,n=0):e=da(e),function(t,n,e,o){for(var u=-1,i=ye(se((n-t)/(e||1)),0),a=r(i);i--;)a[o?i:++u]=t,t+=e;return a}(n,e,u=u===o?n<e?1:-1:da(u),t)}}function qo(t){return function(n,e){return"string"==typeof n&&"string"==typeof e||(n=ya(n),e=ya(e)),t(n,e)}}function Go(t,n,e,r,u,i,a,f,s,l){var p=8&n;n|=p?c:64,4&(n&=~(p?64:c))||(n&=-4);var h=[t,n,u,p?i:o,p?a:o,p?o:i,p?o:a,f,s,l],d=e.apply(o,h);return bu(t)&&Pu(d,h),d.placeholder=r,Lu(d,t,n)}function Zo(t){var n=Et[t];return function(t,e){if(t=ya(t),(e=null==e?0:_e(va(e),292))&&de(t)){var r=(ma(t)+"e").split("e");return+((r=(ma(n(r[0]+"e"+(+r[1]+e)))+"e").split("e"))[0]+"e"+(+r[1]-e))}return n(t)}}var Ho=Re&&1/re(new Re([,-0]))[1]==s?function(t){return new Re(t)}:fc;function Ko(t){return function(n){var e=hu(n);return e==x?te(n):e==O?oe(n):function(t,n){return Rn(n,(function(n){return[n,t[n]]}))}(n,t(n))}}function Jo(t,n,e,i,s,l,p,h){var d=2&n;if(!d&&"function"!=typeof t)throw new Ot(u);var v=i?i.length:0;if(v||(n&=-97,i=s=o),p=p===o?p:ye(va(p),0),h=h===o?h:va(h),v-=s?s.length:0,64&n){var g=i,y=s;i=s=o}var _=d?o:ou(t),m=[t,n,e,i,s,g,y,l,p,h];if(_&&function(t,n){var e=t[1],r=n[1],o=e|r,u=o<131,i=r==f&&8==e||r==f&&256==e&&t[7].length<=n[8]||384==r&&n[7].length<=n[8]&&8==e;if(!u&&!i)return t;1&r&&(t[2]=n[2],o|=1&e?0:4);var c=n[3];if(c){var s=t[3];t[3]=s?Ro(s,c,n[4]):c,t[4]=s?ee(t[3],a):n[4]}(c=n[5])&&(s=t[5],t[5]=s?Oo(s,c,n[6]):c,t[6]=s?ee(t[5],a):n[6]),(c=n[7])&&(t[7]=c),r&f&&(t[8]=null==t[8]?n[8]:_e(t[8],n[8])),null==t[9]&&(t[9]=n[9]),t[0]=n[0],t[1]=o}(m,_),t=m[0],n=m[1],e=m[2],i=m[3],s=m[4],!(h=m[9]=m[9]===o?d?0:t.length:ye(m[9]-v,0))&&24&n&&(n&=-25),n&&1!=n)b=8==n||16==n?function(t,n,e){var u=Mo(t);return function i(){for(var a=arguments.length,c=r(a),f=a,s=iu(i);f--;)c[f]=arguments[f];var l=a<3&&c[0]!==s&&c[a-1]!==s?[]:ee(c,s);return(a-=l.length)<e?Go(t,n,Bo,i.placeholder,o,c,l,o,o,e-a):_n(this&&this!==un&&this instanceof i?u:t,this,c)}}(t,n,h):n!=c&&33!=n||s.length?Bo.apply(o,m):function(t,n,e,o){var u=1&n,i=Mo(t);return function n(){for(var a=-1,c=arguments.length,f=-1,s=o.length,l=r(s+c),p=this&&this!==un&&this instanceof n?i:t;++f<s;)l[f]=o[f];for(;c--;)l[f++]=arguments[++a];return _n(p,u?e:this,l)}}(t,n,e,i);else var b=function(t,n,e){var r=1&n,o=Mo(t);return function n(){return(this&&this!==un&&this instanceof n?o:t).apply(r?e:this,arguments)}}(t,n,e);return Lu((_?Qr:Pu)(b,m),t,n)}function Yo(t,n,e,r){return t===o||Wi(t,kt[e])&&!Tt.call(r,e)?n:t}function Qo(t,n,e,r,u,i){return na(t)&&na(n)&&(i.set(n,t),zr(t,n,o,Qo,i),i.delete(n)),t}function Xo(t){return ua(t)?o:t}function tu(t,n,e,r,u,i){var a=1&e,c=t.length,f=n.length;if(c!=f&&!(a&&f>c))return!1;var s=i.get(t),l=i.get(n);if(s&&l)return s==n&&l==t;var p=-1,h=!0,d=2&e?new Ze:o;for(i.set(t,n),i.set(n,t);++p<c;){var v=t[p],g=n[p];if(r)var y=a?r(g,v,p,n,t,i):r(v,g,p,t,n,i);if(y!==o){if(y)continue;h=!1;break}if(d){if(!kn(n,(function(t,n){if(!Gn(d,n)&&(v===t||u(v,t,e,r,i)))return d.push(n)}))){h=!1;break}}else if(v!==g&&!u(v,g,e,r,i)){h=!1;break}}return i.delete(t),i.delete(n),h}function nu(t){return Au(Cu(t,o,Gu),t+"")}function eu(t){return Er(t,La,lu)}function ru(t){return Er(t,Ta,pu)}var ou=Pe?function(t){return Pe.get(t)}:fc;function uu(t){for(var n=t.name+"",e=ke[n],r=Tt.call(ke,n)?e.length:0;r--;){var o=e[r],u=o.func;if(null==u||u==t)return o.name}return n}function iu(t){return(Tt.call(Be,"placeholder")?Be:t).placeholder}function au(){var t=Be.iteratee||uc;return t=t===uc?Ir:t,arguments.length?t(arguments[0],arguments[1]):t}function cu(t,n){var e,r,o=t.__data__;return("string"==(r=typeof(e=n))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e)?o["string"==typeof n?"string":"hash"]:o.map}function fu(t){for(var n=La(t),e=n.length;e--;){var r=n[e],o=t[r];n[e]=[r,o,Eu(o)]}return n}function su(t,n){var e=function(t,n){return null==t?o:t[n]}(t,n);return Tr(e)?e:o}var lu=pe?function(t){return null==t?[]:(t=St(t),En(pe(t),(function(n){return tn.call(t,n)})))}:gc,pu=pe?function(t){for(var n=[];t;)On(n,lu(t)),t=Gt(t);return n}:gc,hu=Sr;function du(t,n,e){for(var r=-1,o=(n=_o(n,t)).length,u=!1;++r<o;){var i=Du(n[r]);if(!(u=null!=t&&e(t,i)))break;t=t[i]}return u||++r!=o?u:!!(o=null==t?0:t.length)&&ta(o)&&yu(i,o)&&(qi(t)||Vi(t))}function vu(t){return"function"!=typeof t.constructor||xu(t)?{}:ze(Gt(t))}function gu(t){return qi(t)||Vi(t)||!!(on&&t&&t[on])}function yu(t,n){var e=typeof t;return!!(n=null==n?l:n)&&("number"==e||"symbol"!=e&&yt.test(t))&&t>-1&&t%1==0&&t<n}function _u(t,n,e){if(!na(e))return!1;var r=typeof n;return!!("number"==r?Zi(e)&&yu(n,e.length):"string"==r&&n in e)&&Wi(e[n],t)}function mu(t,n){if(qi(t))return!1;var e=typeof t;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!fa(t))||X.test(t)||!Q.test(t)||null!=n&&t in St(n)}function bu(t){var n=uu(t),e=Be[n];if("function"!=typeof e||!(n in $e.prototype))return!1;if(t===e)return!0;var r=ou(e);return!!r&&t===r[0]}(Ee&&hu(new Ee(new ArrayBuffer(1)))!=L||Se&&hu(new Se)!=x||Ce&&hu(Ce.resolve())!=C||Re&&hu(new Re)!=O||Oe&&hu(new Oe)!=k)&&(hu=function(t){var n=Sr(t),e=n==S?t.constructor:o,r=e?Bu(e):"";if(r)switch(r){case Ae:return L;case Le:return x;case Te:return C;case Ie:return O;case Ue:return k}return n});var wu=At?Qi:yc;function xu(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||kt)}function Eu(t){return t==t&&!na(t)}function Su(t,n){return function(e){return null!=e&&e[t]===n&&(n!==o||t in St(e))}}function Cu(t,n,e){return n=ye(n===o?t.length-1:n,0),function(){for(var o=arguments,u=-1,i=ye(o.length-n,0),a=r(i);++u<i;)a[u]=o[n+u];u=-1;for(var c=r(n+1);++u<n;)c[u]=o[u];return c[n]=e(a),_n(t,this,c)}}function Ru(t,n){return n.length<2?t:xr(t,no(n,0,-1))}function Ou(t,n){for(var e=t.length,r=_e(n.length,e),u=jo(t);r--;){var i=n[r];t[r]=yu(i,e)?u[i]:o}return t}function ju(t,n){if(("constructor"!==n||"function"!=typeof t[n])&&"__proto__"!=n)return t[n]}var Pu=Tu(Qr),ku=Bn||function(t,n){return un.setTimeout(t,n)},Au=Tu(Xr);function Lu(t,n,e){var r=n+"";return Au(t,function(t,n){var e=n.length;if(!e)return t;var r=e-1;return n[r]=(e>1?"& ":"")+n[r],n=n.join(e>2?", ":" "),t.replace(ut,"{\n/* [wrapped with "+n+"] */\n")}(r,function(t,n){return bn(d,(function(e){var r="_."+e[0];n&e[1]&&!Sn(t,r)&&t.push(r)})),t.sort()}(function(t){var n=t.match(it);return n?n[1].split(at):[]}(r),e)))}function Tu(t){var n=0,e=0;return function(){var r=me(),u=16-(r-e);if(e=r,u>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(o,arguments)}}function Iu(t,n){var e=-1,r=t.length,u=r-1;for(n=n===o?r:n;++e<n;){var i=Gr(e,u),a=t[i];t[i]=t[e],t[e]=a}return t.length=n,t}var Uu,Mu,Nu=(Uu=Ui((function(t){var n=[];return 46===t.charCodeAt(0)&&n.push(""),t.replace(tt,(function(t,e,r,o){n.push(r?o.replace(st,"$1"):e||t)})),n}),(function(t){return 500===Mu.size&&Mu.clear(),t})),Mu=Uu.cache,Uu);function Du(t){if("string"==typeof t||fa(t))return t;var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}function Bu(t){if(null!=t){try{return Lt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function zu(t){if(t instanceof $e)return t.clone();var n=new Fe(t.__wrapped__,t.__chain__);return n.__actions__=jo(t.__actions__),n.__index__=t.__index__,n.__values__=t.__values__,n}var Wu=Hr((function(t,n){return Hi(t)?sr(t,gr(n,1,Hi,!0)):[]})),Fu=Hr((function(t,n){var e=Yu(n);return Hi(e)&&(e=o),Hi(t)?sr(t,gr(n,1,Hi,!0),au(e,2)):[]})),$u=Hr((function(t,n){var e=Yu(n);return Hi(e)&&(e=o),Hi(t)?sr(t,gr(n,1,Hi,!0),o,e):[]}));function Vu(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var o=null==e?0:va(e);return o<0&&(o=ye(r+o,0)),Tn(t,au(n,3),o)}function qu(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var u=r-1;return e!==o&&(u=va(e),u=e<0?ye(r+u,0):_e(u,r-1)),Tn(t,au(n,3),u,!0)}function Gu(t){return null!=t&&t.length?gr(t,1):[]}function Zu(t){return t&&t.length?t[0]:o}var Hu=Hr((function(t){var n=Rn(t,go);return n.length&&n[0]===t[0]?jr(n):[]})),Ku=Hr((function(t){var n=Yu(t),e=Rn(t,go);return n===Yu(e)?n=o:e.pop(),e.length&&e[0]===t[0]?jr(e,au(n,2)):[]})),Ju=Hr((function(t){var n=Yu(t),e=Rn(t,go);return(n="function"==typeof n?n:o)&&e.pop(),e.length&&e[0]===t[0]?jr(e,o,n):[]}));function Yu(t){var n=null==t?0:t.length;return n?t[n-1]:o}var Qu=Hr(Xu);function Xu(t,n){return t&&t.length&&n&&n.length?Vr(t,n):t}var ti=nu((function(t,n){var e=null==t?0:t.length,r=ur(t,n);return qr(t,Rn(n,(function(t){return yu(t,e)?+t:t})).sort(Co)),r}));function ni(t){return null==t?t:xe.call(t)}var ei=Hr((function(t){return co(gr(t,1,Hi,!0))})),ri=Hr((function(t){var n=Yu(t);return Hi(n)&&(n=o),co(gr(t,1,Hi,!0),au(n,2))})),oi=Hr((function(t){var n=Yu(t);return n="function"==typeof n?n:o,co(gr(t,1,Hi,!0),o,n)}));function ui(t){if(!t||!t.length)return[];var n=0;return t=En(t,(function(t){if(Hi(t))return n=ye(t.length,n),!0})),Fn(n,(function(n){return Rn(t,Dn(n))}))}function ii(t,n){if(!t||!t.length)return[];var e=ui(t);return null==n?e:Rn(e,(function(t){return _n(n,o,t)}))}var ai=Hr((function(t,n){return Hi(t)?sr(t,n):[]})),ci=Hr((function(t){return ho(En(t,Hi))})),fi=Hr((function(t){var n=Yu(t);return Hi(n)&&(n=o),ho(En(t,Hi),au(n,2))})),si=Hr((function(t){var n=Yu(t);return n="function"==typeof n?n:o,ho(En(t,Hi),o,n)})),li=Hr(ui),pi=Hr((function(t){var n=t.length,e=n>1?t[n-1]:o;return e="function"==typeof e?(t.pop(),e):o,ii(t,e)}));function hi(t){var n=Be(t);return n.__chain__=!0,n}function di(t,n){return n(t)}var vi=nu((function(t){var n=t.length,e=n?t[0]:0,r=this.__wrapped__,u=function(n){return ur(n,t)};return!(n>1||this.__actions__.length)&&r instanceof $e&&yu(e)?((r=r.slice(e,+e+(n?1:0))).__actions__.push({func:di,args:[u],thisArg:o}),new Fe(r,this.__chain__).thru((function(t){return n&&!t.length&&t.push(o),t}))):this.thru(u)})),gi=ko((function(t,n,e){Tt.call(t,e)?++t[e]:or(t,e,1)})),yi=No(Vu),_i=No(qu);function mi(t,n){return(qi(t)?bn:lr)(t,au(n,3))}function bi(t,n){return(qi(t)?wn:pr)(t,au(n,3))}var wi=ko((function(t,n,e){Tt.call(t,e)?t[e].push(n):or(t,e,[n])})),xi=Hr((function(t,n,e){var o=-1,u="function"==typeof n,i=Zi(t)?r(t.length):[];return lr(t,(function(t){i[++o]=u?_n(n,t,e):Pr(t,n,e)})),i})),Ei=ko((function(t,n,e){or(t,e,n)}));function Si(t,n){return(qi(t)?Rn:Nr)(t,au(n,3))}var Ci=ko((function(t,n,e){t[e?0:1].push(n)}),(function(){return[[],[]]})),Ri=Hr((function(t,n){if(null==t)return[];var e=n.length;return e>1&&_u(t,n[0],n[1])?n=[]:e>2&&_u(n[0],n[1],n[2])&&(n=[n[0]]),Fr(t,gr(n,1),[])})),Oi=An||function(){return un.Date.now()};function ji(t,n,e){return n=e?o:n,n=t&&null==n?t.length:n,Jo(t,f,o,o,o,o,n)}function Pi(t,n){var e;if("function"!=typeof n)throw new Ot(u);return t=va(t),function(){return--t>0&&(e=n.apply(this,arguments)),t<=1&&(n=o),e}}var ki=Hr((function(t,n,e){var r=1;if(e.length){var o=ee(e,iu(ki));r|=c}return Jo(t,r,n,e,o)})),Ai=Hr((function(t,n,e){var r=3;if(e.length){var o=ee(e,iu(Ai));r|=c}return Jo(n,r,t,e,o)}));function Li(t,n,e){var r,i,a,c,f,s,l=0,p=!1,h=!1,d=!0;if("function"!=typeof t)throw new Ot(u);function v(n){var e=r,u=i;return r=i=o,l=n,c=t.apply(u,e)}function g(t){return l=t,f=ku(_,n),p?v(t):c}function y(t){var e=t-s;return s===o||e>=n||e<0||h&&t-l>=a}function _(){var t=Oi();if(y(t))return m(t);f=ku(_,function(t){var e=n-(t-s);return h?_e(e,a-(t-l)):e}(t))}function m(t){return f=o,d&&r?v(t):(r=i=o,c)}function b(){var t=Oi(),e=y(t);if(r=arguments,i=this,s=t,e){if(f===o)return g(s);if(h)return wo(f),f=ku(_,n),v(s)}return f===o&&(f=ku(_,n)),c}return n=ya(n)||0,na(e)&&(p=!!e.leading,a=(h="maxWait"in e)?ye(ya(e.maxWait)||0,n):a,d="trailing"in e?!!e.trailing:d),b.cancel=function(){f!==o&&wo(f),l=0,r=s=i=f=o},b.flush=function(){return f===o?c:m(Oi())},b}var Ti=Hr((function(t,n){return fr(t,1,n)})),Ii=Hr((function(t,n,e){return fr(t,ya(n)||0,e)}));function Ui(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Ot(u);var e=function(){var r=arguments,o=n?n.apply(this,r):r[0],u=e.cache;if(u.has(o))return u.get(o);var i=t.apply(this,r);return e.cache=u.set(o,i)||u,i};return e.cache=new(Ui.Cache||Ge),e}function Mi(t){if("function"!=typeof t)throw new Ot(u);return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}Ui.Cache=Ge;var Ni=mo((function(t,n){var e=(n=1==n.length&&qi(n[0])?Rn(n[0],Vn(au())):Rn(gr(n,1),Vn(au()))).length;return Hr((function(r){for(var o=-1,u=_e(r.length,e);++o<u;)r[o]=n[o].call(this,r[o]);return _n(t,this,r)}))})),Di=Hr((function(t,n){var e=ee(n,iu(Di));return Jo(t,c,o,n,e)})),Bi=Hr((function(t,n){var e=ee(n,iu(Bi));return Jo(t,64,o,n,e)})),zi=nu((function(t,n){return Jo(t,256,o,o,o,n)}));function Wi(t,n){return t===n||t!=t&&n!=n}var Fi=qo(Cr),$i=qo((function(t,n){return t>=n})),Vi=kr(function(){return arguments}())?kr:function(t){return ea(t)&&Tt.call(t,"callee")&&!tn.call(t,"callee")},qi=r.isArray,Gi=pn?Vn(pn):function(t){return ea(t)&&Sr(t)==A};function Zi(t){return null!=t&&ta(t.length)&&!Qi(t)}function Hi(t){return ea(t)&&Zi(t)}var Ki=he||yc,Ji=hn?Vn(hn):function(t){return ea(t)&&Sr(t)==_};function Yi(t){if(!ea(t))return!1;var n=Sr(t);return n==m||"[object DOMException]"==n||"string"==typeof t.message&&"string"==typeof t.name&&!ua(t)}function Qi(t){if(!na(t))return!1;var n=Sr(t);return n==b||n==w||"[object AsyncFunction]"==n||"[object Proxy]"==n}function Xi(t){return"number"==typeof t&&t==va(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=l}function na(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}function ea(t){return null!=t&&"object"==typeof t}var ra=dn?Vn(dn):function(t){return ea(t)&&hu(t)==x};function oa(t){return"number"==typeof t||ea(t)&&Sr(t)==E}function ua(t){if(!ea(t)||Sr(t)!=S)return!1;var n=Gt(t);if(null===n)return!0;var e=Tt.call(n,"constructor")&&n.constructor;return"function"==typeof e&&e instanceof e&&Lt.call(e)==Nt}var ia=vn?Vn(vn):function(t){return ea(t)&&Sr(t)==R},aa=gn?Vn(gn):function(t){return ea(t)&&hu(t)==O};function ca(t){return"string"==typeof t||!qi(t)&&ea(t)&&Sr(t)==j}function fa(t){return"symbol"==typeof t||ea(t)&&Sr(t)==P}var sa=yn?Vn(yn):function(t){return ea(t)&&ta(t.length)&&!!Qt[Sr(t)]},la=qo(Mr),pa=qo((function(t,n){return t<=n}));function ha(t){if(!t)return[];if(Zi(t))return ca(t)?ie(t):jo(t);if(an&&t[an])return function(t){for(var n,e=[];!(n=t.next()).done;)e.push(n.value);return e}(t[an]());var n=hu(t);return(n==x?te:n==O?re:Wa)(t)}function da(t){return t?(t=ya(t))===s||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function va(t){var n=da(t),e=n%1;return n==n?e?n-e:n:0}function ga(t){return t?ir(va(t),0,h):0}function ya(t){if("number"==typeof t)return t;if(fa(t))return p;if(na(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=na(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=$n(t);var e=dt.test(t);return e||gt.test(t)?en(t.slice(2),e?2:8):ht.test(t)?p:+t}function _a(t){return Po(t,Ta(t))}function ma(t){return null==t?"":ao(t)}var ba=Ao((function(t,n){if(xu(n)||Zi(n))Po(n,La(n),t);else for(var e in n)Tt.call(n,e)&&tr(t,e,n[e])})),wa=Ao((function(t,n){Po(n,Ta(n),t)})),xa=Ao((function(t,n,e,r){Po(n,Ta(n),t,r)})),Ea=Ao((function(t,n,e,r){Po(n,La(n),t,r)})),Sa=nu(ur),Ca=Hr((function(t,n){t=St(t);var e=-1,r=n.length,u=r>2?n[2]:o;for(u&&_u(n[0],n[1],u)&&(r=1);++e<r;)for(var i=n[e],a=Ta(i),c=-1,f=a.length;++c<f;){var s=a[c],l=t[s];(l===o||Wi(l,kt[s])&&!Tt.call(t,s))&&(t[s]=i[s])}return t})),Ra=Hr((function(t){return t.push(o,Qo),_n(Ua,o,t)}));function Oa(t,n,e){var r=null==t?o:xr(t,n);return r===o?e:r}function ja(t,n){return null!=t&&du(t,n,Or)}var Pa=zo((function(t,n,e){null!=n&&"function"!=typeof n.toString&&(n=Mt.call(n)),t[n]=e}),nc(oc)),ka=zo((function(t,n,e){null!=n&&"function"!=typeof n.toString&&(n=Mt.call(n)),Tt.call(t,n)?t[n].push(e):t[n]=[e]}),au),Aa=Hr(Pr);function La(t){return Zi(t)?Ke(t):Ur(t)}function Ta(t){return Zi(t)?Ke(t,!0):function(t){if(!na(t))return function(t){var n=[];if(null!=t)for(var e in St(t))n.push(e);return n}(t);var n=xu(t),e=[];for(var r in t)("constructor"!=r||!n&&Tt.call(t,r))&&e.push(r);return e}(t)}var Ia=Ao((function(t,n,e){zr(t,n,e)})),Ua=Ao((function(t,n,e,r){zr(t,n,e,r)})),Ma=nu((function(t,n){var e={};if(null==t)return e;var r=!1;n=Rn(n,(function(n){return n=_o(n,t),r||(r=n.length>1),n})),Po(t,ru(t),e),r&&(e=ar(e,7,Xo));for(var o=n.length;o--;)fo(e,n[o]);return e})),Na=nu((function(t,n){return null==t?{}:function(t,n){return $r(t,n,(function(n,e){return ja(t,e)}))}(t,n)}));function Da(t,n){if(null==t)return{};var e=Rn(ru(t),(function(t){return[t]}));return n=au(n),$r(t,e,(function(t,e){return n(t,e[0])}))}var Ba=Ko(La),za=Ko(Ta);function Wa(t){return null==t?[]:qn(t,La(t))}var Fa=Uo((function(t,n,e){return n=n.toLowerCase(),t+(e?$a(n):n)}));function $a(t){return Ya(ma(t).toLowerCase())}function Va(t){return(t=ma(t))&&t.replace(_t,Jn).replace(qt,"")}var qa=Uo((function(t,n,e){return t+(e?"-":"")+n.toLowerCase()})),Ga=Uo((function(t,n,e){return t+(e?" ":"")+n.toLowerCase()})),Za=Io("toLowerCase"),Ha=Uo((function(t,n,e){return t+(e?"_":"")+n.toLowerCase()})),Ka=Uo((function(t,n,e){return t+(e?" ":"")+Ya(n)})),Ja=Uo((function(t,n,e){return t+(e?" ":"")+n.toUpperCase()})),Ya=Io("toUpperCase");function Qa(t,n,e){return t=ma(t),(n=e?o:n)===o?function(t){return Kt.test(t)}(t)?function(t){return t.match(Zt)||[]}(t):function(t){return t.match(ct)||[]}(t):t.match(n)||[]}var Xa=Hr((function(t,n){try{return _n(t,o,n)}catch(t){return Yi(t)?t:new wt(t)}})),tc=nu((function(t,n){return bn(n,(function(n){n=Du(n),or(t,n,ki(t[n],t))})),t}));function nc(t){return function(){return t}}var ec=Do(),rc=Do(!0);function oc(t){return t}function uc(t){return Ir("function"==typeof t?t:ar(t,1))}var ic=Hr((function(t,n){return function(e){return Pr(e,t,n)}})),ac=Hr((function(t,n){return function(e){return Pr(t,e,n)}}));function cc(t,n,e){var r=La(n),o=wr(n,r);null!=e||na(n)&&(o.length||!r.length)||(e=n,n=t,t=this,o=wr(n,La(n)));var u=!(na(e)&&"chain"in e&&!e.chain),i=Qi(t);return bn(o,(function(e){var r=n[e];t[e]=r,i&&(t.prototype[e]=function(){var n=this.__chain__;if(u||n){var e=t(this.__wrapped__),o=e.__actions__=jo(this.__actions__);return o.push({func:r,args:arguments,thisArg:t}),e.__chain__=n,e}return r.apply(t,On([this.value()],arguments))})})),t}function fc(){}var sc=Fo(Rn),lc=Fo(xn),pc=Fo(kn);function hc(t){return mu(t)?Dn(Du(t)):function(t){return function(n){return xr(n,t)}}(t)}var dc=Vo(),vc=Vo(!0);function gc(){return[]}function yc(){return!1}var _c,mc=Wo((function(t,n){return t+n}),0),bc=Zo("ceil"),wc=Wo((function(t,n){return t/n}),1),xc=Zo("floor"),Ec=Wo((function(t,n){return t*n}),1),Sc=Zo("round"),Cc=Wo((function(t,n){return t-n}),0);return Be.after=function(t,n){if("function"!=typeof n)throw new Ot(u);return t=va(t),function(){if(--t<1)return n.apply(this,arguments)}},Be.ary=ji,Be.assign=ba,Be.assignIn=wa,Be.assignInWith=xa,Be.assignWith=Ea,Be.at=Sa,Be.before=Pi,Be.bind=ki,Be.bindAll=tc,Be.bindKey=Ai,Be.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return qi(t)?t:[t]},Be.chain=hi,Be.chunk=function(t,n,e){n=(e?_u(t,n,e):n===o)?1:ye(va(n),0);var u=null==t?0:t.length;if(!u||n<1)return[];for(var i=0,a=0,c=r(se(u/n));i<u;)c[a++]=no(t,i,i+=n);return c},Be.compact=function(t){for(var n=-1,e=null==t?0:t.length,r=0,o=[];++n<e;){var u=t[n];u&&(o[r++]=u)}return o},Be.concat=function(){var t=arguments.length;if(!t)return[];for(var n=r(t-1),e=arguments[0],o=t;o--;)n[o-1]=arguments[o];return On(qi(e)?jo(e):[e],gr(n,1))},Be.cond=function(t){var n=null==t?0:t.length,e=au();return t=n?Rn(t,(function(t){if("function"!=typeof t[1])throw new Ot(u);return[e(t[0]),t[1]]})):[],Hr((function(e){for(var r=-1;++r<n;){var o=t[r];if(_n(o[0],this,e))return _n(o[1],this,e)}}))},Be.conforms=function(t){return function(t){var n=La(t);return function(e){return cr(e,t,n)}}(ar(t,1))},Be.constant=nc,Be.countBy=gi,Be.create=function(t,n){var e=ze(t);return null==n?e:rr(e,n)},Be.curry=function t(n,e,r){var u=Jo(n,8,o,o,o,o,o,e=r?o:e);return u.placeholder=t.placeholder,u},Be.curryRight=function t(n,e,r){var u=Jo(n,16,o,o,o,o,o,e=r?o:e);return u.placeholder=t.placeholder,u},Be.debounce=Li,Be.defaults=Ca,Be.defaultsDeep=Ra,Be.defer=Ti,Be.delay=Ii,Be.difference=Wu,Be.differenceBy=Fu,Be.differenceWith=$u,Be.drop=function(t,n,e){var r=null==t?0:t.length;return r?no(t,(n=e||n===o?1:va(n))<0?0:n,r):[]},Be.dropRight=function(t,n,e){var r=null==t?0:t.length;return r?no(t,0,(n=r-(n=e||n===o?1:va(n)))<0?0:n):[]},Be.dropRightWhile=function(t,n){return t&&t.length?lo(t,au(n,3),!0,!0):[]},Be.dropWhile=function(t,n){return t&&t.length?lo(t,au(n,3),!0):[]},Be.fill=function(t,n,e,r){var u=null==t?0:t.length;return u?(e&&"number"!=typeof e&&_u(t,n,e)&&(e=0,r=u),function(t,n,e,r){var u=t.length;for((e=va(e))<0&&(e=-e>u?0:u+e),(r=r===o||r>u?u:va(r))<0&&(r+=u),r=e>r?0:ga(r);e<r;)t[e++]=n;return t}(t,n,e,r)):[]},Be.filter=function(t,n){return(qi(t)?En:vr)(t,au(n,3))},Be.flatMap=function(t,n){return gr(Si(t,n),1)},Be.flatMapDeep=function(t,n){return gr(Si(t,n),s)},Be.flatMapDepth=function(t,n,e){return e=e===o?1:va(e),gr(Si(t,n),e)},Be.flatten=Gu,Be.flattenDeep=function(t){return null!=t&&t.length?gr(t,s):[]},Be.flattenDepth=function(t,n){return null!=t&&t.length?gr(t,n=n===o?1:va(n)):[]},Be.flip=function(t){return Jo(t,512)},Be.flow=ec,Be.flowRight=rc,Be.fromPairs=function(t){for(var n=-1,e=null==t?0:t.length,r={};++n<e;){var o=t[n];r[o[0]]=o[1]}return r},Be.functions=function(t){return null==t?[]:wr(t,La(t))},Be.functionsIn=function(t){return null==t?[]:wr(t,Ta(t))},Be.groupBy=wi,Be.initial=function(t){return null!=t&&t.length?no(t,0,-1):[]},Be.intersection=Hu,Be.intersectionBy=Ku,Be.intersectionWith=Ju,Be.invert=Pa,Be.invertBy=ka,Be.invokeMap=xi,Be.iteratee=uc,Be.keyBy=Ei,Be.keys=La,Be.keysIn=Ta,Be.map=Si,Be.mapKeys=function(t,n){var e={};return n=au(n,3),mr(t,(function(t,r,o){or(e,n(t,r,o),t)})),e},Be.mapValues=function(t,n){var e={};return n=au(n,3),mr(t,(function(t,r,o){or(e,r,n(t,r,o))})),e},Be.matches=function(t){return Dr(ar(t,1))},Be.matchesProperty=function(t,n){return Br(t,ar(n,1))},Be.memoize=Ui,Be.merge=Ia,Be.mergeWith=Ua,Be.method=ic,Be.methodOf=ac,Be.mixin=cc,Be.negate=Mi,Be.nthArg=function(t){return t=va(t),Hr((function(n){return Wr(n,t)}))},Be.omit=Ma,Be.omitBy=function(t,n){return Da(t,Mi(au(n)))},Be.once=function(t){return Pi(2,t)},Be.orderBy=function(t,n,e,r){return null==t?[]:(qi(n)||(n=null==n?[]:[n]),qi(e=r?o:e)||(e=null==e?[]:[e]),Fr(t,n,e))},Be.over=sc,Be.overArgs=Ni,Be.overEvery=lc,Be.overSome=pc,Be.partial=Di,Be.partialRight=Bi,Be.partition=Ci,Be.pick=Na,Be.pickBy=Da,Be.property=hc,Be.propertyOf=function(t){return function(n){return null==t?o:xr(t,n)}},Be.pull=Qu,Be.pullAll=Xu,Be.pullAllBy=function(t,n,e){return t&&t.length&&n&&n.length?Vr(t,n,au(e,2)):t},Be.pullAllWith=function(t,n,e){return t&&t.length&&n&&n.length?Vr(t,n,o,e):t},Be.pullAt=ti,Be.range=dc,Be.rangeRight=vc,Be.rearg=zi,Be.reject=function(t,n){return(qi(t)?En:vr)(t,Mi(au(n,3)))},Be.remove=function(t,n){var e=[];if(!t||!t.length)return e;var r=-1,o=[],u=t.length;for(n=au(n,3);++r<u;){var i=t[r];n(i,r,t)&&(e.push(i),o.push(r))}return qr(t,o),e},Be.rest=function(t,n){if("function"!=typeof t)throw new Ot(u);return Hr(t,n=n===o?n:va(n))},Be.reverse=ni,Be.sampleSize=function(t,n,e){return n=(e?_u(t,n,e):n===o)?1:va(n),(qi(t)?Ye:Jr)(t,n)},Be.set=function(t,n,e){return null==t?t:Yr(t,n,e)},Be.setWith=function(t,n,e,r){return r="function"==typeof r?r:o,null==t?t:Yr(t,n,e,r)},Be.shuffle=function(t){return(qi(t)?Qe:to)(t)},Be.slice=function(t,n,e){var r=null==t?0:t.length;return r?(e&&"number"!=typeof e&&_u(t,n,e)?(n=0,e=r):(n=null==n?0:va(n),e=e===o?r:va(e)),no(t,n,e)):[]},Be.sortBy=Ri,Be.sortedUniq=function(t){return t&&t.length?uo(t):[]},Be.sortedUniqBy=function(t,n){return t&&t.length?uo(t,au(n,2)):[]},Be.split=function(t,n,e){return e&&"number"!=typeof e&&_u(t,n,e)&&(n=e=o),(e=e===o?h:e>>>0)?(t=ma(t))&&("string"==typeof n||null!=n&&!ia(n))&&!(n=ao(n))&&Xn(t)?bo(ie(t),0,e):t.split(n,e):[]},Be.spread=function(t,n){if("function"!=typeof t)throw new Ot(u);return n=null==n?0:ye(va(n),0),Hr((function(e){var r=e[n],o=bo(e,0,n);return r&&On(o,r),_n(t,this,o)}))},Be.tail=function(t){var n=null==t?0:t.length;return n?no(t,1,n):[]},Be.take=function(t,n,e){return t&&t.length?no(t,0,(n=e||n===o?1:va(n))<0?0:n):[]},Be.takeRight=function(t,n,e){var r=null==t?0:t.length;return r?no(t,(n=r-(n=e||n===o?1:va(n)))<0?0:n,r):[]},Be.takeRightWhile=function(t,n){return t&&t.length?lo(t,au(n,3),!1,!0):[]},Be.takeWhile=function(t,n){return t&&t.length?lo(t,au(n,3)):[]},Be.tap=function(t,n){return n(t),t},Be.throttle=function(t,n,e){var r=!0,o=!0;if("function"!=typeof t)throw new Ot(u);return na(e)&&(r="leading"in e?!!e.leading:r,o="trailing"in e?!!e.trailing:o),Li(t,n,{leading:r,maxWait:n,trailing:o})},Be.thru=di,Be.toArray=ha,Be.toPairs=Ba,Be.toPairsIn=za,Be.toPath=function(t){return qi(t)?Rn(t,Du):fa(t)?[t]:jo(Nu(ma(t)))},Be.toPlainObject=_a,Be.transform=function(t,n,e){var r=qi(t),o=r||Ki(t)||sa(t);if(n=au(n,4),null==e){var u=t&&t.constructor;e=o?r?new u:[]:na(t)&&Qi(u)?ze(Gt(t)):{}}return(o?bn:mr)(t,(function(t,r,o){return n(e,t,r,o)})),e},Be.unary=function(t){return ji(t,1)},Be.union=ei,Be.unionBy=ri,Be.unionWith=oi,Be.uniq=function(t){return t&&t.length?co(t):[]},Be.uniqBy=function(t,n){return t&&t.length?co(t,au(n,2)):[]},Be.uniqWith=function(t,n){return n="function"==typeof n?n:o,t&&t.length?co(t,o,n):[]},Be.unset=function(t,n){return null==t||fo(t,n)},Be.unzip=ui,Be.unzipWith=ii,Be.update=function(t,n,e){return null==t?t:so(t,n,yo(e))},Be.updateWith=function(t,n,e,r){return r="function"==typeof r?r:o,null==t?t:so(t,n,yo(e),r)},Be.values=Wa,Be.valuesIn=function(t){return null==t?[]:qn(t,Ta(t))},Be.without=ai,Be.words=Qa,Be.wrap=function(t,n){return Di(yo(n),t)},Be.xor=ci,Be.xorBy=fi,Be.xorWith=si,Be.zip=li,Be.zipObject=function(t,n){return vo(t||[],n||[],tr)},Be.zipObjectDeep=function(t,n){return vo(t||[],n||[],Yr)},Be.zipWith=pi,Be.entries=Ba,Be.entriesIn=za,Be.extend=wa,Be.extendWith=xa,cc(Be,Be),Be.add=mc,Be.attempt=Xa,Be.camelCase=Fa,Be.capitalize=$a,Be.ceil=bc,Be.clamp=function(t,n,e){return e===o&&(e=n,n=o),e!==o&&(e=(e=ya(e))==e?e:0),n!==o&&(n=(n=ya(n))==n?n:0),ir(ya(t),n,e)},Be.clone=function(t){return ar(t,4)},Be.cloneDeep=function(t){return ar(t,5)},Be.cloneDeepWith=function(t,n){return ar(t,5,n="function"==typeof n?n:o)},Be.cloneWith=function(t,n){return ar(t,4,n="function"==typeof n?n:o)},Be.conformsTo=function(t,n){return null==n||cr(t,n,La(n))},Be.deburr=Va,Be.defaultTo=function(t,n){return null==t||t!=t?n:t},Be.divide=wc,Be.endsWith=function(t,n,e){t=ma(t),n=ao(n);var r=t.length,u=e=e===o?r:ir(va(e),0,r);return(e-=n.length)>=0&&t.slice(e,u)==n},Be.eq=Wi,Be.escape=function(t){return(t=ma(t))&&H.test(t)?t.replace(G,Yn):t},Be.escapeRegExp=function(t){return(t=ma(t))&&et.test(t)?t.replace(nt,"\\$&"):t},Be.every=function(t,n,e){var r=qi(t)?xn:hr;return e&&_u(t,n,e)&&(n=o),r(t,au(n,3))},Be.find=yi,Be.findIndex=Vu,Be.findKey=function(t,n){return Ln(t,au(n,3),mr)},Be.findLast=_i,Be.findLastIndex=qu,Be.findLastKey=function(t,n){return Ln(t,au(n,3),br)},Be.floor=xc,Be.forEach=mi,Be.forEachRight=bi,Be.forIn=function(t,n){return null==t?t:yr(t,au(n,3),Ta)},Be.forInRight=function(t,n){return null==t?t:_r(t,au(n,3),Ta)},Be.forOwn=function(t,n){return t&&mr(t,au(n,3))},Be.forOwnRight=function(t,n){return t&&br(t,au(n,3))},Be.get=Oa,Be.gt=Fi,Be.gte=$i,Be.has=function(t,n){return null!=t&&du(t,n,Rr)},Be.hasIn=ja,Be.head=Zu,Be.identity=oc,Be.includes=function(t,n,e,r){t=Zi(t)?t:Wa(t),e=e&&!r?va(e):0;var o=t.length;return e<0&&(e=ye(o+e,0)),ca(t)?e<=o&&t.indexOf(n,e)>-1:!!o&&In(t,n,e)>-1},Be.indexOf=function(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var o=null==e?0:va(e);return o<0&&(o=ye(r+o,0)),In(t,n,o)},Be.inRange=function(t,n,e){return n=da(n),e===o?(e=n,n=0):e=da(e),function(t,n,e){return t>=_e(n,e)&&t<ye(n,e)}(t=ya(t),n,e)},Be.invoke=Aa,Be.isArguments=Vi,Be.isArray=qi,Be.isArrayBuffer=Gi,Be.isArrayLike=Zi,Be.isArrayLikeObject=Hi,Be.isBoolean=function(t){return!0===t||!1===t||ea(t)&&Sr(t)==y},Be.isBuffer=Ki,Be.isDate=Ji,Be.isElement=function(t){return ea(t)&&1===t.nodeType&&!ua(t)},Be.isEmpty=function(t){if(null==t)return!0;if(Zi(t)&&(qi(t)||"string"==typeof t||"function"==typeof t.splice||Ki(t)||sa(t)||Vi(t)))return!t.length;var n=hu(t);if(n==x||n==O)return!t.size;if(xu(t))return!Ur(t).length;for(var e in t)if(Tt.call(t,e))return!1;return!0},Be.isEqual=function(t,n){return Ar(t,n)},Be.isEqualWith=function(t,n,e){var r=(e="function"==typeof e?e:o)?e(t,n):o;return r===o?Ar(t,n,o,e):!!r},Be.isError=Yi,Be.isFinite=function(t){return"number"==typeof t&&de(t)},Be.isFunction=Qi,Be.isInteger=Xi,Be.isLength=ta,Be.isMap=ra,Be.isMatch=function(t,n){return t===n||Lr(t,n,fu(n))},Be.isMatchWith=function(t,n,e){return e="function"==typeof e?e:o,Lr(t,n,fu(n),e)},Be.isNaN=function(t){return oa(t)&&t!=+t},Be.isNative=function(t){if(wu(t))throw new wt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Tr(t)},Be.isNil=function(t){return null==t},Be.isNull=function(t){return null===t},Be.isNumber=oa,Be.isObject=na,Be.isObjectLike=ea,Be.isPlainObject=ua,Be.isRegExp=ia,Be.isSafeInteger=function(t){return Xi(t)&&t>=-9007199254740991&&t<=l},Be.isSet=aa,Be.isString=ca,Be.isSymbol=fa,Be.isTypedArray=sa,Be.isUndefined=function(t){return t===o},Be.isWeakMap=function(t){return ea(t)&&hu(t)==k},Be.isWeakSet=function(t){return ea(t)&&"[object WeakSet]"==Sr(t)},Be.join=function(t,n){return null==t?"":ve.call(t,n)},Be.kebabCase=qa,Be.last=Yu,Be.lastIndexOf=function(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var u=r;return e!==o&&(u=(u=va(e))<0?ye(r+u,0):_e(u,r-1)),n==n?function(t,n,e){for(var r=e+1;r--;)if(t[r]===n)return r;return r}(t,n,u):Tn(t,Mn,u,!0)},Be.lowerCase=Ga,Be.lowerFirst=Za,Be.lt=la,Be.lte=pa,Be.max=function(t){return t&&t.length?dr(t,oc,Cr):o},Be.maxBy=function(t,n){return t&&t.length?dr(t,au(n,2),Cr):o},Be.mean=function(t){return Nn(t,oc)},Be.meanBy=function(t,n){return Nn(t,au(n,2))},Be.min=function(t){return t&&t.length?dr(t,oc,Mr):o},Be.minBy=function(t,n){return t&&t.length?dr(t,au(n,2),Mr):o},Be.stubArray=gc,Be.stubFalse=yc,Be.stubObject=function(){return{}},Be.stubString=function(){return""},Be.stubTrue=function(){return!0},Be.multiply=Ec,Be.nth=function(t,n){return t&&t.length?Wr(t,va(n)):o},Be.noConflict=function(){return un._===this&&(un._=Dt),this},Be.noop=fc,Be.now=Oi,Be.pad=function(t,n,e){t=ma(t);var r=(n=va(n))?ue(t):0;if(!n||r>=n)return t;var o=(n-r)/2;return $o(le(o),e)+t+$o(se(o),e)},Be.padEnd=function(t,n,e){t=ma(t);var r=(n=va(n))?ue(t):0;return n&&r<n?t+$o(n-r,e):t},Be.padStart=function(t,n,e){t=ma(t);var r=(n=va(n))?ue(t):0;return n&&r<n?$o(n-r,e)+t:t},Be.parseInt=function(t,n,e){return e||null==n?n=0:n&&(n=+n),be(ma(t).replace(rt,""),n||0)},Be.random=function(t,n,e){if(e&&"boolean"!=typeof e&&_u(t,n,e)&&(n=e=o),e===o&&("boolean"==typeof n?(e=n,n=o):"boolean"==typeof t&&(e=t,t=o)),t===o&&n===o?(t=0,n=1):(t=da(t),n===o?(n=t,t=0):n=da(n)),t>n){var r=t;t=n,n=r}if(e||t%1||n%1){var u=we();return _e(t+u*(n-t+nn("1e-"+((u+"").length-1))),n)}return Gr(t,n)},Be.reduce=function(t,n,e){var r=qi(t)?jn:zn,o=arguments.length<3;return r(t,au(n,4),e,o,lr)},Be.reduceRight=function(t,n,e){var r=qi(t)?Pn:zn,o=arguments.length<3;return r(t,au(n,4),e,o,pr)},Be.repeat=function(t,n,e){return n=(e?_u(t,n,e):n===o)?1:va(n),Zr(ma(t),n)},Be.replace=function(){var t=arguments,n=ma(t[0]);return t.length<3?n:n.replace(t[1],t[2])},Be.result=function(t,n,e){var r=-1,u=(n=_o(n,t)).length;for(u||(u=1,t=o);++r<u;){var i=null==t?o:t[Du(n[r])];i===o&&(r=u,i=e),t=Qi(i)?i.call(t):i}return t},Be.round=Sc,Be.runInContext=t,Be.sample=function(t){return(qi(t)?Je:Kr)(t)},Be.size=function(t){if(null==t)return 0;if(Zi(t))return ca(t)?ue(t):t.length;var n=hu(t);return n==x||n==O?t.size:Ur(t).length},Be.snakeCase=Ha,Be.some=function(t,n,e){var r=qi(t)?kn:eo;return e&&_u(t,n,e)&&(n=o),r(t,au(n,3))},Be.sortedIndex=function(t,n){return ro(t,n)},Be.sortedIndexBy=function(t,n,e){return oo(t,n,au(e,2))},Be.sortedIndexOf=function(t,n){var e=null==t?0:t.length;if(e){var r=ro(t,n);if(r<e&&Wi(t[r],n))return r}return-1},Be.sortedLastIndex=function(t,n){return ro(t,n,!0)},Be.sortedLastIndexBy=function(t,n,e){return oo(t,n,au(e,2),!0)},Be.sortedLastIndexOf=function(t,n){if(null!=t&&t.length){var e=ro(t,n,!0)-1;if(Wi(t[e],n))return e}return-1},Be.startCase=Ka,Be.startsWith=function(t,n,e){return t=ma(t),e=null==e?0:ir(va(e),0,t.length),n=ao(n),t.slice(e,e+n.length)==n},Be.subtract=Cc,Be.sum=function(t){return t&&t.length?Wn(t,oc):0},Be.sumBy=function(t,n){return t&&t.length?Wn(t,au(n,2)):0},Be.template=function(t,n,e){var r=Be.templateSettings;e&&_u(t,n,e)&&(n=o),t=ma(t),n=xa({},n,r,Yo);var u,i,a=xa({},n.imports,r.imports,Yo),c=La(a),f=qn(a,c),s=0,l=n.interpolate||mt,p="__p += '",h=Ct((n.escape||mt).source+"|"+l.source+"|"+(l===Y?lt:mt).source+"|"+(n.evaluate||mt).source+"|$","g"),d="//# sourceURL="+(Tt.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Yt+"]")+"\n";t.replace(h,(function(n,e,r,o,a,c){return r||(r=o),p+=t.slice(s,c).replace(bt,Qn),e&&(u=!0,p+="' +\n__e("+e+") +\n'"),a&&(i=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=c+n.length,n})),p+="';\n";var v=Tt.call(n,"variable")&&n.variable;if(v){if(ft.test(v))throw new wt("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(i?p.replace(F,""):p).replace($,"$1").replace(V,"$1;"),p="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=Xa((function(){return xt(c,d+"return "+p).apply(o,f)}));if(g.source=p,Yi(g))throw g;return g},Be.times=function(t,n){if((t=va(t))<1||t>l)return[];var e=h,r=_e(t,h);n=au(n),t-=h;for(var o=Fn(r,n);++e<t;)n(e);return o},Be.toFinite=da,Be.toInteger=va,Be.toLength=ga,Be.toLower=function(t){return ma(t).toLowerCase()},Be.toNumber=ya,Be.toSafeInteger=function(t){return t?ir(va(t),-9007199254740991,l):0===t?t:0},Be.toString=ma,Be.toUpper=function(t){return ma(t).toUpperCase()},Be.trim=function(t,n,e){if((t=ma(t))&&(e||n===o))return $n(t);if(!t||!(n=ao(n)))return t;var r=ie(t),u=ie(n);return bo(r,Zn(r,u),Hn(r,u)+1).join("")},Be.trimEnd=function(t,n,e){if((t=ma(t))&&(e||n===o))return t.slice(0,ae(t)+1);if(!t||!(n=ao(n)))return t;var r=ie(t);return bo(r,0,Hn(r,ie(n))+1).join("")},Be.trimStart=function(t,n,e){if((t=ma(t))&&(e||n===o))return t.replace(rt,"");if(!t||!(n=ao(n)))return t;var r=ie(t);return bo(r,Zn(r,ie(n))).join("")},Be.truncate=function(t,n){var e=30,r="...";if(na(n)){var u="separator"in n?n.separator:u;e="length"in n?va(n.length):e,r="omission"in n?ao(n.omission):r}var i=(t=ma(t)).length;if(Xn(t)){var a=ie(t);i=a.length}if(e>=i)return t;var c=e-ue(r);if(c<1)return r;var f=a?bo(a,0,c).join(""):t.slice(0,c);if(u===o)return f+r;if(a&&(c+=f.length-c),ia(u)){if(t.slice(c).search(u)){var s,l=f;for(u.global||(u=Ct(u.source,ma(pt.exec(u))+"g")),u.lastIndex=0;s=u.exec(l);)var p=s.index;f=f.slice(0,p===o?c:p)}}else if(t.indexOf(ao(u),c)!=c){var h=f.lastIndexOf(u);h>-1&&(f=f.slice(0,h))}return f+r},Be.unescape=function(t){return(t=ma(t))&&Z.test(t)?t.replace(q,ce):t},Be.uniqueId=function(t){var n=++It;return ma(t)+n},Be.upperCase=Ja,Be.upperFirst=Ya,Be.each=mi,Be.eachRight=bi,Be.first=Zu,cc(Be,(_c={},mr(Be,(function(t,n){Tt.call(Be.prototype,n)||(_c[n]=t)})),_c),{chain:!1}),Be.VERSION="4.17.21",bn(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Be[t].placeholder=Be})),bn(["drop","take"],(function(t,n){$e.prototype[t]=function(e){e=e===o?1:ye(va(e),0);var r=this.__filtered__&&!n?new $e(this):this.clone();return r.__filtered__?r.__takeCount__=_e(e,r.__takeCount__):r.__views__.push({size:_e(e,h),type:t+(r.__dir__<0?"Right":"")}),r},$e.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}})),bn(["filter","map","takeWhile"],(function(t,n){var e=n+1,r=1==e||3==e;$e.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:au(t,3),type:e}),n.__filtered__=n.__filtered__||r,n}})),bn(["head","last"],(function(t,n){var e="take"+(n?"Right":"");$e.prototype[t]=function(){return this[e](1).value()[0]}})),bn(["initial","tail"],(function(t,n){var e="drop"+(n?"":"Right");$e.prototype[t]=function(){return this.__filtered__?new $e(this):this[e](1)}})),$e.prototype.compact=function(){return this.filter(oc)},$e.prototype.find=function(t){return this.filter(t).head()},$e.prototype.findLast=function(t){return this.reverse().find(t)},$e.prototype.invokeMap=Hr((function(t,n){return"function"==typeof t?new $e(this):this.map((function(e){return Pr(e,t,n)}))})),$e.prototype.reject=function(t){return this.filter(Mi(au(t)))},$e.prototype.slice=function(t,n){t=va(t);var e=this;return e.__filtered__&&(t>0||n<0)?new $e(e):(t<0?e=e.takeRight(-t):t&&(e=e.drop(t)),n!==o&&(e=(n=va(n))<0?e.dropRight(-n):e.take(n-t)),e)},$e.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},$e.prototype.toArray=function(){return this.take(h)},mr($e.prototype,(function(t,n){var e=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),u=Be[r?"take"+("last"==n?"Right":""):n],i=r||/^find/.test(n);u&&(Be.prototype[n]=function(){var n=this.__wrapped__,a=r?[1]:arguments,c=n instanceof $e,f=a[0],s=c||qi(n),l=function(t){var n=u.apply(Be,On([t],a));return r&&p?n[0]:n};s&&e&&"function"==typeof f&&1!=f.length&&(c=s=!1);var p=this.__chain__,h=!!this.__actions__.length,d=i&&!p,v=c&&!h;if(!i&&s){n=v?n:new $e(this);var g=t.apply(n,a);return g.__actions__.push({func:di,args:[l],thisArg:o}),new Fe(g,p)}return d&&v?t.apply(this,a):(g=this.thru(l),d?r?g.value()[0]:g.value():g)})})),bn(["pop","push","shift","sort","splice","unshift"],(function(t){var n=jt[t],e=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Be.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return n.apply(qi(o)?o:[],t)}return this[e]((function(e){return n.apply(qi(e)?e:[],t)}))}})),mr($e.prototype,(function(t,n){var e=Be[n];if(e){var r=e.name+"";Tt.call(ke,r)||(ke[r]=[]),ke[r].push({name:n,func:e})}})),ke[Bo(o,2).name]=[{name:"wrapper",func:o}],$e.prototype.clone=function(){var t=new $e(this.__wrapped__);return t.__actions__=jo(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=jo(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=jo(this.__views__),t},$e.prototype.reverse=function(){if(this.__filtered__){var t=new $e(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},$e.prototype.value=function(){var t=this.__wrapped__.value(),n=this.__dir__,e=qi(t),r=n<0,o=e?t.length:0,u=function(t,n,e){for(var r=-1,o=e.length;++r<o;){var u=e[r],i=u.size;switch(u.type){case"drop":t+=i;break;case"dropRight":n-=i;break;case"take":n=_e(n,t+i);break;case"takeRight":t=ye(t,n-i)}}return{start:t,end:n}}(0,o,this.__views__),i=u.start,a=u.end,c=a-i,f=r?a:i-1,s=this.__iteratees__,l=s.length,p=0,h=_e(c,this.__takeCount__);if(!e||!r&&o==c&&h==c)return po(t,this.__actions__);var d=[];t:for(;c--&&p<h;){for(var v=-1,g=t[f+=n];++v<l;){var y=s[v],_=y.iteratee,m=y.type,b=_(g);if(2==m)g=b;else if(!b){if(1==m)continue t;break t}}d[p++]=g}return d},Be.prototype.at=vi,Be.prototype.chain=function(){return hi(this)},Be.prototype.commit=function(){return new Fe(this.value(),this.__chain__)},Be.prototype.next=function(){this.__values__===o&&(this.__values__=ha(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},Be.prototype.plant=function(t){for(var n,e=this;e instanceof We;){var r=zu(e);r.__index__=0,r.__values__=o,n?u.__wrapped__=r:n=r;var u=r;e=e.__wrapped__}return u.__wrapped__=t,n},Be.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof $e){var n=t;return this.__actions__.length&&(n=new $e(this)),(n=n.reverse()).__actions__.push({func:di,args:[ni],thisArg:o}),new Fe(n,this.__chain__)}return this.thru(ni)},Be.prototype.toJSON=Be.prototype.valueOf=Be.prototype.value=function(){return po(this.__wrapped__,this.__actions__)},Be.prototype.first=Be.prototype.head,an&&(Be.prototype[an]=function(){return this}),Be}();un._=fe,(r=function(){return fe}.call(n,e,n,t))===o||(t.exports=r)}.call(this)},968:(t,n,e)=>{const r=e(577).R;n.s=function(t){if(t||(t=1),!e.y.meta||!e.y.meta.url)throw console.error("__system_context__",e.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");e.p=r(e.y.meta.url,t)}},577:(t,n,e)=>{n.R=function(t,n){var e=document.createElement("a");e.href=t;for(var r="/"===e.pathname[0]?e.pathname:"/"+e.pathname,o=0,u=r.length;o!==n&&u>=0;)"/"===r[--u]&&o++;if(o!==n)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+n+") is greater than the number of directories ("+o+") in the URL path "+t);var i=r.slice(0,u+1);return e.protocol+"//"+e.host+i};Number.isInteger},124:function(t){t.exports=function(){"use strict";return function(t,n,e){n.prototype.isToday=function(){var t="YYYY-MM-DD",n=e();return this.format(t)===n.format(t)}}}()},766:t=>{"use strict";t.exports=f},824:t=>{"use strict";t.exports=r},45:t=>{"use strict";t.exports=o},728:t=>{"use strict";t.exports=u},688:t=>{"use strict";t.exports=s},64:t=>{"use strict";t.exports=a},954:t=>{"use strict";t.exports=e},493:t=>{"use strict";t.exports=i},281:t=>{"use strict";t.exports=c}},l={};function p(n){var e=l[n];if(void 0!==e)return e.exports;var r=l[n]={id:n,loaded:!1,exports:{}};return t[n].call(r.exports,r,r.exports,p),r.loaded=!0,r.exports}p.y=n,p.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return p.d(n,{a:n}),n},p.d=(t,n)=>{for(var e in n)p.o(n,e)&&!p.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),p.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),p.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},p.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;p.g.importScripts&&(t=p.g.location+"");var n=p.g.document;if(!t&&n&&(n.currentScript&&(t=n.currentScript.src),!t)){var e=n.getElementsByTagName("script");e.length&&(t=e[e.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),p.p=t})();var h={};return(0,p(968).s)(1),(()=>{"use strict";p.r(h),p.d(h,{ComponentContext:()=>n,ConfigurableLink:()=>o,Extension:()=>a,ExtensionSlot:()=>_,UserHasAccess:()=>gt,createUseStore:()=>u,getAsyncExtensionLifecycle:()=>$,getAsyncLifecycle:()=>W,getLifecycle:()=>z,getSyncLifecycle:()=>F,openmrsComponentDecorator:()=>B,useAssignedExtensionIds:()=>V,useAssignedExtensions:()=>l,useBodyScrollLock:()=>q,useConfig:()=>K,useConnectedExtensions:()=>d,useConnectivity:()=>f,useCurrentPatient:()=>it,useExtensionInternalStore:()=>at,useExtensionSlot:()=>v,useExtensionSlotMeta:()=>ct,useExtensionStore:()=>ft,useForceUpdate:()=>st,useLayoutType:()=>pt,useLocations:()=>ht,useNavigationContext:()=>dt,useOnClickOutside:()=>vt,usePagination:()=>wn,usePatient:()=>nt,useSessionUser:()=>yt,useStore:()=>wt,useStoreWithActions:()=>xt,useVisit:()=>mn,useVisitTypes:()=>bn});var t=p(954);const n=t.default.createContext({moduleName:""});var e=p(824);function r(){return r=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},r.apply(this,arguments)}const o=n=>{let{to:o,children:u,...i}=n;return t.default.createElement("a",r({onClick:t=>function(t,n){t.metaKey||t.ctrlKey||t.shiftKey||0!=t.button||(t.preventDefault(),(0,e.navigate)({to:n}))}(t,o),href:(0,e.interpolateUrl)(o)},i),u)};function u(n){return function(e){const[r,o]=(0,t.useState)(n.getState());(0,t.useEffect)((()=>n.subscribe((t=>o(t)))),[]);let u={};return e&&(u=(0,t.useMemo)((()=>function(t,n){"function"==typeof n&&(n=n(t));const e={};for(let r in n)e[r]=t.action(n[r]);return e}(n,e)),[n,e])),{...r,...u}}}var i=p(45);const a=e=>{let{state:r,wrap:o}=e;const[u,a]=(0,t.useState)(),{extension:c}=(0,t.useContext)(n),f=(0,t.useCallback)((t=>{a(t)}),[]);(0,t.useEffect)((()=>{if(null!=u&&c)return(0,i.renderExtension)(u,c.extensionSlotName,c.extensionSlotModuleName,c.extensionId,void 0,r)}),[c?.extensionSlotName,c?.extensionId,c?.extensionSlotModuleName,r,u]);const s=t.default.createElement("div",{ref:f,"data-extension-id":c?.extensionId,style:{position:"relative"}});return c&&o?o(s,c):s};var c=p(728);function f(){let[n,e]=(0,t.useState)(window.navigator.onLine);return(0,t.useEffect)((()=>(0,c.subscribeConnectivityChanged)((t=>{let{online:n}=t;return e(n)}))),[]),n}var s=p(891);function l(n){const[e,r]=(0,t.useState)([]);return(0,t.useEffect)((()=>{function t(t){const o=t.slots[n]?.assignedExtensions??[];(0,s.isEqual)(o,e)||r(o)}return t((0,i.getExtensionStore)().getState()),(0,i.getExtensionStore)().subscribe(t)}),[n,e]),e}function d(n){const e=f(),r=l(n);return(0,t.useMemo)((()=>(0,i.getConnectedExtensions)(r,e)),[r,e])}function v(e){const{moduleName:r}=(0,t.useContext)(n);if(!r)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,t.useEffect)((()=>{(0,i.registerExtensionSlot)(r,e)}),[]),{extensions:d(e),extensionSlotName:e,extensionSlotModuleName:r}}function g(){return g=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},g.apply(this,arguments)}function y(t){return t}const _=e=>{let{extensionSlotName:r,select:o=y,children:u,state:i,style:c,...f}=e;const s=(0,t.useRef)(null),{extensions:l,extensionSlotModuleName:p}=v(r),h=(0,t.useRef)(i);(function(t,n){if(t===n)return!0;if(!t&&n)return!1;if(t&&!n)return!1;if("object"!=typeof t||"object"!=typeof n)return!1;const e=Object.keys(t),r=Object.keys(n);if(e.length!==r.length)return!1;for(let r=0;r<e.length;r++){const o=e[r];if(!(o in n)||n[o]!==t[o])return!1}return!0})(h.current,i)||(h.current=i);const d=(0,t.useMemo)((()=>r&&o(l).map((e=>t.default.createElement(n.Provider,{key:e.id,value:{moduleName:p,extension:{extensionId:e.id,extensionSlotName:r,extensionSlotModuleName:p}}},u??t.default.createElement(a,{state:h.current}))))),[o,l,r,h.current]);return t.default.createElement("div",g({ref:s,"data-extension-slot-name":r,"data-extension-slot-module-name":p,style:{...c,position:"relative"}},f),d)};var m=p(493);function b(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function w(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?b(Object(e),!0).forEach((function(n){E(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):b(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function x(t){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function E(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function S(t){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function C(t,n){var e;if("function"!=typeof(e=n.domElement?function(){return n.domElement}:n.domElementGetter?n.domElementGetter:t.domElementGetter?t.domElementGetter:function(t){var n=t.appName||t.name;if(!n)throw Error("single-spa's dom-element-getter-helpers was not given an application name as a prop, so it can't make a unique dom element container for the react application");var e="single-spa-application:".concat(n);return function(){var t=document.getElementById(e);return t||((t=document.createElement("div")).id=e,document.body.appendChild(t)),t}}(n)))throw Error("single-spa's dom-element-getter-helpers was given an invalid domElementGetter for application or parcel '".concat(n.name,"'. Expected a function, received ").concat(S(e)));return function(){var t=e(n);if(!(t instanceof HTMLElement))throw Error("single-spa's dom-element-getter-helpers: domElementGetter returned an invalid dom element for application or parcel '".concat(n.name,"'. Expected HTMLElement, received ").concat(S(t)));return t}}var R=null;try{R=require("react").createContext()}catch(b){}var O={React:null,ReactDOM:null,rootComponent:null,loadRootComponent:null,renderType:null,errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{}};function j(t){if("object"!==x(t))throw new Error("single-spa-react requires a configuration object");var n=w(w({},O),t);if(!n.React)throw new Error("single-spa-react must be passed opts.React");if(!n.ReactDOM)throw new Error("single-spa-react must be passed opts.ReactDOM");if(!n.rootComponent&&!n.loadRootComponent)throw new Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(n.errorBoundary&&"function"!=typeof n.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!R&&n.React.createContext&&(R=n.React.createContext()),n.SingleSpaRoot=function(t){function n(t){n.displayName="SingleSpaRoot(".concat(t.name,")")}return n.prototype=Object.create(t.React.Component.prototype),n.prototype.componentDidMount=function(){setTimeout(this.props.mountFinished)},n.prototype.componentWillUnmount=function(){setTimeout(this.props.unmountFinished)},n.prototype.render=function(){return setTimeout(this.props.updateFinished),this.props.children},n}(n);var e={bootstrap:P.bind(null,n),mount:k.bind(null,n),unmount:A.bind(null,n)};return n.parcelCanUpdate&&(e.update=L.bind(null,n)),e}function P(t,n){return t.rootComponent?Promise.resolve():t.loadRootComponent(n).then((function(n){t.rootComponent=n}))}function k(t,n){return new Promise((function(e,r){t.suppressComponentDidCatchWarning||!function(t){if(!(t&&"string"==typeof t.version&&t.version.indexOf(".")>=0))return!1;var n=t.version.slice(0,t.version.indexOf("."));try{return Number(n)>=16}catch(t){return!1}}(t.React)||t.errorBoundary||(t.rootComponent.prototype?t.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(n.name||n.appName||n.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(n.name||n.appName||n.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var o=T(t,n,(function(){e(this)})),u=C(t,n)(),i=function(t){var n=t.opts,e=t.elementToRender,r=t.domElement,o="function"==typeof n.renderType?n.renderType():n.renderType;if(["createRoot","unstable_createRoot","createBlockingRoot","unstable_createBlockingRoot"].indexOf(o)>=0){var u=n.ReactDOM[o](r);return u.render(e),u}return"hydrate"===o?n.ReactDOM.hydrate(e,r):n.ReactDOM.render(e,r),null}({elementToRender:o,domElement:u,opts:t});t.domElements[n.name]=u,t.renderResults[n.name]=i}))}function A(t,n){return new Promise((function(e){t.unmountFinished=e;var r=t.renderResults[n.name];r&&r.unmount?r.unmount():t.ReactDOM.unmountComponentAtNode(t.domElements[n.name]),delete t.domElements[n.name],delete t.renderResults[n.name]}))}function L(t,n){return new Promise((function(e){t.updateResolves[n.name]||(t.updateResolves[n.name]=[]),t.updateResolves[n.name].push(e);var r=T(t,n,null),o=t.renderResults[n.name];if(o&&o.render)o.render(r);else{var u=C(t,n)();t.ReactDOM.render(r,u)}}))}function T(t,n,e){var r=t.React.createElement(t.rootComponent,n),o=R?t.React.createElement(R.Provider,{value:n},r):r;return(t.errorBoundary||n.errorBoundary||t.errorBoundaryClass||n.errorBoundaryClass)&&(t.errorBoundaryClass=t.errorBoundaryClass||n.errorBoundaryClass||function(t,n){function e(n){t.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},e.displayName="SingleSpaReactErrorBoundary(".concat(n.name,")")}return e.prototype=Object.create(t.React.Component.prototype),e.prototype.render=function(){return this.state.caughtError?(t.errorBoundary||n.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},e.prototype.componentDidCatch=function(t,n){this.setState({caughtError:t,caughtErrorInfo:n})},e}(t,n),o=t.React.createElement(t.errorBoundaryClass,n,o)),t.React.createElement(t.SingleSpaRoot,w(w({},n),{},{mountFinished:e,updateFinished:function(){t.updateResolves[n.name]&&(t.updateResolves[n.name].forEach((function(t){return t()})),delete t.updateResolves[n.name])},unmountFinished:function(){setTimeout(t.unmountFinished)}}),o)}var I=p(64),U=p(281);const M=I.default.default||I.default,N={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},D=n=>{(0,t.useEffect)((()=>(M.on("languageChanged",n.forceUpdate),()=>M.off("languageChanged",n.forceUpdate))),[n.forceUpdate]);const e=(0,t.useRef)(null);if(e.current)throw e.current;if(!M.hasLoadedNamespace(n.ns)){const t=setTimeout((()=>{console.warn(`openmrsComponentDecorator: the React suspense promise for i18next.loadNamespaces(['${n.ns}']) did not resolve nor reject after three seconds. This could mean you have multiple versions of i18next and haven't made i18next a webpack external in all projects.`)}),3e3);throw M.loadNamespaces([n.ns]).then((()=>clearTimeout(t))).catch((n=>{clearTimeout(t),e.current=n}))}return t.default.createElement(t.default.Fragment,null,n.children)};function B(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw new Error("Invalid options");const r=Object.assign({},N,e);return function(e){var o,u,i,a;return u=o=class extends t.default.Component{constructor(t){super(t),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:r.moduleName,extension:t._extensionContext}}}componentDidCatch(t,n){n&&n.componentStack&&(t.extra=Object.assign(t.extra||{},{componentStack:n.componentStack})),r.throwErrorsToConsole&&setTimeout((()=>{throw t})),this.setState({caughtError:t,caughtErrorInfo:n})}render(){if(this.state.caughtError)return t.default.createElement("div",null,"An error has occurred. Please try reloading the page.");{const o=t.default.createElement(n.Provider,{value:this.state.config},t.default.createElement(t.default.Suspense,{fallback:null},r.disableTranslations?t.default.createElement(e,this.props):t.default.createElement(D,{ns:r.moduleName,forceUpdate:()=>this.forceUpdate()},t.default.createElement(U.I18nextProvider,{i18n:M,defaultNS:r.moduleName},t.default.createElement(e,this.props)))));return r.strictMode||!t.default.StrictMode?o:t.default.createElement(t.default.StrictMode,null,o)}}},i="displayName",a=`OpenmrsReactComponent(${r.featureName})`,i in u?Object.defineProperty(u,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[i]=a,o}}function z(n,e){return j({React:t.default,ReactDOM:m.default,rootComponent:B(e)(n)})}function W(t,n){return()=>t().then((t=>{let{default:e}=t;return z(e,n)}))}function F(t,n){return()=>Promise.resolve(z(t,n))}const $=W;function V(n){const[e,r]=(0,t.useState)([]);return(0,t.useEffect)((()=>(0,i.getExtensionStore)().subscribe((t=>{const o=t.slots[n]?.assignedExtensions.map((t=>t.id))??[];(0,s.isEqual)(o,e)||r(o)}))),[]),e}function q(n){(0,t.useEffect)((()=>{if(n){const t=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}}}),[n])}const G={};function Z(t){return new Promise((n=>{const e=t.subscribe((t=>{t.loaded&&t.config&&(n(t.config),e())}))}))}function H(n){const[e,r]=(0,t.useState)(function(t){return t?()=>{const n=t.getState();if(n.loaded&&n.config)return n.config}:void 0}(n));return(0,t.useEffect)((()=>n?.subscribe((t=>{t.loaded&&t.config&&r(t.config)}))),[n]),e}function K(){const{moduleName:r,extension:o}=(0,t.useContext)(n);if(!r&&!o)throw Error('No ComponentContext has been provided. This should come from "openmrsComponentDecorator".\nUsually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".');const u=function(n){const r=(0,t.useMemo)((()=>(0,e.getConfigStore)(n)),[n]),o=n,u=H(r);if(!u)throw G[o]||(G[o]=Z(r)),G[o];return u}(r),i=function(n){const r=(0,t.useMemo)((()=>n&&(0,e.getExtensionConfigStore)(n.extensionSlotModuleName,n.extensionSlotName,n.extensionId)),[n]),o=H(r);if(!o&&n){const t=`${n.extensionSlotModuleName}-${n.extensionSlotName}-${n.extensionId}`;throw!G[t]&&r&&(G[t]=Z(r)),G[t]}return o||{}}(o);return(0,t.useMemo)((()=>({...u,...i})),[u,i])}var J,Y=p(766);!function(t){t.loadPatient="loadPatient",t.newPatient="newPatient",t.loadError="patientLoadError"}(J||(J={}));const Q={patientUuid:null,patient:null,isPendingUuid:!0,isLoadingPatient:!1,err:null};function X(){const t=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return t&&t[1]}function tt(t,n){switch(n.type){case J.loadPatient:return{...t,patientUuid:n.patientUuid,patient:null,isPendingUuid:!1,isLoadingPatient:!0,err:null};case J.newPatient:return{...t,patient:n.patient,isPendingUuid:!1,isLoadingPatient:!1,err:null};case J.loadError:return{...t,patient:null,isPendingUuid:!1,isLoadingPatient:!1,err:n.err};default:return t}}function nt(n){const[e,r]=(0,t.useReducer)(tt,{...Q,patientUuid:n??null,isPendingUuid:!n,isLoadingPatient:!!n});return(0,t.useEffect)((()=>{if(e.isPendingUuid){const t=X();r(t?{type:J.loadPatient,patientUuid:t}:{type:J.newPatient,patient:null})}let t=!0;return e.isLoadingPatient&&e.patientUuid&&(0,Y.fetchCurrentPatient)(e.patientUuid).then((n=>t&&r({patient:n.data,type:J.newPatient})),(n=>t&&r({err:n,type:J.loadError}))),()=>{t=!1}}),[e.isPendingUuid,e.isLoadingPatient,e.patientUuid]),(0,t.useEffect)((()=>{const t=t=>{const n=X();n!=e.patientUuid&&r({type:J.loadPatient,patientUuid:n})};return window.addEventListener("single-spa:routing-event",t),()=>window.removeEventListener("single-spa:routing-event",t)}),[e.patientUuid]),{isLoading:e.isPendingUuid||e.isLoadingPatient,patient:e.patient,patientUuid:n??e.patientUuid,error:e.err}}var et;!function(t){t.loadPatient="loadPatient",t.newPatient="newPatient",t.loadError="patientLloadErroroadError"}(et||(et={}));const rt={patient:null,isLoadingPatient:!0,err:null};function ot(){const t=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return t&&t[1]}function ut(t,n){switch(n.type){case et.loadPatient:return{...t,patient:null,isLoadingPatient:!0,err:null};case et.newPatient:return{...t,patient:n.patient,isLoadingPatient:!1,err:null};case et.loadError:return{...t,patient:null,isLoadingPatient:!1,err:n.err};default:return t}}function it(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ot();const[e,r]=(0,t.useReducer)(ut,rt);return(0,t.useEffect)((()=>{let t=!0;return n?((0,Y.fetchCurrentPatient)(n).then((n=>t&&r({patient:n.data,type:et.newPatient})),(n=>t&&r({err:n,type:et.loadError}))),r({type:et.loadPatient})):r({type:et.newPatient,patient:null}),()=>{t=!1}}),[n]),[e.isLoadingPatient,e.patient,n,e.err]}const at=u((0,i.getExtensionInternalStore)());function ct(n){const e=d(n);return(0,t.useMemo)((()=>Object.fromEntries(e.map((t=>[t.name,t.meta])))),[e])}const ft=u((0,i.getExtensionStore)());function st(){const[,n]=(0,t.useState)(0);return(0,t.useCallback)((()=>{n((t=>t+1))}),[])}function lt(){let t="tablet";return document.body.classList.forEach((n=>{switch(n){case"omrs-breakpoint-lt-tablet":t="phone";break;case"omrs-breakpoint-gt-tablet":t="desktop"}})),t}function pt(){const[n,e]=(0,t.useState)(lt);return(0,t.useEffect)((()=>{const t=()=>{e(lt())};return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[]),n}function ht(){const[n,e]=(0,t.useState)([]);return(0,t.useEffect)((()=>{const t=(0,Y.getLocations)().subscribe((t=>{e(t)}),(t=>{console.error(t)}));return()=>t.unsubscribe()}),[]),n}function dt(n){(0,t.useEffect)((()=>(0,i.pushNavigationContext)(n)),[])}function vt(n){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=(0,t.useRef)(null);return(0,t.useEffect)((()=>{if(e){const t=t=>{const e=r?.current;e?.contains(t.target)&&n(t)};return window.addEventListener("click",t),()=>window.removeEventListener("click",t)}}),[n,e]),r}const gt=n=>{let{privilege:e,children:r}=n;const[o,u]=(0,t.useState)(null);return(0,t.useEffect)((()=>{const t=(0,Y.getCurrentUser)({includeAuthStatus:!1}).subscribe(u);return()=>t.unsubscribe()}),[]),o&&(0,Y.userHasAccess)(e,o)?t.default.createElement(t.default.Fragment,null,r):null};function yt(){const[n,e]=(0,t.useState)(null);return(0,t.useEffect)((()=>{if(null===n){const t=(0,Y.openmrsObservableFetch)("/ws/rest/v1/session").subscribe((t=>{e(t.data)}));return()=>t.unsubscribe()}}),[n]),n}var _t=p(748);function mt(t,n){"function"==typeof n&&(n=n(t));const e={};for(let r in n)e[r]=t.action(n[r]);return e}const bt=t=>t;function wt(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bt,r=arguments.length>2?arguments[2]:void 0;const[o,u]=(0,t.useState)((()=>e(n.getState())));(0,t.useEffect)((()=>(0,_t.subscribeTo)(n,e,u)),[n,e]);let i={};return r&&(i=(0,t.useMemo)((()=>mt(n,r)),[n,r])),{...o,...i}}function xt(t,n){return wt(t,bt,n)}function Et(t,n,e,r){return new(e||(e=Promise))((function(o,u){function i(t){try{c(r.next(t))}catch(t){u(t)}}function a(t){try{c(r.throw(t))}catch(t){u(t)}}function c(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(i,a)}c((r=r.apply(t,n||[])).next())}))}function St(t,n){var e,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=n.call(t,i)}catch(t){u=[6,t],r=0}finally{e=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}var Ct,Rt=function(){},Ot=Rt(),jt=Object,Pt=function(t){return t===Ot},kt=function(t){return"function"==typeof t},At=function(t,n){return jt.assign({},t,n)},Lt="undefined",Tt=function(){return typeof window!=Lt},It=new WeakMap,Ut=0,Mt=function(t){var n,e,r=typeof t,o=t&&t.constructor,u=o==Date;if(jt(t)!==t||u||o==RegExp)n=u?t.toJSON():"symbol"==r?t.toString():"string"==r?JSON.stringify(t):""+t;else{if(n=It.get(t))return n;if(n=++Ut+"~",It.set(t,n),o==Array){for(n="@",e=0;e<t.length;e++)n+=Mt(t[e])+",";It.set(t,n)}if(o==jt){n="#";for(var i=jt.keys(t).sort();!Pt(e=i.pop());)Pt(t[e])||(n+=e+":"+Mt(t[e])+",");It.set(t,n)}}return n},Nt=!0,Dt=Tt(),Bt=typeof document!=Lt,zt=Dt&&window.addEventListener?window.addEventListener.bind(window):Rt,Wt=Bt?document.addEventListener.bind(document):Rt,Ft=Dt&&window.removeEventListener?window.removeEventListener.bind(window):Rt,$t=Bt?document.removeEventListener.bind(document):Rt,Vt={isOnline:function(){return Nt},isVisible:function(){var t=Bt&&document.visibilityState;return Pt(t)||"hidden"!==t}},qt={initFocus:function(t){return Wt("visibilitychange",t),zt("focus",t),function(){$t("visibilitychange",t),Ft("focus",t)}},initReconnect:function(t){var n=function(){Nt=!0,t()},e=function(){Nt=!1};return zt("online",n),zt("offline",e),function(){Ft("online",n),Ft("offline",e)}}},Gt=!Tt()||"Deno"in window,Zt=Gt?t.useEffect:t.useLayoutEffect,Ht="undefined"!=typeof navigator&&navigator.connection,Kt=!Gt&&Ht&&(["slow-2g","2g"].includes(Ht.effectiveType)||Ht.saveData),Jt=function(t){if(kt(t))try{t=t()}catch(n){t=""}var n=[].concat(t);return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?Mt(t):"",n,t?"$swr$"+t:""]},Yt=new WeakMap,Qt=function(t,n,e,r,o,u,i){void 0===i&&(i=!0);var a=Yt.get(t),c=a[0],f=a[1],s=a[3],l=c[n],p=f[n];if(i&&p)for(var h=0;h<p.length;++h)p[h](e,r,o);return u&&(delete s[n],l&&l[0])?l[0](2).then((function(){return t.get(n)})):t.get(n)},Xt=0,tn=function(){return++Xt},nn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Et(void 0,void 0,void 0,(function(){var n,e,r,o,u,i,a,c,f,s,l,p,h,d,v,g,y,_,m,b;return St(this,(function(w){switch(w.label){case 0:if(n=t[0],e=t[1],r=t[2],o=t[3],i=!!Pt((u="boolean"==typeof o?{revalidate:o}:o||{}).populateCache)||u.populateCache,a=!1!==u.revalidate,c=!1!==u.rollbackOnError,f=u.optimisticData,s=Jt(e),l=s[0],p=s[2],!l)return[2];if(h=Yt.get(n),d=h[2],t.length<3)return[2,Qt(n,l,n.get(l),Ot,Ot,a,!0)];if(v=r,y=tn(),d[l]=[y,0],_=!Pt(f),m=n.get(l),_&&(n.set(l,f),Qt(n,l,f)),kt(v))try{v=v(n.get(l))}catch(t){g=t}return v&&kt(v.then)?[4,v.catch((function(t){g=t}))]:[3,2];case 1:if(v=w.sent(),y!==d[l][0]){if(g)throw g;return[2,v]}g&&_&&c&&(i=!0,v=m,n.set(l,m)),w.label=2;case 2:return i&&(g||(kt(i)&&(v=i(v,m)),n.set(l,v)),n.set(p,At(n.get(p),{error:g}))),d[l][1]=tn(),[4,Qt(n,l,v,g,Ot,a,!!i)];case 3:if(b=w.sent(),g)throw g;return[2,i?b:v]}}))}))},en=function(t,n){for(var e in t)t[e][0]&&t[e][0](n)},rn=function(t,n){if(!Yt.has(t)){var e=At(qt,n),r={},o=nn.bind(Ot,t),u=Rt;if(Yt.set(t,[r,{},{},{},o]),!Gt){var i=e.initFocus(setTimeout.bind(Ot,en.bind(Ot,r,0))),a=e.initReconnect(setTimeout.bind(Ot,en.bind(Ot,r,1)));u=function(){i&&i(),a&&a(),Yt.delete(t)}}return[t,o,u]}return[t,Yt.get(t)[4]]},on=rn(new Map),un=on[0],an=on[1],cn=At({onLoadingSlow:Rt,onSuccess:Rt,onError:Rt,onErrorRetry:function(t,n,e,r,o){var u=e.errorRetryCount,i=o.retryCount,a=~~((Math.random()+.5)*(1<<(i<8?i:8)))*e.errorRetryInterval;!Pt(u)&&i>u||setTimeout(r,a,o)},onDiscarded:Rt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Kt?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:Kt?5e3:3e3,compare:function(t,n){return Mt(t)==Mt(n)},isPaused:function(){return!1},cache:un,mutate:an,fallback:{}},Vt),fn=function(t,n){var e=At(t,n);if(n){var r=t.use,o=t.fallback,u=n.use,i=n.fallback;r&&u&&(e.use=r.concat(u)),o&&i&&(e.fallback=At(o,i))}return e},sn=(0,t.createContext)({}),ln=function(t){return kt(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(null===t[1]?t[2]:t[1])||{}]},pn=function(){return At(cn,(0,t.useContext)(sn))},hn=function(t,n,e){var r=n[t]||(n[t]=[]);return r.push(e),function(){var t=r.indexOf(e);t>=0&&(r[t]=r[r.length-1],r.pop())}},dn={dedupe:!0},vn=(jt.defineProperty((function(n){var e=n.value,r=fn((0,t.useContext)(sn),e),o=e&&e.provider,u=(0,t.useState)((function(){return o?rn(o(r.cache||un),e):Ot}))[0];return u&&(r.cache=u[0],r.mutate=u[1]),Zt((function(){return u?u[2]:Ot}),[]),(0,t.createElement)(sn.Provider,At(n,{value:r}))}),"default",{value:cn}),Ct=function(n,e,r){var o=r.cache,u=r.compare,i=r.fallbackData,a=r.suspense,c=r.revalidateOnMount,f=r.refreshInterval,s=r.refreshWhenHidden,l=r.refreshWhenOffline,p=Yt.get(o),h=p[0],d=p[1],v=p[2],g=p[3],y=Jt(n),_=y[0],m=y[1],b=y[2],w=(0,t.useRef)(!1),x=(0,t.useRef)(!1),E=(0,t.useRef)(_),S=(0,t.useRef)(e),C=(0,t.useRef)(r),R=function(){return C.current},O=function(){return R().isVisible()&&R().isOnline()},j=function(t){return o.set(b,At(o.get(b),t))},P=o.get(_),k=Pt(i)?r.fallback[_]:i,A=Pt(P)?k:P,L=o.get(b)||{},T=L.error,I=!w.current,U=function(){return I&&!Pt(c)?c:!R().isPaused()&&(a?!Pt(A):Pt(A)||r.revalidateIfStale)},M=!(!_||!e)&&(!!L.isValidating||I&&U()),N=function(n,e){var r=(0,t.useState)({})[1],o=(0,t.useRef)(n),u=(0,t.useRef)({data:!1,error:!1,isValidating:!1}),i=(0,t.useCallback)((function(t){var n=!1,i=o.current;for(var a in t){var c=a;i[c]!==t[c]&&(i[c]=t[c],u.current[c]&&(n=!0))}n&&!e.current&&r({})}),[]);return Zt((function(){o.current=n})),[o,u.current,i]}({data:A,error:T,isValidating:M},x),D=N[0],B=N[1],z=N[2],W=(0,t.useCallback)((function(t){return Et(void 0,void 0,void 0,(function(){var n,e,i,a,c,f,s,l,p,h,d,y,b;return St(this,(function(C){switch(C.label){case 0:if(n=S.current,!_||!n||x.current||R().isPaused())return[2,!1];a=!0,c=t||{},f=!g[_]||!c.dedupe,s=function(){return!x.current&&_===E.current&&w.current},l=function(){var t=g[_];t&&t[1]===i&&delete g[_]},p={isValidating:!1},h=function(){j({isValidating:!1}),s()&&z(p)},j({isValidating:!0}),z({isValidating:!0}),C.label=1;case 1:return C.trys.push([1,3,,4]),f&&(Qt(o,_,D.current.data,D.current.error,!0),r.loadingTimeout&&!o.get(_)&&setTimeout((function(){a&&s()&&R().onLoadingSlow(_,r)}),r.loadingTimeout),g[_]=[n.apply(void 0,m),tn()]),b=g[_],e=b[0],i=b[1],[4,e];case 2:return e=C.sent(),f&&setTimeout(l,r.dedupingInterval),g[_]&&g[_][1]===i?(j({error:Ot}),p.error=Ot,d=v[_],!Pt(d)&&(i<=d[0]||i<=d[1]||0===d[1])?(h(),f&&s()&&R().onDiscarded(_),[2,!1]):(u(D.current.data,e)?p.data=D.current.data:p.data=e,u(o.get(_),e)||o.set(_,e),f&&s()&&R().onSuccess(e,_,r),[3,4])):(f&&s()&&R().onDiscarded(_),[2,!1]);case 3:return y=C.sent(),l(),R().isPaused()||(j({error:y}),p.error=y,f&&s()&&(R().onError(y,_,r),("boolean"==typeof r.shouldRetryOnError&&r.shouldRetryOnError||kt(r.shouldRetryOnError)&&r.shouldRetryOnError(y))&&O()&&R().onErrorRetry(y,_,r,W,{retryCount:(c.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return a=!1,h(),s()&&f&&Qt(o,_,p.data,p.error,!1),[2,!0]}}))}))}),[_]),F=(0,t.useCallback)(nn.bind(Ot,o,(function(){return E.current})),[]);if(Zt((function(){S.current=e,C.current=r})),Zt((function(){if(_){var t=_!==E.current,n=W.bind(Ot,dn),e=0,r=hn(_,d,(function(t,n,e){z(At({error:n,isValidating:e},u(D.current.data,t)?Ot:{data:t}))})),o=hn(_,h,(function(t){if(0==t){var r=Date.now();R().revalidateOnFocus&&r>e&&O()&&(e=r+R().focusThrottleInterval,n())}else if(1==t)R().revalidateOnReconnect&&O()&&n();else if(2==t)return W()}));return x.current=!1,E.current=_,w.current=!0,t&&z({data:A,error:T,isValidating:M}),U()&&(Pt(A)||Gt?n():(i=n,Tt()&&typeof window.requestAnimationFrame!=Lt?window.requestAnimationFrame(i):setTimeout(i,1))),function(){x.current=!0,r(),o()}}var i}),[_,W]),Zt((function(){var t;function n(){var n=kt(f)?f(A):f;n&&-1!==t&&(t=setTimeout(e,n))}function e(){D.current.error||!s&&!R().isVisible()||!l&&!R().isOnline()?n():W(dn).then(n)}return n(),function(){t&&(clearTimeout(t),t=-1)}}),[f,s,l,W]),(0,t.useDebugValue)(A),a&&Pt(A)&&_)throw S.current=e,C.current=r,x.current=!1,Pt(T)?W(dn):T;return{mutate:F,get data(){return B.data=!0,A},get error(){return B.error=!0,T},get isValidating(){return B.isValidating=!0,M}}},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=pn(),r=ln(t),o=r[0],u=r[1],i=r[2],a=fn(e,i),c=Ct,f=a.use;if(f)for(var s=f.length;s-- >0;)c=f[s](c);return c(o,u||a.fetcher,a)}),gn=p(688),yn=p(124),_n=p.n(yn);function mn(t){const{data:n,error:e,mutate:r,isValidating:o}=vn(`/ws/rest/v1/visit?patient=${t}&v=${Y.defaultVisitCustomRepresentation}&includeInactive=false`,Y.openmrsFetch);return{error:e,mutate:r,isValidating:o,currentVisit:n?.data.results.find((t=>null===t.stopDatetime&&(0,gn.default)(t.startDatetime).isToday()))??null}}function bn(){const[n,e]=(0,t.useState)([]);return(0,t.useEffect)((()=>{const t=(0,Y.getVisitTypes)().subscribe((t=>{e(t)}),(t=>console.error(t)));return()=>t.unsubscribe()}),[]),n}function wn(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const[r,o]=(0,t.useState)(1),u=(0,t.useMemo)((()=>Math.max(1,Math.ceil(n.length/e))),[n.length,e]),i=(0,t.useMemo)((()=>{const t=(r-1)*e,o=(r+0)*e;return n.slice(t,o)}),[n,r,e]);return{results:i,totalPages:u,currentPage:r,paginated:n.length>e,showNextButton:r<u,showPreviousButton:r>1,goTo(t){o(Math.max(1,Math.min(u,t)))},goToNext(){r<u&&o(r+1)},goToPrevious(){r>1&&o(r-1)}}}gn.default.extend(_n())})(),h})())}}}));
2
+ System.register(["react","@openmrs/esm-config","@openmrs/esm-extensions","@openmrs/esm-globals","react-dom","i18next","react-i18next","@openmrs/esm-api","dayjs"],(function(t,n){var e={},r={},o={},u={},i={},a={},c={},f={},s={};return{setters:[function(t){e.createContext=t.createContext,e.createElement=t.createElement,e.default=t.default,e.useCallback=t.useCallback,e.useContext=t.useContext,e.useDebugValue=t.useDebugValue,e.useEffect=t.useEffect,e.useLayoutEffect=t.useLayoutEffect,e.useMemo=t.useMemo,e.useReducer=t.useReducer,e.useRef=t.useRef,e.useState=t.useState},function(t){r.getConfigStore=t.getConfigStore,r.getExtensionConfigStore=t.getExtensionConfigStore,r.interpolateUrl=t.interpolateUrl,r.navigate=t.navigate},function(t){o.getConnectedExtensions=t.getConnectedExtensions,o.getExtensionInternalStore=t.getExtensionInternalStore,o.getExtensionStore=t.getExtensionStore,o.registerExtensionSlot=t.registerExtensionSlot,o.renderExtension=t.renderExtension},function(t){u.subscribeConnectivityChanged=t.subscribeConnectivityChanged},function(t){i.default=t.default},function(t){a.default=t.default},function(t){c.I18nextProvider=t.I18nextProvider},function(t){f.defaultVisitCustomRepresentation=t.defaultVisitCustomRepresentation,f.fetchCurrentPatient=t.fetchCurrentPatient,f.getCurrentUser=t.getCurrentUser,f.getLocations=t.getLocations,f.getVisitTypes=t.getVisitTypes,f.openmrsFetch=t.openmrsFetch,f.openmrsObservableFetch=t.openmrsObservableFetch,f.userHasAccess=t.userHasAccess},function(t){s.default=t.default}],execute:function(){t((()=>{var t={748:()=>{System.register([],(function(t,n){return{execute:function(){t((()=>{var t={968:(t,n,e)=>{const r=e(577).R;n.s=function(t){if(t||(t=1),!e.y.meta||!e.y.meta.url)throw console.error("__system_context__",e.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");e.p=r(e.y.meta.url,t)}},577:(t,n,e)=>{n.R=function(t,n){var e=document.createElement("a");e.href=t;for(var r="/"===e.pathname[0]?e.pathname:"/"+e.pathname,o=0,u=r.length;o!==n&&u>=0;)"/"===r[--u]&&o++;if(o!==n)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+n+") is greater than the number of directories ("+o+") in the URL path "+t);var i=r.slice(0,u+1);return e.protocol+"//"+e.host+i},Number.isInteger}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var u=e[n]={exports:{}};return t[n](u,u.exports,r),u.exports}r.y=n,r.d=(t,n)=>{for(var e in n)r.o(n,e)&&!r.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;r.g.importScripts&&(t=r.g.location+"");var n=r.g.document;if(!t&&n&&(n.currentScript&&(t=n.currentScript.src),!t)){var e=n.getElementsByTagName("script");e.length&&(t=e[e.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=t})();var o={};return(0,r(968).s)(1),(()=>{"use strict";function t(t,n){for(var e in n)t[e]=n[e];return t}function n(n){var e=[];function r(t){for(var n=[],r=0;r<e.length;r++)e[r]===t?t=null:n.push(e[r]);e=n}function o(r,o,u){n=o?r:t(t({},n),r);for(var i=e,a=0;a<i.length;a++)i[a](n,u)}return n=n||{},{action:function(t){function e(n){o(n,!1,t)}return function(){for(var r=arguments,o=[n],u=0;u<arguments.length;u++)o.push(r[u]);var i=t.apply(this,o);if(null!=i)return i.then?i.then(e):e(i)}},setState:o,subscribe:function(t){return e.push(t),function(){r(t)}},unsubscribe:r,getState:function(){return n}}}r.r(o),r.d(o,{createAppState:()=>a,createGlobalStore:()=>u,getAppState:()=>c,getGlobalStore:()=>i,subscribeTo:()=>f,update:()=>s});const e={};function u(t,r){const o=e[t];if(o)return o.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):o.value.setState(r,!0),o.active=!0,o.value;{const o=n(r);return e[t]={value:o,active:!0},o}}function i(t,r){const o=e[t];if(!o){const o=n(r);return e[t]={value:o,active:!1},o}return o.value}function a(t){return u("app",t)}function c(){return i("app",{})}function f(t,n,e){let r=n(t.getState());return t.subscribe((t=>{const o=n(t);o!==r&&(r=o,e(o))}))}function s(t,n,e){let[r,...o]=n;return r?0===o.length?{...t,[r]:e}:{...t,[r]:s(t[r]||{},o,e)}:t}})(),o})())}}}))},891:function(t,n,e){var r;t=e.nmd(t),function(){var o,u="Expected a function",i="__lodash_hash_undefined__",a="__lodash_placeholder__",c=32,f=128,s=1/0,l=9007199254740991,p=NaN,h=4294967295,d=[["ary",f],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",c],["partialRight",64],["rearg",256]],v="[object Arguments]",g="[object Array]",y="[object Boolean]",_="[object Date]",m="[object Error]",b="[object Function]",w="[object GeneratorFunction]",x="[object Map]",E="[object Number]",S="[object Object]",C="[object Promise]",R="[object RegExp]",O="[object Set]",j="[object String]",P="[object Symbol]",k="[object WeakMap]",A="[object ArrayBuffer]",L="[object DataView]",T="[object Float32Array]",I="[object Float64Array]",U="[object Int8Array]",M="[object Int16Array]",D="[object Int32Array]",N="[object Uint8Array]",B="[object Uint8ClampedArray]",z="[object Uint16Array]",W="[object Uint32Array]",F=/\b__p \+= '';/g,$=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,Z=RegExp(q.source),H=RegExp(G.source),K=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(nt.source),rt=/^\s+/,ot=/\s/,ut=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,it=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ct=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ft=/[()=,{}\[\]\/\s]/,st=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,ht=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,_t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mt=/($^)/,bt=/['\n\r\u2028\u2029\\]/g,wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",St="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ct="["+St+"]",Rt="["+wt+"]",Ot="\\d+",jt="["+xt+"]",Pt="[^\\ud800-\\udfff"+St+Ot+"\\u2700-\\u27bf"+xt+Et+"]",kt="\\ud83c[\\udffb-\\udfff]",At="[^\\ud800-\\udfff]",Lt="(?:\\ud83c[\\udde6-\\uddff]){2}",Tt="[\\ud800-\\udbff][\\udc00-\\udfff]",It="["+Et+"]",Ut="(?:"+jt+"|"+Pt+")",Mt="(?:"+It+"|"+Pt+")",Dt="(?:['’](?:d|ll|m|re|s|t|ve))?",Nt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Bt="(?:"+Rt+"|"+kt+")?",zt="[\\ufe0e\\ufe0f]?",Wt=zt+Bt+"(?:\\u200d(?:"+[At,Lt,Tt].join("|")+")"+zt+Bt+")*",Ft="(?:"+["[\\u2700-\\u27bf]",Lt,Tt].join("|")+")"+Wt,$t="(?:"+[At+Rt+"?",Rt,Lt,Tt,"[\\ud800-\\udfff]"].join("|")+")",Vt=RegExp("['’]","g"),qt=RegExp(Rt,"g"),Gt=RegExp(kt+"(?="+kt+")|"+$t+Wt,"g"),Zt=RegExp([It+"?"+jt+"+"+Dt+"(?="+[Ct,It,"$"].join("|")+")",Mt+"+"+Nt+"(?="+[Ct,It+Ut,"$"].join("|")+")",It+"?"+Ut+"+"+Dt,It+"+"+Nt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ot,Ft].join("|"),"g"),Ht=RegExp("[\\u200d\\ud800-\\udfff"+wt+"\\ufe0e\\ufe0f]"),Kt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Jt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Yt=-1,Qt={};Qt[T]=Qt[I]=Qt[U]=Qt[M]=Qt[D]=Qt[N]=Qt[B]=Qt[z]=Qt[W]=!0,Qt[v]=Qt[g]=Qt[A]=Qt[y]=Qt[L]=Qt[_]=Qt[m]=Qt[b]=Qt[x]=Qt[E]=Qt[S]=Qt[R]=Qt[O]=Qt[j]=Qt[k]=!1;var Xt={};Xt[v]=Xt[g]=Xt[A]=Xt[L]=Xt[y]=Xt[_]=Xt[T]=Xt[I]=Xt[U]=Xt[M]=Xt[D]=Xt[x]=Xt[E]=Xt[S]=Xt[R]=Xt[O]=Xt[j]=Xt[P]=Xt[N]=Xt[B]=Xt[z]=Xt[W]=!0,Xt[m]=Xt[b]=Xt[k]=!1;var tn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},nn=parseFloat,en=parseInt,rn="object"==typeof e.g&&e.g&&e.g.Object===Object&&e.g,on="object"==typeof self&&self&&self.Object===Object&&self,un=rn||on||Function("return this")(),an=n&&!n.nodeType&&n,cn=an&&t&&!t.nodeType&&t,fn=cn&&cn.exports===an,sn=fn&&rn.process,ln=function(){try{return cn&&cn.require&&cn.require("util").types||sn&&sn.binding&&sn.binding("util")}catch(t){}}(),pn=ln&&ln.isArrayBuffer,hn=ln&&ln.isDate,dn=ln&&ln.isMap,vn=ln&&ln.isRegExp,gn=ln&&ln.isSet,yn=ln&&ln.isTypedArray;function _n(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)}function mn(t,n,e,r){for(var o=-1,u=null==t?0:t.length;++o<u;){var i=t[o];n(r,i,e(i),t)}return r}function bn(t,n){for(var e=-1,r=null==t?0:t.length;++e<r&&!1!==n(t[e],e,t););return t}function wn(t,n){for(var e=null==t?0:t.length;e--&&!1!==n(t[e],e,t););return t}function xn(t,n){for(var e=-1,r=null==t?0:t.length;++e<r;)if(!n(t[e],e,t))return!1;return!0}function En(t,n){for(var e=-1,r=null==t?0:t.length,o=0,u=[];++e<r;){var i=t[e];n(i,e,t)&&(u[o++]=i)}return u}function Sn(t,n){return!(null==t||!t.length)&&In(t,n,0)>-1}function Cn(t,n,e){for(var r=-1,o=null==t?0:t.length;++r<o;)if(e(n,t[r]))return!0;return!1}function Rn(t,n){for(var e=-1,r=null==t?0:t.length,o=Array(r);++e<r;)o[e]=n(t[e],e,t);return o}function On(t,n){for(var e=-1,r=n.length,o=t.length;++e<r;)t[o+e]=n[e];return t}function jn(t,n,e,r){var o=-1,u=null==t?0:t.length;for(r&&u&&(e=t[++o]);++o<u;)e=n(e,t[o],o,t);return e}function Pn(t,n,e,r){var o=null==t?0:t.length;for(r&&o&&(e=t[--o]);o--;)e=n(e,t[o],o,t);return e}function kn(t,n){for(var e=-1,r=null==t?0:t.length;++e<r;)if(n(t[e],e,t))return!0;return!1}var An=Nn("length");function Ln(t,n,e){var r;return e(t,(function(t,e,o){if(n(t,e,o))return r=e,!1})),r}function Tn(t,n,e,r){for(var o=t.length,u=e+(r?1:-1);r?u--:++u<o;)if(n(t[u],u,t))return u;return-1}function In(t,n,e){return n==n?function(t,n,e){for(var r=e-1,o=t.length;++r<o;)if(t[r]===n)return r;return-1}(t,n,e):Tn(t,Mn,e)}function Un(t,n,e,r){for(var o=e-1,u=t.length;++o<u;)if(r(t[o],n))return o;return-1}function Mn(t){return t!=t}function Dn(t,n){var e=null==t?0:t.length;return e?Wn(t,n)/e:p}function Nn(t){return function(n){return null==n?o:n[t]}}function Bn(t){return function(n){return null==t?o:t[n]}}function zn(t,n,e,r,o){return o(t,(function(t,o,u){e=r?(r=!1,t):n(e,t,o,u)})),e}function Wn(t,n){for(var e,r=-1,u=t.length;++r<u;){var i=n(t[r]);i!==o&&(e=e===o?i:e+i)}return e}function Fn(t,n){for(var e=-1,r=Array(t);++e<t;)r[e]=n(e);return r}function $n(t){return t?t.slice(0,ae(t)+1).replace(rt,""):t}function Vn(t){return function(n){return t(n)}}function qn(t,n){return Rn(n,(function(n){return t[n]}))}function Gn(t,n){return t.has(n)}function Zn(t,n){for(var e=-1,r=t.length;++e<r&&In(n,t[e],0)>-1;);return e}function Hn(t,n){for(var e=t.length;e--&&In(n,t[e],0)>-1;);return e}function Kn(t,n){for(var e=t.length,r=0;e--;)t[e]===n&&++r;return r}var Jn=Bn({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Yn=Bn({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Qn(t){return"\\"+tn[t]}function Xn(t){return Ht.test(t)}function te(t){var n=-1,e=Array(t.size);return t.forEach((function(t,r){e[++n]=[r,t]})),e}function ne(t,n){return function(e){return t(n(e))}}function ee(t,n){for(var e=-1,r=t.length,o=0,u=[];++e<r;){var i=t[e];i!==n&&i!==a||(t[e]=a,u[o++]=e)}return u}function re(t){var n=-1,e=Array(t.size);return t.forEach((function(t){e[++n]=t})),e}function oe(t){var n=-1,e=Array(t.size);return t.forEach((function(t){e[++n]=[t,t]})),e}function ue(t){return Xn(t)?function(t){for(var n=Gt.lastIndex=0;Gt.test(t);)++n;return n}(t):An(t)}function ie(t){return Xn(t)?function(t){return t.match(Gt)||[]}(t):function(t){return t.split("")}(t)}function ae(t){for(var n=t.length;n--&&ot.test(t.charAt(n)););return n}var ce=Bn({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),fe=function t(n){var e,r=(n=null==n?un:fe.defaults(un.Object(),n,fe.pick(un,Jt))).Array,ot=n.Date,wt=n.Error,xt=n.Function,Et=n.Math,St=n.Object,Ct=n.RegExp,Rt=n.String,Ot=n.TypeError,jt=r.prototype,Pt=xt.prototype,kt=St.prototype,At=n["__core-js_shared__"],Lt=Pt.toString,Tt=kt.hasOwnProperty,It=0,Ut=(e=/[^.]+$/.exec(At&&At.keys&&At.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"",Mt=kt.toString,Dt=Lt.call(St),Nt=un._,Bt=Ct("^"+Lt.call(Tt).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=fn?n.Buffer:o,Wt=n.Symbol,Ft=n.Uint8Array,$t=zt?zt.allocUnsafe:o,Gt=ne(St.getPrototypeOf,St),Ht=St.create,tn=kt.propertyIsEnumerable,rn=jt.splice,on=Wt?Wt.isConcatSpreadable:o,an=Wt?Wt.iterator:o,cn=Wt?Wt.toStringTag:o,sn=function(){try{var t=su(St,"defineProperty");return t({},"",{}),t}catch(t){}}(),ln=n.clearTimeout!==un.clearTimeout&&n.clearTimeout,An=ot&&ot.now!==un.Date.now&&ot.now,Bn=n.setTimeout!==un.setTimeout&&n.setTimeout,se=Et.ceil,le=Et.floor,pe=St.getOwnPropertySymbols,he=zt?zt.isBuffer:o,de=n.isFinite,ve=jt.join,ge=ne(St.keys,St),ye=Et.max,_e=Et.min,me=ot.now,be=n.parseInt,we=Et.random,xe=jt.reverse,Ee=su(n,"DataView"),Se=su(n,"Map"),Ce=su(n,"Promise"),Re=su(n,"Set"),Oe=su(n,"WeakMap"),je=su(St,"create"),Pe=Oe&&new Oe,ke={},Ae=Bu(Ee),Le=Bu(Se),Te=Bu(Ce),Ie=Bu(Re),Ue=Bu(Oe),Me=Wt?Wt.prototype:o,De=Me?Me.valueOf:o,Ne=Me?Me.toString:o;function Be(t){if(ea(t)&&!qi(t)&&!(t instanceof $e)){if(t instanceof Fe)return t;if(Tt.call(t,"__wrapped__"))return zu(t)}return new Fe(t)}var ze=function(){function t(){}return function(n){if(!na(n))return{};if(Ht)return Ht(n);t.prototype=n;var e=new t;return t.prototype=o,e}}();function We(){}function Fe(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=o}function $e(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Ve(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function qe(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function Ge(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function Ze(t){var n=-1,e=null==t?0:t.length;for(this.__data__=new Ge;++n<e;)this.add(t[n])}function He(t){var n=this.__data__=new qe(t);this.size=n.size}function Ke(t,n){var e=qi(t),r=!e&&Vi(t),o=!e&&!r&&Ki(t),u=!e&&!r&&!o&&sa(t),i=e||r||o||u,a=i?Fn(t.length,Rt):[],c=a.length;for(var f in t)!n&&!Tt.call(t,f)||i&&("length"==f||o&&("offset"==f||"parent"==f)||u&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||yu(f,c))||a.push(f);return a}function Je(t){var n=t.length;return n?t[Gr(0,n-1)]:o}function Ye(t,n){return Iu(jo(t),ir(n,0,t.length))}function Qe(t){return Iu(jo(t))}function Xe(t,n,e){(e!==o&&!Wi(t[n],e)||e===o&&!(n in t))&&or(t,n,e)}function tr(t,n,e){var r=t[n];Tt.call(t,n)&&Wi(r,e)&&(e!==o||n in t)||or(t,n,e)}function nr(t,n){for(var e=t.length;e--;)if(Wi(t[e][0],n))return e;return-1}function er(t,n,e,r){return lr(t,(function(t,o,u){n(r,t,e(t),u)})),r}function rr(t,n){return t&&Po(n,La(n),t)}function or(t,n,e){"__proto__"==n&&sn?sn(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}function ur(t,n){for(var e=-1,u=n.length,i=r(u),a=null==t;++e<u;)i[e]=a?o:Oa(t,n[e]);return i}function ir(t,n,e){return t==t&&(e!==o&&(t=t<=e?t:e),n!==o&&(t=t>=n?t:n)),t}function ar(t,n,e,r,u,i){var a,c=1&n,f=2&n,s=4&n;if(e&&(a=u?e(t,r,u,i):e(t)),a!==o)return a;if(!na(t))return t;var l=qi(t);if(l){if(a=function(t){var n=t.length,e=new t.constructor(n);return n&&"string"==typeof t[0]&&Tt.call(t,"index")&&(e.index=t.index,e.input=t.input),e}(t),!c)return jo(t,a)}else{var p=hu(t),h=p==b||p==w;if(Ki(t))return xo(t,c);if(p==S||p==v||h&&!u){if(a=f||h?{}:vu(t),!c)return f?function(t,n){return Po(t,pu(t),n)}(t,function(t,n){return t&&Po(n,Ta(n),t)}(a,t)):function(t,n){return Po(t,lu(t),n)}(t,rr(a,t))}else{if(!Xt[p])return u?t:{};a=function(t,n,e){var r,o=t.constructor;switch(n){case A:return Eo(t);case y:case _:return new o(+t);case L:return function(t,n){var e=n?Eo(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}(t,e);case T:case I:case U:case M:case D:case N:case B:case z:case W:return So(t,e);case x:return new o;case E:case j:return new o(t);case R:return function(t){var n=new t.constructor(t.source,pt.exec(t));return n.lastIndex=t.lastIndex,n}(t);case O:return new o;case P:return r=t,De?St(De.call(r)):{}}}(t,p,c)}}i||(i=new He);var d=i.get(t);if(d)return d;i.set(t,a),aa(t)?t.forEach((function(r){a.add(ar(r,n,e,r,t,i))})):ra(t)&&t.forEach((function(r,o){a.set(o,ar(r,n,e,o,t,i))}));var g=l?o:(s?f?ru:eu:f?Ta:La)(t);return bn(g||t,(function(r,o){g&&(r=t[o=r]),tr(a,o,ar(r,n,e,o,t,i))})),a}function cr(t,n,e){var r=e.length;if(null==t)return!r;for(t=St(t);r--;){var u=e[r],i=n[u],a=t[u];if(a===o&&!(u in t)||!i(a))return!1}return!0}function fr(t,n,e){if("function"!=typeof t)throw new Ot(u);return ku((function(){t.apply(o,e)}),n)}function sr(t,n,e,r){var o=-1,u=Sn,i=!0,a=t.length,c=[],f=n.length;if(!a)return c;e&&(n=Rn(n,Vn(e))),r?(u=Cn,i=!1):n.length>=200&&(u=Gn,i=!1,n=new Ze(n));t:for(;++o<a;){var s=t[o],l=null==e?s:e(s);if(s=r||0!==s?s:0,i&&l==l){for(var p=f;p--;)if(n[p]===l)continue t;c.push(s)}else u(n,l,r)||c.push(s)}return c}Be.templateSettings={escape:K,evaluate:J,interpolate:Y,variable:"",imports:{_:Be}},Be.prototype=We.prototype,Be.prototype.constructor=Be,Fe.prototype=ze(We.prototype),Fe.prototype.constructor=Fe,$e.prototype=ze(We.prototype),$e.prototype.constructor=$e,Ve.prototype.clear=function(){this.__data__=je?je(null):{},this.size=0},Ve.prototype.delete=function(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n},Ve.prototype.get=function(t){var n=this.__data__;if(je){var e=n[t];return e===i?o:e}return Tt.call(n,t)?n[t]:o},Ve.prototype.has=function(t){var n=this.__data__;return je?n[t]!==o:Tt.call(n,t)},Ve.prototype.set=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=je&&n===o?i:n,this},qe.prototype.clear=function(){this.__data__=[],this.size=0},qe.prototype.delete=function(t){var n=this.__data__,e=nr(n,t);return!(e<0||(e==n.length-1?n.pop():rn.call(n,e,1),--this.size,0))},qe.prototype.get=function(t){var n=this.__data__,e=nr(n,t);return e<0?o:n[e][1]},qe.prototype.has=function(t){return nr(this.__data__,t)>-1},qe.prototype.set=function(t,n){var e=this.__data__,r=nr(e,t);return r<0?(++this.size,e.push([t,n])):e[r][1]=n,this},Ge.prototype.clear=function(){this.size=0,this.__data__={hash:new Ve,map:new(Se||qe),string:new Ve}},Ge.prototype.delete=function(t){var n=cu(this,t).delete(t);return this.size-=n?1:0,n},Ge.prototype.get=function(t){return cu(this,t).get(t)},Ge.prototype.has=function(t){return cu(this,t).has(t)},Ge.prototype.set=function(t,n){var e=cu(this,t),r=e.size;return e.set(t,n),this.size+=e.size==r?0:1,this},Ze.prototype.add=Ze.prototype.push=function(t){return this.__data__.set(t,i),this},Ze.prototype.has=function(t){return this.__data__.has(t)},He.prototype.clear=function(){this.__data__=new qe,this.size=0},He.prototype.delete=function(t){var n=this.__data__,e=n.delete(t);return this.size=n.size,e},He.prototype.get=function(t){return this.__data__.get(t)},He.prototype.has=function(t){return this.__data__.has(t)},He.prototype.set=function(t,n){var e=this.__data__;if(e instanceof qe){var r=e.__data__;if(!Se||r.length<199)return r.push([t,n]),this.size=++e.size,this;e=this.__data__=new Ge(r)}return e.set(t,n),this.size=e.size,this};var lr=Lo(mr),pr=Lo(br,!0);function hr(t,n){var e=!0;return lr(t,(function(t,r,o){return e=!!n(t,r,o)})),e}function dr(t,n,e){for(var r=-1,u=t.length;++r<u;){var i=t[r],a=n(i);if(null!=a&&(c===o?a==a&&!fa(a):e(a,c)))var c=a,f=i}return f}function vr(t,n){var e=[];return lr(t,(function(t,r,o){n(t,r,o)&&e.push(t)})),e}function gr(t,n,e,r,o){var u=-1,i=t.length;for(e||(e=gu),o||(o=[]);++u<i;){var a=t[u];n>0&&e(a)?n>1?gr(a,n-1,e,r,o):On(o,a):r||(o[o.length]=a)}return o}var yr=To(),_r=To(!0);function mr(t,n){return t&&yr(t,n,La)}function br(t,n){return t&&_r(t,n,La)}function wr(t,n){return En(n,(function(n){return Qi(t[n])}))}function xr(t,n){for(var e=0,r=(n=_o(n,t)).length;null!=t&&e<r;)t=t[Nu(n[e++])];return e&&e==r?t:o}function Er(t,n,e){var r=n(t);return qi(t)?r:On(r,e(t))}function Sr(t){return null==t?t===o?"[object Undefined]":"[object Null]":cn&&cn in St(t)?function(t){var n=Tt.call(t,cn),e=t[cn];try{t[cn]=o;var r=!0}catch(t){}var u=Mt.call(t);return r&&(n?t[cn]=e:delete t[cn]),u}(t):function(t){return Mt.call(t)}(t)}function Cr(t,n){return t>n}function Rr(t,n){return null!=t&&Tt.call(t,n)}function Or(t,n){return null!=t&&n in St(t)}function jr(t,n,e){for(var u=e?Cn:Sn,i=t[0].length,a=t.length,c=a,f=r(a),s=1/0,l=[];c--;){var p=t[c];c&&n&&(p=Rn(p,Vn(n))),s=_e(p.length,s),f[c]=!e&&(n||i>=120&&p.length>=120)?new Ze(c&&p):o}p=t[0];var h=-1,d=f[0];t:for(;++h<i&&l.length<s;){var v=p[h],g=n?n(v):v;if(v=e||0!==v?v:0,!(d?Gn(d,g):u(l,g,e))){for(c=a;--c;){var y=f[c];if(!(y?Gn(y,g):u(t[c],g,e)))continue t}d&&d.push(g),l.push(v)}}return l}function Pr(t,n,e){var r=null==(t=Ru(t,n=_o(n,t)))?t:t[Nu(Yu(n))];return null==r?o:_n(r,t,e)}function kr(t){return ea(t)&&Sr(t)==v}function Ar(t,n,e,r,u){return t===n||(null==t||null==n||!ea(t)&&!ea(n)?t!=t&&n!=n:function(t,n,e,r,u,i){var a=qi(t),c=qi(n),f=a?g:hu(t),s=c?g:hu(n),l=(f=f==v?S:f)==S,p=(s=s==v?S:s)==S,h=f==s;if(h&&Ki(t)){if(!Ki(n))return!1;a=!0,l=!1}if(h&&!l)return i||(i=new He),a||sa(t)?tu(t,n,e,r,u,i):function(t,n,e,r,o,u,i){switch(e){case L:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return!1;t=t.buffer,n=n.buffer;case A:return!(t.byteLength!=n.byteLength||!u(new Ft(t),new Ft(n)));case y:case _:case E:return Wi(+t,+n);case m:return t.name==n.name&&t.message==n.message;case R:case j:return t==n+"";case x:var a=te;case O:var c=1&r;if(a||(a=re),t.size!=n.size&&!c)return!1;var f=i.get(t);if(f)return f==n;r|=2,i.set(t,n);var s=tu(a(t),a(n),r,o,u,i);return i.delete(t),s;case P:if(De)return De.call(t)==De.call(n)}return!1}(t,n,f,e,r,u,i);if(!(1&e)){var d=l&&Tt.call(t,"__wrapped__"),b=p&&Tt.call(n,"__wrapped__");if(d||b){var w=d?t.value():t,C=b?n.value():n;return i||(i=new He),u(w,C,e,r,i)}}return!!h&&(i||(i=new He),function(t,n,e,r,u,i){var a=1&e,c=eu(t),f=c.length;if(f!=eu(n).length&&!a)return!1;for(var s=f;s--;){var l=c[s];if(!(a?l in n:Tt.call(n,l)))return!1}var p=i.get(t),h=i.get(n);if(p&&h)return p==n&&h==t;var d=!0;i.set(t,n),i.set(n,t);for(var v=a;++s<f;){var g=t[l=c[s]],y=n[l];if(r)var _=a?r(y,g,l,n,t,i):r(g,y,l,t,n,i);if(!(_===o?g===y||u(g,y,e,r,i):_)){d=!1;break}v||(v="constructor"==l)}if(d&&!v){var m=t.constructor,b=n.constructor;m==b||!("constructor"in t)||!("constructor"in n)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(d=!1)}return i.delete(t),i.delete(n),d}(t,n,e,r,u,i))}(t,n,e,r,Ar,u))}function Lr(t,n,e,r){var u=e.length,i=u,a=!r;if(null==t)return!i;for(t=St(t);u--;){var c=e[u];if(a&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++u<i;){var f=(c=e[u])[0],s=t[f],l=c[1];if(a&&c[2]){if(s===o&&!(f in t))return!1}else{var p=new He;if(r)var h=r(s,l,f,t,n,p);if(!(h===o?Ar(l,s,3,r,p):h))return!1}}return!0}function Tr(t){return!(!na(t)||(n=t,Ut&&Ut in n))&&(Qi(t)?Bt:vt).test(Bu(t));var n}function Ir(t){return"function"==typeof t?t:null==t?oc:"object"==typeof t?qi(t)?Br(t[0],t[1]):Nr(t):hc(t)}function Ur(t){if(!xu(t))return ge(t);var n=[];for(var e in St(t))Tt.call(t,e)&&"constructor"!=e&&n.push(e);return n}function Mr(t,n){return t<n}function Dr(t,n){var e=-1,o=Zi(t)?r(t.length):[];return lr(t,(function(t,r,u){o[++e]=n(t,r,u)})),o}function Nr(t){var n=fu(t);return 1==n.length&&n[0][2]?Su(n[0][0],n[0][1]):function(e){return e===t||Lr(e,t,n)}}function Br(t,n){return mu(t)&&Eu(n)?Su(Nu(t),n):function(e){var r=Oa(e,t);return r===o&&r===n?ja(e,t):Ar(n,r,3)}}function zr(t,n,e,r,u){t!==n&&yr(n,(function(i,a){if(u||(u=new He),na(i))!function(t,n,e,r,u,i,a){var c=ju(t,e),f=ju(n,e),s=a.get(f);if(s)Xe(t,e,s);else{var l=i?i(c,f,e+"",t,n,a):o,p=l===o;if(p){var h=qi(f),d=!h&&Ki(f),v=!h&&!d&&sa(f);l=f,h||d||v?qi(c)?l=c:Hi(c)?l=jo(c):d?(p=!1,l=xo(f,!0)):v?(p=!1,l=So(f,!0)):l=[]:ua(f)||Vi(f)?(l=c,Vi(c)?l=_a(c):na(c)&&!Qi(c)||(l=vu(f))):p=!1}p&&(a.set(f,l),u(l,f,r,i,a),a.delete(f)),Xe(t,e,l)}}(t,n,a,e,zr,r,u);else{var c=r?r(ju(t,a),i,a+"",t,n,u):o;c===o&&(c=i),Xe(t,a,c)}}),Ta)}function Wr(t,n){var e=t.length;if(e)return yu(n+=n<0?e:0,e)?t[n]:o}function Fr(t,n,e){n=n.length?Rn(n,(function(t){return qi(t)?function(n){return xr(n,1===t.length?t[0]:t)}:t})):[oc];var r=-1;n=Rn(n,Vn(au()));var o=Dr(t,(function(t,e,o){var u=Rn(n,(function(n){return n(t)}));return{criteria:u,index:++r,value:t}}));return function(t,n){var r=t.length;for(t.sort((function(t,n){return function(t,n,e){for(var r=-1,o=t.criteria,u=n.criteria,i=o.length,a=e.length;++r<i;){var c=Co(o[r],u[r]);if(c)return r>=a?c:c*("desc"==e[r]?-1:1)}return t.index-n.index}(t,n,e)}));r--;)t[r]=t[r].value;return t}(o)}function $r(t,n,e){for(var r=-1,o=n.length,u={};++r<o;){var i=n[r],a=xr(t,i);e(a,i)&&Yr(u,_o(i,t),a)}return u}function Vr(t,n,e,r){var o=r?Un:In,u=-1,i=n.length,a=t;for(t===n&&(n=jo(n)),e&&(a=Rn(t,Vn(e)));++u<i;)for(var c=0,f=n[u],s=e?e(f):f;(c=o(a,s,c,r))>-1;)a!==t&&rn.call(a,c,1),rn.call(t,c,1);return t}function qr(t,n){for(var e=t?n.length:0,r=e-1;e--;){var o=n[e];if(e==r||o!==u){var u=o;yu(o)?rn.call(t,o,1):fo(t,o)}}return t}function Gr(t,n){return t+le(we()*(n-t+1))}function Zr(t,n){var e="";if(!t||n<1||n>l)return e;do{n%2&&(e+=t),(n=le(n/2))&&(t+=t)}while(n);return e}function Hr(t,n){return Au(Cu(t,n,oc),t+"")}function Kr(t){return Je(Wa(t))}function Jr(t,n){var e=Wa(t);return Iu(e,ir(n,0,e.length))}function Yr(t,n,e,r){if(!na(t))return t;for(var u=-1,i=(n=_o(n,t)).length,a=i-1,c=t;null!=c&&++u<i;){var f=Nu(n[u]),s=e;if("__proto__"===f||"constructor"===f||"prototype"===f)return t;if(u!=a){var l=c[f];(s=r?r(l,f,c):o)===o&&(s=na(l)?l:yu(n[u+1])?[]:{})}tr(c,f,s),c=c[f]}return t}var Qr=Pe?function(t,n){return Pe.set(t,n),t}:oc,Xr=sn?function(t,n){return sn(t,"toString",{configurable:!0,enumerable:!1,value:nc(n),writable:!0})}:oc;function to(t){return Iu(Wa(t))}function no(t,n,e){var o=-1,u=t.length;n<0&&(n=-n>u?0:u+n),(e=e>u?u:e)<0&&(e+=u),u=n>e?0:e-n>>>0,n>>>=0;for(var i=r(u);++o<u;)i[o]=t[o+n];return i}function eo(t,n){var e;return lr(t,(function(t,r,o){return!(e=n(t,r,o))})),!!e}function ro(t,n,e){var r=0,o=null==t?r:t.length;if("number"==typeof n&&n==n&&o<=2147483647){for(;r<o;){var u=r+o>>>1,i=t[u];null!==i&&!fa(i)&&(e?i<=n:i<n)?r=u+1:o=u}return o}return oo(t,n,oc,e)}function oo(t,n,e,r){var u=0,i=null==t?0:t.length;if(0===i)return 0;for(var a=(n=e(n))!=n,c=null===n,f=fa(n),s=n===o;u<i;){var l=le((u+i)/2),p=e(t[l]),h=p!==o,d=null===p,v=p==p,g=fa(p);if(a)var y=r||v;else y=s?v&&(r||h):c?v&&h&&(r||!d):f?v&&h&&!d&&(r||!g):!d&&!g&&(r?p<=n:p<n);y?u=l+1:i=l}return _e(i,4294967294)}function uo(t,n){for(var e=-1,r=t.length,o=0,u=[];++e<r;){var i=t[e],a=n?n(i):i;if(!e||!Wi(a,c)){var c=a;u[o++]=0===i?0:i}}return u}function io(t){return"number"==typeof t?t:fa(t)?p:+t}function ao(t){if("string"==typeof t)return t;if(qi(t))return Rn(t,ao)+"";if(fa(t))return Ne?Ne.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}function co(t,n,e){var r=-1,o=Sn,u=t.length,i=!0,a=[],c=a;if(e)i=!1,o=Cn;else if(u>=200){var f=n?null:Ho(t);if(f)return re(f);i=!1,o=Gn,c=new Ze}else c=n?[]:a;t:for(;++r<u;){var s=t[r],l=n?n(s):s;if(s=e||0!==s?s:0,i&&l==l){for(var p=c.length;p--;)if(c[p]===l)continue t;n&&c.push(l),a.push(s)}else o(c,l,e)||(c!==a&&c.push(l),a.push(s))}return a}function fo(t,n){return null==(t=Ru(t,n=_o(n,t)))||delete t[Nu(Yu(n))]}function so(t,n,e,r){return Yr(t,n,e(xr(t,n)),r)}function lo(t,n,e,r){for(var o=t.length,u=r?o:-1;(r?u--:++u<o)&&n(t[u],u,t););return e?no(t,r?0:u,r?u+1:o):no(t,r?u+1:0,r?o:u)}function po(t,n){var e=t;return e instanceof $e&&(e=e.value()),jn(n,(function(t,n){return n.func.apply(n.thisArg,On([t],n.args))}),e)}function ho(t,n,e){var o=t.length;if(o<2)return o?co(t[0]):[];for(var u=-1,i=r(o);++u<o;)for(var a=t[u],c=-1;++c<o;)c!=u&&(i[u]=sr(i[u]||a,t[c],n,e));return co(gr(i,1),n,e)}function vo(t,n,e){for(var r=-1,u=t.length,i=n.length,a={};++r<u;){var c=r<i?n[r]:o;e(a,t[r],c)}return a}function go(t){return Hi(t)?t:[]}function yo(t){return"function"==typeof t?t:oc}function _o(t,n){return qi(t)?t:mu(t,n)?[t]:Du(ma(t))}var mo=Hr;function bo(t,n,e){var r=t.length;return e=e===o?r:e,!n&&e>=r?t:no(t,n,e)}var wo=ln||function(t){return un.clearTimeout(t)};function xo(t,n){if(n)return t.slice();var e=t.length,r=$t?$t(e):new t.constructor(e);return t.copy(r),r}function Eo(t){var n=new t.constructor(t.byteLength);return new Ft(n).set(new Ft(t)),n}function So(t,n){var e=n?Eo(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}function Co(t,n){if(t!==n){var e=t!==o,r=null===t,u=t==t,i=fa(t),a=n!==o,c=null===n,f=n==n,s=fa(n);if(!c&&!s&&!i&&t>n||i&&a&&f&&!c&&!s||r&&a&&f||!e&&f||!u)return 1;if(!r&&!i&&!s&&t<n||s&&e&&u&&!r&&!i||c&&e&&u||!a&&u||!f)return-1}return 0}function Ro(t,n,e,o){for(var u=-1,i=t.length,a=e.length,c=-1,f=n.length,s=ye(i-a,0),l=r(f+s),p=!o;++c<f;)l[c]=n[c];for(;++u<a;)(p||u<i)&&(l[e[u]]=t[u]);for(;s--;)l[c++]=t[u++];return l}function Oo(t,n,e,o){for(var u=-1,i=t.length,a=-1,c=e.length,f=-1,s=n.length,l=ye(i-c,0),p=r(l+s),h=!o;++u<l;)p[u]=t[u];for(var d=u;++f<s;)p[d+f]=n[f];for(;++a<c;)(h||u<i)&&(p[d+e[a]]=t[u++]);return p}function jo(t,n){var e=-1,o=t.length;for(n||(n=r(o));++e<o;)n[e]=t[e];return n}function Po(t,n,e,r){var u=!e;e||(e={});for(var i=-1,a=n.length;++i<a;){var c=n[i],f=r?r(e[c],t[c],c,e,t):o;f===o&&(f=t[c]),u?or(e,c,f):tr(e,c,f)}return e}function ko(t,n){return function(e,r){var o=qi(e)?mn:er,u=n?n():{};return o(e,t,au(r,2),u)}}function Ao(t){return Hr((function(n,e){var r=-1,u=e.length,i=u>1?e[u-1]:o,a=u>2?e[2]:o;for(i=t.length>3&&"function"==typeof i?(u--,i):o,a&&_u(e[0],e[1],a)&&(i=u<3?o:i,u=1),n=St(n);++r<u;){var c=e[r];c&&t(n,c,r,i)}return n}))}function Lo(t,n){return function(e,r){if(null==e)return e;if(!Zi(e))return t(e,r);for(var o=e.length,u=n?o:-1,i=St(e);(n?u--:++u<o)&&!1!==r(i[u],u,i););return e}}function To(t){return function(n,e,r){for(var o=-1,u=St(n),i=r(n),a=i.length;a--;){var c=i[t?a:++o];if(!1===e(u[c],c,u))break}return n}}function Io(t){return function(n){var e=Xn(n=ma(n))?ie(n):o,r=e?e[0]:n.charAt(0),u=e?bo(e,1).join(""):n.slice(1);return r[t]()+u}}function Uo(t){return function(n){return jn(Qa(Va(n).replace(Vt,"")),t,"")}}function Mo(t){return function(){var n=arguments;switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3]);case 5:return new t(n[0],n[1],n[2],n[3],n[4]);case 6:return new t(n[0],n[1],n[2],n[3],n[4],n[5]);case 7:return new t(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}var e=ze(t.prototype),r=t.apply(e,n);return na(r)?r:e}}function Do(t){return function(n,e,r){var u=St(n);if(!Zi(n)){var i=au(e,3);n=La(n),e=function(t){return i(u[t],t,u)}}var a=t(n,e,r);return a>-1?u[i?n[a]:a]:o}}function No(t){return nu((function(n){var e=n.length,r=e,i=Fe.prototype.thru;for(t&&n.reverse();r--;){var a=n[r];if("function"!=typeof a)throw new Ot(u);if(i&&!c&&"wrapper"==uu(a))var c=new Fe([],!0)}for(r=c?r:e;++r<e;){var f=uu(a=n[r]),s="wrapper"==f?ou(a):o;c=s&&bu(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?c[uu(s[0])].apply(c,s[3]):1==a.length&&bu(a)?c[f]():c.thru(a)}return function(){var t=arguments,r=t[0];if(c&&1==t.length&&qi(r))return c.plant(r).value();for(var o=0,u=e?n[o].apply(this,t):r;++o<e;)u=n[o].call(this,u);return u}}))}function Bo(t,n,e,u,i,a,c,s,l,p){var h=n&f,d=1&n,v=2&n,g=24&n,y=512&n,_=v?o:Mo(t);return function o(){for(var f=arguments.length,m=r(f),b=f;b--;)m[b]=arguments[b];if(g)var w=iu(o),x=Kn(m,w);if(u&&(m=Ro(m,u,i,g)),a&&(m=Oo(m,a,c,g)),f-=x,g&&f<p){var E=ee(m,w);return Go(t,n,Bo,o.placeholder,e,m,E,s,l,p-f)}var S=d?e:this,C=v?S[t]:t;return f=m.length,s?m=Ou(m,s):y&&f>1&&m.reverse(),h&&l<f&&(m.length=l),this&&this!==un&&this instanceof o&&(C=_||Mo(C)),C.apply(S,m)}}function zo(t,n){return function(e,r){return function(t,n,e,r){return mr(t,(function(t,o,u){n(r,e(t),o,u)})),r}(e,t,n(r),{})}}function Wo(t,n){return function(e,r){var u;if(e===o&&r===o)return n;if(e!==o&&(u=e),r!==o){if(u===o)return r;"string"==typeof e||"string"==typeof r?(e=ao(e),r=ao(r)):(e=io(e),r=io(r)),u=t(e,r)}return u}}function Fo(t){return nu((function(n){return n=Rn(n,Vn(au())),Hr((function(e){var r=this;return t(n,(function(t){return _n(t,r,e)}))}))}))}function $o(t,n){var e=(n=n===o?" ":ao(n)).length;if(e<2)return e?Zr(n,t):n;var r=Zr(n,se(t/ue(n)));return Xn(n)?bo(ie(r),0,t).join(""):r.slice(0,t)}function Vo(t){return function(n,e,u){return u&&"number"!=typeof u&&_u(n,e,u)&&(e=u=o),n=da(n),e===o?(e=n,n=0):e=da(e),function(t,n,e,o){for(var u=-1,i=ye(se((n-t)/(e||1)),0),a=r(i);i--;)a[o?i:++u]=t,t+=e;return a}(n,e,u=u===o?n<e?1:-1:da(u),t)}}function qo(t){return function(n,e){return"string"==typeof n&&"string"==typeof e||(n=ya(n),e=ya(e)),t(n,e)}}function Go(t,n,e,r,u,i,a,f,s,l){var p=8&n;n|=p?c:64,4&(n&=~(p?64:c))||(n&=-4);var h=[t,n,u,p?i:o,p?a:o,p?o:i,p?o:a,f,s,l],d=e.apply(o,h);return bu(t)&&Pu(d,h),d.placeholder=r,Lu(d,t,n)}function Zo(t){var n=Et[t];return function(t,e){if(t=ya(t),(e=null==e?0:_e(va(e),292))&&de(t)){var r=(ma(t)+"e").split("e");return+((r=(ma(n(r[0]+"e"+(+r[1]+e)))+"e").split("e"))[0]+"e"+(+r[1]-e))}return n(t)}}var Ho=Re&&1/re(new Re([,-0]))[1]==s?function(t){return new Re(t)}:fc;function Ko(t){return function(n){var e=hu(n);return e==x?te(n):e==O?oe(n):function(t,n){return Rn(n,(function(n){return[n,t[n]]}))}(n,t(n))}}function Jo(t,n,e,i,s,l,p,h){var d=2&n;if(!d&&"function"!=typeof t)throw new Ot(u);var v=i?i.length:0;if(v||(n&=-97,i=s=o),p=p===o?p:ye(va(p),0),h=h===o?h:va(h),v-=s?s.length:0,64&n){var g=i,y=s;i=s=o}var _=d?o:ou(t),m=[t,n,e,i,s,g,y,l,p,h];if(_&&function(t,n){var e=t[1],r=n[1],o=e|r,u=o<131,i=r==f&&8==e||r==f&&256==e&&t[7].length<=n[8]||384==r&&n[7].length<=n[8]&&8==e;if(!u&&!i)return t;1&r&&(t[2]=n[2],o|=1&e?0:4);var c=n[3];if(c){var s=t[3];t[3]=s?Ro(s,c,n[4]):c,t[4]=s?ee(t[3],a):n[4]}(c=n[5])&&(s=t[5],t[5]=s?Oo(s,c,n[6]):c,t[6]=s?ee(t[5],a):n[6]),(c=n[7])&&(t[7]=c),r&f&&(t[8]=null==t[8]?n[8]:_e(t[8],n[8])),null==t[9]&&(t[9]=n[9]),t[0]=n[0],t[1]=o}(m,_),t=m[0],n=m[1],e=m[2],i=m[3],s=m[4],!(h=m[9]=m[9]===o?d?0:t.length:ye(m[9]-v,0))&&24&n&&(n&=-25),n&&1!=n)b=8==n||16==n?function(t,n,e){var u=Mo(t);return function i(){for(var a=arguments.length,c=r(a),f=a,s=iu(i);f--;)c[f]=arguments[f];var l=a<3&&c[0]!==s&&c[a-1]!==s?[]:ee(c,s);return(a-=l.length)<e?Go(t,n,Bo,i.placeholder,o,c,l,o,o,e-a):_n(this&&this!==un&&this instanceof i?u:t,this,c)}}(t,n,h):n!=c&&33!=n||s.length?Bo.apply(o,m):function(t,n,e,o){var u=1&n,i=Mo(t);return function n(){for(var a=-1,c=arguments.length,f=-1,s=o.length,l=r(s+c),p=this&&this!==un&&this instanceof n?i:t;++f<s;)l[f]=o[f];for(;c--;)l[f++]=arguments[++a];return _n(p,u?e:this,l)}}(t,n,e,i);else var b=function(t,n,e){var r=1&n,o=Mo(t);return function n(){return(this&&this!==un&&this instanceof n?o:t).apply(r?e:this,arguments)}}(t,n,e);return Lu((_?Qr:Pu)(b,m),t,n)}function Yo(t,n,e,r){return t===o||Wi(t,kt[e])&&!Tt.call(r,e)?n:t}function Qo(t,n,e,r,u,i){return na(t)&&na(n)&&(i.set(n,t),zr(t,n,o,Qo,i),i.delete(n)),t}function Xo(t){return ua(t)?o:t}function tu(t,n,e,r,u,i){var a=1&e,c=t.length,f=n.length;if(c!=f&&!(a&&f>c))return!1;var s=i.get(t),l=i.get(n);if(s&&l)return s==n&&l==t;var p=-1,h=!0,d=2&e?new Ze:o;for(i.set(t,n),i.set(n,t);++p<c;){var v=t[p],g=n[p];if(r)var y=a?r(g,v,p,n,t,i):r(v,g,p,t,n,i);if(y!==o){if(y)continue;h=!1;break}if(d){if(!kn(n,(function(t,n){if(!Gn(d,n)&&(v===t||u(v,t,e,r,i)))return d.push(n)}))){h=!1;break}}else if(v!==g&&!u(v,g,e,r,i)){h=!1;break}}return i.delete(t),i.delete(n),h}function nu(t){return Au(Cu(t,o,Gu),t+"")}function eu(t){return Er(t,La,lu)}function ru(t){return Er(t,Ta,pu)}var ou=Pe?function(t){return Pe.get(t)}:fc;function uu(t){for(var n=t.name+"",e=ke[n],r=Tt.call(ke,n)?e.length:0;r--;){var o=e[r],u=o.func;if(null==u||u==t)return o.name}return n}function iu(t){return(Tt.call(Be,"placeholder")?Be:t).placeholder}function au(){var t=Be.iteratee||uc;return t=t===uc?Ir:t,arguments.length?t(arguments[0],arguments[1]):t}function cu(t,n){var e,r,o=t.__data__;return("string"==(r=typeof(e=n))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e)?o["string"==typeof n?"string":"hash"]:o.map}function fu(t){for(var n=La(t),e=n.length;e--;){var r=n[e],o=t[r];n[e]=[r,o,Eu(o)]}return n}function su(t,n){var e=function(t,n){return null==t?o:t[n]}(t,n);return Tr(e)?e:o}var lu=pe?function(t){return null==t?[]:(t=St(t),En(pe(t),(function(n){return tn.call(t,n)})))}:gc,pu=pe?function(t){for(var n=[];t;)On(n,lu(t)),t=Gt(t);return n}:gc,hu=Sr;function du(t,n,e){for(var r=-1,o=(n=_o(n,t)).length,u=!1;++r<o;){var i=Nu(n[r]);if(!(u=null!=t&&e(t,i)))break;t=t[i]}return u||++r!=o?u:!!(o=null==t?0:t.length)&&ta(o)&&yu(i,o)&&(qi(t)||Vi(t))}function vu(t){return"function"!=typeof t.constructor||xu(t)?{}:ze(Gt(t))}function gu(t){return qi(t)||Vi(t)||!!(on&&t&&t[on])}function yu(t,n){var e=typeof t;return!!(n=null==n?l:n)&&("number"==e||"symbol"!=e&&yt.test(t))&&t>-1&&t%1==0&&t<n}function _u(t,n,e){if(!na(e))return!1;var r=typeof n;return!!("number"==r?Zi(e)&&yu(n,e.length):"string"==r&&n in e)&&Wi(e[n],t)}function mu(t,n){if(qi(t))return!1;var e=typeof t;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!fa(t))||X.test(t)||!Q.test(t)||null!=n&&t in St(n)}function bu(t){var n=uu(t),e=Be[n];if("function"!=typeof e||!(n in $e.prototype))return!1;if(t===e)return!0;var r=ou(e);return!!r&&t===r[0]}(Ee&&hu(new Ee(new ArrayBuffer(1)))!=L||Se&&hu(new Se)!=x||Ce&&hu(Ce.resolve())!=C||Re&&hu(new Re)!=O||Oe&&hu(new Oe)!=k)&&(hu=function(t){var n=Sr(t),e=n==S?t.constructor:o,r=e?Bu(e):"";if(r)switch(r){case Ae:return L;case Le:return x;case Te:return C;case Ie:return O;case Ue:return k}return n});var wu=At?Qi:yc;function xu(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||kt)}function Eu(t){return t==t&&!na(t)}function Su(t,n){return function(e){return null!=e&&e[t]===n&&(n!==o||t in St(e))}}function Cu(t,n,e){return n=ye(n===o?t.length-1:n,0),function(){for(var o=arguments,u=-1,i=ye(o.length-n,0),a=r(i);++u<i;)a[u]=o[n+u];u=-1;for(var c=r(n+1);++u<n;)c[u]=o[u];return c[n]=e(a),_n(t,this,c)}}function Ru(t,n){return n.length<2?t:xr(t,no(n,0,-1))}function Ou(t,n){for(var e=t.length,r=_e(n.length,e),u=jo(t);r--;){var i=n[r];t[r]=yu(i,e)?u[i]:o}return t}function ju(t,n){if(("constructor"!==n||"function"!=typeof t[n])&&"__proto__"!=n)return t[n]}var Pu=Tu(Qr),ku=Bn||function(t,n){return un.setTimeout(t,n)},Au=Tu(Xr);function Lu(t,n,e){var r=n+"";return Au(t,function(t,n){var e=n.length;if(!e)return t;var r=e-1;return n[r]=(e>1?"& ":"")+n[r],n=n.join(e>2?", ":" "),t.replace(ut,"{\n/* [wrapped with "+n+"] */\n")}(r,function(t,n){return bn(d,(function(e){var r="_."+e[0];n&e[1]&&!Sn(t,r)&&t.push(r)})),t.sort()}(function(t){var n=t.match(it);return n?n[1].split(at):[]}(r),e)))}function Tu(t){var n=0,e=0;return function(){var r=me(),u=16-(r-e);if(e=r,u>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(o,arguments)}}function Iu(t,n){var e=-1,r=t.length,u=r-1;for(n=n===o?r:n;++e<n;){var i=Gr(e,u),a=t[i];t[i]=t[e],t[e]=a}return t.length=n,t}var Uu,Mu,Du=(Uu=Ui((function(t){var n=[];return 46===t.charCodeAt(0)&&n.push(""),t.replace(tt,(function(t,e,r,o){n.push(r?o.replace(st,"$1"):e||t)})),n}),(function(t){return 500===Mu.size&&Mu.clear(),t})),Mu=Uu.cache,Uu);function Nu(t){if("string"==typeof t||fa(t))return t;var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}function Bu(t){if(null!=t){try{return Lt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function zu(t){if(t instanceof $e)return t.clone();var n=new Fe(t.__wrapped__,t.__chain__);return n.__actions__=jo(t.__actions__),n.__index__=t.__index__,n.__values__=t.__values__,n}var Wu=Hr((function(t,n){return Hi(t)?sr(t,gr(n,1,Hi,!0)):[]})),Fu=Hr((function(t,n){var e=Yu(n);return Hi(e)&&(e=o),Hi(t)?sr(t,gr(n,1,Hi,!0),au(e,2)):[]})),$u=Hr((function(t,n){var e=Yu(n);return Hi(e)&&(e=o),Hi(t)?sr(t,gr(n,1,Hi,!0),o,e):[]}));function Vu(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var o=null==e?0:va(e);return o<0&&(o=ye(r+o,0)),Tn(t,au(n,3),o)}function qu(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var u=r-1;return e!==o&&(u=va(e),u=e<0?ye(r+u,0):_e(u,r-1)),Tn(t,au(n,3),u,!0)}function Gu(t){return null!=t&&t.length?gr(t,1):[]}function Zu(t){return t&&t.length?t[0]:o}var Hu=Hr((function(t){var n=Rn(t,go);return n.length&&n[0]===t[0]?jr(n):[]})),Ku=Hr((function(t){var n=Yu(t),e=Rn(t,go);return n===Yu(e)?n=o:e.pop(),e.length&&e[0]===t[0]?jr(e,au(n,2)):[]})),Ju=Hr((function(t){var n=Yu(t),e=Rn(t,go);return(n="function"==typeof n?n:o)&&e.pop(),e.length&&e[0]===t[0]?jr(e,o,n):[]}));function Yu(t){var n=null==t?0:t.length;return n?t[n-1]:o}var Qu=Hr(Xu);function Xu(t,n){return t&&t.length&&n&&n.length?Vr(t,n):t}var ti=nu((function(t,n){var e=null==t?0:t.length,r=ur(t,n);return qr(t,Rn(n,(function(t){return yu(t,e)?+t:t})).sort(Co)),r}));function ni(t){return null==t?t:xe.call(t)}var ei=Hr((function(t){return co(gr(t,1,Hi,!0))})),ri=Hr((function(t){var n=Yu(t);return Hi(n)&&(n=o),co(gr(t,1,Hi,!0),au(n,2))})),oi=Hr((function(t){var n=Yu(t);return n="function"==typeof n?n:o,co(gr(t,1,Hi,!0),o,n)}));function ui(t){if(!t||!t.length)return[];var n=0;return t=En(t,(function(t){if(Hi(t))return n=ye(t.length,n),!0})),Fn(n,(function(n){return Rn(t,Nn(n))}))}function ii(t,n){if(!t||!t.length)return[];var e=ui(t);return null==n?e:Rn(e,(function(t){return _n(n,o,t)}))}var ai=Hr((function(t,n){return Hi(t)?sr(t,n):[]})),ci=Hr((function(t){return ho(En(t,Hi))})),fi=Hr((function(t){var n=Yu(t);return Hi(n)&&(n=o),ho(En(t,Hi),au(n,2))})),si=Hr((function(t){var n=Yu(t);return n="function"==typeof n?n:o,ho(En(t,Hi),o,n)})),li=Hr(ui),pi=Hr((function(t){var n=t.length,e=n>1?t[n-1]:o;return e="function"==typeof e?(t.pop(),e):o,ii(t,e)}));function hi(t){var n=Be(t);return n.__chain__=!0,n}function di(t,n){return n(t)}var vi=nu((function(t){var n=t.length,e=n?t[0]:0,r=this.__wrapped__,u=function(n){return ur(n,t)};return!(n>1||this.__actions__.length)&&r instanceof $e&&yu(e)?((r=r.slice(e,+e+(n?1:0))).__actions__.push({func:di,args:[u],thisArg:o}),new Fe(r,this.__chain__).thru((function(t){return n&&!t.length&&t.push(o),t}))):this.thru(u)})),gi=ko((function(t,n,e){Tt.call(t,e)?++t[e]:or(t,e,1)})),yi=Do(Vu),_i=Do(qu);function mi(t,n){return(qi(t)?bn:lr)(t,au(n,3))}function bi(t,n){return(qi(t)?wn:pr)(t,au(n,3))}var wi=ko((function(t,n,e){Tt.call(t,e)?t[e].push(n):or(t,e,[n])})),xi=Hr((function(t,n,e){var o=-1,u="function"==typeof n,i=Zi(t)?r(t.length):[];return lr(t,(function(t){i[++o]=u?_n(n,t,e):Pr(t,n,e)})),i})),Ei=ko((function(t,n,e){or(t,e,n)}));function Si(t,n){return(qi(t)?Rn:Dr)(t,au(n,3))}var Ci=ko((function(t,n,e){t[e?0:1].push(n)}),(function(){return[[],[]]})),Ri=Hr((function(t,n){if(null==t)return[];var e=n.length;return e>1&&_u(t,n[0],n[1])?n=[]:e>2&&_u(n[0],n[1],n[2])&&(n=[n[0]]),Fr(t,gr(n,1),[])})),Oi=An||function(){return un.Date.now()};function ji(t,n,e){return n=e?o:n,n=t&&null==n?t.length:n,Jo(t,f,o,o,o,o,n)}function Pi(t,n){var e;if("function"!=typeof n)throw new Ot(u);return t=va(t),function(){return--t>0&&(e=n.apply(this,arguments)),t<=1&&(n=o),e}}var ki=Hr((function(t,n,e){var r=1;if(e.length){var o=ee(e,iu(ki));r|=c}return Jo(t,r,n,e,o)})),Ai=Hr((function(t,n,e){var r=3;if(e.length){var o=ee(e,iu(Ai));r|=c}return Jo(n,r,t,e,o)}));function Li(t,n,e){var r,i,a,c,f,s,l=0,p=!1,h=!1,d=!0;if("function"!=typeof t)throw new Ot(u);function v(n){var e=r,u=i;return r=i=o,l=n,c=t.apply(u,e)}function g(t){return l=t,f=ku(_,n),p?v(t):c}function y(t){var e=t-s;return s===o||e>=n||e<0||h&&t-l>=a}function _(){var t=Oi();if(y(t))return m(t);f=ku(_,function(t){var e=n-(t-s);return h?_e(e,a-(t-l)):e}(t))}function m(t){return f=o,d&&r?v(t):(r=i=o,c)}function b(){var t=Oi(),e=y(t);if(r=arguments,i=this,s=t,e){if(f===o)return g(s);if(h)return wo(f),f=ku(_,n),v(s)}return f===o&&(f=ku(_,n)),c}return n=ya(n)||0,na(e)&&(p=!!e.leading,a=(h="maxWait"in e)?ye(ya(e.maxWait)||0,n):a,d="trailing"in e?!!e.trailing:d),b.cancel=function(){f!==o&&wo(f),l=0,r=s=i=f=o},b.flush=function(){return f===o?c:m(Oi())},b}var Ti=Hr((function(t,n){return fr(t,1,n)})),Ii=Hr((function(t,n,e){return fr(t,ya(n)||0,e)}));function Ui(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Ot(u);var e=function(){var r=arguments,o=n?n.apply(this,r):r[0],u=e.cache;if(u.has(o))return u.get(o);var i=t.apply(this,r);return e.cache=u.set(o,i)||u,i};return e.cache=new(Ui.Cache||Ge),e}function Mi(t){if("function"!=typeof t)throw new Ot(u);return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}Ui.Cache=Ge;var Di=mo((function(t,n){var e=(n=1==n.length&&qi(n[0])?Rn(n[0],Vn(au())):Rn(gr(n,1),Vn(au()))).length;return Hr((function(r){for(var o=-1,u=_e(r.length,e);++o<u;)r[o]=n[o].call(this,r[o]);return _n(t,this,r)}))})),Ni=Hr((function(t,n){var e=ee(n,iu(Ni));return Jo(t,c,o,n,e)})),Bi=Hr((function(t,n){var e=ee(n,iu(Bi));return Jo(t,64,o,n,e)})),zi=nu((function(t,n){return Jo(t,256,o,o,o,n)}));function Wi(t,n){return t===n||t!=t&&n!=n}var Fi=qo(Cr),$i=qo((function(t,n){return t>=n})),Vi=kr(function(){return arguments}())?kr:function(t){return ea(t)&&Tt.call(t,"callee")&&!tn.call(t,"callee")},qi=r.isArray,Gi=pn?Vn(pn):function(t){return ea(t)&&Sr(t)==A};function Zi(t){return null!=t&&ta(t.length)&&!Qi(t)}function Hi(t){return ea(t)&&Zi(t)}var Ki=he||yc,Ji=hn?Vn(hn):function(t){return ea(t)&&Sr(t)==_};function Yi(t){if(!ea(t))return!1;var n=Sr(t);return n==m||"[object DOMException]"==n||"string"==typeof t.message&&"string"==typeof t.name&&!ua(t)}function Qi(t){if(!na(t))return!1;var n=Sr(t);return n==b||n==w||"[object AsyncFunction]"==n||"[object Proxy]"==n}function Xi(t){return"number"==typeof t&&t==va(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=l}function na(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}function ea(t){return null!=t&&"object"==typeof t}var ra=dn?Vn(dn):function(t){return ea(t)&&hu(t)==x};function oa(t){return"number"==typeof t||ea(t)&&Sr(t)==E}function ua(t){if(!ea(t)||Sr(t)!=S)return!1;var n=Gt(t);if(null===n)return!0;var e=Tt.call(n,"constructor")&&n.constructor;return"function"==typeof e&&e instanceof e&&Lt.call(e)==Dt}var ia=vn?Vn(vn):function(t){return ea(t)&&Sr(t)==R},aa=gn?Vn(gn):function(t){return ea(t)&&hu(t)==O};function ca(t){return"string"==typeof t||!qi(t)&&ea(t)&&Sr(t)==j}function fa(t){return"symbol"==typeof t||ea(t)&&Sr(t)==P}var sa=yn?Vn(yn):function(t){return ea(t)&&ta(t.length)&&!!Qt[Sr(t)]},la=qo(Mr),pa=qo((function(t,n){return t<=n}));function ha(t){if(!t)return[];if(Zi(t))return ca(t)?ie(t):jo(t);if(an&&t[an])return function(t){for(var n,e=[];!(n=t.next()).done;)e.push(n.value);return e}(t[an]());var n=hu(t);return(n==x?te:n==O?re:Wa)(t)}function da(t){return t?(t=ya(t))===s||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function va(t){var n=da(t),e=n%1;return n==n?e?n-e:n:0}function ga(t){return t?ir(va(t),0,h):0}function ya(t){if("number"==typeof t)return t;if(fa(t))return p;if(na(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=na(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=$n(t);var e=dt.test(t);return e||gt.test(t)?en(t.slice(2),e?2:8):ht.test(t)?p:+t}function _a(t){return Po(t,Ta(t))}function ma(t){return null==t?"":ao(t)}var ba=Ao((function(t,n){if(xu(n)||Zi(n))Po(n,La(n),t);else for(var e in n)Tt.call(n,e)&&tr(t,e,n[e])})),wa=Ao((function(t,n){Po(n,Ta(n),t)})),xa=Ao((function(t,n,e,r){Po(n,Ta(n),t,r)})),Ea=Ao((function(t,n,e,r){Po(n,La(n),t,r)})),Sa=nu(ur),Ca=Hr((function(t,n){t=St(t);var e=-1,r=n.length,u=r>2?n[2]:o;for(u&&_u(n[0],n[1],u)&&(r=1);++e<r;)for(var i=n[e],a=Ta(i),c=-1,f=a.length;++c<f;){var s=a[c],l=t[s];(l===o||Wi(l,kt[s])&&!Tt.call(t,s))&&(t[s]=i[s])}return t})),Ra=Hr((function(t){return t.push(o,Qo),_n(Ua,o,t)}));function Oa(t,n,e){var r=null==t?o:xr(t,n);return r===o?e:r}function ja(t,n){return null!=t&&du(t,n,Or)}var Pa=zo((function(t,n,e){null!=n&&"function"!=typeof n.toString&&(n=Mt.call(n)),t[n]=e}),nc(oc)),ka=zo((function(t,n,e){null!=n&&"function"!=typeof n.toString&&(n=Mt.call(n)),Tt.call(t,n)?t[n].push(e):t[n]=[e]}),au),Aa=Hr(Pr);function La(t){return Zi(t)?Ke(t):Ur(t)}function Ta(t){return Zi(t)?Ke(t,!0):function(t){if(!na(t))return function(t){var n=[];if(null!=t)for(var e in St(t))n.push(e);return n}(t);var n=xu(t),e=[];for(var r in t)("constructor"!=r||!n&&Tt.call(t,r))&&e.push(r);return e}(t)}var Ia=Ao((function(t,n,e){zr(t,n,e)})),Ua=Ao((function(t,n,e,r){zr(t,n,e,r)})),Ma=nu((function(t,n){var e={};if(null==t)return e;var r=!1;n=Rn(n,(function(n){return n=_o(n,t),r||(r=n.length>1),n})),Po(t,ru(t),e),r&&(e=ar(e,7,Xo));for(var o=n.length;o--;)fo(e,n[o]);return e})),Da=nu((function(t,n){return null==t?{}:function(t,n){return $r(t,n,(function(n,e){return ja(t,e)}))}(t,n)}));function Na(t,n){if(null==t)return{};var e=Rn(ru(t),(function(t){return[t]}));return n=au(n),$r(t,e,(function(t,e){return n(t,e[0])}))}var Ba=Ko(La),za=Ko(Ta);function Wa(t){return null==t?[]:qn(t,La(t))}var Fa=Uo((function(t,n,e){return n=n.toLowerCase(),t+(e?$a(n):n)}));function $a(t){return Ya(ma(t).toLowerCase())}function Va(t){return(t=ma(t))&&t.replace(_t,Jn).replace(qt,"")}var qa=Uo((function(t,n,e){return t+(e?"-":"")+n.toLowerCase()})),Ga=Uo((function(t,n,e){return t+(e?" ":"")+n.toLowerCase()})),Za=Io("toLowerCase"),Ha=Uo((function(t,n,e){return t+(e?"_":"")+n.toLowerCase()})),Ka=Uo((function(t,n,e){return t+(e?" ":"")+Ya(n)})),Ja=Uo((function(t,n,e){return t+(e?" ":"")+n.toUpperCase()})),Ya=Io("toUpperCase");function Qa(t,n,e){return t=ma(t),(n=e?o:n)===o?function(t){return Kt.test(t)}(t)?function(t){return t.match(Zt)||[]}(t):function(t){return t.match(ct)||[]}(t):t.match(n)||[]}var Xa=Hr((function(t,n){try{return _n(t,o,n)}catch(t){return Yi(t)?t:new wt(t)}})),tc=nu((function(t,n){return bn(n,(function(n){n=Nu(n),or(t,n,ki(t[n],t))})),t}));function nc(t){return function(){return t}}var ec=No(),rc=No(!0);function oc(t){return t}function uc(t){return Ir("function"==typeof t?t:ar(t,1))}var ic=Hr((function(t,n){return function(e){return Pr(e,t,n)}})),ac=Hr((function(t,n){return function(e){return Pr(t,e,n)}}));function cc(t,n,e){var r=La(n),o=wr(n,r);null!=e||na(n)&&(o.length||!r.length)||(e=n,n=t,t=this,o=wr(n,La(n)));var u=!(na(e)&&"chain"in e&&!e.chain),i=Qi(t);return bn(o,(function(e){var r=n[e];t[e]=r,i&&(t.prototype[e]=function(){var n=this.__chain__;if(u||n){var e=t(this.__wrapped__),o=e.__actions__=jo(this.__actions__);return o.push({func:r,args:arguments,thisArg:t}),e.__chain__=n,e}return r.apply(t,On([this.value()],arguments))})})),t}function fc(){}var sc=Fo(Rn),lc=Fo(xn),pc=Fo(kn);function hc(t){return mu(t)?Nn(Nu(t)):function(t){return function(n){return xr(n,t)}}(t)}var dc=Vo(),vc=Vo(!0);function gc(){return[]}function yc(){return!1}var _c,mc=Wo((function(t,n){return t+n}),0),bc=Zo("ceil"),wc=Wo((function(t,n){return t/n}),1),xc=Zo("floor"),Ec=Wo((function(t,n){return t*n}),1),Sc=Zo("round"),Cc=Wo((function(t,n){return t-n}),0);return Be.after=function(t,n){if("function"!=typeof n)throw new Ot(u);return t=va(t),function(){if(--t<1)return n.apply(this,arguments)}},Be.ary=ji,Be.assign=ba,Be.assignIn=wa,Be.assignInWith=xa,Be.assignWith=Ea,Be.at=Sa,Be.before=Pi,Be.bind=ki,Be.bindAll=tc,Be.bindKey=Ai,Be.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return qi(t)?t:[t]},Be.chain=hi,Be.chunk=function(t,n,e){n=(e?_u(t,n,e):n===o)?1:ye(va(n),0);var u=null==t?0:t.length;if(!u||n<1)return[];for(var i=0,a=0,c=r(se(u/n));i<u;)c[a++]=no(t,i,i+=n);return c},Be.compact=function(t){for(var n=-1,e=null==t?0:t.length,r=0,o=[];++n<e;){var u=t[n];u&&(o[r++]=u)}return o},Be.concat=function(){var t=arguments.length;if(!t)return[];for(var n=r(t-1),e=arguments[0],o=t;o--;)n[o-1]=arguments[o];return On(qi(e)?jo(e):[e],gr(n,1))},Be.cond=function(t){var n=null==t?0:t.length,e=au();return t=n?Rn(t,(function(t){if("function"!=typeof t[1])throw new Ot(u);return[e(t[0]),t[1]]})):[],Hr((function(e){for(var r=-1;++r<n;){var o=t[r];if(_n(o[0],this,e))return _n(o[1],this,e)}}))},Be.conforms=function(t){return function(t){var n=La(t);return function(e){return cr(e,t,n)}}(ar(t,1))},Be.constant=nc,Be.countBy=gi,Be.create=function(t,n){var e=ze(t);return null==n?e:rr(e,n)},Be.curry=function t(n,e,r){var u=Jo(n,8,o,o,o,o,o,e=r?o:e);return u.placeholder=t.placeholder,u},Be.curryRight=function t(n,e,r){var u=Jo(n,16,o,o,o,o,o,e=r?o:e);return u.placeholder=t.placeholder,u},Be.debounce=Li,Be.defaults=Ca,Be.defaultsDeep=Ra,Be.defer=Ti,Be.delay=Ii,Be.difference=Wu,Be.differenceBy=Fu,Be.differenceWith=$u,Be.drop=function(t,n,e){var r=null==t?0:t.length;return r?no(t,(n=e||n===o?1:va(n))<0?0:n,r):[]},Be.dropRight=function(t,n,e){var r=null==t?0:t.length;return r?no(t,0,(n=r-(n=e||n===o?1:va(n)))<0?0:n):[]},Be.dropRightWhile=function(t,n){return t&&t.length?lo(t,au(n,3),!0,!0):[]},Be.dropWhile=function(t,n){return t&&t.length?lo(t,au(n,3),!0):[]},Be.fill=function(t,n,e,r){var u=null==t?0:t.length;return u?(e&&"number"!=typeof e&&_u(t,n,e)&&(e=0,r=u),function(t,n,e,r){var u=t.length;for((e=va(e))<0&&(e=-e>u?0:u+e),(r=r===o||r>u?u:va(r))<0&&(r+=u),r=e>r?0:ga(r);e<r;)t[e++]=n;return t}(t,n,e,r)):[]},Be.filter=function(t,n){return(qi(t)?En:vr)(t,au(n,3))},Be.flatMap=function(t,n){return gr(Si(t,n),1)},Be.flatMapDeep=function(t,n){return gr(Si(t,n),s)},Be.flatMapDepth=function(t,n,e){return e=e===o?1:va(e),gr(Si(t,n),e)},Be.flatten=Gu,Be.flattenDeep=function(t){return null!=t&&t.length?gr(t,s):[]},Be.flattenDepth=function(t,n){return null!=t&&t.length?gr(t,n=n===o?1:va(n)):[]},Be.flip=function(t){return Jo(t,512)},Be.flow=ec,Be.flowRight=rc,Be.fromPairs=function(t){for(var n=-1,e=null==t?0:t.length,r={};++n<e;){var o=t[n];r[o[0]]=o[1]}return r},Be.functions=function(t){return null==t?[]:wr(t,La(t))},Be.functionsIn=function(t){return null==t?[]:wr(t,Ta(t))},Be.groupBy=wi,Be.initial=function(t){return null!=t&&t.length?no(t,0,-1):[]},Be.intersection=Hu,Be.intersectionBy=Ku,Be.intersectionWith=Ju,Be.invert=Pa,Be.invertBy=ka,Be.invokeMap=xi,Be.iteratee=uc,Be.keyBy=Ei,Be.keys=La,Be.keysIn=Ta,Be.map=Si,Be.mapKeys=function(t,n){var e={};return n=au(n,3),mr(t,(function(t,r,o){or(e,n(t,r,o),t)})),e},Be.mapValues=function(t,n){var e={};return n=au(n,3),mr(t,(function(t,r,o){or(e,r,n(t,r,o))})),e},Be.matches=function(t){return Nr(ar(t,1))},Be.matchesProperty=function(t,n){return Br(t,ar(n,1))},Be.memoize=Ui,Be.merge=Ia,Be.mergeWith=Ua,Be.method=ic,Be.methodOf=ac,Be.mixin=cc,Be.negate=Mi,Be.nthArg=function(t){return t=va(t),Hr((function(n){return Wr(n,t)}))},Be.omit=Ma,Be.omitBy=function(t,n){return Na(t,Mi(au(n)))},Be.once=function(t){return Pi(2,t)},Be.orderBy=function(t,n,e,r){return null==t?[]:(qi(n)||(n=null==n?[]:[n]),qi(e=r?o:e)||(e=null==e?[]:[e]),Fr(t,n,e))},Be.over=sc,Be.overArgs=Di,Be.overEvery=lc,Be.overSome=pc,Be.partial=Ni,Be.partialRight=Bi,Be.partition=Ci,Be.pick=Da,Be.pickBy=Na,Be.property=hc,Be.propertyOf=function(t){return function(n){return null==t?o:xr(t,n)}},Be.pull=Qu,Be.pullAll=Xu,Be.pullAllBy=function(t,n,e){return t&&t.length&&n&&n.length?Vr(t,n,au(e,2)):t},Be.pullAllWith=function(t,n,e){return t&&t.length&&n&&n.length?Vr(t,n,o,e):t},Be.pullAt=ti,Be.range=dc,Be.rangeRight=vc,Be.rearg=zi,Be.reject=function(t,n){return(qi(t)?En:vr)(t,Mi(au(n,3)))},Be.remove=function(t,n){var e=[];if(!t||!t.length)return e;var r=-1,o=[],u=t.length;for(n=au(n,3);++r<u;){var i=t[r];n(i,r,t)&&(e.push(i),o.push(r))}return qr(t,o),e},Be.rest=function(t,n){if("function"!=typeof t)throw new Ot(u);return Hr(t,n=n===o?n:va(n))},Be.reverse=ni,Be.sampleSize=function(t,n,e){return n=(e?_u(t,n,e):n===o)?1:va(n),(qi(t)?Ye:Jr)(t,n)},Be.set=function(t,n,e){return null==t?t:Yr(t,n,e)},Be.setWith=function(t,n,e,r){return r="function"==typeof r?r:o,null==t?t:Yr(t,n,e,r)},Be.shuffle=function(t){return(qi(t)?Qe:to)(t)},Be.slice=function(t,n,e){var r=null==t?0:t.length;return r?(e&&"number"!=typeof e&&_u(t,n,e)?(n=0,e=r):(n=null==n?0:va(n),e=e===o?r:va(e)),no(t,n,e)):[]},Be.sortBy=Ri,Be.sortedUniq=function(t){return t&&t.length?uo(t):[]},Be.sortedUniqBy=function(t,n){return t&&t.length?uo(t,au(n,2)):[]},Be.split=function(t,n,e){return e&&"number"!=typeof e&&_u(t,n,e)&&(n=e=o),(e=e===o?h:e>>>0)?(t=ma(t))&&("string"==typeof n||null!=n&&!ia(n))&&!(n=ao(n))&&Xn(t)?bo(ie(t),0,e):t.split(n,e):[]},Be.spread=function(t,n){if("function"!=typeof t)throw new Ot(u);return n=null==n?0:ye(va(n),0),Hr((function(e){var r=e[n],o=bo(e,0,n);return r&&On(o,r),_n(t,this,o)}))},Be.tail=function(t){var n=null==t?0:t.length;return n?no(t,1,n):[]},Be.take=function(t,n,e){return t&&t.length?no(t,0,(n=e||n===o?1:va(n))<0?0:n):[]},Be.takeRight=function(t,n,e){var r=null==t?0:t.length;return r?no(t,(n=r-(n=e||n===o?1:va(n)))<0?0:n,r):[]},Be.takeRightWhile=function(t,n){return t&&t.length?lo(t,au(n,3),!1,!0):[]},Be.takeWhile=function(t,n){return t&&t.length?lo(t,au(n,3)):[]},Be.tap=function(t,n){return n(t),t},Be.throttle=function(t,n,e){var r=!0,o=!0;if("function"!=typeof t)throw new Ot(u);return na(e)&&(r="leading"in e?!!e.leading:r,o="trailing"in e?!!e.trailing:o),Li(t,n,{leading:r,maxWait:n,trailing:o})},Be.thru=di,Be.toArray=ha,Be.toPairs=Ba,Be.toPairsIn=za,Be.toPath=function(t){return qi(t)?Rn(t,Nu):fa(t)?[t]:jo(Du(ma(t)))},Be.toPlainObject=_a,Be.transform=function(t,n,e){var r=qi(t),o=r||Ki(t)||sa(t);if(n=au(n,4),null==e){var u=t&&t.constructor;e=o?r?new u:[]:na(t)&&Qi(u)?ze(Gt(t)):{}}return(o?bn:mr)(t,(function(t,r,o){return n(e,t,r,o)})),e},Be.unary=function(t){return ji(t,1)},Be.union=ei,Be.unionBy=ri,Be.unionWith=oi,Be.uniq=function(t){return t&&t.length?co(t):[]},Be.uniqBy=function(t,n){return t&&t.length?co(t,au(n,2)):[]},Be.uniqWith=function(t,n){return n="function"==typeof n?n:o,t&&t.length?co(t,o,n):[]},Be.unset=function(t,n){return null==t||fo(t,n)},Be.unzip=ui,Be.unzipWith=ii,Be.update=function(t,n,e){return null==t?t:so(t,n,yo(e))},Be.updateWith=function(t,n,e,r){return r="function"==typeof r?r:o,null==t?t:so(t,n,yo(e),r)},Be.values=Wa,Be.valuesIn=function(t){return null==t?[]:qn(t,Ta(t))},Be.without=ai,Be.words=Qa,Be.wrap=function(t,n){return Ni(yo(n),t)},Be.xor=ci,Be.xorBy=fi,Be.xorWith=si,Be.zip=li,Be.zipObject=function(t,n){return vo(t||[],n||[],tr)},Be.zipObjectDeep=function(t,n){return vo(t||[],n||[],Yr)},Be.zipWith=pi,Be.entries=Ba,Be.entriesIn=za,Be.extend=wa,Be.extendWith=xa,cc(Be,Be),Be.add=mc,Be.attempt=Xa,Be.camelCase=Fa,Be.capitalize=$a,Be.ceil=bc,Be.clamp=function(t,n,e){return e===o&&(e=n,n=o),e!==o&&(e=(e=ya(e))==e?e:0),n!==o&&(n=(n=ya(n))==n?n:0),ir(ya(t),n,e)},Be.clone=function(t){return ar(t,4)},Be.cloneDeep=function(t){return ar(t,5)},Be.cloneDeepWith=function(t,n){return ar(t,5,n="function"==typeof n?n:o)},Be.cloneWith=function(t,n){return ar(t,4,n="function"==typeof n?n:o)},Be.conformsTo=function(t,n){return null==n||cr(t,n,La(n))},Be.deburr=Va,Be.defaultTo=function(t,n){return null==t||t!=t?n:t},Be.divide=wc,Be.endsWith=function(t,n,e){t=ma(t),n=ao(n);var r=t.length,u=e=e===o?r:ir(va(e),0,r);return(e-=n.length)>=0&&t.slice(e,u)==n},Be.eq=Wi,Be.escape=function(t){return(t=ma(t))&&H.test(t)?t.replace(G,Yn):t},Be.escapeRegExp=function(t){return(t=ma(t))&&et.test(t)?t.replace(nt,"\\$&"):t},Be.every=function(t,n,e){var r=qi(t)?xn:hr;return e&&_u(t,n,e)&&(n=o),r(t,au(n,3))},Be.find=yi,Be.findIndex=Vu,Be.findKey=function(t,n){return Ln(t,au(n,3),mr)},Be.findLast=_i,Be.findLastIndex=qu,Be.findLastKey=function(t,n){return Ln(t,au(n,3),br)},Be.floor=xc,Be.forEach=mi,Be.forEachRight=bi,Be.forIn=function(t,n){return null==t?t:yr(t,au(n,3),Ta)},Be.forInRight=function(t,n){return null==t?t:_r(t,au(n,3),Ta)},Be.forOwn=function(t,n){return t&&mr(t,au(n,3))},Be.forOwnRight=function(t,n){return t&&br(t,au(n,3))},Be.get=Oa,Be.gt=Fi,Be.gte=$i,Be.has=function(t,n){return null!=t&&du(t,n,Rr)},Be.hasIn=ja,Be.head=Zu,Be.identity=oc,Be.includes=function(t,n,e,r){t=Zi(t)?t:Wa(t),e=e&&!r?va(e):0;var o=t.length;return e<0&&(e=ye(o+e,0)),ca(t)?e<=o&&t.indexOf(n,e)>-1:!!o&&In(t,n,e)>-1},Be.indexOf=function(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var o=null==e?0:va(e);return o<0&&(o=ye(r+o,0)),In(t,n,o)},Be.inRange=function(t,n,e){return n=da(n),e===o?(e=n,n=0):e=da(e),function(t,n,e){return t>=_e(n,e)&&t<ye(n,e)}(t=ya(t),n,e)},Be.invoke=Aa,Be.isArguments=Vi,Be.isArray=qi,Be.isArrayBuffer=Gi,Be.isArrayLike=Zi,Be.isArrayLikeObject=Hi,Be.isBoolean=function(t){return!0===t||!1===t||ea(t)&&Sr(t)==y},Be.isBuffer=Ki,Be.isDate=Ji,Be.isElement=function(t){return ea(t)&&1===t.nodeType&&!ua(t)},Be.isEmpty=function(t){if(null==t)return!0;if(Zi(t)&&(qi(t)||"string"==typeof t||"function"==typeof t.splice||Ki(t)||sa(t)||Vi(t)))return!t.length;var n=hu(t);if(n==x||n==O)return!t.size;if(xu(t))return!Ur(t).length;for(var e in t)if(Tt.call(t,e))return!1;return!0},Be.isEqual=function(t,n){return Ar(t,n)},Be.isEqualWith=function(t,n,e){var r=(e="function"==typeof e?e:o)?e(t,n):o;return r===o?Ar(t,n,o,e):!!r},Be.isError=Yi,Be.isFinite=function(t){return"number"==typeof t&&de(t)},Be.isFunction=Qi,Be.isInteger=Xi,Be.isLength=ta,Be.isMap=ra,Be.isMatch=function(t,n){return t===n||Lr(t,n,fu(n))},Be.isMatchWith=function(t,n,e){return e="function"==typeof e?e:o,Lr(t,n,fu(n),e)},Be.isNaN=function(t){return oa(t)&&t!=+t},Be.isNative=function(t){if(wu(t))throw new wt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Tr(t)},Be.isNil=function(t){return null==t},Be.isNull=function(t){return null===t},Be.isNumber=oa,Be.isObject=na,Be.isObjectLike=ea,Be.isPlainObject=ua,Be.isRegExp=ia,Be.isSafeInteger=function(t){return Xi(t)&&t>=-9007199254740991&&t<=l},Be.isSet=aa,Be.isString=ca,Be.isSymbol=fa,Be.isTypedArray=sa,Be.isUndefined=function(t){return t===o},Be.isWeakMap=function(t){return ea(t)&&hu(t)==k},Be.isWeakSet=function(t){return ea(t)&&"[object WeakSet]"==Sr(t)},Be.join=function(t,n){return null==t?"":ve.call(t,n)},Be.kebabCase=qa,Be.last=Yu,Be.lastIndexOf=function(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var u=r;return e!==o&&(u=(u=va(e))<0?ye(r+u,0):_e(u,r-1)),n==n?function(t,n,e){for(var r=e+1;r--;)if(t[r]===n)return r;return r}(t,n,u):Tn(t,Mn,u,!0)},Be.lowerCase=Ga,Be.lowerFirst=Za,Be.lt=la,Be.lte=pa,Be.max=function(t){return t&&t.length?dr(t,oc,Cr):o},Be.maxBy=function(t,n){return t&&t.length?dr(t,au(n,2),Cr):o},Be.mean=function(t){return Dn(t,oc)},Be.meanBy=function(t,n){return Dn(t,au(n,2))},Be.min=function(t){return t&&t.length?dr(t,oc,Mr):o},Be.minBy=function(t,n){return t&&t.length?dr(t,au(n,2),Mr):o},Be.stubArray=gc,Be.stubFalse=yc,Be.stubObject=function(){return{}},Be.stubString=function(){return""},Be.stubTrue=function(){return!0},Be.multiply=Ec,Be.nth=function(t,n){return t&&t.length?Wr(t,va(n)):o},Be.noConflict=function(){return un._===this&&(un._=Nt),this},Be.noop=fc,Be.now=Oi,Be.pad=function(t,n,e){t=ma(t);var r=(n=va(n))?ue(t):0;if(!n||r>=n)return t;var o=(n-r)/2;return $o(le(o),e)+t+$o(se(o),e)},Be.padEnd=function(t,n,e){t=ma(t);var r=(n=va(n))?ue(t):0;return n&&r<n?t+$o(n-r,e):t},Be.padStart=function(t,n,e){t=ma(t);var r=(n=va(n))?ue(t):0;return n&&r<n?$o(n-r,e)+t:t},Be.parseInt=function(t,n,e){return e||null==n?n=0:n&&(n=+n),be(ma(t).replace(rt,""),n||0)},Be.random=function(t,n,e){if(e&&"boolean"!=typeof e&&_u(t,n,e)&&(n=e=o),e===o&&("boolean"==typeof n?(e=n,n=o):"boolean"==typeof t&&(e=t,t=o)),t===o&&n===o?(t=0,n=1):(t=da(t),n===o?(n=t,t=0):n=da(n)),t>n){var r=t;t=n,n=r}if(e||t%1||n%1){var u=we();return _e(t+u*(n-t+nn("1e-"+((u+"").length-1))),n)}return Gr(t,n)},Be.reduce=function(t,n,e){var r=qi(t)?jn:zn,o=arguments.length<3;return r(t,au(n,4),e,o,lr)},Be.reduceRight=function(t,n,e){var r=qi(t)?Pn:zn,o=arguments.length<3;return r(t,au(n,4),e,o,pr)},Be.repeat=function(t,n,e){return n=(e?_u(t,n,e):n===o)?1:va(n),Zr(ma(t),n)},Be.replace=function(){var t=arguments,n=ma(t[0]);return t.length<3?n:n.replace(t[1],t[2])},Be.result=function(t,n,e){var r=-1,u=(n=_o(n,t)).length;for(u||(u=1,t=o);++r<u;){var i=null==t?o:t[Nu(n[r])];i===o&&(r=u,i=e),t=Qi(i)?i.call(t):i}return t},Be.round=Sc,Be.runInContext=t,Be.sample=function(t){return(qi(t)?Je:Kr)(t)},Be.size=function(t){if(null==t)return 0;if(Zi(t))return ca(t)?ue(t):t.length;var n=hu(t);return n==x||n==O?t.size:Ur(t).length},Be.snakeCase=Ha,Be.some=function(t,n,e){var r=qi(t)?kn:eo;return e&&_u(t,n,e)&&(n=o),r(t,au(n,3))},Be.sortedIndex=function(t,n){return ro(t,n)},Be.sortedIndexBy=function(t,n,e){return oo(t,n,au(e,2))},Be.sortedIndexOf=function(t,n){var e=null==t?0:t.length;if(e){var r=ro(t,n);if(r<e&&Wi(t[r],n))return r}return-1},Be.sortedLastIndex=function(t,n){return ro(t,n,!0)},Be.sortedLastIndexBy=function(t,n,e){return oo(t,n,au(e,2),!0)},Be.sortedLastIndexOf=function(t,n){if(null!=t&&t.length){var e=ro(t,n,!0)-1;if(Wi(t[e],n))return e}return-1},Be.startCase=Ka,Be.startsWith=function(t,n,e){return t=ma(t),e=null==e?0:ir(va(e),0,t.length),n=ao(n),t.slice(e,e+n.length)==n},Be.subtract=Cc,Be.sum=function(t){return t&&t.length?Wn(t,oc):0},Be.sumBy=function(t,n){return t&&t.length?Wn(t,au(n,2)):0},Be.template=function(t,n,e){var r=Be.templateSettings;e&&_u(t,n,e)&&(n=o),t=ma(t),n=xa({},n,r,Yo);var u,i,a=xa({},n.imports,r.imports,Yo),c=La(a),f=qn(a,c),s=0,l=n.interpolate||mt,p="__p += '",h=Ct((n.escape||mt).source+"|"+l.source+"|"+(l===Y?lt:mt).source+"|"+(n.evaluate||mt).source+"|$","g"),d="//# sourceURL="+(Tt.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Yt+"]")+"\n";t.replace(h,(function(n,e,r,o,a,c){return r||(r=o),p+=t.slice(s,c).replace(bt,Qn),e&&(u=!0,p+="' +\n__e("+e+") +\n'"),a&&(i=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=c+n.length,n})),p+="';\n";var v=Tt.call(n,"variable")&&n.variable;if(v){if(ft.test(v))throw new wt("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(i?p.replace(F,""):p).replace($,"$1").replace(V,"$1;"),p="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=Xa((function(){return xt(c,d+"return "+p).apply(o,f)}));if(g.source=p,Yi(g))throw g;return g},Be.times=function(t,n){if((t=va(t))<1||t>l)return[];var e=h,r=_e(t,h);n=au(n),t-=h;for(var o=Fn(r,n);++e<t;)n(e);return o},Be.toFinite=da,Be.toInteger=va,Be.toLength=ga,Be.toLower=function(t){return ma(t).toLowerCase()},Be.toNumber=ya,Be.toSafeInteger=function(t){return t?ir(va(t),-9007199254740991,l):0===t?t:0},Be.toString=ma,Be.toUpper=function(t){return ma(t).toUpperCase()},Be.trim=function(t,n,e){if((t=ma(t))&&(e||n===o))return $n(t);if(!t||!(n=ao(n)))return t;var r=ie(t),u=ie(n);return bo(r,Zn(r,u),Hn(r,u)+1).join("")},Be.trimEnd=function(t,n,e){if((t=ma(t))&&(e||n===o))return t.slice(0,ae(t)+1);if(!t||!(n=ao(n)))return t;var r=ie(t);return bo(r,0,Hn(r,ie(n))+1).join("")},Be.trimStart=function(t,n,e){if((t=ma(t))&&(e||n===o))return t.replace(rt,"");if(!t||!(n=ao(n)))return t;var r=ie(t);return bo(r,Zn(r,ie(n))).join("")},Be.truncate=function(t,n){var e=30,r="...";if(na(n)){var u="separator"in n?n.separator:u;e="length"in n?va(n.length):e,r="omission"in n?ao(n.omission):r}var i=(t=ma(t)).length;if(Xn(t)){var a=ie(t);i=a.length}if(e>=i)return t;var c=e-ue(r);if(c<1)return r;var f=a?bo(a,0,c).join(""):t.slice(0,c);if(u===o)return f+r;if(a&&(c+=f.length-c),ia(u)){if(t.slice(c).search(u)){var s,l=f;for(u.global||(u=Ct(u.source,ma(pt.exec(u))+"g")),u.lastIndex=0;s=u.exec(l);)var p=s.index;f=f.slice(0,p===o?c:p)}}else if(t.indexOf(ao(u),c)!=c){var h=f.lastIndexOf(u);h>-1&&(f=f.slice(0,h))}return f+r},Be.unescape=function(t){return(t=ma(t))&&Z.test(t)?t.replace(q,ce):t},Be.uniqueId=function(t){var n=++It;return ma(t)+n},Be.upperCase=Ja,Be.upperFirst=Ya,Be.each=mi,Be.eachRight=bi,Be.first=Zu,cc(Be,(_c={},mr(Be,(function(t,n){Tt.call(Be.prototype,n)||(_c[n]=t)})),_c),{chain:!1}),Be.VERSION="4.17.21",bn(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Be[t].placeholder=Be})),bn(["drop","take"],(function(t,n){$e.prototype[t]=function(e){e=e===o?1:ye(va(e),0);var r=this.__filtered__&&!n?new $e(this):this.clone();return r.__filtered__?r.__takeCount__=_e(e,r.__takeCount__):r.__views__.push({size:_e(e,h),type:t+(r.__dir__<0?"Right":"")}),r},$e.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}})),bn(["filter","map","takeWhile"],(function(t,n){var e=n+1,r=1==e||3==e;$e.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:au(t,3),type:e}),n.__filtered__=n.__filtered__||r,n}})),bn(["head","last"],(function(t,n){var e="take"+(n?"Right":"");$e.prototype[t]=function(){return this[e](1).value()[0]}})),bn(["initial","tail"],(function(t,n){var e="drop"+(n?"":"Right");$e.prototype[t]=function(){return this.__filtered__?new $e(this):this[e](1)}})),$e.prototype.compact=function(){return this.filter(oc)},$e.prototype.find=function(t){return this.filter(t).head()},$e.prototype.findLast=function(t){return this.reverse().find(t)},$e.prototype.invokeMap=Hr((function(t,n){return"function"==typeof t?new $e(this):this.map((function(e){return Pr(e,t,n)}))})),$e.prototype.reject=function(t){return this.filter(Mi(au(t)))},$e.prototype.slice=function(t,n){t=va(t);var e=this;return e.__filtered__&&(t>0||n<0)?new $e(e):(t<0?e=e.takeRight(-t):t&&(e=e.drop(t)),n!==o&&(e=(n=va(n))<0?e.dropRight(-n):e.take(n-t)),e)},$e.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},$e.prototype.toArray=function(){return this.take(h)},mr($e.prototype,(function(t,n){var e=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),u=Be[r?"take"+("last"==n?"Right":""):n],i=r||/^find/.test(n);u&&(Be.prototype[n]=function(){var n=this.__wrapped__,a=r?[1]:arguments,c=n instanceof $e,f=a[0],s=c||qi(n),l=function(t){var n=u.apply(Be,On([t],a));return r&&p?n[0]:n};s&&e&&"function"==typeof f&&1!=f.length&&(c=s=!1);var p=this.__chain__,h=!!this.__actions__.length,d=i&&!p,v=c&&!h;if(!i&&s){n=v?n:new $e(this);var g=t.apply(n,a);return g.__actions__.push({func:di,args:[l],thisArg:o}),new Fe(g,p)}return d&&v?t.apply(this,a):(g=this.thru(l),d?r?g.value()[0]:g.value():g)})})),bn(["pop","push","shift","sort","splice","unshift"],(function(t){var n=jt[t],e=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Be.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return n.apply(qi(o)?o:[],t)}return this[e]((function(e){return n.apply(qi(e)?e:[],t)}))}})),mr($e.prototype,(function(t,n){var e=Be[n];if(e){var r=e.name+"";Tt.call(ke,r)||(ke[r]=[]),ke[r].push({name:n,func:e})}})),ke[Bo(o,2).name]=[{name:"wrapper",func:o}],$e.prototype.clone=function(){var t=new $e(this.__wrapped__);return t.__actions__=jo(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=jo(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=jo(this.__views__),t},$e.prototype.reverse=function(){if(this.__filtered__){var t=new $e(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},$e.prototype.value=function(){var t=this.__wrapped__.value(),n=this.__dir__,e=qi(t),r=n<0,o=e?t.length:0,u=function(t,n,e){for(var r=-1,o=e.length;++r<o;){var u=e[r],i=u.size;switch(u.type){case"drop":t+=i;break;case"dropRight":n-=i;break;case"take":n=_e(n,t+i);break;case"takeRight":t=ye(t,n-i)}}return{start:t,end:n}}(0,o,this.__views__),i=u.start,a=u.end,c=a-i,f=r?a:i-1,s=this.__iteratees__,l=s.length,p=0,h=_e(c,this.__takeCount__);if(!e||!r&&o==c&&h==c)return po(t,this.__actions__);var d=[];t:for(;c--&&p<h;){for(var v=-1,g=t[f+=n];++v<l;){var y=s[v],_=y.iteratee,m=y.type,b=_(g);if(2==m)g=b;else if(!b){if(1==m)continue t;break t}}d[p++]=g}return d},Be.prototype.at=vi,Be.prototype.chain=function(){return hi(this)},Be.prototype.commit=function(){return new Fe(this.value(),this.__chain__)},Be.prototype.next=function(){this.__values__===o&&(this.__values__=ha(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},Be.prototype.plant=function(t){for(var n,e=this;e instanceof We;){var r=zu(e);r.__index__=0,r.__values__=o,n?u.__wrapped__=r:n=r;var u=r;e=e.__wrapped__}return u.__wrapped__=t,n},Be.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof $e){var n=t;return this.__actions__.length&&(n=new $e(this)),(n=n.reverse()).__actions__.push({func:di,args:[ni],thisArg:o}),new Fe(n,this.__chain__)}return this.thru(ni)},Be.prototype.toJSON=Be.prototype.valueOf=Be.prototype.value=function(){return po(this.__wrapped__,this.__actions__)},Be.prototype.first=Be.prototype.head,an&&(Be.prototype[an]=function(){return this}),Be}();un._=fe,(r=function(){return fe}.call(n,e,n,t))===o||(t.exports=r)}.call(this)},968:(t,n,e)=>{const r=e(577).R;n.s=function(t){if(t||(t=1),!e.y.meta||!e.y.meta.url)throw console.error("__system_context__",e.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");e.p=r(e.y.meta.url,t)}},577:(t,n,e)=>{n.R=function(t,n){var e=document.createElement("a");e.href=t;for(var r="/"===e.pathname[0]?e.pathname:"/"+e.pathname,o=0,u=r.length;o!==n&&u>=0;)"/"===r[--u]&&o++;if(o!==n)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+n+") is greater than the number of directories ("+o+") in the URL path "+t);var i=r.slice(0,u+1);return e.protocol+"//"+e.host+i};Number.isInteger},124:function(t){t.exports=function(){"use strict";return function(t,n,e){n.prototype.isToday=function(){var t="YYYY-MM-DD",n=e();return this.format(t)===n.format(t)}}}()},766:t=>{"use strict";t.exports=f},824:t=>{"use strict";t.exports=r},45:t=>{"use strict";t.exports=o},728:t=>{"use strict";t.exports=u},688:t=>{"use strict";t.exports=s},64:t=>{"use strict";t.exports=a},954:t=>{"use strict";t.exports=e},493:t=>{"use strict";t.exports=i},281:t=>{"use strict";t.exports=c}},l={};function p(n){var e=l[n];if(void 0!==e)return e.exports;var r=l[n]={id:n,loaded:!1,exports:{}};return t[n].call(r.exports,r,r.exports,p),r.loaded=!0,r.exports}p.y=n,p.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return p.d(n,{a:n}),n},p.d=(t,n)=>{for(var e in n)p.o(n,e)&&!p.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),p.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),p.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},p.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;p.g.importScripts&&(t=p.g.location+"");var n=p.g.document;if(!t&&n&&(n.currentScript&&(t=n.currentScript.src),!t)){var e=n.getElementsByTagName("script");e.length&&(t=e[e.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),p.p=t})();var h={};return(0,p(968).s)(1),(()=>{"use strict";p.r(h),p.d(h,{ComponentContext:()=>n,ConfigurableLink:()=>o,Extension:()=>a,ExtensionSlot:()=>_,UserHasAccess:()=>vt,createUseStore:()=>u,getAsyncExtensionLifecycle:()=>$,getAsyncLifecycle:()=>W,getLifecycle:()=>z,getSyncLifecycle:()=>F,openmrsComponentDecorator:()=>B,useAssignedExtensionIds:()=>V,useAssignedExtensions:()=>l,useBodyScrollLock:()=>q,useConfig:()=>K,useConnectedExtensions:()=>d,useConnectivity:()=>f,useCurrentPatient:()=>it,useExtensionInternalStore:()=>at,useExtensionSlot:()=>v,useExtensionSlotMeta:()=>ct,useExtensionStore:()=>ft,useForceUpdate:()=>st,useLayoutType:()=>pt,useLocations:()=>ht,useOnClickOutside:()=>dt,usePagination:()=>bn,usePatient:()=>nt,useSessionUser:()=>gt,useStore:()=>bt,useStoreWithActions:()=>wt,useVisit:()=>_n,useVisitTypes:()=>mn});var t=p(954);const n=t.default.createContext({moduleName:""});var e=p(824);function r(){return r=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},r.apply(this,arguments)}const o=n=>{let{to:o,children:u,...i}=n;return t.default.createElement("a",r({onClick:t=>function(t,n){t.metaKey||t.ctrlKey||t.shiftKey||0!=t.button||(t.preventDefault(),(0,e.navigate)({to:n}))}(t,o),href:(0,e.interpolateUrl)(o)},i),u)};function u(n){return function(e){const[r,o]=(0,t.useState)(n.getState());(0,t.useEffect)((()=>n.subscribe((t=>o(t)))),[]);let u={};return e&&(u=(0,t.useMemo)((()=>function(t,n){"function"==typeof n&&(n=n(t));const e={};for(let r in n)e[r]=t.action(n[r]);return e}(n,e)),[n,e])),{...r,...u}}}var i=p(45);const a=e=>{let{state:r,wrap:o}=e;const[u,a]=(0,t.useState)(),{extension:c}=(0,t.useContext)(n),f=(0,t.useCallback)((t=>{a(t)}),[]);(0,t.useEffect)((()=>{if(null!=u&&c)return(0,i.renderExtension)(u,c.extensionSlotName,c.extensionSlotModuleName,c.extensionId,void 0,r)}),[c?.extensionSlotName,c?.extensionId,c?.extensionSlotModuleName,r,u]);const s=t.default.createElement("div",{ref:f,"data-extension-id":c?.extensionId,style:{position:"relative"}});return c&&o?o(s,c):s};var c=p(728);function f(){let[n,e]=(0,t.useState)(window.navigator.onLine);return(0,t.useEffect)((()=>(0,c.subscribeConnectivityChanged)((t=>{let{online:n}=t;return e(n)}))),[]),n}var s=p(891);function l(n){const[e,r]=(0,t.useState)([]);return(0,t.useEffect)((()=>{function t(t){const o=t.slots[n]?.assignedExtensions??[];(0,s.isEqual)(o,e)||r(o)}return t((0,i.getExtensionStore)().getState()),(0,i.getExtensionStore)().subscribe(t)}),[n,e]),e}function d(n){const e=f(),r=l(n);return(0,t.useMemo)((()=>(0,i.getConnectedExtensions)(r,e)),[r,e])}function v(e){const{moduleName:r}=(0,t.useContext)(n);if(!r)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,t.useEffect)((()=>{(0,i.registerExtensionSlot)(r,e)}),[]),{extensions:d(e),extensionSlotName:e,extensionSlotModuleName:r}}function g(){return g=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},g.apply(this,arguments)}function y(t){return t}const _=e=>{let{extensionSlotName:r,select:o=y,children:u,state:i,style:c,...f}=e;const s=(0,t.useRef)(null),{extensions:l,extensionSlotModuleName:p}=v(r),h=(0,t.useRef)(i);(function(t,n){if(t===n)return!0;if(!t&&n)return!1;if(t&&!n)return!1;if("object"!=typeof t||"object"!=typeof n)return!1;const e=Object.keys(t),r=Object.keys(n);if(e.length!==r.length)return!1;for(let r=0;r<e.length;r++){const o=e[r];if(!(o in n)||n[o]!==t[o])return!1}return!0})(h.current,i)||(h.current=i);const d=(0,t.useMemo)((()=>r&&o(l).map((e=>t.default.createElement(n.Provider,{key:e.id,value:{moduleName:p,extension:{extensionId:e.id,extensionSlotName:r,extensionSlotModuleName:p}}},u??t.default.createElement(a,{state:h.current}))))),[o,l,r,h.current]);return t.default.createElement("div",g({ref:s,"data-extension-slot-name":r,"data-extension-slot-module-name":p,style:{...c,position:"relative"}},f),d)};var m=p(493);function b(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function w(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?b(Object(e),!0).forEach((function(n){E(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):b(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function x(t){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function E(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function S(t){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function C(t,n){var e;if("function"!=typeof(e=n.domElement?function(){return n.domElement}:n.domElementGetter?n.domElementGetter:t.domElementGetter?t.domElementGetter:function(t){var n=t.appName||t.name;if(!n)throw Error("single-spa's dom-element-getter-helpers was not given an application name as a prop, so it can't make a unique dom element container for the react application");var e="single-spa-application:".concat(n);return function(){var t=document.getElementById(e);return t||((t=document.createElement("div")).id=e,document.body.appendChild(t)),t}}(n)))throw Error("single-spa's dom-element-getter-helpers was given an invalid domElementGetter for application or parcel '".concat(n.name,"'. Expected a function, received ").concat(S(e)));return function(){var t=e(n);if(!(t instanceof HTMLElement))throw Error("single-spa's dom-element-getter-helpers: domElementGetter returned an invalid dom element for application or parcel '".concat(n.name,"'. Expected HTMLElement, received ").concat(S(t)));return t}}var R=null;try{R=require("react").createContext()}catch(b){}var O={React:null,ReactDOM:null,rootComponent:null,loadRootComponent:null,renderType:null,errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{}};function j(t){if("object"!==x(t))throw new Error("single-spa-react requires a configuration object");var n=w(w({},O),t);if(!n.React)throw new Error("single-spa-react must be passed opts.React");if(!n.ReactDOM)throw new Error("single-spa-react must be passed opts.ReactDOM");if(!n.rootComponent&&!n.loadRootComponent)throw new Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(n.errorBoundary&&"function"!=typeof n.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!R&&n.React.createContext&&(R=n.React.createContext()),n.SingleSpaRoot=function(t){function n(t){n.displayName="SingleSpaRoot(".concat(t.name,")")}return n.prototype=Object.create(t.React.Component.prototype),n.prototype.componentDidMount=function(){setTimeout(this.props.mountFinished)},n.prototype.componentWillUnmount=function(){setTimeout(this.props.unmountFinished)},n.prototype.render=function(){return setTimeout(this.props.updateFinished),this.props.children},n}(n);var e={bootstrap:P.bind(null,n),mount:k.bind(null,n),unmount:A.bind(null,n)};return n.parcelCanUpdate&&(e.update=L.bind(null,n)),e}function P(t,n){return t.rootComponent?Promise.resolve():t.loadRootComponent(n).then((function(n){t.rootComponent=n}))}function k(t,n){return new Promise((function(e,r){t.suppressComponentDidCatchWarning||!function(t){if(!(t&&"string"==typeof t.version&&t.version.indexOf(".")>=0))return!1;var n=t.version.slice(0,t.version.indexOf("."));try{return Number(n)>=16}catch(t){return!1}}(t.React)||t.errorBoundary||(t.rootComponent.prototype?t.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(n.name||n.appName||n.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(n.name||n.appName||n.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var o=T(t,n,(function(){e(this)})),u=C(t,n)(),i=function(t){var n=t.opts,e=t.elementToRender,r=t.domElement,o="function"==typeof n.renderType?n.renderType():n.renderType;if(["createRoot","unstable_createRoot","createBlockingRoot","unstable_createBlockingRoot"].indexOf(o)>=0){var u=n.ReactDOM[o](r);return u.render(e),u}return"hydrate"===o?n.ReactDOM.hydrate(e,r):n.ReactDOM.render(e,r),null}({elementToRender:o,domElement:u,opts:t});t.domElements[n.name]=u,t.renderResults[n.name]=i}))}function A(t,n){return new Promise((function(e){t.unmountFinished=e;var r=t.renderResults[n.name];r&&r.unmount?r.unmount():t.ReactDOM.unmountComponentAtNode(t.domElements[n.name]),delete t.domElements[n.name],delete t.renderResults[n.name]}))}function L(t,n){return new Promise((function(e){t.updateResolves[n.name]||(t.updateResolves[n.name]=[]),t.updateResolves[n.name].push(e);var r=T(t,n,null),o=t.renderResults[n.name];if(o&&o.render)o.render(r);else{var u=C(t,n)();t.ReactDOM.render(r,u)}}))}function T(t,n,e){var r=t.React.createElement(t.rootComponent,n),o=R?t.React.createElement(R.Provider,{value:n},r):r;return(t.errorBoundary||n.errorBoundary||t.errorBoundaryClass||n.errorBoundaryClass)&&(t.errorBoundaryClass=t.errorBoundaryClass||n.errorBoundaryClass||function(t,n){function e(n){t.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},e.displayName="SingleSpaReactErrorBoundary(".concat(n.name,")")}return e.prototype=Object.create(t.React.Component.prototype),e.prototype.render=function(){return this.state.caughtError?(t.errorBoundary||n.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},e.prototype.componentDidCatch=function(t,n){this.setState({caughtError:t,caughtErrorInfo:n})},e}(t,n),o=t.React.createElement(t.errorBoundaryClass,n,o)),t.React.createElement(t.SingleSpaRoot,w(w({},n),{},{mountFinished:e,updateFinished:function(){t.updateResolves[n.name]&&(t.updateResolves[n.name].forEach((function(t){return t()})),delete t.updateResolves[n.name])},unmountFinished:function(){setTimeout(t.unmountFinished)}}),o)}var I=p(64),U=p(281);const M=I.default.default||I.default,D={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},N=n=>{(0,t.useEffect)((()=>(M.on("languageChanged",n.forceUpdate),()=>M.off("languageChanged",n.forceUpdate))),[n.forceUpdate]);const e=(0,t.useRef)(null);if(e.current)throw e.current;if(!M.hasLoadedNamespace(n.ns)){const t=setTimeout((()=>{console.warn(`openmrsComponentDecorator: the React suspense promise for i18next.loadNamespaces(['${n.ns}']) did not resolve nor reject after three seconds. This could mean you have multiple versions of i18next and haven't made i18next a webpack external in all projects.`)}),3e3);throw M.loadNamespaces([n.ns]).then((()=>clearTimeout(t))).catch((n=>{clearTimeout(t),e.current=n}))}return t.default.createElement(t.default.Fragment,null,n.children)};function B(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw new Error("Invalid options");const r=Object.assign({},D,e);return function(e){var o,u,i,a;return u=o=class extends t.default.Component{constructor(t){super(t),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:r.moduleName,extension:t._extensionContext}}}componentDidCatch(t,n){n&&n.componentStack&&(t.extra=Object.assign(t.extra||{},{componentStack:n.componentStack})),r.throwErrorsToConsole&&setTimeout((()=>{throw t})),this.setState({caughtError:t,caughtErrorInfo:n})}render(){if(this.state.caughtError)return t.default.createElement("div",null,"An error has occurred. Please try reloading the page.");{const o=t.default.createElement(n.Provider,{value:this.state.config},t.default.createElement(t.default.Suspense,{fallback:null},r.disableTranslations?t.default.createElement(e,this.props):t.default.createElement(N,{ns:r.moduleName,forceUpdate:()=>this.forceUpdate()},t.default.createElement(U.I18nextProvider,{i18n:M,defaultNS:r.moduleName},t.default.createElement(e,this.props)))));return r.strictMode||!t.default.StrictMode?o:t.default.createElement(t.default.StrictMode,null,o)}}},i="displayName",a=`OpenmrsReactComponent(${r.featureName})`,i in u?Object.defineProperty(u,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[i]=a,o}}function z(n,e){return j({React:t.default,ReactDOM:m.default,rootComponent:B(e)(n)})}function W(t,n){return()=>t().then((t=>{let{default:e}=t;return z(e,n)}))}function F(t,n){return()=>Promise.resolve(z(t,n))}const $=W;function V(n){const[e,r]=(0,t.useState)([]);return(0,t.useEffect)((()=>(0,i.getExtensionStore)().subscribe((t=>{const o=t.slots[n]?.assignedExtensions.map((t=>t.id))??[];(0,s.isEqual)(o,e)||r(o)}))),[]),e}function q(n){(0,t.useEffect)((()=>{if(n){const t=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}}}),[n])}const G={};function Z(t){return new Promise((n=>{const e=t.subscribe((t=>{t.loaded&&t.config&&(n(t.config),e())}))}))}function H(n){const[e,r]=(0,t.useState)(function(t){return t?()=>{const n=t.getState();if(n.loaded&&n.config)return n.config}:void 0}(n));return(0,t.useEffect)((()=>n?.subscribe((t=>{t.loaded&&t.config&&r(t.config)}))),[n]),e}function K(){const{moduleName:r,extension:o}=(0,t.useContext)(n);if(!r&&!o)throw Error('No ComponentContext has been provided. This should come from "openmrsComponentDecorator".\nUsually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".');const u=function(n){const r=(0,t.useMemo)((()=>(0,e.getConfigStore)(n)),[n]),o=n,u=H(r);if(!u)throw G[o]||(G[o]=Z(r)),G[o];return u}(r),i=function(n){const r=(0,t.useMemo)((()=>n&&(0,e.getExtensionConfigStore)(n.extensionSlotModuleName,n.extensionSlotName,n.extensionId)),[n]),o=H(r);if(!o&&n){const t=`${n.extensionSlotModuleName}-${n.extensionSlotName}-${n.extensionId}`;throw!G[t]&&r&&(G[t]=Z(r)),G[t]}return o||{}}(o);return(0,t.useMemo)((()=>({...u,...i})),[u,i])}var J,Y=p(766);!function(t){t.loadPatient="loadPatient",t.newPatient="newPatient",t.loadError="patientLoadError"}(J||(J={}));const Q={patientUuid:null,patient:null,isPendingUuid:!0,isLoadingPatient:!1,err:null};function X(){const t=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return t&&t[1]}function tt(t,n){switch(n.type){case J.loadPatient:return{...t,patientUuid:n.patientUuid,patient:null,isPendingUuid:!1,isLoadingPatient:!0,err:null};case J.newPatient:return{...t,patient:n.patient,isPendingUuid:!1,isLoadingPatient:!1,err:null};case J.loadError:return{...t,patient:null,isPendingUuid:!1,isLoadingPatient:!1,err:n.err};default:return t}}function nt(n){const[e,r]=(0,t.useReducer)(tt,{...Q,patientUuid:n??null,isPendingUuid:!n,isLoadingPatient:!!n});return(0,t.useEffect)((()=>{if(e.isPendingUuid){const t=X();r(t?{type:J.loadPatient,patientUuid:t}:{type:J.newPatient,patient:null})}let t=!0;return e.isLoadingPatient&&e.patientUuid&&(0,Y.fetchCurrentPatient)(e.patientUuid).then((n=>t&&r({patient:n.data,type:J.newPatient})),(n=>t&&r({err:n,type:J.loadError}))),()=>{t=!1}}),[e.isPendingUuid,e.isLoadingPatient,e.patientUuid]),(0,t.useEffect)((()=>{const t=t=>{const n=X();n!=e.patientUuid&&r({type:J.loadPatient,patientUuid:n})};return window.addEventListener("single-spa:routing-event",t),()=>window.removeEventListener("single-spa:routing-event",t)}),[e.patientUuid]),{isLoading:e.isPendingUuid||e.isLoadingPatient,patient:e.patient,patientUuid:n??e.patientUuid,error:e.err}}var et;!function(t){t.loadPatient="loadPatient",t.newPatient="newPatient",t.loadError="patientLloadErroroadError"}(et||(et={}));const rt={patient:null,isLoadingPatient:!0,err:null};function ot(){const t=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return t&&t[1]}function ut(t,n){switch(n.type){case et.loadPatient:return{...t,patient:null,isLoadingPatient:!0,err:null};case et.newPatient:return{...t,patient:n.patient,isLoadingPatient:!1,err:null};case et.loadError:return{...t,patient:null,isLoadingPatient:!1,err:n.err};default:return t}}function it(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ot();const[e,r]=(0,t.useReducer)(ut,rt);return(0,t.useEffect)((()=>{let t=!0;return n?((0,Y.fetchCurrentPatient)(n).then((n=>t&&r({patient:n.data,type:et.newPatient})),(n=>t&&r({err:n,type:et.loadError}))),r({type:et.loadPatient})):r({type:et.newPatient,patient:null}),()=>{t=!1}}),[n]),[e.isLoadingPatient,e.patient,n,e.err]}const at=u((0,i.getExtensionInternalStore)());function ct(n){const e=d(n);return(0,t.useMemo)((()=>Object.fromEntries(e.map((t=>[t.name,t.meta])))),[e])}const ft=u((0,i.getExtensionStore)());function st(){const[,n]=(0,t.useState)(0);return(0,t.useCallback)((()=>{n((t=>t+1))}),[])}function lt(){let t="tablet";return document.body.classList.forEach((n=>{switch(n){case"omrs-breakpoint-lt-tablet":t="phone";break;case"omrs-breakpoint-gt-tablet":t="desktop"}})),t}function pt(){const[n,e]=(0,t.useState)(lt);return(0,t.useEffect)((()=>{const t=()=>{e(lt())};return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[]),n}function ht(){const[n,e]=(0,t.useState)([]);return(0,t.useEffect)((()=>{const t=(0,Y.getLocations)().subscribe((t=>{e(t)}),(t=>{console.error(t)}));return()=>t.unsubscribe()}),[]),n}function dt(n){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=(0,t.useRef)(null);return(0,t.useEffect)((()=>{if(e){const t=t=>{const e=r?.current;e?.contains(t.target)&&n(t)};return window.addEventListener("click",t),()=>window.removeEventListener("click",t)}}),[n,e]),r}const vt=n=>{let{privilege:e,children:r}=n;const[o,u]=(0,t.useState)(null);return(0,t.useEffect)((()=>{const t=(0,Y.getCurrentUser)({includeAuthStatus:!1}).subscribe(u);return()=>t.unsubscribe()}),[]),o&&(0,Y.userHasAccess)(e,o)?t.default.createElement(t.default.Fragment,null,r):null};function gt(){const[n,e]=(0,t.useState)(null);return(0,t.useEffect)((()=>{if(null===n){const t=(0,Y.openmrsObservableFetch)("/ws/rest/v1/session").subscribe((t=>{e(t.data)}));return()=>t.unsubscribe()}}),[n]),n}var yt=p(748);function _t(t,n){"function"==typeof n&&(n=n(t));const e={};for(let r in n)e[r]=t.action(n[r]);return e}const mt=t=>t;function bt(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mt,r=arguments.length>2?arguments[2]:void 0;const[o,u]=(0,t.useState)((()=>e(n.getState())));(0,t.useEffect)((()=>(0,yt.subscribeTo)(n,e,u)),[n,e]);let i={};return r&&(i=(0,t.useMemo)((()=>_t(n,r)),[n,r])),{...o,...i}}function wt(t,n){return bt(t,mt,n)}function xt(t,n,e,r){return new(e||(e=Promise))((function(o,u){function i(t){try{c(r.next(t))}catch(t){u(t)}}function a(t){try{c(r.throw(t))}catch(t){u(t)}}function c(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(i,a)}c((r=r.apply(t,n||[])).next())}))}function Et(t,n){var e,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=n.call(t,i)}catch(t){u=[6,t],r=0}finally{e=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}var St,Ct=function(){},Rt=Ct(),Ot=Object,jt=function(t){return t===Rt},Pt=function(t){return"function"==typeof t},kt=function(t,n){return Ot.assign({},t,n)},At="undefined",Lt=function(){return typeof window!=At},Tt=new WeakMap,It=0,Ut=function(t){var n,e,r=typeof t,o=t&&t.constructor,u=o==Date;if(Ot(t)!==t||u||o==RegExp)n=u?t.toJSON():"symbol"==r?t.toString():"string"==r?JSON.stringify(t):""+t;else{if(n=Tt.get(t))return n;if(n=++It+"~",Tt.set(t,n),o==Array){for(n="@",e=0;e<t.length;e++)n+=Ut(t[e])+",";Tt.set(t,n)}if(o==Ot){n="#";for(var i=Ot.keys(t).sort();!jt(e=i.pop());)jt(t[e])||(n+=e+":"+Ut(t[e])+",");Tt.set(t,n)}}return n},Mt=!0,Dt=Lt(),Nt=typeof document!=At,Bt=Dt&&window.addEventListener?window.addEventListener.bind(window):Ct,zt=Nt?document.addEventListener.bind(document):Ct,Wt=Dt&&window.removeEventListener?window.removeEventListener.bind(window):Ct,Ft=Nt?document.removeEventListener.bind(document):Ct,$t={isOnline:function(){return Mt},isVisible:function(){var t=Nt&&document.visibilityState;return jt(t)||"hidden"!==t}},Vt={initFocus:function(t){return zt("visibilitychange",t),Bt("focus",t),function(){Ft("visibilitychange",t),Wt("focus",t)}},initReconnect:function(t){var n=function(){Mt=!0,t()},e=function(){Mt=!1};return Bt("online",n),Bt("offline",e),function(){Wt("online",n),Wt("offline",e)}}},qt=!Lt()||"Deno"in window,Gt=qt?t.useEffect:t.useLayoutEffect,Zt="undefined"!=typeof navigator&&navigator.connection,Ht=!qt&&Zt&&(["slow-2g","2g"].includes(Zt.effectiveType)||Zt.saveData),Kt=function(t){if(Pt(t))try{t=t()}catch(n){t=""}var n=[].concat(t);return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?Ut(t):"",n,t?"$swr$"+t:""]},Jt=new WeakMap,Yt=function(t,n,e,r,o,u,i){void 0===i&&(i=!0);var a=Jt.get(t),c=a[0],f=a[1],s=a[3],l=c[n],p=f[n];if(i&&p)for(var h=0;h<p.length;++h)p[h](e,r,o);return u&&(delete s[n],l&&l[0])?l[0](2).then((function(){return t.get(n)})):t.get(n)},Qt=0,Xt=function(){return++Qt},tn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return xt(void 0,void 0,void 0,(function(){var n,e,r,o,u,i,a,c,f,s,l,p,h,d,v,g,y,_,m,b;return Et(this,(function(w){switch(w.label){case 0:if(n=t[0],e=t[1],r=t[2],o=t[3],i=!!jt((u="boolean"==typeof o?{revalidate:o}:o||{}).populateCache)||u.populateCache,a=!1!==u.revalidate,c=!1!==u.rollbackOnError,f=u.optimisticData,s=Kt(e),l=s[0],p=s[2],!l)return[2];if(h=Jt.get(n),d=h[2],t.length<3)return[2,Yt(n,l,n.get(l),Rt,Rt,a,!0)];if(v=r,y=Xt(),d[l]=[y,0],_=!jt(f),m=n.get(l),_&&(n.set(l,f),Yt(n,l,f)),Pt(v))try{v=v(n.get(l))}catch(t){g=t}return v&&Pt(v.then)?[4,v.catch((function(t){g=t}))]:[3,2];case 1:if(v=w.sent(),y!==d[l][0]){if(g)throw g;return[2,v]}g&&_&&c&&(i=!0,v=m,n.set(l,m)),w.label=2;case 2:return i&&(g||(Pt(i)&&(v=i(v,m)),n.set(l,v)),n.set(p,kt(n.get(p),{error:g}))),d[l][1]=Xt(),[4,Yt(n,l,v,g,Rt,a,!!i)];case 3:if(b=w.sent(),g)throw g;return[2,i?b:v]}}))}))},nn=function(t,n){for(var e in t)t[e][0]&&t[e][0](n)},en=function(t,n){if(!Jt.has(t)){var e=kt(Vt,n),r={},o=tn.bind(Rt,t),u=Ct;if(Jt.set(t,[r,{},{},{},o]),!qt){var i=e.initFocus(setTimeout.bind(Rt,nn.bind(Rt,r,0))),a=e.initReconnect(setTimeout.bind(Rt,nn.bind(Rt,r,1)));u=function(){i&&i(),a&&a(),Jt.delete(t)}}return[t,o,u]}return[t,Jt.get(t)[4]]},rn=en(new Map),on=rn[0],un=rn[1],an=kt({onLoadingSlow:Ct,onSuccess:Ct,onError:Ct,onErrorRetry:function(t,n,e,r,o){var u=e.errorRetryCount,i=o.retryCount,a=~~((Math.random()+.5)*(1<<(i<8?i:8)))*e.errorRetryInterval;!jt(u)&&i>u||setTimeout(r,a,o)},onDiscarded:Ct,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Ht?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:Ht?5e3:3e3,compare:function(t,n){return Ut(t)==Ut(n)},isPaused:function(){return!1},cache:on,mutate:un,fallback:{}},$t),cn=function(t,n){var e=kt(t,n);if(n){var r=t.use,o=t.fallback,u=n.use,i=n.fallback;r&&u&&(e.use=r.concat(u)),o&&i&&(e.fallback=kt(o,i))}return e},fn=(0,t.createContext)({}),sn=function(t){return Pt(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(null===t[1]?t[2]:t[1])||{}]},ln=function(){return kt(an,(0,t.useContext)(fn))},pn=function(t,n,e){var r=n[t]||(n[t]=[]);return r.push(e),function(){var t=r.indexOf(e);t>=0&&(r[t]=r[r.length-1],r.pop())}},hn={dedupe:!0},dn=(Ot.defineProperty((function(n){var e=n.value,r=cn((0,t.useContext)(fn),e),o=e&&e.provider,u=(0,t.useState)((function(){return o?en(o(r.cache||on),e):Rt}))[0];return u&&(r.cache=u[0],r.mutate=u[1]),Gt((function(){return u?u[2]:Rt}),[]),(0,t.createElement)(fn.Provider,kt(n,{value:r}))}),"default",{value:an}),St=function(n,e,r){var o=r.cache,u=r.compare,i=r.fallbackData,a=r.suspense,c=r.revalidateOnMount,f=r.refreshInterval,s=r.refreshWhenHidden,l=r.refreshWhenOffline,p=Jt.get(o),h=p[0],d=p[1],v=p[2],g=p[3],y=Kt(n),_=y[0],m=y[1],b=y[2],w=(0,t.useRef)(!1),x=(0,t.useRef)(!1),E=(0,t.useRef)(_),S=(0,t.useRef)(e),C=(0,t.useRef)(r),R=function(){return C.current},O=function(){return R().isVisible()&&R().isOnline()},j=function(t){return o.set(b,kt(o.get(b),t))},P=o.get(_),k=jt(i)?r.fallback[_]:i,A=jt(P)?k:P,L=o.get(b)||{},T=L.error,I=!w.current,U=function(){return I&&!jt(c)?c:!R().isPaused()&&(a?!jt(A):jt(A)||r.revalidateIfStale)},M=!(!_||!e)&&(!!L.isValidating||I&&U()),D=function(n,e){var r=(0,t.useState)({})[1],o=(0,t.useRef)(n),u=(0,t.useRef)({data:!1,error:!1,isValidating:!1}),i=(0,t.useCallback)((function(t){var n=!1,i=o.current;for(var a in t){var c=a;i[c]!==t[c]&&(i[c]=t[c],u.current[c]&&(n=!0))}n&&!e.current&&r({})}),[]);return Gt((function(){o.current=n})),[o,u.current,i]}({data:A,error:T,isValidating:M},x),N=D[0],B=D[1],z=D[2],W=(0,t.useCallback)((function(t){return xt(void 0,void 0,void 0,(function(){var n,e,i,a,c,f,s,l,p,h,d,y,b;return Et(this,(function(C){switch(C.label){case 0:if(n=S.current,!_||!n||x.current||R().isPaused())return[2,!1];a=!0,c=t||{},f=!g[_]||!c.dedupe,s=function(){return!x.current&&_===E.current&&w.current},l=function(){var t=g[_];t&&t[1]===i&&delete g[_]},p={isValidating:!1},h=function(){j({isValidating:!1}),s()&&z(p)},j({isValidating:!0}),z({isValidating:!0}),C.label=1;case 1:return C.trys.push([1,3,,4]),f&&(Yt(o,_,N.current.data,N.current.error,!0),r.loadingTimeout&&!o.get(_)&&setTimeout((function(){a&&s()&&R().onLoadingSlow(_,r)}),r.loadingTimeout),g[_]=[n.apply(void 0,m),Xt()]),b=g[_],e=b[0],i=b[1],[4,e];case 2:return e=C.sent(),f&&setTimeout(l,r.dedupingInterval),g[_]&&g[_][1]===i?(j({error:Rt}),p.error=Rt,d=v[_],!jt(d)&&(i<=d[0]||i<=d[1]||0===d[1])?(h(),f&&s()&&R().onDiscarded(_),[2,!1]):(u(N.current.data,e)?p.data=N.current.data:p.data=e,u(o.get(_),e)||o.set(_,e),f&&s()&&R().onSuccess(e,_,r),[3,4])):(f&&s()&&R().onDiscarded(_),[2,!1]);case 3:return y=C.sent(),l(),R().isPaused()||(j({error:y}),p.error=y,f&&s()&&(R().onError(y,_,r),("boolean"==typeof r.shouldRetryOnError&&r.shouldRetryOnError||Pt(r.shouldRetryOnError)&&r.shouldRetryOnError(y))&&O()&&R().onErrorRetry(y,_,r,W,{retryCount:(c.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return a=!1,h(),s()&&f&&Yt(o,_,p.data,p.error,!1),[2,!0]}}))}))}),[_]),F=(0,t.useCallback)(tn.bind(Rt,o,(function(){return E.current})),[]);if(Gt((function(){S.current=e,C.current=r})),Gt((function(){if(_){var t=_!==E.current,n=W.bind(Rt,hn),e=0,r=pn(_,d,(function(t,n,e){z(kt({error:n,isValidating:e},u(N.current.data,t)?Rt:{data:t}))})),o=pn(_,h,(function(t){if(0==t){var r=Date.now();R().revalidateOnFocus&&r>e&&O()&&(e=r+R().focusThrottleInterval,n())}else if(1==t)R().revalidateOnReconnect&&O()&&n();else if(2==t)return W()}));return x.current=!1,E.current=_,w.current=!0,t&&z({data:A,error:T,isValidating:M}),U()&&(jt(A)||qt?n():(i=n,Lt()&&typeof window.requestAnimationFrame!=At?window.requestAnimationFrame(i):setTimeout(i,1))),function(){x.current=!0,r(),o()}}var i}),[_,W]),Gt((function(){var t;function n(){var n=Pt(f)?f(A):f;n&&-1!==t&&(t=setTimeout(e,n))}function e(){N.current.error||!s&&!R().isVisible()||!l&&!R().isOnline()?n():W(hn).then(n)}return n(),function(){t&&(clearTimeout(t),t=-1)}}),[f,s,l,W]),(0,t.useDebugValue)(A),a&&jt(A)&&_)throw S.current=e,C.current=r,x.current=!1,jt(T)?W(hn):T;return{mutate:F,get data(){return B.data=!0,A},get error(){return B.error=!0,T},get isValidating(){return B.isValidating=!0,M}}},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=ln(),r=sn(t),o=r[0],u=r[1],i=r[2],a=cn(e,i),c=St,f=a.use;if(f)for(var s=f.length;s-- >0;)c=f[s](c);return c(o,u||a.fetcher,a)}),vn=p(688),gn=p(124),yn=p.n(gn);function _n(t){const{data:n,error:e,mutate:r,isValidating:o}=dn(`/ws/rest/v1/visit?patient=${t}&v=${Y.defaultVisitCustomRepresentation}&includeInactive=false`,Y.openmrsFetch);return{error:e,mutate:r,isValidating:o,currentVisit:n?.data.results.find((t=>null===t.stopDatetime&&(0,vn.default)(t.startDatetime).isToday()))??null}}function mn(){const[n,e]=(0,t.useState)([]);return(0,t.useEffect)((()=>{const t=(0,Y.getVisitTypes)().subscribe((t=>{e(t)}),(t=>console.error(t)));return()=>t.unsubscribe()}),[]),n}function bn(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const[r,o]=(0,t.useState)(1),u=(0,t.useMemo)((()=>Math.max(1,Math.ceil(n.length/e))),[n.length,e]),i=(0,t.useMemo)((()=>{const t=(r-1)*e,o=(r+0)*e;return n.slice(t,o)}),[n,r,e]);return{results:i,totalPages:u,currentPage:r,paginated:n.length>e,showNextButton:r<u,showPreviousButton:r>1,goTo(t){o(Math.max(1,Math.min(u,t)))},goToNext(){r<u&&o(r+1)},goToPrevious(){r>1&&o(r-1)}}}vn.default.extend(yn())})(),h})())}}}));
3
3
  //# sourceMappingURL=openmrs-esm-react-utils.js.map