@openmrs/esm-form-engine-app 12.3.5-pre.12337 → 12.3.5-pre.12341

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/810.js CHANGED
@@ -1,6 +1,6 @@
1
- (globalThis.webpackChunk_openmrs_esm_form_engine_app=globalThis.webpackChunk_openmrs_esm_form_engine_app||[]).push([["810"],{85602(e){e.exports=function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}},44397(e){e.exports=function(e,t,n){var r=t.prototype,o=function(e){var t=e.date,o=e.utc,i={};if(!(null===t||t instanceof Date||t instanceof Array||r.$utils().u(t)||"Object"!==t.constructor.name)){if(!Object.keys(t).length)return new Date;var a=o?n.utc():n();Object.keys(t).forEach(function(e){var n;i["date"===(n=r.$utils().p(e))?"day":n]=t[e]});var s=i.day||(i.year||i.month>=0?1:a.date()),l=i.year||a.year(),u=i.month>=0?i.month:i.year||i.day?0:a.month(),c=i.hour||0,d=i.minute||0,f=i.second||0,p=i.millisecond||0;return o?new Date(Date.UTC(l,u,s,c,d,f,p)):new Date(l,u,s,c,d,f,p)}return t},i=r.parse;r.parse=function(e){e.date=o.bind(this)(e),i.bind(this)(e)};var a=r.set,s=r.add,l=r.subtract,u=function(e,t,n,r){void 0===r&&(r=1);var o=Object.keys(t),i=this;return o.forEach(function(n){i=e.bind(i)(t[n]*r,n)}),i};r.set=function(e,t){return t=void 0===t?e:t,"Object"===e.constructor.name?u.bind(this)(function(e,t){return a.bind(this)(t,e)},t,e):a.bind(this)(e,t)},r.add=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t):s.bind(this)(e,t)},r.subtract=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t,-1):l.bind(this)(e,t)}}},57657(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,o,i){var a=o.prototype;i.utc=function(e){var t={date:e,utc:!0,args:arguments};return new o(t)},a.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var u=a.utcOffset;a.utcOffset=function(r,o){var i=this.$utils().u;if(i(r))return this.$u?0:i(this.$offset)?u.call(this):this.$offset;if("string"==typeof r&&null===(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var o=(""+r[0]).match(n)||["-",0,0],i=o[0],a=60*o[1]+ +o[2];return 0===a?0:"+"===i?a:-a}(r)))return this;var a=16>=Math.abs(r)?60*r:r,s=this;if(o)return s.$offset=a,s.$u=0===r,s;if(0!==r){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+l,e)).$offset=a,s.$x.$localOffset=l}else s=this.utc();return s};var c=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var f=a.diff;a.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),o=i(e).local();return f.call(r,o,t,n)}}}()},35570(e,t,n){!function(t){"use strict";var r=n(19109);function o(e){return function(t,n){return"object"==typeof t&&(n=t,t=null),null==t&&(t=new Date().toString()),n||(n={}),e.call(this,t,n)}}var i=e.exports={generate:o(function(e,t){return new r(e,t)})};t&&(t.fn.geopattern=o(function(e,n){return this.each(function(){var r=t(this).attr("data-title-sha");r&&(n=t.extend({hash:r},n));var o=i.generate(e,n);t(this).css("background-image",o.toDataUrl())})}))}("u">typeof jQuery?jQuery:null)},51812(e){"use strict";e.exports={hex2rgb:function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,n,r){return t+t+n+n+r+r});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},rgb2hex:function(e){return"#"+["r","g","b"].map(function(t){return("0"+e[t].toString(16)).slice(-2)}).join("")},rgb2hsl:function(e){var t,n,r=e.r,o=e.g,i=e.b,a=Math.max(r/=255,o/=255,i/=255),s=Math.min(r,o,i),l=(a+s)/2;if(a===s)t=n=0;else{var u=a-s;switch(n=l>.5?u/(2-a-s):u/(a+s),a){case r:t=(o-i)/u+6*(o<i);break;case o:t=(i-r)/u+2;break;case i:t=(r-o)/u+4}t/=6}return{h:t,s:n,l:l}},hsl2rgb:function(e){function t(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var n,r,o,i=e.h,a=e.s,s=e.l;if(0===a)n=r=o=s;else{var l=s<.5?s*(1+a):s+a-s*a,u=2*s-l;n=t(u,l,i+1/3),r=t(u,l,i),o=t(u,l,i-1/3)}return{r:Math.round(255*n),g:Math.round(255*r),b:Math.round(255*o)}},rgb2rgbString:function(e){return"rgb("+[e.r,e.g,e.b].join(",")+")"}}},19109(e,t,n){"use strict";var r=n(64751),o=n(51812),i=n(32742),a=n(83153),s={baseColor:"#933c3c"},l=["octogons","overlappingCircles","plusSigns","xes","sineWaves","hexagons","overlappingRings","plaid","triangles","squares","concentricCircles","diamonds","tessellation","nestedSquares","mosaicSquares","chevrons"],u="#000";function c(e,t,n){return parseInt(e.substr(t,n||1),16)}function d(e,t,n,r,o){return(parseFloat(e)-t)*(o-r)/(n-t)+r}function f(e){return e%2==0?"#ddd":"#222"}function p(e){return d(e,0,15,.02,.15)}var h=e.exports=function(e,t){return this.opts=r({},s,t),this.hash=t.hash||i(e),this.svg=new a,this.generateBackground(),this.generatePattern(),this};function m(e){return[[e,0,e,3*e],[0,e,3*e,e]]}function y(e){return[0,0,e,e,0,e,0,0].join(",")}function g(e,t,n,r,o){var i=y(r),a=p(o[0]),s=f(o[0]),l={stroke:u,"stroke-opacity":.02,"fill-opacity":a,fill:s};e.polyline(i,l).transform({translate:[t+r,n],scale:[-1,1]}),e.polyline(i,l).transform({translate:[t+r,n+2*r],scale:[1,-1]}),l={stroke:u,"stroke-opacity":.02,"fill-opacity":a=p(o[1]),fill:s=f(o[1])},e.polyline(i,l).transform({translate:[t+r,n+2*r],scale:[-1,-1]}),e.polyline(i,l).transform({translate:[t+r,n],scale:[1,1]})}function b(e,t,n,r,o){var i=p(o),a=f(o),s=y(r),l={stroke:u,"stroke-opacity":.02,"fill-opacity":i,fill:a};e.polyline(s,l).transform({translate:[t,n+r],scale:[1,-1]}),e.polyline(s,l).transform({translate:[t+2*r,n+r],scale:[-1,-1]}),e.polyline(s,l).transform({translate:[t,n+r],scale:[1,1]}),e.polyline(s,l).transform({translate:[t+2*r,n+r],scale:[-1,1]})}h.prototype.toSvg=function(){return this.svg.toString()},h.prototype.toString=function(){return this.toSvg()},h.prototype.toBase64=function(){var e=this.toSvg();return"u">typeof window&&"function"==typeof window.btoa?window.btoa(e):new Buffer(e).toString("base64")},h.prototype.toDataUri=function(){return"data:image/svg+xml;base64,"+this.toBase64()},h.prototype.toDataUrl=function(){return'url("'+this.toDataUri()+'")'},h.prototype.generateBackground=function(){var e,t,n,r;this.opts.color?n=o.hex2rgb(this.opts.color):(t=d(c(this.hash,14,3),0,4095,0,359),r=c(this.hash,17),(e=o.rgb2hsl(o.hex2rgb(this.opts.baseColor))).h=(360*e.h-t+360)%360/360,r%2==0?e.s=Math.min(1,(100*e.s+r)/100):e.s=Math.max(0,(100*e.s-r)/100),n=o.hsl2rgb(e)),this.color=o.rgb2hex(n),this.svg.rect(0,0,"100%","100%",{fill:o.rgb2rgbString(n)})},h.prototype.generatePattern=function(){var e=this.opts.generator;if(e){if(0>l.indexOf(e))throw Error("The generator "+e+" does not exist.")}else e=l[c(this.hash,20)];return this["geo"+e.slice(0,1).toUpperCase()+e.slice(1)]()},h.prototype.geoHexagons=function(){var e,t,n,r,o,i,a,s,l,h=d(c(this.hash,0),0,15,8,60),m=h*Math.sqrt(3),y=2*h,g=(s=h/2,[0,l=Math.sin(60*Math.PI/180)*h,s,0,s+h,0,2*h,l,s+h,2*l,s,2*l,0,l].join(","));for(this.svg.setWidth(3*y+3*h),this.svg.setHeight(6*m),t=0,a=0;a<6;a++)for(i=0;i<6;i++)o=c(this.hash,t),e=i%2==0?a*m:a*m+m/2,n=p(o),r={fill:f(o),"fill-opacity":n,stroke:u,"stroke-opacity":.02},this.svg.polyline(g,r).transform({translate:[i*h*1.5-y/2,e-m/2]}),0===i&&this.svg.polyline(g,r).transform({translate:[6*h*1.5-y/2,e-m/2]}),0===a&&(e=i%2==0?6*m:6*m+m/2,this.svg.polyline(g,r).transform({translate:[i*h*1.5-y/2,e-m/2]})),0===i&&0===a&&this.svg.polyline(g,r).transform({translate:[6*h*1.5-y/2,5*m+m/2]}),t++},h.prototype.geoSineWaves=function(){var e,t,n,r,o,i,a,s=Math.floor(d(c(this.hash,0),0,15,100,400)),l=Math.floor(d(c(this.hash,1),0,15,30,100)),u=Math.floor(d(c(this.hash,2),0,15,3,30));for(this.svg.setWidth(s),this.svg.setHeight(36*u),t=0;t<36;t++)n=p(i=c(this.hash,t)),e=f(i),a=s/4*.7,o={fill:"none",stroke:e,opacity:n,"stroke-width":""+u+"px"},r="M0 "+l+" C "+a+" 0, "+(s/2-a)+" 0, "+s/2+" "+l+" S "+(s-a)+" "+2*l+", "+s+" "+l+" S "+(1.5*s-a)+" 0, "+1.5*s+", "+l,this.svg.path(r,o).transform({translate:[-s/4,u*t-1.5*l]}),this.svg.path(r,o).transform({translate:[-s/4,u*t-1.5*l+36*u]})},h.prototype.geoChevrons=function(){var e,t,n,r,o,i,a,s=d(c(this.hash,0),0,15,30,80),l=d(c(this.hash,0),0,15,30,80),h=(e=.66*l,[[0,0,s/2,l-e,s/2,l,0,e,0,0],[s/2,l-e,s,0,s,e,s/2,l,s/2,l-e]].map(function(e){return e.join(",")}));for(this.svg.setWidth(6*s),this.svg.setHeight(6*l*.66),t=0,a=0;a<6;a++)for(i=0;i<6;i++)n=p(o=c(this.hash,t)),r={stroke:u,"stroke-opacity":.02,fill:f(o),"fill-opacity":n,"stroke-width":1},this.svg.group(r).transform({translate:[i*s,a*l*.66-l/2]}).polyline(h).end(),0===a&&this.svg.group(r).transform({translate:[i*s,6*l*.66-l/2]}).polyline(h).end(),t+=1},h.prototype.geoPlusSigns=function(){var e,t,n,r,o,i,a,s,l=d(c(this.hash,0),0,15,10,25),h=3*l,y=m(l);for(this.svg.setWidth(12*l),this.svg.setHeight(12*l),n=0,s=0;s<6;s++)for(a=0;a<6;a++)r=p(i=c(this.hash,n)),t=f(i),e=+(s%2!=0),o={fill:t,stroke:u,"stroke-opacity":.02,"fill-opacity":r},this.svg.group(o).transform({translate:[a*h-a*l+e*l-l,s*h-s*l-h/2]}).rect(y).end(),0===a&&this.svg.group(o).transform({translate:[4*h-a*l+e*l-l,s*h-s*l-h/2]}).rect(y).end(),0===s&&this.svg.group(o).transform({translate:[a*h-a*l+e*l-l,4*h-s*l-h/2]}).rect(y).end(),0===a&&0===s&&this.svg.group(o).transform({translate:[4*h-a*l+e*l-l,4*h-s*l-h/2]}).rect(y).end(),n++},h.prototype.geoXes=function(){var e,t,n,r,o,i,a,s=d(c(this.hash,0),0,15,10,25),l=m(s),u=3*s*.943;for(this.svg.setWidth(3*u),this.svg.setHeight(3*u),t=0,a=0;a<6;a++)for(i=0;i<6;i++)n=p(o=c(this.hash,t)),e=i%2==0?a*u-.5*u:a*u-.5*u+u/4,r={fill:f(o),opacity:n},this.svg.group(r).transform({translate:[i*u/2-u/2,e-a*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===i&&this.svg.group(r).transform({translate:[6*u/2-u/2,e-a*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===a&&(e=i%2==0?6*u-u/2:6*u-u/2+u/4,this.svg.group(r).transform({translate:[i*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end()),5===a&&this.svg.group(r).transform({translate:[i*u/2-u/2,e-11*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===i&&0===a&&this.svg.group(r).transform({translate:[6*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),t++},h.prototype.geoOverlappingCircles=function(){var e,t,n,r,o,i,a=d(c(this.hash,0),0,15,25,200)/2;for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),e=0,i=0;i<6;i++)for(o=0;o<6;o++)t=p(r=c(this.hash,e)),n={fill:f(r),opacity:t},this.svg.circle(o*a,i*a,a,n),0===o&&this.svg.circle(6*a,i*a,a,n),0===i&&this.svg.circle(o*a,6*a,a,n),0===o&&0===i&&this.svg.circle(6*a,6*a,a,n),e++},h.prototype.geoOctogons=function(){var e,t,n,r,o,i,a,s=d(c(this.hash,0),0,15,10,60),l=[e=.33*s,0,s-e,0,s,e,s,s-e,s-e,s,e,s,0,s-e,0,e,e,0].join(",");for(this.svg.setWidth(6*s),this.svg.setHeight(6*s),n=0,a=0;a<6;a++)for(i=0;i<6;i++)r=p(o=c(this.hash,n)),t=f(o),this.svg.polyline(l,{fill:t,"fill-opacity":r,stroke:u,"stroke-opacity":.02}).transform({translate:[i*s,a*s]}),n+=1},h.prototype.geoSquares=function(){var e,t,n,r,o,i,a=d(c(this.hash,0),0,15,10,60);for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),t=0,i=0;i<6;i++)for(o=0;o<6;o++)n=p(r=c(this.hash,t)),e=f(r),this.svg.rect(o*a,i*a,a,a,{fill:e,"fill-opacity":n,stroke:u,"stroke-opacity":.02}),t+=1},h.prototype.geoConcentricCircles=function(){var e,t,n,r,o,i,a=d(c(this.hash,0),0,15,10,60),s=a/5;for(this.svg.setWidth((a+s)*6),this.svg.setHeight((a+s)*6),t=0,i=0;i<6;i++)for(o=0;o<6;o++)n=p(r=c(this.hash,t)),e=f(r),this.svg.circle(o*a+o*s+(a+s)/2,i*a+i*s+(a+s)/2,a/2,{fill:"none",stroke:e,opacity:n,"stroke-width":s+"px"}),n=p(r=c(this.hash,39-t)),e=f(r),this.svg.circle(o*a+o*s+(a+s)/2,i*a+i*s+(a+s)/2,a/4,{fill:e,"fill-opacity":n}),t+=1},h.prototype.geoOverlappingRings=function(){var e,t,n,r,o,i,a=d(c(this.hash,0),0,15,10,60),s=a/4;for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),e=0,i=0;i<6;i++)for(o=0;o<6;o++)t=p(r=c(this.hash,e)),n={fill:"none",stroke:f(r),opacity:t,"stroke-width":s+"px"},this.svg.circle(o*a,i*a,a-s/2,n),0===o&&this.svg.circle(6*a,i*a,a-s/2,n),0===i&&this.svg.circle(o*a,6*a,a-s/2,n),0===o&&0===i&&this.svg.circle(6*a,6*a,a-s/2,n),e+=1},h.prototype.geoTriangles=function(){var e,t,n,r,o,i,a,s,l=d(c(this.hash,0),0,15,15,80),h=l/2*Math.sqrt(3),m=[s=l/2,0,l,h,0,h,s,0].join(",");for(this.svg.setWidth(3*l),this.svg.setHeight(6*h),e=0,a=0;a<6;a++)for(i=0;i<6;i++)t=p(o=c(this.hash,e)),r={fill:f(o),"fill-opacity":t,stroke:u,"stroke-opacity":.02},n=a%2==0?180*(i%2==0):180*(i%2!=0),this.svg.polyline(m,r).transform({translate:[i*l*.5-l/2,h*a],rotate:[n,l/2,h/2]}),0===i&&this.svg.polyline(m,r).transform({translate:[6*l*.5-l/2,h*a],rotate:[n,l/2,h/2]}),e+=1},h.prototype.geoDiamonds=function(){var e,t,n,r,o,i,a,s=d(c(this.hash,0),0,15,10,50),l=d(c(this.hash,1),0,15,10,50),h=[s/2,0,s,l/2,s/2,l,0,l/2].join(",");for(this.svg.setWidth(6*s),this.svg.setHeight(3*l),t=0,a=0;a<6;a++)for(i=0;i<6;i++)n=p(o=c(this.hash,t)),r={fill:f(o),"fill-opacity":n,stroke:u,"stroke-opacity":.02},e=a%2==0?0:s/2,this.svg.polyline(h,r).transform({translate:[i*s-s/2+e,l/2*a-l/2]}),0===i&&this.svg.polyline(h,r).transform({translate:[6*s-s/2+e,l/2*a-l/2]}),0===a&&this.svg.polyline(h,r).transform({translate:[i*s-s/2+e,l/2*6-l/2]}),0===i&&0===a&&this.svg.polyline(h,r).transform({translate:[6*s-s/2+e,l/2*6-l/2]}),t+=1},h.prototype.geoNestedSquares=function(){var e,t,n,r,o,i,a=d(c(this.hash,0),0,15,4,12),s=7*a;for(this.svg.setWidth((s+a)*6+6*a),this.svg.setHeight((s+a)*6+6*a),e=0,i=0;i<6;i++)for(o=0;o<6;o++)t=p(r=c(this.hash,e)),n={fill:"none",stroke:f(r),opacity:t,"stroke-width":a+"px"},this.svg.rect(o*s+o*a*2+a/2,i*s+i*a*2+a/2,s,s,n),t=p(r=c(this.hash,39-e)),n={fill:"none",stroke:f(r),opacity:t,"stroke-width":a+"px"},this.svg.rect(o*s+o*a*2+a/2+2*a,i*s+i*a*2+a/2+2*a,3*a,3*a,n),e+=1},h.prototype.geoMosaicSquares=function(){var e,t,n,r=d(c(this.hash,0),0,15,15,50);for(this.svg.setWidth(8*r),this.svg.setHeight(8*r),e=0,n=0;n<4;n++)for(t=0;t<4;t++)t%2==0?n%2==0?b(this.svg,t*r*2,n*r*2,r,c(this.hash,e)):g(this.svg,t*r*2,n*r*2,r,[c(this.hash,e),c(this.hash,e+1)]):n%2==0?g(this.svg,t*r*2,n*r*2,r,[c(this.hash,e),c(this.hash,e+1)]):b(this.svg,t*r*2,n*r*2,r,c(this.hash,e)),e+=1},h.prototype.geoPlaid=function(){var e,t,n,r,o,i,a=0,s=0;for(t=0;t<36;)a+=c(this.hash,t)+5,n=p(i=c(this.hash,t+1)),e=f(i),r=i+5,this.svg.rect(0,a,"100%",r,{opacity:n,fill:e}),a+=r,t+=2;for(t=0;t<36;)s+=c(this.hash,t)+5,n=p(i=c(this.hash,t+1)),e=f(i),o=i+5,this.svg.rect(s,0,o,"100%",{opacity:n,fill:e}),s+=o,t+=2;this.svg.setWidth(s),this.svg.setHeight(a)},h.prototype.geoTessellation=function(){var e,t,n,r,o=d(c(this.hash,0),0,15,5,40),i=o*Math.sqrt(3),a=2*o,s=o/2*Math.sqrt(3),l=[0,0,s,o/2,0,o,0,0].join(","),h=3*o+2*s,m=2*i+2*o;for(this.svg.setWidth(h),this.svg.setHeight(m),e=0;e<20;e++)switch(t=p(r=c(this.hash,e)),n={stroke:u,"stroke-opacity":.02,fill:f(r),"fill-opacity":t,"stroke-width":1},e){case 0:this.svg.rect(-o/2,-o/2,o,o,n),this.svg.rect(h-o/2,-o/2,o,o,n),this.svg.rect(-o/2,m-o/2,o,o,n),this.svg.rect(h-o/2,m-o/2,o,o,n);break;case 1:this.svg.rect(a/2+s,i/2,o,o,n);break;case 2:this.svg.rect(-o/2,m/2-o/2,o,o,n),this.svg.rect(h-o/2,m/2-o/2,o,o,n);break;case 3:this.svg.rect(a/2+s,1.5*i+o,o,o,n);break;case 4:this.svg.polyline(l,n).transform({translate:[o/2,-o/2],rotate:[0,o/2,s/2]}),this.svg.polyline(l,n).transform({translate:[o/2,m- -o/2],rotate:[0,o/2,s/2],scale:[1,-1]});break;case 5:this.svg.polyline(l,n).transform({translate:[h-o/2,-o/2],rotate:[0,o/2,s/2],scale:[-1,1]}),this.svg.polyline(l,n).transform({translate:[h-o/2,m+o/2],rotate:[0,o/2,s/2],scale:[-1,-1]});break;case 6:this.svg.polyline(l,n).transform({translate:[h/2+o/2,i/2]});break;case 7:this.svg.polyline(l,n).transform({translate:[h-h/2-o/2,i/2],scale:[-1,1]});break;case 8:this.svg.polyline(l,n).transform({translate:[h/2+o/2,m-i/2],scale:[1,-1]});break;case 9:this.svg.polyline(l,n).transform({translate:[h-h/2-o/2,m-i/2],scale:[-1,-1]});break;case 10:this.svg.polyline(l,n).transform({translate:[o/2,m/2-o/2]});break;case 11:this.svg.polyline(l,n).transform({translate:[h-o/2,m/2-o/2],scale:[-1,1]});break;case 12:this.svg.rect(0,0,o,o,n).transform({translate:[o/2,o/2],rotate:[-30,0,0]});break;case 13:this.svg.rect(0,0,o,o,n).transform({scale:[-1,1],translate:[-h+o/2,o/2],rotate:[-30,0,0]});break;case 14:this.svg.rect(0,0,o,o,n).transform({translate:[o/2,m/2-o/2-o],rotate:[30,0,o]});break;case 15:this.svg.rect(0,0,o,o,n).transform({scale:[-1,1],translate:[-h+o/2,m/2-o/2-o],rotate:[30,0,o]});break;case 16:this.svg.rect(0,0,o,o,n).transform({scale:[1,-1],translate:[o/2,-m+m/2-o/2-o],rotate:[30,0,o]});break;case 17:this.svg.rect(0,0,o,o,n).transform({scale:[-1,-1],translate:[-h+o/2,-m+m/2-o/2-o],rotate:[30,0,o]});break;case 18:this.svg.rect(0,0,o,o,n).transform({scale:[1,-1],translate:[o/2,-m+o/2],rotate:[-30,0,0]});break;case 19:this.svg.rect(0,0,o,o,n).transform({scale:[-1,-1],translate:[-h+o/2,-m+o/2],rotate:[-30,0,0]})}}},32742(e){"use strict";function t(){var e=0x67452301,t=0xefcdab89,n=0x98badcfe,r=0x10325476,o=0xc3d2e1f0,i=new Uint32Array(80),a=0,s=24,l=0;function u(){for(var s,l,u=16;u<80;u++){var c=i[u-3]^i[u-8]^i[u-14]^i[u-16];i[u]=c<<1|c>>>31}var d=e,f=t,p=n,h=r,m=o;for(u=0;u<80;u++){u<20?(s=h^f&(p^h),l=0x5a827999):u<40?(s=f^p^h,l=0x6ed9eba1):u<60?(s=f&p|h&(f|p),l=0x8f1bbcdc):(s=f^p^h,l=0xca62c1d6);var y=(d<<5|d>>>27)+s+m+l+(0|i[u]);m=h,h=p,p=f<<30|f>>>2,f=d,d=y}for(u=0,e=e+d|0,t=t+f|0,n=n+p|0,r=r+h|0,o=o+m|0,a=0;u<16;u++)i[u]=0}function c(e){i[a]|=(255&e)<<s,s?s-=8:(a++,s=24),16===a&&u()}function d(e){for(var t="",n=28;n>=0;n-=4)t+=(e>>n&15).toString(16);return t}return{update:function(e){if("string"==typeof e){var t=e.length;l+=8*t;for(var n=0;n<t;n++)c(e.charCodeAt(n));return}var r=e.length;l+=8*r;for(var o=0;o<r;o++)c(e[o])},digest:function(){c(128),(a>14||14===a&&s<24)&&u(),a=14,s=24,c(0),c(0),c(l>0xffffffffff?l/0x10000000000:0),c(l>0xffffffff?l/0x100000000:0);for(var i=24;i>=0;i-=8)c(l>>i);return d(e)+d(t)+d(n)+d(r)+d(o)}}}e.exports=function(e){if(void 0===e)return t();var n=t();return n.update(e),n.digest()}},83153(e,t,n){"use strict";var r=n(64751),o=n(57338);function i(){return this.width=100,this.height=100,this.svg=o("svg"),this.context=[],this.setAttributes(this.svg,{xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height}),this}e.exports=i,i.prototype.currentContext=function(){return this.context[this.context.length-1]||this.svg},i.prototype.end=function(){return this.context.pop(),this},i.prototype.currentNode=function(){var e=this.currentContext();return e.lastChild||e},i.prototype.transform=function(e){return this.currentNode().setAttribute("transform",Object.keys(e).map(function(t){return t+"("+e[t].join(",")+")"}).join(" ")),this},i.prototype.setAttributes=function(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})},i.prototype.setWidth=function(e){this.svg.setAttribute("width",Math.floor(e))},i.prototype.setHeight=function(e){this.svg.setAttribute("height",Math.floor(e))},i.prototype.toString=function(){return this.svg.toString()},i.prototype.rect=function(e,t,n,i,a){var s=this;if(Array.isArray(e))return e.forEach(function(e){s.rect.apply(s,e.concat(a))}),this;var l=o("rect");return this.currentContext().appendChild(l),this.setAttributes(l,r({x:e,y:t,width:n,height:i},a)),this},i.prototype.circle=function(e,t,n,i){var a=o("circle");return this.currentContext().appendChild(a),this.setAttributes(a,r({cx:e,cy:t,r:n},i)),this},i.prototype.path=function(e,t){var n=o("path");return this.currentContext().appendChild(n),this.setAttributes(n,r({d:e},t)),this},i.prototype.polyline=function(e,t){var n=this;if(Array.isArray(e))return e.forEach(function(e){n.polyline(e,t)}),this;var i=o("polyline");return this.currentContext().appendChild(i),this.setAttributes(i,r({points:e},t)),this},i.prototype.group=function(e){var t=o("g");return this.currentContext().appendChild(t),this.context.push(t),this.setAttributes(t,r({},e)),this}},57338(e){"use strict";var t=e.exports=function(e){return this instanceof t?(this.tagName=e,this.attributes=Object.create(null),this.children=[],this.lastChild=null,this):new t(e)};t.prototype.appendChild=function(e){return this.children.push(e),this.lastChild=e,this},t.prototype.setAttribute=function(e,t){return this.attributes[e]=t,this},t.prototype.toString=function(){var e=this;return["<",e.tagName,Object.keys(e.attributes).map(function(t){return[" ",t,'="',e.attributes[t],'"'].join("")}).join(""),">",e.children.map(function(e){return e.toString()}).join(""),"</",e.tagName,">"].join("")}},64751(e){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function r(e){if(!e||"[object Object]"!==n.call(e)||e.nodeType||e.setInterval)return!1;var r,o=t.call(e,"constructor"),i=t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!i)return!1;for(r in e);return void 0===r||t.call(e,r)}e.exports=function e(){var t,n,o,i,a,s,l=arguments[0]||{},u=1,c=arguments.length,d=!1;for("boolean"==typeof l&&(d=l,l=arguments[1]||{},u=2),"object"!=typeof l&&"function"!=typeof l&&(l={});u<c;u++)if(null!=(t=arguments[u]))for(n in t)o=l[n],l!==(i=t[n])&&(d&&i&&(r(i)||(a=Array.isArray(i)))?(a?(a=!1,s=o&&Array.isArray(o)?o:[]):s=o&&r(o)?o:{},l[n]=e(d,s,i)):void 0!==i&&(l[n]=i));return l}},82034(e,t){"use strict";t.pathToRegexp=function(e,t={}){let{delimiter:u="/",end:c=!0,sensitive:d=!1,trailing:f=!0}=t,p=[],h="",m=0;!function e(c){if(Array.isArray(c)){for(let t of c)e(t);return}let d="object"==typeof c?c:function(e,t={}){let{encodePath:i=n}=t,l=[...e],u=0;return new a(function t(n){let a=[],c="";function d(){c&&(a.push({type:"text",value:i(c)}),c="")}for(;u<l.length;){let i=l[u++];if(i===n)return d(),a;if("\\"===i){if(u===l.length)throw new s(`Unexpected end after \\ at index ${u}`,e);c+=l[u++];continue}if(":"===i||"*"===i){let t=":"===i?"param":"wildcard",n="";if(r.test(l[u]))do n+=l[u++];while(o.test(l[u]));else if('"'===l[u]){let t=u;for(;u<l.length;){if('"'===l[++u]){u++,t=0;break}"\\"===l[u]&&u++,n+=l[u]}if(t)throw new s(`Unterminated quote at index ${t}`,e)}if(!n)throw new s(`Missing parameter name at index ${u}`,e);d(),a.push({type:t,name:n});continue}if("{"===i){d(),a.push({type:"group",tokens:t("}")});continue}if("}"===i||"("===i||")"===i||"["===i||"]"===i||"+"===i||"?"===i||"!"===i)throw new s(`Unexpected ${i} at index ${u-1}`,e);c+=i}if(n)throw new s(`Unexpected end at index ${u}, expected ${n}`,e);return d(),a}(""),e)}(c,t);!function e(t,n,r,o){for(;n<t.length;){let i=t[n++];if("group"===i.type){let a=r.length;e(i.tokens,0,r,r=>e(t,n,r,o)),r.length=a;continue}r.push(i)}o(r)}(d.tokens,0,[],e=>{if(m>=256)throw new s("Too many path combinations",d.originalPath);m>0&&(h+="|"),h+=function(e,t,n,r){let o="",a="",u="",c=0,d=0,f=0;for(;f<e.length;){let p=e[f++];if("text"===p.type){o+=i(p.value),a+=p.value,2===c&&(u+=p.value),p.value.includes(t)&&(d=0);continue}if("param"===p.type||"wildcard"===p.type){if(c&&!a)throw new s(`Missing text before "${p.name}" ${p.type}`,r);"param"===p.type?(o+=2&d?`(${l(t,a)}+)`:!function(n,r){for(;n<e.length;){let o=e[n++];if(o.type===r)return!0;if("text"===o.type&&o.value.includes(t))break}return!1}(f,"wildcard")?1&d?`(${l(t,a)}+|${i(a)})`:`(${l(t,"")}+)`:`(${l(t,function(t){let n="";for(;t<e.length;){let r=e[t++];if("text"!==r.type)break;n+=r.value}return n}(f))}+)`,d|=c=1):(o+=2&d?`(${l(a,"")}+)`:u?`(${l(u,"")}+|${l(t,"")}+)`:"([^]+)",u="",d|=c=2),n.push(p),a="";continue}throw TypeError(`Unknown token type: ${p.type}`)}return o}(e,u,p,d.originalPath),m++})}(e);let y=`^(?:${h})`;return f&&(y+="(?:"+i(u)+"$)?"),{regexp:new RegExp(y+=c?"$":"(?="+i(u)+"|$)",d?"":"i"),keys:p}};let n=e=>e,r=/^[$_\p{ID_Start}]$/u,o=/^[$\u200c\u200d\p{ID_Continue}]$/u;function i(e){return e.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}class a{constructor(e,t){this.tokens=e,this.originalPath=t}}class s extends TypeError{constructor(e,t){let n=e;t&&(n+=`: ${t}`),super(n+="; visit https://git.new/pathToRegexpError for info"),this.originalPath=t}}function l(e,t){return t.length>e.length?l(t,e):(e===t&&(t=""),t.length>1)?`(?:(?!${i(e)}|${i(t)})[^])`:e.length>1?`(?:(?!${i(e)})[^${i(t)}])`:`[^${i(e+t)}]`}},25873(e,t,n){"use strict";var r=n(43144);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},38513(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(21016);t.AsyncSubject=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t}return o(t,e),t.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),a.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),a.Subscription.EMPTY):e.prototype._subscribe.call(this,t)},t.prototype.next=function(e){this.hasCompleted||(this.value=e,this.hasNext=!0)},t.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},t.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(i.Subject)},8791(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(18860);t.BehaviorSubject=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return o(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(!this.closed)return this._value;throw new a.ObjectUnsubscribedError},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(i.Subject)},1359(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.InnerSubscriber=function(e){function t(t,n,r){var o=e.call(this)||this;return o.parent=t,o.outerValue=n,o.outerIndex=r,o.index=0,o}return o(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(n(77759).Subscriber)},4942(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(34914),i=n(47986),a=n(11673);(r=t.NotificationKind||(t.NotificationKind={})).NEXT="N",r.ERROR="E",r.COMPLETE="C",t.Notification=function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}},e.prototype.accept=function(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){switch(this.kind){case"N":return i.of(this.value);case"E":return a.throwError(this.error);case"C":return o.empty()}throw Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}()},95092(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(21226),o=n(67595),i=n(46713),a=n(27928),s=n(5319);function l(e){if(e||(e=s.config.Promise||Promise),!e)throw Error("no Promise impl found");return e}t.Observable=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,i=o.toSubscriber(e,t,n);if(r?i.add(r.call(i,this.source)):i.add(this.source||s.config.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),s.config.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){s.config.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),r.canReportError(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=l(t))(function(t,r){var o;o=n.subscribe(function(t){try{e(t)}catch(e){r(e),o&&o.unsubscribe()}},r,t)})},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[i.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:a.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=l(e))(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}()},74143(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5319),o=n(59468);t.empty={closed:!0,next:function(e){},error:function(e){if(r.config.useDeprecatedSynchronousErrorHandling)throw e;o.hostReportError(e)},complete:function(){}}},89152(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.OuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.notifyNext=function(e,t,n,r,o){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(n(77759).Subscriber)},20328(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(63792),s=n(21016),l=n(24654),u=n(18860),c=n(43716);t.ReplaySubject=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0);var o=e.call(this)||this;return o.scheduler=r,o._events=[],o._infiniteTimeWindow=!1,o._bufferSize=t<1?1:t,o._windowTime=n<1?1:n,n===1/0?(o._infiniteTimeWindow=!0,o.next=o.nextInfiniteTimeWindow):o.next=o.nextTimeWindow,o}return o(t,e),t.prototype.nextInfiniteTimeWindow=function(t){if(!this.isStopped){var n=this._events;n.push(t),n.length>this._bufferSize&&n.shift()}e.prototype.next.call(this,t)},t.prototype.nextTimeWindow=function(t){this.isStopped||(this._events.push(new d(this._getNow(),t)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){var t,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),o=this.scheduler,i=r.length;if(this.closed)throw new u.ObjectUnsubscribedError;if(this.isStopped||this.hasError?t=s.Subscription.EMPTY:(this.observers.push(e),t=new c.SubjectSubscription(this,e)),o&&e.add(e=new l.ObserveOnSubscriber(e,o)),n)for(var a=0;a<i&&!e.closed;a++)e.next(r[a]);else for(var a=0;a<i&&!e.closed;a++)e.next(r[a].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),t},t.prototype._getNow=function(){return(this.scheduler||a.queue).now()},t.prototype._trimBufferThenGetEvents=function(){for(var e=this._getNow(),t=this._bufferSize,n=this._windowTime,r=this._events,o=r.length,i=0;i<o&&!(e-r[i].time<n);)i++;return o>t&&(i=Math.max(i,o-t)),i>0&&r.splice(0,i),r},t}(i.Subject);var d=function(e,t){this.time=e,this.value=t}},94688(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scheduler=function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(n,t)},e.now=function(){return Date.now()},e}()},71077(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(95092),a=n(77759),s=n(21016),l=n(18860),u=n(43716),c=n(58636),d=function(e){function t(t){var n=e.call(this,t)||this;return n.destination=t,n}return o(t,e),t}(a.Subscriber);t.SubjectSubscriber=d;var f=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return o(t,e),t.prototype[c.rxSubscriber]=function(){return new d(this)},t.prototype.lift=function(e){var t=new p(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].next(e)},t.prototype.error=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new l.ObjectUnsubscribedError;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;r++)n[r].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(!this.closed)return e.prototype._trySubscribe.call(this,t);throw new l.ObjectUnsubscribedError},t.prototype._subscribe=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;return this.hasError?(e.error(this.thrownError),s.Subscription.EMPTY):this.isStopped?(e.complete(),s.Subscription.EMPTY):(this.observers.push(e),new u.SubjectSubscription(this,e))},t.prototype.asObservable=function(){var e=new i.Observable;return e.source=this,e},t.create=function(e,t){return new p(e,t)},t}(i.Observable);t.Subject=f;var p=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return o(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):s.Subscription.EMPTY},t}(f);t.AnonymousSubject=p},43716(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.SubjectSubscription=function(e){function t(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return o(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},t}(n(21016).Subscription)},77759(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(84864),a=n(74143),s=n(21016),l=n(58636),u=n(5319),c=n(59468),d=function(e){function t(n,r,o){var i=e.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=a.empty;break;case 1:if(!n){i.destination=a.empty;break}if("object"==typeof n){n instanceof t?(i.syncErrorThrowable=n.syncErrorThrowable,i.destination=n,n.add(i)):(i.syncErrorThrowable=!0,i.destination=new f(i,n));break}default:i.syncErrorThrowable=!0,i.destination=new f(i,n,r,o)}return i}return o(t,e),t.prototype[l.rxSubscriber]=function(){return this},t.create=function(e,n,r){var o=new t(e,n,r);return o.syncErrorThrowable=!1,o},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(s.Subscription);t.Subscriber=d;var f=function(e){function t(t,n,r,o){var s,l=e.call(this)||this;l._parentSubscriber=t;var u=l;return i.isFunction(n)?s=n:n&&(s=n.next,r=n.error,o=n.complete,n!==a.empty&&(u=Object.create(n),i.isFunction(u.unsubscribe)&&l.add(u.unsubscribe.bind(u)),u.unsubscribe=l.unsubscribe.bind(l))),l._context=u,l._next=s,l._error=r,l._complete=o,l}return o(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;u.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=u.config.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?this.__tryOrSetError(t,this._error,e):this.__tryOrUnsub(this._error,e),this.unsubscribe();else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):c.hostReportError(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;c.hostReportError(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};u.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,n):this.__tryOrUnsub(n),this.unsubscribe()}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),u.config.useDeprecatedSynchronousErrorHandling)throw e;c.hostReportError(e)}},t.prototype.__tryOrSetError=function(e,t,n){if(!u.config.useDeprecatedSynchronousErrorHandling)throw Error("bad call");try{t.call(this._context,n)}catch(t){if(u.config.useDeprecatedSynchronousErrorHandling)return e.syncErrorValue=t,e.syncErrorThrown=!0,!0;return c.hostReportError(t),!0}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(d);t.SafeSubscriber=f},21016(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(80743),o=n(6727),i=n(84864),a=n(11806);function s(e){return e.reduce(function(e,t){return e.concat(t instanceof a.UnsubscriptionError?t.errors:t)},[])}t.Subscription=function(){var e;function t(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return t.prototype.unsubscribe=function(){if(!this.closed){var e,n=this._parentOrParents,l=this._ctorUnsubscribe,u=this._unsubscribe,c=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(var d=0;d<n.length;++d)n[d].remove(this);if(i.isFunction(u)){l&&(this._unsubscribe=void 0);try{u.call(this)}catch(t){e=t instanceof a.UnsubscriptionError?s(t.errors):[t]}}if(r.isArray(c))for(var d=-1,f=c.length;++d<f;){var p=c[d];if(o.isObject(p))try{p.unsubscribe()}catch(t){e=e||[],t instanceof a.UnsubscriptionError?e=e.concat(s(t.errors)):e.push(t)}}if(e)throw new a.UnsubscriptionError(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw Error("unrecognized teardown "+e+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof t){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.push(n),n},t.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},(e=new t).closed=!0,t.EMPTY=e,t}()},5319(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=!1;t.config={Promise:void 0,set useDeprecatedSynchronousErrorHandling(value){value?console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+Error().stack):n&&console.log("RxJS: Back to a better error behavior. Thank you. <3"),n=value},get useDeprecatedSynchronousErrorHandling(){return n}}},75901(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(95092),s=n(41727);t.SimpleInnerSubscriber=function(e){function t(t){var n=e.call(this)||this;return n.parent=t,n}return o(t,e),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(i.Subscriber),t.ComplexInnerSubscriber=function(e){function t(t,n,r){var o=e.call(this)||this;return o.parent=t,o.outerValue=n,o.outerIndex=r,o}return o(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(i.Subscriber),t.SimpleOuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(i.Subscriber),t.ComplexOuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.notifyNext=function(e,t,n,r){this.destination.next(t)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(i.Subscriber),t.innerSubscribe=function(e,t){var n;if(!t.closed){if(e instanceof a.Observable)return e.subscribe(t);try{n=s.subscribeTo(e)(t)}catch(e){t.error(e)}return n}}},27432(e,t,n){"use strict";var r,o,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(71077),s=n(95092),l=n(77759),u=n(21016),c=n(85203),d=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return i(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return!e&&(this._isComplete=!1,(e=this._connection=new u.Subscription).add(this.source.subscribe(new f(this.getSubject(),this))),e.closed&&(this._connection=null,e=u.Subscription.EMPTY)),e},t.prototype.refCount=function(){return c.refCount()(this)},t}(s.Observable);t.ConnectableObservable=d,t.connectableObservableDescriptor={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:(o=d.prototype)._subscribe},_isComplete:{value:o._isComplete,writable:!0},getSubject:{value:o.getSubject},connect:{value:o.connect},refCount:{value:o.refCount}};var f=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return i(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(a.SubjectSubscriber);(function(e){this.connectable=e}).prototype.call=function(e,t){var n=this.connectable;n._refCount++;var r=new p(e,n),o=t.subscribe(r);return r.closed||(r.connection=n.connect()),o};var p=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return i(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(!e){this.connection=null;return}this.connectable=null;var t=e._refCount;if(t<=0||(e._refCount=t-1,t>1)){this.connection=null;return}var n=this.connection,r=e._connection;this.connection=null,r&&(!n||r===n)&&r.unsubscribe()},t}(l.Subscriber)},17563(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(95092),a=n(73766),s=n(19673);t.SubscribeOnObservable=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=a.asap);var o=e.call(this)||this;return o.source=t,o.delayTime=n,o.scheduler=r,(!s.isNumeric(n)||n<0)&&(o.delayTime=0),r&&"function"==typeof r.schedule||(o.scheduler=a.asap),o}return o(t,e),t.create=function(e,n,r){return void 0===n&&(n=0),void 0===r&&(r=a.asap),new t(e,n,r)},t.dispatch=function(e){var t=e.source,n=e.subscriber;return this.add(t.subscribe(n))},t.prototype._subscribe=function(e){var n=this.delayTime,r=this.source;return this.scheduler.schedule(t.dispatch,n,{source:r,subscriber:e})},t}(i.Observable)},92413(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(23935),a=n(80743),s=n(89152),l=n(87778),u=n(67446),c={};t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=void 0,r=void 0;return i.isScheduler(e[e.length-1])&&(r=e.pop()),"function"==typeof e[e.length-1]&&(n=e.pop()),1===e.length&&a.isArray(e[0])&&(e=e[0]),u.fromArray(e,r).lift(new d(n))};var d=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new f(e,this.resultSelector))},e}();t.CombineLatestOperator=d;var f=function(e){function t(t,n){var r=e.call(this,t)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return o(t,e),t.prototype._next=function(e){this.values.push(c),this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(var n=0;n<t;n++){var r=e[n];this.add(l.subscribeToResult(this,r,void 0,n))}}},t.prototype.notifyComplete=function(e){0==(this.active-=1)&&this.destination.complete()},t.prototype.notifyNext=function(e,t,n){var r=this.values,o=r[n],i=this.toRespond?o===c?--this.toRespond:this.toRespond:0;r[n]=t,0===i&&(this.resultSelector?this._tryResultSelector(r):this.destination.next(r.slice()))},t.prototype._tryResultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(s.OuterSubscriber);t.CombineLatestSubscriber=f},99623(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(47986),o=n(60208);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.concatAll()(r.of.apply(void 0,e))}},26691(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(85295),i=n(34914);t.defer=function(e){return new r.Observable(function(t){var n;try{n=e()}catch(e){t.error(e);return}return(n?o.from(n):i.empty()).subscribe(t)})}},34914(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092);t.EMPTY=new r.Observable(function(e){return e.complete()}),t.empty=function(e){var n;return e?(n=e,new r.Observable(function(e){return n.schedule(function(){return e.complete()})})):t.EMPTY}},85295(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(41727),i=n(67670);t.from=function(e,t){return t?i.scheduled(e,t):e instanceof r.Observable?e:new r.Observable(o.subscribeTo(e))}},67446(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(422),i=n(85791);t.fromArray=function(e,t){return t?i.scheduleArray(e,t):new r.Observable(o.subscribeToArray(e))}},33395(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(23935),i=n(80980),a=n(67446);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=1/0,s=null,l=e[e.length-1];return(o.isScheduler(l)?(s=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(n=e.pop())):"number"==typeof l&&(n=e.pop()),null===s&&1===e.length&&e[0]instanceof r.Observable)?e[0]:i.mergeAll(n)(a.fromArray(e,s))}},47986(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(23935),o=n(67446),i=n(85791);t.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return r.isScheduler(n)?(e.pop(),i.scheduleArray(e,n)):o.fromArray(e)}},57894(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(80743),a=n(67446),s=n(89152),l=n(87778);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length)if(!i.isArray(e[0]))return e[0];else e=e[0];return a.fromArray(e,void 0).lift(new u)};var u=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new c(e))},e}();t.RaceOperator=u;var c=function(e){function t(t){var n=e.call(this,t)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return o(t,e),t.prototype._next=function(e){this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{for(var n=0;n<t&&!this.hasFirst;n++){var r=e[n],o=l.subscribeToResult(this,r,void 0,n);this.subscriptions&&this.subscriptions.push(o),this.add(o)}this.observables=null}},t.prototype.notifyNext=function(e,t,n){if(!this.hasFirst){this.hasFirst=!0;for(var r=0;r<this.subscriptions.length;r++)if(r!==n){var o=this.subscriptions[r];o.unsubscribe(),this.remove(o)}this.subscriptions=null}this.destination.next(t)},t}(s.OuterSubscriber);t.RaceSubscriber=c},11673(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092);function o(e){var t=e.error;e.subscriber.error(t)}t.throwError=function(e,t){return new r.Observable(t?function(n){return t.schedule(o,0,{error:e,subscriber:n})}:function(t){return t.error(e)})}},27954(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(86735),i=n(19673),a=n(23935);function s(e){var t=e.index,n=e.period,r=e.subscriber;if(r.next(t),!r.closed){if(-1===n)return r.complete();e.index=t+1,this.schedule(e,n)}}t.timer=function(e,t,n){void 0===e&&(e=0);var l=-1;return i.isNumeric(t)?l=1>Number(t)&&1||Number(t):a.isScheduler(t)&&(n=t),a.isScheduler(n)||(n=o.async),new r.Observable(function(t){var r=i.isNumeric(e)?e:e-n.now();return n.schedule(s,r,{index:0,period:l,subscriber:t})})}},85356(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(67446),a=n(80743),s=n(77759),l=n(78258),u=n(75901);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return"function"==typeof n&&e.pop(),i.fromArray(e,void 0).lift(new c(n))};var c=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.resultSelector))},e}();t.ZipOperator=c;var d=function(e){function t(t,n,r){void 0===r&&(r=Object.create(null));var o=e.call(this,t)||this;return o.resultSelector=n,o.iterators=[],o.active=0,o.resultSelector="function"==typeof n?n:void 0,o}return o(t,e),t.prototype._next=function(e){var t=this.iterators;a.isArray(e)?t.push(new p(e)):"function"==typeof e[l.iterator]?t.push(new f(e[l.iterator]())):t.push(new h(this.destination,this,e))},t.prototype._complete=function(){var e=this.iterators,t=e.length;if(this.unsubscribe(),0===t)return void this.destination.complete();this.active=t;for(var n=0;n<t;n++){var r=e[n];r.stillUnsubscribed?this.destination.add(r.subscribe()):this.active--}},t.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},t.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,n=this.destination,r=0;r<t;r++){var o=e[r];if("function"==typeof o.hasValue&&!o.hasValue())return}for(var i=!1,a=[],r=0;r<t;r++){var o=e[r],s=o.next();if(o.hasCompleted()&&(i=!0),s.done)return void n.complete();a.push(s.value)}this.resultSelector?this._tryresultSelector(a):n.next(a),i&&n.complete()},t.prototype._tryresultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(s.Subscriber);t.ZipSubscriber=d;var f=function(){function e(e){this.iterator=e,this.nextResult=e.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return!!(e&&e.done)},e}(),p=function(){function e(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return e.prototype[l.iterator]=function(){return this},e.prototype.next=function(e){var t=this.index++,n=this.array;return t<this.length?{value:n[t],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),h=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.parent=n,o.observable=r,o.stillUnsubscribed=!0,o.buffer=[],o.isComplete=!1,o}return o(t,e),t.prototype[l.iterator]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e){this.buffer.push(e),this.parent.checkIterators()},t.prototype.subscribe=function(){return u.innerSubscribe(this.observable,new u.SimpleInnerSubscriber(this))},t}(u.SimpleOuterSubscriber)},18780(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.audit=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.durationSelector=n,r.hasValue=!1,r}return o(t,e),t.prototype._next=function(e){if(this.value=e,this.hasValue=!0,!this.throttled){var t=void 0;try{t=(0,this.durationSelector)(e)}catch(e){return this.destination.error(e)}var n=i.innerSubscribe(t,new i.SimpleInnerSubscriber(this));!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}},t.prototype.clearThrottle=function(){var e=this.value,t=this.hasValue,n=this.throttled;n&&(this.remove(n),this.throttled=void 0,n.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))},t.prototype.notifyNext=function(){this.clearThrottle()},t.prototype.notifyComplete=function(){this.clearThrottle()},t}(i.SimpleOuterSubscriber)},13441(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(86735),o=n(18780),i=n(27954);t.auditTime=function(e,t){return void 0===t&&(t=r.async),o.audit(function(){return i.timer(e,t)})}},11853(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.buffer=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.closingNotifier=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.closingNotifier))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.buffer=[],r.add(i.innerSubscribe(n,new i.SimpleInnerSubscriber(r))),r}return o(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype.notifyNext=function(){var e=this.buffer;this.buffer=[],this.destination.next(e)},t}(i.SimpleOuterSubscriber)},77650(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.bufferCount=function(e,t){return void 0===t&&(t=null),function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.bufferSize=e,this.startBufferEvery=t,t&&e!==t?this.subscriberClass=l:this.subscriberClass=s}return e.prototype.call=function(e,t){return t.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.bufferSize=n,r.buffer=[],r}return o(t,e),t.prototype._next=function(e){var t=this.buffer;t.push(e),t.length==this.bufferSize&&(this.destination.next(t),this.buffer=[])},t.prototype._complete=function(){var t=this.buffer;t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},t}(i.Subscriber),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.bufferSize=n,o.startBufferEvery=r,o.buffers=[],o.count=0,o}return o(t,e),t.prototype._next=function(e){var t=this.bufferSize,n=this.startBufferEvery,r=this.buffers,o=this.count;this.count++,o%n==0&&r.push([]);for(var i=r.length;i--;){var a=r[i];a.push(e),a.length===t&&(r.splice(i,1),this.destination.next(a))}},t.prototype._complete=function(){for(var t=this.buffers,n=this.destination;t.length>0;){var r=t.shift();r.length>0&&n.next(r)}e.prototype._complete.call(this)},t}(i.Subscriber)},94360(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(86735),a=n(77759),s=n(23935);t.bufferTime=function(e){var t=arguments.length,n=i.async;s.isScheduler(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],t--);var r=null;t>=2&&(r=arguments[1]);var o=1/0;return t>=3&&(o=arguments[2]),function(t){return t.lift(new l(e,r,o,n))}};var l=function(){function e(e,t,n,r){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),u=function(){this.buffer=[]},c=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;a.bufferTimeSpan=n,a.bufferCreationInterval=r,a.maxBufferSize=o,a.scheduler=i,a.contexts=[];var s=a.openContext();return a.timespanOnly=null==r||r<0,a.timespanOnly?a.add(s.closeAction=i.schedule(d,n,{subscriber:a,context:s,bufferTimeSpan:n})):(a.add(s.closeAction=i.schedule(p,n,{subscriber:a,context:s})),a.add(i.schedule(f,r,{bufferTimeSpan:n,bufferCreationInterval:r,subscriber:a,scheduler:i}))),a}return o(t,e),t.prototype._next=function(e){for(var t,n=this.contexts,r=n.length,o=0;o<r;o++){var i=n[o],a=i.buffer;a.push(e),a.length==this.maxBufferSize&&(t=i)}t&&this.onBufferFull(t)},t.prototype._error=function(t){this.contexts.length=0,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts,n=this.destination;t.length>0;){var r=t.shift();n.next(r.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(e){this.closeContext(e);var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:e,bufferTimeSpan:n};this.add(e.closeAction=this.scheduler.schedule(d,n,r))}},t.prototype.openContext=function(){var e=new u;return this.contexts.push(e),e},t.prototype.closeContext=function(e){this.destination.next(e.buffer);var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},t}(a.Subscriber);function d(e){var t=e.subscriber,n=e.context;n&&t.closeContext(n),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function f(e){var t=e.bufferCreationInterval,n=e.bufferTimeSpan,r=e.subscriber,o=e.scheduler,i=r.openContext();r.closed||(r.add(i.closeAction=o.schedule(p,n,{subscriber:r,context:i})),this.schedule(e,t))}function p(e){var t=e.subscriber,n=e.context;t.closeContext(n)}},43381(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(21016),a=n(87778),s=n(89152);t.bufferToggle=function(e,t){return function(n){return n.lift(new l(e,t))}};var l=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.openings,this.closingSelector))},e}(),u=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.closingSelector=r,o.contexts=[],o.add(a.subscribeToResult(o,n)),o}return o(t,e),t.prototype._next=function(e){for(var t=this.contexts,n=t.length,r=0;r<n;r++)t[r].buffer.push(e)},t.prototype._error=function(t){for(var n=this.contexts;n.length>0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var n=t.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t){e?this.closeBuffer(e):this.openBuffer(t)},t.prototype.notifyComplete=function(e){this.closeBuffer(e.context)},t.prototype.openBuffer=function(e){try{var t=this.closingSelector.call(this,e);t&&this.trySubscribe(t)}catch(e){this._error(e)}},t.prototype.closeBuffer=function(e){var t=this.contexts;if(t&&e){var n=e.buffer,r=e.subscription;this.destination.next(n),t.splice(t.indexOf(e),1),this.remove(r),r.unsubscribe()}},t.prototype.trySubscribe=function(e){var t=this.contexts,n=new i.Subscription,r={buffer:[],subscription:n};t.push(r);var o=a.subscribeToResult(this,e,r);!o||o.closed?this.closeBuffer(r):(o.context=r,this.add(o),n.add(o))},t}(s.OuterSubscriber)},51069(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(21016),a=n(75901);t.bufferWhen=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.closingSelector))},e}(),l=function(e){function t(t,n){var r=e.call(this,t)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return o(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},t.prototype.notifyNext=function(){this.openBuffer()},t.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var e,t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{e=(0,this.closingSelector)()}catch(e){return this.error(e)}t=new i.Subscription,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(a.innerSubscribe(e,new a.SimpleInnerSubscriber(this))),this.subscribing=!1},t}(a.SimpleOuterSubscriber)},85916(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.catchError=function(e){return function(t){var n=new a(e),r=t.lift(n);return n.caught=r}};var a=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.selector,this.caught))},e}(),s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.selector=n,o.caught=r,o}return o(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(t){e.prototype.error.call(this,t);return}this._unsubscribeAndRecycle();var r=new i.SimpleInnerSubscriber(this);this.add(r);var o=i.innerSubscribe(n,r);o!==r&&this.add(o)}},t}(i.SimpleOuterSubscriber)},90239(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(92413);t.combineAll=function(e){return function(t){return t.lift(new r.CombineLatestOperator(e))}}},79397(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(80743),o=n(92413),i=n(85295);t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=null;return"function"==typeof e[e.length-1]&&(n=e.pop()),1===e.length&&r.isArray(e[0])&&(e=e[0].slice()),function(t){return t.lift.call(i.from([t].concat(e)),new o.CombineLatestOperator(n))}}},66255(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(99623);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(r.concat.apply(void 0,[t].concat(e)))}}},60208(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(80980);t.concatAll=function(){return r.mergeAll(1)}},92209(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(60781);t.concatMap=function(e,t){return r.mergeMap(e,t,1)}},83232(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(92209);t.concatMapTo=function(e,t){return r.concatMap(function(){return e},t)}},85476(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.count=function(e){return function(t){return t.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source))},e}(),s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.predicate=n,o.source=r,o.count=0,o.index=0,o}return o(t,e),t.prototype._next=function(e){this.predicate?this._tryPredicate(e):this.count++},t.prototype._tryPredicate=function(e){var t;try{t=this.predicate(e,this.index++,this.source)}catch(e){this.destination.error(e);return}t&&this.count++},t.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},t}(i.Subscriber)},59768(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.debounce=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.durationSelector=n,r.hasValue=!1,r}return o(t,e),t.prototype._next=function(e){try{var t=this.durationSelector.call(this,e);t&&this._tryNext(e,t)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.emitValue(),this.destination.complete()},t.prototype._tryNext=function(e,t){var n=this.durationSubscription;this.value=e,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=i.innerSubscribe(t,new i.SimpleInnerSubscriber(this)))&&!n.closed&&this.add(this.durationSubscription=n)},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){if(this.hasValue){var t=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,e.prototype._next.call(this,t)}},t}(i.SimpleOuterSubscriber)},92661(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(86735);t.debounceTime=function(e,t){return void 0===t&&(t=a.async),function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.dueTime,this.scheduler))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.dueTime=n,o.scheduler=r,o.debouncedSubscription=null,o.lastValue=null,o.hasValue=!1,o}return o(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(u,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(i.Subscriber);function u(e){e.debouncedNext()}},90952(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.defaultIfEmpty=function(e){return void 0===e&&(e=null),function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.defaultValue=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.defaultValue))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.defaultValue=n,r.isEmpty=!0,r}return o(t,e),t.prototype._next=function(e){this.isEmpty=!1,this.destination.next(e)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},t}(i.Subscriber)},17436(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(86735),a=n(66740),s=n(77759),l=n(4942);t.delay=function(e,t){void 0===t&&(t=i.async);var n=a.isDate(e)?e-t.now():Math.abs(e);return function(e){return e.lift(new u(n,t))}};var u=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delay,this.scheduler))},e}(),c=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.delay=n,o.scheduler=r,o.queue=[],o.active=!1,o.errored=!1,o}return o(t,e),t.dispatch=function(e){for(var t=e.source,n=t.queue,r=e.scheduler,o=e.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(o);if(n.length>0){var i=Math.max(0,n[0].time-r.now());this.schedule(e,i)}else this.unsubscribe(),t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.destination.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,n=new d(t.now()+this.delay,e);this.queue.push(n),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(l.Notification.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.scheduleNotification(l.Notification.createComplete()),this.unsubscribe()},t}(s.Subscriber),d=function(e,t){this.time=e,this.notification=t}},41136(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(95092),s=n(89152),l=n(87778);t.delayWhen=function(e,t){return t?function(n){return new d(n,t).lift(new u(e))}:function(t){return t.lift(new u(e))}};var u=function(){function e(e){this.delayDurationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delayDurationSelector))},e}(),c=function(e){function t(t,n){var r=e.call(this,t)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r.index=0,r}return o(t,e),t.prototype.notifyNext=function(e,t,n,r,o){this.destination.next(e),this.removeSubscription(o),this.tryComplete()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype.notifyComplete=function(e){var t=this.removeSubscription(e);t&&this.destination.next(t),this.tryComplete()},t.prototype._next=function(e){var t=this.index++;try{var n=this.delayDurationSelector(e,t);n&&this.tryDelay(n,e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},t.prototype.removeSubscription=function(e){e.unsubscribe();var t=this.delayNotifierSubscriptions.indexOf(e);return -1!==t&&this.delayNotifierSubscriptions.splice(t,1),e.outerValue},t.prototype.tryDelay=function(e,t){var n=l.subscribeToResult(this,e,t);n&&!n.closed&&(this.destination.add(n),this.delayNotifierSubscriptions.push(n))},t.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},t}(s.OuterSubscriber),d=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subscriptionDelay=n,r}return o(t,e),t.prototype._subscribe=function(e){this.subscriptionDelay.subscribe(new f(e,this.source))},t}(a.Observable),f=function(e){function t(t,n){var r=e.call(this)||this;return r.parent=t,r.source=n,r.sourceSubscribed=!1,r}return o(t,e),t.prototype._next=function(e){this.subscribeToSource()},t.prototype._error=function(e){this.unsubscribe(),this.parent.error(e)},t.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},t.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},t}(i.Subscriber)},56051(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.dematerialize=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype._next=function(e){e.observe(this.destination)},t}(i.Subscriber)},85343(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.distinct=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.keySelector,this.flushes))},e}(),s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.keySelector=n,o.values=new Set,r&&o.add(i.innerSubscribe(r,new i.SimpleInnerSubscriber(o))),o}return o(t,e),t.prototype.notifyNext=function(){this.values.clear()},t.prototype.notifyError=function(e){this._error(e)},t.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},t.prototype._useKeySelector=function(e){var t,n=this.destination;try{t=this.keySelector(e)}catch(e){n.error(e);return}this._finalizeNext(t,e)},t.prototype._finalizeNext=function(e,t){var n=this.values;n.has(e)||(n.add(e),this.destination.next(t))},t}(i.SimpleOuterSubscriber);t.DistinctSubscriber=s},88179(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.distinctUntilChanged=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.compare,this.keySelector))},e}(),s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.keySelector=r,o.hasKey=!1,"function"==typeof n&&(o.compare=n),o}return o(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){try{var t,n=this.keySelector;t=n?n(e):e}catch(e){return this.destination.error(e)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,t)}catch(e){return this.destination.error(e)}else this.hasKey=!0;r||(this.key=t,this.destination.next(e))},t}(i.Subscriber)},43670(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(88179);t.distinctUntilKeyChanged=function(e,t){return r.distinctUntilChanged(function(n,r){return t?t(n[e],r[e]):n[e]===r[e]})}},57366(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2519),o=n(64629),i=n(8347),a=n(90952),s=n(85624);t.elementAt=function(e,t){if(e<0)throw new r.ArgumentOutOfRangeError;var n=arguments.length>=2;return function(l){return l.pipe(o.filter(function(t,n){return n===e}),s.take(1),n?a.defaultIfEmpty(t):i.throwIfEmpty(function(){return new r.ArgumentOutOfRangeError}))}}},61650(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(99623),o=n(47986);t.endWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return r.concat(t,o.of.apply(void 0,e))}}},92472(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.every=function(e,t){return function(n){return n.lift(new a(e,t,n))}};var a=function(){function e(e,t,n){this.predicate=e,this.thisArg=t,this.source=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.thisArg,this.source))},e}(),s=function(e){function t(t,n,r,o){var i=e.call(this,t)||this;return i.predicate=n,i.thisArg=r,i.source=o,i.index=0,i.thisArg=r||i,i}return o(t,e),t.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},t.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(e){this.destination.error(e);return}t||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(i.Subscriber)},65893(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.exhaust=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){var n=e.call(this,t)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return o(t,e),t.prototype._next=function(e){this.hasSubscription||(this.hasSubscription=!0,this.add(i.innerSubscribe(e,new i.SimpleInnerSubscriber(this))))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(i.SimpleOuterSubscriber)},29219(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(89233),a=n(85295),s=n(75901);t.exhaustMap=function e(t,n){return n?function(r){return r.pipe(e(function(e,r){return a.from(t(e,r)).pipe(i.map(function(t,o){return n(e,t,r,o)}))}))}:function(e){return e.lift(new l(t))}};var l=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.project))},e}(),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return o(t,e),t.prototype._next=function(e){this.hasSubscription||this.tryNext(e)},t.prototype.tryNext=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){this.destination.error(e);return}this.hasSubscription=!0,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new s.SimpleInnerSubscriber(this),n=this.destination;n.add(t);var r=s.innerSubscribe(e,t);r!==t&&n.add(r)},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(s.SimpleOuterSubscriber)},76527(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.expand=function(e,t,n){return void 0===t&&(t=1/0),t=1>(t||0)?1/0:t,function(r){return r.lift(new a(e,t,n))}};var a=function(){function e(e,t,n){this.project=e,this.concurrent=t,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.concurrent,this.scheduler))},e}();t.ExpandOperator=a;var s=function(e){function t(t,n,r,o){var i=e.call(this,t)||this;return i.project=n,i.concurrent=r,i.scheduler=o,i.index=0,i.active=0,i.hasCompleted=!1,r<1/0&&(i.buffer=[]),i}return o(t,e),t.dispatch=function(e){var t=e.subscriber,n=e.result,r=e.value,o=e.index;t.subscribeToProjection(n,r,o)},t.prototype._next=function(e){var n=this.destination;if(n.closed)return void this._complete();var r=this.index++;if(this.active<this.concurrent){n.next(e);try{var o=(0,this.project)(e,r);this.scheduler?this.destination.add(this.scheduler.schedule(t.dispatch,0,{subscriber:this,result:o,value:e,index:r})):this.subscribeToProjection(o,e,r)}catch(e){n.error(e)}}else this.buffer.push(e)},t.prototype.subscribeToProjection=function(e,t,n){this.active++,this.destination.add(i.innerSubscribe(e,new i.SimpleInnerSubscriber(this)))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this._next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e&&e.length>0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t}(i.SimpleOuterSubscriber);t.ExpandSubscriber=s},64629(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.filter=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.thisArg))},e}(),s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.predicate=n,o.thisArg=r,o.count=0,o}return o(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){this.destination.error(e);return}t&&this.destination.next(e)},t}(i.Subscriber)},4349(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(21016);t.finalize=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.callback=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.callback))},e}(),l=function(e){function t(t,n){var r=e.call(this,t)||this;return r.add(new a.Subscription(n)),r}return o(t,e),t}(i.Subscriber)},32376(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.find=function(e,t){if("function"!=typeof e)throw TypeError("predicate is not a function");return function(n){return n.lift(new a(e,n,!1,t))}};var a=function(){function e(e,t,n,r){this.predicate=e,this.source=t,this.yieldIndex=n,this.thisArg=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}();t.FindValueOperator=a;var s=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;return a.predicate=n,a.source=r,a.yieldIndex=o,a.thisArg=i,a.index=0,a}return o(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete(),this.unsubscribe()},t.prototype._next=function(e){var t=this.predicate,n=this.thisArg,r=this.index++;try{t.call(n||this,e,r,this.source)&&this.notifyComplete(this.yieldIndex?r:e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},t}(i.Subscriber);t.FindValueSubscriber=s},8674(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(32376);t.findIndex=function(e,t){return function(n){return n.lift(new r.FindValueOperator(e,n,!0,t))}}},77089(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(62637),o=n(64629),i=n(85624),a=n(90952),s=n(8347),l=n(78522);t.first=function(e,t){var n=arguments.length>=2;return function(u){return u.pipe(e?o.filter(function(t,n){return e(t,n,u)}):l.identity,i.take(1),n?a.defaultIfEmpty(t):s.throwIfEmpty(function(){return new r.EmptyError}))}}},36217(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(21016),s=n(95092),l=n(71077);t.groupBy=function(e,t,n,r){return function(o){return o.lift(new u(e,t,n,r))}};var u=function(){function e(e,t,n,r){this.keySelector=e,this.elementSelector=t,this.durationSelector=n,this.subjectSelector=r}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),c=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;return a.keySelector=n,a.elementSelector=r,a.durationSelector=o,a.subjectSelector=i,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return o(t,e),t.prototype._next=function(e){var t;try{t=this.keySelector(e)}catch(e){this.error(e);return}this._group(e,t)},t.prototype._group=function(e,t){var n,r=this.groups;r||(r=this.groups=new Map);var o=r.get(t);if(this.elementSelector)try{n=this.elementSelector(e)}catch(e){this.error(e)}else n=e;if(!o){o=this.subjectSelector?this.subjectSelector():new l.Subject,r.set(t,o);var i=new f(t,o,this);if(this.destination.next(i),this.durationSelector){var a=void 0;try{a=this.durationSelector(new f(t,o))}catch(e){this.error(e);return}this.add(a.subscribe(new d(t,o,this)))}}o.closed||o.next(n)},t.prototype._error=function(e){var t=this.groups;t&&(t.forEach(function(t,n){t.error(e)}),t.clear()),this.destination.error(e)},t.prototype._complete=function(){var e=this.groups;e&&(e.forEach(function(e,t){e.complete()}),e.clear()),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups.delete(e)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},t}(i.Subscriber),d=function(e){function t(t,n,r){var o=e.call(this,n)||this;return o.key=t,o.group=n,o.parent=r,o}return o(t,e),t.prototype._next=function(e){this.complete()},t.prototype._unsubscribe=function(){var e=this.parent,t=this.key;this.key=this.parent=null,e&&e.removeGroup(t)},t}(i.Subscriber),f=function(e){function t(t,n,r){var o=e.call(this)||this;return o.key=t,o.groupSubject=n,o.refCountSubscription=r,o}return o(t,e),t.prototype._subscribe=function(e){var t=new a.Subscription,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&t.add(new p(n)),t.add(r.subscribe(e)),t},t}(s.Observable);t.GroupedObservable=f;var p=function(e){function t(t){var n=e.call(this)||this;return n.parent=t,t.count++,n}return o(t,e),t.prototype.unsubscribe=function(){var t=this.parent;t.closed||this.closed||(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},t}(a.Subscription)},76024(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.ignoreElements=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype._next=function(e){},t}(i.Subscriber)},87362(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.isEmpty=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(i.Subscriber)},6047(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(62637),o=n(64629),i=n(96696),a=n(8347),s=n(90952),l=n(78522);t.last=function(e,t){var n=arguments.length>=2;return function(u){return u.pipe(e?o.filter(function(t,n){return e(t,n,u)}):l.identity,i.takeLast(1),n?s.defaultIfEmpty(t):a.throwIfEmpty(function(){return new r.EmptyError}))}}},89233(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.map=function(e,t){return function(n){if("function"!=typeof e)throw TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.thisArg))},e}();t.MapOperator=a;var s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return o(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(i.Subscriber)},27296(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.mapTo=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.value))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.value=n,r}return o(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(i.Subscriber)},75434(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(4942);t.materialize=function(){return function(e){return e.lift(new s)}};var s=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new l(e))},e}(),l=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype._next=function(e){this.destination.next(a.Notification.createNext(e))},t.prototype._error=function(e){var t=this.destination;t.next(a.Notification.createError(e)),t.complete()},t.prototype._complete=function(){var e=this.destination;e.next(a.Notification.createComplete()),e.complete()},t}(i.Subscriber)},57001(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(71929);t.max=function(e){return r.reduce("function"==typeof e?function(t,n){return e(t,n)>0?t:n}:function(e,t){return e>t?e:t})}},14779(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(33395);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(r.merge.apply(void 0,[t].concat(e)))}}},80980(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(60781),o=n(78522);t.mergeAll=function(e){return void 0===e&&(e=1/0),r.mergeMap(o.identity,e)}},60781(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(89233),a=n(85295),s=n(75901);function l(e,t,n){return(void 0===n&&(n=1/0),"function"==typeof t)?function(r){return r.pipe(l(function(n,r){return a.from(e(n,r)).pipe(i.map(function(e,o){return t(n,e,r,o)}))},n))}:("number"==typeof t&&(n=t),function(t){return t.lift(new u(e,n))})}t.mergeMap=l;var u=function(){function e(e,t){void 0===t&&(t=1/0),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.project,this.concurrent))},e}();t.MergeMapOperator=u;var c=function(e){function t(t,n,r){void 0===r&&(r=1/0);var o=e.call(this,t)||this;return o.project=n,o.concurrent=r,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return o(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){this.destination.error(e);return}this.active++,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new s.SimpleInnerSubscriber(this),n=this.destination;n.add(t);var r=s.innerSubscribe(e,t);r!==t&&n.add(r)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(s.SimpleOuterSubscriber);t.MergeMapSubscriber=c,t.flatMap=l},62988(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(60781);t.mergeMapTo=function(e,t,n){return(void 0===n&&(n=1/0),"function"==typeof t)?r.mergeMap(function(){return e},t,n):("number"==typeof t&&(n=t),r.mergeMap(function(){return e},n))}},86430(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.mergeScan=function(e,t,n){return void 0===n&&(n=1/0),function(r){return r.lift(new a(e,t,n))}};var a=function(){function e(e,t,n){this.accumulator=e,this.seed=t,this.concurrent=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.accumulator,this.seed,this.concurrent))},e}();t.MergeScanOperator=a;var s=function(e){function t(t,n,r,o){var i=e.call(this,t)||this;return i.accumulator=n,i.acc=r,i.concurrent=o,i.hasValue=!1,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return o(t,e),t.prototype._next=function(e){if(this.active<this.concurrent){var t=this.index++,n=this.destination,r=void 0;try{r=(0,this.accumulator)(this.acc,e,t)}catch(e){return n.error(e)}this.active++,this._innerSub(r)}else this.buffer.push(e)},t.prototype._innerSub=function(e){var t=new i.SimpleInnerSubscriber(this),n=this.destination;n.add(t);var r=i.innerSubscribe(e,t);r!==t&&n.add(r)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},t.prototype.notifyNext=function(e){var t=this.destination;this.acc=e,this.hasValue=!0,t.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},t}(i.SimpleOuterSubscriber);t.MergeScanSubscriber=s},21547(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(71929);t.min=function(e){return r.reduce("function"==typeof e?function(t,n){return 0>e(t,n)?t:n}:function(e,t){return e<t?e:t})}},49529(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(27432);t.multicast=function(e,t){return function(n){if(i="function"==typeof e?e:function(){return e},"function"==typeof t)return n.lift(new o(i,t));var i,a=Object.create(n,r.connectableObservableDescriptor);return a.source=n,a.subjectFactory=i,a}};var o=function(){function e(e,t){this.subjectFactory=e,this.selector=t}return e.prototype.call=function(e,t){var n=this.selector,r=this.subjectFactory(),o=n(r).subscribe(e);return o.add(t.subscribe(r)),o},e}();t.MulticastOperator=o},24654(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(4942);t.observeOn=function(e,t){return void 0===t&&(t=0),function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.scheduler,this.delay))},e}();t.ObserveOnOperator=s;var l=function(e){function t(t,n,r){void 0===r&&(r=0);var o=e.call(this,t)||this;return o.scheduler=n,o.delay=r,o}return o(t,e),t.dispatch=function(e){var t=e.notification,n=e.destination;t.observe(n),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.destination.add(this.scheduler.schedule(t.dispatch,this.delay,new u(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(a.Notification.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(a.Notification.createError(e)),this.unsubscribe()},t.prototype._complete=function(){this.scheduleMessage(a.Notification.createComplete()),this.unsubscribe()},t}(i.Subscriber);t.ObserveOnSubscriber=l;var u=function(e,t){this.notification=e,this.destination=t};t.ObserveOnMessage=u},45276(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(85295),a=n(80743),s=n(75901);t.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length&&a.isArray(e[0])&&(e=e[0]),function(t){return t.lift(new l(e))}},t.onErrorResumeNextStatic=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=void 0;return 1===e.length&&a.isArray(e[0])&&(e=e[0]),n=e.shift(),i.from(n).lift(new l(e))};var l=function(){function e(e){this.nextSources=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.nextSources))},e}(),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r.destination=t,r.nextSources=n,r}return o(t,e),t.prototype.notifyError=function(){this.subscribeToNextSource()},t.prototype.notifyComplete=function(){this.subscribeToNextSource()},t.prototype._error=function(e){this.subscribeToNextSource(),this.unsubscribe()},t.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},t.prototype.subscribeToNextSource=function(){var e=this.nextSources.shift();if(e){var t=new s.SimpleInnerSubscriber(this),n=this.destination;n.add(t);var r=s.innerSubscribe(e,t);r!==t&&n.add(r)}else this.destination.complete()},t}(s.SimpleOuterSubscriber)},98155(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.pairwise=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){var n=e.call(this,t)||this;return n.hasPrev=!1,n}return o(t,e),t.prototype._next=function(e){var t;this.hasPrev?t=[this.prev,e]:this.hasPrev=!0,this.prev=e,t&&this.destination.next(t)},t}(i.Subscriber)},27337(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(86484),o=n(64629);t.partition=function(e,t){return function(n){return[o.filter(e,t)(n),o.filter(r.not(e,t))(n)]}}},86050(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(89233);t.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.length;if(0===n)throw Error("list of properties cannot be empty.");return function(t){var o,i;return r.map((o=e,i=n,function(e){for(var t=e,n=0;n<i;n++){var r=null!=t?t[o[n]]:void 0;if(void 0===r)return;t=r}return t}))(t)}}},96904(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(71077),o=n(49529);t.publish=function(e){return e?o.multicast(function(){return new r.Subject},e):o.multicast(new r.Subject)}},82334(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8791),o=n(49529);t.publishBehavior=function(e){return function(t){return o.multicast(new r.BehaviorSubject(e))(t)}}},20232(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(38513),o=n(49529);t.publishLast=function(){return function(e){return o.multicast(new r.AsyncSubject)(e)}}},24355(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(20328),o=n(49529);t.publishReplay=function(e,t,n,i){n&&"function"!=typeof n&&(i=n);var a="function"==typeof n?n:void 0,s=new r.ReplaySubject(e,t,i);return function(e){return o.multicast(function(){return s},a)(e)}}},89646(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(80743),o=n(57894);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return 1===e.length&&r.isArray(e[0])&&(e=e[0]),t.lift.call(o.race.apply(void 0,[t].concat(e)))}}},71929(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(85002),o=n(96696),i=n(90952),a=n(27928);t.reduce=function(e,t){return arguments.length>=2?function(n){return a.pipe(r.scan(e,t),o.takeLast(1),i.defaultIfEmpty(t))(n)}:function(t){return a.pipe(r.scan(function(t,n,r){return e(t,n,r+1)}),o.takeLast(1))(t)}}},85203(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.refCount=function(){return function(e){return e.lift(new a(e))}};var a=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var n=this.connectable;n._refCount++;var r=new s(e,n),o=t.subscribe(r);return r.closed||(r.connection=n.connect()),o},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return o(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(!e){this.connection=null;return}this.connectable=null;var t=e._refCount;if(t<=0||(e._refCount=t-1,t>1)){this.connection=null;return}var n=this.connection,r=e._connection;this.connection=null,r&&(!n||r===n)&&r.unsubscribe()},t}(i.Subscriber)},30068(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(34914);t.repeat=function(e){return void 0===e&&(e=-1),function(t){return 0===e?a.empty():e<0?t.lift(new s(-1,t)):t.lift(new s(e-1,t))}};var s=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.count,this.source))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.count=n,o.source=r,o}return o(t,e),t.prototype.complete=function(){if(!this.isStopped){var t=this.source,n=this.count;if(0===n)return e.prototype.complete.call(this);n>-1&&(this.count=n-1),t.subscribe(this._unsubscribeAndRecycle())}},t}(i.Subscriber)},58440(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(75901);t.repeatWhen=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,t))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.notifier=n,o.source=r,o.sourceIsBeingSubscribedTo=!0,o}return o(t,e),t.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},t.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return e.prototype.complete.call(this)},t.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},t.prototype._unsubscribe=function(){var e=this.notifications,t=this.retriesSubscription;e&&(e.unsubscribe(),this.notifications=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype._unsubscribeAndRecycle=function(){var t=this._unsubscribe;return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=t,this},t.prototype.subscribeToRetries=function(){this.notifications=new i.Subject;try{var t;t=(0,this.notifier)(this.notifications)}catch(t){return e.prototype.complete.call(this)}this.retries=t,this.retriesSubscription=a.innerSubscribe(t,new a.SimpleInnerSubscriber(this))},t}(a.SimpleOuterSubscriber)},39933(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.retry=function(e){return void 0===e&&(e=-1),function(t){return t.lift(new a(e,t))}};var a=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.count,this.source))},e}(),s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.count=n,o.source=r,o}return o(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return e.prototype.error.call(this,t);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},t}(i.Subscriber)},53325(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(75901);t.retryWhen=function(e){return function(t){return t.lift(new s(e,t))}};var s=function(){function e(e,t){this.notifier=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,this.source))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.notifier=n,o.source=r,o}return o(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=this.errors,r=this.retries,o=this.retriesSubscription;if(r)this.errors=void 0,this.retriesSubscription=void 0;else{n=new i.Subject;try{r=(0,this.notifier)(n)}catch(t){return e.prototype.error.call(this,t)}o=a.innerSubscribe(r,new a.SimpleInnerSubscriber(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=o,n.next(t)}},t.prototype._unsubscribe=function(){var e=this.errors,t=this.retriesSubscription;e&&(e.unsubscribe(),this.errors=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype.notifyNext=function(){var e=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=e,this.source.subscribe(this)},t}(a.SimpleOuterSubscriber)},27677(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.sample=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new s(e),r=t.subscribe(n);return r.add(i.innerSubscribe(this.notifier,new i.SimpleInnerSubscriber(n))),r},e}(),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasValue=!1,t}return o(t,e),t.prototype._next=function(e){this.value=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(i.SimpleOuterSubscriber)},88360(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(86735);t.sampleTime=function(e,t){return void 0===t&&(t=a.async),function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){this.period=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.period,this.scheduler))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.period=n,o.scheduler=r,o.hasValue=!1,o.add(r.schedule(u,n,{subscriber:o,period:n})),o}return o(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(i.Subscriber);function u(e){var t=e.subscriber,n=e.period;t.notifyNext(),this.schedule(e,n)}},85002(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.scan=function(e,t){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new a(e,t,n))}};var a=function(){function e(e,t,n){void 0===n&&(n=!1),this.accumulator=e,this.seed=t,this.hasSeed=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.accumulator,this.seed,this.hasSeed))},e}(),s=function(e){function t(t,n,r,o){var i=e.call(this,t)||this;return i.accumulator=n,i._seed=r,i.hasSeed=o,i.index=0,i}return o(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.accumulator(this.seed,e,n)}catch(e){this.destination.error(e)}this.seed=t,this.destination.next(t)},t}(i.Subscriber)},54332(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.sequenceEqual=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.compareTo=e,this.comparator=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.compareTo,this.comparator))},e}();t.SequenceEqualOperator=a;var s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.compareTo=n,o.comparator=r,o._a=[],o._b=[],o._oneComplete=!1,o.destination.add(n.subscribe(new l(t,o))),o}return o(t,e),t.prototype._next=function(e){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(e),this.checkValues())},t.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},t.prototype.checkValues=function(){for(var e=this._a,t=this._b,n=this.comparator;e.length>0&&t.length>0;){var r=e.shift(),o=t.shift(),i=!1;try{i=n?n(r,o):r===o}catch(e){this.destination.error(e)}i||this.emit(!1)}},t.prototype.emit=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype.nextB=function(e){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(e),this.checkValues())},t.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},t}(i.Subscriber);t.SequenceEqualSubscriber=s;var l=function(e){function t(t,n){var r=e.call(this,t)||this;return r.parent=n,r}return o(t,e),t.prototype._next=function(e){this.parent.nextB(e)},t.prototype._error=function(e){this.parent.error(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},t}(i.Subscriber)},49184(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(49529),o=n(85203),i=n(71077);function a(){return new i.Subject}t.share=function(){return function(e){return o.refCount()(r.multicast(a)(e))}}},91451(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(20328);t.shareReplay=function(e,t,n){var o;return o=e&&"object"==typeof e?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:n},function(e){var t,n,i,a,s,l,u,c,d,f,p,h;return e.lift((s=void 0===(a=(t=o).bufferSize)?1/0:a,u=void 0===(l=t.windowTime)?1/0:l,c=t.refCount,d=t.scheduler,f=0,p=!1,h=!1,function(e){var t;f++,!n||p?(p=!1,t=(n=new r.ReplaySubject(s,u,d)).subscribe(this),i=e.subscribe({next:function(e){n.next(e)},error:function(e){p=!0,n.error(e)},complete:function(){h=!0,i=void 0,n.complete()}}),h&&(i=void 0)):t=n.subscribe(this),this.add(function(){f--,t.unsubscribe(),t=void 0,i&&!h&&c&&0===f&&(i.unsubscribe(),i=void 0,n=void 0)})}))}}},76003(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(62637);t.single=function(e){return function(t){return t.lift(new s(e,t))}};var s=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.predicate,this.source))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.predicate=n,o.source=r,o.seenValue=!1,o.index=0,o}return o(t,e),t.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},t.prototype._next=function(e){var t=this.index++;this.predicate?this.tryNext(e,t):this.applySingleValue(e)},t.prototype.tryNext=function(e,t){try{this.predicate(e,t,this.source)&&this.applySingleValue(e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){var e=this.destination;this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new a.EmptyError)},t}(i.Subscriber)},67124(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.skip=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.total=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.total))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return o(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(i.Subscriber)},31444(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(2519);t.skipLast=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){if(this._skipCount=e,this._skipCount<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return 0===this._skipCount?t.subscribe(new i.Subscriber(e)):t.subscribe(new l(e,this._skipCount))},e}(),l=function(e){function t(t,n){var r=e.call(this,t)||this;return r._skipCount=n,r._count=0,r._ring=Array(n),r}return o(t,e),t.prototype._next=function(e){var t=this._skipCount,n=this._count++;if(n<t)this._ring[n]=e;else{var r=n%t,o=this._ring,i=o[r];o[r]=e,this.destination.next(i)}},t}(i.Subscriber)},51026(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.skipUntil=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.notifier))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;r.hasValue=!1;var o=new i.SimpleInnerSubscriber(r);r.add(o),r.innerSubscription=o;var a=i.innerSubscribe(n,o);return a!==o&&(r.add(a),r.innerSubscription=a),r}return o(t,e),t.prototype._next=function(t){this.hasValue&&e.prototype._next.call(this,t)},t.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},t.prototype.notifyComplete=function(){},t}(i.SimpleOuterSubscriber)},79159(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.skipWhile=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.predicate=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return o(t,e),t.prototype._next=function(e){var t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)},t.prototype.tryCallPredicate=function(e){try{var t=this.predicate(e,this.index++);this.skipping=!!t}catch(e){this.destination.error(e)}},t}(i.Subscriber)},89155(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(99623),o=n(23935);t.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return o.isScheduler(n)?(e.pop(),function(t){return r.concat(e,t,n)}):function(t){return r.concat(e,t)}}},30162(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(17563);t.subscribeOn=function(e,t){return void 0===t&&(t=0),function(n){return n.lift(new o(e,t))}};var o=function(){function e(e,t){this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return new r.SubscribeOnObservable(t,this.delay,this.scheduler).subscribe(e)},e}()},21324(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(20917),o=n(78522);t.switchAll=function(){return r.switchMap(o.identity)}},20917(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(89233),a=n(85295),s=n(75901);t.switchMap=function e(t,n){return"function"==typeof n?function(r){return r.pipe(e(function(e,r){return a.from(t(e,r)).pipe(i.map(function(t,o){return n(e,t,r,o)}))}))}:function(e){return e.lift(new l(t))}};var l=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.project))},e}(),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r.project=n,r.index=0,r}return o(t,e),t.prototype._next=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){this.destination.error(e);return}this._innerSub(t)},t.prototype._innerSub=function(e){var t=this.innerSubscription;t&&t.unsubscribe();var n=new s.SimpleInnerSubscriber(this),r=this.destination;r.add(n),this.innerSubscription=s.innerSubscribe(e,n),this.innerSubscription!==n&&r.add(this.innerSubscription)},t.prototype._complete=function(){var t=this.innerSubscription;(!t||t.closed)&&e.prototype._complete.call(this),this.unsubscribe()},t.prototype._unsubscribe=function(){this.innerSubscription=void 0},t.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e){this.destination.next(e)},t}(s.SimpleOuterSubscriber)},35428(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(20917);t.switchMapTo=function(e,t){return t?r.switchMap(function(){return e},t):r.switchMap(function(){return e})}},85624(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(2519),s=n(34914);t.take=function(e){return function(t){return 0===e?s.empty():t.lift(new l(e))}};var l=function(){function e(e){if(this.total=e,this.total<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return o(t,e),t.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},t}(i.Subscriber)},96696(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(2519),s=n(34914);t.takeLast=function(e){return function(t){return 0===e?s.empty():t.lift(new l(e))}};var l=function(){function e(e){if(this.total=e,this.total<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.ring=[],r.count=0,r}return o(t,e),t.prototype._next=function(e){var t=this.ring,n=this.total,r=this.count++;t.length<n?t.push(e):t[r%n]=e},t.prototype._complete=function(){var e=this.destination,t=this.count;if(t>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,o=0;o<n;o++){var i=t++%n;e.next(r[i])}e.complete()},t}(i.Subscriber)},41534(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.takeUntil=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new s(e),r=i.innerSubscribe(this.notifier,new i.SimpleInnerSubscriber(n));return r&&!n.seenValue?(n.add(r),t.subscribe(n)):n},e}(),s=function(e){function t(t){var n=e.call(this,t)||this;return n.seenValue=!1,n}return o(t,e),t.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(i.SimpleOuterSubscriber)},5179(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.takeWhile=function(e,t){return void 0===t&&(t=!1),function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.inclusive=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.inclusive))},e}(),s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.predicate=n,o.inclusive=r,o.index=0,o}return o(t,e),t.prototype._next=function(e){var t,n=this.destination;try{t=this.predicate(e,this.index++)}catch(e){n.error(e);return}this.nextOrComplete(e,t)},t.prototype.nextOrComplete=function(e,t){var n=this.destination;t?n.next(e):(this.inclusive&&n.next(e),n.complete())},t}(i.Subscriber)},68022(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(53912),s=n(84864);t.tap=function(e,t,n){return function(r){return r.lift(new l(e,t,n))}};var l=function(){function e(e,t,n){this.nextOrObserver=e,this.error=t,this.complete=n}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.nextOrObserver,this.error,this.complete))},e}(),u=function(e){function t(t,n,r,o){var i=e.call(this,t)||this;return i._tapNext=a.noop,i._tapError=a.noop,i._tapComplete=a.noop,i._tapError=r||a.noop,i._tapComplete=o||a.noop,s.isFunction(n)?(i._context=i,i._tapNext=n):n&&(i._context=n,i._tapNext=n.next||a.noop,i._tapError=n.error||a.noop,i._tapComplete=n.complete||a.noop),i}return o(t,e),t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.next(e)},t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.error(e)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){this.destination.error(e);return}return this.destination.complete()},t}(i.Subscriber)},15019(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.defaultThrottleConfig={leading:!0,trailing:!1},t.throttle=function(e,n){return void 0===n&&(n=t.defaultThrottleConfig),function(t){return t.lift(new a(e,!!n.leading,!!n.trailing))}};var a=function(){function e(e,t,n){this.durationSelector=e,this.leading=t,this.trailing=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector,this.leading,this.trailing))},e}(),s=function(e){function t(t,n,r,o){var i=e.call(this,t)||this;return i.destination=t,i.durationSelector=n,i._leading=r,i._trailing=o,i._hasValue=!1,i}return o(t,e),t.prototype._next=function(e){this._hasValue=!0,this._sendValue=e,this._throttled||(this._leading?this.send():this.throttle(e))},t.prototype.send=function(){var e=this._hasValue,t=this._sendValue;e&&(this.destination.next(t),this.throttle(t)),this._hasValue=!1,this._sendValue=void 0},t.prototype.throttle=function(e){var t=this.tryDurationSelector(e);t&&this.add(this._throttled=i.innerSubscribe(t,new i.SimpleInnerSubscriber(this)))},t.prototype.tryDurationSelector=function(e){try{return this.durationSelector(e)}catch(e){return this.destination.error(e),null}},t.prototype.throttlingDone=function(){var e=this._throttled,t=this._trailing;e&&e.unsubscribe(),this._throttled=void 0,t&&this.send()},t.prototype.notifyNext=function(){this.throttlingDone()},t.prototype.notifyComplete=function(){this.throttlingDone()},t}(i.SimpleOuterSubscriber)},7406(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(86735),s=n(15019);t.throttleTime=function(e,t,n){return void 0===t&&(t=a.async),void 0===n&&(n=s.defaultThrottleConfig),function(r){return r.lift(new l(e,t,n.leading,n.trailing))}};var l=function(){function e(e,t,n,r){this.duration=e,this.scheduler=t,this.leading=n,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),u=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;return a.duration=n,a.scheduler=r,a.leading=o,a.trailing=i,a._hasTrailingValue=!1,a._trailingValue=null,a}return o(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(c,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue&&this.destination.next(this._trailingValue),this.destination.complete()},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(i.Subscriber);function c(e){e.subscriber.clearThrottle()}},8347(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(62637),a=n(77759);t.throwIfEmpty=function(e){return void 0===e&&(e=u),function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.errorFactory=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.errorFactory))},e}(),l=function(e){function t(t,n){var r=e.call(this,t)||this;return r.errorFactory=n,r.hasValue=!1,r}return o(t,e),t.prototype._next=function(e){this.hasValue=!0,this.destination.next(e)},t.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var e=void 0;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)},t}(a.Subscriber);function u(){return new i.EmptyError}},61115(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(86735),o=n(85002),i=n(26691),a=n(89233);t.timeInterval=function(e){return void 0===e&&(e=r.async),function(t){return i.defer(function(){return t.pipe(o.scan(function(t,n){var r=t.current;return{value:n,current:e.now(),last:r}},{current:e.now(),value:void 0,last:void 0}),a.map(function(e){var t=e.current,n=e.last;return new s(e.value,t-n)}))})}};var s=function(e,t){this.value=e,this.interval=t};t.TimeInterval=s},82784(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(86735),o=n(31027),i=n(35816),a=n(11673);t.timeout=function(e,t){return void 0===t&&(t=r.async),i.timeoutWith(e,a.throwError(new o.TimeoutError),t)}},35816(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(86735),a=n(66740),s=n(75901);t.timeoutWith=function(e,t,n){return void 0===n&&(n=i.async),function(r){var o=a.isDate(e),i=o?e-n.now():Math.abs(e);return r.lift(new l(i,o,t,n))}};var l=function(){function e(e,t,n,r){this.waitFor=e,this.absoluteTimeout=t,this.withObservable=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},e}(),u=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;return a.absoluteTimeout=n,a.waitFor=r,a.withObservable=o,a.scheduler=i,a.scheduleTimeout(),a}return o(t,e),t.dispatchTimeout=function(e){var t=e.withObservable;e._unsubscribeAndRecycle(),e.add(s.innerSubscribe(t,new s.SimpleInnerSubscriber(e)))},t.prototype.scheduleTimeout=function(){var e=this.action;e?this.action=e.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(t.dispatchTimeout,this.waitFor,this))},t.prototype._next=function(t){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,t)},t.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},t}(s.SimpleOuterSubscriber)},20367(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(86735),o=n(89233);t.timestamp=function(e){return void 0===e&&(e=r.async),o.map(function(t){return new i(t,e.now())})};var i=function(e,t){this.value=e,this.timestamp=t};t.Timestamp=i},89133(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(71929);function o(e,t,n){return 0===n?[t]:(e.push(t),e)}t.toArray=function(){return r.reduce(o,[])}},22363(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(75901);t.window=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.windowBoundaries=e}return e.prototype.call=function(e,t){var n=new l(e),r=t.subscribe(n);return r.closed||n.add(a.innerSubscribe(this.windowBoundaries,new a.SimpleInnerSubscriber(n))),r},e}(),l=function(e){function t(t){var n=e.call(this,t)||this;return n.window=new i.Subject,t.next(n.window),n}return o(t,e),t.prototype.notifyNext=function(){this.openWindow()},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(){this._complete()},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e)},t.prototype._complete=function(){this.window.complete(),this.destination.complete()},t.prototype._unsubscribe=function(){this.window=null},t.prototype.openWindow=function(){var e=this.window;e&&e.complete();var t=this.destination,n=this.window=new i.Subject;t.next(n)},t}(a.SimpleOuterSubscriber)},32216(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(71077);t.windowCount=function(e,t){return void 0===t&&(t=0),function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){this.windowSize=e,this.startWindowEvery=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.windowSize,this.startWindowEvery))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.destination=t,o.windowSize=n,o.startWindowEvery=r,o.windows=[new a.Subject],o.count=0,t.next(o.windows[0]),o}return o(t,e),t.prototype._next=function(e){for(var t=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,o=this.windows,i=o.length,s=0;s<i&&!this.closed;s++)o[s].next(e);var l=this.count-r+1;if(l>=0&&l%t==0&&!this.closed&&o.shift().complete(),++this.count%t==0&&!this.closed){var u=new a.Subject;o.push(u),n.next(u)}},t.prototype._error=function(e){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().complete();this.destination.complete()},t.prototype._unsubscribe=function(){this.count=0,this.windows=null},t}(i.Subscriber)},93886(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(86735),s=n(77759),l=n(19673),u=n(23935);t.windowTime=function(e){var t=a.async,n=null,r=1/0;return u.isScheduler(arguments[3])&&(t=arguments[3]),u.isScheduler(arguments[2])?t=arguments[2]:l.isNumeric(arguments[2])&&(r=Number(arguments[2])),u.isScheduler(arguments[1])?t=arguments[1]:l.isNumeric(arguments[1])&&(n=Number(arguments[1])),function(o){return o.lift(new c(e,n,r,t))}};var c=function(){function e(e,t,n,r){this.windowTimeSpan=e,this.windowCreationInterval=t,this.maxWindowSize=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new f(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._numberOfNextedValues=0,t}return o(t,e),t.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),t}(i.Subject),f=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;a.destination=t,a.windowTimeSpan=n,a.windowCreationInterval=r,a.maxWindowSize=o,a.scheduler=i,a.windows=[];var s=a.openWindow();return null!==r&&r>=0?(a.add(i.schedule(m,n,{subscriber:a,window:s,context:null})),a.add(i.schedule(h,r,{windowTimeSpan:n,windowCreationInterval:r,subscriber:a,scheduler:i}))):a.add(i.schedule(p,n,{subscriber:a,window:s,windowTimeSpan:n})),a}return o(t,e),t.prototype._next=function(e){for(var t=this.windows,n=t.length,r=0;r<n;r++){var o=t[r];!o.closed&&(o.next(e),o.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(o))}},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;){var t=e.shift();t.closed||t.complete()}this.destination.complete()},t.prototype.openWindow=function(){var e=new d;return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},t}(s.Subscriber);function p(e){var t=e.subscriber,n=e.windowTimeSpan,r=e.window;r&&t.closeWindow(r),e.window=t.openWindow(),this.schedule(e,n)}function h(e){var t=e.windowTimeSpan,n=e.subscriber,r=e.scheduler,o=e.windowCreationInterval,i=n.openWindow(),a={action:this,subscription:null};a.subscription=r.schedule(m,t,{subscriber:n,window:i,context:a}),this.add(a.subscription),this.schedule(e,o)}function m(e){var t=e.subscriber,n=e.window,r=e.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),t.closeWindow(n)}},83903(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(21016),s=n(89152),l=n(87778);t.windowToggle=function(e,t){return function(n){return n.lift(new u(e,t))}};var u=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.openings,this.closingSelector))},e}(),c=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.openings=n,o.closingSelector=r,o.contexts=[],o.add(o.openSubscription=l.subscribeToResult(o,n,n)),o}return o(t,e),t.prototype._next=function(e){var t=this.contexts;if(t)for(var n=t.length,r=0;r<n;r++)t[r].window.next(e)},t.prototype._error=function(t){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,o=-1;++o<r;){var i=n[o];i.window.error(t),i.subscription.unsubscribe()}e.prototype._error.call(this,t)},t.prototype._complete=function(){var t=this.contexts;if(this.contexts=null,t)for(var n=t.length,r=-1;++r<n;){var o=t[r];o.window.complete(),o.subscription.unsubscribe()}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.contexts;if(this.contexts=null,e)for(var t=e.length,n=-1;++n<t;){var r=e[n];r.window.unsubscribe(),r.subscription.unsubscribe()}},t.prototype.notifyNext=function(e,t,n,r,o){if(e===this.openings){var s=void 0;try{s=(0,this.closingSelector)(t)}catch(e){return this.error(e)}var u=new i.Subject,c=new a.Subscription,d={window:u,subscription:c};this.contexts.push(d);var f=l.subscribeToResult(this,s,d);f.closed?this.closeWindow(this.contexts.length-1):(f.context=d,c.add(f)),this.destination.next(u)}else this.closeWindow(this.contexts.indexOf(e))},t.prototype.notifyError=function(e){this.error(e)},t.prototype.notifyComplete=function(e){e!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(e.context))},t.prototype.closeWindow=function(e){if(-1!==e){var t=this.contexts,n=t[e],r=n.window,o=n.subscription;t.splice(e,1),r.complete(),o.unsubscribe()}},t}(s.OuterSubscriber)},27539(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(89152),s=n(87778);t.windowWhen=function(e){return function(t){return t.lift(new l(e))}};var l=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.closingSelector))},e}(),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r.destination=t,r.closingSelector=n,r.openWindow(),r}return o(t,e),t.prototype.notifyNext=function(e,t,n,r,o){this.openWindow(o)},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(e){this.openWindow(e)},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e),this.unsubscribeClosingNotification()},t.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},t.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},t.prototype.openWindow=function(e){void 0===e&&(e=null),e&&(this.remove(e),e.unsubscribe());var t,n=this.window;n&&n.complete();var r=this.window=new i.Subject;this.destination.next(r);try{t=(0,this.closingSelector)()}catch(e){this.destination.error(e),this.window.error(e);return}this.add(this.closingNotification=s.subscribeToResult(this,t))},t}(a.OuterSubscriber)},76788(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(89152),a=n(87778);t.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n;return"function"==typeof e[e.length-1]&&(n=e.pop()),t.lift(new s(e,n))}};var s=function(){function e(e,t){this.observables=e,this.project=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.observables,this.project))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;o.observables=n,o.project=r,o.toRespond=[];var i=n.length;o.values=Array(i);for(var s=0;s<i;s++)o.toRespond.push(s);for(var s=0;s<i;s++){var l=n[s];o.add(a.subscribeToResult(o,l,void 0,s))}return o}return o(t,e),t.prototype.notifyNext=function(e,t,n){this.values[n]=t;var r=this.toRespond;if(r.length>0){var o=r.indexOf(n);-1!==o&&r.splice(o,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(i.OuterSubscriber)},64868(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(85356);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(r.zip.apply(void 0,[t].concat(e)))}}},85517(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(85356);t.zipAll=function(e){return function(t){return t.lift(new r.ZipOperator(e))}}},85791(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(21016);t.scheduleArray=function(e,t){return new r.Observable(function(n){var r=new o.Subscription,i=0;return r.add(t.schedule(function(){i===e.length?n.complete():(n.next(e[i++]),n.closed||r.add(this.schedule()))})),r})}},34178(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(21016),i=n(78258);t.scheduleIterable=function(e,t){if(!e)throw Error("Iterable cannot be null");return new r.Observable(function(n){var r,a=new o.Subscription;return a.add(function(){r&&"function"==typeof r.return&&r.return()}),a.add(t.schedule(function(){r=e[i.iterator](),a.add(t.schedule(function(){if(!n.closed){try{var e,t,o=r.next();e=o.value,t=o.done}catch(e){n.error(e);return}t?n.complete():(n.next(e),this.schedule())}}))})),a})}},12873(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(21016),i=n(46713);t.scheduleObservable=function(e,t){return new r.Observable(function(n){var r=new o.Subscription;return r.add(t.schedule(function(){var o=e[i.observable]();r.add(o.subscribe({next:function(e){r.add(t.schedule(function(){return n.next(e)}))},error:function(e){r.add(t.schedule(function(){return n.error(e)}))},complete:function(){r.add(t.schedule(function(){return n.complete()}))}}))})),r})}},91039(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(21016);t.schedulePromise=function(e,t){return new r.Observable(function(n){var r=new o.Subscription;return r.add(t.schedule(function(){return e.then(function(e){r.add(t.schedule(function(){n.next(e),r.add(t.schedule(function(){return n.complete()}))}))},function(e){r.add(t.schedule(function(){return n.error(e)}))})})),r})}},67670(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12873),o=n(91039),i=n(85791),a=n(34178),s=n(67606),l=n(94215),u=n(90624),c=n(74442);t.scheduled=function(e,t){if(null!=e){if(s.isInteropObservable(e))return r.scheduleObservable(e,t);else if(l.isPromise(e))return o.schedulePromise(e,t);else if(u.isArrayLike(e))return i.scheduleArray(e,t);else if(c.isIterable(e)||"string"==typeof e)return a.scheduleIterable(e,t)}throw TypeError((null!==e&&typeof e||e)+" is not observable")}},55169(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Action=function(e){function t(t,n){return e.call(this)||this}return o(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(21016).Subscription)},82900(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(42839);t.AsapAction=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return o(t,e),t.prototype.requestAsyncId=function(t,n,r){return(void 0===r&&(r=0),null!==r&&r>0)?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=i.Immediate.setImmediate(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(i.Immediate.clearImmediate(n),t.scheduled=void 0)},t}(n(70469).AsyncAction)},3069(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapScheduler=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,r=-1,o=n.length;e=e||n.shift();do if(t=e.execute(e.state,e.delay))break;while(++r<o&&(e=n.shift()));if(this.active=!1,t){for(;++r<o&&(e=n.shift());)e.unsubscribe();throw t}},t}(n(25646).AsyncScheduler)},70469(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncAction=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return o(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r=void 0;try{this.work(e)}catch(e){n=!0,r=!!e&&e||Error(e)}if(n)return this.unsubscribe(),r},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,n=t.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(n(55169).Action)},25646(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(94688);t.AsyncScheduler=function(e){function t(n,r){void 0===r&&(r=i.Scheduler.now);var o=e.call(this,n,function(){return t.delegate&&t.delegate!==o?t.delegate.now():r()})||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return o(t,e),t.prototype.schedule=function(n,r,o){return(void 0===r&&(r=0),t.delegate&&t.delegate!==this)?t.delegate.schedule(n,r,o):e.prototype.schedule.call(this,n,r,o)},t.prototype.flush=function(e){var t,n=this.actions;if(this.active)return void n.push(e);this.active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=n.shift());if(this.active=!1,t){for(;e=n.shift();)e.unsubscribe();throw t}},t}(i.Scheduler)},58538(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueAction=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return o(t,e),t.prototype.schedule=function(t,n){return(void 0===n&&(n=0),n>0)?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)?e.prototype.requestAsyncId.call(this,t,n,r):t.flush(this)},t}(n(70469).AsyncAction)},78831(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueScheduler=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(n(25646).AsyncScheduler)},73766(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(82900);t.asapScheduler=new(n(3069)).AsapScheduler(r.AsapAction),t.asap=t.asapScheduler},86735(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(70469);t.asyncScheduler=new(n(25646)).AsyncScheduler(r.AsyncAction),t.async=t.asyncScheduler},63792(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(58538);t.queueScheduler=new(n(78831)).QueueScheduler(r.QueueAction),t.queue=t.queueScheduler},78258(e,t){"use strict";function n(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(t,"__esModule",{value:!0}),t.getSymbolIterator=n,t.iterator=n(),t.$$iterator=t.iterator},46713(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},58636(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rxSubscriber="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),t.$$rxSubscriber=t.rxSubscriber},2519(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentOutOfRangeError=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}()},62637(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyError=function(){function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e}()},42839(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=1,r=Promise.resolve(),o={};function i(e){return e in o&&(delete o[e],!0)}t.Immediate={setImmediate:function(e){var t=n++;return o[t]=!0,r.then(function(){return i(t)&&e()}),t},clearImmediate:function(e){i(e)}},t.TestTools={pending:function(){return Object.keys(o).length}}},18860(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUnsubscribedError=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}()},31027(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeoutError=function(){function e(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return e.prototype=Object.create(Error.prototype),e}()},11806(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscriptionError=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}()},21226(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(77759);t.canReportError=function(e){for(;e;){var t=e,n=t.closed,o=t.destination,i=t.isStopped;if(n||i)return!1;e=o&&o instanceof r.Subscriber?o:null}return!0}},59468(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hostReportError=function(e){setTimeout(function(){throw e},0)}},78522(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identity=function(e){return e}},80743(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArray=Array.isArray||function(e){return e&&"number"==typeof e.length}},90624(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},66740(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDate=function(e){return e instanceof Date&&!isNaN(+e)}},84864(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=function(e){return"function"==typeof e}},67606(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(46713);t.isInteropObservable=function(e){return e&&"function"==typeof e[r.observable]}},74442(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(78258);t.isIterable=function(e){return e&&"function"==typeof e[r.iterator]}},19673(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(80743);t.isNumeric=function(e){return!r.isArray(e)&&e-parseFloat(e)+1>=0}},6727(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=function(e){return null!==e&&"object"==typeof e}},94215(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=function(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}},23935(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScheduler=function(e){return e&&"function"==typeof e.schedule}},53912(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=function(){}},86484(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.not=function(e,t){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=e,n.thisArg=t,n}},27928(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(78522);function o(e){return 0===e.length?r.identity:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(e)},t.pipeFromArray=o},41727(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(422),o=n(63266),i=n(47429),a=n(13394),s=n(90624),l=n(94215),u=n(6727),c=n(78258),d=n(46713);t.subscribeTo=function(e){if(e&&"function"==typeof e[d.observable])return a.subscribeToObservable(e);if(s.isArrayLike(e))return r.subscribeToArray(e);if(l.isPromise(e))return o.subscribeToPromise(e);if(e&&"function"==typeof e[c.iterator])return i.subscribeToIterable(e);throw TypeError("You provided "+(u.isObject(e)?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},422(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeToArray=function(e){return function(t){for(var n=0,r=e.length;n<r&&!t.closed;n++)t.next(e[n]);t.complete()}}},47429(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(78258);t.subscribeToIterable=function(e){return function(t){for(var n=e[r.iterator]();;){var o=void 0;try{o=n.next()}catch(e){return t.error(e),t}if(o.done){t.complete();break}if(t.next(o.value),t.closed)break}return"function"==typeof n.return&&t.add(function(){n.return&&n.return()}),t}}},13394(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(46713);t.subscribeToObservable=function(e){return function(t){var n=e[r.observable]();if("function"==typeof n.subscribe)return n.subscribe(t);throw TypeError("Provided object does not correctly implement Symbol.observable")}}},63266(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(59468);t.subscribeToPromise=function(e){return function(t){return e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,r.hostReportError),t}}},87778(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1359),o=n(41727),i=n(95092);t.subscribeToResult=function(e,t,n,a,s){if(void 0===s&&(s=new r.InnerSubscriber(e,n,a)),!s.closed)return t instanceof i.Observable?t.subscribe(s):o.subscribeTo(t)(s)}},67595(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(77759),o=n(58636),i=n(74143);t.toSubscriber=function(e,t,n){if(e){if(e instanceof r.Subscriber)return e;if(e[o.rxSubscriber])return e[o.rxSubscriber]()}return e||t||n?new r.Subscriber(e,t,n):new r.Subscriber(i.empty)}},99549(e,t,n){"use strict";n(18780).audit,n(13441).auditTime,n(11853).buffer,n(77650).bufferCount,n(94360).bufferTime,n(43381).bufferToggle,n(51069).bufferWhen,n(85916).catchError,n(90239).combineAll,n(79397).combineLatest,n(66255).concat,n(60208).concatAll,n(92209).concatMap,n(83232).concatMapTo,n(85476).count,n(59768).debounce,n(92661).debounceTime,n(90952).defaultIfEmpty,n(17436).delay,n(41136).delayWhen,n(56051).dematerialize,n(85343).distinct,n(88179).distinctUntilChanged,n(43670).distinctUntilKeyChanged,n(57366).elementAt,n(61650).endWith,n(92472).every,n(65893).exhaust,n(29219).exhaustMap,n(76527).expand,n(64629).filter,n(4349).finalize,n(32376).find,n(8674).findIndex,n(77089).first,n(36217).groupBy,n(76024).ignoreElements,n(87362).isEmpty,n(6047).last,t.map=n(89233).map,n(27296).mapTo,n(75434).materialize,n(57001).max,n(14779).merge,n(80980).mergeAll;var r=n(60781);r.mergeMap,r.flatMap,n(62988).mergeMapTo,n(86430).mergeScan,n(21547).min,n(49529).multicast,n(24654).observeOn,n(45276).onErrorResumeNext,n(98155).pairwise,n(27337).partition,n(86050).pluck,n(96904).publish,n(82334).publishBehavior,n(20232).publishLast,n(24355).publishReplay,n(89646).race,n(71929).reduce,n(30068).repeat,n(58440).repeatWhen,n(39933).retry,n(53325).retryWhen,n(85203).refCount,n(27677).sample,n(88360).sampleTime,n(85002).scan,n(54332).sequenceEqual,n(49184).share,n(91451).shareReplay,n(76003).single,n(67124).skip,n(31444).skipLast,n(51026).skipUntil,n(79159).skipWhile,n(89155).startWith,n(30162).subscribeOn,n(21324).switchAll,n(20917).switchMap,n(35428).switchMapTo,t.take=n(85624).take,n(96696).takeLast,n(41534).takeUntil,n(5179).takeWhile,n(68022).tap,n(15019).throttle,n(7406).throttleTime,n(8347).throwIfEmpty,n(61115).timeInterval,n(82784).timeout,n(35816).timeoutWith,n(20367).timestamp,n(89133).toArray,n(22363).window,n(32216).windowCount,n(93886).windowTime,n(83903).windowToggle,n(27539).windowWhen,n(76788).withLatestFrom,n(64868).zip,n(85517).zipAll},72481(e,t,n){"use strict";let r,o,i,a,s,l,u,c,d,f,p,h,m;n.r(t),n.d(t,{GenderUnknownIcon:()=>mF,evaluateAsNumber:()=>di,getImportMapOverrideMap:()=>i1,StockManagementPictogram:()=>O1,ChemistryIcon:()=>m_,BabyIcon:()=>mc,DashboardExtension:()=>yF,openmrsComponentDecorator:()=>pD,tryRegisterExtension:()=>hB,pictogramIds:()=>Oj,ActivityIcon:()=>mo,compile:()=>du,removeRouteMapOverride:()=>a_,checkStatus:()=>d$,TableBatchActions:()=>h4,getAsyncLifecycle:()=>pk,subscribeOpenmrsEvent:()=>cV,dispatchConnectivityChanged:()=>g,PasswordIcon:()=>m8,Assessment2Pictogram:()=>ON,CloseIcon:()=>mO,setupRouteMapOverrides:()=>aE,getWorkspaceGroupRegistration:()=>fA,registerWorkspace:()=>fC,useFeatureFlag:()=>p6,reset:()=>fw,LabOrderIcon:()=>mZ,VisitMode:()=>cq,offlineUuidPrefix:()=>cb,useLocations:()=>hm,getLifecycle:()=>pO,formatDatetime:()=>EH,getVisitsForPatient:()=>c2,subscribeConnectivity:()=>v,formatPartialDate:()=>EU,CustomOverflowMenu:()=>me,LocationIcon:()=>mJ,GroupIcon:()=>mV,canBeginEditSynchronizationItemsOfType:()=>cc,VisitStatus:()=>cZ,createUseStore:()=>f6,getCurrentImportMap:()=>ar,getSessionLocation:()=>oJ,usePatient:()=>hx,useRenderableExtensions:()=>hE,getOpenedWindowIndexByWorkspace:()=>f$,checkStatusFor:()=>dL,clearHistory:()=>oT,clearConfigErrors:()=>nz,formatTime:()=>Ez,isDevEnabled:()=>o1,setLeftNav:()=>fx,syncOfflinePatientData:()=>cI,closeWorkspaceGroup2:()=>Pn,getCurrentRouteMap:()=>ay,ConfigurableLink:()=>fQ,sessionStore:()=>oU,subscribeSnackbarShown:()=>M,getDynamicOfflineDataEntriesFor:()=>cD,getLoggedInUser:()=>oY,GenderMaleIcon:()=>m$,getExtensionSlotConfigFromStore:()=>t7,evaluateAsNumberAsync:()=>da,putDynamicOfflineDataFor:()=>ck,getImportMapDefaultMap:()=>iX,unregisterExtensionRendering:()=>dZ,implementerToolsConfigStore:()=>nd,Type:()=>tG,InPatientPictogram:()=>OK,cleanupObsoleteFeatureFlags:()=>dT,getAttachmentsUrl:()=>aP,showSnackbar:()=>ki,PatientBannerActionsMenu:()=>OS,PatientSearchPictogram:()=>Oq,DocumentAttachmentIcon:()=>mj,Snackbar:()=>ke,CardiologyPictogram:()=>OI,ImageMedicalIcon:()=>mK,ActionableNotificationComponent:()=>DJ,DiagnosisTags:()=>Dk,iconIds:()=>mr,PatientsPictogram:()=>OZ,interpolateUrl:()=>oS,setupHistory:()=>oP,subscribeToastShown:()=>N,detachAll:()=>fm,convertToLocaleCalendar:()=>EG,DocumentIcon:()=>mC,configInternalStore:()=>t1,ActionMenuButton2:()=>Pb,setupDynamicOfflineDataHandler:()=>cS,makeUrl:()=>oL,oneOf:()=>nQ,selectPreferredName:()=>Oc,launchWorkspaceGroup:()=>function e(t,n){let r=fA(t),{state:o,onWorkspaceGroupLaunch:i,workspaceGroupCleanup:a,workspaceToLaunch:s}=n,l=function(){return kD}();if(l.getState().openWorkspaces.length){let r=l.getState().workspaceGroup;r?kp(r?.name,()=>{e(t,n)}):kC(()=>{e(t,n)})}else l.setState(e=>({...e,workspaceGroup:{name:t,members:r.members,cleanup:a}})),kN(t,o),i?.(),s&&km(s.name,s.additionalProps??{})},syncDynamicOfflineData:()=>cT,MobileCheckIcon:()=>m4,createErrorHandler:()=>$,openmrsObservableFetch:()=>oB,parseDate:()=>EI,getAttachmentByUuid:()=>aO,LeftNavMenu:()=>DA,getExtensionRegistration:()=>fd,ShoppingCartAddItemIcon:()=>yI,ReferralOrderIcon:()=>yi,ReportIcon:()=>ys,dispatchToastShown:()=>T,getImportMapNextPageMap:()=>i0,registerExtension:()=>ff,setupOfflineSync:()=>cp,DownloadIcon:()=>mT,useConnectivity:()=>pY,provide:()=>nE,getSynchronizationItemsFor:()=>ci,ShoppingCartArrowDownIcon:()=>yh,featureFlagsStore:()=>dC,promptBeforeClosing:()=>kb,removeDynamicOfflineDataFor:()=>cC,jsep:()=>c6,GeriatricsPictogram:()=>OU,SearchIcon:()=>yc,reportError:()=>I,slugify:()=>ae,isOmrsDateToday:()=>EA,getExtensionStore:()=>dY,BloodBankPictogram:()=>OM,TriagePictogram:()=>O4,Workspace2:()=>Pf,refetchCurrentUser:()=>oG,CheckmarkOutlineIcon:()=>mw,registerExtensionSlot:()=>fv,AllergiesIcon:()=>yR,ArrowDownIcon:()=>ma,useOpenmrsInfinite:()=>ho,getExtensionConfigFromExtensionSlotStore:()=>nt,OpenmrsDatePicker:()=>DD,getExtensionConfigFromStore:()=>ne,getDynamicOfflineDataEntries:()=>cE,getLocaleDisplayName:()=>S9,messageOmrsServiceWorker:()=>aG,navigate:()=>oD,launchWorkspace2:()=>Pr,getGroupByWindowName:()=>fI,CustomOverflowMenuItem:()=>mt,isUrl:()=>nJ,CaretDownIcon:()=>mp,ArrowLeftIcon:()=>ms,FacilityPictogram:()=>OV,ViewOffIcon:()=>yC,setCurrentOfflineMode:()=>a1,updateInternalExtensionStore:()=>dW,dispatchActionableNotificationShown:()=>C,resetRouteMapOverrides:()=>ax,formatDurationBetween:()=>E1,defaultVisitCustomRepresentation:()=>cY,getBreadcrumbsFor:()=>n7,useOpenmrsPagination:()=>p7,Pagination:()=>Oi,CheckmarkFilledIcon:()=>mv,clearCurrentUser:()=>oq,showModal:()=>DG,ChevronUpIcon:()=>mD,saveVisit:()=>c0,useAttachments:()=>pK,Pictogram:()=>O9,useExtensionSlot:()=>pt,ChevronDownIcon:()=>mx,OpenmrsDateRangePicker:()=>DO,deleteAttachmentPermanently:()=>aj,getVisitTypes:()=>cH,OverflowMenuHorizontalIcon:()=>m7,EventScheduleIcon:()=>mN,getSessionStore:()=>oz,ActionMenu:()=>k2,ProcedureOrderIcon:()=>yr,preloadImport:()=>an,registerWorkspaceWindows2:()=>fF,useOnVisible:()=>hg,setSessionLocation:()=>oQ,userHasAccess:()=>oZ,ChartAverageIcon:()=>mg,getFeatureFlag:()=>dR,UserAvatarIcon:()=>yD,renderExtension:()=>fq,useFhirInfinite:()=>hu,toVisitTypeObject:()=>cz,useSession:()=>hD,EmergencyDepartmentPictogram:()=>OB,Notification:()=>DZ,dispatchSnackbarShown:()=>j,getSynchronizationItem:()=>cu,navigateAndLaunchWorkspace:()=>ky,omrsOfflineCachingStrategyHttpHeaderName:()=>aH,formatDate:()=>EW,workspace2StoreActions:()=>Pa,SwitcherIcon:()=>yf,esmStyleGuideSchema:()=>h0,getImportMapDisabledOverrides:()=>i2,useAssignedExtensionIds:()=>pU,CaretRightIcon:()=>mm,evaluateAsType:()=>ds,PageHeader:()=>Or,TranslateIcon:()=>y_,setUserProperties:()=>oX,MovementIcon:()=>m5,renderInlineNotifications:()=>D3,subscribePrecacheStaticDependencies:()=>S,PaymentsDeskPictogram:()=>OY,usePrimaryIdentifierCode:()=>hS,dispatchPrecacheStaticDependencies:()=>x,getCurrentUser:()=>oK,useLayoutType:()=>hd,XrayPictogram:()=>O3,CaretUpIcon:()=>my,renderActionableNotifications:()=>D5,OpenmrsAppContext:()=>p$,setupModals:()=>DH,omrsOfflineResponseBodyHttpHeaderName:()=>aK,getDefaultsFromConfigSchema:()=>function e(t){let n={};for(let r of Object.keys(t))if(PI(t[r])&&t[r].hasOwnProperty("_default"))n[r]=t[r]._default;else{if(r.startsWith("_"))continue;PI(t[r])?n[r]=e(t[r]):n[r]=t[r]}return n},subscribeTo:()=>Q,recordConfigDerivationError:()=>nu,useAbortController:()=>pF,Extension:()=>fX,getFhirServerPaginationHandlers:()=>ht,useConnectedExtensions:()=>pZ,registerApp:()=>hU,queueSynchronizationItemFor:()=>cr,HospitalBedIcon:()=>mW,useExtensionInternalStore:()=>p2,configExtensionStore:()=>t4,getSynchronizationItems:()=>cs,getExtensionSlotsConfigStore:()=>t6,registerExtensionRendering:()=>dq,RenderIfValueIsTruthy:()=>pL,registerFeatureFlag:()=>dj,useFhirFetchAll:()=>hl,restBaseUrl:()=>oM,CalendarHeatMapIcon:()=>md,getWorkspaceRegistration:()=>fR,isImportMapOverrideDisabled:()=>i4,resetConfigSystem:()=>nH,getFullSynchronizationItems:()=>cl,getExtensionInternalStore:()=>dV,registerGlobalStore:()=>Y,runSynchronization:()=>ce,evaluateAsBoolean:()=>dn,PatientBannerPatientInfo:()=>Ow,addRouteMapOverride:()=>aw,getDefaultCalendar:()=>EB,SettingsIcon:()=>yd,DrugOrderIcon:()=>mR,isOnline:()=>dM,ProgramsIcon:()=>yo,useAssignedExtensions:()=>pe,CloseFilledIcon:()=>mk,canAccessStorage:()=>PM,registerDefaultCalendar:()=>EF,TreeViewAltIcon:()=>yS,OverflowMenuVerticalIcon:()=>m9,clearConfigDerivationError:()=>nc,getConfigStore:()=>t3,registerWorkspaceGroup:()=>fj,InformationSquareIcon:()=>mG,EmptyCard:()=>Dj,ChevronLeftIcon:()=>mS,RadiologyIcon:()=>yM,useCandidateExtensions:()=>pW,renderToasts:()=>kc,isDesktop:()=>hf,integrateBreakpoints:()=>hG,RegistrationPictogram:()=>OX,CardHeader:()=>hJ,getExtensionRegistrationFrom:()=>fc,InformationIcon:()=>mz,TrashCanIcon:()=>yx,useShallowStableValue:()=>f0,useOpenmrsSWR:()=>hb,Assessment1Pictogram:()=>OA,finishRegisteringAllApps:()=>hW,importDynamic:()=>at,useFhirPagination:()=>he,useVisitContextStore:()=>hA,ArrowUpIcon:()=>mu,showActionableNotification:()=>D7,getDynamicOfflineDataHandlers:()=>cx,useForceUpdate:()=>p5,updateWorkspaceWindowState:()=>kk,useVisit:()=>hN,PatientBannerPatientIdentifiers:()=>Oy,WorkspaceNotification:()=>kH,TransferPictogram:()=>O2,usePagination:()=>hv,Breakpoint:()=>hK,PatientBannerToggleContactDetailsButton:()=>Pv,CloseOutlineIcon:()=>mP,ObstetricsPictogram:()=>OG,parseDateInput:()=>EZ,getConfig:()=>nO,attach:()=>fp,getLocale:()=>S8,ActionMenuButton:()=>kF,isUrlWithTemplateParameters:()=>nY,useEmrConfiguration:()=>p1,useLeftNav:()=>hp,ToolsIcon:()=>yw,ErrorState:()=>DT,detach:()=>fh,setCurrentVisit:()=>cX,registerOmrsServiceWorker:()=>aU,ConditionsIcon:()=>yN,SaveIcon:()=>yu,activateOfflineCapability:()=>a2,useWorkspaces:()=>kj,resetWorkspaceStore:()=>kA,useConfig:()=>pq,validator:()=>tq,CalendarIcon:()=>mf,getHistory:()=>oC,StickyNoteAddIcon:()=>ym,useWorkspace2Store:()=>Ps,getPatientName:()=>Oa,getVisitStore:()=>cQ,getCoreTranslation:()=>iV,registerModuleWithConfigSystem:()=>nw,isOfflineUuid:()=>cw,registerModuleLoad:()=>n_,getBreadcrumbs:()=>n3,extractVariableNames:()=>dO,getOfflineSynchronizationStore:()=>u8,translateFrom:()=>iB,EditIcon:()=>mA,useStoreWithActions:()=>f3,getCandidateExtensions:()=>fb,putDynamicOfflineData:()=>cO,shallowEqual:()=>F,subscribeNotificationShown:()=>R,MaximizeIcon:()=>mX,promptForClosingWorkspaces:()=>Pi,WarningIcon:()=>yT,closeAllWorkspaces:()=>kC,fhirBaseUrl:()=>oI,matchLocale:()=>PN,registerBreadcrumb:()=>n2,usePatientPhoto:()=>OO,EventsIcon:()=>mM,createGlobalStore:()=>Z,workspaceStore:()=>kD,getCurrentOfflineMode:()=>a0,subscribeToFeatureFlag:()=>dA,useExtensionStore:()=>p3,closeWorkspace:()=>kx,createAttachment:()=>aC,useLeftNavStore:()=>hh,TableIcon:()=>yb,Icon:()=>yL,InformationFilledIcon:()=>mH,getCurrentPageMap:()=>iQ,LaboratoryPictogram:()=>Oz,temporaryConfigStore:()=>t2,getPromptBeforeClosingFcn:()=>kv,toDateObjectStrict:()=>EN,defineConfigSchema:()=>nv,filterBreadcrumbs:()=>n5,invalidateImplementerToolsConfig:()=>ns,PatientBannerContactDetails:()=>PD,getAssignedExtensions:()=>fg,PatientPhoto:()=>OC,MaterialOrderIcon:()=>mQ,MicroscopeIcon:()=>m2,scheduleRecomputation:()=>d1,PharmacyPictogram:()=>OJ,AttachmentIcon:()=>yA,MoneyIcon:()=>m3,getAttachments:()=>ak,getFullSynchronizationItemsFor:()=>ca,PageHeaderContent:()=>Oo,MedicationIcon:()=>m0,PrinterIcon:()=>yn,getWorkspaceGroupStore:()=>kN,PatientListsPictogram:()=>O5,useAppContext:()=>pB,isOpenmrsRoutes:()=>aa,AppointmentsAltPictogram:()=>OR,GenericOrderTypeIcon:()=>mB,batchExtensionUpdates:()=>dX,useExtensionSlotStore:()=>f9,ViewIcon:()=>yj,formattedName:()=>Ou,sessionEndpoint:()=>o$,duration:()=>EX,resetImportMapOverrides:()=>i5,TableOfContentsIcon:()=>yg,CaretLeftIcon:()=>mh,getTranslationOverrides:()=>nk,isVersionSatisfied:()=>PF,EmptyCardIllustration:()=>DC,PenIcon:()=>yt,getWorkspaceStore:()=>kO,registerOfflinePatientHandler:()=>cM,setupImportMapOverrides:()=>i8,showToast:()=>kd,useDefineAppContext:()=>pI,validators:()=>nX,getGlobalStore:()=>J,useOnClickOutside:()=>hy,getWindowByWorkspaceName:()=>fM,ArrowRightIcon:()=>ml,loadLifeCycles:()=>h$,registerBreadcrumbs:()=>n4,MotherIcon:()=>m6,fetchCurrentPatient:()=>cL,Toast:()=>ka,MessageQueueIcon:()=>m1,TwoFactorAuthenticationIcon:()=>yE,Pharmacy2Pictogram:()=>OQ,goBackInHistory:()=>oj,GroupAccessIcon:()=>mU,getExtensionRenderingsStore:()=>dU,setImplementerToolsConfigRecomputer:()=>na,getAsyncExtensionLifecycle:()=>pC,setupApiModule:()=>o4,renderLoadingSpinner:()=>PO,WorkspaceContainer:()=>k4,showNotification:()=>D6,queueSynchronizationItem:()=>co,getModalRegistration:()=>fO,ListCheckedIcon:()=>mY,ResponsiveWrapper:()=>O8,GynaecologyPictogram:()=>OW,ShoppingCartIcon:()=>yp,getRouteMapNextPageMap:()=>ab,updateVisit:()=>c1,backendDependencies:()=>o2,MaybePictogram:()=>O7,beginEditSynchronizationItem:()=>cd,createParcelMounter:()=>fH,getStartedVisit:()=>c4,omrsOfflineResponseStatusHttpHeaderName:()=>az,isOpenmrsAppRoutes:()=>ai,openmrsFetch:()=>oF,HomePictogram:()=>O6,DentistryPictogram:()=>OL,ServiceQueuesPictogram:()=>O0,toLanguageTag:()=>S7,launchWorkspace:()=>km,setFeatureFlag:()=>dN,useStore:()=>f4,DigitalTrustPictogram:()=>OF,NumericObservation:()=>Ot,attachmentUrl:()=>aD,interpolateString:()=>oE,inRange:()=>nZ,useExtensionSlotMeta:()=>p4,AppointmentsPictogram:()=>OT,renderSnackbars:()=>ko,getRegisteredWorkspace2Names:()=>Pu,toLocationObject:()=>cW,ChartLineIcon:()=>mb,UserHasAccess:()=>hO,evaluateAsBooleanAsync:()=>dr,changeWorkspaceContext:()=>kS,createDashboard:()=>yB,getLocations:()=>cK,getOfflineDb:()=>u6,canCloseWorkspaceWithoutPrompting:()=>kf,getExtensionsConfigStore:()=>t9,getRouteMapDefaultMap:()=>ag,age:()=>Of,syncAllDynamicOfflineData:()=>cj,isOmrsDateStrict:()=>ER,registerWorkspaceGroups2:()=>fL,usePaginationInfo:()=>hw,evaluateAsync:()=>dt,useOpenmrsFetchAll:()=>ha,removeImportMapOverride:()=>i6,showWorkspacePrompts:()=>kT,useVisitTypes:()=>hM,ageAsDuration:()=>Od,removeDynamicOfflineData:()=>cP,getExtensionNameFromId:()=>fu,deleteSynchronizationItem:()=>cf,renderParcel:()=>fz,useWorkspace2Context:()=>Pl,ResetIcon:()=>yl,RenewIcon:()=>ya,subscribeActionableNotificationShown:()=>A,ErrorCard:()=>DR,GenderFemaleIcon:()=>mI,enableImportMapOverride:()=>i7,getOfflinePatientDataStore:()=>cN,retry:()=>PB,ComponentContext:()=>fJ,ExtensionSlot:()=>pr,getOmrsServiceWorker:()=>aW,addImportMapOverride:()=>i3,subscribeConnectivityChanged:()=>b,unsetLeftNav:()=>fS,MaybeIcon:()=>y$,useCustomOverflowMenu:()=>h8,PedestrianFamilyIcon:()=>ye,generateOfflineUuid:()=>cv,cancelPrompt:()=>kw,CtScanPictogram:()=>O$,dispatchNotificationShown:()=>P,leftNavStore:()=>f_,OpenmrsFetchError:()=>oV,UserFollowIcon:()=>yO,launchWorkspaceGroup2:()=>Pt,ChevronRightIcon:()=>mE,UserXrayIcon:()=>yk,GenderOtherIcon:()=>mL,formatDuration:()=>Eq,toOmrsIsoString:()=>EM,Labs2Pictogram:()=>OH,workspace2Store:()=>fN,setUserLanguage:()=>oH,useBodyScrollLock:()=>pz,getExtensionConfig:()=>t8,SyringeIcon:()=>yy,LocationPicker:()=>DN,useDebounce:()=>pJ,TimeIcon:()=>yv,getExtensionSlotConfig:()=>t5,AddIcon:()=>mi,getRouteMapOverrideMap:()=>av,processConfig:()=>nP,InventoryManagementIcon:()=>mq,registerWorkspaces2:()=>fB,UserIcon:()=>yP,formatPatientName:()=>Ol,fireOpenmrsEvent:()=>cB,registerModal:()=>fD,registerTranslationNamespace:()=>nx,displayName:()=>Os,evaluate:()=>de,defineExtensionConfigSchema:()=>nS,renderWorkspaceWindowsAndMenu:()=>PR,getSyncLifecycle:()=>pP,evaluateAsTypeAsync:()=>dl});let y="openmrs:connectivity-changed";function g(e){window.dispatchEvent(new CustomEvent(y,{detail:{online:e}}))}function b(e){if(!window.offlineEnabled)return()=>{};let t=t=>e(t.detail);return window.addEventListener(y,t),()=>window.removeEventListener(y,t)}function v(e){return e({online:!window.offlineEnabled||navigator.onLine}),b(e)}let w="openmrs:precache-static-dependencies";function x(e={}){window.dispatchEvent(new CustomEvent(w,{detail:e}))}function S(e){let t=t=>e(t.detail);return window.addEventListener(w,t),()=>window.removeEventListener(w,t)}let E="openmrs:notification-shown",D="openmrs:actionable-notification-shown",O="openmrs:toast-shown",k="openmrs:snack-bar-shown";function P(e){window.dispatchEvent(new CustomEvent(E,{detail:e}))}function C(e){window.dispatchEvent(new CustomEvent(D,{detail:e}))}function j(e){window.dispatchEvent(new CustomEvent(k,{detail:e}))}function T(e){window.dispatchEvent(new CustomEvent(O,{detail:e}))}function R(e){let t=t=>e(t.detail);return window.addEventListener(E,t),()=>window.removeEventListener(E,t)}function A(e){let t=t=>e(t.detail);return window.addEventListener(D,t),()=>window.removeEventListener(D,t)}function N(e){let t=t=>e(t.detail);return window.addEventListener(O,t),()=>window.removeEventListener(O,t)}function M(e){let t=t=>e(t.detail);return window.addEventListener(k,t),()=>window.removeEventListener(k,t)}function I(e){let t=L(e);setTimeout(()=>{throw t})}function $(){let e=Error();return t=>{let n=L(t);n.stack+=`
1
+ (globalThis.webpackChunk_openmrs_esm_form_engine_app=globalThis.webpackChunk_openmrs_esm_form_engine_app||[]).push([["810"],{85602(e){e.exports=function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}},44397(e){e.exports=function(e,t,n){var r=t.prototype,o=function(e){var t=e.date,o=e.utc,i={};if(!(null===t||t instanceof Date||t instanceof Array||r.$utils().u(t)||"Object"!==t.constructor.name)){if(!Object.keys(t).length)return new Date;var a=o?n.utc():n();Object.keys(t).forEach(function(e){var n;i["date"===(n=r.$utils().p(e))?"day":n]=t[e]});var s=i.day||(i.year||i.month>=0?1:a.date()),l=i.year||a.year(),u=i.month>=0?i.month:i.year||i.day?0:a.month(),c=i.hour||0,d=i.minute||0,f=i.second||0,p=i.millisecond||0;return o?new Date(Date.UTC(l,u,s,c,d,f,p)):new Date(l,u,s,c,d,f,p)}return t},i=r.parse;r.parse=function(e){e.date=o.bind(this)(e),i.bind(this)(e)};var a=r.set,s=r.add,l=r.subtract,u=function(e,t,n,r){void 0===r&&(r=1);var o=Object.keys(t),i=this;return o.forEach(function(n){i=e.bind(i)(t[n]*r,n)}),i};r.set=function(e,t){return t=void 0===t?e:t,"Object"===e.constructor.name?u.bind(this)(function(e,t){return a.bind(this)(t,e)},t,e):a.bind(this)(e,t)},r.add=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t):s.bind(this)(e,t)},r.subtract=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t,-1):l.bind(this)(e,t)}}},57657(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,o,i){var a=o.prototype;i.utc=function(e){var t={date:e,utc:!0,args:arguments};return new o(t)},a.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var u=a.utcOffset;a.utcOffset=function(r,o){var i=this.$utils().u;if(i(r))return this.$u?0:i(this.$offset)?u.call(this):this.$offset;if("string"==typeof r&&null===(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var o=(""+r[0]).match(n)||["-",0,0],i=o[0],a=60*o[1]+ +o[2];return 0===a?0:"+"===i?a:-a}(r)))return this;var a=16>=Math.abs(r)?60*r:r,s=this;if(o)return s.$offset=a,s.$u=0===r,s;if(0!==r){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+l,e)).$offset=a,s.$x.$localOffset=l}else s=this.utc();return s};var c=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var f=a.diff;a.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),o=i(e).local();return f.call(r,o,t,n)}}}()},35570(e,t,n){!function(t){"use strict";var r=n(19109);function o(e){return function(t,n){return"object"==typeof t&&(n=t,t=null),null==t&&(t=new Date().toString()),n||(n={}),e.call(this,t,n)}}var i=e.exports={generate:o(function(e,t){return new r(e,t)})};t&&(t.fn.geopattern=o(function(e,n){return this.each(function(){var r=t(this).attr("data-title-sha");r&&(n=t.extend({hash:r},n));var o=i.generate(e,n);t(this).css("background-image",o.toDataUrl())})}))}("u">typeof jQuery?jQuery:null)},51812(e){"use strict";e.exports={hex2rgb:function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,n,r){return t+t+n+n+r+r});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},rgb2hex:function(e){return"#"+["r","g","b"].map(function(t){return("0"+e[t].toString(16)).slice(-2)}).join("")},rgb2hsl:function(e){var t,n,r=e.r,o=e.g,i=e.b,a=Math.max(r/=255,o/=255,i/=255),s=Math.min(r,o,i),l=(a+s)/2;if(a===s)t=n=0;else{var u=a-s;switch(n=l>.5?u/(2-a-s):u/(a+s),a){case r:t=(o-i)/u+6*(o<i);break;case o:t=(i-r)/u+2;break;case i:t=(r-o)/u+4}t/=6}return{h:t,s:n,l:l}},hsl2rgb:function(e){function t(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var n,r,o,i=e.h,a=e.s,s=e.l;if(0===a)n=r=o=s;else{var l=s<.5?s*(1+a):s+a-s*a,u=2*s-l;n=t(u,l,i+1/3),r=t(u,l,i),o=t(u,l,i-1/3)}return{r:Math.round(255*n),g:Math.round(255*r),b:Math.round(255*o)}},rgb2rgbString:function(e){return"rgb("+[e.r,e.g,e.b].join(",")+")"}}},19109(e,t,n){"use strict";var r=n(64751),o=n(51812),i=n(32742),a=n(83153),s={baseColor:"#933c3c"},l=["octogons","overlappingCircles","plusSigns","xes","sineWaves","hexagons","overlappingRings","plaid","triangles","squares","concentricCircles","diamonds","tessellation","nestedSquares","mosaicSquares","chevrons"],u="#000";function c(e,t,n){return parseInt(e.substr(t,n||1),16)}function d(e,t,n,r,o){return(parseFloat(e)-t)*(o-r)/(n-t)+r}function f(e){return e%2==0?"#ddd":"#222"}function p(e){return d(e,0,15,.02,.15)}var h=e.exports=function(e,t){return this.opts=r({},s,t),this.hash=t.hash||i(e),this.svg=new a,this.generateBackground(),this.generatePattern(),this};function m(e){return[[e,0,e,3*e],[0,e,3*e,e]]}function y(e){return[0,0,e,e,0,e,0,0].join(",")}function g(e,t,n,r,o){var i=y(r),a=p(o[0]),s=f(o[0]),l={stroke:u,"stroke-opacity":.02,"fill-opacity":a,fill:s};e.polyline(i,l).transform({translate:[t+r,n],scale:[-1,1]}),e.polyline(i,l).transform({translate:[t+r,n+2*r],scale:[1,-1]}),l={stroke:u,"stroke-opacity":.02,"fill-opacity":a=p(o[1]),fill:s=f(o[1])},e.polyline(i,l).transform({translate:[t+r,n+2*r],scale:[-1,-1]}),e.polyline(i,l).transform({translate:[t+r,n],scale:[1,1]})}function b(e,t,n,r,o){var i=p(o),a=f(o),s=y(r),l={stroke:u,"stroke-opacity":.02,"fill-opacity":i,fill:a};e.polyline(s,l).transform({translate:[t,n+r],scale:[1,-1]}),e.polyline(s,l).transform({translate:[t+2*r,n+r],scale:[-1,-1]}),e.polyline(s,l).transform({translate:[t,n+r],scale:[1,1]}),e.polyline(s,l).transform({translate:[t+2*r,n+r],scale:[-1,1]})}h.prototype.toSvg=function(){return this.svg.toString()},h.prototype.toString=function(){return this.toSvg()},h.prototype.toBase64=function(){var e=this.toSvg();return"u">typeof window&&"function"==typeof window.btoa?window.btoa(e):new Buffer(e).toString("base64")},h.prototype.toDataUri=function(){return"data:image/svg+xml;base64,"+this.toBase64()},h.prototype.toDataUrl=function(){return'url("'+this.toDataUri()+'")'},h.prototype.generateBackground=function(){var e,t,n,r;this.opts.color?n=o.hex2rgb(this.opts.color):(t=d(c(this.hash,14,3),0,4095,0,359),r=c(this.hash,17),(e=o.rgb2hsl(o.hex2rgb(this.opts.baseColor))).h=(360*e.h-t+360)%360/360,r%2==0?e.s=Math.min(1,(100*e.s+r)/100):e.s=Math.max(0,(100*e.s-r)/100),n=o.hsl2rgb(e)),this.color=o.rgb2hex(n),this.svg.rect(0,0,"100%","100%",{fill:o.rgb2rgbString(n)})},h.prototype.generatePattern=function(){var e=this.opts.generator;if(e){if(0>l.indexOf(e))throw Error("The generator "+e+" does not exist.")}else e=l[c(this.hash,20)];return this["geo"+e.slice(0,1).toUpperCase()+e.slice(1)]()},h.prototype.geoHexagons=function(){var e,t,n,r,o,i,a,s,l,h=d(c(this.hash,0),0,15,8,60),m=h*Math.sqrt(3),y=2*h,g=(s=h/2,[0,l=Math.sin(60*Math.PI/180)*h,s,0,s+h,0,2*h,l,s+h,2*l,s,2*l,0,l].join(","));for(this.svg.setWidth(3*y+3*h),this.svg.setHeight(6*m),t=0,a=0;a<6;a++)for(i=0;i<6;i++)o=c(this.hash,t),e=i%2==0?a*m:a*m+m/2,n=p(o),r={fill:f(o),"fill-opacity":n,stroke:u,"stroke-opacity":.02},this.svg.polyline(g,r).transform({translate:[i*h*1.5-y/2,e-m/2]}),0===i&&this.svg.polyline(g,r).transform({translate:[6*h*1.5-y/2,e-m/2]}),0===a&&(e=i%2==0?6*m:6*m+m/2,this.svg.polyline(g,r).transform({translate:[i*h*1.5-y/2,e-m/2]})),0===i&&0===a&&this.svg.polyline(g,r).transform({translate:[6*h*1.5-y/2,5*m+m/2]}),t++},h.prototype.geoSineWaves=function(){var e,t,n,r,o,i,a,s=Math.floor(d(c(this.hash,0),0,15,100,400)),l=Math.floor(d(c(this.hash,1),0,15,30,100)),u=Math.floor(d(c(this.hash,2),0,15,3,30));for(this.svg.setWidth(s),this.svg.setHeight(36*u),t=0;t<36;t++)n=p(i=c(this.hash,t)),e=f(i),a=s/4*.7,o={fill:"none",stroke:e,opacity:n,"stroke-width":""+u+"px"},r="M0 "+l+" C "+a+" 0, "+(s/2-a)+" 0, "+s/2+" "+l+" S "+(s-a)+" "+2*l+", "+s+" "+l+" S "+(1.5*s-a)+" 0, "+1.5*s+", "+l,this.svg.path(r,o).transform({translate:[-s/4,u*t-1.5*l]}),this.svg.path(r,o).transform({translate:[-s/4,u*t-1.5*l+36*u]})},h.prototype.geoChevrons=function(){var e,t,n,r,o,i,a,s=d(c(this.hash,0),0,15,30,80),l=d(c(this.hash,0),0,15,30,80),h=(e=.66*l,[[0,0,s/2,l-e,s/2,l,0,e,0,0],[s/2,l-e,s,0,s,e,s/2,l,s/2,l-e]].map(function(e){return e.join(",")}));for(this.svg.setWidth(6*s),this.svg.setHeight(6*l*.66),t=0,a=0;a<6;a++)for(i=0;i<6;i++)n=p(o=c(this.hash,t)),r={stroke:u,"stroke-opacity":.02,fill:f(o),"fill-opacity":n,"stroke-width":1},this.svg.group(r).transform({translate:[i*s,a*l*.66-l/2]}).polyline(h).end(),0===a&&this.svg.group(r).transform({translate:[i*s,6*l*.66-l/2]}).polyline(h).end(),t+=1},h.prototype.geoPlusSigns=function(){var e,t,n,r,o,i,a,s,l=d(c(this.hash,0),0,15,10,25),h=3*l,y=m(l);for(this.svg.setWidth(12*l),this.svg.setHeight(12*l),n=0,s=0;s<6;s++)for(a=0;a<6;a++)r=p(i=c(this.hash,n)),t=f(i),e=+(s%2!=0),o={fill:t,stroke:u,"stroke-opacity":.02,"fill-opacity":r},this.svg.group(o).transform({translate:[a*h-a*l+e*l-l,s*h-s*l-h/2]}).rect(y).end(),0===a&&this.svg.group(o).transform({translate:[4*h-a*l+e*l-l,s*h-s*l-h/2]}).rect(y).end(),0===s&&this.svg.group(o).transform({translate:[a*h-a*l+e*l-l,4*h-s*l-h/2]}).rect(y).end(),0===a&&0===s&&this.svg.group(o).transform({translate:[4*h-a*l+e*l-l,4*h-s*l-h/2]}).rect(y).end(),n++},h.prototype.geoXes=function(){var e,t,n,r,o,i,a,s=d(c(this.hash,0),0,15,10,25),l=m(s),u=3*s*.943;for(this.svg.setWidth(3*u),this.svg.setHeight(3*u),t=0,a=0;a<6;a++)for(i=0;i<6;i++)n=p(o=c(this.hash,t)),e=i%2==0?a*u-.5*u:a*u-.5*u+u/4,r={fill:f(o),opacity:n},this.svg.group(r).transform({translate:[i*u/2-u/2,e-a*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===i&&this.svg.group(r).transform({translate:[6*u/2-u/2,e-a*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===a&&(e=i%2==0?6*u-u/2:6*u-u/2+u/4,this.svg.group(r).transform({translate:[i*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end()),5===a&&this.svg.group(r).transform({translate:[i*u/2-u/2,e-11*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===i&&0===a&&this.svg.group(r).transform({translate:[6*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),t++},h.prototype.geoOverlappingCircles=function(){var e,t,n,r,o,i,a=d(c(this.hash,0),0,15,25,200)/2;for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),e=0,i=0;i<6;i++)for(o=0;o<6;o++)t=p(r=c(this.hash,e)),n={fill:f(r),opacity:t},this.svg.circle(o*a,i*a,a,n),0===o&&this.svg.circle(6*a,i*a,a,n),0===i&&this.svg.circle(o*a,6*a,a,n),0===o&&0===i&&this.svg.circle(6*a,6*a,a,n),e++},h.prototype.geoOctogons=function(){var e,t,n,r,o,i,a,s=d(c(this.hash,0),0,15,10,60),l=[e=.33*s,0,s-e,0,s,e,s,s-e,s-e,s,e,s,0,s-e,0,e,e,0].join(",");for(this.svg.setWidth(6*s),this.svg.setHeight(6*s),n=0,a=0;a<6;a++)for(i=0;i<6;i++)r=p(o=c(this.hash,n)),t=f(o),this.svg.polyline(l,{fill:t,"fill-opacity":r,stroke:u,"stroke-opacity":.02}).transform({translate:[i*s,a*s]}),n+=1},h.prototype.geoSquares=function(){var e,t,n,r,o,i,a=d(c(this.hash,0),0,15,10,60);for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),t=0,i=0;i<6;i++)for(o=0;o<6;o++)n=p(r=c(this.hash,t)),e=f(r),this.svg.rect(o*a,i*a,a,a,{fill:e,"fill-opacity":n,stroke:u,"stroke-opacity":.02}),t+=1},h.prototype.geoConcentricCircles=function(){var e,t,n,r,o,i,a=d(c(this.hash,0),0,15,10,60),s=a/5;for(this.svg.setWidth((a+s)*6),this.svg.setHeight((a+s)*6),t=0,i=0;i<6;i++)for(o=0;o<6;o++)n=p(r=c(this.hash,t)),e=f(r),this.svg.circle(o*a+o*s+(a+s)/2,i*a+i*s+(a+s)/2,a/2,{fill:"none",stroke:e,opacity:n,"stroke-width":s+"px"}),n=p(r=c(this.hash,39-t)),e=f(r),this.svg.circle(o*a+o*s+(a+s)/2,i*a+i*s+(a+s)/2,a/4,{fill:e,"fill-opacity":n}),t+=1},h.prototype.geoOverlappingRings=function(){var e,t,n,r,o,i,a=d(c(this.hash,0),0,15,10,60),s=a/4;for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),e=0,i=0;i<6;i++)for(o=0;o<6;o++)t=p(r=c(this.hash,e)),n={fill:"none",stroke:f(r),opacity:t,"stroke-width":s+"px"},this.svg.circle(o*a,i*a,a-s/2,n),0===o&&this.svg.circle(6*a,i*a,a-s/2,n),0===i&&this.svg.circle(o*a,6*a,a-s/2,n),0===o&&0===i&&this.svg.circle(6*a,6*a,a-s/2,n),e+=1},h.prototype.geoTriangles=function(){var e,t,n,r,o,i,a,s,l=d(c(this.hash,0),0,15,15,80),h=l/2*Math.sqrt(3),m=[s=l/2,0,l,h,0,h,s,0].join(",");for(this.svg.setWidth(3*l),this.svg.setHeight(6*h),e=0,a=0;a<6;a++)for(i=0;i<6;i++)t=p(o=c(this.hash,e)),r={fill:f(o),"fill-opacity":t,stroke:u,"stroke-opacity":.02},n=a%2==0?180*(i%2==0):180*(i%2!=0),this.svg.polyline(m,r).transform({translate:[i*l*.5-l/2,h*a],rotate:[n,l/2,h/2]}),0===i&&this.svg.polyline(m,r).transform({translate:[6*l*.5-l/2,h*a],rotate:[n,l/2,h/2]}),e+=1},h.prototype.geoDiamonds=function(){var e,t,n,r,o,i,a,s=d(c(this.hash,0),0,15,10,50),l=d(c(this.hash,1),0,15,10,50),h=[s/2,0,s,l/2,s/2,l,0,l/2].join(",");for(this.svg.setWidth(6*s),this.svg.setHeight(3*l),t=0,a=0;a<6;a++)for(i=0;i<6;i++)n=p(o=c(this.hash,t)),r={fill:f(o),"fill-opacity":n,stroke:u,"stroke-opacity":.02},e=a%2==0?0:s/2,this.svg.polyline(h,r).transform({translate:[i*s-s/2+e,l/2*a-l/2]}),0===i&&this.svg.polyline(h,r).transform({translate:[6*s-s/2+e,l/2*a-l/2]}),0===a&&this.svg.polyline(h,r).transform({translate:[i*s-s/2+e,l/2*6-l/2]}),0===i&&0===a&&this.svg.polyline(h,r).transform({translate:[6*s-s/2+e,l/2*6-l/2]}),t+=1},h.prototype.geoNestedSquares=function(){var e,t,n,r,o,i,a=d(c(this.hash,0),0,15,4,12),s=7*a;for(this.svg.setWidth((s+a)*6+6*a),this.svg.setHeight((s+a)*6+6*a),e=0,i=0;i<6;i++)for(o=0;o<6;o++)t=p(r=c(this.hash,e)),n={fill:"none",stroke:f(r),opacity:t,"stroke-width":a+"px"},this.svg.rect(o*s+o*a*2+a/2,i*s+i*a*2+a/2,s,s,n),t=p(r=c(this.hash,39-e)),n={fill:"none",stroke:f(r),opacity:t,"stroke-width":a+"px"},this.svg.rect(o*s+o*a*2+a/2+2*a,i*s+i*a*2+a/2+2*a,3*a,3*a,n),e+=1},h.prototype.geoMosaicSquares=function(){var e,t,n,r=d(c(this.hash,0),0,15,15,50);for(this.svg.setWidth(8*r),this.svg.setHeight(8*r),e=0,n=0;n<4;n++)for(t=0;t<4;t++)t%2==0?n%2==0?b(this.svg,t*r*2,n*r*2,r,c(this.hash,e)):g(this.svg,t*r*2,n*r*2,r,[c(this.hash,e),c(this.hash,e+1)]):n%2==0?g(this.svg,t*r*2,n*r*2,r,[c(this.hash,e),c(this.hash,e+1)]):b(this.svg,t*r*2,n*r*2,r,c(this.hash,e)),e+=1},h.prototype.geoPlaid=function(){var e,t,n,r,o,i,a=0,s=0;for(t=0;t<36;)a+=c(this.hash,t)+5,n=p(i=c(this.hash,t+1)),e=f(i),r=i+5,this.svg.rect(0,a,"100%",r,{opacity:n,fill:e}),a+=r,t+=2;for(t=0;t<36;)s+=c(this.hash,t)+5,n=p(i=c(this.hash,t+1)),e=f(i),o=i+5,this.svg.rect(s,0,o,"100%",{opacity:n,fill:e}),s+=o,t+=2;this.svg.setWidth(s),this.svg.setHeight(a)},h.prototype.geoTessellation=function(){var e,t,n,r,o=d(c(this.hash,0),0,15,5,40),i=o*Math.sqrt(3),a=2*o,s=o/2*Math.sqrt(3),l=[0,0,s,o/2,0,o,0,0].join(","),h=3*o+2*s,m=2*i+2*o;for(this.svg.setWidth(h),this.svg.setHeight(m),e=0;e<20;e++)switch(t=p(r=c(this.hash,e)),n={stroke:u,"stroke-opacity":.02,fill:f(r),"fill-opacity":t,"stroke-width":1},e){case 0:this.svg.rect(-o/2,-o/2,o,o,n),this.svg.rect(h-o/2,-o/2,o,o,n),this.svg.rect(-o/2,m-o/2,o,o,n),this.svg.rect(h-o/2,m-o/2,o,o,n);break;case 1:this.svg.rect(a/2+s,i/2,o,o,n);break;case 2:this.svg.rect(-o/2,m/2-o/2,o,o,n),this.svg.rect(h-o/2,m/2-o/2,o,o,n);break;case 3:this.svg.rect(a/2+s,1.5*i+o,o,o,n);break;case 4:this.svg.polyline(l,n).transform({translate:[o/2,-o/2],rotate:[0,o/2,s/2]}),this.svg.polyline(l,n).transform({translate:[o/2,m- -o/2],rotate:[0,o/2,s/2],scale:[1,-1]});break;case 5:this.svg.polyline(l,n).transform({translate:[h-o/2,-o/2],rotate:[0,o/2,s/2],scale:[-1,1]}),this.svg.polyline(l,n).transform({translate:[h-o/2,m+o/2],rotate:[0,o/2,s/2],scale:[-1,-1]});break;case 6:this.svg.polyline(l,n).transform({translate:[h/2+o/2,i/2]});break;case 7:this.svg.polyline(l,n).transform({translate:[h-h/2-o/2,i/2],scale:[-1,1]});break;case 8:this.svg.polyline(l,n).transform({translate:[h/2+o/2,m-i/2],scale:[1,-1]});break;case 9:this.svg.polyline(l,n).transform({translate:[h-h/2-o/2,m-i/2],scale:[-1,-1]});break;case 10:this.svg.polyline(l,n).transform({translate:[o/2,m/2-o/2]});break;case 11:this.svg.polyline(l,n).transform({translate:[h-o/2,m/2-o/2],scale:[-1,1]});break;case 12:this.svg.rect(0,0,o,o,n).transform({translate:[o/2,o/2],rotate:[-30,0,0]});break;case 13:this.svg.rect(0,0,o,o,n).transform({scale:[-1,1],translate:[-h+o/2,o/2],rotate:[-30,0,0]});break;case 14:this.svg.rect(0,0,o,o,n).transform({translate:[o/2,m/2-o/2-o],rotate:[30,0,o]});break;case 15:this.svg.rect(0,0,o,o,n).transform({scale:[-1,1],translate:[-h+o/2,m/2-o/2-o],rotate:[30,0,o]});break;case 16:this.svg.rect(0,0,o,o,n).transform({scale:[1,-1],translate:[o/2,-m+m/2-o/2-o],rotate:[30,0,o]});break;case 17:this.svg.rect(0,0,o,o,n).transform({scale:[-1,-1],translate:[-h+o/2,-m+m/2-o/2-o],rotate:[30,0,o]});break;case 18:this.svg.rect(0,0,o,o,n).transform({scale:[1,-1],translate:[o/2,-m+o/2],rotate:[-30,0,0]});break;case 19:this.svg.rect(0,0,o,o,n).transform({scale:[-1,-1],translate:[-h+o/2,-m+o/2],rotate:[-30,0,0]})}}},32742(e){"use strict";function t(){var e=0x67452301,t=0xefcdab89,n=0x98badcfe,r=0x10325476,o=0xc3d2e1f0,i=new Uint32Array(80),a=0,s=24,l=0;function u(){for(var s,l,u=16;u<80;u++){var c=i[u-3]^i[u-8]^i[u-14]^i[u-16];i[u]=c<<1|c>>>31}var d=e,f=t,p=n,h=r,m=o;for(u=0;u<80;u++){u<20?(s=h^f&(p^h),l=0x5a827999):u<40?(s=f^p^h,l=0x6ed9eba1):u<60?(s=f&p|h&(f|p),l=0x8f1bbcdc):(s=f^p^h,l=0xca62c1d6);var y=(d<<5|d>>>27)+s+m+l+(0|i[u]);m=h,h=p,p=f<<30|f>>>2,f=d,d=y}for(u=0,e=e+d|0,t=t+f|0,n=n+p|0,r=r+h|0,o=o+m|0,a=0;u<16;u++)i[u]=0}function c(e){i[a]|=(255&e)<<s,s?s-=8:(a++,s=24),16===a&&u()}function d(e){for(var t="",n=28;n>=0;n-=4)t+=(e>>n&15).toString(16);return t}return{update:function(e){if("string"==typeof e){var t=e.length;l+=8*t;for(var n=0;n<t;n++)c(e.charCodeAt(n));return}var r=e.length;l+=8*r;for(var o=0;o<r;o++)c(e[o])},digest:function(){c(128),(a>14||14===a&&s<24)&&u(),a=14,s=24,c(0),c(0),c(l>0xffffffffff?l/0x10000000000:0),c(l>0xffffffff?l/0x100000000:0);for(var i=24;i>=0;i-=8)c(l>>i);return d(e)+d(t)+d(n)+d(r)+d(o)}}}e.exports=function(e){if(void 0===e)return t();var n=t();return n.update(e),n.digest()}},83153(e,t,n){"use strict";var r=n(64751),o=n(57338);function i(){return this.width=100,this.height=100,this.svg=o("svg"),this.context=[],this.setAttributes(this.svg,{xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height}),this}e.exports=i,i.prototype.currentContext=function(){return this.context[this.context.length-1]||this.svg},i.prototype.end=function(){return this.context.pop(),this},i.prototype.currentNode=function(){var e=this.currentContext();return e.lastChild||e},i.prototype.transform=function(e){return this.currentNode().setAttribute("transform",Object.keys(e).map(function(t){return t+"("+e[t].join(",")+")"}).join(" ")),this},i.prototype.setAttributes=function(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})},i.prototype.setWidth=function(e){this.svg.setAttribute("width",Math.floor(e))},i.prototype.setHeight=function(e){this.svg.setAttribute("height",Math.floor(e))},i.prototype.toString=function(){return this.svg.toString()},i.prototype.rect=function(e,t,n,i,a){var s=this;if(Array.isArray(e))return e.forEach(function(e){s.rect.apply(s,e.concat(a))}),this;var l=o("rect");return this.currentContext().appendChild(l),this.setAttributes(l,r({x:e,y:t,width:n,height:i},a)),this},i.prototype.circle=function(e,t,n,i){var a=o("circle");return this.currentContext().appendChild(a),this.setAttributes(a,r({cx:e,cy:t,r:n},i)),this},i.prototype.path=function(e,t){var n=o("path");return this.currentContext().appendChild(n),this.setAttributes(n,r({d:e},t)),this},i.prototype.polyline=function(e,t){var n=this;if(Array.isArray(e))return e.forEach(function(e){n.polyline(e,t)}),this;var i=o("polyline");return this.currentContext().appendChild(i),this.setAttributes(i,r({points:e},t)),this},i.prototype.group=function(e){var t=o("g");return this.currentContext().appendChild(t),this.context.push(t),this.setAttributes(t,r({},e)),this}},57338(e){"use strict";var t=e.exports=function(e){return this instanceof t?(this.tagName=e,this.attributes=Object.create(null),this.children=[],this.lastChild=null,this):new t(e)};t.prototype.appendChild=function(e){return this.children.push(e),this.lastChild=e,this},t.prototype.setAttribute=function(e,t){return this.attributes[e]=t,this},t.prototype.toString=function(){var e=this;return["<",e.tagName,Object.keys(e.attributes).map(function(t){return[" ",t,'="',e.attributes[t],'"'].join("")}).join(""),">",e.children.map(function(e){return e.toString()}).join(""),"</",e.tagName,">"].join("")}},64751(e){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function r(e){if(!e||"[object Object]"!==n.call(e)||e.nodeType||e.setInterval)return!1;var r,o=t.call(e,"constructor"),i=t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!i)return!1;for(r in e);return void 0===r||t.call(e,r)}e.exports=function e(){var t,n,o,i,a,s,l=arguments[0]||{},u=1,c=arguments.length,d=!1;for("boolean"==typeof l&&(d=l,l=arguments[1]||{},u=2),"object"!=typeof l&&"function"!=typeof l&&(l={});u<c;u++)if(null!=(t=arguments[u]))for(n in t)o=l[n],l!==(i=t[n])&&(d&&i&&(r(i)||(a=Array.isArray(i)))?(a?(a=!1,s=o&&Array.isArray(o)?o:[]):s=o&&r(o)?o:{},l[n]=e(d,s,i)):void 0!==i&&(l[n]=i));return l}},82034(e,t){"use strict";t.pathToRegexp=function(e,t={}){let{delimiter:u="/",end:c=!0,sensitive:d=!1,trailing:f=!0}=t,p=[],h="",m=0;!function e(c){if(Array.isArray(c)){for(let t of c)e(t);return}let d="object"==typeof c?c:function(e,t={}){let{encodePath:i=n}=t,l=[...e],u=0;return new a(function t(n){let a=[],c="";function d(){c&&(a.push({type:"text",value:i(c)}),c="")}for(;u<l.length;){let i=l[u++];if(i===n)return d(),a;if("\\"===i){if(u===l.length)throw new s(`Unexpected end after \\ at index ${u}`,e);c+=l[u++];continue}if(":"===i||"*"===i){let t=":"===i?"param":"wildcard",n="";if(r.test(l[u]))do n+=l[u++];while(o.test(l[u]));else if('"'===l[u]){let t=u;for(;u<l.length;){if('"'===l[++u]){u++,t=0;break}"\\"===l[u]&&u++,n+=l[u]}if(t)throw new s(`Unterminated quote at index ${t}`,e)}if(!n)throw new s(`Missing parameter name at index ${u}`,e);d(),a.push({type:t,name:n});continue}if("{"===i){d(),a.push({type:"group",tokens:t("}")});continue}if("}"===i||"("===i||")"===i||"["===i||"]"===i||"+"===i||"?"===i||"!"===i)throw new s(`Unexpected ${i} at index ${u-1}`,e);c+=i}if(n)throw new s(`Unexpected end at index ${u}, expected ${n}`,e);return d(),a}(""),e)}(c,t);!function e(t,n,r,o){for(;n<t.length;){let i=t[n++];if("group"===i.type){let a=r.length;e(i.tokens,0,r,r=>e(t,n,r,o)),r.length=a;continue}r.push(i)}o(r)}(d.tokens,0,[],e=>{if(m>=256)throw new s("Too many path combinations",d.originalPath);m>0&&(h+="|"),h+=function(e,t,n,r){let o="",a="",u="",c=0,d=0,f=0;for(;f<e.length;){let p=e[f++];if("text"===p.type){o+=i(p.value),a+=p.value,2===c&&(u+=p.value),p.value.includes(t)&&(d=0);continue}if("param"===p.type||"wildcard"===p.type){if(c&&!a)throw new s(`Missing text before "${p.name}" ${p.type}`,r);"param"===p.type?(o+=2&d?`(${l(t,a)}+)`:!function(n,r){for(;n<e.length;){let o=e[n++];if(o.type===r)return!0;if("text"===o.type&&o.value.includes(t))break}return!1}(f,"wildcard")?1&d?`(${l(t,a)}+|${i(a)})`:`(${l(t,"")}+)`:`(${l(t,function(t){let n="";for(;t<e.length;){let r=e[t++];if("text"!==r.type)break;n+=r.value}return n}(f))}+)`,d|=c=1):(o+=2&d?`(${l(a,"")}+)`:u?`(${l(u,"")}+|${l(t,"")}+)`:"([^]+)",u="",d|=c=2),n.push(p),a="";continue}throw TypeError(`Unknown token type: ${p.type}`)}return o}(e,u,p,d.originalPath),m++})}(e);let y=`^(?:${h})`;return f&&(y+="(?:"+i(u)+"$)?"),{regexp:new RegExp(y+=c?"$":"(?="+i(u)+"|$)",d?"":"i"),keys:p}};let n=e=>e,r=/^[$_\p{ID_Start}]$/u,o=/^[$\u200c\u200d\p{ID_Continue}]$/u;function i(e){return e.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}class a{constructor(e,t){this.tokens=e,this.originalPath=t}}class s extends TypeError{constructor(e,t){let n=e;t&&(n+=`: ${t}`),super(n+="; visit https://git.new/pathToRegexpError for info"),this.originalPath=t}}function l(e,t){return t.length>e.length?l(t,e):(e===t&&(t=""),t.length>1)?`(?:(?!${i(e)}|${i(t)})[^])`:e.length>1?`(?:(?!${i(e)})[^${i(t)}])`:`[^${i(e+t)}]`}},25873(e,t,n){"use strict";var r=n(43144);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},38513(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(21016);t.AsyncSubject=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t}return o(t,e),t.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),a.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),a.Subscription.EMPTY):e.prototype._subscribe.call(this,t)},t.prototype.next=function(e){this.hasCompleted||(this.value=e,this.hasNext=!0)},t.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},t.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(i.Subject)},8791(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(18860);t.BehaviorSubject=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return o(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(!this.closed)return this._value;throw new a.ObjectUnsubscribedError},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(i.Subject)},1359(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.InnerSubscriber=function(e){function t(t,n,r){var o=e.call(this)||this;return o.parent=t,o.outerValue=n,o.outerIndex=r,o.index=0,o}return o(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(n(77759).Subscriber)},4942(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(34914),i=n(47986),a=n(11673);(r=t.NotificationKind||(t.NotificationKind={})).NEXT="N",r.ERROR="E",r.COMPLETE="C",t.Notification=function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}},e.prototype.accept=function(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){switch(this.kind){case"N":return i.of(this.value);case"E":return a.throwError(this.error);case"C":return o.empty()}throw Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}()},95092(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(21226),o=n(67595),i=n(46713),a=n(27928),s=n(5319);function l(e){if(e||(e=s.config.Promise||Promise),!e)throw Error("no Promise impl found");return e}t.Observable=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,i=o.toSubscriber(e,t,n);if(r?i.add(r.call(i,this.source)):i.add(this.source||s.config.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),s.config.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){s.config.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),r.canReportError(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=l(t))(function(t,r){var o;o=n.subscribe(function(t){try{e(t)}catch(e){r(e),o&&o.unsubscribe()}},r,t)})},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[i.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:a.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=l(e))(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}()},74143(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5319),o=n(59468);t.empty={closed:!0,next:function(e){},error:function(e){if(r.config.useDeprecatedSynchronousErrorHandling)throw e;o.hostReportError(e)},complete:function(){}}},89152(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.OuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.notifyNext=function(e,t,n,r,o){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(n(77759).Subscriber)},20328(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(63792),s=n(21016),l=n(24654),u=n(18860),c=n(43716);t.ReplaySubject=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0);var o=e.call(this)||this;return o.scheduler=r,o._events=[],o._infiniteTimeWindow=!1,o._bufferSize=t<1?1:t,o._windowTime=n<1?1:n,n===1/0?(o._infiniteTimeWindow=!0,o.next=o.nextInfiniteTimeWindow):o.next=o.nextTimeWindow,o}return o(t,e),t.prototype.nextInfiniteTimeWindow=function(t){if(!this.isStopped){var n=this._events;n.push(t),n.length>this._bufferSize&&n.shift()}e.prototype.next.call(this,t)},t.prototype.nextTimeWindow=function(t){this.isStopped||(this._events.push(new d(this._getNow(),t)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){var t,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),o=this.scheduler,i=r.length;if(this.closed)throw new u.ObjectUnsubscribedError;if(this.isStopped||this.hasError?t=s.Subscription.EMPTY:(this.observers.push(e),t=new c.SubjectSubscription(this,e)),o&&e.add(e=new l.ObserveOnSubscriber(e,o)),n)for(var a=0;a<i&&!e.closed;a++)e.next(r[a]);else for(var a=0;a<i&&!e.closed;a++)e.next(r[a].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),t},t.prototype._getNow=function(){return(this.scheduler||a.queue).now()},t.prototype._trimBufferThenGetEvents=function(){for(var e=this._getNow(),t=this._bufferSize,n=this._windowTime,r=this._events,o=r.length,i=0;i<o&&!(e-r[i].time<n);)i++;return o>t&&(i=Math.max(i,o-t)),i>0&&r.splice(0,i),r},t}(i.Subject);var d=function(e,t){this.time=e,this.value=t}},94688(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scheduler=function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(n,t)},e.now=function(){return Date.now()},e}()},71077(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(95092),a=n(77759),s=n(21016),l=n(18860),u=n(43716),c=n(58636),d=function(e){function t(t){var n=e.call(this,t)||this;return n.destination=t,n}return o(t,e),t}(a.Subscriber);t.SubjectSubscriber=d;var f=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return o(t,e),t.prototype[c.rxSubscriber]=function(){return new d(this)},t.prototype.lift=function(e){var t=new p(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].next(e)},t.prototype.error=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new l.ObjectUnsubscribedError;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;r++)n[r].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(!this.closed)return e.prototype._trySubscribe.call(this,t);throw new l.ObjectUnsubscribedError},t.prototype._subscribe=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;return this.hasError?(e.error(this.thrownError),s.Subscription.EMPTY):this.isStopped?(e.complete(),s.Subscription.EMPTY):(this.observers.push(e),new u.SubjectSubscription(this,e))},t.prototype.asObservable=function(){var e=new i.Observable;return e.source=this,e},t.create=function(e,t){return new p(e,t)},t}(i.Observable);t.Subject=f;var p=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return o(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):s.Subscription.EMPTY},t}(f);t.AnonymousSubject=p},43716(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.SubjectSubscription=function(e){function t(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return o(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},t}(n(21016).Subscription)},77759(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(84864),a=n(74143),s=n(21016),l=n(58636),u=n(5319),c=n(59468),d=function(e){function t(n,r,o){var i=e.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=a.empty;break;case 1:if(!n){i.destination=a.empty;break}if("object"==typeof n){n instanceof t?(i.syncErrorThrowable=n.syncErrorThrowable,i.destination=n,n.add(i)):(i.syncErrorThrowable=!0,i.destination=new f(i,n));break}default:i.syncErrorThrowable=!0,i.destination=new f(i,n,r,o)}return i}return o(t,e),t.prototype[l.rxSubscriber]=function(){return this},t.create=function(e,n,r){var o=new t(e,n,r);return o.syncErrorThrowable=!1,o},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(s.Subscription);t.Subscriber=d;var f=function(e){function t(t,n,r,o){var s,l=e.call(this)||this;l._parentSubscriber=t;var u=l;return i.isFunction(n)?s=n:n&&(s=n.next,r=n.error,o=n.complete,n!==a.empty&&(u=Object.create(n),i.isFunction(u.unsubscribe)&&l.add(u.unsubscribe.bind(u)),u.unsubscribe=l.unsubscribe.bind(l))),l._context=u,l._next=s,l._error=r,l._complete=o,l}return o(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;u.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=u.config.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?this.__tryOrSetError(t,this._error,e):this.__tryOrUnsub(this._error,e),this.unsubscribe();else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):c.hostReportError(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;c.hostReportError(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};u.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,n):this.__tryOrUnsub(n),this.unsubscribe()}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),u.config.useDeprecatedSynchronousErrorHandling)throw e;c.hostReportError(e)}},t.prototype.__tryOrSetError=function(e,t,n){if(!u.config.useDeprecatedSynchronousErrorHandling)throw Error("bad call");try{t.call(this._context,n)}catch(t){if(u.config.useDeprecatedSynchronousErrorHandling)return e.syncErrorValue=t,e.syncErrorThrown=!0,!0;return c.hostReportError(t),!0}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(d);t.SafeSubscriber=f},21016(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(80743),o=n(6727),i=n(84864),a=n(11806);function s(e){return e.reduce(function(e,t){return e.concat(t instanceof a.UnsubscriptionError?t.errors:t)},[])}t.Subscription=function(){var e;function t(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return t.prototype.unsubscribe=function(){if(!this.closed){var e,n=this._parentOrParents,l=this._ctorUnsubscribe,u=this._unsubscribe,c=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(var d=0;d<n.length;++d)n[d].remove(this);if(i.isFunction(u)){l&&(this._unsubscribe=void 0);try{u.call(this)}catch(t){e=t instanceof a.UnsubscriptionError?s(t.errors):[t]}}if(r.isArray(c))for(var d=-1,f=c.length;++d<f;){var p=c[d];if(o.isObject(p))try{p.unsubscribe()}catch(t){e=e||[],t instanceof a.UnsubscriptionError?e=e.concat(s(t.errors)):e.push(t)}}if(e)throw new a.UnsubscriptionError(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw Error("unrecognized teardown "+e+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof t){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.push(n),n},t.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},(e=new t).closed=!0,t.EMPTY=e,t}()},5319(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=!1;t.config={Promise:void 0,set useDeprecatedSynchronousErrorHandling(value){value?console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+Error().stack):n&&console.log("RxJS: Back to a better error behavior. Thank you. <3"),n=value},get useDeprecatedSynchronousErrorHandling(){return n}}},75901(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(95092),s=n(41727);t.SimpleInnerSubscriber=function(e){function t(t){var n=e.call(this)||this;return n.parent=t,n}return o(t,e),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(i.Subscriber),t.ComplexInnerSubscriber=function(e){function t(t,n,r){var o=e.call(this)||this;return o.parent=t,o.outerValue=n,o.outerIndex=r,o}return o(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(i.Subscriber),t.SimpleOuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(i.Subscriber),t.ComplexOuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.notifyNext=function(e,t,n,r){this.destination.next(t)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(i.Subscriber),t.innerSubscribe=function(e,t){var n;if(!t.closed){if(e instanceof a.Observable)return e.subscribe(t);try{n=s.subscribeTo(e)(t)}catch(e){t.error(e)}return n}}},27432(e,t,n){"use strict";var r,o,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(71077),s=n(95092),l=n(77759),u=n(21016),c=n(85203),d=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return i(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return!e&&(this._isComplete=!1,(e=this._connection=new u.Subscription).add(this.source.subscribe(new f(this.getSubject(),this))),e.closed&&(this._connection=null,e=u.Subscription.EMPTY)),e},t.prototype.refCount=function(){return c.refCount()(this)},t}(s.Observable);t.ConnectableObservable=d,t.connectableObservableDescriptor={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:(o=d.prototype)._subscribe},_isComplete:{value:o._isComplete,writable:!0},getSubject:{value:o.getSubject},connect:{value:o.connect},refCount:{value:o.refCount}};var f=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return i(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(a.SubjectSubscriber);(function(e){this.connectable=e}).prototype.call=function(e,t){var n=this.connectable;n._refCount++;var r=new p(e,n),o=t.subscribe(r);return r.closed||(r.connection=n.connect()),o};var p=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return i(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(!e){this.connection=null;return}this.connectable=null;var t=e._refCount;if(t<=0||(e._refCount=t-1,t>1)){this.connection=null;return}var n=this.connection,r=e._connection;this.connection=null,r&&(!n||r===n)&&r.unsubscribe()},t}(l.Subscriber)},17563(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(95092),a=n(73766),s=n(19673);t.SubscribeOnObservable=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=a.asap);var o=e.call(this)||this;return o.source=t,o.delayTime=n,o.scheduler=r,(!s.isNumeric(n)||n<0)&&(o.delayTime=0),r&&"function"==typeof r.schedule||(o.scheduler=a.asap),o}return o(t,e),t.create=function(e,n,r){return void 0===n&&(n=0),void 0===r&&(r=a.asap),new t(e,n,r)},t.dispatch=function(e){var t=e.source,n=e.subscriber;return this.add(t.subscribe(n))},t.prototype._subscribe=function(e){var n=this.delayTime,r=this.source;return this.scheduler.schedule(t.dispatch,n,{source:r,subscriber:e})},t}(i.Observable)},92413(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(23935),a=n(80743),s=n(89152),l=n(87778),u=n(67446),c={};t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=void 0,r=void 0;return i.isScheduler(e[e.length-1])&&(r=e.pop()),"function"==typeof e[e.length-1]&&(n=e.pop()),1===e.length&&a.isArray(e[0])&&(e=e[0]),u.fromArray(e,r).lift(new d(n))};var d=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new f(e,this.resultSelector))},e}();t.CombineLatestOperator=d;var f=function(e){function t(t,n){var r=e.call(this,t)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return o(t,e),t.prototype._next=function(e){this.values.push(c),this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(var n=0;n<t;n++){var r=e[n];this.add(l.subscribeToResult(this,r,void 0,n))}}},t.prototype.notifyComplete=function(e){0==(this.active-=1)&&this.destination.complete()},t.prototype.notifyNext=function(e,t,n){var r=this.values,o=r[n],i=this.toRespond?o===c?--this.toRespond:this.toRespond:0;r[n]=t,0===i&&(this.resultSelector?this._tryResultSelector(r):this.destination.next(r.slice()))},t.prototype._tryResultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(s.OuterSubscriber);t.CombineLatestSubscriber=f},99623(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(47986),o=n(60208);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.concatAll()(r.of.apply(void 0,e))}},26691(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(85295),i=n(34914);t.defer=function(e){return new r.Observable(function(t){var n;try{n=e()}catch(e){t.error(e);return}return(n?o.from(n):i.empty()).subscribe(t)})}},34914(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092);t.EMPTY=new r.Observable(function(e){return e.complete()}),t.empty=function(e){var n;return e?(n=e,new r.Observable(function(e){return n.schedule(function(){return e.complete()})})):t.EMPTY}},85295(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(41727),i=n(67670);t.from=function(e,t){return t?i.scheduled(e,t):e instanceof r.Observable?e:new r.Observable(o.subscribeTo(e))}},67446(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(422),i=n(85791);t.fromArray=function(e,t){return t?i.scheduleArray(e,t):new r.Observable(o.subscribeToArray(e))}},33395(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(23935),i=n(80980),a=n(67446);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=1/0,s=null,l=e[e.length-1];return(o.isScheduler(l)?(s=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(n=e.pop())):"number"==typeof l&&(n=e.pop()),null===s&&1===e.length&&e[0]instanceof r.Observable)?e[0]:i.mergeAll(n)(a.fromArray(e,s))}},47986(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(23935),o=n(67446),i=n(85791);t.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return r.isScheduler(n)?(e.pop(),i.scheduleArray(e,n)):o.fromArray(e)}},57894(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(80743),a=n(67446),s=n(89152),l=n(87778);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length)if(!i.isArray(e[0]))return e[0];else e=e[0];return a.fromArray(e,void 0).lift(new u)};var u=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new c(e))},e}();t.RaceOperator=u;var c=function(e){function t(t){var n=e.call(this,t)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return o(t,e),t.prototype._next=function(e){this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{for(var n=0;n<t&&!this.hasFirst;n++){var r=e[n],o=l.subscribeToResult(this,r,void 0,n);this.subscriptions&&this.subscriptions.push(o),this.add(o)}this.observables=null}},t.prototype.notifyNext=function(e,t,n){if(!this.hasFirst){this.hasFirst=!0;for(var r=0;r<this.subscriptions.length;r++)if(r!==n){var o=this.subscriptions[r];o.unsubscribe(),this.remove(o)}this.subscriptions=null}this.destination.next(t)},t}(s.OuterSubscriber);t.RaceSubscriber=c},11673(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092);function o(e){var t=e.error;e.subscriber.error(t)}t.throwError=function(e,t){return new r.Observable(t?function(n){return t.schedule(o,0,{error:e,subscriber:n})}:function(t){return t.error(e)})}},27954(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(86735),i=n(19673),a=n(23935);function s(e){var t=e.index,n=e.period,r=e.subscriber;if(r.next(t),!r.closed){if(-1===n)return r.complete();e.index=t+1,this.schedule(e,n)}}t.timer=function(e,t,n){void 0===e&&(e=0);var l=-1;return i.isNumeric(t)?l=1>Number(t)&&1||Number(t):a.isScheduler(t)&&(n=t),a.isScheduler(n)||(n=o.async),new r.Observable(function(t){var r=i.isNumeric(e)?e:e-n.now();return n.schedule(s,r,{index:0,period:l,subscriber:t})})}},85356(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(67446),a=n(80743),s=n(77759),l=n(78258),u=n(75901);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return"function"==typeof n&&e.pop(),i.fromArray(e,void 0).lift(new c(n))};var c=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.resultSelector))},e}();t.ZipOperator=c;var d=function(e){function t(t,n,r){void 0===r&&(r=Object.create(null));var o=e.call(this,t)||this;return o.resultSelector=n,o.iterators=[],o.active=0,o.resultSelector="function"==typeof n?n:void 0,o}return o(t,e),t.prototype._next=function(e){var t=this.iterators;a.isArray(e)?t.push(new p(e)):"function"==typeof e[l.iterator]?t.push(new f(e[l.iterator]())):t.push(new h(this.destination,this,e))},t.prototype._complete=function(){var e=this.iterators,t=e.length;if(this.unsubscribe(),0===t)return void this.destination.complete();this.active=t;for(var n=0;n<t;n++){var r=e[n];r.stillUnsubscribed?this.destination.add(r.subscribe()):this.active--}},t.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},t.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,n=this.destination,r=0;r<t;r++){var o=e[r];if("function"==typeof o.hasValue&&!o.hasValue())return}for(var i=!1,a=[],r=0;r<t;r++){var o=e[r],s=o.next();if(o.hasCompleted()&&(i=!0),s.done)return void n.complete();a.push(s.value)}this.resultSelector?this._tryresultSelector(a):n.next(a),i&&n.complete()},t.prototype._tryresultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(s.Subscriber);t.ZipSubscriber=d;var f=function(){function e(e){this.iterator=e,this.nextResult=e.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return!!(e&&e.done)},e}(),p=function(){function e(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return e.prototype[l.iterator]=function(){return this},e.prototype.next=function(e){var t=this.index++,n=this.array;return t<this.length?{value:n[t],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),h=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.parent=n,o.observable=r,o.stillUnsubscribed=!0,o.buffer=[],o.isComplete=!1,o}return o(t,e),t.prototype[l.iterator]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e){this.buffer.push(e),this.parent.checkIterators()},t.prototype.subscribe=function(){return u.innerSubscribe(this.observable,new u.SimpleInnerSubscriber(this))},t}(u.SimpleOuterSubscriber)},18780(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.audit=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.durationSelector=n,r.hasValue=!1,r}return o(t,e),t.prototype._next=function(e){if(this.value=e,this.hasValue=!0,!this.throttled){var t=void 0;try{t=(0,this.durationSelector)(e)}catch(e){return this.destination.error(e)}var n=i.innerSubscribe(t,new i.SimpleInnerSubscriber(this));!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}},t.prototype.clearThrottle=function(){var e=this.value,t=this.hasValue,n=this.throttled;n&&(this.remove(n),this.throttled=void 0,n.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))},t.prototype.notifyNext=function(){this.clearThrottle()},t.prototype.notifyComplete=function(){this.clearThrottle()},t}(i.SimpleOuterSubscriber)},13441(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(86735),o=n(18780),i=n(27954);t.auditTime=function(e,t){return void 0===t&&(t=r.async),o.audit(function(){return i.timer(e,t)})}},11853(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.buffer=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.closingNotifier=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.closingNotifier))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.buffer=[],r.add(i.innerSubscribe(n,new i.SimpleInnerSubscriber(r))),r}return o(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype.notifyNext=function(){var e=this.buffer;this.buffer=[],this.destination.next(e)},t}(i.SimpleOuterSubscriber)},77650(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.bufferCount=function(e,t){return void 0===t&&(t=null),function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.bufferSize=e,this.startBufferEvery=t,t&&e!==t?this.subscriberClass=l:this.subscriberClass=s}return e.prototype.call=function(e,t){return t.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.bufferSize=n,r.buffer=[],r}return o(t,e),t.prototype._next=function(e){var t=this.buffer;t.push(e),t.length==this.bufferSize&&(this.destination.next(t),this.buffer=[])},t.prototype._complete=function(){var t=this.buffer;t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},t}(i.Subscriber),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.bufferSize=n,o.startBufferEvery=r,o.buffers=[],o.count=0,o}return o(t,e),t.prototype._next=function(e){var t=this.bufferSize,n=this.startBufferEvery,r=this.buffers,o=this.count;this.count++,o%n==0&&r.push([]);for(var i=r.length;i--;){var a=r[i];a.push(e),a.length===t&&(r.splice(i,1),this.destination.next(a))}},t.prototype._complete=function(){for(var t=this.buffers,n=this.destination;t.length>0;){var r=t.shift();r.length>0&&n.next(r)}e.prototype._complete.call(this)},t}(i.Subscriber)},94360(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(86735),a=n(77759),s=n(23935);t.bufferTime=function(e){var t=arguments.length,n=i.async;s.isScheduler(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],t--);var r=null;t>=2&&(r=arguments[1]);var o=1/0;return t>=3&&(o=arguments[2]),function(t){return t.lift(new l(e,r,o,n))}};var l=function(){function e(e,t,n,r){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),u=function(){this.buffer=[]},c=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;a.bufferTimeSpan=n,a.bufferCreationInterval=r,a.maxBufferSize=o,a.scheduler=i,a.contexts=[];var s=a.openContext();return a.timespanOnly=null==r||r<0,a.timespanOnly?a.add(s.closeAction=i.schedule(d,n,{subscriber:a,context:s,bufferTimeSpan:n})):(a.add(s.closeAction=i.schedule(p,n,{subscriber:a,context:s})),a.add(i.schedule(f,r,{bufferTimeSpan:n,bufferCreationInterval:r,subscriber:a,scheduler:i}))),a}return o(t,e),t.prototype._next=function(e){for(var t,n=this.contexts,r=n.length,o=0;o<r;o++){var i=n[o],a=i.buffer;a.push(e),a.length==this.maxBufferSize&&(t=i)}t&&this.onBufferFull(t)},t.prototype._error=function(t){this.contexts.length=0,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts,n=this.destination;t.length>0;){var r=t.shift();n.next(r.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(e){this.closeContext(e);var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:e,bufferTimeSpan:n};this.add(e.closeAction=this.scheduler.schedule(d,n,r))}},t.prototype.openContext=function(){var e=new u;return this.contexts.push(e),e},t.prototype.closeContext=function(e){this.destination.next(e.buffer);var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},t}(a.Subscriber);function d(e){var t=e.subscriber,n=e.context;n&&t.closeContext(n),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function f(e){var t=e.bufferCreationInterval,n=e.bufferTimeSpan,r=e.subscriber,o=e.scheduler,i=r.openContext();r.closed||(r.add(i.closeAction=o.schedule(p,n,{subscriber:r,context:i})),this.schedule(e,t))}function p(e){var t=e.subscriber,n=e.context;t.closeContext(n)}},43381(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(21016),a=n(87778),s=n(89152);t.bufferToggle=function(e,t){return function(n){return n.lift(new l(e,t))}};var l=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.openings,this.closingSelector))},e}(),u=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.closingSelector=r,o.contexts=[],o.add(a.subscribeToResult(o,n)),o}return o(t,e),t.prototype._next=function(e){for(var t=this.contexts,n=t.length,r=0;r<n;r++)t[r].buffer.push(e)},t.prototype._error=function(t){for(var n=this.contexts;n.length>0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var n=t.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t){e?this.closeBuffer(e):this.openBuffer(t)},t.prototype.notifyComplete=function(e){this.closeBuffer(e.context)},t.prototype.openBuffer=function(e){try{var t=this.closingSelector.call(this,e);t&&this.trySubscribe(t)}catch(e){this._error(e)}},t.prototype.closeBuffer=function(e){var t=this.contexts;if(t&&e){var n=e.buffer,r=e.subscription;this.destination.next(n),t.splice(t.indexOf(e),1),this.remove(r),r.unsubscribe()}},t.prototype.trySubscribe=function(e){var t=this.contexts,n=new i.Subscription,r={buffer:[],subscription:n};t.push(r);var o=a.subscribeToResult(this,e,r);!o||o.closed?this.closeBuffer(r):(o.context=r,this.add(o),n.add(o))},t}(s.OuterSubscriber)},51069(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(21016),a=n(75901);t.bufferWhen=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.closingSelector))},e}(),l=function(e){function t(t,n){var r=e.call(this,t)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return o(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},t.prototype.notifyNext=function(){this.openBuffer()},t.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var e,t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{e=(0,this.closingSelector)()}catch(e){return this.error(e)}t=new i.Subscription,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(a.innerSubscribe(e,new a.SimpleInnerSubscriber(this))),this.subscribing=!1},t}(a.SimpleOuterSubscriber)},85916(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.catchError=function(e){return function(t){var n=new a(e),r=t.lift(n);return n.caught=r}};var a=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.selector,this.caught))},e}(),s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.selector=n,o.caught=r,o}return o(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(t){e.prototype.error.call(this,t);return}this._unsubscribeAndRecycle();var r=new i.SimpleInnerSubscriber(this);this.add(r);var o=i.innerSubscribe(n,r);o!==r&&this.add(o)}},t}(i.SimpleOuterSubscriber)},90239(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(92413);t.combineAll=function(e){return function(t){return t.lift(new r.CombineLatestOperator(e))}}},79397(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(80743),o=n(92413),i=n(85295);t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=null;return"function"==typeof e[e.length-1]&&(n=e.pop()),1===e.length&&r.isArray(e[0])&&(e=e[0].slice()),function(t){return t.lift.call(i.from([t].concat(e)),new o.CombineLatestOperator(n))}}},66255(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(99623);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(r.concat.apply(void 0,[t].concat(e)))}}},60208(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(80980);t.concatAll=function(){return r.mergeAll(1)}},92209(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(60781);t.concatMap=function(e,t){return r.mergeMap(e,t,1)}},83232(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(92209);t.concatMapTo=function(e,t){return r.concatMap(function(){return e},t)}},85476(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.count=function(e){return function(t){return t.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source))},e}(),s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.predicate=n,o.source=r,o.count=0,o.index=0,o}return o(t,e),t.prototype._next=function(e){this.predicate?this._tryPredicate(e):this.count++},t.prototype._tryPredicate=function(e){var t;try{t=this.predicate(e,this.index++,this.source)}catch(e){this.destination.error(e);return}t&&this.count++},t.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},t}(i.Subscriber)},59768(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.debounce=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.durationSelector=n,r.hasValue=!1,r}return o(t,e),t.prototype._next=function(e){try{var t=this.durationSelector.call(this,e);t&&this._tryNext(e,t)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.emitValue(),this.destination.complete()},t.prototype._tryNext=function(e,t){var n=this.durationSubscription;this.value=e,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=i.innerSubscribe(t,new i.SimpleInnerSubscriber(this)))&&!n.closed&&this.add(this.durationSubscription=n)},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){if(this.hasValue){var t=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,e.prototype._next.call(this,t)}},t}(i.SimpleOuterSubscriber)},92661(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(86735);t.debounceTime=function(e,t){return void 0===t&&(t=a.async),function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.dueTime,this.scheduler))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.dueTime=n,o.scheduler=r,o.debouncedSubscription=null,o.lastValue=null,o.hasValue=!1,o}return o(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(u,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(i.Subscriber);function u(e){e.debouncedNext()}},90952(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.defaultIfEmpty=function(e){return void 0===e&&(e=null),function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.defaultValue=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.defaultValue))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.defaultValue=n,r.isEmpty=!0,r}return o(t,e),t.prototype._next=function(e){this.isEmpty=!1,this.destination.next(e)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},t}(i.Subscriber)},17436(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(86735),a=n(66740),s=n(77759),l=n(4942);t.delay=function(e,t){void 0===t&&(t=i.async);var n=a.isDate(e)?e-t.now():Math.abs(e);return function(e){return e.lift(new u(n,t))}};var u=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delay,this.scheduler))},e}(),c=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.delay=n,o.scheduler=r,o.queue=[],o.active=!1,o.errored=!1,o}return o(t,e),t.dispatch=function(e){for(var t=e.source,n=t.queue,r=e.scheduler,o=e.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(o);if(n.length>0){var i=Math.max(0,n[0].time-r.now());this.schedule(e,i)}else this.unsubscribe(),t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.destination.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,n=new d(t.now()+this.delay,e);this.queue.push(n),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(l.Notification.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.scheduleNotification(l.Notification.createComplete()),this.unsubscribe()},t}(s.Subscriber),d=function(e,t){this.time=e,this.notification=t}},41136(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(95092),s=n(89152),l=n(87778);t.delayWhen=function(e,t){return t?function(n){return new d(n,t).lift(new u(e))}:function(t){return t.lift(new u(e))}};var u=function(){function e(e){this.delayDurationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delayDurationSelector))},e}(),c=function(e){function t(t,n){var r=e.call(this,t)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r.index=0,r}return o(t,e),t.prototype.notifyNext=function(e,t,n,r,o){this.destination.next(e),this.removeSubscription(o),this.tryComplete()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype.notifyComplete=function(e){var t=this.removeSubscription(e);t&&this.destination.next(t),this.tryComplete()},t.prototype._next=function(e){var t=this.index++;try{var n=this.delayDurationSelector(e,t);n&&this.tryDelay(n,e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},t.prototype.removeSubscription=function(e){e.unsubscribe();var t=this.delayNotifierSubscriptions.indexOf(e);return -1!==t&&this.delayNotifierSubscriptions.splice(t,1),e.outerValue},t.prototype.tryDelay=function(e,t){var n=l.subscribeToResult(this,e,t);n&&!n.closed&&(this.destination.add(n),this.delayNotifierSubscriptions.push(n))},t.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},t}(s.OuterSubscriber),d=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subscriptionDelay=n,r}return o(t,e),t.prototype._subscribe=function(e){this.subscriptionDelay.subscribe(new f(e,this.source))},t}(a.Observable),f=function(e){function t(t,n){var r=e.call(this)||this;return r.parent=t,r.source=n,r.sourceSubscribed=!1,r}return o(t,e),t.prototype._next=function(e){this.subscribeToSource()},t.prototype._error=function(e){this.unsubscribe(),this.parent.error(e)},t.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},t.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},t}(i.Subscriber)},56051(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.dematerialize=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype._next=function(e){e.observe(this.destination)},t}(i.Subscriber)},85343(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.distinct=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.keySelector,this.flushes))},e}(),s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.keySelector=n,o.values=new Set,r&&o.add(i.innerSubscribe(r,new i.SimpleInnerSubscriber(o))),o}return o(t,e),t.prototype.notifyNext=function(){this.values.clear()},t.prototype.notifyError=function(e){this._error(e)},t.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},t.prototype._useKeySelector=function(e){var t,n=this.destination;try{t=this.keySelector(e)}catch(e){n.error(e);return}this._finalizeNext(t,e)},t.prototype._finalizeNext=function(e,t){var n=this.values;n.has(e)||(n.add(e),this.destination.next(t))},t}(i.SimpleOuterSubscriber);t.DistinctSubscriber=s},88179(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.distinctUntilChanged=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.compare,this.keySelector))},e}(),s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.keySelector=r,o.hasKey=!1,"function"==typeof n&&(o.compare=n),o}return o(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){try{var t,n=this.keySelector;t=n?n(e):e}catch(e){return this.destination.error(e)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,t)}catch(e){return this.destination.error(e)}else this.hasKey=!0;r||(this.key=t,this.destination.next(e))},t}(i.Subscriber)},43670(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(88179);t.distinctUntilKeyChanged=function(e,t){return r.distinctUntilChanged(function(n,r){return t?t(n[e],r[e]):n[e]===r[e]})}},57366(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2519),o=n(64629),i=n(8347),a=n(90952),s=n(85624);t.elementAt=function(e,t){if(e<0)throw new r.ArgumentOutOfRangeError;var n=arguments.length>=2;return function(l){return l.pipe(o.filter(function(t,n){return n===e}),s.take(1),n?a.defaultIfEmpty(t):i.throwIfEmpty(function(){return new r.ArgumentOutOfRangeError}))}}},61650(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(99623),o=n(47986);t.endWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return r.concat(t,o.of.apply(void 0,e))}}},92472(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.every=function(e,t){return function(n){return n.lift(new a(e,t,n))}};var a=function(){function e(e,t,n){this.predicate=e,this.thisArg=t,this.source=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.thisArg,this.source))},e}(),s=function(e){function t(t,n,r,o){var i=e.call(this,t)||this;return i.predicate=n,i.thisArg=r,i.source=o,i.index=0,i.thisArg=r||i,i}return o(t,e),t.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},t.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(e){this.destination.error(e);return}t||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(i.Subscriber)},65893(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.exhaust=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){var n=e.call(this,t)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return o(t,e),t.prototype._next=function(e){this.hasSubscription||(this.hasSubscription=!0,this.add(i.innerSubscribe(e,new i.SimpleInnerSubscriber(this))))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(i.SimpleOuterSubscriber)},29219(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(89233),a=n(85295),s=n(75901);t.exhaustMap=function e(t,n){return n?function(r){return r.pipe(e(function(e,r){return a.from(t(e,r)).pipe(i.map(function(t,o){return n(e,t,r,o)}))}))}:function(e){return e.lift(new l(t))}};var l=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.project))},e}(),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return o(t,e),t.prototype._next=function(e){this.hasSubscription||this.tryNext(e)},t.prototype.tryNext=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){this.destination.error(e);return}this.hasSubscription=!0,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new s.SimpleInnerSubscriber(this),n=this.destination;n.add(t);var r=s.innerSubscribe(e,t);r!==t&&n.add(r)},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(s.SimpleOuterSubscriber)},76527(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.expand=function(e,t,n){return void 0===t&&(t=1/0),t=1>(t||0)?1/0:t,function(r){return r.lift(new a(e,t,n))}};var a=function(){function e(e,t,n){this.project=e,this.concurrent=t,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.concurrent,this.scheduler))},e}();t.ExpandOperator=a;var s=function(e){function t(t,n,r,o){var i=e.call(this,t)||this;return i.project=n,i.concurrent=r,i.scheduler=o,i.index=0,i.active=0,i.hasCompleted=!1,r<1/0&&(i.buffer=[]),i}return o(t,e),t.dispatch=function(e){var t=e.subscriber,n=e.result,r=e.value,o=e.index;t.subscribeToProjection(n,r,o)},t.prototype._next=function(e){var n=this.destination;if(n.closed)return void this._complete();var r=this.index++;if(this.active<this.concurrent){n.next(e);try{var o=(0,this.project)(e,r);this.scheduler?this.destination.add(this.scheduler.schedule(t.dispatch,0,{subscriber:this,result:o,value:e,index:r})):this.subscribeToProjection(o,e,r)}catch(e){n.error(e)}}else this.buffer.push(e)},t.prototype.subscribeToProjection=function(e,t,n){this.active++,this.destination.add(i.innerSubscribe(e,new i.SimpleInnerSubscriber(this)))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this._next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e&&e.length>0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t}(i.SimpleOuterSubscriber);t.ExpandSubscriber=s},64629(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.filter=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.thisArg))},e}(),s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.predicate=n,o.thisArg=r,o.count=0,o}return o(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){this.destination.error(e);return}t&&this.destination.next(e)},t}(i.Subscriber)},4349(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(21016);t.finalize=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.callback=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.callback))},e}(),l=function(e){function t(t,n){var r=e.call(this,t)||this;return r.add(new a.Subscription(n)),r}return o(t,e),t}(i.Subscriber)},32376(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.find=function(e,t){if("function"!=typeof e)throw TypeError("predicate is not a function");return function(n){return n.lift(new a(e,n,!1,t))}};var a=function(){function e(e,t,n,r){this.predicate=e,this.source=t,this.yieldIndex=n,this.thisArg=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}();t.FindValueOperator=a;var s=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;return a.predicate=n,a.source=r,a.yieldIndex=o,a.thisArg=i,a.index=0,a}return o(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete(),this.unsubscribe()},t.prototype._next=function(e){var t=this.predicate,n=this.thisArg,r=this.index++;try{t.call(n||this,e,r,this.source)&&this.notifyComplete(this.yieldIndex?r:e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},t}(i.Subscriber);t.FindValueSubscriber=s},8674(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(32376);t.findIndex=function(e,t){return function(n){return n.lift(new r.FindValueOperator(e,n,!0,t))}}},77089(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(62637),o=n(64629),i=n(85624),a=n(90952),s=n(8347),l=n(78522);t.first=function(e,t){var n=arguments.length>=2;return function(u){return u.pipe(e?o.filter(function(t,n){return e(t,n,u)}):l.identity,i.take(1),n?a.defaultIfEmpty(t):s.throwIfEmpty(function(){return new r.EmptyError}))}}},36217(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(21016),s=n(95092),l=n(71077);t.groupBy=function(e,t,n,r){return function(o){return o.lift(new u(e,t,n,r))}};var u=function(){function e(e,t,n,r){this.keySelector=e,this.elementSelector=t,this.durationSelector=n,this.subjectSelector=r}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),c=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;return a.keySelector=n,a.elementSelector=r,a.durationSelector=o,a.subjectSelector=i,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return o(t,e),t.prototype._next=function(e){var t;try{t=this.keySelector(e)}catch(e){this.error(e);return}this._group(e,t)},t.prototype._group=function(e,t){var n,r=this.groups;r||(r=this.groups=new Map);var o=r.get(t);if(this.elementSelector)try{n=this.elementSelector(e)}catch(e){this.error(e)}else n=e;if(!o){o=this.subjectSelector?this.subjectSelector():new l.Subject,r.set(t,o);var i=new f(t,o,this);if(this.destination.next(i),this.durationSelector){var a=void 0;try{a=this.durationSelector(new f(t,o))}catch(e){this.error(e);return}this.add(a.subscribe(new d(t,o,this)))}}o.closed||o.next(n)},t.prototype._error=function(e){var t=this.groups;t&&(t.forEach(function(t,n){t.error(e)}),t.clear()),this.destination.error(e)},t.prototype._complete=function(){var e=this.groups;e&&(e.forEach(function(e,t){e.complete()}),e.clear()),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups.delete(e)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},t}(i.Subscriber),d=function(e){function t(t,n,r){var o=e.call(this,n)||this;return o.key=t,o.group=n,o.parent=r,o}return o(t,e),t.prototype._next=function(e){this.complete()},t.prototype._unsubscribe=function(){var e=this.parent,t=this.key;this.key=this.parent=null,e&&e.removeGroup(t)},t}(i.Subscriber),f=function(e){function t(t,n,r){var o=e.call(this)||this;return o.key=t,o.groupSubject=n,o.refCountSubscription=r,o}return o(t,e),t.prototype._subscribe=function(e){var t=new a.Subscription,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&t.add(new p(n)),t.add(r.subscribe(e)),t},t}(s.Observable);t.GroupedObservable=f;var p=function(e){function t(t){var n=e.call(this)||this;return n.parent=t,t.count++,n}return o(t,e),t.prototype.unsubscribe=function(){var t=this.parent;t.closed||this.closed||(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},t}(a.Subscription)},76024(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.ignoreElements=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype._next=function(e){},t}(i.Subscriber)},87362(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.isEmpty=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(i.Subscriber)},6047(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(62637),o=n(64629),i=n(96696),a=n(8347),s=n(90952),l=n(78522);t.last=function(e,t){var n=arguments.length>=2;return function(u){return u.pipe(e?o.filter(function(t,n){return e(t,n,u)}):l.identity,i.takeLast(1),n?s.defaultIfEmpty(t):a.throwIfEmpty(function(){return new r.EmptyError}))}}},89233(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.map=function(e,t){return function(n){if("function"!=typeof e)throw TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.thisArg))},e}();t.MapOperator=a;var s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return o(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(i.Subscriber)},27296(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.mapTo=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.value))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.value=n,r}return o(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(i.Subscriber)},75434(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(4942);t.materialize=function(){return function(e){return e.lift(new s)}};var s=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new l(e))},e}(),l=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype._next=function(e){this.destination.next(a.Notification.createNext(e))},t.prototype._error=function(e){var t=this.destination;t.next(a.Notification.createError(e)),t.complete()},t.prototype._complete=function(){var e=this.destination;e.next(a.Notification.createComplete()),e.complete()},t}(i.Subscriber)},57001(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(71929);t.max=function(e){return r.reduce("function"==typeof e?function(t,n){return e(t,n)>0?t:n}:function(e,t){return e>t?e:t})}},14779(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(33395);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(r.merge.apply(void 0,[t].concat(e)))}}},80980(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(60781),o=n(78522);t.mergeAll=function(e){return void 0===e&&(e=1/0),r.mergeMap(o.identity,e)}},60781(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(89233),a=n(85295),s=n(75901);function l(e,t,n){return(void 0===n&&(n=1/0),"function"==typeof t)?function(r){return r.pipe(l(function(n,r){return a.from(e(n,r)).pipe(i.map(function(e,o){return t(n,e,r,o)}))},n))}:("number"==typeof t&&(n=t),function(t){return t.lift(new u(e,n))})}t.mergeMap=l;var u=function(){function e(e,t){void 0===t&&(t=1/0),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.project,this.concurrent))},e}();t.MergeMapOperator=u;var c=function(e){function t(t,n,r){void 0===r&&(r=1/0);var o=e.call(this,t)||this;return o.project=n,o.concurrent=r,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return o(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){this.destination.error(e);return}this.active++,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new s.SimpleInnerSubscriber(this),n=this.destination;n.add(t);var r=s.innerSubscribe(e,t);r!==t&&n.add(r)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(s.SimpleOuterSubscriber);t.MergeMapSubscriber=c,t.flatMap=l},62988(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(60781);t.mergeMapTo=function(e,t,n){return(void 0===n&&(n=1/0),"function"==typeof t)?r.mergeMap(function(){return e},t,n):("number"==typeof t&&(n=t),r.mergeMap(function(){return e},n))}},86430(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.mergeScan=function(e,t,n){return void 0===n&&(n=1/0),function(r){return r.lift(new a(e,t,n))}};var a=function(){function e(e,t,n){this.accumulator=e,this.seed=t,this.concurrent=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.accumulator,this.seed,this.concurrent))},e}();t.MergeScanOperator=a;var s=function(e){function t(t,n,r,o){var i=e.call(this,t)||this;return i.accumulator=n,i.acc=r,i.concurrent=o,i.hasValue=!1,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return o(t,e),t.prototype._next=function(e){if(this.active<this.concurrent){var t=this.index++,n=this.destination,r=void 0;try{r=(0,this.accumulator)(this.acc,e,t)}catch(e){return n.error(e)}this.active++,this._innerSub(r)}else this.buffer.push(e)},t.prototype._innerSub=function(e){var t=new i.SimpleInnerSubscriber(this),n=this.destination;n.add(t);var r=i.innerSubscribe(e,t);r!==t&&n.add(r)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},t.prototype.notifyNext=function(e){var t=this.destination;this.acc=e,this.hasValue=!0,t.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},t}(i.SimpleOuterSubscriber);t.MergeScanSubscriber=s},21547(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(71929);t.min=function(e){return r.reduce("function"==typeof e?function(t,n){return 0>e(t,n)?t:n}:function(e,t){return e<t?e:t})}},49529(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(27432);t.multicast=function(e,t){return function(n){if(i="function"==typeof e?e:function(){return e},"function"==typeof t)return n.lift(new o(i,t));var i,a=Object.create(n,r.connectableObservableDescriptor);return a.source=n,a.subjectFactory=i,a}};var o=function(){function e(e,t){this.subjectFactory=e,this.selector=t}return e.prototype.call=function(e,t){var n=this.selector,r=this.subjectFactory(),o=n(r).subscribe(e);return o.add(t.subscribe(r)),o},e}();t.MulticastOperator=o},24654(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(4942);t.observeOn=function(e,t){return void 0===t&&(t=0),function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.scheduler,this.delay))},e}();t.ObserveOnOperator=s;var l=function(e){function t(t,n,r){void 0===r&&(r=0);var o=e.call(this,t)||this;return o.scheduler=n,o.delay=r,o}return o(t,e),t.dispatch=function(e){var t=e.notification,n=e.destination;t.observe(n),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.destination.add(this.scheduler.schedule(t.dispatch,this.delay,new u(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(a.Notification.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(a.Notification.createError(e)),this.unsubscribe()},t.prototype._complete=function(){this.scheduleMessage(a.Notification.createComplete()),this.unsubscribe()},t}(i.Subscriber);t.ObserveOnSubscriber=l;var u=function(e,t){this.notification=e,this.destination=t};t.ObserveOnMessage=u},45276(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(85295),a=n(80743),s=n(75901);t.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length&&a.isArray(e[0])&&(e=e[0]),function(t){return t.lift(new l(e))}},t.onErrorResumeNextStatic=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=void 0;return 1===e.length&&a.isArray(e[0])&&(e=e[0]),n=e.shift(),i.from(n).lift(new l(e))};var l=function(){function e(e){this.nextSources=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.nextSources))},e}(),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r.destination=t,r.nextSources=n,r}return o(t,e),t.prototype.notifyError=function(){this.subscribeToNextSource()},t.prototype.notifyComplete=function(){this.subscribeToNextSource()},t.prototype._error=function(e){this.subscribeToNextSource(),this.unsubscribe()},t.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},t.prototype.subscribeToNextSource=function(){var e=this.nextSources.shift();if(e){var t=new s.SimpleInnerSubscriber(this),n=this.destination;n.add(t);var r=s.innerSubscribe(e,t);r!==t&&n.add(r)}else this.destination.complete()},t}(s.SimpleOuterSubscriber)},98155(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.pairwise=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){var n=e.call(this,t)||this;return n.hasPrev=!1,n}return o(t,e),t.prototype._next=function(e){var t;this.hasPrev?t=[this.prev,e]:this.hasPrev=!0,this.prev=e,t&&this.destination.next(t)},t}(i.Subscriber)},27337(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(86484),o=n(64629);t.partition=function(e,t){return function(n){return[o.filter(e,t)(n),o.filter(r.not(e,t))(n)]}}},86050(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(89233);t.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.length;if(0===n)throw Error("list of properties cannot be empty.");return function(t){var o,i;return r.map((o=e,i=n,function(e){for(var t=e,n=0;n<i;n++){var r=null!=t?t[o[n]]:void 0;if(void 0===r)return;t=r}return t}))(t)}}},96904(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(71077),o=n(49529);t.publish=function(e){return e?o.multicast(function(){return new r.Subject},e):o.multicast(new r.Subject)}},82334(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8791),o=n(49529);t.publishBehavior=function(e){return function(t){return o.multicast(new r.BehaviorSubject(e))(t)}}},20232(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(38513),o=n(49529);t.publishLast=function(){return function(e){return o.multicast(new r.AsyncSubject)(e)}}},24355(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(20328),o=n(49529);t.publishReplay=function(e,t,n,i){n&&"function"!=typeof n&&(i=n);var a="function"==typeof n?n:void 0,s=new r.ReplaySubject(e,t,i);return function(e){return o.multicast(function(){return s},a)(e)}}},89646(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(80743),o=n(57894);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return 1===e.length&&r.isArray(e[0])&&(e=e[0]),t.lift.call(o.race.apply(void 0,[t].concat(e)))}}},71929(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(85002),o=n(96696),i=n(90952),a=n(27928);t.reduce=function(e,t){return arguments.length>=2?function(n){return a.pipe(r.scan(e,t),o.takeLast(1),i.defaultIfEmpty(t))(n)}:function(t){return a.pipe(r.scan(function(t,n,r){return e(t,n,r+1)}),o.takeLast(1))(t)}}},85203(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.refCount=function(){return function(e){return e.lift(new a(e))}};var a=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var n=this.connectable;n._refCount++;var r=new s(e,n),o=t.subscribe(r);return r.closed||(r.connection=n.connect()),o},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return o(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(!e){this.connection=null;return}this.connectable=null;var t=e._refCount;if(t<=0||(e._refCount=t-1,t>1)){this.connection=null;return}var n=this.connection,r=e._connection;this.connection=null,r&&(!n||r===n)&&r.unsubscribe()},t}(i.Subscriber)},30068(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(34914);t.repeat=function(e){return void 0===e&&(e=-1),function(t){return 0===e?a.empty():e<0?t.lift(new s(-1,t)):t.lift(new s(e-1,t))}};var s=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.count,this.source))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.count=n,o.source=r,o}return o(t,e),t.prototype.complete=function(){if(!this.isStopped){var t=this.source,n=this.count;if(0===n)return e.prototype.complete.call(this);n>-1&&(this.count=n-1),t.subscribe(this._unsubscribeAndRecycle())}},t}(i.Subscriber)},58440(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(75901);t.repeatWhen=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,t))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.notifier=n,o.source=r,o.sourceIsBeingSubscribedTo=!0,o}return o(t,e),t.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},t.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return e.prototype.complete.call(this)},t.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},t.prototype._unsubscribe=function(){var e=this.notifications,t=this.retriesSubscription;e&&(e.unsubscribe(),this.notifications=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype._unsubscribeAndRecycle=function(){var t=this._unsubscribe;return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=t,this},t.prototype.subscribeToRetries=function(){this.notifications=new i.Subject;try{var t;t=(0,this.notifier)(this.notifications)}catch(t){return e.prototype.complete.call(this)}this.retries=t,this.retriesSubscription=a.innerSubscribe(t,new a.SimpleInnerSubscriber(this))},t}(a.SimpleOuterSubscriber)},39933(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.retry=function(e){return void 0===e&&(e=-1),function(t){return t.lift(new a(e,t))}};var a=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.count,this.source))},e}(),s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.count=n,o.source=r,o}return o(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return e.prototype.error.call(this,t);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},t}(i.Subscriber)},53325(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(75901);t.retryWhen=function(e){return function(t){return t.lift(new s(e,t))}};var s=function(){function e(e,t){this.notifier=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,this.source))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.notifier=n,o.source=r,o}return o(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=this.errors,r=this.retries,o=this.retriesSubscription;if(r)this.errors=void 0,this.retriesSubscription=void 0;else{n=new i.Subject;try{r=(0,this.notifier)(n)}catch(t){return e.prototype.error.call(this,t)}o=a.innerSubscribe(r,new a.SimpleInnerSubscriber(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=o,n.next(t)}},t.prototype._unsubscribe=function(){var e=this.errors,t=this.retriesSubscription;e&&(e.unsubscribe(),this.errors=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype.notifyNext=function(){var e=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=e,this.source.subscribe(this)},t}(a.SimpleOuterSubscriber)},27677(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.sample=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new s(e),r=t.subscribe(n);return r.add(i.innerSubscribe(this.notifier,new i.SimpleInnerSubscriber(n))),r},e}(),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasValue=!1,t}return o(t,e),t.prototype._next=function(e){this.value=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(i.SimpleOuterSubscriber)},88360(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(86735);t.sampleTime=function(e,t){return void 0===t&&(t=a.async),function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){this.period=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.period,this.scheduler))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.period=n,o.scheduler=r,o.hasValue=!1,o.add(r.schedule(u,n,{subscriber:o,period:n})),o}return o(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(i.Subscriber);function u(e){var t=e.subscriber,n=e.period;t.notifyNext(),this.schedule(e,n)}},85002(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.scan=function(e,t){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new a(e,t,n))}};var a=function(){function e(e,t,n){void 0===n&&(n=!1),this.accumulator=e,this.seed=t,this.hasSeed=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.accumulator,this.seed,this.hasSeed))},e}(),s=function(e){function t(t,n,r,o){var i=e.call(this,t)||this;return i.accumulator=n,i._seed=r,i.hasSeed=o,i.index=0,i}return o(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.accumulator(this.seed,e,n)}catch(e){this.destination.error(e)}this.seed=t,this.destination.next(t)},t}(i.Subscriber)},54332(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.sequenceEqual=function(e,t){return function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.compareTo=e,this.comparator=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.compareTo,this.comparator))},e}();t.SequenceEqualOperator=a;var s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.compareTo=n,o.comparator=r,o._a=[],o._b=[],o._oneComplete=!1,o.destination.add(n.subscribe(new l(t,o))),o}return o(t,e),t.prototype._next=function(e){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(e),this.checkValues())},t.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},t.prototype.checkValues=function(){for(var e=this._a,t=this._b,n=this.comparator;e.length>0&&t.length>0;){var r=e.shift(),o=t.shift(),i=!1;try{i=n?n(r,o):r===o}catch(e){this.destination.error(e)}i||this.emit(!1)}},t.prototype.emit=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype.nextB=function(e){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(e),this.checkValues())},t.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},t}(i.Subscriber);t.SequenceEqualSubscriber=s;var l=function(e){function t(t,n){var r=e.call(this,t)||this;return r.parent=n,r}return o(t,e),t.prototype._next=function(e){this.parent.nextB(e)},t.prototype._error=function(e){this.parent.error(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},t}(i.Subscriber)},49184(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(49529),o=n(85203),i=n(71077);function a(){return new i.Subject}t.share=function(){return function(e){return o.refCount()(r.multicast(a)(e))}}},91451(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(20328);t.shareReplay=function(e,t,n){var o;return o=e&&"object"==typeof e?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:n},function(e){var t,n,i,a,s,l,u,c,d,f,p,h;return e.lift((s=void 0===(a=(t=o).bufferSize)?1/0:a,u=void 0===(l=t.windowTime)?1/0:l,c=t.refCount,d=t.scheduler,f=0,p=!1,h=!1,function(e){var t;f++,!n||p?(p=!1,t=(n=new r.ReplaySubject(s,u,d)).subscribe(this),i=e.subscribe({next:function(e){n.next(e)},error:function(e){p=!0,n.error(e)},complete:function(){h=!0,i=void 0,n.complete()}}),h&&(i=void 0)):t=n.subscribe(this),this.add(function(){f--,t.unsubscribe(),t=void 0,i&&!h&&c&&0===f&&(i.unsubscribe(),i=void 0,n=void 0)})}))}}},76003(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(62637);t.single=function(e){return function(t){return t.lift(new s(e,t))}};var s=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.predicate,this.source))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.predicate=n,o.source=r,o.seenValue=!1,o.index=0,o}return o(t,e),t.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},t.prototype._next=function(e){var t=this.index++;this.predicate?this.tryNext(e,t):this.applySingleValue(e)},t.prototype.tryNext=function(e,t){try{this.predicate(e,t,this.source)&&this.applySingleValue(e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){var e=this.destination;this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new a.EmptyError)},t}(i.Subscriber)},67124(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.skip=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.total=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.total))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return o(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(i.Subscriber)},31444(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(2519);t.skipLast=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){if(this._skipCount=e,this._skipCount<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return 0===this._skipCount?t.subscribe(new i.Subscriber(e)):t.subscribe(new l(e,this._skipCount))},e}(),l=function(e){function t(t,n){var r=e.call(this,t)||this;return r._skipCount=n,r._count=0,r._ring=Array(n),r}return o(t,e),t.prototype._next=function(e){var t=this._skipCount,n=this._count++;if(n<t)this._ring[n]=e;else{var r=n%t,o=this._ring,i=o[r];o[r]=e,this.destination.next(i)}},t}(i.Subscriber)},51026(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.skipUntil=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.notifier))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;r.hasValue=!1;var o=new i.SimpleInnerSubscriber(r);r.add(o),r.innerSubscription=o;var a=i.innerSubscribe(n,o);return a!==o&&(r.add(a),r.innerSubscription=a),r}return o(t,e),t.prototype._next=function(t){this.hasValue&&e.prototype._next.call(this,t)},t.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},t.prototype.notifyComplete=function(){},t}(i.SimpleOuterSubscriber)},79159(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.skipWhile=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.predicate=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate))},e}(),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return o(t,e),t.prototype._next=function(e){var t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)},t.prototype.tryCallPredicate=function(e){try{var t=this.predicate(e,this.index++);this.skipping=!!t}catch(e){this.destination.error(e)}},t}(i.Subscriber)},89155(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(99623),o=n(23935);t.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return o.isScheduler(n)?(e.pop(),function(t){return r.concat(e,t,n)}):function(t){return r.concat(e,t)}}},30162(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(17563);t.subscribeOn=function(e,t){return void 0===t&&(t=0),function(n){return n.lift(new o(e,t))}};var o=function(){function e(e,t){this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return new r.SubscribeOnObservable(t,this.delay,this.scheduler).subscribe(e)},e}()},21324(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(20917),o=n(78522);t.switchAll=function(){return r.switchMap(o.identity)}},20917(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(89233),a=n(85295),s=n(75901);t.switchMap=function e(t,n){return"function"==typeof n?function(r){return r.pipe(e(function(e,r){return a.from(t(e,r)).pipe(i.map(function(t,o){return n(e,t,r,o)}))}))}:function(e){return e.lift(new l(t))}};var l=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.project))},e}(),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r.project=n,r.index=0,r}return o(t,e),t.prototype._next=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){this.destination.error(e);return}this._innerSub(t)},t.prototype._innerSub=function(e){var t=this.innerSubscription;t&&t.unsubscribe();var n=new s.SimpleInnerSubscriber(this),r=this.destination;r.add(n),this.innerSubscription=s.innerSubscribe(e,n),this.innerSubscription!==n&&r.add(this.innerSubscription)},t.prototype._complete=function(){var t=this.innerSubscription;(!t||t.closed)&&e.prototype._complete.call(this),this.unsubscribe()},t.prototype._unsubscribe=function(){this.innerSubscription=void 0},t.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e){this.destination.next(e)},t}(s.SimpleOuterSubscriber)},35428(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(20917);t.switchMapTo=function(e,t){return t?r.switchMap(function(){return e},t):r.switchMap(function(){return e})}},85624(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(2519),s=n(34914);t.take=function(e){return function(t){return 0===e?s.empty():t.lift(new l(e))}};var l=function(){function e(e){if(this.total=e,this.total<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return o(t,e),t.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},t}(i.Subscriber)},96696(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(2519),s=n(34914);t.takeLast=function(e){return function(t){return 0===e?s.empty():t.lift(new l(e))}};var l=function(){function e(e){if(this.total=e,this.total<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.ring=[],r.count=0,r}return o(t,e),t.prototype._next=function(e){var t=this.ring,n=this.total,r=this.count++;t.length<n?t.push(e):t[r%n]=e},t.prototype._complete=function(){var e=this.destination,t=this.count;if(t>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,o=0;o<n;o++){var i=t++%n;e.next(r[i])}e.complete()},t}(i.Subscriber)},41534(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.takeUntil=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new s(e),r=i.innerSubscribe(this.notifier,new i.SimpleInnerSubscriber(n));return r&&!n.seenValue?(n.add(r),t.subscribe(n)):n},e}(),s=function(e){function t(t){var n=e.call(this,t)||this;return n.seenValue=!1,n}return o(t,e),t.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(i.SimpleOuterSubscriber)},5179(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759);t.takeWhile=function(e,t){return void 0===t&&(t=!1),function(n){return n.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.inclusive=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.inclusive))},e}(),s=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.predicate=n,o.inclusive=r,o.index=0,o}return o(t,e),t.prototype._next=function(e){var t,n=this.destination;try{t=this.predicate(e,this.index++)}catch(e){n.error(e);return}this.nextOrComplete(e,t)},t.prototype.nextOrComplete=function(e,t){var n=this.destination;t?n.next(e):(this.inclusive&&n.next(e),n.complete())},t}(i.Subscriber)},68022(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(53912),s=n(84864);t.tap=function(e,t,n){return function(r){return r.lift(new l(e,t,n))}};var l=function(){function e(e,t,n){this.nextOrObserver=e,this.error=t,this.complete=n}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.nextOrObserver,this.error,this.complete))},e}(),u=function(e){function t(t,n,r,o){var i=e.call(this,t)||this;return i._tapNext=a.noop,i._tapError=a.noop,i._tapComplete=a.noop,i._tapError=r||a.noop,i._tapComplete=o||a.noop,s.isFunction(n)?(i._context=i,i._tapNext=n):n&&(i._context=n,i._tapNext=n.next||a.noop,i._tapError=n.error||a.noop,i._tapComplete=n.complete||a.noop),i}return o(t,e),t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.next(e)},t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.error(e)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){this.destination.error(e);return}return this.destination.complete()},t}(i.Subscriber)},15019(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(75901);t.defaultThrottleConfig={leading:!0,trailing:!1},t.throttle=function(e,n){return void 0===n&&(n=t.defaultThrottleConfig),function(t){return t.lift(new a(e,!!n.leading,!!n.trailing))}};var a=function(){function e(e,t,n){this.durationSelector=e,this.leading=t,this.trailing=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector,this.leading,this.trailing))},e}(),s=function(e){function t(t,n,r,o){var i=e.call(this,t)||this;return i.destination=t,i.durationSelector=n,i._leading=r,i._trailing=o,i._hasValue=!1,i}return o(t,e),t.prototype._next=function(e){this._hasValue=!0,this._sendValue=e,this._throttled||(this._leading?this.send():this.throttle(e))},t.prototype.send=function(){var e=this._hasValue,t=this._sendValue;e&&(this.destination.next(t),this.throttle(t)),this._hasValue=!1,this._sendValue=void 0},t.prototype.throttle=function(e){var t=this.tryDurationSelector(e);t&&this.add(this._throttled=i.innerSubscribe(t,new i.SimpleInnerSubscriber(this)))},t.prototype.tryDurationSelector=function(e){try{return this.durationSelector(e)}catch(e){return this.destination.error(e),null}},t.prototype.throttlingDone=function(){var e=this._throttled,t=this._trailing;e&&e.unsubscribe(),this._throttled=void 0,t&&this.send()},t.prototype.notifyNext=function(){this.throttlingDone()},t.prototype.notifyComplete=function(){this.throttlingDone()},t}(i.SimpleOuterSubscriber)},7406(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(86735),s=n(15019);t.throttleTime=function(e,t,n){return void 0===t&&(t=a.async),void 0===n&&(n=s.defaultThrottleConfig),function(r){return r.lift(new l(e,t,n.leading,n.trailing))}};var l=function(){function e(e,t,n,r){this.duration=e,this.scheduler=t,this.leading=n,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),u=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;return a.duration=n,a.scheduler=r,a.leading=o,a.trailing=i,a._hasTrailingValue=!1,a._trailingValue=null,a}return o(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(c,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue&&this.destination.next(this._trailingValue),this.destination.complete()},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(i.Subscriber);function c(e){e.subscriber.clearThrottle()}},8347(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(62637),a=n(77759);t.throwIfEmpty=function(e){return void 0===e&&(e=u),function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.errorFactory=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.errorFactory))},e}(),l=function(e){function t(t,n){var r=e.call(this,t)||this;return r.errorFactory=n,r.hasValue=!1,r}return o(t,e),t.prototype._next=function(e){this.hasValue=!0,this.destination.next(e)},t.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var e=void 0;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)},t}(a.Subscriber);function u(){return new i.EmptyError}},61115(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(86735),o=n(85002),i=n(26691),a=n(89233);t.timeInterval=function(e){return void 0===e&&(e=r.async),function(t){return i.defer(function(){return t.pipe(o.scan(function(t,n){var r=t.current;return{value:n,current:e.now(),last:r}},{current:e.now(),value:void 0,last:void 0}),a.map(function(e){var t=e.current,n=e.last;return new s(e.value,t-n)}))})}};var s=function(e,t){this.value=e,this.interval=t};t.TimeInterval=s},82784(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(86735),o=n(31027),i=n(35816),a=n(11673);t.timeout=function(e,t){return void 0===t&&(t=r.async),i.timeoutWith(e,a.throwError(new o.TimeoutError),t)}},35816(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(86735),a=n(66740),s=n(75901);t.timeoutWith=function(e,t,n){return void 0===n&&(n=i.async),function(r){var o=a.isDate(e),i=o?e-n.now():Math.abs(e);return r.lift(new l(i,o,t,n))}};var l=function(){function e(e,t,n,r){this.waitFor=e,this.absoluteTimeout=t,this.withObservable=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},e}(),u=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;return a.absoluteTimeout=n,a.waitFor=r,a.withObservable=o,a.scheduler=i,a.scheduleTimeout(),a}return o(t,e),t.dispatchTimeout=function(e){var t=e.withObservable;e._unsubscribeAndRecycle(),e.add(s.innerSubscribe(t,new s.SimpleInnerSubscriber(e)))},t.prototype.scheduleTimeout=function(){var e=this.action;e?this.action=e.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(t.dispatchTimeout,this.waitFor,this))},t.prototype._next=function(t){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,t)},t.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},t}(s.SimpleOuterSubscriber)},20367(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(86735),o=n(89233);t.timestamp=function(e){return void 0===e&&(e=r.async),o.map(function(t){return new i(t,e.now())})};var i=function(e,t){this.value=e,this.timestamp=t};t.Timestamp=i},89133(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(71929);function o(e,t,n){return 0===n?[t]:(e.push(t),e)}t.toArray=function(){return r.reduce(o,[])}},22363(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(75901);t.window=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.windowBoundaries=e}return e.prototype.call=function(e,t){var n=new l(e),r=t.subscribe(n);return r.closed||n.add(a.innerSubscribe(this.windowBoundaries,new a.SimpleInnerSubscriber(n))),r},e}(),l=function(e){function t(t){var n=e.call(this,t)||this;return n.window=new i.Subject,t.next(n.window),n}return o(t,e),t.prototype.notifyNext=function(){this.openWindow()},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(){this._complete()},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e)},t.prototype._complete=function(){this.window.complete(),this.destination.complete()},t.prototype._unsubscribe=function(){this.window=null},t.prototype.openWindow=function(){var e=this.window;e&&e.complete();var t=this.destination,n=this.window=new i.Subject;t.next(n)},t}(a.SimpleOuterSubscriber)},32216(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(77759),a=n(71077);t.windowCount=function(e,t){return void 0===t&&(t=0),function(n){return n.lift(new s(e,t))}};var s=function(){function e(e,t){this.windowSize=e,this.startWindowEvery=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.windowSize,this.startWindowEvery))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.destination=t,o.windowSize=n,o.startWindowEvery=r,o.windows=[new a.Subject],o.count=0,t.next(o.windows[0]),o}return o(t,e),t.prototype._next=function(e){for(var t=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,o=this.windows,i=o.length,s=0;s<i&&!this.closed;s++)o[s].next(e);var l=this.count-r+1;if(l>=0&&l%t==0&&!this.closed&&o.shift().complete(),++this.count%t==0&&!this.closed){var u=new a.Subject;o.push(u),n.next(u)}},t.prototype._error=function(e){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().complete();this.destination.complete()},t.prototype._unsubscribe=function(){this.count=0,this.windows=null},t}(i.Subscriber)},93886(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(86735),s=n(77759),l=n(19673),u=n(23935);t.windowTime=function(e){var t=a.async,n=null,r=1/0;return u.isScheduler(arguments[3])&&(t=arguments[3]),u.isScheduler(arguments[2])?t=arguments[2]:l.isNumeric(arguments[2])&&(r=Number(arguments[2])),u.isScheduler(arguments[1])?t=arguments[1]:l.isNumeric(arguments[1])&&(n=Number(arguments[1])),function(o){return o.lift(new c(e,n,r,t))}};var c=function(){function e(e,t,n,r){this.windowTimeSpan=e,this.windowCreationInterval=t,this.maxWindowSize=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new f(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._numberOfNextedValues=0,t}return o(t,e),t.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),t}(i.Subject),f=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;a.destination=t,a.windowTimeSpan=n,a.windowCreationInterval=r,a.maxWindowSize=o,a.scheduler=i,a.windows=[];var s=a.openWindow();return null!==r&&r>=0?(a.add(i.schedule(m,n,{subscriber:a,window:s,context:null})),a.add(i.schedule(h,r,{windowTimeSpan:n,windowCreationInterval:r,subscriber:a,scheduler:i}))):a.add(i.schedule(p,n,{subscriber:a,window:s,windowTimeSpan:n})),a}return o(t,e),t.prototype._next=function(e){for(var t=this.windows,n=t.length,r=0;r<n;r++){var o=t[r];!o.closed&&(o.next(e),o.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(o))}},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;){var t=e.shift();t.closed||t.complete()}this.destination.complete()},t.prototype.openWindow=function(){var e=new d;return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},t}(s.Subscriber);function p(e){var t=e.subscriber,n=e.windowTimeSpan,r=e.window;r&&t.closeWindow(r),e.window=t.openWindow(),this.schedule(e,n)}function h(e){var t=e.windowTimeSpan,n=e.subscriber,r=e.scheduler,o=e.windowCreationInterval,i=n.openWindow(),a={action:this,subscription:null};a.subscription=r.schedule(m,t,{subscriber:n,window:i,context:a}),this.add(a.subscription),this.schedule(e,o)}function m(e){var t=e.subscriber,n=e.window,r=e.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),t.closeWindow(n)}},83903(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(21016),s=n(89152),l=n(87778);t.windowToggle=function(e,t){return function(n){return n.lift(new u(e,t))}};var u=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.openings,this.closingSelector))},e}(),c=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.openings=n,o.closingSelector=r,o.contexts=[],o.add(o.openSubscription=l.subscribeToResult(o,n,n)),o}return o(t,e),t.prototype._next=function(e){var t=this.contexts;if(t)for(var n=t.length,r=0;r<n;r++)t[r].window.next(e)},t.prototype._error=function(t){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,o=-1;++o<r;){var i=n[o];i.window.error(t),i.subscription.unsubscribe()}e.prototype._error.call(this,t)},t.prototype._complete=function(){var t=this.contexts;if(this.contexts=null,t)for(var n=t.length,r=-1;++r<n;){var o=t[r];o.window.complete(),o.subscription.unsubscribe()}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.contexts;if(this.contexts=null,e)for(var t=e.length,n=-1;++n<t;){var r=e[n];r.window.unsubscribe(),r.subscription.unsubscribe()}},t.prototype.notifyNext=function(e,t,n,r,o){if(e===this.openings){var s=void 0;try{s=(0,this.closingSelector)(t)}catch(e){return this.error(e)}var u=new i.Subject,c=new a.Subscription,d={window:u,subscription:c};this.contexts.push(d);var f=l.subscribeToResult(this,s,d);f.closed?this.closeWindow(this.contexts.length-1):(f.context=d,c.add(f)),this.destination.next(u)}else this.closeWindow(this.contexts.indexOf(e))},t.prototype.notifyError=function(e){this.error(e)},t.prototype.notifyComplete=function(e){e!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(e.context))},t.prototype.closeWindow=function(e){if(-1!==e){var t=this.contexts,n=t[e],r=n.window,o=n.subscription;t.splice(e,1),r.complete(),o.unsubscribe()}},t}(s.OuterSubscriber)},27539(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(71077),a=n(89152),s=n(87778);t.windowWhen=function(e){return function(t){return t.lift(new l(e))}};var l=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.closingSelector))},e}(),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r.destination=t,r.closingSelector=n,r.openWindow(),r}return o(t,e),t.prototype.notifyNext=function(e,t,n,r,o){this.openWindow(o)},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(e){this.openWindow(e)},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e),this.unsubscribeClosingNotification()},t.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},t.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},t.prototype.openWindow=function(e){void 0===e&&(e=null),e&&(this.remove(e),e.unsubscribe());var t,n=this.window;n&&n.complete();var r=this.window=new i.Subject;this.destination.next(r);try{t=(0,this.closingSelector)()}catch(e){this.destination.error(e),this.window.error(e);return}this.add(this.closingNotification=s.subscribeToResult(this,t))},t}(a.OuterSubscriber)},76788(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(89152),a=n(87778);t.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n;return"function"==typeof e[e.length-1]&&(n=e.pop()),t.lift(new s(e,n))}};var s=function(){function e(e,t){this.observables=e,this.project=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.observables,this.project))},e}(),l=function(e){function t(t,n,r){var o=e.call(this,t)||this;o.observables=n,o.project=r,o.toRespond=[];var i=n.length;o.values=Array(i);for(var s=0;s<i;s++)o.toRespond.push(s);for(var s=0;s<i;s++){var l=n[s];o.add(a.subscribeToResult(o,l,void 0,s))}return o}return o(t,e),t.prototype.notifyNext=function(e,t,n){this.values[n]=t;var r=this.toRespond;if(r.length>0){var o=r.indexOf(n);-1!==o&&r.splice(o,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(i.OuterSubscriber)},64868(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(85356);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(r.zip.apply(void 0,[t].concat(e)))}}},85517(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(85356);t.zipAll=function(e){return function(t){return t.lift(new r.ZipOperator(e))}}},85791(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(21016);t.scheduleArray=function(e,t){return new r.Observable(function(n){var r=new o.Subscription,i=0;return r.add(t.schedule(function(){i===e.length?n.complete():(n.next(e[i++]),n.closed||r.add(this.schedule()))})),r})}},34178(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(21016),i=n(78258);t.scheduleIterable=function(e,t){if(!e)throw Error("Iterable cannot be null");return new r.Observable(function(n){var r,a=new o.Subscription;return a.add(function(){r&&"function"==typeof r.return&&r.return()}),a.add(t.schedule(function(){r=e[i.iterator](),a.add(t.schedule(function(){if(!n.closed){try{var e,t,o=r.next();e=o.value,t=o.done}catch(e){n.error(e);return}t?n.complete():(n.next(e),this.schedule())}}))})),a})}},12873(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(21016),i=n(46713);t.scheduleObservable=function(e,t){return new r.Observable(function(n){var r=new o.Subscription;return r.add(t.schedule(function(){var o=e[i.observable]();r.add(o.subscribe({next:function(e){r.add(t.schedule(function(){return n.next(e)}))},error:function(e){r.add(t.schedule(function(){return n.error(e)}))},complete:function(){r.add(t.schedule(function(){return n.complete()}))}}))})),r})}},91039(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95092),o=n(21016);t.schedulePromise=function(e,t){return new r.Observable(function(n){var r=new o.Subscription;return r.add(t.schedule(function(){return e.then(function(e){r.add(t.schedule(function(){n.next(e),r.add(t.schedule(function(){return n.complete()}))}))},function(e){r.add(t.schedule(function(){return n.error(e)}))})})),r})}},67670(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12873),o=n(91039),i=n(85791),a=n(34178),s=n(67606),l=n(94215),u=n(90624),c=n(74442);t.scheduled=function(e,t){if(null!=e){if(s.isInteropObservable(e))return r.scheduleObservable(e,t);else if(l.isPromise(e))return o.schedulePromise(e,t);else if(u.isArrayLike(e))return i.scheduleArray(e,t);else if(c.isIterable(e)||"string"==typeof e)return a.scheduleIterable(e,t)}throw TypeError((null!==e&&typeof e||e)+" is not observable")}},55169(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Action=function(e){function t(t,n){return e.call(this)||this}return o(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(21016).Subscription)},82900(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(42839);t.AsapAction=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return o(t,e),t.prototype.requestAsyncId=function(t,n,r){return(void 0===r&&(r=0),null!==r&&r>0)?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=i.Immediate.setImmediate(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(i.Immediate.clearImmediate(n),t.scheduled=void 0)},t}(n(70469).AsyncAction)},3069(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapScheduler=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,r=-1,o=n.length;e=e||n.shift();do if(t=e.execute(e.state,e.delay))break;while(++r<o&&(e=n.shift()));if(this.active=!1,t){for(;++r<o&&(e=n.shift());)e.unsubscribe();throw t}},t}(n(25646).AsyncScheduler)},70469(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncAction=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return o(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r=void 0;try{this.work(e)}catch(e){n=!0,r=!!e&&e||Error(e)}if(n)return this.unsubscribe(),r},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,n=t.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(n(55169).Action)},25646(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(94688);t.AsyncScheduler=function(e){function t(n,r){void 0===r&&(r=i.Scheduler.now);var o=e.call(this,n,function(){return t.delegate&&t.delegate!==o?t.delegate.now():r()})||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return o(t,e),t.prototype.schedule=function(n,r,o){return(void 0===r&&(r=0),t.delegate&&t.delegate!==this)?t.delegate.schedule(n,r,o):e.prototype.schedule.call(this,n,r,o)},t.prototype.flush=function(e){var t,n=this.actions;if(this.active)return void n.push(e);this.active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=n.shift());if(this.active=!1,t){for(;e=n.shift();)e.unsubscribe();throw t}},t}(i.Scheduler)},58538(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueAction=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return o(t,e),t.prototype.schedule=function(t,n){return(void 0===n&&(n=0),n>0)?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)?e.prototype.requestAsyncId.call(this,t,n,r):t.flush(this)},t}(n(70469).AsyncAction)},78831(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueScheduler=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(n(25646).AsyncScheduler)},73766(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(82900);t.asapScheduler=new(n(3069)).AsapScheduler(r.AsapAction),t.asap=t.asapScheduler},86735(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(70469);t.asyncScheduler=new(n(25646)).AsyncScheduler(r.AsyncAction),t.async=t.asyncScheduler},63792(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(58538);t.queueScheduler=new(n(78831)).QueueScheduler(r.QueueAction),t.queue=t.queueScheduler},78258(e,t){"use strict";function n(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(t,"__esModule",{value:!0}),t.getSymbolIterator=n,t.iterator=n(),t.$$iterator=t.iterator},46713(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},58636(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rxSubscriber="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),t.$$rxSubscriber=t.rxSubscriber},2519(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentOutOfRangeError=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}()},62637(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyError=function(){function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e}()},42839(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=1,r=Promise.resolve(),o={};function i(e){return e in o&&(delete o[e],!0)}t.Immediate={setImmediate:function(e){var t=n++;return o[t]=!0,r.then(function(){return i(t)&&e()}),t},clearImmediate:function(e){i(e)}},t.TestTools={pending:function(){return Object.keys(o).length}}},18860(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUnsubscribedError=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}()},31027(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeoutError=function(){function e(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return e.prototype=Object.create(Error.prototype),e}()},11806(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscriptionError=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}()},21226(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(77759);t.canReportError=function(e){for(;e;){var t=e,n=t.closed,o=t.destination,i=t.isStopped;if(n||i)return!1;e=o&&o instanceof r.Subscriber?o:null}return!0}},59468(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hostReportError=function(e){setTimeout(function(){throw e},0)}},78522(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identity=function(e){return e}},80743(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArray=Array.isArray||function(e){return e&&"number"==typeof e.length}},90624(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},66740(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDate=function(e){return e instanceof Date&&!isNaN(+e)}},84864(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=function(e){return"function"==typeof e}},67606(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(46713);t.isInteropObservable=function(e){return e&&"function"==typeof e[r.observable]}},74442(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(78258);t.isIterable=function(e){return e&&"function"==typeof e[r.iterator]}},19673(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(80743);t.isNumeric=function(e){return!r.isArray(e)&&e-parseFloat(e)+1>=0}},6727(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=function(e){return null!==e&&"object"==typeof e}},94215(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=function(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}},23935(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScheduler=function(e){return e&&"function"==typeof e.schedule}},53912(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=function(){}},86484(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.not=function(e,t){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=e,n.thisArg=t,n}},27928(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(78522);function o(e){return 0===e.length?r.identity:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(e)},t.pipeFromArray=o},41727(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(422),o=n(63266),i=n(47429),a=n(13394),s=n(90624),l=n(94215),u=n(6727),c=n(78258),d=n(46713);t.subscribeTo=function(e){if(e&&"function"==typeof e[d.observable])return a.subscribeToObservable(e);if(s.isArrayLike(e))return r.subscribeToArray(e);if(l.isPromise(e))return o.subscribeToPromise(e);if(e&&"function"==typeof e[c.iterator])return i.subscribeToIterable(e);throw TypeError("You provided "+(u.isObject(e)?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},422(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeToArray=function(e){return function(t){for(var n=0,r=e.length;n<r&&!t.closed;n++)t.next(e[n]);t.complete()}}},47429(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(78258);t.subscribeToIterable=function(e){return function(t){for(var n=e[r.iterator]();;){var o=void 0;try{o=n.next()}catch(e){return t.error(e),t}if(o.done){t.complete();break}if(t.next(o.value),t.closed)break}return"function"==typeof n.return&&t.add(function(){n.return&&n.return()}),t}}},13394(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(46713);t.subscribeToObservable=function(e){return function(t){var n=e[r.observable]();if("function"==typeof n.subscribe)return n.subscribe(t);throw TypeError("Provided object does not correctly implement Symbol.observable")}}},63266(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(59468);t.subscribeToPromise=function(e){return function(t){return e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,r.hostReportError),t}}},87778(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1359),o=n(41727),i=n(95092);t.subscribeToResult=function(e,t,n,a,s){if(void 0===s&&(s=new r.InnerSubscriber(e,n,a)),!s.closed)return t instanceof i.Observable?t.subscribe(s):o.subscribeTo(t)(s)}},67595(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(77759),o=n(58636),i=n(74143);t.toSubscriber=function(e,t,n){if(e){if(e instanceof r.Subscriber)return e;if(e[o.rxSubscriber])return e[o.rxSubscriber]()}return e||t||n?new r.Subscriber(e,t,n):new r.Subscriber(i.empty)}},99549(e,t,n){"use strict";n(18780).audit,n(13441).auditTime,n(11853).buffer,n(77650).bufferCount,n(94360).bufferTime,n(43381).bufferToggle,n(51069).bufferWhen,n(85916).catchError,n(90239).combineAll,n(79397).combineLatest,n(66255).concat,n(60208).concatAll,n(92209).concatMap,n(83232).concatMapTo,n(85476).count,n(59768).debounce,n(92661).debounceTime,n(90952).defaultIfEmpty,n(17436).delay,n(41136).delayWhen,n(56051).dematerialize,n(85343).distinct,n(88179).distinctUntilChanged,n(43670).distinctUntilKeyChanged,n(57366).elementAt,n(61650).endWith,n(92472).every,n(65893).exhaust,n(29219).exhaustMap,n(76527).expand,n(64629).filter,n(4349).finalize,n(32376).find,n(8674).findIndex,n(77089).first,n(36217).groupBy,n(76024).ignoreElements,n(87362).isEmpty,n(6047).last,t.map=n(89233).map,n(27296).mapTo,n(75434).materialize,n(57001).max,n(14779).merge,n(80980).mergeAll;var r=n(60781);r.mergeMap,r.flatMap,n(62988).mergeMapTo,n(86430).mergeScan,n(21547).min,n(49529).multicast,n(24654).observeOn,n(45276).onErrorResumeNext,n(98155).pairwise,n(27337).partition,n(86050).pluck,n(96904).publish,n(82334).publishBehavior,n(20232).publishLast,n(24355).publishReplay,n(89646).race,n(71929).reduce,n(30068).repeat,n(58440).repeatWhen,n(39933).retry,n(53325).retryWhen,n(85203).refCount,n(27677).sample,n(88360).sampleTime,n(85002).scan,n(54332).sequenceEqual,n(49184).share,n(91451).shareReplay,n(76003).single,n(67124).skip,n(31444).skipLast,n(51026).skipUntil,n(79159).skipWhile,n(89155).startWith,n(30162).subscribeOn,n(21324).switchAll,n(20917).switchMap,n(35428).switchMapTo,t.take=n(85624).take,n(96696).takeLast,n(41534).takeUntil,n(5179).takeWhile,n(68022).tap,n(15019).throttle,n(7406).throttleTime,n(8347).throwIfEmpty,n(61115).timeInterval,n(82784).timeout,n(35816).timeoutWith,n(20367).timestamp,n(89133).toArray,n(22363).window,n(32216).windowCount,n(93886).windowTime,n(83903).windowToggle,n(27539).windowWhen,n(76788).withLatestFrom,n(64868).zip,n(85517).zipAll},72481(e,t,n){"use strict";let r,o,i,a,s,l,u,c,d,f,p,h,m;n.r(t),n.d(t,{GenderUnknownIcon:()=>mF,evaluateAsNumber:()=>di,getImportMapOverrideMap:()=>i1,StockManagementPictogram:()=>O2,ChemistryIcon:()=>m_,BabyIcon:()=>mc,DashboardExtension:()=>yF,openmrsComponentDecorator:()=>pD,tryRegisterExtension:()=>hB,pictogramIds:()=>Oj,ActivityIcon:()=>mo,compile:()=>du,removeRouteMapOverride:()=>a_,checkStatus:()=>d$,TableBatchActions:()=>h4,getAsyncLifecycle:()=>pP,subscribeOpenmrsEvent:()=>cV,dispatchConnectivityChanged:()=>g,PasswordIcon:()=>m8,Assessment2Pictogram:()=>OM,CloseIcon:()=>mO,setupRouteMapOverrides:()=>aE,getWorkspaceGroupRegistration:()=>fA,registerWorkspace:()=>fC,useFeatureFlag:()=>p6,reset:()=>fw,LabOrderIcon:()=>mZ,VisitMode:()=>cq,offlineUuidPrefix:()=>cb,useLocations:()=>hm,getLifecycle:()=>pO,formatDatetime:()=>EH,getVisitsForPatient:()=>c2,subscribeConnectivity:()=>v,formatPartialDate:()=>EU,CustomOverflowMenu:()=>me,LocationIcon:()=>mJ,GroupIcon:()=>mV,canBeginEditSynchronizationItemsOfType:()=>cc,VisitStatus:()=>cZ,createUseStore:()=>f6,getCurrentImportMap:()=>ar,getSessionLocation:()=>oJ,usePatient:()=>hx,useRenderableExtensions:()=>hE,getOpenedWindowIndexByWorkspace:()=>f$,checkStatusFor:()=>dL,clearHistory:()=>oT,clearConfigErrors:()=>nz,formatTime:()=>Ez,isDevEnabled:()=>o1,setLeftNav:()=>fx,syncOfflinePatientData:()=>cI,closeWorkspaceGroup2:()=>kr,getCurrentRouteMap:()=>ay,ConfigurableLink:()=>fQ,sessionStore:()=>oU,subscribeSnackbarShown:()=>N,getDynamicOfflineDataEntriesFor:()=>cD,getLoggedInUser:()=>oY,GenderMaleIcon:()=>m$,getExtensionSlotConfigFromStore:()=>t7,evaluateAsNumberAsync:()=>da,putDynamicOfflineDataFor:()=>cP,getImportMapDefaultMap:()=>iX,unregisterExtensionRendering:()=>dZ,implementerToolsConfigStore:()=>nd,Type:()=>tG,InPatientPictogram:()=>OK,cleanupObsoleteFeatureFlags:()=>dT,getAttachmentsUrl:()=>ak,showSnackbar:()=>Pa,PatientBannerActionsMenu:()=>OS,PatientSearchPictogram:()=>OZ,DocumentAttachmentIcon:()=>mj,Snackbar:()=>Pt,CardiologyPictogram:()=>OI,ImageMedicalIcon:()=>mK,ActionableNotificationComponent:()=>DJ,DiagnosisTags:()=>DP,iconIds:()=>mr,PatientsPictogram:()=>OY,interpolateUrl:()=>oS,setupHistory:()=>ok,subscribeToastShown:()=>M,detachAll:()=>fm,convertToLocaleCalendar:()=>EG,DocumentIcon:()=>mC,configInternalStore:()=>t1,ActionMenuButton2:()=>kv,setupDynamicOfflineDataHandler:()=>cS,makeUrl:()=>oL,oneOf:()=>nQ,selectPreferredName:()=>Oc,launchWorkspaceGroup:()=>function e(t,n){let r=fA(t),{state:o,onWorkspaceGroupLaunch:i,workspaceGroupCleanup:a,workspaceToLaunch:s}=n,l=function(){return PO}();if(l.getState().openWorkspaces.length){let r=l.getState().workspaceGroup;r?Ph(r?.name,()=>{e(t,n)}):Pj(()=>{e(t,n)})}else l.setState(e=>({...e,workspaceGroup:{name:t,members:r.members,cleanup:a}})),PN(t,o),i?.(),s&&Py(s.name,s.additionalProps??{})},syncDynamicOfflineData:()=>cT,MobileCheckIcon:()=>m4,createErrorHandler:()=>$,openmrsObservableFetch:()=>oB,parseDate:()=>EI,getAttachmentByUuid:()=>aO,LeftNavMenu:()=>DA,getExtensionRegistration:()=>fd,ShoppingCartAddItemIcon:()=>yI,ReferralOrderIcon:()=>yi,ReportIcon:()=>ys,dispatchToastShown:()=>T,getImportMapNextPageMap:()=>i0,registerExtension:()=>ff,setupOfflineSync:()=>cp,DownloadIcon:()=>mT,useConnectivity:()=>pY,provide:()=>nE,getSynchronizationItemsFor:()=>ci,ShoppingCartArrowDownIcon:()=>yh,featureFlagsStore:()=>dC,promptBeforeClosing:()=>Pv,removeDynamicOfflineDataFor:()=>cC,jsep:()=>c6,GeriatricsPictogram:()=>OU,SearchIcon:()=>yc,reportError:()=>I,slugify:()=>ae,isOmrsDateToday:()=>EA,getExtensionStore:()=>dY,BloodBankPictogram:()=>ON,TriagePictogram:()=>O3,Workspace2:()=>kp,refetchCurrentUser:()=>oG,CheckmarkOutlineIcon:()=>mw,registerExtensionSlot:()=>fv,AllergiesIcon:()=>yR,ArrowDownIcon:()=>ma,useOpenmrsInfinite:()=>ho,getExtensionConfigFromExtensionSlotStore:()=>nt,OpenmrsDatePicker:()=>DD,getExtensionConfigFromStore:()=>ne,getDynamicOfflineDataEntries:()=>cE,getLocaleDisplayName:()=>S9,messageOmrsServiceWorker:()=>aG,navigate:()=>oD,launchWorkspace2:()=>ko,getGroupByWindowName:()=>fI,CustomOverflowMenuItem:()=>mt,isUrl:()=>nJ,CaretDownIcon:()=>mp,ArrowLeftIcon:()=>ms,FacilityPictogram:()=>OV,ViewOffIcon:()=>yC,setCurrentOfflineMode:()=>a1,updateInternalExtensionStore:()=>dW,dispatchActionableNotificationShown:()=>C,resetRouteMapOverrides:()=>ax,formatDurationBetween:()=>E1,defaultVisitCustomRepresentation:()=>cY,getBreadcrumbsFor:()=>n7,useOpenmrsPagination:()=>p7,Pagination:()=>Oi,CheckmarkFilledIcon:()=>mv,clearCurrentUser:()=>oq,showModal:()=>DG,ChevronUpIcon:()=>mD,saveVisit:()=>c0,useAttachments:()=>pK,Pictogram:()=>O8,useExtensionSlot:()=>pt,ChevronDownIcon:()=>mx,OpenmrsDateRangePicker:()=>DO,deleteAttachmentPermanently:()=>aj,getVisitTypes:()=>cH,OverflowMenuHorizontalIcon:()=>m7,EventScheduleIcon:()=>mM,getSessionStore:()=>oz,ActionMenu:()=>P4,ProcedureOrderIcon:()=>yr,preloadImport:()=>an,registerWorkspaceWindows2:()=>fF,useOnVisible:()=>hg,setSessionLocation:()=>oQ,userHasAccess:()=>oZ,ChartAverageIcon:()=>mg,getFeatureFlag:()=>dR,UserAvatarIcon:()=>yD,renderExtension:()=>fq,useFhirInfinite:()=>hu,toVisitTypeObject:()=>cz,useSession:()=>hD,EmergencyDepartmentPictogram:()=>OB,Notification:()=>DZ,dispatchSnackbarShown:()=>j,getSynchronizationItem:()=>cu,navigateAndLaunchWorkspace:()=>Pg,omrsOfflineCachingStrategyHttpHeaderName:()=>aH,formatDate:()=>EW,workspace2StoreActions:()=>ks,SwitcherIcon:()=>yf,esmStyleGuideSchema:()=>h0,getImportMapDisabledOverrides:()=>i2,useAssignedExtensionIds:()=>pU,CaretRightIcon:()=>mm,evaluateAsType:()=>ds,PageHeader:()=>Or,TranslateIcon:()=>y_,setUserProperties:()=>oX,MovementIcon:()=>m5,renderInlineNotifications:()=>D3,subscribePrecacheStaticDependencies:()=>S,PaymentsDeskPictogram:()=>OJ,usePrimaryIdentifierCode:()=>hS,dispatchPrecacheStaticDependencies:()=>x,getCurrentUser:()=>oK,useLayoutType:()=>hd,XrayPictogram:()=>O6,CaretUpIcon:()=>my,renderActionableNotifications:()=>D5,OpenmrsAppContext:()=>p$,setupModals:()=>DH,omrsOfflineResponseBodyHttpHeaderName:()=>aK,getDefaultsFromConfigSchema:()=>function e(t){let n={};for(let r of Object.keys(t))if(k$(t[r])&&t[r].hasOwnProperty("_default"))n[r]=t[r]._default;else{if(r.startsWith("_"))continue;k$(t[r])?n[r]=e(t[r]):n[r]=t[r]}return n},subscribeTo:()=>Q,recordConfigDerivationError:()=>nu,useAbortController:()=>pF,Extension:()=>fX,getFhirServerPaginationHandlers:()=>ht,useConnectedExtensions:()=>pZ,registerApp:()=>hU,queueSynchronizationItemFor:()=>cr,HospitalBedIcon:()=>mW,useExtensionInternalStore:()=>p2,configExtensionStore:()=>t4,getSynchronizationItems:()=>cs,getExtensionSlotsConfigStore:()=>t6,registerExtensionRendering:()=>dq,RenderIfValueIsTruthy:()=>pL,registerFeatureFlag:()=>dj,useFhirFetchAll:()=>hl,restBaseUrl:()=>oN,CalendarHeatMapIcon:()=>md,getWorkspaceRegistration:()=>fR,isImportMapOverrideDisabled:()=>i4,resetConfigSystem:()=>nH,getFullSynchronizationItems:()=>cl,getExtensionInternalStore:()=>dV,registerGlobalStore:()=>Y,runSynchronization:()=>ce,evaluateAsBoolean:()=>dn,PatientBannerPatientInfo:()=>Ow,addRouteMapOverride:()=>aw,getDefaultCalendar:()=>EB,SettingsIcon:()=>yd,DrugOrderIcon:()=>mR,isOnline:()=>dN,ProgramsIcon:()=>yo,useAssignedExtensions:()=>pe,CloseFilledIcon:()=>mP,canAccessStorage:()=>kI,registerDefaultCalendar:()=>EF,TreeViewAltIcon:()=>yS,OverflowMenuVerticalIcon:()=>m9,clearConfigDerivationError:()=>nc,getConfigStore:()=>t3,registerWorkspaceGroup:()=>fj,InformationSquareIcon:()=>mG,EmptyCard:()=>Dj,ChevronLeftIcon:()=>mS,RadiologyIcon:()=>yN,useCandidateExtensions:()=>pW,renderToasts:()=>Pd,isDesktop:()=>hf,integrateBreakpoints:()=>hG,RegistrationPictogram:()=>O0,CardHeader:()=>hJ,getExtensionRegistrationFrom:()=>fc,InformationIcon:()=>mz,TrashCanIcon:()=>yx,useShallowStableValue:()=>f0,useOpenmrsSWR:()=>hb,Assessment1Pictogram:()=>OA,finishRegisteringAllApps:()=>hW,importDynamic:()=>at,useFhirPagination:()=>he,useVisitContextStore:()=>hA,ArrowUpIcon:()=>mu,showActionableNotification:()=>D7,getDynamicOfflineDataHandlers:()=>cx,useForceUpdate:()=>p5,updateWorkspaceWindowState:()=>Pk,useVisit:()=>hM,PatientBannerPatientIdentifiers:()=>Oy,WorkspaceNotification:()=>PG,TransferPictogram:()=>O4,usePagination:()=>hv,Breakpoint:()=>hK,PatientBannerToggleContactDetailsButton:()=>kw,CloseOutlineIcon:()=>mk,ObstetricsPictogram:()=>Oq,parseDateInput:()=>EZ,getConfig:()=>nO,attach:()=>fp,getLocale:()=>S8,ActionMenuButton:()=>PB,isUrlWithTemplateParameters:()=>nY,useEmrConfiguration:()=>p1,useLeftNav:()=>hp,ToolsIcon:()=>yw,ErrorState:()=>DT,detach:()=>fh,setCurrentVisit:()=>cX,registerOmrsServiceWorker:()=>aU,ConditionsIcon:()=>yM,SaveIcon:()=>yu,activateOfflineCapability:()=>a2,useWorkspaces:()=>PT,resetWorkspaceStore:()=>PM,useConfig:()=>pq,validator:()=>tq,CalendarIcon:()=>mf,getHistory:()=>oC,StickyNoteAddIcon:()=>ym,useWorkspace2Store:()=>kl,getPatientName:()=>Oa,getVisitStore:()=>cQ,getCoreTranslation:()=>iV,registerModuleWithConfigSystem:()=>nw,isOfflineUuid:()=>cw,registerModuleLoad:()=>n_,getBreadcrumbs:()=>n3,extractVariableNames:()=>dO,getOfflineSynchronizationStore:()=>u8,translateFrom:()=>iB,EditIcon:()=>mA,useStoreWithActions:()=>f3,getCandidateExtensions:()=>fb,putDynamicOfflineData:()=>cO,shallowEqual:()=>F,subscribeNotificationShown:()=>R,MaximizeIcon:()=>mX,promptForClosingWorkspaces:()=>ka,WarningIcon:()=>yT,closeAllWorkspaces:()=>Pj,fhirBaseUrl:()=>oI,matchLocale:()=>kN,registerBreadcrumb:()=>n2,usePatientPhoto:()=>OO,EventsIcon:()=>mN,createGlobalStore:()=>Z,workspaceStore:()=>PO,getCurrentOfflineMode:()=>a0,subscribeToFeatureFlag:()=>dA,useExtensionStore:()=>p3,closeWorkspace:()=>PS,createAttachment:()=>aC,useLeftNavStore:()=>hh,TableIcon:()=>yb,Icon:()=>yL,InformationFilledIcon:()=>mH,getCurrentPageMap:()=>iQ,LaboratoryPictogram:()=>Oz,temporaryConfigStore:()=>t2,getPromptBeforeClosingFcn:()=>Pw,toDateObjectStrict:()=>EM,defineConfigSchema:()=>nv,filterBreadcrumbs:()=>n5,invalidateImplementerToolsConfig:()=>ns,PatientBannerContactDetails:()=>kO,getAssignedExtensions:()=>fg,PatientPhoto:()=>OC,MaterialOrderIcon:()=>mQ,MicroscopeIcon:()=>m2,scheduleRecomputation:()=>d1,PharmacyPictogram:()=>OQ,AttachmentIcon:()=>yA,MoneyIcon:()=>m3,getAttachments:()=>aP,getFullSynchronizationItemsFor:()=>ca,PageHeaderContent:()=>Oo,MedicationIcon:()=>m0,PrinterIcon:()=>yn,getWorkspaceGroupStore:()=>PN,PatientListsPictogram:()=>O7,useAppContext:()=>pB,isOpenmrsRoutes:()=>aa,AppointmentsAltPictogram:()=>OR,GenericOrderTypeIcon:()=>mB,batchExtensionUpdates:()=>dX,useExtensionSlotStore:()=>f9,ViewIcon:()=>yj,formattedName:()=>Ou,sessionEndpoint:()=>o$,duration:()=>EX,resetImportMapOverrides:()=>i5,TableOfContentsIcon:()=>yg,CaretLeftIcon:()=>mh,getTranslationOverrides:()=>nP,isVersionSatisfied:()=>kB,EmptyCardIllustration:()=>DC,PenIcon:()=>yt,getWorkspaceStore:()=>PP,registerOfflinePatientHandler:()=>cN,setupImportMapOverrides:()=>i8,showToast:()=>Pf,useDefineAppContext:()=>pI,validators:()=>nX,getGlobalStore:()=>J,useOnClickOutside:()=>hy,getWindowByWorkspaceName:()=>fN,ArrowRightIcon:()=>ml,loadLifeCycles:()=>h$,registerBreadcrumbs:()=>n4,MotherIcon:()=>m6,fetchCurrentPatient:()=>cL,Toast:()=>Ps,MessageQueueIcon:()=>m1,TwoFactorAuthenticationIcon:()=>yE,Pharmacy2Pictogram:()=>OX,goBackInHistory:()=>oj,GroupAccessIcon:()=>mU,getExtensionRenderingsStore:()=>dU,setImplementerToolsConfigRecomputer:()=>na,getAsyncExtensionLifecycle:()=>pC,setupApiModule:()=>o4,renderLoadingSpinner:()=>kP,WorkspaceContainer:()=>P3,showNotification:()=>D6,queueSynchronizationItem:()=>co,getModalRegistration:()=>fO,ListCheckedIcon:()=>mY,ResponsiveWrapper:()=>Pe,GynaecologyPictogram:()=>OW,ShoppingCartIcon:()=>yp,getRouteMapNextPageMap:()=>ab,MetadataExportPictogram:()=>OG,updateVisit:()=>c1,backendDependencies:()=>o2,MaybePictogram:()=>O9,beginEditSynchronizationItem:()=>cd,createParcelMounter:()=>fH,getStartedVisit:()=>c4,omrsOfflineResponseStatusHttpHeaderName:()=>az,isOpenmrsAppRoutes:()=>ai,openmrsFetch:()=>oF,HomePictogram:()=>O5,DentistryPictogram:()=>OL,ServiceQueuesPictogram:()=>O1,toLanguageTag:()=>S7,launchWorkspace:()=>Py,setFeatureFlag:()=>dM,useStore:()=>f4,DigitalTrustPictogram:()=>OF,NumericObservation:()=>Ot,attachmentUrl:()=>aD,interpolateString:()=>oE,inRange:()=>nZ,useExtensionSlotMeta:()=>p4,AppointmentsPictogram:()=>OT,renderSnackbars:()=>Pi,getRegisteredWorkspace2Names:()=>kc,toLocationObject:()=>cW,ChartLineIcon:()=>mb,UserHasAccess:()=>hO,evaluateAsBooleanAsync:()=>dr,changeWorkspaceContext:()=>PE,createDashboard:()=>yB,getLocations:()=>cK,getOfflineDb:()=>u6,canCloseWorkspaceWithoutPrompting:()=>Pp,getExtensionsConfigStore:()=>t9,getRouteMapDefaultMap:()=>ag,age:()=>Of,syncAllDynamicOfflineData:()=>cj,isOmrsDateStrict:()=>ER,registerWorkspaceGroups2:()=>fL,usePaginationInfo:()=>hw,evaluateAsync:()=>dt,useOpenmrsFetchAll:()=>ha,removeImportMapOverride:()=>i6,showWorkspacePrompts:()=>PR,useVisitTypes:()=>hN,ageAsDuration:()=>Od,removeDynamicOfflineData:()=>ck,getExtensionNameFromId:()=>fu,deleteSynchronizationItem:()=>cf,renderParcel:()=>fz,useWorkspace2Context:()=>ku,ResetIcon:()=>yl,RenewIcon:()=>ya,subscribeActionableNotificationShown:()=>A,ErrorCard:()=>DR,GenderFemaleIcon:()=>mI,enableImportMapOverride:()=>i7,getOfflinePatientDataStore:()=>cM,retry:()=>kV,ComponentContext:()=>fJ,ExtensionSlot:()=>pr,getOmrsServiceWorker:()=>aW,addImportMapOverride:()=>i3,subscribeConnectivityChanged:()=>b,unsetLeftNav:()=>fS,MaybeIcon:()=>y$,useCustomOverflowMenu:()=>h8,PedestrianFamilyIcon:()=>ye,generateOfflineUuid:()=>cv,cancelPrompt:()=>P_,CtScanPictogram:()=>O$,dispatchNotificationShown:()=>k,leftNavStore:()=>f_,OpenmrsFetchError:()=>oV,UserFollowIcon:()=>yO,launchWorkspaceGroup2:()=>kn,ChevronRightIcon:()=>mE,UserXrayIcon:()=>yP,GenderOtherIcon:()=>mL,formatDuration:()=>Eq,toOmrsIsoString:()=>EN,Labs2Pictogram:()=>OH,workspace2Store:()=>fM,setUserLanguage:()=>oH,useBodyScrollLock:()=>pz,getExtensionConfig:()=>t8,SyringeIcon:()=>yy,LocationPicker:()=>DM,useDebounce:()=>pJ,TimeIcon:()=>yv,getExtensionSlotConfig:()=>t5,AddIcon:()=>mi,getRouteMapOverrideMap:()=>av,processConfig:()=>nk,InventoryManagementIcon:()=>mq,registerWorkspaces2:()=>fB,UserIcon:()=>yk,formatPatientName:()=>Ol,fireOpenmrsEvent:()=>cB,registerModal:()=>fD,registerTranslationNamespace:()=>nx,displayName:()=>Os,evaluate:()=>de,defineExtensionConfigSchema:()=>nS,renderWorkspaceWindowsAndMenu:()=>kA,getSyncLifecycle:()=>pk,evaluateAsTypeAsync:()=>dl});let y="openmrs:connectivity-changed";function g(e){window.dispatchEvent(new CustomEvent(y,{detail:{online:e}}))}function b(e){if(!window.offlineEnabled)return()=>{};let t=t=>e(t.detail);return window.addEventListener(y,t),()=>window.removeEventListener(y,t)}function v(e){return e({online:!window.offlineEnabled||navigator.onLine}),b(e)}let w="openmrs:precache-static-dependencies";function x(e={}){window.dispatchEvent(new CustomEvent(w,{detail:e}))}function S(e){let t=t=>e(t.detail);return window.addEventListener(w,t),()=>window.removeEventListener(w,t)}let E="openmrs:notification-shown",D="openmrs:actionable-notification-shown",O="openmrs:toast-shown",P="openmrs:snack-bar-shown";function k(e){window.dispatchEvent(new CustomEvent(E,{detail:e}))}function C(e){window.dispatchEvent(new CustomEvent(D,{detail:e}))}function j(e){window.dispatchEvent(new CustomEvent(P,{detail:e}))}function T(e){window.dispatchEvent(new CustomEvent(O,{detail:e}))}function R(e){let t=t=>e(t.detail);return window.addEventListener(E,t),()=>window.removeEventListener(E,t)}function A(e){let t=t=>e(t.detail);return window.addEventListener(D,t),()=>window.removeEventListener(D,t)}function M(e){let t=t=>e(t.detail);return window.addEventListener(O,t),()=>window.removeEventListener(O,t)}function N(e){let t=t=>e(t.detail);return window.addEventListener(P,t),()=>window.removeEventListener(P,t)}function I(e){let t=L(e);setTimeout(()=>{throw t})}function $(){let e=Error();return t=>{let n=L(t);n.stack+=`
2
2
  Async stacktrace:
3
- ${e.stack}`,I(t)}}function L(e){let t;if(e instanceof Error)return e;if(null===e)return Error("'null' was thrown as an error");if("object"==typeof e){try{t=`Object thrown as error: ${JSON.stringify(e)}`}catch(n){t=`Object thrown as error with the following properties: ${Object.keys(e)}`}return Error(t)}if(void 0===e)return Error("'undefined' was thrown as an error");return Error(e.toString())}function F(e,t){if(e===t||Object.is(e,t))return!0;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}if(Array.isArray(t)||"object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(t);return n.length===r.length&&n.every(n=>e[n]===t[n])}function B(e,t){let n;try{n=e()}catch(e){return}return{getItem:e=>{var r;let o=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),i=null!=(r=n.getItem(e))?r:null;return i instanceof Promise?i.then(o):o(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,null==t?void 0:t.replacer)),removeItem:e=>n.removeItem(e)}}window.onerror=function(e){return console.error("Unexpected error: ",e),T({description:e??"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(e){console.error("Unhandled rejection: ",e.reason),T({description:e.reason??"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})};let V=e=>t=>{try{let n=e(t);if(n instanceof Promise)return n;return{then:e=>V(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>V(t)(e)}}},U=e=>{let t,n=new Set,r=(e,r)=>{let o="function"==typeof e?e(t):e;if(!Object.is(o,t)){let e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=t=e(r,o,i);return i},W=e=>e?U(e):U;function K(){try{return"u">typeof process&&("true"===process.env.VITEST||void 0!==process.env.JEST_WORKER_ID)||"u">typeof globalThis&&("__vitest_worker__"in globalThis||"__jest__"in globalThis)}catch{return!1}}let z={},H=Symbol.for("openmrs.esm-state.instanceCount"),G=globalThis,q=(G[H]??0)+1;function Z(e,t,n="none"){let r=z[e];if(r)return r.active?K()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):r.value.setState(t,!0),r.active=!0,r.value;{let r=X(e,t,n);return z[e]={value:r,active:!0},r}}function Y(e,t){let n=z[e];return n?(n.active?K()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):n.value=t,n.active=!0,n.value):(z[e]={value:t,active:!0},t)}function J(e,t,n="none"){let r=z[e];if(!r){let r=X(e,t??{},n);return z[e]={value:r,active:!1},r}return r.value}function Q(...e){let[t,n,r]=e,o=void 0===r?n:r,i=void 0===r?e=>e:n,a=i(t.getState());return o(a),t.subscribe(e=>{let t=i(e);F(a,t)||(a=t,o(t))})}function X(e,t,n){return"sessionStorage"===n?W()(((e,t)=>{if("getStorage"in t||"serialize"in t||"deserialize"in t)return console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),(n,r,o)=>{let i,a,s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},l=!1,u=new Set,c=new Set;try{i=s.getStorage()}catch(e){}if(!i)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...e)},r,o);let d=V(s.serialize),f=()=>{let e,t=d({state:s.partialize({...r()}),version:s.version}).then(e=>i.setItem(s.name,e)).catch(t=>{e=t});if(e)throw e;return t},p=o.setState;o.setState=(e,t)=>{p(e,t),f()};let h=e((...e)=>{n(...e),f()},r,o),m=()=>{var e;if(!i)return;l=!1,u.forEach(e=>e(r()));let t=(null==(e=s.onRehydrateStorage)?void 0:e.call(s,r()))||void 0;return V(i.getItem.bind(i))(s.name).then(e=>{if(e)return s.deserialize(e)}).then(e=>{if(e)if("number"!=typeof e.version||e.version===s.version)return e.state;else{if(s.migrate)return s.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return n(a=s.merge(e,null!=(t=r())?t:h),!0),f()}).then(()=>{null==t||t(a,void 0),l=!0,c.forEach(e=>e(a))}).catch(e=>{null==t||t(void 0,e)})};return o.persist={setOptions:e=>{s={...s,...e},e.getStorage&&(i=e.getStorage())},clearStorage:()=>{null==i||i.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>l,onHydrate:e=>(u.add(e),()=>{u.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},m(),a||h};return(n,r,o)=>{let i,a={storage:B(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1,l=new Set,u=new Set,c=a.storage;if(!c)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,o);let d=()=>{let e=a.partialize({...r()});return c.setItem(a.name,{state:e,version:a.version})},f=o.setState;o.setState=(e,t)=>{f(e,t),d()};let p=e((...e)=>{n(...e),d()},r,o);o.getInitialState=()=>p;let h=()=>{var e,t;if(!c)return;s=!1,l.forEach(e=>{var t;return e(null!=(t=r())?t:p)});let o=(null==(t=a.onRehydrateStorage)?void 0:t.call(a,null!=(e=r())?e:p))||void 0;return V(c.getItem.bind(c))(a.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===a.version)return[!1,e.state];else{if(a.migrate)return[!0,a.migrate(e.state,e.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;let[o,s]=e;if(n(i=a.merge(s,null!=(t=r())?t:p),!0),o)return d()}).then(()=>{null==o||o(i,void 0),i=r(),s=!0,u.forEach(e=>e(i))}).catch(e=>{null==o||o(void 0,e)})};return o.persist={setOptions:e=>{a={...a,...e},e.storage&&(c=e.storage)},clearStorage:()=>{null==c||c.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>s,onHydrate:e=>(l.add(e),()=>{l.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},a.skipHydration||h(),i||p}})(()=>t,{name:e,storage:B(()=>sessionStorage)})):W()(()=>t)}G[H]=q,q>1&&!K()&&console.error(`Detected ${q} copies of @openmrs/esm-framework running on this page. Each copy keeps its own store registry, so stores, configuration and extension state are not shared between them. This usually means a frontend module loaded its own bundled framework instead of the one the app shell provides.`),globalThis.setTimeout?.(()=>{"u">typeof window&&"development"===window.spaEnv&&(window.stores=z)},1e3);let ee=function(e){return void 0===e};var et,en,er,eo,ei,ea,es,el,eu,ec,ed,ef,ep,eh,em,ey,eg=n(85693),eb=n(77361),ev=n(34878),ew=n(47313),e_=Object.prototype,ex=Function.prototype.toString,eS=e_.hasOwnProperty,eE=ex.call(Object);let eD=function(e){if(!(0,ew.A)(e)||"[object Object]"!=(0,eb.A)(e))return!1;var t=(0,ev.A)(e);if(null===t)return!0;var n=eS.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ex.call(n)==eE};var eO=n(21050),ek=n(99271),eP=n(26979);let eC=function(e,t,n){(void 0===n||(0,eP.A)(e[t],n))&&(void 0!==n||t in e)||(0,ek.A)(e,t,n)},ej=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[++r];if(!1===t(o[s],s,o))break}return e};var eT=n(521),eR=n(65246),eA=n(80084),eN=n(12458),eM=n(86770),eI=n(96956),e$=n(31475),eL=n(11917),eF=n(50405),eB=n(97942),eV=n(60480);let eU=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var eW=n(28078),eK=n(25894);let ez=function(e,t,n,r,o,i,a){var s=eU(e,n),l=eU(t,n),u=a.get(l);if(u)return void eC(e,n,u);var c=i?i(s,l,n+"",e,t,a):void 0,d=void 0===c;if(d){var f=(0,eI.A)(l),p=!f&&(0,eL.A)(l),h=!f&&!p&&(0,eV.A)(l);(c=l,f||p||h)?(0,eI.A)(s)?c=s:(0,ew.A)(s)&&(0,e$.A)(s)?c=(0,eA.A)(s):p?(d=!1,c=(0,eT.A)(l,!0)):h?(d=!1,c=(0,eR.A)(l,!0)):c=[]:eD(l)||(0,eM.A)(l)?(c=s,(0,eM.A)(s))?c=(0,eW.A)(s,(0,eK.A)(s)):(!(0,eB.A)(s)||(0,eF.A)(s))&&(c=(0,eN.A)(l)):d=!1}d&&(a.set(l,c),o(c,l,r,i,a),a.delete(l)),eC(e,n,c)},eH=function e(t,n,r,o,i){t!==n&&ej(n,function(a,s){if(i||(i=new eO.A),(0,eB.A)(a))ez(t,n,s,r,e,o,i);else{var l=o?o(eU(t,s),a,s+"",t,n,i):void 0;void 0===l&&(l=a),eC(t,s,l)}},eK.A)},eG=function(e){return e},eq=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var eZ=Math.max;let eY=function(e,t,n){return t=eZ(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=eZ(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),eq(e,this,s)}};var eJ=n(61758),eQ=eJ.A?function(e,t){return(0,eJ.A)(e,"toString",{configurable:!0,enumerable:!1,value:function(){return t},writable:!0})}:eG,eX=Date.now,e0=(et=0,en=0,function(){var e=eX(),t=16-(e-en);if(en=e,t>0){if(++et>=800)return arguments[0]}else et=0;return eQ.apply(void 0,arguments)}),e1=n(85378);let e2=function(e,t,n){if(!(0,eB.A)(n))return!1;var r=typeof t;return("number"==r?!!((0,e$.A)(n)&&(0,e1.A)(t,n.length)):"string"==r&&t in n)&&(0,eP.A)(n[t],e)},e4=function(e){var t;return e0(eY(t=function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&e2(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++r<o;){var s=n[r];s&&e(t,s,r,i)}return t},void 0,eG),t+"")};var e3=e4(function(e,t,n,r){eH(e,t,n,r)}),e6=n(90257);function e5(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new e6.A;++t<n;)this.add(e[t])}e5.prototype.add=e5.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},e5.prototype.has=function(e){return this.__data__.has(e)};let e7=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},e9=function(e,t,n,r,o,i){var a=1&n,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,p=2&n?new e5:void 0;for(i.set(e,t),i.set(t,e);++d<s;){var h=e[d],m=t[d];if(r)var y=a?r(m,h,d,t,e,i):r(h,m,d,e,t,i);if(void 0!==y){if(y)continue;f=!1;break}if(p){if(!e7(t,function(e,t){if(!p.has(t)&&(h===e||o(h,e,n,r,i)))return p.push(t)})){f=!1;break}}else if(!(h===m||o(h,m,n,r,i))){f=!1;break}}return i.delete(e),i.delete(t),f};var e8=n(83516),te=n(97913);let tt=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n},tn=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n};var tr=e8.A?e8.A.prototype:void 0,to=tr?tr.valueOf:void 0;let ti=function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!i(new te.A(e),new te.A(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return(0,eP.A)(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=tt;case"[object Set]":var l=1&r;if(s||(s=tn),e.size!=t.size&&!l)break;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var c=e9(s(e),s(t),r,o,i,a);return a.delete(e),c;case"[object Symbol]":if(to)return to.call(e)==to.call(t)}return!1};var ta=n(2475),ts=Object.prototype.hasOwnProperty;let tl=function(e,t,n,r,o,i){var a=1&n,s=(0,ta.A)(e),l=s.length;if(l!=(0,ta.A)(t).length&&!a)return!1;for(var u=l;u--;){var c=s[u];if(!(a?c in t:ts.call(t,c)))return!1}var d=i.get(e),f=i.get(t);if(d&&f)return d==t&&f==e;var p=!0;i.set(e,t),i.set(t,e);for(var h=a;++u<l;){var m=e[c=s[u]],y=t[c];if(r)var g=a?r(y,m,c,t,e,i):r(m,y,c,e,t,i);if(!(void 0===g?m===y||o(m,y,n,r,i):g)){p=!1;break}h||(h="constructor"==c)}if(p&&!h){var b=e.constructor,v=t.constructor;b!=v&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v)&&(p=!1)}return i.delete(e),i.delete(t),p};var tu=n(92728),tc="[object Arguments]",td="[object Array]",tf="[object Object]",tp=Object.prototype.hasOwnProperty;let th=function(e,t,n,r,o,i){var a=(0,eI.A)(e),s=(0,eI.A)(t),l=a?td:(0,tu.A)(e),u=s?td:(0,tu.A)(t);l=l==tc?tf:l,u=u==tc?tf:u;var c=l==tf,d=u==tf,f=l==u;if(f&&(0,eL.A)(e)){if(!(0,eL.A)(t))return!1;a=!0,c=!1}if(f&&!c)return i||(i=new eO.A),a||(0,eV.A)(e)?e9(e,t,n,r,o,i):ti(e,t,l,n,r,o,i);if(!(1&n)){var p=c&&tp.call(e,"__wrapped__"),h=d&&tp.call(t,"__wrapped__");if(p||h){var m=p?e.value():e,y=h?t.value():t;return i||(i=new eO.A),o(m,y,n,r,i)}}return!!f&&(i||(i=new eO.A),tl(e,t,n,r,o,i))},tm=function(e,t){return function e(t,n,r,o,i){return t===n||(null!=t&&null!=n&&((0,ew.A)(t)||(0,ew.A)(n))?th(t,n,r,o,e,i):t!=t&&n!=n)}(e,t)},ty=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o};var tg=n(41736),tb=n(84089),tv=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tw=/^\w*$/;let t_=function(e,t){if((0,eI.A)(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||(0,tb.A)(e))||tw.test(e)||!tv.test(e)||null!=t&&e in Object(t)};function tx(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(tx.Cache||e6.A),n}tx.Cache=e6.A;var tS=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tE=/\\(\\)?/g,tD=(eo=(er=tx(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(tS,function(e,n,r,o){t.push(r?o.replace(tE,"$1"):n||e)}),t},function(e){return 500===eo.size&&eo.clear(),e})).cache,er),tO=1/0,tk=e8.A?e8.A.prototype:void 0,tP=tk?tk.toString:void 0;let tC=function e(t){if("string"==typeof t)return t;if((0,eI.A)(t))return ty(t,e)+"";if((0,tb.A)(t))return tP?tP.call(t):"";var n=t+"";return"0"==n&&1/t==-tO?"-0":n},tj=function(e){return null==e?"":tC(e)},tT=function(e,t){return(0,eI.A)(e)?e:t_(e,t)?[e]:tD(tj(e))},tR=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var tA=1/0;let tN=function(e){if("string"==typeof e||(0,tb.A)(e))return e;var t=e+"";return"0"==t&&1/e==-tA?"-0":t},tM=function(e,t){t=tT(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[tN(t[n++])];return n&&n==r?e:void 0},tI=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i};var t$=Object.prototype.hasOwnProperty;let tL=function(e,t){t=tT(t,e);var n,r=-1,o=t.length;if(!o)return!0;for(;++r<o;){var i=tN(t[r]);if("__proto__"===i&&!t$.call(e,"__proto__")||("constructor"===i||"prototype"===i)&&r<o-1)return!1}var a=(n=t).length<2?e:tM(e,tI(n,0,-1));return null==a||delete a[tN(tR(t))]},tF=function(e){return eD(e)?void 0:e};var tB=n(53271),tV=e8.A?e8.A.isConcatSpreadable:void 0;let tU=function(e){return(0,eI.A)(e)||(0,eM.A)(e)||!!(tV&&e&&e[tV])},tW=function e(t,n,r,o,i){var a=-1,s=t.length;for(r||(r=tU),i||(i=[]);++a<s;){var l=t[a];n>0&&r(l)?n>1?e(l,n-1,r,o,i):(0,tB.A)(i,l):o||(i[i.length]=l)}return i};var tK=n(7096),tz=e0(eY(ei=function(e,t){var n={};if(null==e)return n;var r=!1;t=ty(t,function(t){return t=tT(t,e),r||(r=t.length>1),t}),(0,eW.A)(e,(0,tK.A)(e),n),r&&(n=(0,tg.A)(n,7,tF));for(var o=t.length;o--;)tL(n,t[o]);return n},void 0,function(e){return(null==e?0:e.length)?tW(e,1):[]}),ei+""),tH=n(43322),tG=((ea={}).Array="Array",ea.Boolean="Boolean",ea.ConceptUuid="ConceptUuid",ea.Number="Number",ea.Object="Object",ea.String="String",ea.UUID="UUID",ea.PersonAttributeTypeUuid="PersonAttributeTypeUuid",ea.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid",ea);function tq(e,t){return n=>{if(!e(n))if("function"==typeof t)return t(n);else return t}}let tZ=tq(e=>Array.isArray(e),"must be an array"),tY=tq(e=>"boolean"==typeof e,"must be a boolean"),tJ=tq(e=>"number"==typeof e,"must be a number"),tQ=tq(e=>"string"==typeof e,"must be a string"),tX=tq(e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,"must be an object (not an array or null)"),t0=tq(e=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[0-9a-f]{36}$/i.test(e),"must be a valid UUID or a 36-character hexadecimal string"),t1=Z("config-internal",{providedConfigs:[],schemas:{},moduleLoaded:{}}),t2=Z("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});t2.subscribe(e=>{var t=e.config;try{localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}catch(e){}});let t4=Z("config-store-of-extension-state",{mountedExtensions:[]});function t3(e){return J(`config-module-${e}`,{config:null,loaded:!1,translationOverridesLoaded:!1})}function t6(){return J("config-extension-slots",{slots:{}})}function t5(e){return t7(t6().getState(),e)}function t7(e,t){return e.slots[t]??{loaded:!1,config:{}}}function t9(){return J("config-extensions",{configs:{}})}function t8(e,t){if("string"!=typeof e||"string"!=typeof t||"__proto__"===e||"__proto__"===t||"constructor"===e||"constructor"===t||"prototype"===e||"prototype"===t)throw Error("Attempted to call `getExtensionConfig()` with invalid argument");let n=t9(),r=n=>n.configs[e]?.[t];return{getInitialState:()=>r(n.getInitialState()),getState:()=>r(n.getState())??{loaded:!1,config:null},subscribe:e=>n.subscribe((t,n)=>{let o=r(t),i=r(n);F(o,i)||e(o,i)})}}function ne(e,t,n){return e.configs[t]?.[n]??{loaded:!1,config:null}}function nt(e,t,n){return e.configure?.[n]??null}let nn=W()(()=>({config:{}})),nr=0,no=!0,ni=!1;function na(e){r=e}function ns(){no=!0,nr>0&&nl()}function nl(){if(no&&r&&!ni){ni=!0,no=!1;try{r()}catch(e){no=!0,nu(e),console.error("Failed to derive the implementer tools config",e)}finally{ni=!1}}}function nu(e){nn.setState({derivationError:e instanceof Error?e.message:String(e)})}function nc(){nn.getState().derivationError&&nn.setState({derivationError:void 0})}let nd=Y("config-implementer-tools",{...nn,getState:()=>(0===nr&&nl(),nn.getState()),setState:(...e)=>(no=!1,nn.setState(...e)),subscribe(e){nr++,nl();let t=nn.subscribe(e),n=!1;return()=>{!n&&(n=!0,nr--),t()}}});function nf(e,t){if(Array.isArray(t))return t}function np(e,t){return e3({},e,t,nf)}let nh=[];function nm(){let e=t1.getState(),t=t2.getState(),n=t4.getState();!function(e,t){for(let n of Object.keys(e.schemas)){let r,o=t3(n),i=e.schemas[n],a=!!e.moduleLoaded[n],s=nb.get(n);if(s&&s.schema===i&&s.moduleLoaded===a&&s.providedConfigs===e.providedConfigs&&s.temporaryConfig===t.config)r=s.state;else{let o=a?function(e,t,n){let r=t.schemas[e],o=nN(e,nR(t,n));nI(r,o,e);let i=nB(r,o);return n$(r,i,e),delete i.extensionSlots,i}(n,e,t):function(e,t,n){let r=nB(nq,nN(e,nR(t,n)));return n$(nq,r,e),delete r.extensionSlots,r}(n,e,t);r={translationOverridesLoaded:!0,loaded:a,config:o},nb.set(n,{schema:i,moduleLoaded:a,providedConfigs:e.providedConfigs,temporaryConfig:t.config,state:r})}let l=o.getState();l.loaded===r.loaded&&l.translationOverridesLoaded===r.translationOverridesLoaded&&tm(l.config,r.config)||o.setState(r)}}(e,t);let r=function(e,t){let n=nM(nR(e,t)),r=Object.keys(n).reduce((e,t)=>(n[t]?.extensionSlots&&(e[t]=n[t]?.extensionSlots),e),{});var o=r;for(let[e,t]of Object.entries(o))for(let[n,r]of Object.entries(t))!function(e,t,n){let r=`${t}.extensionSlots.${n}`,o=`Extension slot config '${r}'`,i=Object.keys(e).filter(e=>!["add","remove","order","configure"].includes(e));i.length&&nK(r,o+`' contains invalid keys '${i.join("', '")}'`),!e.add||Array.isArray(e.add)&&e.add.every(e=>"string"==typeof e)||nK(r,o+".add' is invalid. Must be an array of strings (extension IDs)"),!e.remove||Array.isArray(e.remove)&&e.remove.every(e=>"string"==typeof e)||nK(r,o+".remove' is invalid. Must be an array of strings (extension IDs)"),!e.order||Array.isArray(e.order)&&e.order.every(e=>"string"==typeof e)||nK(r,o+".order' is invalid. Must be an array of strings (extension IDs)"),e.configure&&!nU(e.configure)&&nK(r,o+".configure' is invalid. Must be an object with extension IDs for keys")}(r,e,n);let i={},a={};for(let e of Object.values(r))for(let[t,n]of Object.entries(e))i[t]=n,n.configure&&(a[t]??(a[t]=[])).push(n.configure);for(let[e,t]of Object.entries(a)){let n=1===t.length?t[0]:nM(t);i[e].configure!==n&&(i[e]={...i[e],configure:n})}return i}(e,t);(function(e){let t=t6(),n=t.getState().slots,r={},o=!1;for(let[t,i]of Object.entries(e)){let e=n[t];e?.loaded&&tm(e.config,i)?r[t]=e:(r[t]={loaded:!0,config:i},o=!0)}(o||Object.keys(n).length!==Object.keys(r).length)&&t.setState({slots:r})})(r),function(e,t,n,r){let o=t9(),i=o.getState().configs,a={},s=!1,l=0;for(let o of t.mountedExtensions){let t=function(e,t,n,r,o,i,a){let s=function(e){let[t]=e.split("#");return t}(r),l=o.schemas[s],u=JSON.stringify([n,r,e,t]),c=nC.get(u);if(c&&c.extensionSchema===l&&c.extensionModuleSchema===o.schemas[t]&&c.providedConfigs===o.providedConfigs&&c.temporaryConfig===i.config)return c.config;let d=l?s:t,f=nR(o,i),p=a?.configure?.[r]??{},h=nN(e,f),m=h?.extensionSlots?.[n]?.configure?.[r]??{},y=nM([nN(d,f),p,m]),g=l??o.schemas[t];nI(g,y,d);let b=nB(g,y);return n$(g,b,d),delete b.extensionSlots,nC.set(u,{extensionSchema:l,extensionModuleSchema:o.schemas[t],providedConfigs:o.providedConfigs,temporaryConfig:i.config,config:b}),b}(o.slotModuleName,o.extensionModuleName,o.slotName,o.extensionId,e,n,r[o.slotName]),u=i[o.slotName]?.[o.extensionId],c=u?.loaded&&tm(u.config,t)?u:{config:t,loaded:!0};c!==u&&(s=!0),a[o.slotName]||(a[o.slotName]={}),a[o.slotName][o.extensionId]=c,l++}for(let[e,t]of Object.entries(a)){let n=i[e];n&&Object.keys(n).length===Object.keys(t).length&&Object.entries(t).every(([e,t])=>n[e]===t)&&(a[e]=n)}s||(s=Object.keys(i).length!==Object.keys(a).length||Object.values(i).reduce((e,t)=>e+Object.keys(t).length,0)!==l),s&&o.setState({configs:a})}(e,n,t,r),ns()}function ny(){r=()=>{var e,t;let n,r;return e=t1.getState(),t=t2.getState(),n=nd.getState(),r={config:function(e,t){let n=function(e){let t={};for(let[n,r]of Object.entries(e)){let e=nT.get(n);if(e&&e.schema===r)t[n]=e.annotated;else{let e=function e(t){return t.hasOwnProperty("_default")?{...t,_value:t._default,_source:"default"}:nU(t)?Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{}):{}}((0,tH.A)(r));nT.set(n,{schema:r,annotated:e}),t[n]=e}}return t}(e.schemas),r=[...e.providedConfigs.map(e=>[e.config,e.source]),[t.config,"temporary config"]],o=new Set(Object.keys(n));for(let[e]of r)for(let t of Object.keys(e))o.add(t);let i={};for(let e of o){let t=n[e],o=r.map(([t])=>t[e]),a=r.map(([,e])=>e),s=nj.get(e);if(s&&s.annotatedSchema===t&&s.configSlices.length===o.length&&s.configSlices.every((e,t)=>e===o[t])&&s.sources.every((e,t)=>e===a[t])){i[e]=s.result;continue}let l=t??{};r.forEach(([,e],t)=>{let n=o[t];void 0!==n&&(l=np(l,function e(t,n){return nU(t)?Object.keys(t).reduce((r,o)=>(r[o]=e(t[o],n),r),{}):{_value:t,_source:n}}(n,e)))}),nj.set(e,{annotatedSchema:t,configSlices:o,sources:a,result:l}),i[e]=l}return i}(e,t)},void(tm(n.config,r.config)||nd.setState(r))},nm(),nh.push(t1.subscribe(ng),t2.subscribe(ng),t4.subscribe(ng))}function ng(){nc();try{nm()}catch(e){nu(e),console.error("Failed to recompute the configuration",e)}}ny();let nb=new Map;function nv(e,t){nA(e,t);let n=np(t,nq);t1.setState(t=>({...t,schemas:{...t.schemas,[e]:n},moduleLoaded:{...t.moduleLoaded,[e]:!0}}))}function nw(e){t1.setState(t=>({...t,schemas:{...t.schemas,[e]:nq}}))}function n_(e){t1.setState(t=>({...t,moduleLoaded:{...t.moduleLoaded,[e]:!0}}))}function nx(e){t1.setState(t=>({...t,schemas:{...t.schemas,[e]:nG}}))}function nS(e,t){nA(e,t);let n=np(t,nq);t1.getState().schemas[e]&&console.error(`Config schema for extension ${e} already exists. If there are multiple extensions with this same name, one will probably crash.`),t1.setState(t=>({...t,schemas:{...t.schemas,[e]:n}}))}function nE(e,t="provided"){t1.setState(n=>({...n,providedConfigs:[...n.providedConfigs,{source:t,config:e}]}))}function nD(e,t,n){return new Promise(r=>{let o,i=!1;function a(e){!i&&t(e)&&(i=!0,r(n(e)),o?.())}a(e.getState()),i||(o=e.subscribe(a))})}function nO(e){return nD(t3(e),e=>!!(e.loaded&&e.config),e=>tz(e.config,["Display conditions","Translation overrides"]))}function nk(e,t,n){let r=[nD(t3(e),e=>!!(e.translationOverridesLoaded&&e.config),e=>e.config["Translation overrides"]??{})];return t&&n&&r.push(nD(t8(t,n),e=>!!(e.loaded&&e.config),e=>e.config["Translation overrides"]??{})),Promise.all(r)}function nP(e,t,n){nI(e,t,n);let r=nB(e,t);return n$(e,r,n),r}let nC=new Map,nj=new Map,nT=new Map;function nR(e,t){return[...e.providedConfigs.map(e=>e.config),t.config]}function nA(e,t,n=""){let r="Please verify that you are running the latest version and, if so, alert the maintainer.";for(let o of Object.keys(t).filter(e=>!e.startsWith("_"))){let i=n+(n&&".")+o,a=t[o];if("Display conditions"===i&&console.error(`${e} declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ${r}`),"Translation overrides"===i&&console.error(`${e} declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ${r}`),!nU(a)){console.error(`${e} has bad config schema definition for key '${i}'. ${r}`);continue}a.hasOwnProperty("_default")||nA(e,a,i);let s=a._elements;if(nV(s)&&nA(e,s,i+"._elements"),a._validators)for(let t of a._validators)"function"!=typeof t&&console.error(`${e} has invalid validator for key '${i}' ${r}.
3
+ ${e.stack}`,I(t)}}function L(e){let t;if(e instanceof Error)return e;if(null===e)return Error("'null' was thrown as an error");if("object"==typeof e){try{t=`Object thrown as error: ${JSON.stringify(e)}`}catch(n){t=`Object thrown as error with the following properties: ${Object.keys(e)}`}return Error(t)}if(void 0===e)return Error("'undefined' was thrown as an error");return Error(e.toString())}function F(e,t){if(e===t||Object.is(e,t))return!0;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}if(Array.isArray(t)||"object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(t);return n.length===r.length&&n.every(n=>e[n]===t[n])}function B(e,t){let n;try{n=e()}catch(e){return}return{getItem:e=>{var r;let o=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),i=null!=(r=n.getItem(e))?r:null;return i instanceof Promise?i.then(o):o(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,null==t?void 0:t.replacer)),removeItem:e=>n.removeItem(e)}}window.onerror=function(e){return console.error("Unexpected error: ",e),T({description:e??"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(e){console.error("Unhandled rejection: ",e.reason),T({description:e.reason??"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})};let V=e=>t=>{try{let n=e(t);if(n instanceof Promise)return n;return{then:e=>V(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>V(t)(e)}}},U=e=>{let t,n=new Set,r=(e,r)=>{let o="function"==typeof e?e(t):e;if(!Object.is(o,t)){let e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=t=e(r,o,i);return i},W=e=>e?U(e):U;function K(){try{return"u">typeof process&&("true"===process.env.VITEST||void 0!==process.env.JEST_WORKER_ID)||"u">typeof globalThis&&("__vitest_worker__"in globalThis||"__jest__"in globalThis)}catch{return!1}}let z={},H=Symbol.for("openmrs.esm-state.instanceCount"),G=globalThis,q=(G[H]??0)+1;function Z(e,t,n="none"){let r=z[e];if(r)return r.active?K()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):r.value.setState(t,!0),r.active=!0,r.value;{let r=X(e,t,n);return z[e]={value:r,active:!0},r}}function Y(e,t){let n=z[e];return n?(n.active?K()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):n.value=t,n.active=!0,n.value):(z[e]={value:t,active:!0},t)}function J(e,t,n="none"){let r=z[e];if(!r){let r=X(e,t??{},n);return z[e]={value:r,active:!1},r}return r.value}function Q(...e){let[t,n,r]=e,o=void 0===r?n:r,i=void 0===r?e=>e:n,a=i(t.getState());return o(a),t.subscribe(e=>{let t=i(e);F(a,t)||(a=t,o(t))})}function X(e,t,n){return"sessionStorage"===n?W()(((e,t)=>{if("getStorage"in t||"serialize"in t||"deserialize"in t)return console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),(n,r,o)=>{let i,a,s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},l=!1,u=new Set,c=new Set;try{i=s.getStorage()}catch(e){}if(!i)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...e)},r,o);let d=V(s.serialize),f=()=>{let e,t=d({state:s.partialize({...r()}),version:s.version}).then(e=>i.setItem(s.name,e)).catch(t=>{e=t});if(e)throw e;return t},p=o.setState;o.setState=(e,t)=>{p(e,t),f()};let h=e((...e)=>{n(...e),f()},r,o),m=()=>{var e;if(!i)return;l=!1,u.forEach(e=>e(r()));let t=(null==(e=s.onRehydrateStorage)?void 0:e.call(s,r()))||void 0;return V(i.getItem.bind(i))(s.name).then(e=>{if(e)return s.deserialize(e)}).then(e=>{if(e)if("number"!=typeof e.version||e.version===s.version)return e.state;else{if(s.migrate)return s.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return n(a=s.merge(e,null!=(t=r())?t:h),!0),f()}).then(()=>{null==t||t(a,void 0),l=!0,c.forEach(e=>e(a))}).catch(e=>{null==t||t(void 0,e)})};return o.persist={setOptions:e=>{s={...s,...e},e.getStorage&&(i=e.getStorage())},clearStorage:()=>{null==i||i.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>l,onHydrate:e=>(u.add(e),()=>{u.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},m(),a||h};return(n,r,o)=>{let i,a={storage:B(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1,l=new Set,u=new Set,c=a.storage;if(!c)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,o);let d=()=>{let e=a.partialize({...r()});return c.setItem(a.name,{state:e,version:a.version})},f=o.setState;o.setState=(e,t)=>{f(e,t),d()};let p=e((...e)=>{n(...e),d()},r,o);o.getInitialState=()=>p;let h=()=>{var e,t;if(!c)return;s=!1,l.forEach(e=>{var t;return e(null!=(t=r())?t:p)});let o=(null==(t=a.onRehydrateStorage)?void 0:t.call(a,null!=(e=r())?e:p))||void 0;return V(c.getItem.bind(c))(a.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===a.version)return[!1,e.state];else{if(a.migrate)return[!0,a.migrate(e.state,e.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;let[o,s]=e;if(n(i=a.merge(s,null!=(t=r())?t:p),!0),o)return d()}).then(()=>{null==o||o(i,void 0),i=r(),s=!0,u.forEach(e=>e(i))}).catch(e=>{null==o||o(void 0,e)})};return o.persist={setOptions:e=>{a={...a,...e},e.storage&&(c=e.storage)},clearStorage:()=>{null==c||c.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>s,onHydrate:e=>(l.add(e),()=>{l.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},a.skipHydration||h(),i||p}})(()=>t,{name:e,storage:B(()=>sessionStorage)})):W()(()=>t)}G[H]=q,q>1&&!K()&&console.error(`Detected ${q} copies of @openmrs/esm-framework running on this page. Each copy keeps its own store registry, so stores, configuration and extension state are not shared between them. This usually means a frontend module loaded its own bundled framework instead of the one the app shell provides.`),globalThis.setTimeout?.(()=>{"u">typeof window&&"development"===window.spaEnv&&(window.stores=z)},1e3);let ee=function(e){return void 0===e};var et,en,er,eo,ei,ea,es,el,eu,ec,ed,ef,ep,eh,em,ey,eg=n(85693),eb=n(77361),ev=n(34878),ew=n(47313),e_=Object.prototype,ex=Function.prototype.toString,eS=e_.hasOwnProperty,eE=ex.call(Object);let eD=function(e){if(!(0,ew.A)(e)||"[object Object]"!=(0,eb.A)(e))return!1;var t=(0,ev.A)(e);if(null===t)return!0;var n=eS.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ex.call(n)==eE};var eO=n(21050),eP=n(99271),ek=n(26979);let eC=function(e,t,n){(void 0===n||(0,ek.A)(e[t],n))&&(void 0!==n||t in e)||(0,eP.A)(e,t,n)},ej=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[++r];if(!1===t(o[s],s,o))break}return e};var eT=n(521),eR=n(65246),eA=n(80084),eM=n(12458),eN=n(86770),eI=n(96956),e$=n(31475),eL=n(11917),eF=n(50405),eB=n(97942),eV=n(60480);let eU=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var eW=n(28078),eK=n(25894);let ez=function(e,t,n,r,o,i,a){var s=eU(e,n),l=eU(t,n),u=a.get(l);if(u)return void eC(e,n,u);var c=i?i(s,l,n+"",e,t,a):void 0,d=void 0===c;if(d){var f=(0,eI.A)(l),p=!f&&(0,eL.A)(l),h=!f&&!p&&(0,eV.A)(l);(c=l,f||p||h)?(0,eI.A)(s)?c=s:(0,ew.A)(s)&&(0,e$.A)(s)?c=(0,eA.A)(s):p?(d=!1,c=(0,eT.A)(l,!0)):h?(d=!1,c=(0,eR.A)(l,!0)):c=[]:eD(l)||(0,eN.A)(l)?(c=s,(0,eN.A)(s))?c=(0,eW.A)(s,(0,eK.A)(s)):(!(0,eB.A)(s)||(0,eF.A)(s))&&(c=(0,eM.A)(l)):d=!1}d&&(a.set(l,c),o(c,l,r,i,a),a.delete(l)),eC(e,n,c)},eH=function e(t,n,r,o,i){t!==n&&ej(n,function(a,s){if(i||(i=new eO.A),(0,eB.A)(a))ez(t,n,s,r,e,o,i);else{var l=o?o(eU(t,s),a,s+"",t,n,i):void 0;void 0===l&&(l=a),eC(t,s,l)}},eK.A)},eG=function(e){return e},eq=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var eZ=Math.max;let eY=function(e,t,n){return t=eZ(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=eZ(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),eq(e,this,s)}};var eJ=n(61758),eQ=eJ.A?function(e,t){return(0,eJ.A)(e,"toString",{configurable:!0,enumerable:!1,value:function(){return t},writable:!0})}:eG,eX=Date.now,e0=(et=0,en=0,function(){var e=eX(),t=16-(e-en);if(en=e,t>0){if(++et>=800)return arguments[0]}else et=0;return eQ.apply(void 0,arguments)}),e1=n(85378);let e2=function(e,t,n){if(!(0,eB.A)(n))return!1;var r=typeof t;return("number"==r?!!((0,e$.A)(n)&&(0,e1.A)(t,n.length)):"string"==r&&t in n)&&(0,ek.A)(n[t],e)},e4=function(e){var t;return e0(eY(t=function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&e2(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++r<o;){var s=n[r];s&&e(t,s,r,i)}return t},void 0,eG),t+"")};var e3=e4(function(e,t,n,r){eH(e,t,n,r)}),e6=n(90257);function e5(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new e6.A;++t<n;)this.add(e[t])}e5.prototype.add=e5.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},e5.prototype.has=function(e){return this.__data__.has(e)};let e7=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},e9=function(e,t,n,r,o,i){var a=1&n,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,p=2&n?new e5:void 0;for(i.set(e,t),i.set(t,e);++d<s;){var h=e[d],m=t[d];if(r)var y=a?r(m,h,d,t,e,i):r(h,m,d,e,t,i);if(void 0!==y){if(y)continue;f=!1;break}if(p){if(!e7(t,function(e,t){if(!p.has(t)&&(h===e||o(h,e,n,r,i)))return p.push(t)})){f=!1;break}}else if(!(h===m||o(h,m,n,r,i))){f=!1;break}}return i.delete(e),i.delete(t),f};var e8=n(83516),te=n(97913);let tt=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n},tn=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n};var tr=e8.A?e8.A.prototype:void 0,to=tr?tr.valueOf:void 0;let ti=function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!i(new te.A(e),new te.A(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return(0,ek.A)(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=tt;case"[object Set]":var l=1&r;if(s||(s=tn),e.size!=t.size&&!l)break;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var c=e9(s(e),s(t),r,o,i,a);return a.delete(e),c;case"[object Symbol]":if(to)return to.call(e)==to.call(t)}return!1};var ta=n(2475),ts=Object.prototype.hasOwnProperty;let tl=function(e,t,n,r,o,i){var a=1&n,s=(0,ta.A)(e),l=s.length;if(l!=(0,ta.A)(t).length&&!a)return!1;for(var u=l;u--;){var c=s[u];if(!(a?c in t:ts.call(t,c)))return!1}var d=i.get(e),f=i.get(t);if(d&&f)return d==t&&f==e;var p=!0;i.set(e,t),i.set(t,e);for(var h=a;++u<l;){var m=e[c=s[u]],y=t[c];if(r)var g=a?r(y,m,c,t,e,i):r(m,y,c,e,t,i);if(!(void 0===g?m===y||o(m,y,n,r,i):g)){p=!1;break}h||(h="constructor"==c)}if(p&&!h){var b=e.constructor,v=t.constructor;b!=v&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v)&&(p=!1)}return i.delete(e),i.delete(t),p};var tu=n(92728),tc="[object Arguments]",td="[object Array]",tf="[object Object]",tp=Object.prototype.hasOwnProperty;let th=function(e,t,n,r,o,i){var a=(0,eI.A)(e),s=(0,eI.A)(t),l=a?td:(0,tu.A)(e),u=s?td:(0,tu.A)(t);l=l==tc?tf:l,u=u==tc?tf:u;var c=l==tf,d=u==tf,f=l==u;if(f&&(0,eL.A)(e)){if(!(0,eL.A)(t))return!1;a=!0,c=!1}if(f&&!c)return i||(i=new eO.A),a||(0,eV.A)(e)?e9(e,t,n,r,o,i):ti(e,t,l,n,r,o,i);if(!(1&n)){var p=c&&tp.call(e,"__wrapped__"),h=d&&tp.call(t,"__wrapped__");if(p||h){var m=p?e.value():e,y=h?t.value():t;return i||(i=new eO.A),o(m,y,n,r,i)}}return!!f&&(i||(i=new eO.A),tl(e,t,n,r,o,i))},tm=function(e,t){return function e(t,n,r,o,i){return t===n||(null!=t&&null!=n&&((0,ew.A)(t)||(0,ew.A)(n))?th(t,n,r,o,e,i):t!=t&&n!=n)}(e,t)},ty=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o};var tg=n(41736),tb=n(84089),tv=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tw=/^\w*$/;let t_=function(e,t){if((0,eI.A)(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||(0,tb.A)(e))||tw.test(e)||!tv.test(e)||null!=t&&e in Object(t)};function tx(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(tx.Cache||e6.A),n}tx.Cache=e6.A;var tS=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tE=/\\(\\)?/g,tD=(eo=(er=tx(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(tS,function(e,n,r,o){t.push(r?o.replace(tE,"$1"):n||e)}),t},function(e){return 500===eo.size&&eo.clear(),e})).cache,er),tO=1/0,tP=e8.A?e8.A.prototype:void 0,tk=tP?tP.toString:void 0;let tC=function e(t){if("string"==typeof t)return t;if((0,eI.A)(t))return ty(t,e)+"";if((0,tb.A)(t))return tk?tk.call(t):"";var n=t+"";return"0"==n&&1/t==-tO?"-0":n},tj=function(e){return null==e?"":tC(e)},tT=function(e,t){return(0,eI.A)(e)?e:t_(e,t)?[e]:tD(tj(e))},tR=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var tA=1/0;let tM=function(e){if("string"==typeof e||(0,tb.A)(e))return e;var t=e+"";return"0"==t&&1/e==-tA?"-0":t},tN=function(e,t){t=tT(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[tM(t[n++])];return n&&n==r?e:void 0},tI=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i};var t$=Object.prototype.hasOwnProperty;let tL=function(e,t){t=tT(t,e);var n,r=-1,o=t.length;if(!o)return!0;for(;++r<o;){var i=tM(t[r]);if("__proto__"===i&&!t$.call(e,"__proto__")||("constructor"===i||"prototype"===i)&&r<o-1)return!1}var a=(n=t).length<2?e:tN(e,tI(n,0,-1));return null==a||delete a[tM(tR(t))]},tF=function(e){return eD(e)?void 0:e};var tB=n(53271),tV=e8.A?e8.A.isConcatSpreadable:void 0;let tU=function(e){return(0,eI.A)(e)||(0,eN.A)(e)||!!(tV&&e&&e[tV])},tW=function e(t,n,r,o,i){var a=-1,s=t.length;for(r||(r=tU),i||(i=[]);++a<s;){var l=t[a];n>0&&r(l)?n>1?e(l,n-1,r,o,i):(0,tB.A)(i,l):o||(i[i.length]=l)}return i};var tK=n(7096),tz=e0(eY(ei=function(e,t){var n={};if(null==e)return n;var r=!1;t=ty(t,function(t){return t=tT(t,e),r||(r=t.length>1),t}),(0,eW.A)(e,(0,tK.A)(e),n),r&&(n=(0,tg.A)(n,7,tF));for(var o=t.length;o--;)tL(n,t[o]);return n},void 0,function(e){return(null==e?0:e.length)?tW(e,1):[]}),ei+""),tH=n(43322),tG=((ea={}).Array="Array",ea.Boolean="Boolean",ea.ConceptUuid="ConceptUuid",ea.Number="Number",ea.Object="Object",ea.String="String",ea.UUID="UUID",ea.PersonAttributeTypeUuid="PersonAttributeTypeUuid",ea.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid",ea);function tq(e,t){return n=>{if(!e(n))if("function"==typeof t)return t(n);else return t}}let tZ=tq(e=>Array.isArray(e),"must be an array"),tY=tq(e=>"boolean"==typeof e,"must be a boolean"),tJ=tq(e=>"number"==typeof e,"must be a number"),tQ=tq(e=>"string"==typeof e,"must be a string"),tX=tq(e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,"must be an object (not an array or null)"),t0=tq(e=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[0-9a-f]{36}$/i.test(e),"must be a valid UUID or a 36-character hexadecimal string"),t1=Z("config-internal",{providedConfigs:[],schemas:{},moduleLoaded:{}}),t2=Z("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});t2.subscribe(e=>{var t=e.config;try{localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}catch(e){}});let t4=Z("config-store-of-extension-state",{mountedExtensions:[]});function t3(e){return J(`config-module-${e}`,{config:null,loaded:!1,translationOverridesLoaded:!1})}function t6(){return J("config-extension-slots",{slots:{}})}function t5(e){return t7(t6().getState(),e)}function t7(e,t){return e.slots[t]??{loaded:!1,config:{}}}function t9(){return J("config-extensions",{configs:{}})}function t8(e,t){if("string"!=typeof e||"string"!=typeof t||"__proto__"===e||"__proto__"===t||"constructor"===e||"constructor"===t||"prototype"===e||"prototype"===t)throw Error("Attempted to call `getExtensionConfig()` with invalid argument");let n=t9(),r=n=>n.configs[e]?.[t];return{getInitialState:()=>r(n.getInitialState()),getState:()=>r(n.getState())??{loaded:!1,config:null},subscribe:e=>n.subscribe((t,n)=>{let o=r(t),i=r(n);F(o,i)||e(o,i)})}}function ne(e,t,n){return e.configs[t]?.[n]??{loaded:!1,config:null}}function nt(e,t,n){return e.configure?.[n]??null}let nn=W()(()=>({config:{}})),nr=0,no=!0,ni=!1;function na(e){r=e}function ns(){no=!0,nr>0&&nl()}function nl(){if(no&&r&&!ni){ni=!0,no=!1;try{r()}catch(e){no=!0,nu(e),console.error("Failed to derive the implementer tools config",e)}finally{ni=!1}}}function nu(e){nn.setState({derivationError:e instanceof Error?e.message:String(e)})}function nc(){nn.getState().derivationError&&nn.setState({derivationError:void 0})}let nd=Y("config-implementer-tools",{...nn,getState:()=>(0===nr&&nl(),nn.getState()),setState:(...e)=>(no=!1,nn.setState(...e)),subscribe(e){nr++,nl();let t=nn.subscribe(e),n=!1;return()=>{!n&&(n=!0,nr--),t()}}});function nf(e,t){if(Array.isArray(t))return t}function np(e,t){return e3({},e,t,nf)}let nh=[];function nm(){let e=t1.getState(),t=t2.getState(),n=t4.getState();!function(e,t){for(let n of Object.keys(e.schemas)){let r,o=t3(n),i=e.schemas[n],a=!!e.moduleLoaded[n],s=nb.get(n);if(s&&s.schema===i&&s.moduleLoaded===a&&s.providedConfigs===e.providedConfigs&&s.temporaryConfig===t.config)r=s.state;else{let o=a?function(e,t,n){let r=t.schemas[e],o=nM(e,nR(t,n));nI(r,o,e);let i=nB(r,o);return n$(r,i,e),delete i.extensionSlots,i}(n,e,t):function(e,t,n){let r=nB(nq,nM(e,nR(t,n)));return n$(nq,r,e),delete r.extensionSlots,r}(n,e,t);r={translationOverridesLoaded:!0,loaded:a,config:o},nb.set(n,{schema:i,moduleLoaded:a,providedConfigs:e.providedConfigs,temporaryConfig:t.config,state:r})}let l=o.getState();l.loaded===r.loaded&&l.translationOverridesLoaded===r.translationOverridesLoaded&&tm(l.config,r.config)||o.setState(r)}}(e,t);let r=function(e,t){let n=nN(nR(e,t)),r=Object.keys(n).reduce((e,t)=>(n[t]?.extensionSlots&&(e[t]=n[t]?.extensionSlots),e),{});var o=r;for(let[e,t]of Object.entries(o))for(let[n,r]of Object.entries(t))!function(e,t,n){let r=`${t}.extensionSlots.${n}`,o=`Extension slot config '${r}'`,i=Object.keys(e).filter(e=>!["add","remove","order","configure"].includes(e));i.length&&nK(r,o+`' contains invalid keys '${i.join("', '")}'`),!e.add||Array.isArray(e.add)&&e.add.every(e=>"string"==typeof e)||nK(r,o+".add' is invalid. Must be an array of strings (extension IDs)"),!e.remove||Array.isArray(e.remove)&&e.remove.every(e=>"string"==typeof e)||nK(r,o+".remove' is invalid. Must be an array of strings (extension IDs)"),!e.order||Array.isArray(e.order)&&e.order.every(e=>"string"==typeof e)||nK(r,o+".order' is invalid. Must be an array of strings (extension IDs)"),e.configure&&!nU(e.configure)&&nK(r,o+".configure' is invalid. Must be an object with extension IDs for keys")}(r,e,n);let i={},a={};for(let e of Object.values(r))for(let[t,n]of Object.entries(e))i[t]=n,n.configure&&(a[t]??(a[t]=[])).push(n.configure);for(let[e,t]of Object.entries(a)){let n=1===t.length?t[0]:nN(t);i[e].configure!==n&&(i[e]={...i[e],configure:n})}return i}(e,t);(function(e){let t=t6(),n=t.getState().slots,r={},o=!1;for(let[t,i]of Object.entries(e)){let e=n[t];e?.loaded&&tm(e.config,i)?r[t]=e:(r[t]={loaded:!0,config:i},o=!0)}(o||Object.keys(n).length!==Object.keys(r).length)&&t.setState({slots:r})})(r),function(e,t,n,r){let o=t9(),i=o.getState().configs,a={},s=!1,l=0;for(let o of t.mountedExtensions){let t=function(e,t,n,r,o,i,a){let s=function(e){let[t]=e.split("#");return t}(r),l=o.schemas[s],u=JSON.stringify([n,r,e,t]),c=nC.get(u);if(c&&c.extensionSchema===l&&c.extensionModuleSchema===o.schemas[t]&&c.providedConfigs===o.providedConfigs&&c.temporaryConfig===i.config)return c.config;let d=l?s:t,f=nR(o,i),p=a?.configure?.[r]??{},h=nM(e,f),m=h?.extensionSlots?.[n]?.configure?.[r]??{},y=nN([nM(d,f),p,m]),g=l??o.schemas[t];nI(g,y,d);let b=nB(g,y);return n$(g,b,d),delete b.extensionSlots,nC.set(u,{extensionSchema:l,extensionModuleSchema:o.schemas[t],providedConfigs:o.providedConfigs,temporaryConfig:i.config,config:b}),b}(o.slotModuleName,o.extensionModuleName,o.slotName,o.extensionId,e,n,r[o.slotName]),u=i[o.slotName]?.[o.extensionId],c=u?.loaded&&tm(u.config,t)?u:{config:t,loaded:!0};c!==u&&(s=!0),a[o.slotName]||(a[o.slotName]={}),a[o.slotName][o.extensionId]=c,l++}for(let[e,t]of Object.entries(a)){let n=i[e];n&&Object.keys(n).length===Object.keys(t).length&&Object.entries(t).every(([e,t])=>n[e]===t)&&(a[e]=n)}s||(s=Object.keys(i).length!==Object.keys(a).length||Object.values(i).reduce((e,t)=>e+Object.keys(t).length,0)!==l),s&&o.setState({configs:a})}(e,n,t,r),ns()}function ny(){r=()=>{var e,t;let n,r;return e=t1.getState(),t=t2.getState(),n=nd.getState(),r={config:function(e,t){let n=function(e){let t={};for(let[n,r]of Object.entries(e)){let e=nT.get(n);if(e&&e.schema===r)t[n]=e.annotated;else{let e=function e(t){return t.hasOwnProperty("_default")?{...t,_value:t._default,_source:"default"}:nU(t)?Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{}):{}}((0,tH.A)(r));nT.set(n,{schema:r,annotated:e}),t[n]=e}}return t}(e.schemas),r=[...e.providedConfigs.map(e=>[e.config,e.source]),[t.config,"temporary config"]],o=new Set(Object.keys(n));for(let[e]of r)for(let t of Object.keys(e))o.add(t);let i={};for(let e of o){let t=n[e],o=r.map(([t])=>t[e]),a=r.map(([,e])=>e),s=nj.get(e);if(s&&s.annotatedSchema===t&&s.configSlices.length===o.length&&s.configSlices.every((e,t)=>e===o[t])&&s.sources.every((e,t)=>e===a[t])){i[e]=s.result;continue}let l=t??{};r.forEach(([,e],t)=>{let n=o[t];void 0!==n&&(l=np(l,function e(t,n){return nU(t)?Object.keys(t).reduce((r,o)=>(r[o]=e(t[o],n),r),{}):{_value:t,_source:n}}(n,e)))}),nj.set(e,{annotatedSchema:t,configSlices:o,sources:a,result:l}),i[e]=l}return i}(e,t)},void(tm(n.config,r.config)||nd.setState(r))},nm(),nh.push(t1.subscribe(ng),t2.subscribe(ng),t4.subscribe(ng))}function ng(){nc();try{nm()}catch(e){nu(e),console.error("Failed to recompute the configuration",e)}}ny();let nb=new Map;function nv(e,t){nA(e,t);let n=np(t,nq);t1.setState(t=>({...t,schemas:{...t.schemas,[e]:n},moduleLoaded:{...t.moduleLoaded,[e]:!0}}))}function nw(e){t1.setState(t=>({...t,schemas:{...t.schemas,[e]:nq}}))}function n_(e){t1.setState(t=>({...t,moduleLoaded:{...t.moduleLoaded,[e]:!0}}))}function nx(e){t1.setState(t=>({...t,schemas:{...t.schemas,[e]:nG}}))}function nS(e,t){nA(e,t);let n=np(t,nq);t1.getState().schemas[e]&&console.error(`Config schema for extension ${e} already exists. If there are multiple extensions with this same name, one will probably crash.`),t1.setState(t=>({...t,schemas:{...t.schemas,[e]:n}}))}function nE(e,t="provided"){t1.setState(n=>({...n,providedConfigs:[...n.providedConfigs,{source:t,config:e}]}))}function nD(e,t,n){return new Promise(r=>{let o,i=!1;function a(e){!i&&t(e)&&(i=!0,r(n(e)),o?.())}a(e.getState()),i||(o=e.subscribe(a))})}function nO(e){return nD(t3(e),e=>!!(e.loaded&&e.config),e=>tz(e.config,["Display conditions","Translation overrides"]))}function nP(e,t,n){let r=[nD(t3(e),e=>!!(e.translationOverridesLoaded&&e.config),e=>e.config["Translation overrides"]??{})];return t&&n&&r.push(nD(t8(t,n),e=>!!(e.loaded&&e.config),e=>e.config["Translation overrides"]??{})),Promise.all(r)}function nk(e,t,n){nI(e,t,n);let r=nB(e,t);return n$(e,r,n),r}let nC=new Map,nj=new Map,nT=new Map;function nR(e,t){return[...e.providedConfigs.map(e=>e.config),t.config]}function nA(e,t,n=""){let r="Please verify that you are running the latest version and, if so, alert the maintainer.";for(let o of Object.keys(t).filter(e=>!e.startsWith("_"))){let i=n+(n&&".")+o,a=t[o];if("Display conditions"===i&&console.error(`${e} declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ${r}`),"Translation overrides"===i&&console.error(`${e} declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ${r}`),!nU(a)){console.error(`${e} has bad config schema definition for key '${i}'. ${r}`);continue}a.hasOwnProperty("_default")||nA(e,a,i);let s=a._elements;if(nV(s)&&nA(e,s,i+"._elements"),a._validators)for(let t of a._validators)"function"!=typeof t&&console.error(`${e} has invalid validator for key '${i}' ${r}.
4
4
 
5
5
  If you're the maintainer: validators must be functions that return either undefined or an error string. Received ${t}.`);let l=a._type;l&&!Object.values(tG).includes(l)&&console.error(`${e} has invalid type for key '${i}' ${r}.
6
6
 
@@ -8,12 +8,12 @@ If you're the maintainer: the allowed types are ${Object.values(tG).join(", ")}.
8
8
 
9
9
  If you're the maintainer: all config elements must have a default. Received ${JSON.stringify(a)}`),s&&l&&![tG.Array,tG.Object].includes(l)&&console.error(`${e} has bad config schema definition for key '${i}'. ${r}.
10
10
 
11
- If you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. Received ${JSON.stringify(l)}`)}}function nN(e,t){return nM(t.map(({[e]:t})=>t).filter(e=>!!e))}function nM(e){return e.reduce((e,t)=>e3(e,t,nf),{})}function nI(e,t,n=""){for(let r of Object.keys(t)){let o=t[r],i=n+"."+r,a=e[r];if(!e.hasOwnProperty(r)){("extensionSlots"!==r||""===n)&&nK(i,`Unknown config key '${i}' provided. Ignoring.`);continue}(function e(t,n,r){nL(r,t._type,n),nU(n)?t._type===tG.Object?function(t,n,r){if(t._elements)for(let o of Object.keys(n)){let i=n[o];e(t._elements,i,`${r}.${o}`)}}(t,n,r):t.hasOwnProperty("_default")||t.hasOwnProperty("_type")||nI(t,n,r):t._type===tG.Array&&function(t,n,r){if(nL(r,tG.Array,n)){if(nV(t._elements))for(let o=0;o<n.length;o++)e(t._elements,n[o],`${r}[${o}]`);for(let e=0;e<n.length;e++)nL(`${r}[${e}]`,t._elements?._type,n[e])}}(t,n,r)})(a,o,i)}}function n$(e,t,n=""){if(e){if(t!==e._default&&nF(n,e._validators,t),nU(t))for(let r of Object.keys(t)){let o=t[r],i=n+"."+r,a=e[r];e._type===tG.Object&&e._elements?n$(e._elements,o,i):n$(a,o,i)}else if(Array.isArray(t)&&e._elements)for(let r=0;r<t.length;r++)n$(e._elements,t[r],`${n}[${r}]`)}}function nL(e,t,n){return!t||nF(e,[{Array:tZ,Boolean:tY,ConceptUuid:t0,Number:tJ,Object:tX,String:tQ,UUID:t0,PersonAttributeTypeUuid:t0,PatientIdentifierTypeUuid:t0}[t]],n)}function nF(e,t,n){let r=!0;if(t)try{for(let o of t){let t=o(n);if("string"==typeof t){let o="object"==typeof n?`Invalid configuration for ${e}: ${t}`:`Invalid configuration value ${n} for ${e}: ${t}`;nK(e,o),r=!1}}}catch(t){console.error(`Skipping invalid validator at "${e}". Encountered error
12
- ${t}`)}return r}let nB=(e,t)=>{let n=structuredClone(t);if(!e)return n;for(let t of Object.keys(e)){let r=n[t],o=e[t];if(o&&(o.hasOwnProperty("_type")||o.hasOwnProperty("_default"))){n.hasOwnProperty(t)||(n[t]=o._default);let e=o._elements;if(r&&nV(e)){if(o._type===tG.Array&&Array.isArray(r)){let o=r.map(t=>nB(e,t));n[t]=o}else if(o._type===tG.Object)for(let t of Object.keys(r))r[t]=nB(e,r[t])}}else if(nU(o)){let e=r??{};nU(e)&&(n[t]=nB(o,e))}}return n};function nV(e){return!!e&&Object.keys(e).filter(e=>!["_default","_validators"].includes(e)).length>0}function nU(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}let nW=new Set;function nK(e,t){let n=`${e}:::${t}`;nW||(nW=new Set),nW.has(n)||(console.error(t),nW.add(n))}function nz(e){e?nW.forEach(t=>{t.startsWith(e)&&nW.delete(t)}):nW.clear()}function nH(){nh.forEach(e=>e()),nh.length=0,nb.clear(),nC.clear(),nT.clear(),nj.clear(),ny()}let nG={"Translation overrides":{_description:"Per-language overrides for frontend translations should be keyed by language code and each language dictionary contains the translation key and the display value",_type:tG.Object,_default:{},_validators:[tq(e=>Object.keys(e).every(e=>/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e)),e=>{let t=Object.keys(e).filter(e=>!/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e));return`The 'Translation overrides' object should have language codes for keys. Language codes must be in the form of a two-to-three letter language code optionally followed by a hyphen and a two-to-three letter country code. The following keys do not conform: ${t.join(", ")}.`})]}},nq={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:tG.Array,_default:[]},expression:{_description:"The expression that determines whether the extension is displayed",_type:tG.String,_default:void 0}},...nG},nZ=(e,t)=>tq(n=>e<=n&&n<=t,`must be between ${e} and ${t}`),nY=e=>{let t=e.concat(["openmrsBase","openmrsSpaBase"]);return tq(e=>{if(!e||"string"!=typeof e)return!1;let n=/\${(.*?)}/g,r=n.exec(e);for(;r;){if(!t.includes(r[1]))return!1;r=n.exec(e)}return!0},"Should be a URL or path. The allowed template parameters are "+t.map(e=>"${"+e+"}").join(", "))},nJ=nY([]),nQ=e=>tq(t=>e.includes(t),`Must be one of the following: '${e.join("', '")}'.`),nX={inRange:nZ,isUrl:nJ,isUrlWithTemplateParameters:nY,oneOf:nQ};var n0=n(82034);let n1=Z("breadcrumbs",[]);function n2(e){return n4([e])}function n4(e){let t=[...n3(),...e.map(e=>({matcher:e.matcher instanceof RegExp?e.matcher:"string"==typeof e.matcher?(0,n0.pathToRegexp)(e.matcher).regexp:(0,n0.pathToRegexp)(e.path).regexp,settings:e}))];n1.setState(t,!0)}function n3(){return n1.getState()}function n6(e,t){if(t)return function(e,t){let[n]=e.filter(e=>e.matcher.test(t));return n}(e,t)||function(e,t){let n=t.split("/");for(;n.length>1;){n.pop();let t=n6(e,n.join("/"));if(t)return t}}(e,t)}function n5(e,t){if(e.length>0){let n=n6(e,t);if(n){let t=[n],r=n6(e,n.settings.parent);for(;void 0!==r;)t.push(r),r=n6(e,r.settings.parent);return t.reverse()}}return[]}function n7(e){return n5(n3(),e)}var n9=Object.freeze({__proto__:null,get start(){return ox},get ensureJQuerySupport(){return r7},get setBootstrapMaxTime(){return rU},get setMountMaxTime(){return rW},get setUnmountMaxTime(){return rK},get setUnloadMaxTime(){return rz},get registerApplication(){return ol},get unregisterApplication(){return oc},get getMountedApps(){return oo},get getAppStatus(){return oa},get unloadApplication(){return od},get checkActivityFunctions(){return ou},get getAppNames(){return oi},get pathToActiveWhen(){return oh},get navigateToUrl(){return rQ},get patchHistoryApi(){return r3},get triggerAppChange(){return ob},get addErrorHandler(){return rr},get removeErrorHandler(){return ro},get mountRootParcel(){return r$},get NOT_LOADED(){return rs},get LOADING_SOURCE_CODE(){return rl},get NOT_BOOTSTRAPPED(){return ru},get BOOTSTRAPPING(){return rc},get NOT_MOUNTED(){return rd},get MOUNTING(){return rf},get UPDATING(){return rh},get LOAD_ERROR(){return rg},get MOUNTED(){return rp},get UNLOADING(){return ry},get UNMOUNTING(){return rm},get SKIP_BECAUSE_BROKEN(){return rb}}),n8=("u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{}).CustomEvent,re=!function(){try{var e=new n8("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?"u">typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=!!t.bubbles,n.cancelable=!!t.cancelable,n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n}:n8;let rt=[];function rn(e,t,n){let r=ra(e,t,n);rt.length?rt.forEach(e=>e(r)):setTimeout(()=>{throw r})}function rr(e){if("function"!=typeof e)throw Error(ri(28,!1));rt.push(e)}function ro(e){if("function"!=typeof e)throw Error(ri(29,!1));let t=!1;return rt=rt.filter(n=>{let r=n===e;return t=t||r,!r}),t}function ri(e,t,...n){return`single-spa minified message #${e}: ${t?t+" ":""}See https://single-spa.js.org/error/?code=${e}${n.length?`&arg=${n.join("&arg=")}`:""}`}function ra(e,t,n){let r,o=`${rS(t)} '${r_(t)}' died in status ${t.status}: `;if(e instanceof Error){try{e.message=o+e.message}catch(e){}r=e}else{console.warn(ri(30,!1,t.status,r_(t)));try{r=Error(o+JSON.stringify(e))}catch(t){r=e}}return r.appOrParcelName=r_(t),t.status=n,r}let rs="NOT_LOADED",rl="LOADING_SOURCE_CODE",ru="NOT_BOOTSTRAPPED",rc="BOOTSTRAPPING",rd="NOT_MOUNTED",rf="MOUNTING",rp="MOUNTED",rh="UPDATING",rm="UNMOUNTING",ry="UNLOADING",rg="LOAD_ERROR",rb="SKIP_BECAUSE_BROKEN";function rv(e){return e.status===rp}function rw(e){try{return e.activeWhen(window.location)}catch(t){return rn(t,e,rb),!1}}function r_(e){return e.name}function rx(e){return!!e.unmountThisParcel}function rS(e){return rx(e)?"parcel":"application"}function rE(){for(let e=arguments.length-1;e>0;e--)for(let t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]}function rD(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}function rO(e){return e&&("function"==typeof e||Array.isArray(e)&&!rD(e,e=>"function"!=typeof e))}function rk(e,t){let n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[()=>Promise.resolve()]);let r=rS(e),o=r_(e);return function(e){return n.reduce((n,i,a)=>n.then(()=>{let n=i(e);return rP(n)?n:Promise.reject(ri(15,!1,r,o,t,a))}),Promise.resolve())}}function rP(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}let rC=[];function rj(e,t){return Promise.resolve().then(()=>e.status!==ru?e:(e.status=rc,e.bootstrap?rH(e,"bootstrap").then(n).catch(n=>{if(t)throw ra(n,e,rb);return rn(n,e,rb),e}):Promise.resolve().then(n)));function n(){return e.status=rd,e}}function rT(e,t){return Promise.resolve().then(()=>{if(e.status!==rp)return e;return e.status=rm,Promise.all(Object.keys(e.parcels).map(t=>e.parcels[t].unmountThisParcel())).then(n,r=>n().then(()=>{let n=Error(r.message);if(t)throw ra(n,e,rb);rn(n,e,rb)})).then(()=>e);function n(){return rH(e,"unmount").then(()=>{e.status=rd},n=>{if(t)throw ra(n,e,rb);rn(n,e,rb)})}})}let rR=!1,rA=!1;function rN(e,t){return Promise.resolve().then(()=>e.status!==rd?e:(rR||(window.dispatchEvent(new re("single-spa:before-first-mount")),rR=!0),e.status=rf,rH(e,"mount").then(()=>(e.status=rp,rA||(window.dispatchEvent(new re("single-spa:first-mount")),rA=!0),e)).catch(n=>{return e.status=rp,rT(e,!0).then(r,r);function r(){if(t)throw ra(n,e,rb);return rn(n,e,rb),e}})))}let rM=0,rI={parcels:{}};function r$(){return rL.apply(rI,arguments)}function rL(e,t){let n,r,o,i=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(ri(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(ri(3,!1,typeof e.name));let a=rM++,s=e.name||`parcel-${a}`;if("object"!=typeof t)throw Error(ri(4,!1,s,typeof t));if(!t.domElement)throw Error(ri(5,!1,s));let l="function"==typeof e,u=l?e:()=>Promise.resolve(e),c={id:a,parcels:{},status:l?rl:ru,customProps:t,parentName:r_(i),unmountThisParcel:()=>p.then(()=>{if(c.status!==rp)throw Error(ri(6,!1,s,c.status));return rT(c,!0)}).then(e=>(c.parentName&&delete i.parcels[c.id],e)).then(e=>(r(e),e)).catch(e=>{throw c.status=rb,o(e),e})};i.parcels[a]=c;let d=u();if(!d||"function"!=typeof d.then)throw Error(ri(7,!1));let f=(d=d.then(e=>{if(!e)throw Error(ri(8,!1));if(s=e.name||`parcel-${a}`,Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!rO(e.bootstrap))throw Error(ri(9,!1,s));if(!rO(e.mount))throw Error(ri(10,!1,s));if(!rO(e.unmount))throw Error(ri(11,!1,s));if(e.update&&!rO(e.update))throw Error(ri(12,!1,s));let t=rk(e,"bootstrap"),r=rk(e,"mount"),o=rk(e,"unmount");c.status=ru,c.name=s,c.bootstrap=t,c.mount=r,c.unmount=o,c.timeouts=rG(e.timeouts),e.update&&(c.update=rk(e,"update"),n.update=function(e){return c.customProps=e,rF(Promise.resolve().then(()=>{if(c.status!==rp)throw Error(ri(32,!1,r_(c)));return c.status=rh,rH(c,"update").then(()=>(c.status=rp,c)).catch(e=>{throw ra(e,c,rb)})}))})})).then(()=>rj(c,!0)),p=f.then(()=>rN(c,!0)),h=new Promise((e,t)=>{r=e,o=t});return n={mount:()=>rF(Promise.resolve().then(()=>{if(c.status!==rd)throw Error(ri(13,!1,s,c.status));return i.parcels[a]=c,rN(c)})),unmount:()=>rF(c.unmountThisParcel()),getStatus:()=>c.status,loadPromise:rF(d),bootstrapPromise:rF(f),mountPromise:rF(p),unmountPromise:rF(h)}}function rF(e){return e.then(()=>null)}function rB(e){let t=r_(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof n||null===n||Array.isArray(n))&&(n={},console.warn(ri(40,!1),t,n));let r=rE({},n,{name:t,mountParcel:rL.bind(e),singleSpa:n9});return rx(e)&&(r.unmountSelf=e.unmountThisParcel),r}let rV={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function rU(e,t,n){if("number"!=typeof e||e<=0)throw Error(ri(16,!1));rV.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rW(e,t,n){if("number"!=typeof e||e<=0)throw Error(ri(17,!1));rV.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rK(e,t,n){if("number"!=typeof e||e<=0)throw Error(ri(18,!1));rV.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rz(e,t,n){if("number"!=typeof e||e<=0)throw Error(ri(19,!1));rV.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rH(e,t){let n=e.timeouts[t],r=n.warningMillis,o=rS(e);return new Promise((i,a)=>{let s=!1,l=!1;e[t](rB(e)).then(e=>{s=!0,i(e)}).catch(e=>{s=!0,a(e)}),setTimeout(()=>c(1),r),setTimeout(()=>c(!0),n.millis);let u=ri(31,!1,t,o,r_(e),n.millis);function c(e){s||(!0===e?(l=!0,n.dieOnTimeout?a(Error(u)):console.error(u)):!l&&(console.warn(u),e*r+r<n.millis&&setTimeout(()=>c(e+1),r)))}})}function rG(e){let t={};for(let n in rV)t[n]=rE({},rV[n],e&&e[n]||{});return t}function rq(e){return Promise.resolve().then(()=>{let t,n;return e.loadPromise?e.loadPromise:e.status!==rs&&e.status!==rg?e:(e.status=rl,e.loadPromise=Promise.resolve().then(()=>{let r=e.loadApp(rB(e));if(!rP(r))throw n=!0,Error(ri(33,!1,r_(e)));return r.then(n=>{let r;e.loadErrorTime=null,"object"!=typeof(t=n)&&(r=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!rO(t.bootstrap)&&(r=35),rO(t.mount)||(r=36),rO(t.unmount)||(r=37);let o=rS(t);if(r){let n;try{n=JSON.stringify(t)}catch(e){}return console.error(ri(r,!1,o,r_(e),n),t),rn(void 0,e,rb),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=rE({},e.devtools.overlays,t.devtools.overlays)),e.status=ru,e.bootstrap=rk(t,"bootstrap"),e.mount=rk(t,"mount"),e.unmount=rk(t,"unmount"),e.unload=rk(t,"unload"),e.timeouts=rG(t.timeouts),delete e.loadPromise,e})}).catch(t=>{let r;return delete e.loadPromise,n?r=rb:(r=rg,e.loadErrorTime=(new Date).getTime()),rn(t,e,r),e}))})}let rZ="u">typeof window,rY={hashchange:[],popstate:[]},rJ=["hashchange","popstate"];function rQ(e){let t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(ri(14,!1));t=e.currentTarget.href,e.preventDefault()}let n=r6(window.location.href),r=r6(t);0===t.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)}function rX(e){if(e){let t=e[0].type;rJ.indexOf(t)>=0&&rY[t].forEach(t=>{try{t.apply(this,e)}catch(e){setTimeout(()=>{throw e})}})}}function r0(){ov([],arguments)}function r1(e,t){return function(){let n=window.location.href,r=e.apply(this,arguments),i=window.location.href;return o&&n===i||window.dispatchEvent(function(e,t){let n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)),r}}let r2=null,r4=!1;function r3(e){if(r4)throw Error(ri(43,!1));o=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,r4=!0,r2=window.history.replaceState,window.addEventListener("hashchange",r0),window.addEventListener("popstate",r0);let t=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(e,n){if(!("function"==typeof n&&rJ.indexOf(e)>=0)||rD(rY[e],e=>e===n))return t.apply(this,arguments);rY[e].push(n)},window.removeEventListener=function(e,t){return"function"==typeof t&&rJ.indexOf(e)>=0&&(rY[e]=rY[e].filter(e=>e!==t)),n.apply(this,arguments)},window.history.pushState=r1(window.history.pushState,"pushState"),window.history.replaceState=r1(r2,"replaceState")}function r6(e){let t=document.createElement("a");return t.href=e,t}rZ&&(window.singleSpaNavigate?console.warn(ri(41,!1)):window.singleSpaNavigate=rQ);let r5=!1;function r7(e=window.jQuery){if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!r5){let t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return r9.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return r9.call(this,n,window.removeEventListener,e,t,arguments)},r5=!0}}function r9(e,t,n,r,o){return"string"!=typeof n?e.apply(this,o):(n.split(/\s+/).forEach(e=>{rJ.indexOf(e)>=0&&(t(e,r),n=n.replace(e,""))}),""===n.trim()?this:e.apply(this,o))}let r8={};function oe(e){return Promise.resolve().then(()=>{let t=r8[r_(e)];if(!t)return e;if(e.status===rs)return ot(e,t),e;if(e.status===ry)return t.promise.then(()=>e);if(e.status!==rd&&e.status!==rg)return e;let n=e.status===rg?Promise.resolve():rH(e,"unload");return e.status=ry,n.then(()=>(ot(e,t),e)).catch(n=>(delete r8[r_(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,rn(n,e,rb),t.reject(n),e))})}function ot(e,t){delete r8[r_(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=rs,t.resolve()}function on(e,t,n,r){r8[r_(e)]={app:e,resolve:n,reject:r},Object.defineProperty(r8[r_(e)],"promise",{get:t})}let or=[];function oo(){return or.filter(rv).map(r_)}function oi(){return or.map(r_)}function oa(e){let t=rD(or,t=>r_(t)===e);return t?t.status:null}let os=!1;function ol(e,t,n,r){var o,i;let a,s,l=(a={name:null,loadApp:null,activeWhen:null,customProps:null},"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(ri(39,!1));let t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((e,n)=>t.indexOf(n)>=0?e:e.concat(n),[]);if(0!==n.length)throw Error(ri(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length||"object"!=typeof e.app&&"function"!=typeof e.app)throw Error(ri(20,!1));let r=e=>"string"==typeof e||"function"==typeof e;if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error(ri(24,!1));if(!op(e.customProps))throw Error(ri(22,!1))}(e),a.name=e.name,a.loadApp=e.app,a.activeWhen=e.activeWhen,a.customProps=e.customProps):(function(e,t,n,r){if("string"!=typeof e||0===e.length)throw Error(ri(20,!1));if(!t)throw Error(ri(23,!1));if("function"!=typeof n)throw Error(ri(24,!1));if(!op(r))throw Error(ri(22,!1))}(e,t,n,r),a.name=e,a.loadApp=t,a.activeWhen=n,a.customProps=r),a.loadApp="function"!=typeof(o=a.loadApp)?()=>Promise.resolve(o):o,a.customProps=a.customProps||{},s=(s=Array.isArray(i=a.activeWhen)?i:[i]).map(e=>"function"==typeof e?e:oh(e)),a.activeWhen=e=>s.some(t=>t(e)),a);if(o_||os||(os=!0,setTimeout(()=>{o_||console.warn(ri(1,!1))},5e3)),-1!==oi().indexOf(l.name))throw Error(ri(21,!1,l.name));or.push(rE({loadErrorTime:null,status:rs,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},l)),rZ&&(r7(),ov())}function ou(e=window.location){return or.filter(t=>t.activeWhen(e)).map(r_)}function oc(e){if(0===or.filter(t=>r_(t)===e).length)throw Error(ri(25,!1,e));return(rZ?od(e,{waitForUnmount:!1}):Promise.resolve()).then(()=>{let t=or.map(r_).indexOf(e);or.splice(t,1)})}function od(e,t={waitForUnmount:!1}){if("string"!=typeof e)throw Error(ri(26,!1));let n=rD(or,t=>r_(t)===e);if(!n)throw Error(ri(27,!1,e));let r=r8[r_(n)];if(t&&t.waitForUnmount){if(r)return r.promise;{let e=new Promise((t,r)=>{on(n,()=>e,t,r)});return e}}{let e;return r?(e=r.promise,of(n,r.resolve,r.reject)):e=new Promise((t,r)=>{on(n,()=>e,t,r),of(n,t,r)}),e}}function of(e,t,n){Promise.resolve().then(()=>{if(rD(ou(),t=>t===r_(e)))return ob()}).then(()=>rT(e).then(oe).then(()=>{t(),setTimeout(()=>{ov()})})).catch(n)}function op(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)}function oh(e,t){let n=function(e,t){let n=0,r=!1,o="^";"/"!==e[0]&&(e="/"+e);for(let t=0;t<e.length;t++){let n=e[t],o=r&&"/"===n;(!r&&":"===n||o)&&i(t)}return i(e.length),RegExp(o,"i");function i(i){let a=e.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===e.length)if(r)t&&(o+="$");else{let e=t?"":".*";o="/"===o.charAt(o.length-1)?`${o}${e}$`:`${o}(/${e})?(#.*)?$`}r=!r,n=i}}(e,t);return e=>{let t=e.origin;t||(t=`${e.protocol}//${e.host}`);let r=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(r)}}let om=!1,oy=[],og=rZ&&window.location.href;function ob(){return ov()}function ov(e=[],t,n=!1){let r,o,i,a,s;if(om)return new Promise((e,n)=>{oy.push({resolve:e,reject:n,eventArguments:t})});let{appsToUnload:l,appsToUnmount:u,appsToLoad:c,appsToMount:d}=(r=[],o=[],i=[],a=[],s=(new Date).getTime(),or.forEach(e=>{let t=e.status!==rb&&rw(e);switch(e.status){case rg:t&&s-e.loadErrorTime>=200&&i.push(e);break;case rs:case rl:t&&i.push(e);break;case ru:case rd:!t&&r8[r_(e)]?r.push(e):t&&a.push(e);break;case rp:t||o.push(e)}}),{appsToUnload:r,appsToUnmount:o,appsToLoad:i,appsToMount:a}),f,p=[],h=og,m=og=window.location.href;return o_?(om=!0,f=l.concat(c,u,d),Promise.resolve().then(()=>(w(0===f.length?"before-no-app-change":"before-app-change",v(!0)),w("before-routing-event",v(!0,{cancelNavigation:y})),Promise.all(p).then(n=>{if(n.some(e=>e))return r2.call(window.history,history.state,"",h.substring(location.origin.length)),og=location.href,om=!1,ov(e,t,!0);let r=l.map(oe),o=Promise.all(u.map(rT).map(e=>e.then(oe)).concat(r));o.then(()=>{w("before-mount-routing-event",v(!0))},e=>{throw e});let i=c.map(e=>rq(e).then(e=>ow(e,o))),a=d.filter(e=>0>c.indexOf(e)).map(e=>ow(e,o));return o.catch(e=>{throw b(),e}).then(()=>(b(),Promise.all(i.concat(a)).catch(t=>{throw e.forEach(e=>e.reject(t)),t}).then(g).then(()=>{},e=>{throw e})))})))):(f=c,Promise.resolve().then(()=>Promise.all(c.map(rq)).then(b).then(()=>[]).catch(e=>{throw b(),e}).finally(()=>{})));function y(e=!0){let t="function"==typeof(null==e?void 0:e.then)?e:Promise.resolve(e);p.push(t.catch(e=>(console.warn(Error(ri(42,!1))),console.warn(e),!1)))}function g(){let t=oo();e.forEach(e=>e.resolve(t));try{w(0===f.length?"no-app-change":"app-change",v()),w("routing-event",v())}catch(e){setTimeout(()=>{throw e})}if(om=!1,oy.length>0){let e=oy;oy=[],ov(e)}return t}function b(){n||(e.forEach(e=>{rX(e.eventArguments)}),rX(t))}function v(e=!1,n){let r={},o={[rp]:[],[rd]:[],[rs]:[],[rb]:[]};e?(c.concat(d).forEach((e,t)=>{a(e,rp)}),l.forEach(e=>{a(e,rs)}),u.forEach(e=>{a(e,rd)})):f.forEach(e=>{a(e)});let i={detail:{newAppStatuses:r,appsByNewStatus:o,totalAppChanges:f.length,originalEvent:null==t?void 0:t[0],oldUrl:h,newUrl:m}};return n&&rE(i.detail,n),i;function a(e,t){let n=r_(e);t=t||oa(n),r[n]=t,(o[t]=o[t]||[]).push(n)}}function w(e,t){n||window.dispatchEvent(new re(`single-spa:${e}`,t))}}function ow(e,t){return rw(e)?rj(e).then(e=>t.then(()=>rw(e)?rN(e):e)):t.then(()=>e)}let o_=!1;function ox(e){o_=!0,rZ&&(r3(e),ov())}function oS(e,t){let n=window.getOpenmrsSpaBase().replace(/\/$/,"");return oE(e,{openmrsBase:window.openmrsBase,openmrsSpaBase:n,...t}).replace(/^\/\//,"/")}function oE(e,t){return Object.keys(t).reduce((e,n)=>e.split("${"+n+"}").join(t[n]),e)}function oD({to:e,templateParams:t}){let n=window.getOpenmrsSpaBase().replace(/\/$/,""),r=oS(e,t).replace(window.location.origin,"");r.startsWith(n)?rQ(r):window.location.assign(r)}rZ&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods={getRawAppData:function(){return[...or]},reroute:ov,NOT_LOADED:rs,toLoadPromise:rq,toBootstrapPromise:rj,unregisterApplication:oc,getProfilerData:function(){return rC}});let oO="openmrs:history";function ok(e){let t=JSON.parse(sessionStorage.getItem(oO)??"[]")||[];t.push(e),t.length>50&&(t=t.slice(-50)),sessionStorage.setItem(oO,JSON.stringify(t))}function oP(){0===JSON.parse(sessionStorage.getItem(oO)??"[]").length&&document.referrer&&ok(document.referrer),window.addEventListener("single-spa:routing-event",e=>{let t=oC();e.detail.originalEvent?.singleSpaTrigger=="replaceState"?(t[t.length-1]=window.location.href,sessionStorage.setItem(oO,JSON.stringify(t))):!e.detail.originalEvent?.singleSpa&&t.includes(window.location.href)?oj({toUrl:window.location.href}):t[t.length-1]!==window.location.href&&ok(window.location.href)})}function oC(){return JSON.parse(sessionStorage.getItem(oO)??"[]")}function oj({toUrl:e}){let t=oC(),n=t.lastIndexOf(e);if(-1!=n){let e=t.slice(0,n+1);oD({to:t[n]}),sessionStorage.setItem(oO,JSON.stringify(e))}else throw Error(`URL ${e} not found in history; cannot go back to it.`)}function oT(){sessionStorage.removeItem(oO)}let oR="${openmrsSpaBase}/login",oA={redirectAuthFailure:{enabled:{_type:tG.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:tG.String,_default:oR,_validators:[nX.isUrl],_description:"The url to which users will be redirected when they are logged out. If set to blank, the `location` header from the response will be used."},errors:{_type:tG.Array,_default:[401],_elements:{_type:tG.Number,_validators:[nX.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:tG.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}},followRedirects:{_type:tG.Boolean,_default:!0,_description:"Whether openmrsFetch should support redirects returned from the backend"}};function oN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let oM="/ws/rest/v1",oI="/ws/fhir2/R4",o$=`${oM}/session`;function oL(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)}function oF(e,t={}){if("string"!=typeof e)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof t)throw Error("The second argument to @openmrs/api's openmrsFetch function must be a plain object.");if(!window.openmrsBase)throw Error("@openmrs/api is running in a browser that doesn't have window.openmrsBase, which is provided by openmrs-module-spa's HTML file.");let n=oL(e);if(t.headers||(t.headers={}),eD(t.body)&&(t.body=JSON.stringify(t.body)),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),null===t.headers.Accept&&delete t.headers.Accept,e.startsWith(oM)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(oI)){let e=new URL(n,window.location.toString());e.searchParams.has("_summary")||(e.searchParams.set("_summary","data"),n=e.toString())}let r=Error();return window.fetch(n,t).then(async e=>{let{redirectAuthFailure:t,followRedirects:o}=await nO("@openmrs/esm-api");if(e.ok){let t=e.headers.get("location");return(o&&t&&(n===oL(o$)||204===e.status)&&oD({to:t}),204===e.status)?(e.data=null,e):e.clone().text().then(t=>{try{t&&(e.data=JSON.parse(t))}catch(e){}return e})}return n===oL(o$)&&403===e.status||t.enabled&&t.errors.includes(e.status)?(oT(),oD({to:t.url||e.headers.get("location")||oR}),t.resolvePromise?Promise.resolve():new Promise(()=>{})):e.clone().text().then(t=>{let o=t;try{o=JSON.parse(t)}catch(e){}throw new oV(n,e,o,r)},t=>{throw new oV(n,e,null,r)})})}function oB(e,t={}){if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");let n=new AbortController;return t.signal=n.signal,new eg.c(r=>{let o=!1;return oF(e,t).then(e=>{o=!0,r.next(e),r.complete()},e=>{o=!0,r.error(e)}),()=>{o||n.abort()}})}class oV extends Error{constructor(e,t,n,r){super(),oN(this,"response",void 0),oN(this,"responseBody",void 0),this.message=`Server responded with ${t.status} (${t.statusText}) for url ${e}. Check err.responseBody or network tab in dev tools for more info`,r.message=this.message,this.responseBody=n,this.response=t,this.stack=`Stacktrace for outgoing request:
11
+ If you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. Received ${JSON.stringify(l)}`)}}function nM(e,t){return nN(t.map(({[e]:t})=>t).filter(e=>!!e))}function nN(e){return e.reduce((e,t)=>e3(e,t,nf),{})}function nI(e,t,n=""){for(let r of Object.keys(t)){let o=t[r],i=n+"."+r,a=e[r];if(!e.hasOwnProperty(r)){("extensionSlots"!==r||""===n)&&nK(i,`Unknown config key '${i}' provided. Ignoring.`);continue}(function e(t,n,r){nL(r,t._type,n),nU(n)?t._type===tG.Object?function(t,n,r){if(t._elements)for(let o of Object.keys(n)){let i=n[o];e(t._elements,i,`${r}.${o}`)}}(t,n,r):t.hasOwnProperty("_default")||t.hasOwnProperty("_type")||nI(t,n,r):t._type===tG.Array&&function(t,n,r){if(nL(r,tG.Array,n)){if(nV(t._elements))for(let o=0;o<n.length;o++)e(t._elements,n[o],`${r}[${o}]`);for(let e=0;e<n.length;e++)nL(`${r}[${e}]`,t._elements?._type,n[e])}}(t,n,r)})(a,o,i)}}function n$(e,t,n=""){if(e){if(t!==e._default&&nF(n,e._validators,t),nU(t))for(let r of Object.keys(t)){let o=t[r],i=n+"."+r,a=e[r];e._type===tG.Object&&e._elements?n$(e._elements,o,i):n$(a,o,i)}else if(Array.isArray(t)&&e._elements)for(let r=0;r<t.length;r++)n$(e._elements,t[r],`${n}[${r}]`)}}function nL(e,t,n){return!t||nF(e,[{Array:tZ,Boolean:tY,ConceptUuid:t0,Number:tJ,Object:tX,String:tQ,UUID:t0,PersonAttributeTypeUuid:t0,PatientIdentifierTypeUuid:t0}[t]],n)}function nF(e,t,n){let r=!0;if(t)try{for(let o of t){let t=o(n);if("string"==typeof t){let o="object"==typeof n?`Invalid configuration for ${e}: ${t}`:`Invalid configuration value ${n} for ${e}: ${t}`;nK(e,o),r=!1}}}catch(t){console.error(`Skipping invalid validator at "${e}". Encountered error
12
+ ${t}`)}return r}let nB=(e,t)=>{let n=structuredClone(t);if(!e)return n;for(let t of Object.keys(e)){let r=n[t],o=e[t];if(o&&(o.hasOwnProperty("_type")||o.hasOwnProperty("_default"))){n.hasOwnProperty(t)||(n[t]=o._default);let e=o._elements;if(r&&nV(e)){if(o._type===tG.Array&&Array.isArray(r)){let o=r.map(t=>nB(e,t));n[t]=o}else if(o._type===tG.Object)for(let t of Object.keys(r))r[t]=nB(e,r[t])}}else if(nU(o)){let e=r??{};nU(e)&&(n[t]=nB(o,e))}}return n};function nV(e){return!!e&&Object.keys(e).filter(e=>!["_default","_validators"].includes(e)).length>0}function nU(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}let nW=new Set;function nK(e,t){let n=`${e}:::${t}`;nW||(nW=new Set),nW.has(n)||(console.error(t),nW.add(n))}function nz(e){e?nW.forEach(t=>{t.startsWith(e)&&nW.delete(t)}):nW.clear()}function nH(){nh.forEach(e=>e()),nh.length=0,nb.clear(),nC.clear(),nT.clear(),nj.clear(),ny()}let nG={"Translation overrides":{_description:"Per-language overrides for frontend translations should be keyed by language code and each language dictionary contains the translation key and the display value",_type:tG.Object,_default:{},_validators:[tq(e=>Object.keys(e).every(e=>/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e)),e=>{let t=Object.keys(e).filter(e=>!/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e));return`The 'Translation overrides' object should have language codes for keys. Language codes must be in the form of a two-to-three letter language code optionally followed by a hyphen and a two-to-three letter country code. The following keys do not conform: ${t.join(", ")}.`})]}},nq={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:tG.Array,_default:[]},expression:{_description:"The expression that determines whether the extension is displayed",_type:tG.String,_default:void 0}},...nG},nZ=(e,t)=>tq(n=>e<=n&&n<=t,`must be between ${e} and ${t}`),nY=e=>{let t=e.concat(["openmrsBase","openmrsSpaBase"]);return tq(e=>{if(!e||"string"!=typeof e)return!1;let n=/\${(.*?)}/g,r=n.exec(e);for(;r;){if(!t.includes(r[1]))return!1;r=n.exec(e)}return!0},"Should be a URL or path. The allowed template parameters are "+t.map(e=>"${"+e+"}").join(", "))},nJ=nY([]),nQ=e=>tq(t=>e.includes(t),`Must be one of the following: '${e.join("', '")}'.`),nX={inRange:nZ,isUrl:nJ,isUrlWithTemplateParameters:nY,oneOf:nQ};var n0=n(82034);let n1=Z("breadcrumbs",[]);function n2(e){return n4([e])}function n4(e){let t=[...n3(),...e.map(e=>({matcher:e.matcher instanceof RegExp?e.matcher:"string"==typeof e.matcher?(0,n0.pathToRegexp)(e.matcher).regexp:(0,n0.pathToRegexp)(e.path).regexp,settings:e}))];n1.setState(t,!0)}function n3(){return n1.getState()}function n6(e,t){if(t)return function(e,t){let[n]=e.filter(e=>e.matcher.test(t));return n}(e,t)||function(e,t){let n=t.split("/");for(;n.length>1;){n.pop();let t=n6(e,n.join("/"));if(t)return t}}(e,t)}function n5(e,t){if(e.length>0){let n=n6(e,t);if(n){let t=[n],r=n6(e,n.settings.parent);for(;void 0!==r;)t.push(r),r=n6(e,r.settings.parent);return t.reverse()}}return[]}function n7(e){return n5(n3(),e)}var n9=Object.freeze({__proto__:null,get start(){return ox},get ensureJQuerySupport(){return r7},get setBootstrapMaxTime(){return rU},get setMountMaxTime(){return rW},get setUnmountMaxTime(){return rK},get setUnloadMaxTime(){return rz},get registerApplication(){return ol},get unregisterApplication(){return oc},get getMountedApps(){return oo},get getAppStatus(){return oa},get unloadApplication(){return od},get checkActivityFunctions(){return ou},get getAppNames(){return oi},get pathToActiveWhen(){return oh},get navigateToUrl(){return rQ},get patchHistoryApi(){return r3},get triggerAppChange(){return ob},get addErrorHandler(){return rr},get removeErrorHandler(){return ro},get mountRootParcel(){return r$},get NOT_LOADED(){return rs},get LOADING_SOURCE_CODE(){return rl},get NOT_BOOTSTRAPPED(){return ru},get BOOTSTRAPPING(){return rc},get NOT_MOUNTED(){return rd},get MOUNTING(){return rf},get UPDATING(){return rh},get LOAD_ERROR(){return rg},get MOUNTED(){return rp},get UNLOADING(){return ry},get UNMOUNTING(){return rm},get SKIP_BECAUSE_BROKEN(){return rb}}),n8=("u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{}).CustomEvent,re=!function(){try{var e=new n8("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?"u">typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=!!t.bubbles,n.cancelable=!!t.cancelable,n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n}:n8;let rt=[];function rn(e,t,n){let r=ra(e,t,n);rt.length?rt.forEach(e=>e(r)):setTimeout(()=>{throw r})}function rr(e){if("function"!=typeof e)throw Error(ri(28,!1));rt.push(e)}function ro(e){if("function"!=typeof e)throw Error(ri(29,!1));let t=!1;return rt=rt.filter(n=>{let r=n===e;return t=t||r,!r}),t}function ri(e,t,...n){return`single-spa minified message #${e}: ${t?t+" ":""}See https://single-spa.js.org/error/?code=${e}${n.length?`&arg=${n.join("&arg=")}`:""}`}function ra(e,t,n){let r,o=`${rS(t)} '${r_(t)}' died in status ${t.status}: `;if(e instanceof Error){try{e.message=o+e.message}catch(e){}r=e}else{console.warn(ri(30,!1,t.status,r_(t)));try{r=Error(o+JSON.stringify(e))}catch(t){r=e}}return r.appOrParcelName=r_(t),t.status=n,r}let rs="NOT_LOADED",rl="LOADING_SOURCE_CODE",ru="NOT_BOOTSTRAPPED",rc="BOOTSTRAPPING",rd="NOT_MOUNTED",rf="MOUNTING",rp="MOUNTED",rh="UPDATING",rm="UNMOUNTING",ry="UNLOADING",rg="LOAD_ERROR",rb="SKIP_BECAUSE_BROKEN";function rv(e){return e.status===rp}function rw(e){try{return e.activeWhen(window.location)}catch(t){return rn(t,e,rb),!1}}function r_(e){return e.name}function rx(e){return!!e.unmountThisParcel}function rS(e){return rx(e)?"parcel":"application"}function rE(){for(let e=arguments.length-1;e>0;e--)for(let t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]}function rD(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}function rO(e){return e&&("function"==typeof e||Array.isArray(e)&&!rD(e,e=>"function"!=typeof e))}function rP(e,t){let n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[()=>Promise.resolve()]);let r=rS(e),o=r_(e);return function(e){return n.reduce((n,i,a)=>n.then(()=>{let n=i(e);return rk(n)?n:Promise.reject(ri(15,!1,r,o,t,a))}),Promise.resolve())}}function rk(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}let rC=[];function rj(e,t){return Promise.resolve().then(()=>e.status!==ru?e:(e.status=rc,e.bootstrap?rH(e,"bootstrap").then(n).catch(n=>{if(t)throw ra(n,e,rb);return rn(n,e,rb),e}):Promise.resolve().then(n)));function n(){return e.status=rd,e}}function rT(e,t){return Promise.resolve().then(()=>{if(e.status!==rp)return e;return e.status=rm,Promise.all(Object.keys(e.parcels).map(t=>e.parcels[t].unmountThisParcel())).then(n,r=>n().then(()=>{let n=Error(r.message);if(t)throw ra(n,e,rb);rn(n,e,rb)})).then(()=>e);function n(){return rH(e,"unmount").then(()=>{e.status=rd},n=>{if(t)throw ra(n,e,rb);rn(n,e,rb)})}})}let rR=!1,rA=!1;function rM(e,t){return Promise.resolve().then(()=>e.status!==rd?e:(rR||(window.dispatchEvent(new re("single-spa:before-first-mount")),rR=!0),e.status=rf,rH(e,"mount").then(()=>(e.status=rp,rA||(window.dispatchEvent(new re("single-spa:first-mount")),rA=!0),e)).catch(n=>{return e.status=rp,rT(e,!0).then(r,r);function r(){if(t)throw ra(n,e,rb);return rn(n,e,rb),e}})))}let rN=0,rI={parcels:{}};function r$(){return rL.apply(rI,arguments)}function rL(e,t){let n,r,o,i=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(ri(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(ri(3,!1,typeof e.name));let a=rN++,s=e.name||`parcel-${a}`;if("object"!=typeof t)throw Error(ri(4,!1,s,typeof t));if(!t.domElement)throw Error(ri(5,!1,s));let l="function"==typeof e,u=l?e:()=>Promise.resolve(e),c={id:a,parcels:{},status:l?rl:ru,customProps:t,parentName:r_(i),unmountThisParcel:()=>p.then(()=>{if(c.status!==rp)throw Error(ri(6,!1,s,c.status));return rT(c,!0)}).then(e=>(c.parentName&&delete i.parcels[c.id],e)).then(e=>(r(e),e)).catch(e=>{throw c.status=rb,o(e),e})};i.parcels[a]=c;let d=u();if(!d||"function"!=typeof d.then)throw Error(ri(7,!1));let f=(d=d.then(e=>{if(!e)throw Error(ri(8,!1));if(s=e.name||`parcel-${a}`,Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!rO(e.bootstrap))throw Error(ri(9,!1,s));if(!rO(e.mount))throw Error(ri(10,!1,s));if(!rO(e.unmount))throw Error(ri(11,!1,s));if(e.update&&!rO(e.update))throw Error(ri(12,!1,s));let t=rP(e,"bootstrap"),r=rP(e,"mount"),o=rP(e,"unmount");c.status=ru,c.name=s,c.bootstrap=t,c.mount=r,c.unmount=o,c.timeouts=rG(e.timeouts),e.update&&(c.update=rP(e,"update"),n.update=function(e){return c.customProps=e,rF(Promise.resolve().then(()=>{if(c.status!==rp)throw Error(ri(32,!1,r_(c)));return c.status=rh,rH(c,"update").then(()=>(c.status=rp,c)).catch(e=>{throw ra(e,c,rb)})}))})})).then(()=>rj(c,!0)),p=f.then(()=>rM(c,!0)),h=new Promise((e,t)=>{r=e,o=t});return n={mount:()=>rF(Promise.resolve().then(()=>{if(c.status!==rd)throw Error(ri(13,!1,s,c.status));return i.parcels[a]=c,rM(c)})),unmount:()=>rF(c.unmountThisParcel()),getStatus:()=>c.status,loadPromise:rF(d),bootstrapPromise:rF(f),mountPromise:rF(p),unmountPromise:rF(h)}}function rF(e){return e.then(()=>null)}function rB(e){let t=r_(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof n||null===n||Array.isArray(n))&&(n={},console.warn(ri(40,!1),t,n));let r=rE({},n,{name:t,mountParcel:rL.bind(e),singleSpa:n9});return rx(e)&&(r.unmountSelf=e.unmountThisParcel),r}let rV={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function rU(e,t,n){if("number"!=typeof e||e<=0)throw Error(ri(16,!1));rV.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rW(e,t,n){if("number"!=typeof e||e<=0)throw Error(ri(17,!1));rV.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rK(e,t,n){if("number"!=typeof e||e<=0)throw Error(ri(18,!1));rV.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rz(e,t,n){if("number"!=typeof e||e<=0)throw Error(ri(19,!1));rV.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rH(e,t){let n=e.timeouts[t],r=n.warningMillis,o=rS(e);return new Promise((i,a)=>{let s=!1,l=!1;e[t](rB(e)).then(e=>{s=!0,i(e)}).catch(e=>{s=!0,a(e)}),setTimeout(()=>c(1),r),setTimeout(()=>c(!0),n.millis);let u=ri(31,!1,t,o,r_(e),n.millis);function c(e){s||(!0===e?(l=!0,n.dieOnTimeout?a(Error(u)):console.error(u)):!l&&(console.warn(u),e*r+r<n.millis&&setTimeout(()=>c(e+1),r)))}})}function rG(e){let t={};for(let n in rV)t[n]=rE({},rV[n],e&&e[n]||{});return t}function rq(e){return Promise.resolve().then(()=>{let t,n;return e.loadPromise?e.loadPromise:e.status!==rs&&e.status!==rg?e:(e.status=rl,e.loadPromise=Promise.resolve().then(()=>{let r=e.loadApp(rB(e));if(!rk(r))throw n=!0,Error(ri(33,!1,r_(e)));return r.then(n=>{let r;e.loadErrorTime=null,"object"!=typeof(t=n)&&(r=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!rO(t.bootstrap)&&(r=35),rO(t.mount)||(r=36),rO(t.unmount)||(r=37);let o=rS(t);if(r){let n;try{n=JSON.stringify(t)}catch(e){}return console.error(ri(r,!1,o,r_(e),n),t),rn(void 0,e,rb),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=rE({},e.devtools.overlays,t.devtools.overlays)),e.status=ru,e.bootstrap=rP(t,"bootstrap"),e.mount=rP(t,"mount"),e.unmount=rP(t,"unmount"),e.unload=rP(t,"unload"),e.timeouts=rG(t.timeouts),delete e.loadPromise,e})}).catch(t=>{let r;return delete e.loadPromise,n?r=rb:(r=rg,e.loadErrorTime=(new Date).getTime()),rn(t,e,r),e}))})}let rZ="u">typeof window,rY={hashchange:[],popstate:[]},rJ=["hashchange","popstate"];function rQ(e){let t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(ri(14,!1));t=e.currentTarget.href,e.preventDefault()}let n=r6(window.location.href),r=r6(t);0===t.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)}function rX(e){if(e){let t=e[0].type;rJ.indexOf(t)>=0&&rY[t].forEach(t=>{try{t.apply(this,e)}catch(e){setTimeout(()=>{throw e})}})}}function r0(){ov([],arguments)}function r1(e,t){return function(){let n=window.location.href,r=e.apply(this,arguments),i=window.location.href;return o&&n===i||window.dispatchEvent(function(e,t){let n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)),r}}let r2=null,r4=!1;function r3(e){if(r4)throw Error(ri(43,!1));o=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,r4=!0,r2=window.history.replaceState,window.addEventListener("hashchange",r0),window.addEventListener("popstate",r0);let t=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(e,n){if(!("function"==typeof n&&rJ.indexOf(e)>=0)||rD(rY[e],e=>e===n))return t.apply(this,arguments);rY[e].push(n)},window.removeEventListener=function(e,t){return"function"==typeof t&&rJ.indexOf(e)>=0&&(rY[e]=rY[e].filter(e=>e!==t)),n.apply(this,arguments)},window.history.pushState=r1(window.history.pushState,"pushState"),window.history.replaceState=r1(r2,"replaceState")}function r6(e){let t=document.createElement("a");return t.href=e,t}rZ&&(window.singleSpaNavigate?console.warn(ri(41,!1)):window.singleSpaNavigate=rQ);let r5=!1;function r7(e=window.jQuery){if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!r5){let t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return r9.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return r9.call(this,n,window.removeEventListener,e,t,arguments)},r5=!0}}function r9(e,t,n,r,o){return"string"!=typeof n?e.apply(this,o):(n.split(/\s+/).forEach(e=>{rJ.indexOf(e)>=0&&(t(e,r),n=n.replace(e,""))}),""===n.trim()?this:e.apply(this,o))}let r8={};function oe(e){return Promise.resolve().then(()=>{let t=r8[r_(e)];if(!t)return e;if(e.status===rs)return ot(e,t),e;if(e.status===ry)return t.promise.then(()=>e);if(e.status!==rd&&e.status!==rg)return e;let n=e.status===rg?Promise.resolve():rH(e,"unload");return e.status=ry,n.then(()=>(ot(e,t),e)).catch(n=>(delete r8[r_(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,rn(n,e,rb),t.reject(n),e))})}function ot(e,t){delete r8[r_(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=rs,t.resolve()}function on(e,t,n,r){r8[r_(e)]={app:e,resolve:n,reject:r},Object.defineProperty(r8[r_(e)],"promise",{get:t})}let or=[];function oo(){return or.filter(rv).map(r_)}function oi(){return or.map(r_)}function oa(e){let t=rD(or,t=>r_(t)===e);return t?t.status:null}let os=!1;function ol(e,t,n,r){var o,i;let a,s,l=(a={name:null,loadApp:null,activeWhen:null,customProps:null},"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(ri(39,!1));let t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((e,n)=>t.indexOf(n)>=0?e:e.concat(n),[]);if(0!==n.length)throw Error(ri(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length||"object"!=typeof e.app&&"function"!=typeof e.app)throw Error(ri(20,!1));let r=e=>"string"==typeof e||"function"==typeof e;if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error(ri(24,!1));if(!op(e.customProps))throw Error(ri(22,!1))}(e),a.name=e.name,a.loadApp=e.app,a.activeWhen=e.activeWhen,a.customProps=e.customProps):(function(e,t,n,r){if("string"!=typeof e||0===e.length)throw Error(ri(20,!1));if(!t)throw Error(ri(23,!1));if("function"!=typeof n)throw Error(ri(24,!1));if(!op(r))throw Error(ri(22,!1))}(e,t,n,r),a.name=e,a.loadApp=t,a.activeWhen=n,a.customProps=r),a.loadApp="function"!=typeof(o=a.loadApp)?()=>Promise.resolve(o):o,a.customProps=a.customProps||{},s=(s=Array.isArray(i=a.activeWhen)?i:[i]).map(e=>"function"==typeof e?e:oh(e)),a.activeWhen=e=>s.some(t=>t(e)),a);if(o_||os||(os=!0,setTimeout(()=>{o_||console.warn(ri(1,!1))},5e3)),-1!==oi().indexOf(l.name))throw Error(ri(21,!1,l.name));or.push(rE({loadErrorTime:null,status:rs,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},l)),rZ&&(r7(),ov())}function ou(e=window.location){return or.filter(t=>t.activeWhen(e)).map(r_)}function oc(e){if(0===or.filter(t=>r_(t)===e).length)throw Error(ri(25,!1,e));return(rZ?od(e,{waitForUnmount:!1}):Promise.resolve()).then(()=>{let t=or.map(r_).indexOf(e);or.splice(t,1)})}function od(e,t={waitForUnmount:!1}){if("string"!=typeof e)throw Error(ri(26,!1));let n=rD(or,t=>r_(t)===e);if(!n)throw Error(ri(27,!1,e));let r=r8[r_(n)];if(t&&t.waitForUnmount){if(r)return r.promise;{let e=new Promise((t,r)=>{on(n,()=>e,t,r)});return e}}{let e;return r?(e=r.promise,of(n,r.resolve,r.reject)):e=new Promise((t,r)=>{on(n,()=>e,t,r),of(n,t,r)}),e}}function of(e,t,n){Promise.resolve().then(()=>{if(rD(ou(),t=>t===r_(e)))return ob()}).then(()=>rT(e).then(oe).then(()=>{t(),setTimeout(()=>{ov()})})).catch(n)}function op(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)}function oh(e,t){let n=function(e,t){let n=0,r=!1,o="^";"/"!==e[0]&&(e="/"+e);for(let t=0;t<e.length;t++){let n=e[t],o=r&&"/"===n;(!r&&":"===n||o)&&i(t)}return i(e.length),RegExp(o,"i");function i(i){let a=e.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===e.length)if(r)t&&(o+="$");else{let e=t?"":".*";o="/"===o.charAt(o.length-1)?`${o}${e}$`:`${o}(/${e})?(#.*)?$`}r=!r,n=i}}(e,t);return e=>{let t=e.origin;t||(t=`${e.protocol}//${e.host}`);let r=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(r)}}let om=!1,oy=[],og=rZ&&window.location.href;function ob(){return ov()}function ov(e=[],t,n=!1){let r,o,i,a,s;if(om)return new Promise((e,n)=>{oy.push({resolve:e,reject:n,eventArguments:t})});let{appsToUnload:l,appsToUnmount:u,appsToLoad:c,appsToMount:d}=(r=[],o=[],i=[],a=[],s=(new Date).getTime(),or.forEach(e=>{let t=e.status!==rb&&rw(e);switch(e.status){case rg:t&&s-e.loadErrorTime>=200&&i.push(e);break;case rs:case rl:t&&i.push(e);break;case ru:case rd:!t&&r8[r_(e)]?r.push(e):t&&a.push(e);break;case rp:t||o.push(e)}}),{appsToUnload:r,appsToUnmount:o,appsToLoad:i,appsToMount:a}),f,p=[],h=og,m=og=window.location.href;return o_?(om=!0,f=l.concat(c,u,d),Promise.resolve().then(()=>(w(0===f.length?"before-no-app-change":"before-app-change",v(!0)),w("before-routing-event",v(!0,{cancelNavigation:y})),Promise.all(p).then(n=>{if(n.some(e=>e))return r2.call(window.history,history.state,"",h.substring(location.origin.length)),og=location.href,om=!1,ov(e,t,!0);let r=l.map(oe),o=Promise.all(u.map(rT).map(e=>e.then(oe)).concat(r));o.then(()=>{w("before-mount-routing-event",v(!0))},e=>{throw e});let i=c.map(e=>rq(e).then(e=>ow(e,o))),a=d.filter(e=>0>c.indexOf(e)).map(e=>ow(e,o));return o.catch(e=>{throw b(),e}).then(()=>(b(),Promise.all(i.concat(a)).catch(t=>{throw e.forEach(e=>e.reject(t)),t}).then(g).then(()=>{},e=>{throw e})))})))):(f=c,Promise.resolve().then(()=>Promise.all(c.map(rq)).then(b).then(()=>[]).catch(e=>{throw b(),e}).finally(()=>{})));function y(e=!0){let t="function"==typeof(null==e?void 0:e.then)?e:Promise.resolve(e);p.push(t.catch(e=>(console.warn(Error(ri(42,!1))),console.warn(e),!1)))}function g(){let t=oo();e.forEach(e=>e.resolve(t));try{w(0===f.length?"no-app-change":"app-change",v()),w("routing-event",v())}catch(e){setTimeout(()=>{throw e})}if(om=!1,oy.length>0){let e=oy;oy=[],ov(e)}return t}function b(){n||(e.forEach(e=>{rX(e.eventArguments)}),rX(t))}function v(e=!1,n){let r={},o={[rp]:[],[rd]:[],[rs]:[],[rb]:[]};e?(c.concat(d).forEach((e,t)=>{a(e,rp)}),l.forEach(e=>{a(e,rs)}),u.forEach(e=>{a(e,rd)})):f.forEach(e=>{a(e)});let i={detail:{newAppStatuses:r,appsByNewStatus:o,totalAppChanges:f.length,originalEvent:null==t?void 0:t[0],oldUrl:h,newUrl:m}};return n&&rE(i.detail,n),i;function a(e,t){let n=r_(e);t=t||oa(n),r[n]=t,(o[t]=o[t]||[]).push(n)}}function w(e,t){n||window.dispatchEvent(new re(`single-spa:${e}`,t))}}function ow(e,t){return rw(e)?rj(e).then(e=>t.then(()=>rw(e)?rM(e):e)):t.then(()=>e)}let o_=!1;function ox(e){o_=!0,rZ&&(r3(e),ov())}function oS(e,t){let n=window.getOpenmrsSpaBase().replace(/\/$/,"");return oE(e,{openmrsBase:window.openmrsBase,openmrsSpaBase:n,...t}).replace(/^\/\//,"/")}function oE(e,t){return Object.keys(t).reduce((e,n)=>e.split("${"+n+"}").join(t[n]),e)}function oD({to:e,templateParams:t}){let n=window.getOpenmrsSpaBase().replace(/\/$/,""),r=oS(e,t).replace(window.location.origin,"");r.startsWith(n)?rQ(r):window.location.assign(r)}rZ&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods={getRawAppData:function(){return[...or]},reroute:ov,NOT_LOADED:rs,toLoadPromise:rq,toBootstrapPromise:rj,unregisterApplication:oc,getProfilerData:function(){return rC}});let oO="openmrs:history";function oP(e){let t=JSON.parse(sessionStorage.getItem(oO)??"[]")||[];t.push(e),t.length>50&&(t=t.slice(-50)),sessionStorage.setItem(oO,JSON.stringify(t))}function ok(){0===JSON.parse(sessionStorage.getItem(oO)??"[]").length&&document.referrer&&oP(document.referrer),window.addEventListener("single-spa:routing-event",e=>{let t=oC();e.detail.originalEvent?.singleSpaTrigger=="replaceState"?(t[t.length-1]=window.location.href,sessionStorage.setItem(oO,JSON.stringify(t))):!e.detail.originalEvent?.singleSpa&&t.includes(window.location.href)?oj({toUrl:window.location.href}):t[t.length-1]!==window.location.href&&oP(window.location.href)})}function oC(){return JSON.parse(sessionStorage.getItem(oO)??"[]")}function oj({toUrl:e}){let t=oC(),n=t.lastIndexOf(e);if(-1!=n){let e=t.slice(0,n+1);oD({to:t[n]}),sessionStorage.setItem(oO,JSON.stringify(e))}else throw Error(`URL ${e} not found in history; cannot go back to it.`)}function oT(){sessionStorage.removeItem(oO)}let oR="${openmrsSpaBase}/login",oA={redirectAuthFailure:{enabled:{_type:tG.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:tG.String,_default:oR,_validators:[nX.isUrl],_description:"The url to which users will be redirected when they are logged out. If set to blank, the `location` header from the response will be used."},errors:{_type:tG.Array,_default:[401],_elements:{_type:tG.Number,_validators:[nX.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:tG.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}},followRedirects:{_type:tG.Boolean,_default:!0,_description:"Whether openmrsFetch should support redirects returned from the backend"}};function oM(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let oN="/ws/rest/v1",oI="/ws/fhir2/R4",o$=`${oN}/session`;function oL(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)}function oF(e,t={}){if("string"!=typeof e)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof t)throw Error("The second argument to @openmrs/api's openmrsFetch function must be a plain object.");if(!window.openmrsBase)throw Error("@openmrs/api is running in a browser that doesn't have window.openmrsBase, which is provided by openmrs-module-spa's HTML file.");let n=oL(e);if(t.headers||(t.headers={}),eD(t.body)&&(t.body=JSON.stringify(t.body)),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),null===t.headers.Accept&&delete t.headers.Accept,e.startsWith(oN)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(oI)){let e=new URL(n,window.location.toString());e.searchParams.has("_summary")||(e.searchParams.set("_summary","data"),n=e.toString())}let r=Error();return window.fetch(n,t).then(async e=>{let{redirectAuthFailure:t,followRedirects:o}=await nO("@openmrs/esm-api");if(e.ok){let t=e.headers.get("location");return(o&&t&&(n===oL(o$)||204===e.status)&&oD({to:t}),204===e.status)?(e.data=null,e):e.clone().text().then(t=>{try{t&&(e.data=JSON.parse(t))}catch(e){}return e})}return n===oL(o$)&&403===e.status||t.enabled&&t.errors.includes(e.status)?(oT(),oD({to:t.url||e.headers.get("location")||oR}),t.resolvePromise?Promise.resolve():new Promise(()=>{})):e.clone().text().then(t=>{let o=t;try{o=JSON.parse(t)}catch(e){}throw new oV(n,e,o,r)},t=>{throw new oV(n,e,null,r)})})}function oB(e,t={}){if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");let n=new AbortController;return t.signal=n.signal,new eg.c(r=>{let o=!1;return oF(e,t).then(e=>{o=!0,r.next(e),r.complete()},e=>{o=!0,r.error(e)}),()=>{o||n.abort()}})}class oV extends Error{constructor(e,t,n,r){super(),oM(this,"response",void 0),oM(this,"responseBody",void 0),this.message=`Server responded with ${t.status} (${t.statusText}) for url ${e}. Check err.responseBody or network tab in dev tools for more info`,r.message=this.message,this.responseBody=n,this.response=t,this.stack=`Stacktrace for outgoing request:
13
13
  ${r.stack}
14
14
  Stacktrace for incoming response:
15
- ${this.stack}`}}let oU=Z("session",{loaded:!1,session:null}),oW=0;function oK(e={includeAuthStatus:!0}){return(oW<Date.now()-6e4||!oU.getState().loaded)&&oG(),new eg.c(t=>{let n=n=>{n.loaded&&(e.includeAuthStatus?t.next(n.session):t.next(n.session?.user))};return n(oU.getState()),oU.subscribe(n)})}function oz(){return(oW<Date.now()-6e4||!oU.getState().loaded)&&oG(),oU}function oH(e){let t=e.locale??e.user?.userProperties?.defaultLocale;t&&t.includes("_")&&(t=t.replaceAll("_","-")),function(e){if(void 0===e||"string"!=typeof e)return!1;try{new Intl.Locale(e)}catch(e){return!1}return!0}(t)&&t!==document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",t)}function oG(e,t){oW=Date.now();let n={};return e&&t&&(n.Authorization=`Basic ${window.btoa(`${e}:${t}`)}`),o0(oF(o$,{headers:n}))}function oq(){oU.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})}function oZ(e,t){var n,r;if(void 0===t)return!e;if(!e)return!0;return n=e,r=t,("string"==typeof n?!ee(r.privileges.find(e=>n===e.display)):Array.isArray(n)?n.every(e=>!ee(r.privileges.find(t=>e===t.display))):(ee(n)||console.error(`Could not understand privileges "${n}"`),!0))||!ee(t.roles.find(e=>"System Developer"===e.display))}function oY(){let e,t;return new Promise(n=>{let r=r=>{r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};r(oU.getState()),e||(t=oU.subscribe(r))})}function oJ(){return new Promise((e,t)=>{oK().subscribe(t=>{e(t.sessionLocation)},t).unsubscribe()})}async function oQ(e,t){return o0(oF(o$,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal}))}async function oX(e,t,n){return n||(n=new AbortController),await oF(`${oM}/user/${e}`,{method:"POST",body:{userProperties:t},headers:{"Content-Type":"application/json"},signal:n.signal}),oG()}function o0(e){return new Promise((t,n)=>{e.then(e=>{let r;"object"==typeof e?.data?(r={loaded:!0,session:e.data},oU.setState(r),t(r)):(r={loaded:!1,session:null},oU.setState(r),n(r))}).catch(e=>{I(`Failed to fetch new session information: ${e}`);let t={loaded:!1,session:null};oU.setState(t),n(t)})})}function o1(){return"development"===window.spaEnv||"true"===localStorage.getItem("openmrs:devtools")}oU.subscribe(e=>{e.loaded&&e.session&&oH(e.session)});let o2={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"};function o4(){nv("@openmrs/esm-api",oA),oG()}let o3={address1:"Address line 1",address2:"Address line 2",address3:"Address line 3",address4:"Address line 4",address5:"Address line 5",address6:"Address line 6",city:"City",cityVillage:"City",country:"Country",countyDistrict:"District",district:"District",postalCode:"Postal code",state:"State",stateProvince:"State",closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",closingAllWorkspacesPromptTitle:"You have unsaved changes",discard:"Discard",hide:"Hide",maximize:"Maximize",minimize:"Minimize",openAnyway:"Open anyway",unsavedChangesInOpenedWorkspace:"You may have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header",discardUnsavedChangesPromptBodyMultiple:"{{count}} workspaces have unsaved changes. Closing them will discard the changes:",discardUnsavedChangesPromptBodySingle:"<strong>{{workspaceTitle}}</strong> has unsaved changes. Closing it will discard them.",discardUnsavedChangesPromptTitle:"Discard unsaved changes?",keepEditing:"Keep editing",abnormalValue:"Abnormal value",actions:"Actions",actionableNotification:"Actionable notification",address:"Address",age:"Age",batchActionItemSelected:"{{totalSelected}} item selected",batchActionsItemsSelected:"{{totalSelected}} items selected",cancel:"Cancel",change:"Change",Clinic:"Clinic",close:"Close",closesActionableNotification:"Close actionable notification",closeSnackbar:"Close snackbar",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",delete:"Delete",discardChanges:"Discard changes",edit:"Edit",emptyStateText:"There are no {{displayText}} to display",error:"Error",errorCopy:"Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",errorLoadingLoginLocations:"Unable to load login locations. Please try again or contact support if the problem persists.",female:"Female",leftNavigation:"Left navigation",loading:"Loading",localVersion:"Local Build",male:"Male",noResultsToDisplay:"No results to display",notAvailable:"Not available",other:"Other",paginationItemsCount:"{{pageItemsCount}} / {{totalItems}} items",paginationOfPages:"of {{count}} pages",patientAvatarAlt:"Avatar for {{patientName}}",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",patientPhotoAlt:"Profile photo of {{patientName}}",patientPhotoPlaceholder:"Photo placeholder for {{patientName}}",prereleaseVersion:"Prerelease",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",recordNewEntry:"Record {{displayText}}",relationships:"Relationships",resetOverrides:"Reset overrides",save:"Save",scriptLoadingFailed:"Error: Script failed to load",scriptLoadingError:"Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",searchForLocation:"Search for a location",seeAll:"See all",seeMoreLists:"See {{count}} more lists",selectAll:"Select all",sex:"Sex",showLess:"Show less",showMore:"Show more",snackbarNotification:"Snackbar notification",toggleDevTools:"Toggle dev tools",unknown:"Unknown",yearAbbreviation:"yr",yearsAbbreviation:"yrs"},o6=e=>"string"==typeof e,o5=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},o7=e=>null==e?"":""+e,o9=/###/g,o8=e=>e&&e.indexOf("###")>-1?e.replace(o9,"."):e,ie=e=>!e||o6(e),it=(e,t,n)=>{let r=o6(t)?t.split("."):t,o=0;for(;o<r.length-1;){if(ie(e))return{};let t=o8(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return ie(e)?{}:{obj:e,k:o8(r[o])}},ir=(e,t,n)=>{let{obj:r,k:o}=it(e,t,Object);if(void 0!==r||1===t.length){r[o]=n;return}let i=t[t.length-1],a=t.slice(0,t.length-1),s=it(e,a,Object);for(;void 0===s.obj&&a.length;)i=`${a[a.length-1]}.${i}`,s=it(e,a=a.slice(0,a.length-1),Object),s?.obj&&void 0!==s.obj[`${s.k}.${i}`]&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=n},io=(e,t)=>{let{obj:n,k:r}=it(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},ii=(e,t,n)=>{for(let r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?o6(e[r])||e[r]instanceof String||o6(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):ii(e[r],t[r],n):e[r]=t[r]);return e};var ia={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};let is=e=>o6(e)?e.replace(/[&<>"'\/]/g,e=>ia[e]):e,il=[" ",",","?","!",";"],iu=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),ic=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let r=t.split(n),o=e;for(let e=0;e<r.length;){let t;if(!o||"object"!=typeof o)return;let i="";for(let a=e;a<r.length;++a)if(a!==e&&(i+=n),i+=r[a],void 0!==(t=o[i])){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<r.length-1)continue;e+=a-e+1;break}o=t}return o},id=e=>e?.replace("_","-"),ip={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class ih{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||ip,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(o6(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new ih(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new ih(this.logger,e)}}var im=new ih;class iy{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let o=0;o<r;o++)n.apply(n,[e,...t])})}}class ig extends iy{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let o,i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,a=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):o6(n)&&i?o.push(...n.split(i)):o.push(n)));let s=io(this.data,o);return(!s&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),!s&&a&&o6(n))?ic(this.data?.[e]?.[t],n,i):s}addResource(e,t,n,r,o={silent:!1}){let i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),ir(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(o6(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o,i={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let s=io(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?ii(s,n,o):s={...s,...n},ir(this.data,a,s),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var ib={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,o)??t}),t}};let iv=Symbol("i18next/PATH_KEY");function iw(e,t){let n,r,o,{[iv]:i}=e((r=[],(o=Object.create(null)).get=(e,t)=>(n?.revoke?.(),t===iv)?r:(r.push(t),(n=Proxy.revocable(e,o)).proxy),Proxy.revocable(Object.create(null),o).proxy));return i.join(t?.keySeparator??".")}let i_={},ix=e=>!o6(e)&&"boolean"!=typeof e&&"number"!=typeof e;class iS extends iy{constructor(e,t={}){super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=im.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(null==e)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let o=ix(r.res);return!1!==n.returnObjects||!o}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,n)=>{t=t||"",n=n||"";let r=il.filter(e=>0>t.indexOf(e)&&0>n.indexOf(e));if(0===r.length)return!0;let o=iu.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`),i=!o.test(e);if(!i){let t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r);if(i&&!a){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:o6(o)?[o]:o};let i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:o6(o)?[o]:o}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=iw(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]);let o=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],r),l=s[s.length-1],u=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");let c=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode")return d?o?{res:`${l}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${u}${a}`:o?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:a;let f=this.resolve(e,r),p=f?.res,h=f?.usedKey||a,m=f?.exactUsedKey||a,y=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==r.count&&!o6(r.count),v=iS.hasDefaultValue(r),w=b?this.pluralResolver.getSuffix(c,r.count,r):"",x=r.ordinal&&b?this.pluralResolver.getSuffix(c,r.count,{ordinal:!1}):"",S=b&&!r.ordinal&&0===r.count,E=S&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${w}`]||r[`defaultValue${x}`]||r.defaultValue,D=p;g&&!p&&v&&(D=E);let O=ix(D),k=Object.prototype.toString.apply(D);if(g&&D&&O&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(k)&&!(o6(y)&&Array.isArray(D))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,D,{...r,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return o?(f.res=e,f.usedParams=this.getUsedParamsDetails(r),f):e}if(i){let e=Array.isArray(D),t=e?[]:{},n=e?m:h;for(let e in D)if(Object.prototype.hasOwnProperty.call(D,e)){let o=`${n}${i}${e}`;v&&!p?t[e]=this.translate(o,{...r,defaultValue:ix(E)?E[e]:void 0,...{joinArrays:!1,ns:s}}):t[e]=this.translate(o,{...r,joinArrays:!1,ns:s}),t[e]===o&&(t[e]=D[e])}p=t}}else if(g&&o6(y)&&Array.isArray(p))(p=p.join(y))&&(p=this.extendTranslation(p,e,r,n));else{let t=!1,o=!1;!this.isValidLookup(p)&&v&&(t=!0,p=E),this.isValidLookup(p)||(o=!0,p=a);let s=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:p,d=v&&E!==p&&this.options.updateMissing;if(o||t||d){if(this.logger.log(d?"updateKey":"missingKey",c,l,a,d?E:p),i){let e=this.resolve(a,{...r,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);let n=(e,t,n)=>{let o=v&&n!==p?n:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,o,d,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,o,d,r),this.emit("missingKey",e,l,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,r);S&&r[`defaultValue${this.options.pluralSeparator}zero`]&&0>t.indexOf(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],a+t,r[`defaultValue${t}`]||E)})}):n(e,a,E))}p=this.extendTranslation(p,e,r,f,n),o&&p===a&&this.options.appendNamespaceToMissingKey&&(p=`${l}${u}${a}`),(o||t)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${a}`:a,t?p:void 0,r))}return o?(f.res=p,f.usedParams=this.getUsedParamsDetails(r),f):p}extendTranslation(e,t,n,r,o){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){let i;n.interpolation&&this.interpolator.init({...n,...{interpolation:{...this.options.interpolation,...n.interpolation}}});let a=o6(e)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){let t=e.match(this.interpolator.nestingRegexp);i=t&&t.length}let s=n.replace&&!o6(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp);i<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>o?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}let i=n.postProcess||this.options.postProcess,a=o6(i)?[i]:i;return null!=e&&a?.length&&!1!==n.applyPostProcessor&&(e=ib.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,o,i,a;return o6(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),l=s.key;r=l;let u=s.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let c=void 0!==t.count&&!o6(t.count),d=c&&!t.ordinal&&0===t.count,f=void 0!==t.context&&(o6(t.context)||"number"==typeof t.context)&&""!==t.context,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(e=>{this.isValidLookup(n)||(a=e,!i_[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(i_[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(r=>{let a;if(this.isValidLookup(n))return;i=r;let s=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(s,l,r,e,t);else{let e;c&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(t.ordinal&&0===e.indexOf(o)&&s.push(l+e.replace(o,this.options.pluralSeparator)),s.push(l+e),d&&s.push(l+n)),f){let r=`${l}${this.options.contextSeparator||"_"}${t.context}`;s.push(r),c&&(t.ordinal&&0===e.indexOf(o)&&s.push(r+e.replace(o,this.options.pluralSeparator)),s.push(r+e),d&&s.push(r+n))}}for(;a=s.pop();)this.isValidLookup(n)||(o=a,n=this.getResource(r,e,a,t))}))})}),{res:n,usedKey:r,exactUsedKey:o,usedLng:i,usedNS:a}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=e.replace&&!o6(e.replace),n=t?e.replace:e;if(t&&void 0!==e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!t)for(let e of(n={...n},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete n[e];return n}static hasDefaultValue(e){let t="defaultValue";for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}class iE{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=im.create("languageUtils")}getScriptPartFromCode(e){if(!(e=id(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=id(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(o6(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)?t:this.options.lowerCaseLng?e.toLowerCase():e}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(0>e.indexOf("-")&&0>r.indexOf("-"))&&(e.indexOf("-")>0&&0>r.indexOf("-")&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),o6(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return o6(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):o6(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{0>r.indexOf(e)&&o(this.formatLanguageCode(e))}),r}}let iD={zero:0,one:1,two:2,few:3,many:4,other:5},iO={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ik{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=im.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n,r=id("dev"===e?"en":e),o=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:o});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];try{n=new Intl.PluralRules(r,{type:o})}catch(o){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),iO;if(!e.match(/-|_/))return iO;let r=this.languageUtils.getLanguagePartFromCode(e);n=this.getRule(r,t)}return this.pluralRulesCache[i]=n,n}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return(n||(n=this.getRule("dev",t)),n)?n.resolvedOptions().pluralCategories.sort((e,t)=>iD[e]-iD[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}let iP=(e,t,n,r=".",o=!0)=>{let i,a=void 0!==(i=io(e,n))?i:io(t,n);return!a&&o&&o6(n)&&void 0===(a=ic(e,n,r))&&(a=ic(t,n,r)),a};class iC{constructor(e={}){this.logger=im.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:m,maxReplaces:y,alwaysFormat:g}=e.interpolation;this.escape=void 0!==t?t:is,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):i||"{{",this.suffix=a?a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):f||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=p?p.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):h||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=m||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==g&&g,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let o,i,a,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(0>e.indexOf(this.formatSeparator)){let o=iP(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}let o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(iP(t,s,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp();let u=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e.replace(/\$/g,"$$$$")},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e).replace(/\$/g,"$$$$"):e.replace(/\$/g,"$$$$")}].forEach(t=>{for(a=0;o=t.regex.exec(e);){let n=o[1].trim();if(void 0===(i=l(n)))if("function"==typeof u){let t=u(e,o,r);i=o6(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else if(c){i=o[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i="";else o6(i)||this.useRawValueToEscape||(i=o7(i));let s=t.safeValue(i);if(e=e.replace(o[0],s),c?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,o,i,a=(e,t)=>{let n=this.nestingOptionsSeparator;if(0>e.indexOf(n))return e;let r=e.split(RegExp(`${n}[ ]*{`)),o=`{${r[1]}`;e=r[0];let a=(o=this.interpolate(o,i)).match(/'/g),s=o.match(/"/g);((a?.length??0)%2!=0||s)&&s.length%2==0||(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];(i=(i={...n}).replace&&!o6(i.replace)?i.replace:i).applyPostProcessor=!1,delete i.defaultValue;let l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(s=r[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),(o=t(a.call(this,r[1].trim(),i),i))&&r[0]===e&&!o6(o))return o;o6(o)||(o=o7(o)),o||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),o=""),s.length&&(o=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),o.trim())),e=e.replace(r[0],o),this.regexp.lastIndex=0}return e}}let ij=e=>{let t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});let a=r+JSON.stringify(i),s=t[a];return s||(s=e(id(r),o),t[a]=s),s(n)}},iT=e=>(t,n,r)=>e(id(n),r)(t);class iR{constructor(e={}){this.logger=im.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let n=t.cacheInBuiltFormats?ij:iT;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ij(t)}format(e,t,n,r={}){let o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&0>o[0].indexOf(")")&&o.find(e=>e.indexOf(")")>-1)){let e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}return o.reduce((e,t)=>{let{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){let r=e.split("(");t=r[0].toLowerCase().trim();let o=r[1].substring(0,r[1].length-1);"currency"===t&&0>o.indexOf(":")?n.currency||(n.currency=o.trim()):"relativetime"===t&&0>o.indexOf(":")?n.range||(n.range=o.trim()):o.split(";").forEach(e=>{if(e){let[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{let a=r?.formatParams?.[r.interpolationkey]||{},s=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,s,{...i,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e)}}class iA extends iy{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=im.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let o={},i={},a={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let a={};this.queue.forEach(n=>{((e,t,n,r)=>{let{obj:o,k:i}=it(e,t,Object);o[i]=o[i]||[],o[i].push(n)})(n.loaded,[o],i),void 0!==n.pending[e]&&(delete n.pending[e],n.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,o=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;let a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*o,i)},o):i(a,s)},s=this.backend[n].bind(this.backend);if(2===s.length){try{let n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}return}return s(e,t,a)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();o6(e)&&(e=this.languageUtils.toResolveHierarchy(e)),o6(t)&&(t=[t]);let o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){let n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o,i={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");if(null!=n&&""!==n){if(this.backend?.create){let s={...i,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let o;(o=5===l.length?l(e,t,n,r,s):l(e,t,n,r))&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(e){a(e)}else l(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}let iN=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),o6(e[1])&&(t.defaultValue=e[1]),o6(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),iM=e=>(o6(e.ns)&&(e.ns=[e.ns]),o6(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),o6(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),iI=()=>{};class i$ extends iy{constructor(e={},t){if(super(),this.options=iM(e),this.services={},this.logger=im,this.modules={external:[]},(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})})(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(o6(e.ns)?e.defaultNS=e.ns:0>e.ns.indexOf("translation")&&(e.defaultNS=e.ns[0]));let n=iN();this.options={...n,...this.options,...iM(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);let r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?im.init(r(this.modules.logger),this.options):im.init(null,this.options),e=this.modules.formatter?this.modules.formatter:iR;let t=new iE(this.options);this.store=new ig(this.options.resources,this.options);let o=this.services;o.logger=im,o.resourceStore=this.store,o.languageUtils=t,o.pluralResolver=new ik(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(o.formatter=r(e),o.formatter.init&&o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new iC(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new iA(r(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(o.languageDetector=r(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=r(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new iS(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=iI),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let o=o5(),i=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?i():setTimeout(i,0),o}loadResources(e,t=iI){let n=t,r=o6(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return n();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=o5();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=iI),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&ib.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&0>this.languages.indexOf(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=o5();this.emit("languageChanging",e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,i)=>{i?this.isLanguageChangingTo===e&&(r(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(o,(...e)=>this.t(...e))},i=t=>{e||t||!this.services.languageDetector||(t=[]);let n=o6(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(o6(t)?[t]:t);i&&(this.language||r(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector?.cacheUserLanguage?.(i)),this.loadResources(i,e=>{o(e,i)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}getFixedT(e,t,n){let r=(e,t,...o)=>{let i,a;(i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(o)):{...t}).lng=i.lng||r.lng,i.lngs=i.lngs||r.lngs,i.ns=i.ns||r.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||r.keyPrefix);let s=this.options.keySeparator||".";return i.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=iw(e,{...this.options,...t})),`${i.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=iw(e,{...this.options,...t})),a=i.keyPrefix?`${i.keyPrefix}${s}${e}`:e),this.t(a,i)};return o6(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;let i=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return -1===n||0===n||2===n};if(t.precheck){let e=t.precheck(this,i);if(void 0!==e)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!r||i(o,e)))}loadNamespaces(e,t){let n=o5();return this.options.ns?(o6(e)&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=o5();o6(e)&&(e=[e]);let r=this.options.preload||[],o=e.filter(e=>0>r.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}let t=this.services?.languageUtils||new iE(iN());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new i$(e,t)}cloneInstance(e={},t=iI){let n=e.forkResourceStore;n&&delete e.forkResourceStore;let r={...this.options,...e,isClone:!0},o=new i$(r);return(void 0!==e.debug||void 0!==e.prefix)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new ig(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),r),o.services.resourceStore=o.store),o.translator=new iS(o.services,r),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let iL=i$.createInstance();iL.createInstance=i$.createInstance,iL.createInstance,iL.dir,iL.init,iL.loadResources,iL.reloadResources,iL.use,iL.changeLanguage,iL.getFixedT,iL.t,iL.exists,iL.setDefaultNamespace,iL.hasLoadedNamespace,iL.loadNamespaces,iL.loadLanguages;let iF=iL.default||iL;function iB(e,t,n,r){return iF.t(t,{ns:e,defaultValue:n,...r})}function iV(e,t,n){return o3[e]?iB("core",e,t??o3[e],n):(console.error(`O3 Core Translations does not provide key '${e}'. The key itself is being rendered as text.`),e)}iF.on("initialized",function(){window.i18next.loadNamespaces(["core"])});let iU="import-map-override:",iW="import-map-overrides-disabled",iK="import-map-overrides:change",iz=!1,iH=null,iG=null;async function iq(){return iG??(iG=iZ().then(({map:e,complete:t})=>(t||(iG=null),e))),iG}async function iZ(){let e=document.querySelectorAll('script[type="systemjs-importmap"]'),t=[],n=!0;for(let r=0;r<e.length;r++){let o=e[r];try{if(o.src){let e=await fetch(o.src);if(!e.ok)throw Error(`Request for ${o.src} returned ${e.status} ${e.statusText}`);t.push(await e.json())}else o.textContent&&t.push(JSON.parse(o.textContent))}catch(e){n=!1,console.warn(`[import-maps] Failed to parse import map from script tag at index ${r}`,e)}}return{map:iY(t),complete:n}}function iY(e){let t={imports:{}};for(let n of e)n?.imports&&Object.assign(t.imports,n.imports);return t}function iJ(){let e={};try{let t=i2();for(let n=0;n<localStorage.length;n++){let r=localStorage.key(n);if(r?.startsWith(iU)){let n=r.slice(iU.length);if(!t.includes(n)){let t=localStorage.getItem(r);t&&(e[n]=t)}}}}catch(e){console.warn("[import-maps] Failed to read import-map overrides from localStorage",e)}return{imports:e}}async function iQ(){let e=await iq();return iz?iY([e,iH??iJ()]):e}async function iX(){return iq()}async function i0(){return iz?iY([await iq(),iJ()]):iq()}function i1(e){if(!iz)return{imports:{}};if(e){let e={};for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);if(n?.startsWith(iU)){let t=localStorage.getItem(n);t&&(e[n.slice(iU.length)]=t)}}return{imports:e}}return iJ()}function i2(){if(!iz)return[];try{let e=localStorage.getItem(iW);if(e){let t=JSON.parse(e);if(Array.isArray(t))return t}}catch{}return[]}function i4(e){return!!iz&&i2().includes(e)}function i3(e,t){if(!iz)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{localStorage.setItem(iU+e,t),window.dispatchEvent(new CustomEvent(iK))}catch(e){console.warn("[import-maps] Failed to write import-map override to localStorage",e)}}function i6(e){if(!iz)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{localStorage.removeItem(iU+e);let t=i2().filter(t=>t!==e);t.length>0?localStorage.setItem(iW,JSON.stringify(t)):localStorage.removeItem(iW),window.dispatchEvent(new CustomEvent(iK))}catch(e){console.warn("[import-maps] Failed to update import-map overrides in localStorage",e)}}function i5(){if(!iz)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n?.startsWith(iU)&&e.push(n)}e.forEach(e=>localStorage.removeItem(e)),localStorage.removeItem(iW),window.dispatchEvent(new CustomEvent(iK))}catch(e){console.warn("[import-maps] Failed to clear import-map overrides from localStorage",e)}}function i7(e){if(!iz)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{let t=i2().filter(t=>t!==e);t.length>0?localStorage.setItem(iW,JSON.stringify(t)):localStorage.removeItem(iW),window.dispatchEvent(new CustomEvent(iK))}catch(e){console.warn("[import-maps] Failed to update import-map overrides in localStorage",e)}}let i9=!1;function i8(){!i9&&(i9=!0,(iz="development"===window.spaEnv)&&(iH=iJ()))}function ae(e){return e.replace(/[\/\-@]/g,"_")}async function at(e,t="./start",r){var o;let i,a=!r?.maxLoadingTime||r.maxLoadingTime<=0?6e5:r.maxLoadingTime;await Promise.race([an(e,r?.importMap),new Promise((t,n)=>{i=setTimeout(()=>{var t;n(Error(`Could not resolve requested script, ${e}, within ${(t=a)<1e3?`${t} milliseconds`:t<6e4?`${Math.floor(t/1e3)} seconds`:t<36e5?`${Math.floor(t/6e4)} minutes`:t<864e5?`${Math.floor(t/36e5)} hours`:`${Math.floor(t/864e5)} days`}.`))},a)})]),i&&clearTimeout(i);let s=ae(e),l=window[s];if(!("object"==typeof(o=l)&&null!==o&&"init"in o&&"function"==typeof o.init&&"get"in o&&"function"==typeof o.get)){let e=`The global variable ${s} does not refer to a federated module`;throw console.error(e),Error(e)}l.init(n.S.default);let u=(await l.get(t))();if("object"!=typeof u||null===u){let t=`Container for ${e} did not return an ESM module as expected`;throw console.error(t),Error(t)}return u}async function an(e,t){if("string"!=typeof e||0===e.trim().length){let e="Attempted to call importDynamic() without supplying a package to load";throw console.error(e),Error(e)}let n=ae(e);if(!window[n]){let n=t??await ar();if(!n.imports.hasOwnProperty(e)){let t=`Could not find the package ${e} defined in the current importmap`;throw console.error(t),Error(t)}let r=n.imports[e];r.startsWith("./")&&(r=window.spaBase+r.substring(1));let o=e in i1().imports;try{return await function(e){var t;let n=(t=window)[ao]??(t[ao]=new Map),r=n.get(e);if(r)return r;if(document.head.querySelector(`script[src="${e}"]`))return console.warn(`Script at ${e} already loaded. Not loading it again.`),Promise.resolve();let o=document.createElement("script");o.src=e,o.type="text/javascript",o.async=!0;let i=new Promise((t,r)=>{let i=setTimeout(()=>{console.error(`The script at ${e} did not load within 5 seconds. This may indicate an issue with the imports in the script's entry-point file or with the script's bundler configuration.`)},5e3);function a(){clearTimeout(i),o.removeEventListener("load",s),o.removeEventListener("error",l)}function s(){a(),t()}function l(t){a(),n.delete(e),o.remove();let i=`Failed to load script from ${e}`;console.error(i,t),r(t.message??i)}o.addEventListener("load",s),o.addEventListener("error",l),document.head.appendChild(o)});return n.set(e,i),i}(r)}catch(e){return o&&T({kind:"error",title:iV("scriptLoadingFailed","Error: Script failed to load"),description:iV("scriptLoadingError","Failed to load overridden script from {{- url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",{url:r}),actionButtonLabel:iV("resetOverrides","Reset overrides"),onActionButtonClick(){i5(),window.location.reload()}}),Promise.reject(e)}}return Promise.resolve()}async function ar(){return iQ()}let ao=Symbol.for("__openmrs_script_loading");function ai(e){return!!e&&"object"==typeof e&&!(Object.hasOwn(e,"pages")&&(!e.pages||!Array.isArray(e.pages))||Object.hasOwn(e,"extensions")&&(!e.extensions||!Array.isArray(e.extensions))||Object.hasOwn(e,"workspaces")&&(!e.workspaces||!Array.isArray(e.workspaces))||Object.hasOwn(e,"modals")&&(!e.modals||!Array.isArray(e.modals)))}function aa(e){return!!e&&"object"==typeof e&&"routes"in e&&!!e.routes&&"object"==typeof e.routes&&Object.entries(e.routes).every(([e,t])=>"string"==typeof e&&ai(t))}let as="openmrs-routes:",al="openmrs-routes:change",au=!1,ac=null,ad=null;async function af(){return ad??(ad=ap().then(({map:e,complete:t})=>(t||(ad=null),e))),ad}async function ap(){let e=document.querySelectorAll("script[type='openmrs-routes']"),t=[],n=!0;for(let r=0;r<e.length;r++){let o=e[r];try{let e;if(o.src){let t=await fetch(o.src);if(!t.ok)throw Error(`Request for ${o.src} returned ${t.status} ${t.statusText}`);e=await t.json()}else o.textContent&&(e=JSON.parse(o.textContent));e&&aa(e)&&t.push(e)}catch(e){n=!1,console.warn(`[route-maps] Failed to parse routes from script tag at index ${r}`,e)}}return{map:ah(t),complete:n}}function ah(e){let t={routes:{}};for(let n of e)n&&"object"==typeof n&&!Array.isArray(n)&&(Object.assign(t.routes,n.routes),void 0===t.version&&void 0!==n.version&&(t.version=n.version));return t}async function am(){let e={version:void 0,routes:{}};try{let t=[];for(let e=0;e<localStorage.length;e++){let n=localStorage.key(e);if(n?.startsWith(as)){let e=localStorage.getItem(n);e&&t.push({moduleName:n.slice(as.length),raw:e})}}for(let n of(await Promise.allSettled(t.map(async({moduleName:e,raw:t})=>{let n=JSON.parse(t);if(ai(n))return{moduleName:e,routes:n};if("string"==typeof n&&n.startsWith("http")){let t=await fetch(n),r=await t.json();if(ai(r))return{moduleName:e,routes:r};throw Error(`${n} did not resolve to a valid OpenmrsAppRoutes object`)}throw Error(`Override for ${e} is neither a valid routes object nor a URL`)}))))"fulfilled"===n.status?e.routes[n.value.moduleName]=n.value.routes:console.warn("[route-maps] Failed to load route override",n.reason)}catch(e){console.warn("[route-maps] Failed to read route overrides from localStorage",e)}return e}async function ay(){let e=await af();return au?ah([e,ac??await am()]):e}async function ag(){return af()}async function ab(){return au?ah([await af(),await am()]):af()}function av(){if(!au)return{};let e={};try{for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);if(n?.startsWith(as)){let t=localStorage.getItem(n);t&&(e[n.slice(as.length)]=t)}}}catch(e){console.warn("[route-maps] Failed to read route overrides from localStorage",e)}return e}function aw(e,t){if(!au)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{if("string"==typeof t)if(t.startsWith("http"))localStorage.setItem(as+e,JSON.stringify(t));else{let n=JSON.parse(t);if(!ai(n))return void console.error(`The supplied routes for ${e} is not a valid OpenmrsAppRoutes object`,t);localStorage.setItem(as+e,JSON.stringify(n))}else if(t instanceof URL)localStorage.setItem(as+e,JSON.stringify(t.toString()));else{if(!ai(t))return void console.error(`Override for ${e} is not in a valid format. Expected either a Javascript Object, a JSON string of a Javascript object, or a URL`,t);localStorage.setItem(as+e,JSON.stringify(t))}window.dispatchEvent(new CustomEvent(al))}catch(e){console.warn("[route-maps] Failed to write route override to localStorage",e)}}function a_(e){if(!au)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{localStorage.removeItem(as+e),window.dispatchEvent(new CustomEvent(al))}catch(e){console.warn("[route-maps] Failed to remove route override from localStorage",e)}}function ax(){if(!au)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n?.startsWith(as)&&e.push(n)}e.forEach(e=>localStorage.removeItem(e)),window.dispatchEvent(new CustomEvent(al))}catch(e){console.warn("[route-maps] Failed to clear route overrides from localStorage",e)}}let aS=null;function aE(){return aS||(aS=(au="development"===window.spaEnv)?am().then(e=>{ac=e}):Promise.resolve())}let aD=`${oM}/attachment`;function aO(e,t){return oF(`${aD}/${e}`,{signal:t.signal})}function ak(e,t,n,r){return oF(aP(e,t,r),{signal:n.signal})}function aP(e,t,n){return n?`${aD}?patient=${e}&encounter=${n}`:`${aD}?patient=${e}&includeEncounterless=${t}`}async function aC(e,t,n){let r=new FormData;return r.append("fileCaption",t.fileDescription),r.append("patient",e),n&&r.append("encounter",n),t.file?r.append("file",t.file,t.fileName):(r.append("file",new File([""],t.fileName),t.fileName),r.append("base64Content",t.base64Content)),oF(`${aD}`,{method:"POST",body:r})}function aj(e,t){return oF(`${aD}/${e}`,{method:"DELETE",signal:t.signal})}try{self["workbox:window:6.5.4"]&&_()}catch(e){}function aT(e,t){return new Promise(function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])})}function aR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function aA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}try{self["workbox:core:6.5.4"]&&_()}catch(e){}var aN=function(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n})};function aM(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href}var aI=function(e,t){this.type=e,Object.assign(this,t)};function a$(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function aL(){}var aF={type:"SKIP_WAITING"};function aB(e,t){if(!t)return e&&e.then?e.then(aL):Promise.resolve()}var aV=function(e){function t(t,n){var r,o;return void 0===n&&(n={}),(r=e.call(this)||this).nn={},r.tn=0,r.rn=new aN,r.en=new aN,r.on=new aN,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!aM(t.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=t,e.removeEventListener("updatefound",r.cn)):(r.hn=t,r.an.add(t),r.rn.resolve(t)),++r.tn,t.addEventListener("statechange",r.ln)},r.ln=function(e){var t=r.fn,n=e.target,o=n.state,i=n===r.vn,a={sw:n,isExternal:i,originalEvent:e};!i&&r.mn&&(a.isUpdate=!0),r.dispatchEvent(new aI(o,a)),"installed"===o?r.wn=self.setTimeout(function(){"installed"===o&&t.waiting===n&&r.dispatchEvent(new aI("waiting",a))},200):"activating"===o&&(clearTimeout(r.wn),i||r.en.resolve(n))},r.dn=function(e){var t=r.hn,n=t!==navigator.serviceWorker.controller;r.dispatchEvent(new aI("controlling",{isExternal:n,originalEvent:e,sw:t,isUpdate:r.mn})),n||r.on.resolve(t)},o=function(e){var t=e.data,n=e.ports,o=e.source;return a$(r.getSW(),function(){r.an.has(o)&&r.dispatchEvent(new aI("message",{data:t,originalEvent:e,ports:n,sw:o}))})},r.gn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(o.apply(this,e))}catch(e){return Promise.reject(e)}},r.sn=t,r.nn=n,navigator.serviceWorker.addEventListener("message",r.gn),r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n,r,o=t.prototype;return o.register=function(e){var t=(void 0===e?{}:e).immediate,n=void 0!==t&&t;try{var r,o,i,a=this;return r=function(){if(!n&&"complete"!==document.readyState)return aB(new Promise(function(e){return window.addEventListener("load",e)}))},o=function(){return a.mn=!!navigator.serviceWorker.controller,a.yn=a.pn(),a$(a.bn(),function(e){a.fn=e,a.yn&&(a.hn=a.yn,a.en.resolve(a.yn),a.on.resolve(a.yn),a.yn.addEventListener("statechange",a.ln,{once:!0}));var t=a.fn.waiting;return t&&aM(t.scriptURL,a.sn.toString())&&(a.hn=t,Promise.resolve().then(function(){a.dispatchEvent(new aI("waiting",{sw:t,wasWaitingBeforeRegister:!0}))}).then(function(){})),a.hn&&(a.rn.resolve(a.hn),a.an.add(a.hn)),a.fn.addEventListener("updatefound",a.cn),navigator.serviceWorker.addEventListener("controllerchange",a.dn),a.fn})},(i=r())&&i.then?i.then(o):o(i)}catch(e){return Promise.reject(e)}},o.update=function(){try{return this.fn?aB(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},o.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},o.messageSW=function(e){try{return a$(this.getSW(),function(t){return aT(t,e)})}catch(e){return Promise.reject(e)}},o.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&aT(this.fn.waiting,aF)},o.pn=function(){var e=navigator.serviceWorker.controller;return e&&aM(e.scriptURL,this.sn.toString())?e:void 0},o.bn=function(){try{var e=this;return function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}(function(){return a$(navigator.serviceWorker.register(e.sn,e.nn),function(t){return e.un=performance.now(),t})},function(e){throw e})}catch(e){return Promise.reject(e)}},n=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}],aR(t.prototype,n),r&&aR(t,r),t}(function(){function e(){this.Pn=new Map}var t=e.prototype;return t.addEventListener=function(e,t){this.Sn(e).add(t)},t.removeEventListener=function(e,t){this.Sn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,n=function(e){var t;if("u"<typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return aA(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?aA(e,void 0):void 0}}(e))){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}(this.Sn(e.type));!(t=n()).done;)(0,t.value)(e)},t.Sn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}());function aU(e,t){if(void 0!==f)return console.warn(`The application's Service Worker has already been registered. The new service worker at ${e} will not be registered.`),f;if(!("serviceWorker"in navigator))throw Error("Registering the Service Worker is not possible due to missing browser capabilities.");let n=new aV(e,t);return f=n.register().then(()=>n.controlling.then(()=>n))}function aW(){return f??Promise.resolve(void 0)}let aK="x-omrs-offline-response-body",az="x-omrs-offline-response-status",aH="x-omrs-offline-caching-strategy";async function aG(e){let t=await aW();return t?await t.messageSW(e):{success:!1,result:void 0,error:"No service worker has been registered. This is typically the case when the application has been built without offline-related features."}}async function aq(){let e=window.sessionStorage;try{e.setItem("someKeyHere","test"),e.removeItem("someKeyHere")}catch(t){if(t.code===DOMException.QUOTA_EXCEEDED_ERR&&0===e.length)return!0}return!1}async function aZ(){return!window.indexedDB}async function aY(){return new Promise(e=>{let t=indexedDB.open("test");t.onerror=()=>e(!0),t.onsuccess=()=>e(!1)})}async function aJ(){return await aY()||await aZ()||await aq()}let aQ="openmrs3:offline-mode",aX="unavailable";function a0(){return{current:aX,notAvailable:"unavailable"===aX,active:"on"===aX}}function a1(e){"unavailable"!==aX&&"unavailable"!==e&&(localStorage.setItem(aQ,"on"===e?"active":"disabled"),aX=e)}async function a2(){await aJ()||(aX="active"===localStorage.getItem(aQ)?"on":"off"),navigator.onLine}let a4="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,a3=Object.keys,a6=Array.isArray;function a5(e,t){return"object"!=typeof t||a3(t).forEach(function(n){e[n]=t[n]}),e}"u"<typeof Promise||a4.Promise||(a4.Promise=Promise);let a7=Object.getPrototypeOf,a9={}.hasOwnProperty;function a8(e,t){return a9.call(e,t)}function se(e,t){"function"==typeof t&&(t=t(a7(e))),("u"<typeof Reflect?a3:Reflect.ownKeys)(t).forEach(n=>{sn(e,n,t[n])})}let st=Object.defineProperty;function sn(e,t,n,r){st(e,t,a5(n&&a8(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function sr(e){return{from:function(t){return e.prototype=Object.create(t.prototype),sn(e.prototype,"constructor",e),{extend:se.bind(null,e.prototype)}}}}let so=Object.getOwnPropertyDescriptor;function si(e,t){let n;return so(e,t)||(n=a7(e))&&si(n,t)}let sa=[].slice;function ss(e,t,n){return sa.call(e,t,n)}function sl(e,t){return t(e)}function su(e){if(!e)throw Error("Assertion Failed")}function sc(e){a4.setImmediate?setImmediate(e):setTimeout(e,0)}function sd(e,t){return e.reduce((e,n,r)=>{var o=t(n,r);return o&&(e[o[0]]=o[1]),e},{})}function sf(e,t){if(a8(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,o=t.length;r<o;++r){var i=sf(e,t[r]);n.push(i)}return n}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return void 0===s?void 0:sf(s,t.substr(a+1))}}function sp(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){su("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)sp(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var a=t.substr(0,i),s=t.substr(i+1);if(""===s)void 0===n?a6(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n;else{var l=e[a];l&&a8(e,a)||(l=e[a]={}),sp(l,s,n)}}else void 0===n?a6(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function sh(e){var t={};for(var n in e)a8(e,n)&&(t[n]=e[n]);return t}let sm=[].concat;function sy(e){return sm.apply([],e)}let sg="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(sy([8,16,32,64].map(e=>["Int","Uint","Float"].map(t=>t+e+"Array")))).filter(e=>a4[e]),sb=sg.map(e=>a4[e]);sd(sg,e=>[e,!0]);let sv=null;function sw(e){sv="u">typeof WeakMap&&new WeakMap;let t=function e(t){if(!t||"object"!=typeof t)return t;let n=sv&&sv.get(t);if(n)return n;if(a6(t)){n=[],sv&&sv.set(t,n);for(var r=0,o=t.length;r<o;++r)n.push(e(t[r]))}else if(sb.indexOf(t.constructor)>=0)n=t;else{let r=a7(t);for(var i in n=r===Object.prototype?{}:Object.create(r),sv&&sv.set(t,n),t)a8(t,i)&&(n[i]=e(t[i]))}return n}(e);return sv=null,t}let{toString:s_}={};function sx(e){return s_.call(e).slice(8,-1)}let sS="u">typeof Symbol?Symbol.iterator:"@@iterator",sE="symbol"==typeof sS?function(e){var t;return null!=e&&(t=e[sS])&&t.apply(e)}:function(){return null},sD={};function sO(e){var t,n,r,o;if(1==arguments.length){if(a6(e))return e.slice();if(this===sD&&"string"==typeof e)return[e];if(o=sE(e)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=Array(t);t--;)n[t]=arguments[t];return n}let sk="u">typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var sP="u">typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),sC=()=>!0;let sj=!Error("").stack;function sT(){if(sj)try{throw sT.arguments,Error()}catch(e){return e}return Error()}function sR(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(sC).map(e=>"\n"+e).join("")):""}var sA=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],sN=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(sA),sM={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function sI(e,t){this._e=sT(),this.name=e,this.message=t}function s$(e,t){return e+". Errors: "+Object.keys(t).map(e=>t[e].toString()).filter((e,t,n)=>n.indexOf(e)===t).join("\n")}function sL(e,t,n,r){this._e=sT(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=s$(e,t)}function sF(e,t){this._e=sT(),this.name="BulkError",this.failures=Object.keys(t).map(e=>t[e]),this.failuresByPos=t,this.message=s$(e,t)}sr(sI).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+sR(this._e,2))}},toString:function(){return this.name+": "+this.message}}),sr(sL).from(sI),sr(sF).from(sI);var sB=sN.reduce((e,t)=>(e[t]=t+"Error",e),{}),sV=sN.reduce((e,t)=>{var n=t+"Error";function r(e,r){this._e=sT(),this.name=n,e?"string"==typeof e?(this.message=`${e}${r?"\n "+r:""}`,this.inner=r||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=sM[t]||n,this.inner=null)}return sr(r).from(sI),e[t]=r,e},{});sV.Syntax=SyntaxError,sV.Type=TypeError,sV.Range=RangeError;var sU=sA.reduce((e,t)=>(e[t+"Error"]=sV[t],e),{}),sW=sN.reduce((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=sV[t]),e),{});function sK(){}function sz(e){return e}function sH(e,t){return null==e||e===sz?t:function(n){return t(e(n))}}function sG(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function sq(e,t){return e===sK?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?sG(r,this.onsuccess):r),o&&(this.onerror=this.onerror?sG(o,this.onerror):o),void 0!==i?i:n}}function sZ(e,t){return e===sK?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?sG(n,this.onsuccess):n),r&&(this.onerror=this.onerror?sG(r,this.onerror):r)}}function sY(e,t){return e===sK?t:function(n){var r=e.apply(this,arguments);a5(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?sG(o,this.onsuccess):o),i&&(this.onerror=this.onerror?sG(i,this.onerror):i),void 0===r?void 0===a?void 0:a:a5(r,a)}}function sJ(e,t){return e===sK?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function sQ(e,t){return e===sK?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,o=arguments.length,i=Array(o);o--;)i[o]=arguments[o];return n.then(function(){return t.apply(r,i)})}return t.apply(this,arguments)}}sW.ModifyError=sL,sW.DexieError=sI,sW.BulkError=sF;var sX={};let[s0,s1,s2]="u"<typeof Promise?[]:(()=>{let e=Promise.resolve();if("u"<typeof crypto||!crypto.subtle)return[e,a7(e),e];let t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,a7(t),e]})(),s4=s1&&s1.then,s3=s0&&s0.constructor,s6=!!s2;var s5=!1,s7=s2?()=>{s2.then(lb)}:a4.setImmediate?setImmediate.bind(null,lb):a4.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver(()=>{lb(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(lb,0)},s9=function(e,t){ls.push([e,t]),le&&(s7(),le=!1)},s8=!0,le=!0,lt=[],ln=[],lr=null,lo=sz,li={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:lV,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(e=>{try{lV(e[0],e[1])}catch(e){}})}},la=li,ls=[],ll=0,lu=[];function lc(e){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=sK,this._lib=!1;var t=this._PSD=la;if(sP&&(this._stackHolder=sT(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==sX)throw TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&lp(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,n){try{n(n=>{if(null===t._state){if(n===t)throw TypeError("A promise cannot be resolved with itself.");var r=t._lib&&lv();n&&"function"==typeof n.then?e(t,(e,t)=>{n instanceof lc?n._then(e,t):n.then(e,t)}):(t._state=!0,t._value=n,lh(t)),r&&lw()}},lp.bind(null,t))}catch(e){lp(t,e)}}(this,e)}let ld={get:function(){var e=la,t=lP;function n(n,r){var o=!e.global&&(e!==la||t!==lP);let i=o&&!lR();var a=new lc((t,a)=>{lm(this,new lf(lF(n,e,o,i),lF(r,e,o,i),t,a,e))});return sP&&lg(a,this),a}return n.prototype=sX,n},set:function(e){sn(this,"then",e&&e.prototype===sX?ld:{get:function(){return e},set:ld.set})}};function lf(e,t,n,r,o){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=o}function lp(e,t){if(ln.push(t),null===e._state){var n=e._lib&&lv();t=lo(t),e._state=!1,e._value=t,sP&&null!==t&&"object"==typeof t&&!t._promise&&function(e){try{e.apply(null,void 0)}catch(e){}}(()=>{var n=si(t,"stack");t._promise=e,sn(t,"stack",{get:()=>s5?n&&(n.get?n.get.apply(t):n.value):e.stack})}),lt.some(t=>t._value===e._value)||lt.push(e),lh(e),n&&lw()}}function lh(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)lm(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===ll&&(++ll,s9(()=>{0==--ll&&l_()},[]))}function lm(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++ll,s9(ly,[n,e,t])}else e._listeners.push(t)}function ly(e,t,n){try{lr=t;var r,o=t._value;t._state?r=e(o):(ln.length&&(ln=[]),r=e(o),-1===ln.indexOf(o)&&function(e){for(var t=lt.length;t;)if(lt[--t]._value===e._value)return void lt.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{lr=null,0==--ll&&l_(),--n.psd.ref||n.psd.finalize()}}function lg(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function lb(){lv()&&lw()}function lv(){var e=s8;return s8=!1,le=!1,e}function lw(){var e,t,n;do for(;ls.length>0;)for(e=ls,ls=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}while(ls.length>0);s8=!0,le=!0}function l_(){var e=lt;lt=[],e.forEach(e=>{e._PSD.onunhandled.call(null,e._value,e)});for(var t=lu.slice(0),n=t.length;n;)t[--n]()}function lx(e){return new lc(sX,!1,e)}function lS(e,t){var n=la;return function(){var r=lv(),o=la;try{return lI(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{lI(o,!1),r&&lw()}}}se(lc.prototype,{then:ld,_then:function(e,t){lm(this,new lf(null,null,e,t,la))},catch:function(e){if(1==arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,e=>e instanceof t?n(e):lx(e)):this.then(null,e=>e&&e.name===t?n(e):lx(e))},finally:function(e){return this.then(t=>(e(),t),t=>(e(),lx(t)))},stack:{get:function(){if(this._stack)return this._stack;try{s5=!0;var e=(function e(t,n,r){if(n.length===r)return n;var o="";if(!1===t._state){var i,a,s=t._value;null!=s?(i=s.name||"Error",a=s.message||s,o=sR(s,0)):(i=s,a=""),n.push(i+(a?": "+a:"")+o)}return sP&&((o=sR(t._stackHolder,2))&&-1===n.indexOf(o)&&n.push(o),t._prev&&e(t._prev,n,r)),n})(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{s5=!1}}},timeout:function(e,t){return e<1/0?new lc((n,r)=>{var o=setTimeout(()=>r(new sV.Timeout(t)),e);this.then(n,r).finally(clearTimeout.bind(null,o))}):this}}),"u">typeof Symbol&&Symbol.toStringTag&&sn(lc.prototype,Symbol.toStringTag,"Dexie.Promise"),li.env=l$(),se(lc,{all:function(){var e=sO.apply(null,arguments).map(lA);return new lc(function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((o,i)=>lc.resolve(o).then(n=>{e[i]=n,--r||t(e)},n))})},resolve:e=>{if(e instanceof lc)return e;if(e&&"function"==typeof e.then)return new lc((t,n)=>{e.then(t,n)});var t=new lc(sX,!0,e);return lg(t,lr),t},reject:lx,race:function(){var e=sO.apply(null,arguments).map(lA);return new lc((t,n)=>{e.map(e=>lc.resolve(e).then(t,n))})},PSD:{get:()=>la,set:e=>la=e},totalEchoes:{get:()=>lP},newPSD:lj,usePSD:lL,scheduler:{get:()=>s9,set:e=>{s9=e}},rejectionMapper:{get:()=>lo,set:e=>{lo=e}},follow:(e,t)=>new lc((n,r)=>lj((t,n)=>{var r=la;r.unhandleds=[],r.onunhandled=n,r.finalize=sG(function(){var e;e=()=>{0===this.unhandleds.length?t():n(this.unhandleds[0])},lu.push(function t(){e(),lu.splice(lu.indexOf(t),1)}),++ll,s9(()=>{0==--ll&&l_()},[])},r.finalize),e()},t,n,r))}),s3&&(s3.allSettled&&sn(lc,"allSettled",function(){let e=sO.apply(null,arguments).map(lA);return new lc(t=>{0===e.length&&t([]);let n=e.length,r=Array(n);e.forEach((e,o)=>lc.resolve(e).then(e=>r[o]={status:"fulfilled",value:e},e=>r[o]={status:"rejected",reason:e}).then(()=>--n||t(r)))})}),s3.any&&"u">typeof AggregateError&&sn(lc,"any",function(){let e=sO.apply(null,arguments).map(lA);return new lc((t,n)=>{0===e.length&&n(AggregateError([]));let r=e.length,o=Array(r);e.forEach((e,i)=>lc.resolve(e).then(e=>t(e),e=>{o[i]=e,--r||n(AggregateError(o))}))})}));let lE={awaits:0,echoes:0,id:0};var lD=0,lO=[],lk=0,lP=0,lC=0;function lj(e,t,n,r){var o=la,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++lC;var a=li.env;i.env=s6?{Promise:lc,PromiseProp:{value:lc,configurable:!0,writable:!0},all:lc.all,race:lc.race,allSettled:lc.allSettled,any:lc.any,resolve:lc.resolve,reject:lc.reject,nthen:lB(a.nthen,i),gthen:lB(a.gthen,i)}:{},t&&a5(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=lL(i,e,n,r);return 0===i.ref&&i.finalize(),s}function lT(){return lE.id||(lE.id=++lD),++lE.awaits,lE.echoes+=100,lE.id}function lR(){return!!lE.awaits&&(0==--lE.awaits&&(lE.id=0),lE.echoes=100*lE.awaits,!0)}function lA(e){return lE.echoes&&e&&e.constructor===s3?(lT(),e.then(e=>(lR(),e),e=>(lR(),lU(e)))):e}function lN(e){++lP,lE.echoes&&0!=--lE.echoes||(lE.echoes=lE.id=0),lO.push(la),lI(e,!0)}function lM(){var e=lO[lO.length-1];lO.pop(),lI(e,!1)}function lI(e,t){var n,r=la;if((t?!lE.echoes||lk++&&e===la:!lk||--lk&&e===la)||(n=t?lN.bind(null,e):lM,s4.call(s0,n)),e!==la&&(la=e,r===li&&(li.env=l$()),s6)){var o=li.env.Promise,i=e.env;s1.then=i.nthen,o.prototype.then=i.gthen,(r.global||e.global)&&(Object.defineProperty(a4,"Promise",i.PromiseProp),o.all=i.all,o.race=i.race,o.resolve=i.resolve,o.reject=i.reject,i.allSettled&&(o.allSettled=i.allSettled),i.any&&(o.any=i.any))}}function l$(){var e=a4.Promise;return s6?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(a4,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:s1.then,gthen:e.prototype.then}:{}}function lL(e,t,n,r,o){var i=la;try{return lI(e,!0),t(n,r,o)}finally{lI(i,!1)}}function lF(e,t,n,r){return"function"!=typeof e?e:function(){var o,i=la;n&&lT(),lI(t,!0);try{return e.apply(this,arguments)}finally{lI(i,!1),r&&(o=lR,s4.call(s0,o))}}}function lB(e,t){return function(n,r){return e.call(this,lF(n,t),lF(r,t))}}function lV(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,o={promise:t,reason:e};if(a4.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),a5(r,o)):a4.CustomEvent&&a5(r=new CustomEvent("unhandledrejection",{detail:o}),o),r&&a4.dispatchEvent&&(dispatchEvent(r),!a4.PromiseRejectionEvent&&a4.onunhandledrejection))try{a4.onunhandledrejection(r)}catch(e){}sP&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+s4).indexOf("[native code]")&&(lT=lR=sK);var lU=lc.reject;let lW=String.fromCharCode(65535),lK="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",lz=[],lH="u">typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),lG=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function lq(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}let lZ={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function lY(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=sw(t))[e],t)}class lJ{_trans(e,t,n){let r=this._tx||la.trans,o=this.name;function i(e,n,r){if(!r.schema[o])throw new sV.NotFound("Table "+o+" not part of transaction");return t(r.idbtrans,r)}let a=lv();try{return r&&r.db===this.db?r===la.trans?r._promise(e,i,n):lj(()=>r._promise(e,i,n),{trans:r,transless:la.transless||la}):function e(t,n,r,o){if(t.idbdb&&(t._state.openComplete||la.letThrough||t._vip)){var i=t._createTransaction(n,r,t._dbSchema);try{i.create(),t._state.PR1398_maxLoop=3}catch(i){return i.name===sB.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,n,r,o))):lU(i)}return i._promise(n,(e,t)=>lj(()=>(la.trans=i,o(e,t,i)))).then(e=>i._completion.then(()=>e))}if(t._state.openComplete)return lU(new sV.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return lU(new sV.DatabaseClosed);t.open().catch(sK)}return t._state.dbReadyPromise.then(()=>e(t,n,r,o))}(this.db,e,[this.name],i)}finally{a&&lw()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",t=>this.core.get({trans:t,key:e}).then(e=>this.hook.reading.fire(e))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(a6(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);let t=a3(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);let n=this.schema.indexes.concat(this.schema.primKey).filter(e=>e.compound&&t.every(t=>e.keyPath.indexOf(t)>=0)&&e.keyPath.every(e=>t.indexOf(e)>=0))[0];if(n&&this.db._maxKey!==lW)return this.where(n.name).equals(n.keyPath.map(t=>e[t]));!n&&sP&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);let{idxByName:r}=this.schema,o=this.db._deps.indexedDB;function i(e,t){try{return 0===o.cmp(e,t)}catch(e){return!1}}let[a,s]=t.reduce(([t,n],o)=>{let a=r[o],s=e[o];return[t||a,t||!a?lq(n,a&&a.multi?e=>{let t=sf(e,o);return a6(t)&&t.some(e=>i(s,e))}:e=>i(s,sf(e,o))):n]},[null,null]);return a?this.where(a.name).equals(e[a.keyPath]).filter(s):n?this.filter(s):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,a6(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;let t=t=>{if(!t)return t;let n=Object.create(e.prototype);for(var r in t)if(a8(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}defineClass(){return this.mapToClass(function(e){a5(this,e)})}add(e,t){let{auto:n,keyPath:r}=this.schema.primKey,o=e;return r&&n&&(o=lY(r)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[o]})).then(e=>e.numFailures?lc.reject(e.failures[0]):e.lastResult).then(t=>{if(r)try{sp(e,r,t)}catch(e){}return t})}update(e,t){if("object"!=typeof e||a6(e))return this.where(":id").equals(e).modify(t);{let n=sf(e,this.schema.primKey.keyPath);if(void 0===n)return lU(new sV.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?a3(t).forEach(n=>{sp(e,n,t[n])}):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}}put(e,t){let{auto:n,keyPath:r}=this.schema.primKey,o=e;return r&&n&&(o=lY(r)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"put",values:[o],keys:null!=t?[t]:null})).then(e=>e.numFailures?lc.reject(e.failures[0]):e.lastResult).then(t=>{if(r)try{sp(e,r,t)}catch(e){}return t})}delete(e){return this._trans("readwrite",t=>this.core.mutate({trans:t,type:"delete",keys:[e]})).then(e=>e.numFailures?lc.reject(e.failures[0]):void 0)}clear(){return this._trans("readwrite",e=>this.core.mutate({trans:e,type:"deleteRange",range:lZ})).then(e=>e.numFailures?lc.reject(e.failures[0]):void 0)}bulkGet(e){return this._trans("readonly",t=>this.core.getMany({keys:e,trans:t}).then(e=>e.map(e=>this.hook.reading.fire(e))))}bulkAdd(e,t,n){let r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new sV.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new sV.InvalidArgument("Arguments objects and keys must have the same length");let a=e.length,s=i&&n?e.map(lY(i)):e;return this.core.mutate({trans:t,type:"add",keys:r,values:s,wantResults:o}).then(({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new sF(`${this.name}.bulkAdd(): ${e} of ${a} operations failed`,r)})})}bulkPut(e,t,n){let r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new sV.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new sV.InvalidArgument("Arguments objects and keys must have the same length");let a=e.length,s=i&&n?e.map(lY(i)):e;return this.core.mutate({trans:t,type:"put",keys:r,values:s,wantResults:o}).then(({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new sF(`${this.name}.bulkPut(): ${e} of ${a} operations failed`,r)})})}bulkDelete(e){let t=e.length;return this._trans("readwrite",t=>this.core.mutate({trans:t,type:"delete",keys:e})).then(({numFailures:e,lastResult:n,failures:r})=>{if(0===e)return n;throw new sF(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,r)})}}function lQ(e){var t={},n=function(n,r){if(r){for(var o=arguments.length,i=Array(o-1);--o;)i[o-1]=arguments[o];return t[n].subscribe.apply(null,i),e}if("string"==typeof n)return t[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(e,r,o){if("object"==typeof e){var a;return void a3(a=e).forEach(function(e){var t=a[e];if(a6(t))i(e,a[e][0],a[e][1]);else{if("asap"!==t)throw new sV.InvalidArgument("Invalid event config");var n=i(e,sz,function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach(function(e){sc(function(){e.apply(null,t)})})})}})}r||(r=sJ),o||(o=sK);var s={subscribers:[],fire:o,subscribe:function(e){-1===s.subscribers.indexOf(e)&&(s.subscribers.push(e),s.fire=r(s.fire,e))},unsubscribe:function(e){s.subscribers=s.subscribers.filter(function(t){return t!==e}),s.fire=s.subscribers.reduce(r,o)}};return t[e]=n[e]=s,s}}function lX(e,t){return sr(t).from({prototype:e}),t}function l0(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function l1(e,t){e.filter=lq(e.filter,t)}function l2(e,t,n){var r=e.replayFilter;e.replayFilter=r?()=>lq(r(),t()):t,e.justLimit=n&&!r}function l4(e,t){if(e.isPrimKey)return t.primaryKey;let n=t.getIndexByKeyPath(e.index);if(!n)throw new sV.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function l3(e,t,n){let r=l4(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function l6(e,t,n,r){let o=e.replayFilter?lq(e.filter,e.replayFilter()):e.filter;if(e.or){let i={},a=(e,n,r)=>{if(!o||o(n,r,e=>n.stop(e),e=>n.fail(e))){var a=n.primaryKey,s=""+a;"[object ArrayBuffer]"===s&&(s=""+new Uint8Array(a)),a8(i,s)||(i[s]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(a,n),l5(l3(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return l5(l3(e,r,n),lq(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function l5(e,t,n,r){var o=lS(r?(e,t,o)=>n(r(e),t,o):n);return e.then(e=>{if(e)return e.start(()=>{var n=()=>e.continue();t&&!t(e,e=>n=e,t=>{e.stop(t),n=sK},t=>{e.fail(t),n=sK})||o(e.value,e,e=>n=e),n()})})}function l7(e,t){try{let n=l9(e),r=l9(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){let n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return n===r?0:n<r?-1:1}(l8(e),l8(t));case"Array":return function(e,t){let n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n){let r=l7(e[n],t[n]);if(0!==r)return r}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function l9(e){let t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";let n=sx(e);return"ArrayBuffer"===n?"binary":n}function l8(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class ue{_read(e,t){var n=this._ctx;return n.error?n.table._trans(null,lU.bind(null,n.error)):n.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,lU.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=lq(t.algorithm,e)}_iterate(e,t){return l6(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&a5(n,e),t._ctx=n,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read(n=>l6(t,e,n,t.table.core))}count(e){return this._read(e=>{let t=this._ctx,n=t.table.core;if(l0(t,!0))return n.count({trans:e,query:{index:l4(t,n.schema),range:t.range}}).then(e=>Math.min(e,t.limit));var r=0;return l6(t,()=>(++r,!1),e,n).then(()=>r)}).then(e)}sortBy(e,t){let n=e.split(".").reverse(),r=n[0],o=n.length-1;function i(e,t){return t?i(e[n[t]],t-1):e[r]}var a="next"===this._ctx.dir?1:-1;function s(e,t){var n=i(e,o),r=i(t,o);return n<r?-a:n>r?a:0}return this.toArray(function(e){return e.sort(s)}).then(t)}toArray(e){return this._read(e=>{var t=this._ctx;if("next"===t.dir&&l0(t,!0)&&t.limit>0){let{valueMapper:n}=t,r=l4(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:r,range:t.range}}).then(({result:e})=>n?e.map(n):e)}{let n=[];return l6(t,e=>n.push(e),e,t.table.core).then(()=>n)}},e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,l0(t)?l2(t,()=>{var t=e;return(e,n)=>0===t||(1===t?--t:n(()=>{e.advance(t),t=0}),!1)}):l2(t,()=>{var t=e;return()=>--t<0})),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),l2(this._ctx,()=>{var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}},!0),this}until(e,t){return l1(this._ctx,function(n,r,o){return!e(n.value)||(r(o),t)}),this}first(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)}last(e){return this.reverse().first(e)}filter(e){var t;return l1(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=lq(t.isMatch,e),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.key,n)})}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.primaryKey,n)})}keys(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.key)}).then(function(){return n}).then(e)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&l0(t,!0)&&t.limit>0)return this._read(e=>{var n=l4(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})}).then(({result:e})=>e).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.primaryKey)}).then(function(){return n}).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys(function(e){return e[0]}).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return l1(this._ctx,function(e){var t=e.primaryKey.toString(),r=a8(n,t);return n[t]=!0,!r}),this}modify(e){var t=this._ctx;return this._write(n=>{var r;if("function"==typeof e)r=e;else{var o=a3(e),i=o.length;r=function(t){for(var n=!1,r=0;r<i;++r){var a=o[r],s=e[a];sf(t,a)!==s&&(sp(t,a,s),n=!0)}return n}}let a=t.table.core,{outbound:s,extractKey:l}=a.schema.primaryKey,u=this.db._options.modifyChunkSize||200,c=[],d=0,f=[],p=(e,t)=>{let{failures:n,numFailures:r}=t;for(let t of(d+=e-r,a3(n)))c.push(n[t])};return this.clone().primaryKeys().then(o=>{let i=c=>{let d=Math.min(u,o.length-c);return a.getMany({trans:n,keys:o.slice(c,c+d),cache:"immutable"}).then(f=>{let h=[],m=[],y=s?[]:null,g=[];for(let e=0;e<d;++e){let t=f[e],n={value:sw(t),primKey:o[c+e]};!1!==r.call(n,n.value,n)&&(null==n.value?g.push(o[c+e]):s||0===l7(l(t),l(n.value))?(m.push(n.value),s&&y.push(o[c+e])):(g.push(o[c+e]),h.push(n.value)))}let b=l0(t)&&t.limit===1/0&&("function"!=typeof e||e===ut)&&{index:t.index,range:t.range};return Promise.resolve(h.length>0&&a.mutate({trans:n,type:"add",values:h}).then(e=>{for(let t in e.failures)g.splice(parseInt(t),1);p(h.length,e)})).then(()=>(m.length>0||b&&"object"==typeof e)&&a.mutate({trans:n,type:"put",keys:y,values:m,criteria:b,changeSpec:"function"!=typeof e&&e}).then(e=>p(m.length,e))).then(()=>(g.length>0||b&&e===ut)&&a.mutate({trans:n,type:"delete",keys:g,criteria:b}).then(e=>p(g.length,e))).then(()=>o.length>c+d&&i(c+u))})};return i(0).then(()=>{if(c.length>0)throw new sL("Error modifying one or more objects",c,d,f);return o.length})})})}delete(){var e=this._ctx,t=e.range;return l0(e)&&(e.isPrimKey&&!lH||3===t.type)?this._write(n=>{let{primaryKey:r}=e.table.core.schema;return e.table.core.count({trans:n,query:{index:r,range:t}}).then(r=>e.table.core.mutate({trans:n,type:"deleteRange",range:t}).then(({failures:e,lastResult:t,results:n,numFailures:o})=>{if(o)throw new sL("Could not delete some values",Object.keys(e).map(t=>e[t]),r-o);return r-o}))}):this.modify(ut)}}let ut=(e,t)=>t.value=null;function un(e,t){return e<t?-1:+(e!==t)}function ur(e,t){return e>t?-1:+(e!==t)}function uo(e,t,n){var r=e instanceof uu?new e.Collection(e):e;return r._ctx.error=n?new n(t):TypeError(t),r}function ui(e){return new e.Collection(e,()=>ul("")).limit(0)}function ua(e,t,n,r){var o,i,a,s,l,u,c,d=n.length;if(!n.every(e=>"string"==typeof e))return uo(e,"String expected.");function f(e){o="next"===e?e=>e.toUpperCase():e=>e.toLowerCase(),i="next"===e?e=>e.toLowerCase():e=>e.toUpperCase(),a="next"===e?un:ur;var t=n.map(function(e){return{lower:i(e),upper:o(e)}}).sort(function(e,t){return a(e.lower,t.lower)});s=t.map(function(e){return e.upper}),l=t.map(function(e){return e.lower}),u=e,c="next"===e?"":r}f("next");var p=new e.Collection(e,()=>us(s[0],l[d-1]+r));p._ondirectionchange=function(e){f(e)};var h=0;return p._addAlgorithm(function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var f=i(o);if(t(f,l,h))return!0;for(var p=null,m=h;m<d;++m){var y=function(e,t,n,r,o,i){for(var a=Math.min(e.length,r.length),s=-1,l=0;l<a;++l){var u=t[l];if(u!==r[l])return 0>o(e[l],n[l])?e.substr(0,l)+n[l]+n.substr(l+1):0>o(e[l],r[l])?e.substr(0,l)+r[l]+n.substr(l+1):s>=0?e.substr(0,s)+t[s]+n.substr(s+1):null;0>o(e[l],u)&&(s=l)}return a<r.length&&"next"===i?e+n.substr(e.length):a<e.length&&"prev"===i?e.substr(0,n.length):s<0?null:e.substr(0,s)+r[s]+n.substr(s+1)}(o,f,s[m],l[m],a,u);null===y&&null===p?h=m+1:(null===p||a(p,y)>0)&&(p=y)}return n(null!==p?function(){e.continue(p+c)}:r),!1}),p}function us(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function ul(e){return{type:1,lower:e,upper:e}}class uu{get Collection(){return this._ctx.table.db.Collection}between(e,t,n,r){n=!1!==n,r=!0===r;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?ui(this):new this.Collection(this,()=>us(e,t,!n,!r))}catch(e){return uo(this,lK)}}equals(e){return null==e?uo(this,lK):new this.Collection(this,()=>ul(e))}above(e){return null==e?uo(this,lK):new this.Collection(this,()=>us(e,void 0,!0))}aboveOrEqual(e){return null==e?uo(this,lK):new this.Collection(this,()=>us(e,void 0,!1))}below(e){return null==e?uo(this,lK):new this.Collection(this,()=>us(void 0,e,!1,!0))}belowOrEqual(e){return null==e?uo(this,lK):new this.Collection(this,()=>us(void 0,e))}startsWith(e){return"string"!=typeof e?uo(this,"String expected."):this.between(e,e+lW,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):ua(this,(e,t)=>0===e.indexOf(t[0]),[e],lW)}equalsIgnoreCase(e){return ua(this,(e,t)=>e===t[0],[e],"")}anyOfIgnoreCase(){var e=sO.apply(sD,arguments);return 0===e.length?ui(this):ua(this,(e,t)=>-1!==t.indexOf(e),e,"")}startsWithAnyOfIgnoreCase(){var e=sO.apply(sD,arguments);return 0===e.length?ui(this):ua(this,(e,t)=>t.some(t=>0===e.indexOf(t)),e,lW)}anyOf(){let e=sO.apply(sD,arguments),t=this._cmp;try{e.sort(t)}catch(e){return uo(this,lK)}if(0===e.length)return ui(this);let n=new this.Collection(this,()=>us(e[0],e[e.length-1]));n._ondirectionchange=n=>{t="next"===n?this._ascending:this._descending,e.sort(t)};let r=0;return n._addAlgorithm((n,o,i)=>{let a=n.key;for(;t(a,e[r])>0;)if(++r===e.length)return o(i),!1;return 0===t(a,e[r])||(o(()=>{n.continue(e[r])}),!1)}),n}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){let e=sO.apply(sD,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return uo(this,lK)}let t=e.reduce((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]],null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,t){let n=this._cmp,r=this._ascending,o=this._descending,i=this._min,a=this._max;if(0===e.length)return ui(this);if(!e.every(e=>void 0!==e[0]&&void 0!==e[1]&&0>=r(e[0],e[1])))return uo(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",sV.InvalidArgument);let s=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,u,c=r;function d(e,t){return c(e[0],t[0])}try{(u=e.reduce(function(e,t){let r=0,o=e.length;for(;r<o;++r){let o=e[r];if(0>n(t[0],o[1])&&n(t[1],o[0])>0){o[0]=i(o[0],t[0]),o[1]=a(o[1],t[1]);break}}return r===o&&e.push(t),e},[])).sort(d)}catch(e){return uo(this,lK)}let f=0,p=l?e=>r(e,u[f][1])>0:e=>r(e,u[f][1])>=0,h=s?e=>o(e,u[f][0])>0:e=>o(e,u[f][0])>=0,m=p,y=new this.Collection(this,()=>us(u[0][0],u[u.length-1][1],!s,!l));return y._ondirectionchange=e=>{"next"===e?(m=p,c=r):(m=h,c=o),u.sort(d)},y._addAlgorithm((e,t,n)=>{for(var o=e.key;m(o);)if(++f===u.length)return t(n),!1;return!!(!p(o)&&!h(o))||(0===this._cmp(o,u[f][1])||0===this._cmp(o,u[f][0])||t(()=>{c===r?e.continue(u[f][0]):e.continue(u[f][1])}),!1)}),y}startsWithAnyOf(){let e=sO.apply(sD,arguments);return e.every(e=>"string"==typeof e)?0===e.length?ui(this):this.inAnyRange(e.map(e=>[e,e+lW])):uo(this,"startsWithAnyOf() only works with strings")}}function uc(e){return lS(function(t){return ud(t),e(t.target.error),!1})}function ud(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}let uf=lQ(null,"storagemutated");class up{_lock(){return su(!la.global),++this._reculock,1!==this._reculock||la.global||(la.lockOwnerFor=this),this}_unlock(){if(su(!la.global),0==--this._reculock)for(la.global||(la.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{lL(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&la.lockOwnerFor!==this}create(e){if(!this.mode)return this;let t=this.db.idbdb,n=this.db._state.dbOpenError;if(su(!this.idbtrans),!e&&!t)switch(n&&n.name){case"DatabaseClosedError":throw new sV.DatabaseClosed(n);case"MissingAPIError":throw new sV.MissingAPI(n.message,n);default:throw new sV.OpenFailed(n)}if(!this.active)throw new sV.TransactionInactive;return su(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=lS(t=>{ud(t),this._reject(e.error)}),e.onabort=lS(t=>{ud(t),this.active&&this._reject(new sV.Abort(e.error)),this.active=!1,this.on("abort").fire(t)}),e.oncomplete=lS(()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&uf.storagemutated.fire(e.mutatedParts)}),this}_promise(e,t,n){if("readwrite"===e&&"readwrite"!==this.mode)return lU(new sV.ReadOnly("Transaction is readonly"));if(!this.active)return lU(new sV.TransactionInactive);if(this._locked())return new lc((r,o)=>{this._blockedFuncs.push([()=>{this._promise(e,t,n).then(r,o)},la])});if(n)return lj(()=>{var e=new lc((e,n)=>{this._lock();let r=t(e,n,this);r&&r.then&&r.then(e,n)});return e.finally(()=>this._unlock()),e._lib=!0,e});var r=new lc((e,n)=>{var r=t(e,n,this);r&&r.then&&r.then(e,n)});return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();let n=lc.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then(()=>n);else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var o=t._waitingFor;return new lc((e,r)=>{n.then(n=>t._waitingQueue.push(lS(e.bind(null,n))),e=>t._waitingQueue.push(lS(r.bind(null,e)))).finally(()=>{t._waitingFor===o&&(t._waitingFor=null)})})}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new sV.Abort))}table(e){let t=this._memoizedTables||(this._memoizedTables={});if(a8(t,e))return t[e];let n=this.schema[e];if(!n)throw new sV.NotFound("Table "+e+" not part of transaction");let r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}}function uh(e,t,n,r,o,i,a){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+um(t)}}function um(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function uy(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:sd(n,e=>[e.name,e])}}let ug=e=>{try{return e.only([[]]),ug=()=>[[]],[[]]}catch(e){return ug=()=>lW,lW}};function ub(e){return null==e?()=>{}:"string"==typeof e?1===e.split(".").length?t=>t[e]:t=>sf(t,e):t=>sf(t,e)}function uv(e){return[].slice.call(e)}let uw=0;function u_(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function ux({_novip:e},t){let n=t.db,r=function(e,t,{IDBKeyRange:n,indexedDB:r},o){var i;return{dbcore:(i=function(e,t,n){let r;function o(e){if(3===e.type)return null;if(4===e.type)throw Error("Cannot convert never type to IDBKeyRange");let{lower:n,upper:r,lowerOpen:o,upperOpen:i}=e;return void 0===n?void 0===r?null:t.upperBound(r,!!i):void 0===r?t.lowerBound(n,!!o):t.bound(n,r,!!o,!!i)}let{schema:i,hasGetAll:a}=(r=uv(e.objectStoreNames),{schema:{name:e.name,tables:r.map(e=>n.objectStore(e)).map(e=>{let{keyPath:t,autoIncrement:n}=e,r=a6(t),o=null==t,i={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:ub(t)},indexes:uv(e.indexNames).map(t=>e.index(t)).map(e=>{let{name:t,unique:n,multiEntry:r,keyPath:o}=e,a={name:t,compound:a6(o),keyPath:o,unique:n,multiEntry:r,extractKey:ub(o)};return i[u_(o)]=a,a}),getIndexByKeyPath:e=>i[u_(e)]};return i[":id"]=a.primaryKey,null!=t&&(i[u_(t)]=a.primaryKey),a})},hasGetAll:r.length>0&&"getAll"in n.objectStore(r[0])&&!("u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),s=i.tables.map(e=>{let t;return{name:t=e.name,schema:e,mutate:function({trans:e,type:n,keys:r,values:i,range:a}){return new Promise((s,l)=>{let u;s=lS(s);let c=e.objectStore(t),d=null==c.keyPath,f="put"===n||"add"===n;if(!f&&"delete"!==n&&"deleteRange"!==n)throw Error("Invalid operation type: "+n);let{length:p}=r||i||{length:1};if(r&&i&&r.length!==i.length)throw Error("Given keys array must have same length as given values array.");if(0===p)return s({numFailures:0,failures:{},results:[],lastResult:void 0});let h=[],m=[],y=0,g=e=>{++y,ud(e)};if("deleteRange"===n){if(4===a.type)return s({numFailures:y,failures:m,results:[],lastResult:void 0});3===a.type?h.push(u=c.clear()):h.push(u=c.delete(o(a)))}else{let[e,t]=f?d?[i,r]:[i,null]:[r,null];if(f)for(let r=0;r<p;++r)h.push(u=t&&void 0!==t[r]?c[n](e[r],t[r]):c[n](e[r])),u.onerror=g;else for(let t=0;t<p;++t)h.push(u=c[n](e[t])),u.onerror=g}let b=e=>{let t=e.target.result;h.forEach((e,t)=>null!=e.error&&(m[t]=e.error)),s({numFailures:y,failures:m,results:"delete"===n?r:h.map(e=>e.result),lastResult:t})};u.onerror=e=>{g(e),b(e)},u.onsuccess=b})},getMany:({trans:e,keys:n})=>new Promise((r,o)=>{r=lS(r);let i=e.objectStore(t),a=n.length,s=Array(a),l,u=0,c=0,d=e=>{let t=e.target;s[t._pos]=t.result,++c===u&&r(s)},f=uc(o);for(let e=0;e<a;++e)null!=n[e]&&((l=i.get(n[e]))._pos=e,l.onsuccess=d,l.onerror=f,++u);0===u&&r(s)}),get:({trans:e,key:n})=>new Promise((r,o)=>{r=lS(r);let i=e.objectStore(t).get(n);i.onsuccess=e=>r(e.target.result),i.onerror=uc(o)}),query:e=>new Promise((n,r)=>{n=lS(n);let{trans:i,values:s,limit:l,query:u}=e,c=l===1/0?void 0:l,{index:d,range:f}=u,p=i.objectStore(t),h=d.isPrimaryKey?p:p.index(d.name),m=o(f);if(0===l)return n({result:[]});if(a){let e=s?h.getAll(m,c):h.getAllKeys(m,c);e.onsuccess=e=>n({result:e.target.result}),e.onerror=uc(r)}else{let e=0,t=!s&&"openKeyCursor"in h?h.openKeyCursor(m):h.openCursor(m),o=[];t.onsuccess=r=>{let i=t.result;return i?(o.push(s?i.value:i.primaryKey),++e===l?n({result:o}):void i.continue()):n({result:o})},t.onerror=uc(r)}}),openCursor:function({trans:e,values:n,query:r,reverse:i,unique:a}){return new Promise((s,l)=>{s=lS(s);let{index:u,range:c}=r,d=e.objectStore(t),f=u.isPrimaryKey?d:d.index(u.name),p=i?a?"prevunique":"prev":a?"nextunique":"next",h=!n&&"openKeyCursor"in f?f.openKeyCursor(o(c),p):f.openCursor(o(c),p);h.onerror=uc(l),h.onsuccess=lS(t=>{let n=h.result;if(!n)return void s(null);n.___id=++uw,n.done=!1;let r=n.continue.bind(n),o=n.continuePrimaryKey;o&&(o=o.bind(n));let i=n.advance.bind(n),a=()=>{throw Error("Cursor not stopped")};n.trans=e,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw Error("Cursor not started")},n.fail=lS(l),n.next=function(){let e=1;return this.start(()=>e--?this.continue():this.stop()).then(()=>this)},n.start=e=>{let t=new Promise((e,t)=>{e=lS(e),h.onerror=uc(t),n.fail=t,n.stop=t=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=a,e(t)}}),s=()=>{if(h.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=()=>{throw Error("Cursor behind last entry")},n.stop()};return h.onsuccess=lS(e=>{h.onsuccess=s,s()}),n.continue=r,n.continuePrimaryKey=o,n.advance=i,s(),t},s(n)},l)})},count({query:e,trans:n}){let{index:r,range:i}=e;return new Promise((e,a)=>{let s=n.objectStore(t),l=r.isPrimaryKey?s:s.index(r.name),u=o(i),c=u?l.count(u):l.count();c.onsuccess=lS(t=>e(t.target.result)),c.onerror=uc(a)})}}}),l={};return s.forEach(e=>l[e.name]=e),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!l[e])throw Error(`Table '${e}' not found`);return l[e]},MIN_KEY:-1/0,MAX_KEY:ug(t),schema:i}}(t,n,o),e.dbcore.reduce((e,{create:t})=>({...e,...t(e)}),i))}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach(t=>{let n=t.name;e.core.schema.tables.some(e=>e.name===n)&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))})}function uS({_novip:e},t,n,r){n.forEach(n=>{let o=r[n];t.forEach(t=>{let r=si(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?sn(t,n,{get(){return this.table(n)},set(e){st(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,o))})})}function uE({_novip:e},t){t.forEach(t=>{for(let n in t)t[n]instanceof e.Table&&delete t[n]})}function uD(e,t){return e._cfg.version-t._cfg.version}function uO(e,t){let n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){let o=e[n],i=t[n];if(o){let e={name:n,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")==""+(i.primKey.keyPath||"")&&(o.primKey.auto===i.primKey.auto||lH)){let t,n=o.idxByName,a=i.idxByName;for(t in n)a[t]||e.del.push(t);for(t in a){let r=n[t],o=a[t];r?r.src!==o.src&&e.change.push(o):e.add.push(o)}(e.del.length>0||e.add.length>0||e.change.length>0)&&r.change.push(e)}else e.recreate=!0,r.change.push(e)}else r.add.push([n,i])}return r}function uk(e,t,n,r){let o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(e=>uP(o,e)),o}function uP(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function uC(e,t,n){let r={};return ss(t.objectStoreNames,0).forEach(e=>{let t=n.objectStore(e),o=t.keyPath,i=uh(um(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),a=[];for(let e=0;e<t.indexNames.length;++e){let n=t.index(t.indexNames[e]);o=n.keyPath;var s=uh(n.name,o,!!n.unique,!!n.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(s)}r[e]=uy(e,i,a)}),r}function uj({_novip:e},t,n){let r=n.db.objectStoreNames;for(let o=0;o<r.length;++o){let i=r[o],a=n.objectStore(i);e._hasGetAll="getAll"in a;for(let e=0;e<a.indexNames.length;++e){let n=a.indexNames[e],r=a.index(n).keyPath,o="string"==typeof r?r:"["+ss(r).join("+")+"]";if(t[i]){let e=t[i].idxByName[o];e&&(e.name=n,delete t[i].idxByName[o],t[i].idxByName[n]=e)}}}"u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a4.WorkerGlobalScope&&a4 instanceof a4.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class uT{_parseStoresSpec(e,t){a3(e).forEach(n=>{if(null!==e[n]){var r=e[n].split(",").map((e,t)=>{let n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return uh(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),a6(r),0===t)}),o=r.shift();if(o.multi)throw new sV.Schema("Primary key cannot be multi-valued");r.forEach(e=>{if(e.auto)throw new sV.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new sV.Schema("Index must have a name and cannot be an empty string")}),t[n]=uy(n,o,r)}})}stores(e){let t=this.db;this._cfg.storesSource=this._cfg.storesSource?a5(this._cfg.storesSource,e):e;let n=t._versions,r={},o={};return n.forEach(e=>{a5(r,e._cfg.storesSource),o=e._cfg.dbschema={},e._parseStoresSpec(r,o)}),t._dbSchema=o,uE(t,[t._allTables,t,t.Transaction.prototype]),uS(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],a3(o),o),t._storeNames=a3(o),this}upgrade(e){return this._cfg.contentUpgrade=sQ(this._cfg.contentUpgrade||sK,e),this}}function uR(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new uJ("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function uA(e){return e&&"function"==typeof e.databases}function uN(e){return lj(function(){return la.letThrough=!0,e()})}function uM(e){var t=t=>e.next(t),n=o(t),r=o(t=>e.throw(t));function o(e){return t=>{var o=e(t),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):a6(i)?Promise.all(i).then(n,r):n(i)}}return o(t)()}function uI(e,t,n){var r=arguments.length;if(r<2)throw new sV.InvalidArgument("Too few arguments");for(var o=Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[e,sy(o),n]}function u$(e,t,n){let r=a6(e)?e.slice():[e];for(let e=0;e<n;++e)r.push(t);return r}let uL={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){let n=e.table(t),{schema:r}=n,o={},i=[];function a(e,t,n){let r=u_(e),s=o[r]=o[r]||[],l=null==e?0:"string"==typeof e?1:e.length,u=t>0,c={...n,isVirtual:u,keyTail:t,keyLength:l,extractKey:ub(e),unique:!u&&n.unique};return s.push(c),c.isPrimaryKey||i.push(c),l>1&&a(2===l?e[0]:e.slice(0,l-1),t+1,n),s.sort((e,t)=>e.keyTail-t.keyTail),c}let s=a(r.primaryKey.keyPath,0,r.primaryKey);for(let e of(o[":id"]=[s],r.indexes))a(e.keyPath,0,e);function l(t){var n,r;let o=t.query.index;return o.isVirtual?{...t,query:{index:o,range:(n=t.query.range,r=o.keyTail,{type:1===n.type?2:n.type,lower:u$(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,r),lowerOpen:!0,upper:u$(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,r),upperOpen:!0})}}:t}return{...n,schema:{...r,primaryKey:s,indexes:i,getIndexByKeyPath:function(e){let t=o[u_(e)];return t&&t[0]}},count:e=>n.count(l(e)),query:e=>n.query(l(e)),openCursor(t){let{keyTail:r,isVirtual:o,keyLength:i}=t.query.index;return o?n.openCursor(l(t)).then(n=>n&&Object.create(n,{continue:{value:function(o){null!=o?n.continue(u$(o,t.reverse?e.MAX_KEY:e.MIN_KEY,r)):t.unique?n.continue(n.key.slice(0,i).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,r)):n.continue()}},continuePrimaryKey:{value(t,o){n.continuePrimaryKey(u$(t,e.MAX_KEY,r),o)}},primaryKey:{get:()=>n.primaryKey},key:{get(){let e=n.key;return 1===i?e[0]:e.slice(0,i)}},value:{get:()=>n.value}})):n.openCursor(t)}}}}}};function uF(e,t,n,r){return n=n||{},r=r||"",a3(e).forEach(o=>{if(a8(t,o)){var i=e[o],a=t[o];if("object"==typeof i&&"object"==typeof a&&i&&a){let e=sx(i);e!==sx(a)?n[r+o]=t[o]:"Object"===e?uF(i,a,n,r+o+"."):i!==a&&(n[r+o]=t[o])}else i!==a&&(n[r+o]=t[o])}else n[r+o]=void 0}),a3(t).forEach(o=>{a8(e,o)||(n[r+o]=t[o])}),n}let uB={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){let n=e.table(t),{primaryKey:r}=n.schema;return{...n,mutate(e){let o=la.trans,{deleting:i,creating:a,updating:s}=o.table(t).hook;switch(e.type){case"add":if(a.fire===sK)break;return o._promise("readwrite",()=>l(e),!0);case"put":if(a.fire===sK&&s.fire===sK)break;return o._promise("readwrite",()=>l(e),!0);case"delete":if(i.fire===sK)break;return o._promise("readwrite",()=>l(e),!0);case"deleteRange":if(i.fire===sK)break;return o._promise("readwrite",()=>(function e(t,o,i){return n.query({trans:t,values:!1,query:{index:r,range:o},limit:i}).then(({result:n})=>l({type:"delete",keys:n,trans:t}).then(r=>r.numFailures>0?Promise.reject(r.failures[0]):n.length<i?{failures:[],numFailures:0,lastResult:void 0}:e(t,{...o,lower:n[n.length-1],lowerOpen:!0},i)))})(e.trans,e.range,1e4),!0)}return n.mutate(e);function l(e){var t,o;let l=la.trans,u=e.keys||("delete"===(t=e).type?t.keys:t.keys||t.values.map(r.extractKey));if(!u)throw Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:u}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),("add"===(o=e).type?Promise.resolve([]):n.getMany({trans:o.trans,keys:u,cache:"immutable"})).then(t=>{let o=u.map((n,o)=>{let u=t[o],c={onerror:null,onsuccess:null};if("delete"===e.type)i.fire.call(c,n,u,l);else if("add"===e.type||void 0===u){let t=a.fire.call(c,n,e.values[o],l);null==n&&null!=t&&(n=t,e.keys[o]=n,r.outbound||sp(e.values[o],r.keyPath,n))}else{let t=uF(u,e.values[o]),r=s.fire.call(c,t,n,u,l);if(r){let t=e.values[o];Object.keys(r).forEach(e=>{a8(t,e)?t[e]=r[e]:sp(t,e,r[e])})}}return c});return n.mutate(e).then(({failures:n,results:r,numFailures:i,lastResult:a})=>{for(let i=0;i<u.length;++i){let a=r?r[i]:u[i],s=o[i];null==a?s.onerror&&s.onerror(n[i]):s.onsuccess&&s.onsuccess("put"===e.type&&t[i]?e.values[i]:a)}return{failures:n,results:r,numFailures:i,lastResult:a}}).catch(e=>(o.forEach(t=>t.onerror&&t.onerror(e)),Promise.reject(e)))})}}}}})};function uV(e,t,n){try{if(!t||t.keys.length<e.length)return null;let r=[];for(let o=0,i=0;o<t.keys.length&&i<e.length;++o)0===l7(t.keys[o],e[i])&&(r.push(n?sw(t.values[o]):t.values[o]),++i);return r.length===e.length?r:null}catch(e){return null}}let uU={stack:"dbcore",level:-1,create:e=>({table:t=>{let n=e.table(t);return{...n,getMany:e=>{if(!e.cache)return n.getMany(e);let t=uV(e.keys,e.trans._cache,"clone"===e.cache);return t?lc.resolve(t):n.getMany(e).then(t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?sw(t):t},t))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),n.mutate(e))}}})};function uW(e){return!("from"in e)}let uK=function(e,t){if(!this){let t=new uK;return e&&"d"in e&&a5(t,e),t}a5(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function uz(e,t,n){let r=l7(t,n);if(isNaN(r))return;if(r>0)throw RangeError();if(uW(e))return a5(e,{from:t,to:n,d:1});let o=e.l,i=e.r;if(0>l7(n,e.from))return o?uz(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},uq(e);if(l7(t,e.to)>0)return i?uz(i,t,n):e.r={from:t,to:n,d:1,l:null,r:null},uq(e);0>l7(t,e.from)&&(e.from=t,e.l=null,e.d=i?i.d+1:1),l7(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);let a=!e.r;o&&!e.l&&uH(e,o),i&&a&&uH(e,i)}function uH(e,t){uW(t)||function e(t,{from:n,to:r,l:o,r:i}){uz(t,n,r),o&&e(t,o),i&&e(t,i)}(e,t)}function uG(e){let t=uW(e)?null:{s:0,n:e};return{next(e){let n=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&0>l7(e,t.n.from);)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||0>=l7(e,t.n.to))return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function uq(e){var t,n;let r=((null==(t=e.r)?void 0:t.d)||0)-((null==(n=e.l)?void 0:n.d)||0),o=r>1?"r":r<-1?"l":"";if(o){let t="r"===o?"l":"r",n={...e},r=e[o];e.from=r.from,e.to=r.to,e[o]=r[o],n[o]=r[t],e[t]=n,n.d=uZ(n)}e.d=uZ(e)}function uZ({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}se(uK.prototype,{add(e){return uH(this,e),this},addKey(e){return uz(this,e,e),this},addKeys(e){return e.forEach(e=>uz(this,e,e)),this},[sS](){return uG(this)}});let uY={stack:"dbcore",level:0,create:e=>{let t=e.schema.name,n=new uK(e.MIN_KEY,e.MAX_KEY);return{...e,table:r=>{let o=e.table(r),{schema:i}=o,{primaryKey:a}=i,{extractKey:s,outbound:l}=a,u={...o,mutate:e=>{let a=e.trans,s=a.mutatedParts||(a.mutatedParts={}),l=e=>{let n=`idb://${t}/${r}/${e}`;return s[n]||(s[n]=new uK)},u=l(""),c=l(":dels"),{type:d}=e,[f,p]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],h=e.trans._cache;return o.mutate(e).then(e=>{if(a6(f)){"delete"!==d&&(f=e.results),u.addKeys(f);let t=uV(f,h);t||"add"===d||c.addKeys(f),(t||p)&&i.indexes.forEach(function(e){let n=l(e.name||"");function r(t){return null!=t?e.extractKey(t):null}let o=t=>e.multiEntry&&a6(t)?t.forEach(e=>n.addKey(e)):n.addKey(t);(t||p).forEach((e,n)=>{let i=t&&r(t[n]),a=p&&r(p[n]);0!==l7(i,a)&&(null!=i&&o(i),null!=a&&o(a))})})}else if(f){let e={from:f.lower,to:f.upper};c.add(e),u.add(e)}else u.add(n),c.add(n),i.indexes.forEach(e=>l(e.name).add(n));return e})}},c=({query:{index:t,range:n}})=>{var r,o;return[t,new uK(null!=(r=n.lower)?r:e.MIN_KEY,null!=(o=n.upper)?o:e.MAX_KEY)]},d={get:e=>[a,new uK(e.key)],getMany:e=>[a,(new uK).addKeys(e.keys)],count:c,query:c,openCursor:c};return a3(d).forEach(e=>{u[e]=function(i){let{subscr:a}=la;if(a){let u=e=>{let n=`idb://${t}/${r}/${e}`;return a[n]||(a[n]=new uK)},c=u(""),f=u(":dels"),[p,h]=d[e](i);if(u(p.name||"").add(h),!p.isPrimaryKey){if("count"!==e){let t="query"===e&&l&&i.values&&o.query({...i,values:!1});return o[e].apply(this,arguments).then(n=>{if("query"===e){if(l&&i.values)return t.then(({result:e})=>(c.addKeys(e),n));let e=i.values?n.result.map(s):n.result;i.values?c.addKeys(e):f.addKeys(e)}else if("openCursor"===e){let e=i.values;return n&&Object.create(n,{key:{get:()=>(f.addKey(n.primaryKey),n.key)},primaryKey:{get(){let e=n.primaryKey;return f.addKey(e),e}},value:{get:()=>(e&&c.addKey(n.primaryKey),n.value)}})}return n})}f.add(n)}}return o[e].apply(this,arguments)}}),u}}}};class uJ{constructor(e,t){var n;this._middlewares={},this.verno=0;const r=uJ.dependencies;this._options=t={addons:uJ.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:o}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const i={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:sK,dbReadyPromise:null,cancelOpen:sK,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};i.dbReadyPromise=new lc(e=>{i.dbReadyResolve=e}),i.openCanceller=new lc((e,t)=>{i.cancelOpen=t}),this._state=i,this.name=e,this.on=lQ(this,"populate","blocked","versionchange","close",{ready:[sQ,sK]}),this.on.ready.subscribe=sl(this.on.ready.subscribe,e=>(t,n)=>{uJ.vip(()=>{let r=this._state;if(r.openComplete)r.dbOpenError||lc.resolve().then(t),n&&e(t);else if(r.onReadyBeingFired)r.onReadyBeingFired.push(t),n&&e(t);else{e(t);let r=this;n||e(function e(){r.on.ready.unsubscribe(t),r.on.ready.unsubscribe(e)})}})}),this.Collection=(n=this,lX(ue.prototype,function(e,t){this.db=n;let r=lZ,o=null;if(t)try{r=t()}catch(e){o=e}let i=e._ctx,a=i.table,s=a.hook.reading.fire;this._ctx={table:a,index:i.index,isPrimKey:!i.index||a.schema.primKey.keyPath&&i.index===a.schema.primKey.name,range:r,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:o,or:i.or,valueMapper:s!==sz?s:null}})),this.Table=function(e){return lX(lJ.prototype,function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:lQ(null,{creating:[sq,sK],reading:[sH,sz],updating:[sY,sK],deleting:[sZ,sK]})})}(this),this.Transaction=function(e){return lX(up.prototype,function(t,n,r,o,i){this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=lQ(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new lc((e,t)=>{this._resolve=e,this._reject=t}),this._completion.then(()=>{this.active=!1,this.on.complete.fire()},e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),lU(e)})})}(this),this.Version=function(e){return lX(uT.prototype,function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}(this),this.WhereClause=function(e){return lX(uu.prototype,function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};let o=e._deps.indexedDB;if(!o)throw new sV.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=(e,t)=>o.cmp(t,e),this._max=(e,t)=>o.cmp(e,t)>0?e:t,this._min=(e,t)=>0>o.cmp(e,t)?e:t,this._IDBKeyRange=e._deps.IDBKeyRange})}(this),this.on("versionchange",e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()}),this.on("blocked",e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)}),this._maxKey=ug(t.IDBKeyRange),this._createTransaction=(e,t,n,r)=>new this.Transaction(e,t,n,this._options.chromeTransactionDurability,r),this._fireOnBlocked=e=>{this.on("blocked").fire(e),lz.filter(e=>e.name===this.name&&e!==this&&!e._state.vcFired).map(t=>t.on("versionchange").fire(e))},this.use(uL),this.use(uB),this.use(uY),this.use(uU),this.vip=Object.create(this,{_vip:{value:!0}}),o.forEach(e=>e(this))}version(e){if(isNaN(e)||e<.1)throw new sV.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new sV.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);let t=this._versions;var n=t.filter(t=>t._cfg.version===e)[0];return n||(n=new this.Version(e),t.push(n),t.sort(uD),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(e){return this.idbdb&&(this._state.openComplete||la.letThrough||this._vip)?e():new lc((e,t)=>{if(this._state.openComplete)return t(new sV.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new sV.DatabaseClosed);this.open().catch(sK)}this._state.dbReadyPromise.then(e,t)}).then(e)}use({stack:e,create:t,level:n,name:r}){r&&this.unuse({stack:e,name:r});let o=this._middlewares[e]||(this._middlewares[e]=[]);return o.push({stack:e,create:t,level:null==n?10:n,name:r}),o.sort((e,t)=>e.level-t.level),this}unuse({stack:e,name:t,create:n}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter(e=>n?e.create!==n:!!t&&e.name!==t)),this}open(){return function(e){var t;let n=e._state,{indexedDB:r}=e._deps;if(n.isBeingOpened||e.idbdb)return n.dbReadyPromise.then(()=>n.dbOpenError?lU(n.dbOpenError):e);sP&&(n.openCanceller._stackHolder=sT()),n.isBeingOpened=!0,n.dbOpenError=null,n.openComplete=!1;let o=n.openCanceller;function i(){if(n.openCanceller!==o)throw new sV.DatabaseClosed("db.open() was cancelled")}let a=n.dbReadyResolve,s=null,l=!1;return lc.race([o,("u"<typeof navigator?lc.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){var n=function(){return indexedDB.databases().finally(e)};t=setInterval(n,100),n()}).finally(function(){return clearInterval(t)}):Promise.resolve()).then(()=>new lc((t,o)=>{if(i(),!r)throw new sV.MissingAPI;let a=e.name,u=n.autoSchema?r.open(a):r.open(a,Math.round(10*e.verno));if(!u)throw new sV.MissingAPI;u.onerror=uc(o),u.onblocked=lS(e._fireOnBlocked),u.onupgradeneeded=lS(t=>{if(s=u.transaction,n.autoSchema&&!e._options.allowEmptyDB){u.onerror=ud,s.abort(),u.result.close();let e=r.deleteDatabase(a);e.onsuccess=e.onerror=lS(()=>{o(new sV.NoSuchDatabase(`Database ${a} doesnt exist`))})}else{let n,r,a,f;s.onerror=uc(o);var i,c,d=t.oldVersion>0x4000000000000000?0:t.oldVersion;l=d<1,e._novip.idbdb=u.result,i=d/10,c=s,n=e._dbSchema,(r=e._createTransaction("readwrite",e._storeNames,n)).create(c),r._completion.catch(o),a=r._reject.bind(r),f=la.transless||la,lj(()=>{la.trans=r,la.transless=f,0===i?(a3(n).forEach(e=>{uk(c,e,n[e].primKey,n[e].indexes)}),ux(e,c),lc.follow(()=>e.on.populate.fire(r)).catch(a)):(function({_novip:e},t,n,r){let o=[],i=e._versions,a=e._dbSchema=uC(e,e.idbdb,r),s=!1;return i.filter(e=>e._cfg.version>=t).forEach(i=>{o.push(()=>{let o=a,l=i._cfg.dbschema;uj(e,o,r),uj(e,l,r),a=e._dbSchema=l;let u=uO(o,l);u.add.forEach(e=>{uk(r,e[0],e[1].primKey,e[1].indexes)}),u.change.forEach(e=>{if(e.recreate)throw new sV.Upgrade("Not yet support for changing primary key");{let t=r.objectStore(e.name);e.add.forEach(e=>uP(t,e)),e.change.forEach(e=>{t.deleteIndex(e.name),uP(t,e)}),e.del.forEach(e=>t.deleteIndex(e))}});let c=i._cfg.contentUpgrade;if(c&&i._cfg.version>t){let t;ux(e,r),n._memoizedTables={},s=!0;let i=sh(l);u.del.forEach(e=>{i[e]=o[e]}),uE(e,[e.Transaction.prototype]),uS(e,[e.Transaction.prototype],a3(i),i),n.schema=i;let a=sk(c);a&&lT();let d=lc.follow(()=>{if((t=c(n))&&a){var e=lR.bind(null,null);t.then(e,e)}});return t&&"function"==typeof t.then?lc.resolve(t):d.then(()=>t)}}),o.push(t=>{var r;s&&lH||(r=i._cfg.dbschema,[].slice.call(t.db.objectStoreNames).forEach(e=>null==r[e]&&t.db.deleteObjectStore(e))),uE(e,[e.Transaction.prototype]),uS(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema})}),(function e(){return o.length?lc.resolve(o.shift()(n.idbtrans)).then(e):lc.resolve()})().then(()=>{var e;a3(e=a).forEach(t=>{r.db.objectStoreNames.contains(t)||uk(r,t,e[t].primKey,e[t].indexes)})})})(e,i,r,c).catch(a)})}},o),u.onsuccess=lS(()=>{s=null;let r=e._novip.idbdb=u.result,o=ss(r.objectStoreNames);if(o.length>0)try{let t,i=r.transaction(1===o.length?o[0]:o,"readonly");n.autoSchema?function({_novip:e},t,n){e.verno=t.version/10;let r=e._dbSchema=uC(0,t,n);e._storeNames=ss(t.objectStoreNames,0),uS(e,[e._allTables],a3(r),r)}(e,r,i):(uj(e,e._dbSchema,i),((t=uO(uC(0,e.idbdb,i),e._dbSchema)).add.length||t.change.some(e=>e.add.length||e.change.length))&&console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),ux(e,i)}catch(e){}lz.push(e),r.onversionchange=lS(t=>{n.vcFired=!0,e.on("versionchange").fire(t)}),r.onclose=lS(t=>{e.on("close").fire(t)}),l&&function({indexedDB:e,IDBKeyRange:t},n){uA(e)||"__dbnames"===n||uR(e,t).put({name:n}).catch(sK)}(e._deps,a),t()},o)}))]).then(()=>(i(),n.onReadyBeingFired=[],lc.resolve(uN(()=>e.on.ready.fire(e.vip))).then(function t(){if(n.onReadyBeingFired.length>0){let r=n.onReadyBeingFired.reduce(sQ,sK);return n.onReadyBeingFired=[],lc.resolve(uN(()=>r(e.vip))).then(t)}}))).finally(()=>{n.onReadyBeingFired=null,n.isBeingOpened=!1}).then(()=>e).catch(t=>{n.dbOpenError=t;try{s&&s.abort()}catch(e){}return o===n.openCanceller&&e._close(),lU(t)}).finally(()=>{n.openComplete=!0,a()})}(this)}_close(){let e=this._state,t=lz.indexOf(this);if(t>=0&&lz.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new lc(t=>{e.dbReadyResolve=t}),e.openCanceller=new lc((t,n)=>{e.cancelOpen=n})}close(){this._close();let e=this._state;this._options.autoOpen=!1,e.dbOpenError=new sV.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){let e=arguments.length>0,t=this._state;return new lc((n,r)=>{let o=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=lS(()=>{!function({indexedDB:e,IDBKeyRange:t},n){uA(e)||"__dbnames"===n||uR(e,t).delete(n).catch(sK)}(this._deps,this.name),n()}),e.onerror=uc(r),e.onblocked=this._fireOnBlocked};if(e)throw new sV.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(o):o()})}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){let e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return a3(this._allTables).map(e=>this._allTables[e])}transaction(){let e=uI.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,n){let r,o,i=la.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);let a=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(o=t.map(e=>{var t=e instanceof this.Table?e.name:e;if("string"!=typeof t)throw TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t}),"r"==e||"readonly"===e)r="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new sV.InvalidArgument("Invalid transaction mode: "+e);r="readwrite"}if(i){if("readonly"===i.mode&&"readwrite"===r){if(!a)throw new sV.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&o.forEach(e=>{if(i&&-1===i.storeNames.indexOf(e)){if(!a)throw new sV.SubTransaction("Table "+e+" not included in parent transaction.");i=null}}),a&&i&&!i.active&&(i=null)}}catch(e){return i?i._promise(null,(t,n)=>{n(e)}):lU(e)}let s=(function e(t,n,r,o,i){return lc.resolve().then(()=>{let a,s=la.transless||la,l=t._createTransaction(n,r,t._dbSchema,o);if(o)l.idbtrans=o.idbtrans;else try{l.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===sB.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,n,r,null,i))):lU(o)}let u=sk(i);u&&lT();let c=lc.follow(()=>{if(a=i.call(l,l))if(u){var e=lR.bind(null,null);a.then(e,e)}else"function"==typeof a.next&&"function"==typeof a.throw&&(a=uM(a))},{trans:l,transless:s});return(a&&"function"==typeof a.then?lc.resolve(a).then(e=>l.active?e:lU(new sV.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))):c.then(()=>a)).then(e=>(o&&l._resolve(),l._completion.then(()=>e))).catch(e=>(l._reject(e),lU(e)))})}).bind(null,this,r,o,i,n);return i?i._promise(r,s,"lock"):la.trans?lL(la.transless,()=>this._whenReady(s)):this._whenReady(s)}table(e){if(!a8(this._allTables,e))throw new sV.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}let uQ="u">typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class uX{constructor(e){this._subscribe=e}subscribe(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}[uQ](){return this}}function u0(e,t){return a3(t).forEach(n=>{uH(e[n]||(e[n]=new uK),t[n])}),e}try{i={indexedDB:a4.indexedDB||a4.mozIndexedDB||a4.webkitIndexedDB||a4.msIndexedDB,IDBKeyRange:a4.IDBKeyRange||a4.webkitIDBKeyRange}}catch(e){i={indexedDB:null,IDBKeyRange:null}}function u1(e){let t=u2;try{u2=!0,uf.storagemutated.fire(e)}finally{u2=t}}se(uJ,{...sW,delete:e=>new uJ(e,{addons:[]}).delete(),exists:e=>new uJ(e,{addons:[]}).open().then(e=>(e.close(),!0)).catch("NoSuchDatabaseError",()=>!1),getDatabaseNames(e){try{return(function({indexedDB:e,IDBKeyRange:t}){return uA(e)?Promise.resolve(e.databases()).then(e=>e.map(e=>e.name).filter(e=>"__dbnames"!==e)):uR(e,t).toCollection().primaryKeys()})(uJ.dependencies).then(e)}catch(e){return lU(new sV.MissingAPI)}},defineClass:()=>function(e){a5(this,e)},ignoreTransaction:e=>la.trans?lL(la.transless,e):e(),vip:uN,async:function(e){return function(){try{var t=uM(e.apply(this,arguments));return t&&"function"==typeof t.then?t:lc.resolve(t)}catch(e){return lU(e)}}},spawn:function(e,t,n){try{var r=uM(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:lc.resolve(r)}catch(e){return lU(e)}},currentTransaction:{get:()=>la.trans||null},waitFor:function(e,t){let n=lc.resolve("function"==typeof e?uJ.ignoreTransaction(e):e).timeout(t||6e4);return la.trans?la.trans.waitFor(n):n},Promise:lc,debug:{get:()=>sP,set:e=>{sP=e,sC="dexie"===e?()=>!0:lG}},derive:sr,extend:a5,props:se,override:sl,Events:lQ,on:uf,liveQuery:function(e){return new uX(t=>{let n=sk(e),r=!1,o={},i={},a={get closed(){return r},unsubscribe:()=>{r=!0,uf.storagemutated.unsubscribe(c)}};t.start&&t.start(a);let s=!1,l=!1;function u(){return a3(i).some(e=>o[e]&&function(e,t){let n=uG(t),r=n.next();if(r.done)return!1;let o=r.value,i=uG(e),a=i.next(o.from),s=a.value;for(;!r.done&&!a.done;){if(0>=l7(s.from,o.to)&&l7(s.to,o.from)>=0)return!0;0>l7(o.from,s.from)?o=(r=n.next(s.from)).value:s=(a=i.next(o.from)).value}return!1}(o[e],i[e]))}let c=e=>{u0(o,e),u()&&d()},d=()=>{let f,p;if(s||r)return;o={};let h={},m=(n&&lT(),f=()=>lj(e,{subscr:h,trans:null}),p=la.trans?lL(la.transless,f):f(),n&&p.then(lR,lR),p);l||(uf("storagemutated",c),l=!0),s=!0,Promise.resolve(m).then(e=>{s=!1,r||(u()?d():(o={},i=h,t.next&&t.next(e)))},e=>{s=!1,t.error&&t.error(e),a.unsubscribe()})};return d(),a})},extendObservabilitySet:u0,getByKeyPath:sf,setByKeyPath:sp,delByKeyPath:function(e,t){"string"==typeof t?sp(e,t,void 0):"length"in t&&[].map.call(t,function(t){sp(e,t,void 0)})},shallowClone:sh,deepClone:sw,getObjectDiff:uF,cmp:l7,asap:sc,minKey:-1/0,addons:[],connections:lz,errnames:sB,dependencies:i,semVer:"3.2.2",version:"3.2.2".split(".").map(e=>parseInt(e)).reduce((e,t,n)=>e+t/Math.pow(10,2*n))}),uJ.maxKey=ug(uJ.dependencies.IDBKeyRange),"u">typeof dispatchEvent&&"u">typeof addEventListener&&(uf("storagemutated",e=>{if(!u2){let t;lH?(t=document.createEvent("CustomEvent")).initCustomEvent("x-storagemutated-1",!0,!0,e):t=new CustomEvent("x-storagemutated-1",{detail:e}),u2=!0,dispatchEvent(t),u2=!1}}),addEventListener("x-storagemutated-1",({detail:e})=>{u2||u1(e)}));let u2=!1;if("u">typeof BroadcastChannel){let e=new BroadcastChannel("x-storagemutated-1");uf("storagemutated",t=>{u2||e.postMessage(t)}),e.onmessage=e=>{e.data&&u1(e.data)}}else if("u">typeof self&&"u">typeof navigator){uf("storagemutated",e=>{try{u2||("u">typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach(t=>t.postMessage({type:"x-storagemutated-1",changedParts:e})))}catch(e){}}),"u">typeof addEventListener&&addEventListener("storage",e=>{if("x-storagemutated-1"===e.key){let t=JSON.parse(e.newValue);t&&u1(t.changedParts)}});let e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",function({data:e}){e&&"x-storagemutated-1"===e.type&&u1(e.changedParts)})}function u4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}lc.rejectionMapper=function(e,t){if(!e||e instanceof sI||e instanceof TypeError||e instanceof SyntaxError||!e.name||!sU[e.name])return e;var n=new sU[e.name](t||e.message,e);return"stack"in e&&sn(n,"stack",{get:function(){return this.inner.stack}}),n},sC=lG;class u3 extends uJ{constructor(){super("EsmOffline"),u4(this,"syncQueue",void 0),u4(this,"dynamicOfflineData",void 0),this.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),this.syncQueue=this.table("syncQueue"),this.dynamicOfflineData=this.table("dynamicOfflineData")}}function u6(){return new u3}let u5=new u3,u7={},u9=Z("offline-synchronization",{});function u8(){return u9}async function ce(){if(u9.getState().synchronization)return;let e=await u5.syncQueue.count(),t={},n=Object.entries(u7),r=n.length,o={},i=new AbortController,a=()=>{let e=u9.getState().synchronization;u9.setState({synchronization:{...e,pendingCount:e.pendingCount-1}})};try{u9.setState({synchronization:{totalCount:e,pendingCount:e,abortController:i}});for(let e=0;e<r&&n.length>0;e++)for(let e=n.length;e--;){let[r,s]=n[e],l=s.dependsOn.map(e=>t[e]);l.every(Boolean)&&(o[r]={},await Promise.all(l),t[r]=ct(s,o,i,a),n.splice(e,1))}await Promise.allSettled(Object.values(t))}finally{u9.setState({synchronization:void 0})}}async function ct({type:e,dependsOn:t,process:n},r,o,i){let a=[],s=[],l=await cn();await u5.syncQueue.where({type:e,userId:l}).each((e,t)=>{a.push([t.primaryKey,e.content,e.descriptor]),s.push(e.content)});for(let u=0;u<a.length;u++){let[c,d,{id:f,dependencies:p=[]}]=a[u];try{let i=await n(d,{abort:o,index:u,items:s,userId:l,dependencies:p.map(({id:e,type:n})=>t.includes(n)?r[n][e]:void 0)});void 0!==f&&(r[e][f]=i),await u5.syncQueue.delete(c)}catch(e){await u5.syncQueue.update(c,{lastError:{name:e?.name,message:e?.message??e?.toString()}})}finally{i()}}}async function cn(){let e=await oY();return e?.uuid||"*"}async function cr(e,t,n,r){let o=r&&r.id;return void 0!==o&&await u5.syncQueue.where({type:t,userId:e}).filter(e=>e?.descriptor.id===o).delete().catch(uJ.errnames.DatabaseClosed),await u5.syncQueue.add({type:t,content:n,userId:e,descriptor:r||{},createdOn:new Date}).catch(uJ.errnames.DatabaseClosed,()=>-1)}async function co(e,t,n){let r=await cn();return await cr(r,e,t,n)}async function ci(e,t){return(await ca(e,t)).map(e=>e.content)}async function ca(e,t){return await u5.syncQueue.where(t?{type:t,userId:e}:{userId:e}).toArray().catch(uJ.errnames.DatabaseClosed,()=>[])}async function cs(e){let t=await cn();return await ci(t,e)}async function cl(e){let t=await cn();return await ca(t,e)}async function cu(e){return await u5.syncQueue.get(e).catch(uJ.errnames.DatabaseClosed,()=>void 0)}function cc(e){return!!u7[e]?.options.onBeginEditSyncItem}async function cd(e){let t=await cu(e);if(!t)throw Error(`No sync item with the ID ${e} exists.`);let n=u7[t.type]?.options.onBeginEditSyncItem;if(!n)throw Error(`A sync item with the ID ${e} exists, but the associated handler (if one exists) doesn't support editing the item. You can avoid this error by either verifying that sync items of this type can be edited via the "canEditSynchronizationItemsOfType(type: string)" function or alternatively ensure that the synchronizaton handler for sync items of type "${t.type}" supports editing items.`);n(t)}async function cf(e){await u5.syncQueue.delete(e).catch(uJ.errnames.DatabaseClosed)}function cp(e,t,n,r={}){u7[e]={type:e,dependsOn:t,process:n,options:r}}let ch="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),cm=new Uint8Array(16),cy=[];for(let e=0;e<256;++e)cy.push((e+256).toString(16).slice(1));let cg=function(e,t,n){if(ch&&!t&&!e)return ch();let r=(e=e||{}).random||(e.rng||function(){if(!a&&!(a="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(cm)})();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return cy[e[t+0]]+cy[e[t+1]]+cy[e[t+2]]+cy[e[t+3]]+"-"+cy[e[t+4]]+cy[e[t+5]]+"-"+cy[e[t+6]]+cy[e[t+7]]+"-"+cy[e[t+8]]+cy[e[t+9]]+"-"+cy[e[t+10]]+cy[e[t+11]]+cy[e[t+12]]+cy[e[t+13]]+cy[e[t+14]]+cy[e[t+15]]}(r)},cb="OFFLINE+";function cv(){return cb+cg()}function cw(e){return e.startsWith(cb)}let c_={};function cx(){return Object.values(c_)}function cS(e){c_[e.id]&&console.warn(`[setupDynamicOfflineDataHandler] Another second handler with the ID "${e.id}" was registered. This handler will override the previous one. This could be unintended as the previous handler might run different flows than the newly registered one. If this is the case, ensure that you are setting up the handlers with different IDs.`),c_[e.id]=e}async function cE(e){let t=await cR();return await cD(t,e)}async function cD(e,t){let n=new u3;return await n.dynamicOfflineData.where(t?{type:t,users:e}:{users:e}).toArray().catch(uJ.errnames.DatabaseClosed,()=>[])}async function cO(e,t){let n=await cR();return await ck(n,e,t)}async function ck(e,t,n){let r=new u3,o=await r.dynamicOfflineData.get({type:t,identifier:n}).catch(uJ.errnames.DatabaseClosed,()=>void 0);o?o.users.includes(e)||await r.dynamicOfflineData.update(o.id,{users:[...o.users,e]}).catch(uJ.errnames.DatabaseClosed):await r.dynamicOfflineData.add({users:[e],type:t,identifier:n}).catch(uJ.errnames.DatabaseClosed)}async function cP(e,t){let n=await cR();return await cC(n,e,t)}async function cC(e,t,n){let r=new u3,o=await r.dynamicOfflineData.get({type:t,identifier:n,users:e}).catch(uJ.errnames.DatabaseClosed,()=>void 0);o&&(o.users.length>1?await r.dynamicOfflineData.update(o.id,{users:o.users.filter(t=>t!==e)}).catch(uJ.errnames.DatabaseClosed):await r.dynamicOfflineData.delete(o.id).catch(uJ.errnames.DatabaseClosed))}async function cj(e,t){let n=await cE(e);await Promise.all(n.map(async e=>cT(e.type,e.identifier,t)))}async function cT(e,t,n){await cO(e,t);let r=new u3,o=await cR(),i=await r.dynamicOfflineData.get({type:e,identifier:t}).catch(uJ.errnames.DatabaseClosed,()=>void 0),a=cx().filter(t=>t.type===e);if(!i)return;let s=await Promise.all(a.map(async e=>{try{return e.sync(t,n),{id:e.id,error:void 0}}catch(n){let t=n.message?.toString()??n.toString();return{id:e.id,error:t}}})),l=s.filter(e=>!e.error).map(e=>e.id),u=s.filter(e=>e.error).map(e=>e.id),c=s.filter(e=>e.error).map(e=>({handlerId:e.id,message:e.error})),d={syncedOn:new Date,syncedBy:o,succeededHandlers:l,erroredHandlers:u,errors:c};i.id&&await r.dynamicOfflineData.update(i.id,{syncState:d}).catch(uJ.errnames.DatabaseClosed)}async function cR(){let e=(await oY()).uuid;if(!e)throw Error("Using the dynamic offline data API requires a logged in user.");return e}let cA=Z("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function cN(){return c$(),cA}function cM(e,t){c$(),cS({type:"patient",displayName:t.displayName,id:e,isSynced:()=>Promise.resolve(!0),sync:(e,n)=>t.onOfflinePatientAdded({patientUuid:e,signal:n??new AbortController().signal})})}async function cI(e){c$(),await cT("patient",e)}function c$(){console.warn("The offline patient API has been deprecated and will be removed in a future release. To prevent future crashes, the functions remain available for the moment, but any invocations should be migrated ASAP.")}async function cL(e,t,n=!0){if(e){let r=null,[o,i]=await Promise.all([oF(`${oI}/Patient/${e}`,t).catch(e=>r=e),n?cF(e):Promise.resolve(null)]);if(o.ok)return o.data;if(i)return i;if(r)throw r}return null}async function cF(e){let t=(await cs("patient-registration")).find(t=>t.fhirPatient.id===e);return t?.fhirPatient??null}function cB(e,t){let n=new CustomEvent(`openmrs:${e}`,{detail:t??void 0,cancelable:!0,bubbles:!0});return window.dispatchEvent(n)}function cV(e,t){let n=e=>{t("detail"in e&&null!==e.detail?e.detail:void 0)};return window.addEventListener(`openmrs:${e}`,n),()=>{window.removeEventListener(`openmrs:${e}`,n)}}var cU=n(99549);function cW(e){return{uuid:e.uuid,display:e.display}}function cK(e=null,t=null){let n=new URLSearchParams;e&&n.set("tag",e),t&&n.set("q",t);let r=n.toString();return oB(`${oM}/location${r?"?"+r:""}`).pipe((0,cU.map)(e=>e.data.results.map(cW))).pipe((0,cU.take)(1))}function cz(e){return{uuid:e.uuid,display:e.display,name:e.name}}function cH(){return oB(`${oM}/visittype`).pipe((0,cU.map)(e=>e.data.results.map(cz))).pipe((0,cU.take)(1))}var cG=n(29827),cq=((es={}).NEWVISIT="startVisit",es.EDITVISIT="editVisit",es.LOADING="loadingVisit",es),cZ=((el={}).NOTSTARTED="notStarted",el.ONGOING="ongoing",el);let cY="custom:(uuid,display,voided,indication,startDatetime,stopDatetime,encounters:(uuid,display,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,display),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display))",cJ=function(){try{return JSON.parse(sessionStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};function cQ(){return J("visit",cJ)}function cX(e,t){cQ().setState({patientUuid:e,manuallySetVisitUuid:t})}function c0(e,t){return oF(`${oM}/visit`,{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function c1(e,t,n){return oF(`${oM}/visit/${e}`,{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}function c2(e,t,n){return oF(`${oM}/visit?patient=${e}&v=${n??cY}`,{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}})}cQ().subscribe(e=>{var t;t=e,sessionStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))});let c4=new cG.t(null);class c3{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+c3.version}static addUnaryOp(e){return c3.max_unop_len=Math.max(e.length,c3.max_unop_len),c3.unary_ops[e]=1,c3}static addBinaryOp(e,t,n){return c3.max_binop_len=Math.max(e.length,c3.max_binop_len),c3.binary_ops[e]=t,n?c3.right_associative.add(e):c3.right_associative.delete(e),c3}static addIdentifierChar(e){return c3.additional_identifier_chars.add(e),c3}static addLiteral(e,t){return c3.literals[e]=t,c3}static removeUnaryOp(e){return delete c3.unary_ops[e],e.length===c3.max_unop_len&&(c3.max_unop_len=c3.getMaxKeyLen(c3.unary_ops)),c3}static removeAllUnaryOps(){return c3.unary_ops={},c3.max_unop_len=0,c3}static removeIdentifierChar(e){return c3.additional_identifier_chars.delete(e),c3}static removeBinaryOp(e){return delete c3.binary_ops[e],e.length===c3.max_binop_len&&(c3.max_binop_len=c3.getMaxKeyLen(c3.binary_ops)),c3.right_associative.delete(e),c3}static removeAllBinaryOps(){return c3.binary_ops={},c3.max_binop_len=0,c3}static removeLiteral(e){return delete c3.literals[e],c3}static removeAllLiterals(){return c3.literals={},c3}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new c3(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return c3.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!c3.binary_ops[String.fromCharCode(e)]||c3.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return c3.isIdentifierStart(e)||c3.isDecimalDigit(e)}throwError(e){let t=Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(c3.hooks[e]){let n={context:this,node:t};return c3.hooks.run(e,n),n.node}return t}searchHook(e){if(c3.hooks[e]){let t={context:this};return c3.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===c3.SPACE_CODE||e===c3.TAB_CODE||e===c3.LF_CODE||e===c3.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:c3.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t=[],n,r;for(;this.index<this.expr.length;)if((n=this.code)===c3.SEMCOL_CODE||n===c3.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())t.push(r);else if(this.index<this.expr.length){if(n===e)break;this.throwError('Unexpected "'+this.char+'"')}return t}gobbleExpression(){let e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,c3.max_binop_len),t=e.length;for(;t>0;){if(c3.binary_ops.hasOwnProperty(e)&&(!c3.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!c3.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,n,r,o,i,a,s,l;if(!(i=this.gobbleToken())||!(t=this.gobbleBinaryOp()))return i;for(o={value:t,prec:c3.binaryPrecedence(t),right_a:c3.right_associative.has(t)},(a=this.gobbleToken())||this.throwError("Expected expression after "+t),r=[i,o,a];t=this.gobbleBinaryOp();){if(0===(n=c3.binaryPrecedence(t))){this.index-=t.length;break}o={value:t,prec:n,right_a:c3.right_associative.has(t)},l=t;let s=e=>o.right_a&&e.right_a?n>e.prec:n<=e.prec;for(;r.length>2&&s(r[r.length-2]);)a=r.pop(),t=r.pop().value,i=r.pop(),e={type:c3.BINARY_EXP,operator:t,left:i,right:a},r.push(e);(e=this.gobbleToken())||this.throwError("Expected expression after "+l),r.push(o,e)}for(s=r.length-1,e=r[s];s>1;)e={type:c3.BINARY_EXP,operator:r[s-1].value,left:r[s-2],right:e},s-=2;return e}gobbleToken(){let e,t,n,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"))return this.runHook("after-token",r);if(e=this.code,c3.isDecimalDigit(e)||e===c3.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===c3.SQUOTE_CODE||e===c3.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(e===c3.OBRACK_CODE)r=this.gobbleArray();else{for(n=(t=this.expr.substr(this.index,c3.max_unop_len)).length;n>0;){if(c3.unary_ops.hasOwnProperty(t)&&(!c3.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!c3.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=n;let e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:c3.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--n)}c3.isIdentifierStart(e)?(r=this.gobbleIdentifier(),c3.literals.hasOwnProperty(r.name)?r={type:c3.LITERAL,value:c3.literals[r.name],raw:r.name}:r.name===c3.this_str&&(r={type:c3.THIS_EXP})):e===c3.OPAREN_CODE&&(r=this.gobbleGroup())}return r?(r=this.gobbleTokenProperty(r),this.runHook("after-token",r)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===c3.PERIOD_CODE||t===c3.OBRACK_CODE||t===c3.OPAREN_CODE||t===c3.QUMARK_CODE;){let n;if(t===c3.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==c3.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===c3.OBRACK_CODE?((e={type:c3.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),(t=this.code)!==c3.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===c3.OPAREN_CODE?e={type:c3.CALL_EXP,arguments:this.gobbleArguments(c3.CPAREN_CODE),callee:e}:(t===c3.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),e={type:c3.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),n&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e="",t,n;for(;c3.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===c3.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);c3.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if("e"===(t=this.char)||"E"===t){for(e+=this.expr.charAt(this.index++),("+"===(t=this.char)||"-"===t)&&(e+=this.expr.charAt(this.index++));c3.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);c3.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return n=this.code,c3.isIdentifierStart(n)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(n===c3.PERIOD_CODE||1===e.length&&e.charCodeAt(0)===c3.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:c3.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="",t=this.index,n=this.expr.charAt(this.index++),r=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===n){r=!0;break}if("\\"===t)switch(t=this.expr.charAt(this.index++)){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return r||this.throwError('Unclosed quote after "'+e+'"'),{type:c3.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(c3.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length;)if(e=this.code,c3.isIdentifierPart(e))this.index++;else break;return{type:c3.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){let t=[],n=!1,r=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===e){n=!0,this.index++,e===c3.CPAREN_CODE&&r&&r>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(o===c3.COMMA_CODE){if(this.index++,++r!==t.length){if(e===c3.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===c3.CBRACK_CODE)for(let e=t.length;e<r;e++)t.push(null)}}else if(t.length!==r&&0!==r)this.throwError("Expected comma");else{let e=this.gobbleExpression();e&&e.type!==c3.COMPOUND||this.throwError("Expected comma"),t.push(e)}}return n||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(c3.CPAREN_CODE);if(this.code===c3.CPAREN_CODE)return(this.index++,1===e.length)?e[0]:!!e.length&&{type:c3.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:c3.ARRAY_EXP,elements:this.gobbleArguments(c3.CBRACK_CODE)}}}Object.assign(c3,{hooks:new class{add(e,t,n){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][n?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}},plugins:new class{constructor(e){this.jsep=e,this.registered={}}register(...e){e.forEach(e=>{if("object"!=typeof e||!e.name||!e.init)throw Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(c3),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),c3.max_unop_len=c3.getMaxKeyLen(c3.unary_ops),c3.max_binop_len=c3.getMaxKeyLen(c3.binary_ops);let c6=e=>new c3(e).parse(),c5=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(c3).filter(e=>!c5.includes(e)&&void 0===c6[e]).forEach(e=>{c6[e]=c3[e]}),c6.Jsep=c3,c6.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let n=t.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:n,consequent:r,alternate:o},n.operator&&e.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&e.binary_ops[r.right.operator]<=.9;)r=r.right;t.node.test=r.right,r.right=t.node,t.node=n}}else this.throwError("Expected :")}})}});let c7="ArrowFunctionExpression",c9={Array,Boolean,Symbol,Infinity,NaN,Math,Number,BigInt,String,RegExp,JSON,isFinite,isNaN,parseFloat,parseInt,decodeURI,encodeURI,encodeURIComponent,Object:{__proto__:void 0,assign:Object.assign.bind(null),fromEntries:Object.fromEntries.bind(null),hasOwn:Object.hasOwn.bind(null),keys:Object.keys.bind(null),is:Object.is.bind(null),values:Object.values.bind(null)}},c8={...c9,Promise};function de(e,t={}){return ds(e,t,dc)}async function dt(e,t={}){return dl(e,t,dc)}function dn(e,t={}){return ds(e,t,dd)}function dr(e,t={}){return dl(e,t,dd)}function di(e,t={}){return ds(e,t,df)}function da(e,t={}){return dl(e,t,df)}function ds(e,t={},n){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))throw`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`;if("string"==typeof e&&0===e.trim().length)throw{type:"Empty expression",message:"Expression cannot be an empty string"};null==t&&(t={});let r=dg(t,c9),o=dp("string"==typeof e?c6(e):e,r);if(n(o))return o;throw{type:"Invalid result",message:"string"==typeof e?`The expression ${e} did not produce a valid result`:"The expression did not produce a valid result"}}async function dl(e,t={},n){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))return Promise.reject(`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`);if("string"==typeof e&&0===e.trim().length)throw{type:"Empty expression",message:"Expression cannot be an empty string"};null==t&&(t={});let r=dg(t,c8);return Promise.resolve(dp("string"==typeof e?c6(e):e,r)).then(t=>{if(n(t))return t;throw{type:"Invalid result",message:"string"==typeof e?`The expression ${e} did not produce a valid result`:"The expression did not produce a valid result"}})}function du(e){return c6(e)}function dc(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e||e instanceof Date}function dd(e){return"boolean"==typeof e}function df(e){return"number"==typeof e}function dp(e,t){switch(e.type){case"UnaryExpression":var n,r,o,i,a,s,l,u,c,d,f,p,h,m=e,y=t;let g=dp(m.argument,y);switch(m.operator){case"+":return+g;case"-":return-g;case"~":return~g;case"!":return!g;default:throw`Expression evaluator does not support operator '${m.operator}''`}case"BinaryExpression":var b=e,v=t;switch(b.operator){case"&&":return dp(b.left,v)&&dp(b.right,v);case"||":return dp(b.left,v)||dp(b.right,v);case"??":return dp(b.left,v)??dp(b.right,v)}let w=dp(b.left,v),x=dp(b.right,v);switch(b.operator){case"+":return w+x;case"-":return w-x;case"*":return w*x;case"/":return w/x;case"%":return w%x;case"**":return w**x;case"==":return w==x;case"===":return w===x;case"!=":return w!=x;case"!==":return w!==x;case">":return w>x;case">=":return w>=x;case"<":return w<x;case"<=":return w<=x;case"in":return w in x;default:throw`Expression evaluator does not support operator '${b.operator}' operator`}case"ConditionalExpression":return n=e,r=t,dp(n.test,r)?dp(n.consequent,r):dp(n.alternate,r);case"CallExpression":return dw(dm(e,t));case"ArrowFunctionExpression":let S;return o=e,i=t,S=o.params?.map(e=>{if("Identifier"===e.type)return e.name;throw`Cannot handle parameter of type ${e.type}`})??[],(function(...e){if(e.length<S.length)throw`Required argument(s) ${S.slice(e.length,-1).join(", ")} were not provided`;let t=Object.fromEntries(S.reduce((t,n,r)=>{let o=e[r];return function e(t){if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"function"==typeof t||null===t||t instanceof RegExp)return!0;if("object"==typeof t){for(let n of Object.keys(t))if(!e(t[n]))return!1;return!0}if(Array.isArray(t)){for(let n of t)if(!e(n))break}return!1}(o)&&t.push([n,o]),t},[]));return dp(o.body,i.addVariables(t))}).bind(null);case"MemberExpression":return dw(dy(e,t));case"ArrayExpression":return a=e,s=t,a.elements?.map(d_(s));case"SequenceExpression":let E;return l=e,u=t,(E=l.expressions.map(d_(u)))[E.length-1];case"NewExpression":var D=e,O=t;if(D.callee&&"Identifier"===D.callee.type){let e=D.arguments?.map(d_(O));switch(D.callee.name){case"Date":return new Date(...e);case"RegExp":return new RegExp(...e);default:throw`Cannot instantiate object of type ${D.callee.name}`}}if(D.callee)throw"new must be called with either Date or RegExp";throw'Could not handle "new" without a specified class';case"Literal":return e.value;case"Identifier":return c=e,d=t,(dx(c.name),d.variables&&Object.hasOwn(d.variables,c.name))?d.variables[c.name]:Object.hasOwn(d.globals,c.name)?d.globals[c.name]:void 0;case"TemplateLiteral":let k,P;return f=e,p=t,k=f.expressions?.map(d_(p))??[],(P=f.quasis?.map(d_(p))??[]).filter(e=>!e.tail).map(e=>e.value).join("")+k.join("")+P.filter(e=>e.tail).map(e=>e.value).join("");case"TemplateElement":return{value:(h=e).cooked,tail:h.tail};default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function dh(e,t){switch(e.type){case"Literal":return e.value;case"Identifier":return e.name;case"MemberExpression":return dh(e.property,t);default:throw`VisitExpressionName does not support expression of type '${e.type}'`}}function dm(e,t){let n=dv(e.callee,t);if(n===db||e.optional&&null==n)return db;let r=e.arguments?.map(d_(t));if(n){if("function"!=typeof n)throw`${dD(e.callee)} is not a function`}else throw`No function named ${dD(e.callee)} is defined in this context`;return n(...r)}function dy(e,t){let n=dv(e.object,t);if(n===db||e.optional&&null==n)return db;if(null===n)throw TypeError(`TypeError: cannot read properties of null (reading '${dE(e.property,t)}')`);if(void 0===n)switch(e.object.type){case"Identifier":{let n=dh(e.object,t);throw ReferenceError(`ReferenceError: ${n} is not defined`)}case"MemberExpression":throw TypeError(`TypeError: cannot read properties of undefined (reading '${dE(e.property,t)}')`);default:throw`VisitMemberExpression does not support operator '${e.object.type}' type`}if("object"!=typeof n&&"function"!=typeof n&&"string"!=typeof n&&"number"!=typeof n)throw`VisitMemberExpression does not support member access on type ${typeof n}`;let r=e.computed?function(e){if(void 0===e)throw{type:"Illegal property access",message:"No property was supplied to the property access"};if("string"!=typeof e&&"number"!=typeof e)throw{type:"Illegal property access",message:`Cannot use a value of type ${null===e?"null":typeof e} as a property name`};return e}(dp(e.property,t)):function(e){if("Identifier"!==e.type)throw`VisitMemberExpression does not support a property of type '${e.type}'`;return e.name}(e.property);dx(r),function(e,t){if(dS.has(String(t)))return;let n=Object(e);for(;null!==n;){if(Object.hasOwn(n,t)){if(n===Object.prototype||n===Function.prototype)throw{type:"Illegal property access",message:`Cannot access the ${t} property of objects`};return}n=Object.getPrototypeOf(n)}}(n,r);let o=n[r];return"function"==typeof o?o.bind(n):o}function dg(e,t){let n={variables:{...e},globals:{...t},addVariables(e){return this.variables={...this.variables,...e},this}};return n.addVariables.bind(n),n}c6.plugins.register({name:"arrow",init(e){e.addBinaryOp("=>",.1,!0),e.hooks.add("gobble-expression",function(t){if(this.gobbleSpaces(),this.code===e.OPAREN_CODE){let n=this.index;if(this.index++,this.gobbleSpaces(),this.code===e.CPAREN_CODE){this.index++;let e=this.gobbleBinaryOp();if("=>"===e){let n=this.gobbleBinaryExpression();n||this.throwError("Expected expression after "+e),t.node={type:c7,params:null,body:n};return}}this.index=n}}),e.hooks.add("after-expression",function(t){!function t(n){n&&(Object.values(n).forEach(e=>{e&&"object"==typeof e&&t(e)}),"=>"===n.operator&&(n.type=c7,n.params=n.left?[n.left]:null,n.body=n.right,n.params&&n.params[0].type===e.SEQUENCE_EXP&&(n.params=n.params[0].expressions),delete n.left,delete n.right,delete n.operator))}(t.node)})}}),c6.plugins.register({name:"new",init(e){e.addUnaryOp("new"),e.hooks.add("after-token",function(t){let n=t.node;if(n&&"new"===n.operator){n.argument&&[e.CALL_EXP,e.MEMBER_EXP].includes(n.argument.type)||this.throwError("Expected new function()"),t.node=n.argument;let r=t.node;for(;r.type===e.MEMBER_EXP||r.type===e.CALL_EXP&&r.callee.type===e.MEMBER_EXP;)r=r.type===e.MEMBER_EXP?r.object:r.callee.object;r.type="NewExpression"}})}}),c6.plugins.register({name:"numbers",init(e){function t(e){return"x"===e||"X"===e?(this.index+=2,[[48,57],[65,70],[97,102]]):"b"===e||"B"===e?(this.index+=2,[[48,49]]):"o"===e||"O"===e||e>="0"&&e<="7"?(this.index+=e<="7"?1:2,[[48,55]]):null}function n(t){let n=this.index,r="",o=()=>{for(;e.isDecimalDigit(this.code)||95===this.code;)95===this.code?this.index++:r+=this.expr.charAt(this.index++)};o(),this.code===e.PERIOD_CODE&&(r+=this.expr.charAt(this.index++),o());let i=this.char;("e"===i||"E"===i)&&(r+=this.expr.charAt(this.index++),("+"===(i=this.char)||"-"===i)&&(r+=this.expr.charAt(this.index++)),o(),e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+r+this.char+")"));let a=this.code;if(e.isIdentifierStart(a))this.throwError("Variable names cannot start with a number ("+r+this.char+")");else if(a===e.PERIOD_CODE){r.length>1&&this.throwError(`Unexpected period ${JSON.stringify({chCode:a,number:r},null,2)}`),this.index=n;return}t.node={type:e.LITERAL,value:parseFloat(r),raw:this.expr.substring(n,this.index)}}e.hooks.add("gobble-token",function(r){if(48===this.code){var o,i,a;let s=this.index,l=this.expr.charAt(this.index+1),u=t.call(this,l);if(!u)return;let c="";for(;o=this.code,i=u,95===o||i.some(([e,t])=>o>=e&&o<=t);)95===this.code?this.index++:c+=this.expr.charAt(this.index++);if(e.isIdentifierPart(this.code)){if(e.isDecimalDigit(this.code)&&e.isDecimalDigit(l.charCodeAt(0))){this.index=s+1,n.call(this,r);return}this.throwError("unexpected char within number")}r.node={type:e.LITERAL,value:parseInt(c,"x"===(a=l)||"X"===a?16:"b"===a||"B"===a?2:8),raw:this.expr.substring(s,this.index)}}else(e.isDecimalDigit(this.code)||this.code===e.PERIOD_CODE)&&n.call(this,r)})}}),c6.plugins.register({name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){let n=++this.index,r=!1;for(;this.index<this.expr.length;){if(47===this.code&&!r){let r,o=this.expr.slice(n,this.index),i="";for(;++this.index<this.expr.length;){let e=this.code;if(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57)i+=this.char;else break}try{r=new RegExp(o,i)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:r,raw:this.expr.slice(n-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?r=!0:r&&this.code===e.CBRACK_CODE&&(r=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}}),c6.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let n=t.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:n,consequent:r,alternate:o},n.operator&&e.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&e.binary_ops[r.right.operator]<=.9;)r=r.right;t.node.test=r.right,r.right=t.node,t.node=n}}else this.throwError("Expected :")}})}}),c6.plugins.register({name:"jsepTemplateLiteral",init(e){function t(e,n=!0){if(96===this.code){let t={type:"TemplateLiteral",quasis:[],expressions:[]},r="",o="",i=!1,a=this.expr.length,s=()=>t.quasis.push({type:"TemplateElement",value:{raw:o,cooked:r},tail:i});for(;this.index<a;){let a=this.expr.charAt(++this.index);if("`"===a)return this.index+=1,i=!0,s(),e.node=t,n&&(e.node=this.gobbleTokenProperty(e.node)),e.node;if("$"===a&&"{"===this.expr.charAt(this.index+1))this.index+=2,s(),o="",r="",t.expressions.push(...this.gobbleExpressions(125)),125!==this.code&&this.throwError("unclosed ${");else if("\\"===a)switch(o+=a,a=this.expr.charAt(++this.index),o+=a,a){case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+=" ";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:r+=a}else r+=a,o+=a}this.throwError("Unclosed `")}}e.hooks.add("gobble-token",t),e.hooks.add("after-token",function(n){if((n.node.type===e.IDENTIFIER||n.node.type===e.MEMBER_EXP)&&96===this.code)return n.node={type:"TaggedTemplateExpression",tag:n.node,quasi:t.bind(this)(n,!1)},n.node=this.gobbleTokenProperty(n.node),n.node})}}),c6.addBinaryOp("in",7),c6.addBinaryOp("??",1);let db=Symbol("optional chain short-circuited");function dv(e,t){switch(e.type){case"MemberExpression":return dy(e,t);case"CallExpression":return dm(e,t);default:return dp(e,t)}}function dw(e){return e===db?void 0:e}function d_(e){return function(t){return null===t?null:dp(t,e)}}function dx(e){if("__proto__"===e||"prototype"===e||"constructor"===e)throw{type:"Illegal property access",message:`Cannot access the ${e} property of objects`}}let dS=new Set(["toString","valueOf","hasOwnProperty"]);function dE(e,t){try{return dh(e,t)}catch{return"<computed>"}}function dD(e){return e?"MemberExpression"===e.type?e.property?.name:e.name:null}function dO(e){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))throw`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`;let t={globals:{...c8},isLocalExpression:!1,variables:new Set};return dk("string"==typeof e?c6(e):e,t),[...t.variables]}function dk(e,t){switch(e.type){case"UnaryExpression":return r=e,o=t,dk(r.argument,o);case"BinaryExpression":return i=e,a=t,[dk(i.left,a),dk(i.right,a)].filter(Boolean);case"ConditionalExpression":return s=e,l=t,[dk(s.consequent,l),dk(s.test,l),dk(s.alternate,l)].filter(Boolean);case"CallExpression":let n;return u=e,c=t,n=dk(u.callee,c),u.arguments?.map(dP(c)),n;case"ArrowFunctionExpression":var r,o,i,a,s,l,u,c,d,f,p,h,m,y,g,b,v=e,w=t;let x={...w};x.isLocalExpression=!0;let S=v.params?.map(dP(x))??[],E=dk(v.body,x)??[];if(E&&Array.isArray(E))for(let e of E)S.includes(e)||w.variables.add(e);return;case"MemberExpression":var D=e,O=t;if(dk(D.object,O),D.computed)return void dk(D.property,O);let k={...O};k.isLocalExpression=!0,dk(D.property,k);return;case"ArrayExpression":return d=e,f=t,void d.elements?.map(dP(f));case"SequenceExpression":return p=e,h=t,void p.expressions?.map(dP(h));case"NewExpression":return m=e,y=t,void m.arguments?.map(dP(y));case"Literal":case"TemplateElement":return;case"Identifier":var P=e,C=t;if(!(P.name in C.globals))if(C.isLocalExpression)return P.name;else C.variables.add(P.name);return;case"TemplateLiteral":return g=e,b=t,void(g.expressions?.map(dP(b)),g.quasis?.map(dP(b)));default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function dP(e){return function(t){return null===t?null:dk(t,e)}}let dC=J("feature-flags",{flags:function(){let e={};for(let t of Object.keys(localStorage))if(t.startsWith("openmrs:feature-flag:")){let n=t.replace("openmrs:feature-flag:",""),r=JSON.parse(localStorage.getItem(`openmrs:feature-flag-meta:${n}`)||"{}");e[n]={enabled:"true"===localStorage.getItem(t),...r}}return e}()});function dj(e,t,n){dC.setState(r=>({flags:{...r.flags,[e]:{enabled:r.flags[e]?.enabled??!1,label:t,description:n}}}))}function dT(){let e=dC.getState().flags;Object.keys(localStorage).filter(e=>e.startsWith("openmrs:feature-flag:")).forEach(t=>{let n=t.replace("openmrs:feature-flag:","");e[n]||(localStorage.removeItem(t),localStorage.removeItem(`openmrs:feature-flag-meta:${n}`))})}function dR(e){return dC.getState().flags[e].enabled}function dA(e,t){dC.subscribe(n=>{t(n.flags[e].enabled)})}function dN(e,t){dC.setState(n=>({flags:{...n.flags,[e]:{...n.flags[e],enabled:t}}}))}function dM(e){return!window.offlineEnabled||(e??navigator.onLine)}dC.subscribe(e=>{for(let[t,n]of Object.entries(e.flags))localStorage.setItem(`openmrs:feature-flag:${t}`,n.enabled.toString()),localStorage.setItem(`openmrs:feature-flag-meta:${t}`,JSON.stringify({label:n.label,description:n.description}))});var dI=e4(function(e,t,n){eH(e,t,n)});function d$(e=!0,t=!1){return dL(dM(),e,t)}function dL(e,t=!0,n=!1){return!!(e?t:n)}let dF=Z("extensionsInternal",{slots:{},extensions:{}}),dB=Z("extensionRenderings",{renderings:new Map}),dV=()=>J("extensionsInternal",{slots:{},extensions:{}}),dU=()=>J("extensionRenderings",{renderings:new Map});function dW(e){let t=dF.getState(),n=e(t);n!==t&&dF.setState(n)}let dK=null,dz=null;function dH(){let e=dB.getState();return dK&&e===dz||(dK=new Map(e.renderings),dz=e,function(e){for(let t of(d2.clear(),e.values()))d3(t,1);d4=!0}(dK)),dK}function dG(e){dz={renderings:e},dB.setState(dz,!0)}function dq(e){let t=dH();t.has(e.renderingId)||(t.set(e.renderingId,e),d3(e,1),dG(t))}function dZ(e){let t=dH(),n=t.get(e);n&&(t.delete(e),d3(n,-1),dG(t))}let dY=()=>J("extensions",{slots:{}}),dJ=0,dQ=new Set;function dX(e){dJ++;try{return e()}finally{if(0==--dJ&&dQ.size>0){let e=Array.from(dQ);for(let t of(dQ.clear(),e))d0(t)}}}function d0(e){try{e()}catch(t){console.error(`The extension system's '${e.name}' recomputation failed`,t)}}function d1(e){dJ>0?dQ.add(e):d0(e)}let d2=new Map,d4=!1;function d3(e,t){let n=JSON.stringify([e.slotName,e.extensionId,e.slotModuleName,e.extensionModuleName]),r=d2.get(n);if(!r){if(t<0)return;d2.set(n,{count:1,record:{slotModuleName:e.slotModuleName,extensionModuleName:e.extensionModuleName,slotName:e.slotName,extensionId:e.extensionId}}),d4=!0;return}r.count+=t,r.count<1&&(d2.delete(n),d4=!0)}function d6(){var e,t;if(dH(),!d4)return;d4=!1;let n=Array.from(d2.values(),({record:e})=>e);n.sort(d5),e=t4.getState().mountedExtensions,t=n,e.length===t.length&&e.every((e,n)=>0===d5(e,t[n]))||t4.setState({mountedExtensions:n})}function d5(e,t){return d7(e.slotName,t.slotName)||d7(e.extensionId,t.extensionId)||d7(e.slotModuleName,t.slotModuleName)||d7(e.extensionModuleName,t.extensionModuleName)}function d7(e,t){return e===t?0:e<t?-1:1}d6(),dB.subscribe(()=>d1(d6));let d9=dV(),d8=dY(),fe=t6(),ft=t9(),fn=new Set,fr=!1;function fo(e){if(null===e)fn=null;else if(null!==fn)for(let t of e)fn.add(t);d1(fi)}function fi(){if(!fr){fr=!0;try{for(let e=1;;e++){let t=fn;if(null!==t&&0===t.size)return;fn=new Set;try{!function(e,t,n,r,o,i=null){let a=d8.getState().slots,s={},l=!1,u=dM(),c=Object.entries(r.flags).filter(([,{enabled:e}])=>e).map(([e])=>e);for(let[r,d]of Object.entries(e.slots)){let f=a[r];if(f&&i&&!i.has(r)){s[r]=f;continue}let{config:p}=t7(t,d.name),h=function(e,t,n,r,o,i,a){let s=function(e,t){let n=e.add||[],r=e.remove||[],o=e.order||[],{extensions:i}=d9.getState();return[...t,...n].filter(e=>!r.includes(e)).sort((e,n)=>fy(e,o,i[fu(e)]?.order,t)-fy(n,o,i[fu(n)]?.order,t))}(n,t.slots[e].attachedIds),l=[];for(let u of s){let{config:s}=ne(r,e,u),c=nt(n,e,u),d=c?dI({},s,c):s,f=fu(u),p=t.extensions[f];if(p){let e=d?.["Display conditions"]?.privileges??p.privileges??[];if(e&&("string"==typeof e||Array.isArray(e)&&e.length>0)&&(!a?.user||!oZ(e,a.user))||p.featureFlag&&!o.includes(p.featureFlag)||window.offlineEnabled&&!dL(i,p.online,p.offline))continue;l.push({id:u,name:f,moduleName:p.moduleName,config:d,featureFlag:p.featureFlag,meta:p.meta,online:d?.["Display conditions"]?.online??p.online??!0,offline:d?.["Display conditions"]?.offline??p.offline??!1,displayConditionExpression:d?.["Display conditions"]?.expression||p.displayExpression})}}return l}(r,e,p,n,c,u,o.session);f&&f.moduleName===d.moduleName&&tm(f.candidateExtensions,h)?s[r]=f:(s[r]={moduleName:d.moduleName,candidateExtensions:h},l=!0)}(l||Object.keys(a).length!==Object.keys(s).length)&&d8.setState({slots:s})}(d9.getState(),fe.getState(),ft.getState(),dC.getState(),oU.getState(),t)}catch(e){throw fn=null===t||null===fn?null:new Set([...t,...fn]),e}if(e>=20)return void console.error("The extension system stopped recomputing after 20 passes because something keeps invalidating slots in response to the extension store being written. Some slots are left stale until the next write.")}}finally{fr=!1}}}function fa(e,t){let n=new Set;for(let r of Object.keys(e))e[r]!==t[r]&&n.add(r);for(let r of Object.keys(t))r in e||n.add(r);return n}function fs(){fo(null)}function fl(e,t){return{moduleName:t,name:e,attachedIds:[]}}function fu(e){let[t]=e.split("#");return t}function fc(e,t){let n=fu(t);return e.extensions[n]}function fd(e){return fc(d9.getState(),e)}d9.subscribe((e,t)=>{fo(e.extensions!==t.extensions?null:fa(e.slots,t.slots))}),fe.subscribe((e,t)=>{fo(fa(e.slots,t.slots))}),ft.subscribe((e,t)=>{fo(fa(e.configs,t.configs))}),dC.subscribe(()=>fo(null)),oU.subscribe(()=>fo(null)),fs(),b(fs);let ff=e=>dW(t=>({...t,extensions:{...t.extensions,[e.name]:{...e}}}));function fp(e,t){dW(n=>{let r=n.slots[e];return r?{...n,slots:{...n.slots,[e]:{...r,attachedIds:[...r.attachedIds,t]}}}:{...n,slots:{...n.slots,[e]:{...fl(e),attachedIds:[t]}}}})}function fh(e,t){dW(n=>{let r=n.slots[e];return r&&r.attachedIds.includes(t)?{...n,slots:{...n.slots,[e]:{...r,attachedIds:r.attachedIds.filter(e=>e!==t)}}}:n})}function fm(e){dW(t=>{let n=t.slots[e];return n?{...t,slots:{...t.slots,[e]:{...n,attachedIds:[]}}}:t})}function fy(e,t,n,r){let o=t.indexOf(e);if(-1!==o)return o;{if(void 0!==n)return 1e3+n;let t=r.indexOf(e);return -1!==t?2e3+t:3e3}}function fg(e,t){return function(e,t,n=null,r){let o;return e.filter(e=>{let i=e.displayConditionExpression;if("string"!=typeof i||0===i.trim().length)return!0;o??(o=t&&"object"==typeof t?{session:n,...t}:{session:n});try{return!!dn(i,o)}catch(t){return console.error(`Error while evaluating expression '${i}' for ${e.id}`+(r?` in ${r}`:""),t),!1}})}(fb(e),t,oU.getState().session,e)}function fb(e){return d8.getState().slots[e]?.candidateExtensions??[]}let fv=(e,t)=>d9.setState(n=>{let r=n.slots[t]?.moduleName;if(r&&r!=e)return console.warn(`An extension slot with the name '${t}' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ${r}.`),n;if(r&&r==e)return n;if(n.slots[t])return{...n,slots:{...n.slots,[t]:{...n.slots[t],moduleName:e}}};let o=fl(t,e);return{...n,slots:{...n.slots,[t]:{...o}}}}),fw=()=>{fn=null,dW(()=>({slots:{},extensions:{}})),dU().setState({renderings:new Map}),d8.setState({slots:{}})},f_=Z("left-nav",{slotName:null,basePath:window.spaBase,mode:"normal"});function fx({name:e,basePath:t,mode:n,componentContext:r,state:o}){f_.setState({slotName:e,basePath:t,mode:n??"normal",componentContext:r,state:o})}function fS(e){f_.getState().slotName===e&&f_.setState(f_.getInitialState(),!0)}let fE=Z("modalRegistry",{modals:{}});function fD(e){fE.setState(t=>(t.modals[e.name]=e,t))}function fO(e){let t=fE.getState().modals[e];if(!t){let n=fd(e);n&&(t={name:e,load:n.load,moduleName:n.moduleName},console.warn(`Modal ${e} was registered as an extension. This is deprecated and will be removed in the future. Please register it in the "modals" section of routes.json instead of the "extensions" section.`),fD(t))}return t}let fk=Z("workspaceRegistrations",{workspaces:{}}),fP=Z("workspaceGroups",{workspaceGroups:{}});function fC(e){fk.setState(t=>({workspaces:{...t.workspaces,[e.name]:{...e,load:e.load,preferredWindowSize:e.preferredWindowSize??"normal",type:e.type??"form",canHide:e.canHide??!1,canMaximize:e.canMaximize??!1,width:e.width??"narrow",groups:e.groups??[]}}}))}function fj(e){fP.setState(t=>{let n=t.workspaceGroups[e.name];return n?{workspaceGroups:{...t.workspaceGroups,[e.name]:{...n,members:Array.from(new Set([...n.members,...e.members]))}}}:{workspaceGroups:{...t.workspaceGroups,[e.name]:{name:e.name,members:e.members}}}})}let fT=new Set;function fR(e){let t=fk.getState().workspaces;if(t[e])return t[e];{let t=fd(e);if(t){var n;let r;return fT.has(e)||(console.warn(`The workspace '${e}' is registered as an extension. This is deprecated. Please register it in the "workspaces" section of the routes.json file.`),fT.add(e)),{name:t.name,title:(n=t,"string"==typeof(r=n?.meta?.title)?r:r&&"object"==typeof r?iB(n.moduleName,r.key,r.default):n.name),moduleName:t.moduleName,preferredWindowSize:t.meta?.screenSize??"normal",load:t.load,type:t.meta?.type??"form",canHide:t.meta?.canHide??!1,canMaximize:t.meta?.canMaximize??!1,width:t.meta?.width??"narrow",groups:t.meta?.groups??[]}}throw Error(`No workspace named '${e}' has been registered.`)}}function fA(e){let t=fP.getState().workspaceGroups;if(t[e])return t[e];throw Error(`No workspace group named '${e}' has been registered.`)}let fN=Z("workspace2",{registeredGroupsByName:{},registeredWindowsByName:{},registeredWorkspacesByName:{},openedGroup:null,openedWindows:[],workspaceTitleByWorkspaceName:{},isMostRecentlyOpenedWindowHidden:!1});function fM(e){let{registeredWorkspacesByName:t,registeredWindowsByName:n}=fN.getState(),r=t[e];if(r){let t=n[r.window];if(t)return t;throw Error(`No workspace window found with name: ${r.window} for workspace: ${e}`)}throw Error(`No workspace found with name: ${e}`)}function fI(e){let{registeredGroupsByName:t,registeredWindowsByName:n}=fN.getState(),r=n[e];if(r){let n=t[r.group];if(n)return n;throw Error(`No workspace group found with name: ${r.group} for window: ${e}`)}throw Error(`No workspace window found with name: ${e}`)}function f$(e){let{openedWindows:t}=fN.getState();return t.findIndex(t=>t.openedWorkspaces.find(t=>t.workspaceName===e))}function fL(e,t){if(0==t.length)return;let{registeredGroupsByName:n}=fN.getState(),r={...n};for(let n of t){if(r[n.name])throw Error(`Cannot register workspace group ${n.name} more than once`);r[n.name]={...n,moduleName:e}}fN.setState({registeredGroupsByName:r})}function fF(e,t){if(0==t.length)return;let{registeredWindowsByName:n}=fN.getState(),r={...n};for(let n of t){if(r[n.name])throw Error(`Cannot register workspace window ${n.name} more than once`);let t={...n,moduleName:e};r[n.name]=t}fN.setState({registeredWindowsByName:r})}function fB(e,t){if(0==t.length)return;let{registeredWorkspacesByName:n}=fN.getState(),r={...n};for(let n of t){if(r[n.name])throw Error(`Cannot register workspace ${n.name} more than once`);let t={...n,moduleName:e};r[n.name]=t}fN.setState({registeredWorkspacesByName:r})}let fV=0,fU=null,fW={bootstrap:15e3,mount:15e3,unmount:15e3};function fK(e,t){if(e.timeouts)return e;let n=e.name??"parcel",r=Object.fromEntries(Object.keys(fW).filter(t=>e[t]).map(r=>{var o,i;let a,s;return[r,(o=e[r],i=fW[r],a=Array.isArray(o)?o:[o],s=e=>a.reduce((t,o,i)=>t.then(()=>{let t=o(e);return"function"==typeof t?.then&&"function"==typeof t?.catch?t:Promise.reject(Error(`Lifecycle function ${r} at array index ${i} for parcel ${n} did not return a promise`))}),Promise.resolve(void 0)),e=>{let o,a=new Promise((e,t)=>{o=setTimeout(()=>t(Error(`Lifecycle function ${r} for parcel ${n} did not settle within ${i}ms`)),i)});return Promise.race([s(e),a]).finally(()=>clearTimeout(o)).then(e=>(t(r,!1),e),e=>{throw t(r,!0),e})})]}));return{...e,...r}}async function fz(e,t){var n,r;let o,i,a,s,l,u=await (fU??(fU=new Promise((e,t)=>{r$({name:"openmrs-extension-host",bootstrap:()=>Promise.resolve(),mount:t=>(e(t.mountParcel),Promise.resolve()),unmount:()=>Promise.resolve()},{domElement:document.createElement("div")}).mountPromise.catch(t)}).catch(e=>(console.error("The host parcel used to mount extensions could not be mounted. Falling back to mounting extensions as root parcels, which leaks their DOM elements.",e),r$))),fU),c={...t},d=(o=c,i=!1,{retarget:e=>o={...e},release:a=()=>(function(e){for(let t of Object.keys(e))delete e[t]})(o),onSettled(e,t){switch(e){case"bootstrap":t&&a();return;case"mount":i||(i=t);return;case"unmount":(t||i)&&a();return}}});return r=u((n=d.onSettled,"function"==typeof e?()=>e().then(e=>fK(e,n)):fK(e,n)),c),s=e=>t=>e.call(r,d.retarget(t)).catch(e=>{throw"SKIP_BECAUSE_BROKEN"===r.getStatus()&&d.release(),e}),l=r.update&&s(r.update),Object.defineProperty(r,"update",{configurable:!0,enumerable:!0,get:()=>l,set:e=>{l=e&&s(e)}})}function fH(){return fG}function fG(e,t){let n,r=fz(e,t).then(e=>n=e);return{mount:()=>r.then(e=>e.mount()),unmount:()=>r.then(e=>e.unmount()),update:e=>r.then(t=>t.update?.(e)),getStatus:()=>n?.getStatus()??"LOADING_SOURCE_CODE",get loadPromise(){return r.then(e=>e.loadPromise)},get bootstrapPromise(){return r.then(e=>e.bootstrapPromise)},get mountPromise(){return r.then(e=>e.mountPromise)},get unmountPromise(){return r.then(e=>e.unmountPromise)}}}async function fq(e,t,n,r,o=e=>e,i={}){let a=fu(r),s=fd(r),l=null;if(e){if(!s)throw Error(`Couldn't find extension '${a}' to attach to '${t}'`);let{meta:u,moduleName:c,online:d,offline:f,load:p}=s;if(d$(d,f)){let s,d=fV++,f=`${t}/${r}-${d}`;e.dataset.extensionRenderingId=f;let h=e=>{try{dZ(f)}catch(t){console.error(e,t)}};try{dq({renderingId:f,extensionName:a,extensionModuleName:c,extensionId:r,slotName:t,slotModuleName:n})}catch(e){throw h(`Recomputing configuration after registering '${r}' failed also failed`),e}try{s=await p()}catch(e){throw h(`Recomputing configuration after '${r}' failed to load also failed`),e}try{l=await fz(o({...s,name:`${t}/${a}-${d}`}),{...i,_meta:u,_extensionContext:{extensionId:r,extensionSlotName:t,extensionSlotModuleName:n,extensionModuleName:c},domElement:e})}catch(e){throw h(`Recomputing configuration after '${r}' failed to mount also failed`),e}l.mountPromise.then(void 0,e=>{console.error(`Extension '${r}' in slot '${t}' failed to mount`,e),h(`Recomputing configuration after '${r}' failed to mount also failed`)}),l.unmountPromise.then(()=>h(`Recomputing configuration after unmounting '${r}' failed`),e=>{console.error(`Extension '${r}' in slot '${t}' failed to unmount`,e),h(`Recomputing configuration after '${r}' failed to unmount also failed`)})}}else console.warn(`Tried to render ${r} into ${t} but no DOM element was available.`);return l}var fZ=n(35399),fY=n.n(fZ);let fJ=(0,fZ.createContext)({moduleName:"",featureName:""});function fQ({to:e,templateParams:t,onBeforeNavigate:n,children:r,...o}){return(0,fZ.useEffect)(()=>{o.href&&console.warn(`ConfigurableLink does not support the href prop. Use the 'to' prop instead. The provided href value is '${o.href}'`),o.onClick&&console.warn(`ConfigurableLink does not support the onClick prop. Use the 'onBeforeNavigate' prop instead. The 'to' prop of the offending link is ${e}`)},[]),fY().createElement("a",{onClick:r=>{0===r.button&&!r.ctrlKey&&!r.shiftKey&&!r.altKey&&!r.metaKey&&(r.preventDefault(),n?.(r),oD({to:e,templateParams:t})),0===r.button&&(r.ctrlKey||r.metaKey)&&n?.(r),0===r.button&&r.shiftKey&&n?.(r),1===r.button&&n?.(r)},href:oS(e,t),...o},r)}let fX=({state:e,children:t,...n})=>{let{extension:r}=(0,fZ.useContext)(fJ),o=(0,fZ.useRef)(null),i=(0,fZ.useRef)(Promise.resolve()),a=(0,fZ.useRef)(!1),s=(0,fZ.useRef)(!1),l=(0,fZ.useRef)(e),u=(0,fZ.useCallback)(e=>{if(!e)return;let t=()=>{"MOUNTED"===e.getStatus()&&e.unmount()};switch(e.getStatus()){case"MOUNTED":e.unmount();break;case"UPDATING":i.current?.then(t,t);break;default:e.mountPromise.then(t,()=>{})}},[]),c=(0,fZ.useCallback)((e,t)=>{e.update&&"UNMOUNTING"!==e.getStatus()&&(i.current=Promise.all([e.mountPromise,i.current]).then(()=>{if(o.current?.getStatus()==="MOUNTED"&&o.current.update)return o.current.update({...t})}).catch(e=>{let t=o.current?.getStatus();"UNMOUNTING"!==t&&"NOT_MOUNTED"!==t&&"UNLOADING"!==t&&console.error(`The extension '${r?.extensionId}' failed to update`,e)}))},[]),d=(0,fZ.useCallback)(t=>{t&&!o.current&&!s.current&&r?.extensionSlotName&&r.extensionSlotModuleName&&(s.current=!0,fq(t,r.extensionSlotName,r.extensionSlotModuleName,r.extensionId,void 0,e).then(t=>{(s.current=!1,o.current=t,a.current)?u(t):t&&l.current!==e&&c(t,l.current)},()=>{s.current=!1}))},[]);return(0,fZ.useEffect)(()=>(a.current=!1,()=>{a.current=!0,u(o.current)}),[]),(0,fZ.useEffect)(()=>{l.current=e,o.current&&c(o.current,e)},[e]),r?fY().createElement("div",{ref:d,"data-extension-id":r?.extensionId,style:{position:"relative"},...n}):null};function f0(e){let t=(0,fZ.useRef)(e);return F(t.current,e)||(t.current=e),t.current}function f1(e,t){"function"==typeof t&&(t=t(e));let n={};for(let[r,o]of Object.entries(t)){let t=function(...t){e.setState(e=>o(e,...t))};n[r]=t}return n}let f2=e=>e;function f4(e,t=f2,n){let r=(0,fZ.useCallback)(t=>e.subscribe(t),[e]),o=(0,fZ.useCallback)(()=>t(e.getState()),[e,t]),i=(0,fZ.useSyncExternalStore)(r,o,o),a=(0,fZ.useMemo)(()=>n?f1(e,n):null,[e,n]);return(0,fZ.useMemo)(()=>a?{...i,...a}:i,[i,a])}function f3(e,t){return f4(e,f2,t)}function f6(e){return function(t){let n=(0,fZ.useCallback)(t=>e.subscribe(t),[]),r=(0,fZ.useCallback)(()=>e.getState(),[]),o=(0,fZ.useSyncExternalStore)(n,r,r),i=(0,fZ.useMemo)(()=>t?f1(e,t):null,[t]);return(0,fZ.useMemo)(()=>i?{...o,...i}:o,[o,i])}}let f5=[];Object.freeze(f5);let f7={candidateExtensions:f5};Object.freeze(f7);let f9=e=>{let t=(0,fZ.useCallback)(t=>t.slots?.[e]??f7,[e]);return f4(dY(),t)},f8=e=>e.session;function pe(e,t){let{candidateExtensions:n}=f9(e),r=f4(oU,f8),o=f0(t);return(0,fZ.useMemo)(()=>fg(e,o),[e,o,r,n])}function pt(e,t){let{moduleName:n}=(0,fZ.useContext)(fJ);if(!n)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,fZ.useEffect)(()=>{fv(n,e)},[n,e]),{extensions:pe(e,t),extensionSlotName:e,extensionSlotModuleName:n}}function pn(e){return e}function pr({name:e,extensionSlotName:t,select:n=pn,children:r,state:o,style:i,...a}){if(r&&o)throw Error("Both children and state have been provided. If children are provided, the state must be passed as a prop to the `Extension` component.");let s=e??t,l=(0,fZ.useRef)(null),{extensions:u,extensionSlotModuleName:c}=pt(s,o),d=(0,fZ.useMemo)(()=>n(u),[n,u]),f=(0,fZ.useMemo)(()=>{if("function"==typeof r&&!fY().isValidElement(r))return d.map(e=>r(e,o))},[r,d]);return fY().createElement("div",{ref:l,"data-extension-slot-name":s,"data-extension-slot-module-name":c,style:{...i,position:"relative"},...a},s&&d?.map((e,t)=>fY().createElement(fJ.Provider,{key:e.id,value:{moduleName:c,featureName:"",extension:{extensionId:e.id,extensionSlotName:s,extensionSlotModuleName:c}}},f?.[t]??("function"!=typeof r?r:null)??fY().createElement(fX,{state:o}))))}var po=n(25873);function pi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pi(Object(n),!0).forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ps(e){return(ps="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pl(e){return(pl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pu(e,t){var n;if("function"!=typeof(n=t.domElement?function(){return t.domElement}:t.domElementGetter?t.domElementGetter:e.domElementGetter?e.domElementGetter:function(e){var t=e.appName||e.name;if(!t)throw Error("single-spa's dom-element-getter-helpers was not given an application name as a prop, so it can't make a unique dom element container for the react application");var n="single-spa-application:".concat(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)))throw Error("single-spa's dom-element-getter-helpers was given an invalid domElementGetter for application or parcel '".concat(t.name,"'. Expected a function, received ").concat(pl(n)));return function(){var e=n(t);if(!(e instanceof HTMLElement))throw Error("single-spa's dom-element-getter-helpers: domElementGetter returned an invalid dom element for application or parcel '".concat(t.name,"'. Expected HTMLElement, received ").concat(pl(e)));return e}}var pc=null;try{pc=require("react").createContext()}catch(e){}var pd={React:null,ReactDOM:null,ReactDOMClient:null,rootComponent:null,loadRootComponent:null,errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{},unmountResolves:{}};function pf(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then(function(t){e.rootComponent=t})}function pp(e,t){return new Promise(function(n,r){e.suppressComponentDidCatchWarning||!function(e){if(!(e&&"string"==typeof e.version&&e.version.indexOf(".")>=0))return!1;var t=e.version.slice(0,e.version.indexOf("."));try{return Number(t)>=16}catch(e){return!1}}(e.React)||e.errorBoundary||e.errorBoundaryClass||(e.rootComponent.prototype?e.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var o,i=pg(e,t,function(){n(this)}),a=pu(e,t)(),s=function(e){var t=e.reactDom,n=e.renderType,r=e.elementToRender,o=e.domElement,i=t[n];if("function"!=typeof i)throw Error('renderType "'.concat(n,'" did not return a function.'));switch(n){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var a=i(o);return a.render(r),a;case"hydrateRoot":return i(o,r);default:return i(r,o),null}}({elementToRender:i,domElement:a,reactDom:py(e),renderType:"function"==typeof(o=e).renderType?o.renderType():o.renderType});e.domElements[t.name]=a,e.renderResults[t.name]=s})}function ph(e,t){return new Promise(function(n){e.unmountResolves[t.name]=n;var r=e.renderResults[t.name];r&&r.unmount?r.unmount():py(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]})}function pm(e,t){return new Promise(function(n){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(n);var r=pg(e,t,null),o=e.renderResults[t.name];if(o&&o.render)o.render(r);else{var i=pu(e,t)();py(e).render(r,i)}})}function py(e){return e.ReactDOMClient||e.ReactDOM}function pg(e,t,n){var r=e.React.createElement(e.rootComponent,t),o=pc?e.React.createElement(pc.Provider,{value:t},r):r;return(e.errorBoundary||t.errorBoundary||e.errorBoundaryClass||t.errorBoundaryClass)&&(e.errorBoundaryClass=e.errorBoundaryClass||t.errorBoundaryClass||function(e,t){function n(t){e.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},n.displayName="SingleSpaReactErrorBoundary(".concat(t.name,")")}return n.prototype=Object.create(e.React.Component.prototype),n.prototype.render=function(){return this.state.caughtError?(e.errorBoundary||t.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},n.prototype.componentDidCatch=function(e,t){this.setState({caughtError:e,caughtErrorInfo:t})},n}(e,t),o=e.React.createElement(e.errorBoundaryClass,t,o)),o=e.React.createElement(e.SingleSpaRoot,pa(pa({},t),{},{mountFinished:n,updateFinished:function(){e.updateResolves[t.name]&&(e.updateResolves[t.name].forEach(function(e){return e()}),delete e.updateResolves[t.name])},unmountFinished:function(){e.unmountResolves[t.name]&&(e.unmountResolves[t.name](),delete e.unmountResolves[t.name])}}),o)}var pb=n(27807),pv=n(1619),pw=n.n(pv),p_=n(43432);let px={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},pS=new Map;(0,p_.initCache)(pS);let pE={errorRetryCount:3,fetcher:oF,focusThrottleInterval:18e5,revalidateIfStale:!0,revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshInterval:0,shouldRetryOnError:e=>{if(e instanceof oV){let t=e.response.status;return!!(t>=500)||401===t||403===t||429===t}return!0},provider:()=>pS};function pD(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw Error("Invalid options");let t=Object.assign({},px,e),n={...pE,...t.swrConfig};return function(e){var r,o,i,a,s;return i=o=class extends(r=fY().Component){componentDidCatch(e,n){n&&n.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:n.componentStack})),t.throwErrorsToConsole&&setTimeout(()=>{throw e}),this.setState({caughtError:e,caughtErrorInfo:n})}render(){if(this.state.caughtError)return fY().createElement("div",null,"An error has occurred. Please try reloading the page.");{let r=fY().createElement(fZ.Suspense,{fallback:null},fY().createElement(pv.SWRConfig,{value:n},fY().createElement(fJ.Provider,{value:this.state.config},t.disableTranslations?fY().createElement(e,this.props):fY().createElement(pb.I18nextProvider,{i18n:window.i18next,defaultNS:this.state.config.extension?`${this.state.config.moduleName}___${this.state.config.extension.extensionSlotName}___${this.state.config.extension.extensionId}`:this.state.config.moduleName},fY().createElement(e,this.props)))));return t.strictMode&&fY().StrictMode?fY().createElement(fY().StrictMode,null,r):r}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,featureName:t.featureName,extension:e._extensionContext}}}},a="displayName",s=`OpenmrsReactComponent(${t.featureName})`,a in i?Object.defineProperty(i,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[a]=s,o}}function pO(e,t){return function(e){if("object"!==ps(e))throw Error("single-spa-react requires a configuration object");var t,n=pa(pa({},pd),e);if(!n.React)throw Error("single-spa-react must be passed opts.React");if(!n.ReactDOM&&!n.ReactDOMClient)throw Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(n.renderType||(null!=(t=n.ReactDOMClient)&&t.createRoot?n.renderType="createRoot":n.renderType="render"),!n.rootComponent&&!n.loadRootComponent)throw 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");!pc&&n.React.createContext&&(pc=n.React.createContext()),n.SingleSpaRoot=function(e){function t(e){t.displayName="SingleSpaRoot(".concat(e.name,")")}return t.prototype=Object.create(e.React.Component.prototype),t.prototype.componentDidMount=function(){setTimeout(this.props.mountFinished)},t.prototype.componentWillUnmount=function(){setTimeout(this.props.unmountFinished)},t.prototype.render=function(){return setTimeout(this.props.updateFinished),this.props.children},t}(n);var r={bootstrap:pf.bind(null,n),mount:pp.bind(null,n),unmount:ph.bind(null,n)};return n.parcelCanUpdate&&(r.update=pm.bind(null,n)),r}({React:fY(),ReactDOMClient:po,rootComponent:pD(t)(e)})}function pk(e,t){return()=>e().then(({default:e})=>pO(e,t))}function pP(e,t){return()=>Promise.resolve(pO(e,t))}let pC=pk,pj=W()(()=>({}));Y("openmrs-app-context",pj);let pT={};function pR(e,t=e=>e){let n=pj.getState();return e in n?Object.freeze(Object.assign({},t?t(n[e]):n[e])):null}function pA(e,t){pj.setState(n=>(e in n||(n[e]={}),n[e]=t(n[e]),Object.assign({},n)))}function pN(e){return null===e?null:Object.freeze(Object.assign({},e))}let pM=new Map;function pI(e,t){let n=(0,fZ.useRef)(t??{}),r=(0,fZ.useRef)(t=>pA(e,t)),o=(0,fZ.useRef)(Symbol());return(0,fZ.useEffect)(()=>{let n=t??{},r=o.current;return null===pR(e)?!function(e,t=pT){pj.setState(n=>{if(e in n)throw Error(`Attempted to re-register namespace ${e} in the app context. Each namespace must be unregistered before the name can be registered again.`);return Object.assign({},n,{[e]:t===pT?{}:t})})}(e,n):(console.warn(`Namespace ${e} is already registered in the app context. This is likely a race condition during navigation, but may indicate two components are trying to own the same namespace. Updating the existing context.`),pA(e,()=>n)),pM.set(e,r),()=>{pM.get(e)===r&&(pj.setState(t=>(e in t&&delete t[e],t)),pM.delete(e))}},[e]),(0,fZ.useEffect)(()=>{let r=t??{};F(n.current,r)||(pA(e,()=>r),n.current=r)},[t]),r.current}function p$({namespace:e,value:t}){return pI(e,t),null}let pL=({children:e,value:t,fallback:n})=>t?fY().createElement(fY().Fragment,null,e):n?fY().createElement(fY().Fragment,null,n):null;function pF(){let e=(0,fZ.useRef)();return(!e.current||e.current.signal.aborted)&&(e.current=new AbortController),(0,fZ.useEffect)(()=>{let t=e.current;return()=>t?.abort()},[]),e.current}function pB(e,t=e=>e??{}){let[n,r]=(0,fZ.useState)(()=>{if(pV(e))return;let n=pR(e);if(null!==n)return t?t(n):n});return(0,fZ.useEffect)(()=>{if(pV(e))throw Error(`The namespace supplied to useAppContext must be a non-empty string, but was "${e}".`)},[e]),(0,fZ.useEffect)(()=>{var n;let o;return(n=e=>{if(null==e)return void r(void 0);let n=t?t(e):e;r(e=>F(e,n)?e:n)})(pN(o=pR(e))),pj.subscribe(t=>{let r=e in t?t[e]:null;r!==o&&(o=r,n(pN(r)))})},[e,t]),n}function pV(e){return"string"!=typeof e||0===e.trim().length}function pU(e){let t=pe(e);return(0,fZ.useMemo)(()=>t.map(e=>e.id),[t])}function pW(e){return f9(e).candidateExtensions}function pK(e,t,n){let{data:r,error:o,mutate:i,isLoading:a,isValidating:s}=pw()(e?aP(e,t,n):null,oF);return(0,fZ.useMemo)(()=>({isLoading:a,data:r?.data.results??[],error:o,mutate:i,isValidating:s}),[r,o,a,s,i])}function pz(e){(0,fZ.useEffect)(()=>{if(e){let e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[e])}let pH={},pG=`No ComponentContext has been provided. This should come from "openmrsComponentDecorator".
16
- Usually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".`;function pq(e){let{moduleName:t,extension:n}=(0,fZ.useContext)(fJ),r=e?.externalModuleName??t;if(!r&&!n)throw Error(pG);let o=function(e){let t=(0,fZ.useMemo)(()=>t3(e),[e]),n=function(e){let[t,n]=(0,fZ.useState)(()=>{let t=e.getState();return t.loaded&&t.config?t.config:null});return(0,fZ.useEffect)(()=>e?.subscribe(e=>{e.loaded&&e.config&&n(e.config)}),[e]),t}(t);if(!n)throw pH[e]||(pH[e]=new Promise(e=>{let n=t.subscribe(t=>{t.loaded&&t.config&&(e(t.config),n())})})),pH[e];return n}(r),i=function(e){let t=(0,fZ.useMemo)(t9,[]),n=function(e,t){let[n,r]=(0,fZ.useState)(t?()=>{let n=ne(e.getState(),t.extensionSlotName,t.extensionId);if(n.loaded&&n.config)return n.config}:null);return(0,fZ.useEffect)(()=>{if(t)return e.subscribe(e=>{let o=ne(e,t.extensionSlotName,t.extensionId);o.loaded&&o.config&&!tm(o.config,n)&&r(o.config)})},[e,t,n]),n}(t,e);if(!n&&e){let n=`${e.extensionSlotName}-${e.extensionId}`;throw!pH[n]&&t&&(pH[n]=new Promise(n=>{let r=t.subscribe(t=>{let o=ne(t,e.extensionSlotName,e.extensionId);o.loaded&&o.config&&(n(o.config),r())})})),pH[n]}return n||{}}(n);return(0,fZ.useMemo)(()=>e?.externalModuleName&&r===e.externalModuleName?{...o}:{...o,...i},[r,e?.externalModuleName,o,i])}let pZ=pe;function pY(){let[e,t]=(0,fZ.useState)(dM());return(0,fZ.useEffect)(()=>b(({online:e})=>t(e)),[]),e}function pJ(e,t=300){let[n,r]=(0,fZ.useState)(e);return(0,fZ.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}var pQ=n(13660),pX=n.n(pQ);let p0=`custom:${[["admissionDecisionConcept","ref"],["admissionEncounterType","ref"],["admissionForm","ref"],["atFacilityVisitType","ref"],["bedAssignmentEncounterType","ref"],["cancelADTRequestEncounterType","ref"],["checkInClerkEncounterRole","ref"],["checkInEncounterType","ref"],["clinicianEncounterRole","ref"],["conceptSourcesForDiagnosisSearch","ref"],["consultEncounterType","ref"],["consultFreeTextCommentsConcept","ref"],["denyAdmissionConcept","ref"],["diagnosisMetadata","ref"],["diagnosisSets","ref"],["dischargeForm","ref"],["dispositionDescriptor","ref"],["dispositions","ref"],["emrApiConceptSource","ref"],["exitFromInpatientEncounterType","ref"],["extraPatientIdentifierTypes","ref"],["fullPrivilegeLevel","ref"],["highPrivilegeLevel","ref"],["identifierTypesToSearch","ref"],["inpatientNoteEncounterType","ref"],["lastViewedPatientSizeLimit","ref"],["metadataSourceName","ref"],["motherChildRelationshipType","ref"],["narrowerThanConceptMapType","ref"],["nonDiagnosisConceptSets","ref"],["orderingProviderEncounterRole","ref"],["patientDiedConcept","ref"],["personImageDirectory","ref"],["primaryIdentifierType","ref"],["sameAsConceptMapType","ref"],["suppressedDiagnosisConcepts","ref"],["supportsAdmissionLocationTag","(uuid,display,name,links)"],["supportsLoginLocationTag","(uuid,display,name,links)"],["supportsTransferLocationTag","(uuid,display,name,links)"],["supportsVisitsLocationTag","(uuid,display,name,links)"],["telephoneAttributeType","ref"],["testPatientPersonAttributeType","ref"],["transferForm","ref"],["transferRequestEncounterType","ref"],["transferWithinHospitalEncounterType","ref"],["unknownCauseOfDeathConcept","ref"],["unknownLocation","ref"],["unknownPatientPersonAttributeType","ref"],["unknownProvider","ref"],["visitAssignmentHandlerAdjustEncounterTimeOfDayIfNecessary","ref"],["visitExpireHours","ref"],["visitNoteEncounterType","ref"]].map(([e,t])=>`${e}:${t}`).join(",")}`;function p1(){let e=`${oM}/emrapi/configuration?v=${p0}`,t=pX()(e,oF);return(0,fZ.useMemo)(()=>({emrConfiguration:t.data?.data,isLoadingEmrConfiguration:t.isLoading,mutateEmrConfiguration:t.mutate,errorFetchingEmrConfiguration:t.error}),[t])}let p2=f6(dV());function p4(e){let t=pe(e);return(0,fZ.useMemo)(()=>Object.fromEntries(t.map(e=>[e.name,e.meta])),[t])}let p3=f6(dY());function p6(e){let{flags:t}=f4(dC);return t[e]?.enabled??!1}function p5(){let[,e]=(0,fZ.useState)(0);return(0,fZ.useCallback)(()=>{e(e=>e+1)},[])}function p7(e,t,n={}){return p8(e,t,p9,n)}let p9={getPaginatedUrl:(e,t,n)=>{if(!e)return null;{let r=new URL(oL(e.toString()),window.location.toString());return r.searchParams.set("limit",""+t),r.searchParams.set("startIndex",""+n),r.searchParams.set("totalCount","true"),r.toString()}},getNextUrl:e=>{let t=e?.links?.find(e=>"next"==e.rel)?.uri;if(!t)return null;{let e=new URL(t);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.totalCount??NaN,getCurrentPageSize:e=>e?.results?.length??NaN,getData:e=>e?.results};function p8(e,t,n,r={}){let{getPaginatedUrl:o,getTotalCount:i,getCurrentPageSize:a,getData:s}=n,{immutable:l,swrConfig:u}=r,c=r.fetcher??oF,[d,f]=(0,fZ.useState)(1),p=(0,fZ.useRef)(NaN),h=(0,fZ.useRef)(NaN),m=(0,fZ.useRef)(d),y=(0,fZ.useRef)(!1),g=(0,fZ.useRef)(!1),b=e?.toString()??"",[v,w]=(0,fZ.useState)(b);b!==v&&(w(b),f(1),m.current=1,p.current=NaN,h.current=NaN,y.current=!1,g.current=!1);let x=(d-1)*t,S=(0,fZ.useMemo)(()=>o(e,t,x),[e,t,x]),{data:E,...D}=(l?pX():pw())(S,c,u);E?.data&&(p.current=i(E?.data),h.current=a(E?.data),y.current=!0);let O=Math.ceil(p.current/t),k=(0,fZ.useCallback)(e=>{if(!Number.isInteger(e)||e<1)return void console.warn(`useServerPagination: ignoring goTo(${e}); page must be a positive integer.`);let n=Math.ceil(p.current/t);!y.current||Number.isNaN(n)||e<=n?(m.current=e,f(e)):console.warn("Invalid attempt to go to out of bounds page: "+e)},[t]);(0,fZ.useEffect)(()=>{if(!y.current)return;if(Number.isNaN(p.current)){g.current||(g.current=!0,console.warn(`useServerPagination: ${b} returned no total count, so out-of-range pages cannot be detected.`));return}let e=Math.max(1,Math.ceil(p.current/t));d>e&&(console.warn(`Invalid attempt to go to out of bounds page: ${d}; returning to page ${e}.`),m.current=e,f(e))},[d,t,b,E]);let P=(0,fZ.useCallback)(()=>{k(m.current+1)},[k]),C=(0,fZ.useCallback)(()=>{k(m.current-1)},[k]);return{data:s(E?.data),totalPages:O,totalCount:p.current,currentPage:d,currentPageSize:h.current,paginated:O>1,showNextButton:d<O,showPreviousButton:d>1,goTo:k,goToNext:P,goToPrevious:C,...D}}function he(e,t,n={}){return p8(e,t,ht(),n)}function ht(){return{getPaginatedUrl:(e,t,n)=>{if(!e)return null;{let r=new URL(oL(e.toString()),window.location.toString());return r.searchParams.set("_count",""+t),r.searchParams.set("_getpagesoffset",""+n),r.toString()}},getNextUrl:e=>{let t=e?.link?.find(e=>"next"==e.relation)?.url;if(!t)return null;{let e=new URL(t);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.total??NaN,getCurrentPageSize:e=>e?.entry?.length??NaN,getData:e=>e?.entry?.map(e=>e.resource)}}var hn=n(30682),hr=n.n(hn);function ho(e,t={}){return hi(e,p9,t)}function hi(e,t,n={}){let{swrInfiniteConfig:r,immutable:o}=n,{getNextUrl:i,getTotalCount:a,getData:s}=t,l=n.fetcher??oF,u=(0,fZ.useCallback)((n,r)=>0==n?e?.toString()??null:t.getNextUrl(r.data),[e]),{data:c,size:d,setSize:f,...p}=hr()(u,l,{...r,...o?{revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1}:{}}),h=i(c?.[c.length-1].data),m=a(c?.[0]?.data);return{data:c?.flatMap(e=>s(e.data)),totalCount:m,hasMore:null!=h,loadMore:()=>{f((c?.length??0)+1)},nextUri:h,...p}}function ha(e,t={}){return hs(e,p9,t)}function hs(e,t,n={}){let r=hi(e,t,n),{hasMore:o,error:i,data:a,loadMore:s,isLoading:l,nextUri:u}=r;return((0,fZ.useEffect)(()=>{o&&!i&&s()},[o,u]),n.partialData)?r:{...r,data:o||i?void 0:a,isLoading:l||o}}function hl(e,t={}){return hs(e,ht(),t)}function hu(e,t={}){return hi(e,ht(),t)}function hc(){let e="tablet";return document.body.classList.forEach(t=>{switch(t){case"omrs-breakpoint-lt-tablet":e="phone";break;case"omrs-breakpoint-gt-small-desktop":e="large-desktop";break;case"omrs-breakpoint-gt-tablet":e="small-desktop"}}),e}function hd(){let[e,t]=(0,fZ.useState)(hc);return(0,fZ.useEffect)(()=>{let e=()=>{t(hc())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}let hf=e=>"small-desktop"===e||"large-desktop"===e;function hp(e){let t=(0,fZ.useContext)(fJ);(0,fZ.useEffect)(()=>(t&&t.moduleName&&(e.componentContext=t),fx(e),()=>{fS(e.name)}),[t,e])}function hh(){return f4(f_)}function hm(e=null,t=null){let[n,r]=(0,fZ.useState)([]);return(0,fZ.useEffect)(()=>{let n=cK(e,t).subscribe(e=>{r(e)},e=>{console.error(e)});return()=>n.unsubscribe()},[e,t]),n}function hy(e,t=!0){let n=(0,fZ.useRef)(null);return(0,fZ.useEffect)(()=>{let r=r=>{t&&n.current&&r.target&&r.target instanceof Node&&(n.current.contains(r.target)||e(r))};return window.addEventListener("mousedown",r),window.addEventListener("touchstart",r),()=>{window.removeEventListener("mousedown",r),window.removeEventListener("touchstart",r)}},[e,t]),n}function hg(e){let t=(0,fZ.useRef)();return(0,fZ.useEffect)(()=>{let n=new IntersectionObserver(t=>{for(let n of t)if(n.isIntersecting)return void e()},{threshold:1});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current,e]),t}function hb(e,t={}){let{abortController:n,fetchInit:r,url:o,swrConfig:i}=t,a=pF(),s=(0,fZ.useMemo)(()=>r?.signal??n?.signal??a.signal,[n?.signal,r?.signal,a.signal]),l=(0,fZ.useCallback)(e=>oF(function(e,t){if(t)return"function"==typeof t?t(e):t;if("string"==typeof e)return e;throw Error(`When using useOpenmrsSWR with a key that is not a string, you must provide a url() function that converts the key to a valid url. The key for this hook is ${e}.`)}(e,o),{...r,signal:s}),[s,r,o]);return pw()(e,l,i)}function hv(e=[],t=10){let[n,r]=(0,fZ.useState)(1),o=(0,fZ.useMemo)(()=>"number"==typeof t&&t>0?Math.max(1,Math.ceil(e.length/t)):1,[e.length,t]);n>o&&r(o);let i=Math.min(Math.max(1,n),o),a=(0,fZ.useMemo)(()=>{let n=(i-1)*t,r=(i+0)*t;return e.slice(n,r)},[e,i,t]),s=(0,fZ.useCallback)(e=>{!Number.isInteger(e)||e<1?console.warn(`usePagination: ignoring goTo(${e}); page must be a positive integer.`):r(e)},[]),l=(0,fZ.useCallback)(()=>{r(e=>e+1)},[]),u=(0,fZ.useCallback)(()=>{r(e=>Math.max(1,e-1))},[]);return(0,fZ.useMemo)(()=>({results:a,totalPages:o,currentPage:i,paginated:e.length>t,showNextButton:i<o,showPreviousButton:i>1,goTo:s,goToNext:l,goToPrevious:u}),[a,o,e.length,t,i,s,l,u])}function hw(e,t,n,r){return{pageSizes:(0,fZ.useMemo)(()=>{let n=Math.ceil(t/e);return isNaN(n)&&(n=0),[...Array(n).keys()].map(t=>(t+1)*e)},[e,t]),pageItemsCount:(0,fZ.useMemo)(()=>e>t?t:e*n>t?e*(n-1)+r:e*n,[e,t,n,r])}}function h_(){let e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function hx(e){let[t,n]=(0,fZ.useState)(e??h_()),{data:r,error:o,isValidating:i}=pw()(t?["patient",t]:null,()=>cL(t,{}));return(0,fZ.useEffect)(()=>{let e=()=>{let e=h_();e!==t&&n(e)};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)},[t]),(0,fZ.useMemo)(()=>({isLoading:i&&!o&&!r,patient:r,patientUuid:t,error:o}),[i,o,r,t])}function hS(){let e=`${oM}/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType`,{data:t,error:n,isLoading:r}=pw()(e,oF);return(0,fZ.useMemo)(()=>({primaryIdentifierCode:t?.data?.results[0]?.metadataUuid,isLoading:r,error:n}),[t,n,r])}function hE(e){let{extensions:t,extensionSlotModuleName:n}=pt(e);return e?t.map(t=>({state:r})=>fY().createElement(fJ.Provider,{value:{moduleName:n,featureName:"",extension:{extensionId:t.id,extensionSlotName:e,extensionSlotModuleName:n}}},fY().createElement(fX,{state:r}))):[]}function hD(){let e=(0,fZ.useRef)(),[t,n]=(0,fZ.useState)(null),r=null;if(!t){if(s){let e=oz().getState();e.loaded&&(r=e.session)}else s=new Promise(t=>{let n=({loaded:n,session:o})=>{n&&(t(o),r=o,e.current&&(e.current(),e.current=void 0))};n(oz().getState()),r||(e.current=oz().subscribe(n))});if(r)n(r);else throw s}(0,fZ.useEffect)(()=>(e.current||(e.current=oz().subscribe(({loaded:e,session:t})=>{e&&(r=t,n(t))})),()=>{e.current&&(e.current(),e.current=void 0)}),[]);let o=t||r;if(!o)if(s)throw console.warn("useSession is in an unexpected state. Attempting to recover."),s;else throw Error("useSession is in an invalid state.");return o}let hO=({privilege:e,fallback:t,children:n})=>{let[r,o]=(0,fZ.useState)(null);return((0,fZ.useEffect)(()=>{let e=oK({includeAuthStatus:!1}).subscribe(o);return()=>e.unsubscribe()},[]),r&&oZ(e,r))?fY().createElement(fY().Fragment,null,n):t?fY().createElement(fY().Fragment,null,t):null};var hk=n(80222),hP=n.n(hk),hC=n(85602);let hj=new Map;function hT(){for(let e of Array.from(hj.values()))e()}let hR={setVisitContext:(e,t)=>null==t?{manuallySetVisitUuid:null}:{manuallySetVisitUuid:t.uuid,patientUuid:t.patient?.uuid}};function hA(e){let t=(0,fZ.useId)();return(0,fZ.useEffect)(()=>{if(e)return hj.set(t,e),()=>{hj.delete(t)}},[t,e]),{...f3(cQ(),hR),mutateVisit:hT}}function hN(e,t=cY){let n=(0,fZ.useRef)(void 0),{patientUuid:r,manuallySetVisitUuid:o,setVisitContext:i}=hA((0,fZ.useCallback)(()=>n.current?.(),[])),a=e&&r==e?o:null,s=`?patient=${e}&v=${t}&includeInactive=false`,l=`/${a}?v=${t}`,{data:u,error:c,mutate:d,isValidating:f}=pw()(e?`${oM}/visit${s}`:null,oF),{data:p,error:h,mutate:m,isValidating:y}=pw()(e&&a?`${oM}/visit${l}`:null,oF),g=(0,fZ.useMemo)(()=>u?.data.results.find(e=>null===e.stopDatetime)??null,[u]),b=(0,fZ.useMemo)(()=>a&&p?p.data:null,[p,a]),v=(0,fZ.useRef)(null);(0,fZ.useEffect)(()=>{!f&&g&&r===e&&null===o&&i(g),y||(v.current&&b&&v.current.uuid===b.uuid&&!v.current.stopDatetime&&b.stopDatetime&&i(null),v.current=b)},[b,o,g,f,y,r]);let w=(0,fZ.useCallback)(()=>{d(),m()},[d,m]);(0,fZ.useEffect)(()=>{n.current=w},[w]);let x=!!(!u||a&&!p),S=!!(a?h:c);return{error:c||h,mutate:w,isValidating:f||y,activeVisit:g,currentVisit:b,currentVisitIsRetrospective:!!a,isLoading:x&&!S}}function hM(){let[e,t]=(0,fZ.useState)([]);return(0,fZ.useEffect)(()=>{let e=cH().subscribe(e=>{t(e)},e=>console.error(e));return()=>e.unsubscribe()},[]),e}hP().extend(hC);let hI=new Map;async function h$(e,t){let n=t.indexOf("#"),r=n>=0,o=r?t.substring(0,n):e,i=r?t.substring(n+1):t,a=await at(o);return a&&Object.hasOwn(a,i)&&"function"==typeof a[i]?hF(o,a).then(()=>a[i]()):(a?a&&Object.hasOwn(a,i)?console.warn(`The export ${t}, defined in ${e}'s routes.json, is not a function`):console.warn(`${o} does not define a component called "${i}", referenced in ${e}'s routes.json. This cannot be loaded.`):console.warn(`Unknown app ${o} for ${t} defined in ${e}'s routes.json`),hL)}let hL={bootstrap:()=>Promise.resolve(),mount:()=>Promise.resolve(),unmount:()=>Promise.resolve()};async function hF(e,t){if(e in hI)await hI[e];else{let n=t??await at(e);await (hI[e]=new Promise((t,r)=>{if(Object.hasOwn(n,"startupApp")){let o=n.startupApp;if("function"==typeof o)return Promise.resolve(o()).then(()=>{n_(e),t(null)}).catch(r)}n_(e),t(null)}))}}function hB(e,t){let n=t.name;if(!n)return void console.error(`An extension definition in ${e} is missing an name and thus cannot be
15
+ ${this.stack}`}}let oU=Z("session",{loaded:!1,session:null}),oW=0;function oK(e={includeAuthStatus:!0}){return(oW<Date.now()-6e4||!oU.getState().loaded)&&oG(),new eg.c(t=>{let n=n=>{n.loaded&&(e.includeAuthStatus?t.next(n.session):t.next(n.session?.user))};return n(oU.getState()),oU.subscribe(n)})}function oz(){return(oW<Date.now()-6e4||!oU.getState().loaded)&&oG(),oU}function oH(e){let t=e.locale??e.user?.userProperties?.defaultLocale;t&&t.includes("_")&&(t=t.replaceAll("_","-")),function(e){if(void 0===e||"string"!=typeof e)return!1;try{new Intl.Locale(e)}catch(e){return!1}return!0}(t)&&t!==document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",t)}function oG(e,t){oW=Date.now();let n={};return e&&t&&(n.Authorization=`Basic ${window.btoa(`${e}:${t}`)}`),o0(oF(o$,{headers:n}))}function oq(){oU.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})}function oZ(e,t){var n,r;if(void 0===t)return!e;if(!e)return!0;return n=e,r=t,("string"==typeof n?!ee(r.privileges.find(e=>n===e.display)):Array.isArray(n)?n.every(e=>!ee(r.privileges.find(t=>e===t.display))):(ee(n)||console.error(`Could not understand privileges "${n}"`),!0))||!ee(t.roles.find(e=>"System Developer"===e.display))}function oY(){let e,t;return new Promise(n=>{let r=r=>{r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};r(oU.getState()),e||(t=oU.subscribe(r))})}function oJ(){return new Promise((e,t)=>{oK().subscribe(t=>{e(t.sessionLocation)},t).unsubscribe()})}async function oQ(e,t){return o0(oF(o$,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal}))}async function oX(e,t,n){return n||(n=new AbortController),await oF(`${oN}/user/${e}`,{method:"POST",body:{userProperties:t},headers:{"Content-Type":"application/json"},signal:n.signal}),oG()}function o0(e){return new Promise((t,n)=>{e.then(e=>{let r;"object"==typeof e?.data?(r={loaded:!0,session:e.data},oU.setState(r),t(r)):(r={loaded:!1,session:null},oU.setState(r),n(r))}).catch(e=>{I(`Failed to fetch new session information: ${e}`);let t={loaded:!1,session:null};oU.setState(t),n(t)})})}function o1(){return"development"===window.spaEnv||"true"===localStorage.getItem("openmrs:devtools")}oU.subscribe(e=>{e.loaded&&e.session&&oH(e.session)});let o2={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"};function o4(){nv("@openmrs/esm-api",oA),oG()}let o3={address1:"Address line 1",address2:"Address line 2",address3:"Address line 3",address4:"Address line 4",address5:"Address line 5",address6:"Address line 6",city:"City",cityVillage:"City",country:"Country",countyDistrict:"District",district:"District",postalCode:"Postal code",state:"State",stateProvince:"State",closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",closingAllWorkspacesPromptTitle:"You have unsaved changes",discard:"Discard",hide:"Hide",maximize:"Maximize",minimize:"Minimize",openAnyway:"Open anyway",unsavedChangesInOpenedWorkspace:"You may have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header",discardUnsavedChangesPromptBodyMultiple:"{{count}} workspaces have unsaved changes. Closing them will discard the changes:",discardUnsavedChangesPromptBodySingle:"<strong>{{workspaceTitle}}</strong> has unsaved changes. Closing it will discard them.",discardUnsavedChangesPromptTitle:"Discard unsaved changes?",keepEditing:"Keep editing",abnormalValue:"Abnormal value",actions:"Actions",actionableNotification:"Actionable notification",address:"Address",age:"Age",batchActionItemSelected:"{{totalSelected}} item selected",batchActionsItemsSelected:"{{totalSelected}} items selected",cancel:"Cancel",change:"Change",Clinic:"Clinic",close:"Close",closesActionableNotification:"Close actionable notification",closeSnackbar:"Close snackbar",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",delete:"Delete",discardChanges:"Discard changes",edit:"Edit",emptyStateText:"There are no {{displayText}} to display",error:"Error",errorCopy:"Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",errorLoadingLoginLocations:"Unable to load login locations. Please try again or contact support if the problem persists.",female:"Female",leftNavigation:"Left navigation",loading:"Loading",localVersion:"Local Build",male:"Male",noResultsToDisplay:"No results to display",notAvailable:"Not available",other:"Other",paginationItemsCount:"{{pageItemsCount}} / {{totalItems}} items",paginationOfPages:"of {{count}} pages",patientAvatarAlt:"Avatar for {{patientName}}",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",patientPhotoAlt:"Profile photo of {{patientName}}",patientPhotoPlaceholder:"Photo placeholder for {{patientName}}",prereleaseVersion:"Prerelease",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",recordNewEntry:"Record {{displayText}}",relationships:"Relationships",resetOverrides:"Reset overrides",save:"Save",scriptLoadingFailed:"Error: Script failed to load",scriptLoadingError:"Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",searchForLocation:"Search for a location",seeAll:"See all",seeMoreLists:"See {{count}} more lists",selectAll:"Select all",sex:"Sex",showLess:"Show less",showMore:"Show more",snackbarNotification:"Snackbar notification",toggleDevTools:"Toggle dev tools",unknown:"Unknown",yearAbbreviation:"yr",yearsAbbreviation:"yrs"},o6=e=>"string"==typeof e,o5=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},o7=e=>null==e?"":""+e,o9=/###/g,o8=e=>e&&e.indexOf("###")>-1?e.replace(o9,"."):e,ie=e=>!e||o6(e),it=(e,t,n)=>{let r=o6(t)?t.split("."):t,o=0;for(;o<r.length-1;){if(ie(e))return{};let t=o8(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return ie(e)?{}:{obj:e,k:o8(r[o])}},ir=(e,t,n)=>{let{obj:r,k:o}=it(e,t,Object);if(void 0!==r||1===t.length){r[o]=n;return}let i=t[t.length-1],a=t.slice(0,t.length-1),s=it(e,a,Object);for(;void 0===s.obj&&a.length;)i=`${a[a.length-1]}.${i}`,s=it(e,a=a.slice(0,a.length-1),Object),s?.obj&&void 0!==s.obj[`${s.k}.${i}`]&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=n},io=(e,t)=>{let{obj:n,k:r}=it(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},ii=(e,t,n)=>{for(let r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?o6(e[r])||e[r]instanceof String||o6(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):ii(e[r],t[r],n):e[r]=t[r]);return e};var ia={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};let is=e=>o6(e)?e.replace(/[&<>"'\/]/g,e=>ia[e]):e,il=[" ",",","?","!",";"],iu=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),ic=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let r=t.split(n),o=e;for(let e=0;e<r.length;){let t;if(!o||"object"!=typeof o)return;let i="";for(let a=e;a<r.length;++a)if(a!==e&&(i+=n),i+=r[a],void 0!==(t=o[i])){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<r.length-1)continue;e+=a-e+1;break}o=t}return o},id=e=>e?.replace("_","-"),ip={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class ih{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||ip,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(o6(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new ih(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new ih(this.logger,e)}}var im=new ih;class iy{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let o=0;o<r;o++)n.apply(n,[e,...t])})}}class ig extends iy{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let o,i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,a=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):o6(n)&&i?o.push(...n.split(i)):o.push(n)));let s=io(this.data,o);return(!s&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),!s&&a&&o6(n))?ic(this.data?.[e]?.[t],n,i):s}addResource(e,t,n,r,o={silent:!1}){let i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),ir(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(o6(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o,i={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let s=io(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?ii(s,n,o):s={...s,...n},ir(this.data,a,s),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var ib={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,o)??t}),t}};let iv=Symbol("i18next/PATH_KEY");function iw(e,t){let n,r,o,{[iv]:i}=e((r=[],(o=Object.create(null)).get=(e,t)=>(n?.revoke?.(),t===iv)?r:(r.push(t),(n=Proxy.revocable(e,o)).proxy),Proxy.revocable(Object.create(null),o).proxy));return i.join(t?.keySeparator??".")}let i_={},ix=e=>!o6(e)&&"boolean"!=typeof e&&"number"!=typeof e;class iS extends iy{constructor(e,t={}){super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=im.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(null==e)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let o=ix(r.res);return!1!==n.returnObjects||!o}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,n)=>{t=t||"",n=n||"";let r=il.filter(e=>0>t.indexOf(e)&&0>n.indexOf(e));if(0===r.length)return!0;let o=iu.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`),i=!o.test(e);if(!i){let t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r);if(i&&!a){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:o6(o)?[o]:o};let i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:o6(o)?[o]:o}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=iw(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]);let o=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],r),l=s[s.length-1],u=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");let c=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode")return d?o?{res:`${l}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${u}${a}`:o?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:a;let f=this.resolve(e,r),p=f?.res,h=f?.usedKey||a,m=f?.exactUsedKey||a,y=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==r.count&&!o6(r.count),v=iS.hasDefaultValue(r),w=b?this.pluralResolver.getSuffix(c,r.count,r):"",x=r.ordinal&&b?this.pluralResolver.getSuffix(c,r.count,{ordinal:!1}):"",S=b&&!r.ordinal&&0===r.count,E=S&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${w}`]||r[`defaultValue${x}`]||r.defaultValue,D=p;g&&!p&&v&&(D=E);let O=ix(D),P=Object.prototype.toString.apply(D);if(g&&D&&O&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(P)&&!(o6(y)&&Array.isArray(D))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,D,{...r,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return o?(f.res=e,f.usedParams=this.getUsedParamsDetails(r),f):e}if(i){let e=Array.isArray(D),t=e?[]:{},n=e?m:h;for(let e in D)if(Object.prototype.hasOwnProperty.call(D,e)){let o=`${n}${i}${e}`;v&&!p?t[e]=this.translate(o,{...r,defaultValue:ix(E)?E[e]:void 0,...{joinArrays:!1,ns:s}}):t[e]=this.translate(o,{...r,joinArrays:!1,ns:s}),t[e]===o&&(t[e]=D[e])}p=t}}else if(g&&o6(y)&&Array.isArray(p))(p=p.join(y))&&(p=this.extendTranslation(p,e,r,n));else{let t=!1,o=!1;!this.isValidLookup(p)&&v&&(t=!0,p=E),this.isValidLookup(p)||(o=!0,p=a);let s=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:p,d=v&&E!==p&&this.options.updateMissing;if(o||t||d){if(this.logger.log(d?"updateKey":"missingKey",c,l,a,d?E:p),i){let e=this.resolve(a,{...r,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);let n=(e,t,n)=>{let o=v&&n!==p?n:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,o,d,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,o,d,r),this.emit("missingKey",e,l,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,r);S&&r[`defaultValue${this.options.pluralSeparator}zero`]&&0>t.indexOf(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],a+t,r[`defaultValue${t}`]||E)})}):n(e,a,E))}p=this.extendTranslation(p,e,r,f,n),o&&p===a&&this.options.appendNamespaceToMissingKey&&(p=`${l}${u}${a}`),(o||t)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${a}`:a,t?p:void 0,r))}return o?(f.res=p,f.usedParams=this.getUsedParamsDetails(r),f):p}extendTranslation(e,t,n,r,o){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){let i;n.interpolation&&this.interpolator.init({...n,...{interpolation:{...this.options.interpolation,...n.interpolation}}});let a=o6(e)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){let t=e.match(this.interpolator.nestingRegexp);i=t&&t.length}let s=n.replace&&!o6(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp);i<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>o?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}let i=n.postProcess||this.options.postProcess,a=o6(i)?[i]:i;return null!=e&&a?.length&&!1!==n.applyPostProcessor&&(e=ib.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,o,i,a;return o6(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),l=s.key;r=l;let u=s.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let c=void 0!==t.count&&!o6(t.count),d=c&&!t.ordinal&&0===t.count,f=void 0!==t.context&&(o6(t.context)||"number"==typeof t.context)&&""!==t.context,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(e=>{this.isValidLookup(n)||(a=e,!i_[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(i_[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(r=>{let a;if(this.isValidLookup(n))return;i=r;let s=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(s,l,r,e,t);else{let e;c&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(t.ordinal&&0===e.indexOf(o)&&s.push(l+e.replace(o,this.options.pluralSeparator)),s.push(l+e),d&&s.push(l+n)),f){let r=`${l}${this.options.contextSeparator||"_"}${t.context}`;s.push(r),c&&(t.ordinal&&0===e.indexOf(o)&&s.push(r+e.replace(o,this.options.pluralSeparator)),s.push(r+e),d&&s.push(r+n))}}for(;a=s.pop();)this.isValidLookup(n)||(o=a,n=this.getResource(r,e,a,t))}))})}),{res:n,usedKey:r,exactUsedKey:o,usedLng:i,usedNS:a}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=e.replace&&!o6(e.replace),n=t?e.replace:e;if(t&&void 0!==e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!t)for(let e of(n={...n},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete n[e];return n}static hasDefaultValue(e){let t="defaultValue";for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}class iE{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=im.create("languageUtils")}getScriptPartFromCode(e){if(!(e=id(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=id(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(o6(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)?t:this.options.lowerCaseLng?e.toLowerCase():e}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(0>e.indexOf("-")&&0>r.indexOf("-"))&&(e.indexOf("-")>0&&0>r.indexOf("-")&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),o6(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return o6(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):o6(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{0>r.indexOf(e)&&o(this.formatLanguageCode(e))}),r}}let iD={zero:0,one:1,two:2,few:3,many:4,other:5},iO={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class iP{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=im.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n,r=id("dev"===e?"en":e),o=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:o});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];try{n=new Intl.PluralRules(r,{type:o})}catch(o){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),iO;if(!e.match(/-|_/))return iO;let r=this.languageUtils.getLanguagePartFromCode(e);n=this.getRule(r,t)}return this.pluralRulesCache[i]=n,n}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return(n||(n=this.getRule("dev",t)),n)?n.resolvedOptions().pluralCategories.sort((e,t)=>iD[e]-iD[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}let ik=(e,t,n,r=".",o=!0)=>{let i,a=void 0!==(i=io(e,n))?i:io(t,n);return!a&&o&&o6(n)&&void 0===(a=ic(e,n,r))&&(a=ic(t,n,r)),a};class iC{constructor(e={}){this.logger=im.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:m,maxReplaces:y,alwaysFormat:g}=e.interpolation;this.escape=void 0!==t?t:is,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):i||"{{",this.suffix=a?a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):f||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=p?p.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):h||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=m||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==g&&g,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let o,i,a,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(0>e.indexOf(this.formatSeparator)){let o=ik(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}let o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(ik(t,s,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp();let u=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e.replace(/\$/g,"$$$$")},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e).replace(/\$/g,"$$$$"):e.replace(/\$/g,"$$$$")}].forEach(t=>{for(a=0;o=t.regex.exec(e);){let n=o[1].trim();if(void 0===(i=l(n)))if("function"==typeof u){let t=u(e,o,r);i=o6(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else if(c){i=o[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i="";else o6(i)||this.useRawValueToEscape||(i=o7(i));let s=t.safeValue(i);if(e=e.replace(o[0],s),c?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,o,i,a=(e,t)=>{let n=this.nestingOptionsSeparator;if(0>e.indexOf(n))return e;let r=e.split(RegExp(`${n}[ ]*{`)),o=`{${r[1]}`;e=r[0];let a=(o=this.interpolate(o,i)).match(/'/g),s=o.match(/"/g);((a?.length??0)%2!=0||s)&&s.length%2==0||(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];(i=(i={...n}).replace&&!o6(i.replace)?i.replace:i).applyPostProcessor=!1,delete i.defaultValue;let l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(s=r[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),(o=t(a.call(this,r[1].trim(),i),i))&&r[0]===e&&!o6(o))return o;o6(o)||(o=o7(o)),o||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),o=""),s.length&&(o=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),o.trim())),e=e.replace(r[0],o),this.regexp.lastIndex=0}return e}}let ij=e=>{let t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});let a=r+JSON.stringify(i),s=t[a];return s||(s=e(id(r),o),t[a]=s),s(n)}},iT=e=>(t,n,r)=>e(id(n),r)(t);class iR{constructor(e={}){this.logger=im.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let n=t.cacheInBuiltFormats?ij:iT;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ij(t)}format(e,t,n,r={}){let o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&0>o[0].indexOf(")")&&o.find(e=>e.indexOf(")")>-1)){let e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}return o.reduce((e,t)=>{let{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){let r=e.split("(");t=r[0].toLowerCase().trim();let o=r[1].substring(0,r[1].length-1);"currency"===t&&0>o.indexOf(":")?n.currency||(n.currency=o.trim()):"relativetime"===t&&0>o.indexOf(":")?n.range||(n.range=o.trim()):o.split(";").forEach(e=>{if(e){let[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{let a=r?.formatParams?.[r.interpolationkey]||{},s=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,s,{...i,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e)}}class iA extends iy{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=im.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let o={},i={},a={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let a={};this.queue.forEach(n=>{((e,t,n,r)=>{let{obj:o,k:i}=it(e,t,Object);o[i]=o[i]||[],o[i].push(n)})(n.loaded,[o],i),void 0!==n.pending[e]&&(delete n.pending[e],n.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,o=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;let a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*o,i)},o):i(a,s)},s=this.backend[n].bind(this.backend);if(2===s.length){try{let n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}return}return s(e,t,a)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();o6(e)&&(e=this.languageUtils.toResolveHierarchy(e)),o6(t)&&(t=[t]);let o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){let n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o,i={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");if(null!=n&&""!==n){if(this.backend?.create){let s={...i,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let o;(o=5===l.length?l(e,t,n,r,s):l(e,t,n,r))&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(e){a(e)}else l(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}let iM=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),o6(e[1])&&(t.defaultValue=e[1]),o6(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),iN=e=>(o6(e.ns)&&(e.ns=[e.ns]),o6(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),o6(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),iI=()=>{};class i$ extends iy{constructor(e={},t){if(super(),this.options=iN(e),this.services={},this.logger=im,this.modules={external:[]},(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})})(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(o6(e.ns)?e.defaultNS=e.ns:0>e.ns.indexOf("translation")&&(e.defaultNS=e.ns[0]));let n=iM();this.options={...n,...this.options,...iN(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);let r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?im.init(r(this.modules.logger),this.options):im.init(null,this.options),e=this.modules.formatter?this.modules.formatter:iR;let t=new iE(this.options);this.store=new ig(this.options.resources,this.options);let o=this.services;o.logger=im,o.resourceStore=this.store,o.languageUtils=t,o.pluralResolver=new iP(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(o.formatter=r(e),o.formatter.init&&o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new iC(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new iA(r(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(o.languageDetector=r(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=r(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new iS(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=iI),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let o=o5(),i=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?i():setTimeout(i,0),o}loadResources(e,t=iI){let n=t,r=o6(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return n();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=o5();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=iI),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&ib.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&0>this.languages.indexOf(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=o5();this.emit("languageChanging",e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,i)=>{i?this.isLanguageChangingTo===e&&(r(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(o,(...e)=>this.t(...e))},i=t=>{e||t||!this.services.languageDetector||(t=[]);let n=o6(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(o6(t)?[t]:t);i&&(this.language||r(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector?.cacheUserLanguage?.(i)),this.loadResources(i,e=>{o(e,i)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}getFixedT(e,t,n){let r=(e,t,...o)=>{let i,a;(i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(o)):{...t}).lng=i.lng||r.lng,i.lngs=i.lngs||r.lngs,i.ns=i.ns||r.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||r.keyPrefix);let s=this.options.keySeparator||".";return i.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=iw(e,{...this.options,...t})),`${i.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=iw(e,{...this.options,...t})),a=i.keyPrefix?`${i.keyPrefix}${s}${e}`:e),this.t(a,i)};return o6(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;let i=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return -1===n||0===n||2===n};if(t.precheck){let e=t.precheck(this,i);if(void 0!==e)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!r||i(o,e)))}loadNamespaces(e,t){let n=o5();return this.options.ns?(o6(e)&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=o5();o6(e)&&(e=[e]);let r=this.options.preload||[],o=e.filter(e=>0>r.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}let t=this.services?.languageUtils||new iE(iM());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new i$(e,t)}cloneInstance(e={},t=iI){let n=e.forkResourceStore;n&&delete e.forkResourceStore;let r={...this.options,...e,isClone:!0},o=new i$(r);return(void 0!==e.debug||void 0!==e.prefix)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new ig(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),r),o.services.resourceStore=o.store),o.translator=new iS(o.services,r),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let iL=i$.createInstance();iL.createInstance=i$.createInstance,iL.createInstance,iL.dir,iL.init,iL.loadResources,iL.reloadResources,iL.use,iL.changeLanguage,iL.getFixedT,iL.t,iL.exists,iL.setDefaultNamespace,iL.hasLoadedNamespace,iL.loadNamespaces,iL.loadLanguages;let iF=iL.default||iL;function iB(e,t,n,r){return iF.t(t,{ns:e,defaultValue:n,...r})}function iV(e,t,n){return o3[e]?iB("core",e,t??o3[e],n):(console.error(`O3 Core Translations does not provide key '${e}'. The key itself is being rendered as text.`),e)}iF.on("initialized",function(){window.i18next.loadNamespaces(["core"])});let iU="import-map-override:",iW="import-map-overrides-disabled",iK="import-map-overrides:change",iz=!1,iH=null,iG=null;async function iq(){return iG??(iG=iZ().then(({map:e,complete:t})=>(t||(iG=null),e))),iG}async function iZ(){let e=document.querySelectorAll('script[type="systemjs-importmap"]'),t=[],n=!0;for(let r=0;r<e.length;r++){let o=e[r];try{if(o.src){let e=await fetch(o.src);if(!e.ok)throw Error(`Request for ${o.src} returned ${e.status} ${e.statusText}`);t.push(await e.json())}else o.textContent&&t.push(JSON.parse(o.textContent))}catch(e){n=!1,console.warn(`[import-maps] Failed to parse import map from script tag at index ${r}`,e)}}return{map:iY(t),complete:n}}function iY(e){let t={imports:{}};for(let n of e)n?.imports&&Object.assign(t.imports,n.imports);return t}function iJ(){let e={};try{let t=i2();for(let n=0;n<localStorage.length;n++){let r=localStorage.key(n);if(r?.startsWith(iU)){let n=r.slice(iU.length);if(!t.includes(n)){let t=localStorage.getItem(r);t&&(e[n]=t)}}}}catch(e){console.warn("[import-maps] Failed to read import-map overrides from localStorage",e)}return{imports:e}}async function iQ(){let e=await iq();return iz?iY([e,iH??iJ()]):e}async function iX(){return iq()}async function i0(){return iz?iY([await iq(),iJ()]):iq()}function i1(e){if(!iz)return{imports:{}};if(e){let e={};for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);if(n?.startsWith(iU)){let t=localStorage.getItem(n);t&&(e[n.slice(iU.length)]=t)}}return{imports:e}}return iJ()}function i2(){if(!iz)return[];try{let e=localStorage.getItem(iW);if(e){let t=JSON.parse(e);if(Array.isArray(t))return t}}catch{}return[]}function i4(e){return!!iz&&i2().includes(e)}function i3(e,t){if(!iz)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{localStorage.setItem(iU+e,t),window.dispatchEvent(new CustomEvent(iK))}catch(e){console.warn("[import-maps] Failed to write import-map override to localStorage",e)}}function i6(e){if(!iz)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{localStorage.removeItem(iU+e);let t=i2().filter(t=>t!==e);t.length>0?localStorage.setItem(iW,JSON.stringify(t)):localStorage.removeItem(iW),window.dispatchEvent(new CustomEvent(iK))}catch(e){console.warn("[import-maps] Failed to update import-map overrides in localStorage",e)}}function i5(){if(!iz)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n?.startsWith(iU)&&e.push(n)}e.forEach(e=>localStorage.removeItem(e)),localStorage.removeItem(iW),window.dispatchEvent(new CustomEvent(iK))}catch(e){console.warn("[import-maps] Failed to clear import-map overrides from localStorage",e)}}function i7(e){if(!iz)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{let t=i2().filter(t=>t!==e);t.length>0?localStorage.setItem(iW,JSON.stringify(t)):localStorage.removeItem(iW),window.dispatchEvent(new CustomEvent(iK))}catch(e){console.warn("[import-maps] Failed to update import-map overrides in localStorage",e)}}let i9=!1;function i8(){!i9&&(i9=!0,(iz="development"===window.spaEnv)&&(iH=iJ()))}function ae(e){return e.replace(/[\/\-@]/g,"_")}async function at(e,t="./start",r){var o;let i,a=!r?.maxLoadingTime||r.maxLoadingTime<=0?6e5:r.maxLoadingTime;await Promise.race([an(e,r?.importMap),new Promise((t,n)=>{i=setTimeout(()=>{var t;n(Error(`Could not resolve requested script, ${e}, within ${(t=a)<1e3?`${t} milliseconds`:t<6e4?`${Math.floor(t/1e3)} seconds`:t<36e5?`${Math.floor(t/6e4)} minutes`:t<864e5?`${Math.floor(t/36e5)} hours`:`${Math.floor(t/864e5)} days`}.`))},a)})]),i&&clearTimeout(i);let s=ae(e),l=window[s];if(!("object"==typeof(o=l)&&null!==o&&"init"in o&&"function"==typeof o.init&&"get"in o&&"function"==typeof o.get)){let e=`The global variable ${s} does not refer to a federated module`;throw console.error(e),Error(e)}l.init(n.S.default);let u=(await l.get(t))();if("object"!=typeof u||null===u){let t=`Container for ${e} did not return an ESM module as expected`;throw console.error(t),Error(t)}return u}async function an(e,t){if("string"!=typeof e||0===e.trim().length){let e="Attempted to call importDynamic() without supplying a package to load";throw console.error(e),Error(e)}let n=ae(e);if(!window[n]){let n=t??await ar();if(!n.imports.hasOwnProperty(e)){let t=`Could not find the package ${e} defined in the current importmap`;throw console.error(t),Error(t)}let r=n.imports[e];r.startsWith("./")&&(r=window.spaBase+r.substring(1));let o=e in i1().imports;try{return await function(e){var t;let n=(t=window)[ao]??(t[ao]=new Map),r=n.get(e);if(r)return r;if(document.head.querySelector(`script[src="${e}"]`))return console.warn(`Script at ${e} already loaded. Not loading it again.`),Promise.resolve();let o=document.createElement("script");o.src=e,o.type="text/javascript",o.async=!0;let i=new Promise((t,r)=>{let i=setTimeout(()=>{console.error(`The script at ${e} did not load within 5 seconds. This may indicate an issue with the imports in the script's entry-point file or with the script's bundler configuration.`)},5e3);function a(){clearTimeout(i),o.removeEventListener("load",s),o.removeEventListener("error",l)}function s(){a(),t()}function l(t){a(),n.delete(e),o.remove();let i=`Failed to load script from ${e}`;console.error(i,t),r(t.message??i)}o.addEventListener("load",s),o.addEventListener("error",l),document.head.appendChild(o)});return n.set(e,i),i}(r)}catch(e){return o&&T({kind:"error",title:iV("scriptLoadingFailed","Error: Script failed to load"),description:iV("scriptLoadingError","Failed to load overridden script from {{- url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",{url:r}),actionButtonLabel:iV("resetOverrides","Reset overrides"),onActionButtonClick(){i5(),window.location.reload()}}),Promise.reject(e)}}return Promise.resolve()}async function ar(){return iQ()}let ao=Symbol.for("__openmrs_script_loading");function ai(e){return!!e&&"object"==typeof e&&!(Object.hasOwn(e,"pages")&&(!e.pages||!Array.isArray(e.pages))||Object.hasOwn(e,"extensions")&&(!e.extensions||!Array.isArray(e.extensions))||Object.hasOwn(e,"workspaces")&&(!e.workspaces||!Array.isArray(e.workspaces))||Object.hasOwn(e,"modals")&&(!e.modals||!Array.isArray(e.modals)))}function aa(e){return!!e&&"object"==typeof e&&"routes"in e&&!!e.routes&&"object"==typeof e.routes&&Object.entries(e.routes).every(([e,t])=>"string"==typeof e&&ai(t))}let as="openmrs-routes:",al="openmrs-routes:change",au=!1,ac=null,ad=null;async function af(){return ad??(ad=ap().then(({map:e,complete:t})=>(t||(ad=null),e))),ad}async function ap(){let e=document.querySelectorAll("script[type='openmrs-routes']"),t=[],n=!0;for(let r=0;r<e.length;r++){let o=e[r];try{let e;if(o.src){let t=await fetch(o.src);if(!t.ok)throw Error(`Request for ${o.src} returned ${t.status} ${t.statusText}`);e=await t.json()}else o.textContent&&(e=JSON.parse(o.textContent));e&&aa(e)&&t.push(e)}catch(e){n=!1,console.warn(`[route-maps] Failed to parse routes from script tag at index ${r}`,e)}}return{map:ah(t),complete:n}}function ah(e){let t={routes:{}};for(let n of e)n&&"object"==typeof n&&!Array.isArray(n)&&(Object.assign(t.routes,n.routes),void 0===t.version&&void 0!==n.version&&(t.version=n.version));return t}async function am(){let e={version:void 0,routes:{}};try{let t=[];for(let e=0;e<localStorage.length;e++){let n=localStorage.key(e);if(n?.startsWith(as)){let e=localStorage.getItem(n);e&&t.push({moduleName:n.slice(as.length),raw:e})}}for(let n of(await Promise.allSettled(t.map(async({moduleName:e,raw:t})=>{let n=JSON.parse(t);if(ai(n))return{moduleName:e,routes:n};if("string"==typeof n&&n.startsWith("http")){let t=await fetch(n),r=await t.json();if(ai(r))return{moduleName:e,routes:r};throw Error(`${n} did not resolve to a valid OpenmrsAppRoutes object`)}throw Error(`Override for ${e} is neither a valid routes object nor a URL`)}))))"fulfilled"===n.status?e.routes[n.value.moduleName]=n.value.routes:console.warn("[route-maps] Failed to load route override",n.reason)}catch(e){console.warn("[route-maps] Failed to read route overrides from localStorage",e)}return e}async function ay(){let e=await af();return au?ah([e,ac??await am()]):e}async function ag(){return af()}async function ab(){return au?ah([await af(),await am()]):af()}function av(){if(!au)return{};let e={};try{for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);if(n?.startsWith(as)){let t=localStorage.getItem(n);t&&(e[n.slice(as.length)]=t)}}}catch(e){console.warn("[route-maps] Failed to read route overrides from localStorage",e)}return e}function aw(e,t){if(!au)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{if("string"==typeof t)if(t.startsWith("http"))localStorage.setItem(as+e,JSON.stringify(t));else{let n=JSON.parse(t);if(!ai(n))return void console.error(`The supplied routes for ${e} is not a valid OpenmrsAppRoutes object`,t);localStorage.setItem(as+e,JSON.stringify(n))}else if(t instanceof URL)localStorage.setItem(as+e,JSON.stringify(t.toString()));else{if(!ai(t))return void console.error(`Override for ${e} is not in a valid format. Expected either a Javascript Object, a JSON string of a Javascript object, or a URL`,t);localStorage.setItem(as+e,JSON.stringify(t))}window.dispatchEvent(new CustomEvent(al))}catch(e){console.warn("[route-maps] Failed to write route override to localStorage",e)}}function a_(e){if(!au)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{localStorage.removeItem(as+e),window.dispatchEvent(new CustomEvent(al))}catch(e){console.warn("[route-maps] Failed to remove route override from localStorage",e)}}function ax(){if(!au)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n?.startsWith(as)&&e.push(n)}e.forEach(e=>localStorage.removeItem(e)),window.dispatchEvent(new CustomEvent(al))}catch(e){console.warn("[route-maps] Failed to clear route overrides from localStorage",e)}}let aS=null;function aE(){return aS||(aS=(au="development"===window.spaEnv)?am().then(e=>{ac=e}):Promise.resolve())}let aD=`${oN}/attachment`;function aO(e,t){return oF(`${aD}/${e}`,{signal:t.signal})}function aP(e,t,n,r){return oF(ak(e,t,r),{signal:n.signal})}function ak(e,t,n){return n?`${aD}?patient=${e}&encounter=${n}`:`${aD}?patient=${e}&includeEncounterless=${t}`}async function aC(e,t,n){let r=new FormData;return r.append("fileCaption",t.fileDescription),r.append("patient",e),n&&r.append("encounter",n),t.file?r.append("file",t.file,t.fileName):(r.append("file",new File([""],t.fileName),t.fileName),r.append("base64Content",t.base64Content)),oF(`${aD}`,{method:"POST",body:r})}function aj(e,t){return oF(`${aD}/${e}`,{method:"DELETE",signal:t.signal})}try{self["workbox:window:6.5.4"]&&_()}catch(e){}function aT(e,t){return new Promise(function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])})}function aR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function aA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}try{self["workbox:core:6.5.4"]&&_()}catch(e){}var aM=function(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n})};function aN(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href}var aI=function(e,t){this.type=e,Object.assign(this,t)};function a$(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function aL(){}var aF={type:"SKIP_WAITING"};function aB(e,t){if(!t)return e&&e.then?e.then(aL):Promise.resolve()}var aV=function(e){function t(t,n){var r,o;return void 0===n&&(n={}),(r=e.call(this)||this).nn={},r.tn=0,r.rn=new aM,r.en=new aM,r.on=new aM,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!aN(t.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=t,e.removeEventListener("updatefound",r.cn)):(r.hn=t,r.an.add(t),r.rn.resolve(t)),++r.tn,t.addEventListener("statechange",r.ln)},r.ln=function(e){var t=r.fn,n=e.target,o=n.state,i=n===r.vn,a={sw:n,isExternal:i,originalEvent:e};!i&&r.mn&&(a.isUpdate=!0),r.dispatchEvent(new aI(o,a)),"installed"===o?r.wn=self.setTimeout(function(){"installed"===o&&t.waiting===n&&r.dispatchEvent(new aI("waiting",a))},200):"activating"===o&&(clearTimeout(r.wn),i||r.en.resolve(n))},r.dn=function(e){var t=r.hn,n=t!==navigator.serviceWorker.controller;r.dispatchEvent(new aI("controlling",{isExternal:n,originalEvent:e,sw:t,isUpdate:r.mn})),n||r.on.resolve(t)},o=function(e){var t=e.data,n=e.ports,o=e.source;return a$(r.getSW(),function(){r.an.has(o)&&r.dispatchEvent(new aI("message",{data:t,originalEvent:e,ports:n,sw:o}))})},r.gn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(o.apply(this,e))}catch(e){return Promise.reject(e)}},r.sn=t,r.nn=n,navigator.serviceWorker.addEventListener("message",r.gn),r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n,r,o=t.prototype;return o.register=function(e){var t=(void 0===e?{}:e).immediate,n=void 0!==t&&t;try{var r,o,i,a=this;return r=function(){if(!n&&"complete"!==document.readyState)return aB(new Promise(function(e){return window.addEventListener("load",e)}))},o=function(){return a.mn=!!navigator.serviceWorker.controller,a.yn=a.pn(),a$(a.bn(),function(e){a.fn=e,a.yn&&(a.hn=a.yn,a.en.resolve(a.yn),a.on.resolve(a.yn),a.yn.addEventListener("statechange",a.ln,{once:!0}));var t=a.fn.waiting;return t&&aN(t.scriptURL,a.sn.toString())&&(a.hn=t,Promise.resolve().then(function(){a.dispatchEvent(new aI("waiting",{sw:t,wasWaitingBeforeRegister:!0}))}).then(function(){})),a.hn&&(a.rn.resolve(a.hn),a.an.add(a.hn)),a.fn.addEventListener("updatefound",a.cn),navigator.serviceWorker.addEventListener("controllerchange",a.dn),a.fn})},(i=r())&&i.then?i.then(o):o(i)}catch(e){return Promise.reject(e)}},o.update=function(){try{return this.fn?aB(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},o.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},o.messageSW=function(e){try{return a$(this.getSW(),function(t){return aT(t,e)})}catch(e){return Promise.reject(e)}},o.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&aT(this.fn.waiting,aF)},o.pn=function(){var e=navigator.serviceWorker.controller;return e&&aN(e.scriptURL,this.sn.toString())?e:void 0},o.bn=function(){try{var e=this;return function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}(function(){return a$(navigator.serviceWorker.register(e.sn,e.nn),function(t){return e.un=performance.now(),t})},function(e){throw e})}catch(e){return Promise.reject(e)}},n=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}],aR(t.prototype,n),r&&aR(t,r),t}(function(){function e(){this.Pn=new Map}var t=e.prototype;return t.addEventListener=function(e,t){this.Sn(e).add(t)},t.removeEventListener=function(e,t){this.Sn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,n=function(e){var t;if("u"<typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return aA(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?aA(e,void 0):void 0}}(e))){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}(this.Sn(e.type));!(t=n()).done;)(0,t.value)(e)},t.Sn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}());function aU(e,t){if(void 0!==f)return console.warn(`The application's Service Worker has already been registered. The new service worker at ${e} will not be registered.`),f;if(!("serviceWorker"in navigator))throw Error("Registering the Service Worker is not possible due to missing browser capabilities.");let n=new aV(e,t);return f=n.register().then(()=>n.controlling.then(()=>n))}function aW(){return f??Promise.resolve(void 0)}let aK="x-omrs-offline-response-body",az="x-omrs-offline-response-status",aH="x-omrs-offline-caching-strategy";async function aG(e){let t=await aW();return t?await t.messageSW(e):{success:!1,result:void 0,error:"No service worker has been registered. This is typically the case when the application has been built without offline-related features."}}async function aq(){let e=window.sessionStorage;try{e.setItem("someKeyHere","test"),e.removeItem("someKeyHere")}catch(t){if(t.code===DOMException.QUOTA_EXCEEDED_ERR&&0===e.length)return!0}return!1}async function aZ(){return!window.indexedDB}async function aY(){return new Promise(e=>{let t=indexedDB.open("test");t.onerror=()=>e(!0),t.onsuccess=()=>e(!1)})}async function aJ(){return await aY()||await aZ()||await aq()}let aQ="openmrs3:offline-mode",aX="unavailable";function a0(){return{current:aX,notAvailable:"unavailable"===aX,active:"on"===aX}}function a1(e){"unavailable"!==aX&&"unavailable"!==e&&(localStorage.setItem(aQ,"on"===e?"active":"disabled"),aX=e)}async function a2(){await aJ()||(aX="active"===localStorage.getItem(aQ)?"on":"off"),navigator.onLine}let a4="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,a3=Object.keys,a6=Array.isArray;function a5(e,t){return"object"!=typeof t||a3(t).forEach(function(n){e[n]=t[n]}),e}"u"<typeof Promise||a4.Promise||(a4.Promise=Promise);let a7=Object.getPrototypeOf,a9={}.hasOwnProperty;function a8(e,t){return a9.call(e,t)}function se(e,t){"function"==typeof t&&(t=t(a7(e))),("u"<typeof Reflect?a3:Reflect.ownKeys)(t).forEach(n=>{sn(e,n,t[n])})}let st=Object.defineProperty;function sn(e,t,n,r){st(e,t,a5(n&&a8(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function sr(e){return{from:function(t){return e.prototype=Object.create(t.prototype),sn(e.prototype,"constructor",e),{extend:se.bind(null,e.prototype)}}}}let so=Object.getOwnPropertyDescriptor;function si(e,t){let n;return so(e,t)||(n=a7(e))&&si(n,t)}let sa=[].slice;function ss(e,t,n){return sa.call(e,t,n)}function sl(e,t){return t(e)}function su(e){if(!e)throw Error("Assertion Failed")}function sc(e){a4.setImmediate?setImmediate(e):setTimeout(e,0)}function sd(e,t){return e.reduce((e,n,r)=>{var o=t(n,r);return o&&(e[o[0]]=o[1]),e},{})}function sf(e,t){if(a8(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,o=t.length;r<o;++r){var i=sf(e,t[r]);n.push(i)}return n}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return void 0===s?void 0:sf(s,t.substr(a+1))}}function sp(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){su("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)sp(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var a=t.substr(0,i),s=t.substr(i+1);if(""===s)void 0===n?a6(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n;else{var l=e[a];l&&a8(e,a)||(l=e[a]={}),sp(l,s,n)}}else void 0===n?a6(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function sh(e){var t={};for(var n in e)a8(e,n)&&(t[n]=e[n]);return t}let sm=[].concat;function sy(e){return sm.apply([],e)}let sg="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(sy([8,16,32,64].map(e=>["Int","Uint","Float"].map(t=>t+e+"Array")))).filter(e=>a4[e]),sb=sg.map(e=>a4[e]);sd(sg,e=>[e,!0]);let sv=null;function sw(e){sv="u">typeof WeakMap&&new WeakMap;let t=function e(t){if(!t||"object"!=typeof t)return t;let n=sv&&sv.get(t);if(n)return n;if(a6(t)){n=[],sv&&sv.set(t,n);for(var r=0,o=t.length;r<o;++r)n.push(e(t[r]))}else if(sb.indexOf(t.constructor)>=0)n=t;else{let r=a7(t);for(var i in n=r===Object.prototype?{}:Object.create(r),sv&&sv.set(t,n),t)a8(t,i)&&(n[i]=e(t[i]))}return n}(e);return sv=null,t}let{toString:s_}={};function sx(e){return s_.call(e).slice(8,-1)}let sS="u">typeof Symbol?Symbol.iterator:"@@iterator",sE="symbol"==typeof sS?function(e){var t;return null!=e&&(t=e[sS])&&t.apply(e)}:function(){return null},sD={};function sO(e){var t,n,r,o;if(1==arguments.length){if(a6(e))return e.slice();if(this===sD&&"string"==typeof e)return[e];if(o=sE(e)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=Array(t);t--;)n[t]=arguments[t];return n}let sP="u">typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var sk="u">typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),sC=()=>!0;let sj=!Error("").stack;function sT(){if(sj)try{throw sT.arguments,Error()}catch(e){return e}return Error()}function sR(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(sC).map(e=>"\n"+e).join("")):""}var sA=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],sM=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(sA),sN={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function sI(e,t){this._e=sT(),this.name=e,this.message=t}function s$(e,t){return e+". Errors: "+Object.keys(t).map(e=>t[e].toString()).filter((e,t,n)=>n.indexOf(e)===t).join("\n")}function sL(e,t,n,r){this._e=sT(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=s$(e,t)}function sF(e,t){this._e=sT(),this.name="BulkError",this.failures=Object.keys(t).map(e=>t[e]),this.failuresByPos=t,this.message=s$(e,t)}sr(sI).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+sR(this._e,2))}},toString:function(){return this.name+": "+this.message}}),sr(sL).from(sI),sr(sF).from(sI);var sB=sM.reduce((e,t)=>(e[t]=t+"Error",e),{}),sV=sM.reduce((e,t)=>{var n=t+"Error";function r(e,r){this._e=sT(),this.name=n,e?"string"==typeof e?(this.message=`${e}${r?"\n "+r:""}`,this.inner=r||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=sN[t]||n,this.inner=null)}return sr(r).from(sI),e[t]=r,e},{});sV.Syntax=SyntaxError,sV.Type=TypeError,sV.Range=RangeError;var sU=sA.reduce((e,t)=>(e[t+"Error"]=sV[t],e),{}),sW=sM.reduce((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=sV[t]),e),{});function sK(){}function sz(e){return e}function sH(e,t){return null==e||e===sz?t:function(n){return t(e(n))}}function sG(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function sq(e,t){return e===sK?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?sG(r,this.onsuccess):r),o&&(this.onerror=this.onerror?sG(o,this.onerror):o),void 0!==i?i:n}}function sZ(e,t){return e===sK?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?sG(n,this.onsuccess):n),r&&(this.onerror=this.onerror?sG(r,this.onerror):r)}}function sY(e,t){return e===sK?t:function(n){var r=e.apply(this,arguments);a5(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?sG(o,this.onsuccess):o),i&&(this.onerror=this.onerror?sG(i,this.onerror):i),void 0===r?void 0===a?void 0:a:a5(r,a)}}function sJ(e,t){return e===sK?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function sQ(e,t){return e===sK?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,o=arguments.length,i=Array(o);o--;)i[o]=arguments[o];return n.then(function(){return t.apply(r,i)})}return t.apply(this,arguments)}}sW.ModifyError=sL,sW.DexieError=sI,sW.BulkError=sF;var sX={};let[s0,s1,s2]="u"<typeof Promise?[]:(()=>{let e=Promise.resolve();if("u"<typeof crypto||!crypto.subtle)return[e,a7(e),e];let t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,a7(t),e]})(),s4=s1&&s1.then,s3=s0&&s0.constructor,s6=!!s2;var s5=!1,s7=s2?()=>{s2.then(lb)}:a4.setImmediate?setImmediate.bind(null,lb):a4.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver(()=>{lb(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(lb,0)},s9=function(e,t){ls.push([e,t]),le&&(s7(),le=!1)},s8=!0,le=!0,lt=[],ln=[],lr=null,lo=sz,li={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:lV,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(e=>{try{lV(e[0],e[1])}catch(e){}})}},la=li,ls=[],ll=0,lu=[];function lc(e){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=sK,this._lib=!1;var t=this._PSD=la;if(sk&&(this._stackHolder=sT(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==sX)throw TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&lp(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,n){try{n(n=>{if(null===t._state){if(n===t)throw TypeError("A promise cannot be resolved with itself.");var r=t._lib&&lv();n&&"function"==typeof n.then?e(t,(e,t)=>{n instanceof lc?n._then(e,t):n.then(e,t)}):(t._state=!0,t._value=n,lh(t)),r&&lw()}},lp.bind(null,t))}catch(e){lp(t,e)}}(this,e)}let ld={get:function(){var e=la,t=lk;function n(n,r){var o=!e.global&&(e!==la||t!==lk);let i=o&&!lR();var a=new lc((t,a)=>{lm(this,new lf(lF(n,e,o,i),lF(r,e,o,i),t,a,e))});return sk&&lg(a,this),a}return n.prototype=sX,n},set:function(e){sn(this,"then",e&&e.prototype===sX?ld:{get:function(){return e},set:ld.set})}};function lf(e,t,n,r,o){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=o}function lp(e,t){if(ln.push(t),null===e._state){var n=e._lib&&lv();t=lo(t),e._state=!1,e._value=t,sk&&null!==t&&"object"==typeof t&&!t._promise&&function(e){try{e.apply(null,void 0)}catch(e){}}(()=>{var n=si(t,"stack");t._promise=e,sn(t,"stack",{get:()=>s5?n&&(n.get?n.get.apply(t):n.value):e.stack})}),lt.some(t=>t._value===e._value)||lt.push(e),lh(e),n&&lw()}}function lh(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)lm(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===ll&&(++ll,s9(()=>{0==--ll&&l_()},[]))}function lm(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++ll,s9(ly,[n,e,t])}else e._listeners.push(t)}function ly(e,t,n){try{lr=t;var r,o=t._value;t._state?r=e(o):(ln.length&&(ln=[]),r=e(o),-1===ln.indexOf(o)&&function(e){for(var t=lt.length;t;)if(lt[--t]._value===e._value)return void lt.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{lr=null,0==--ll&&l_(),--n.psd.ref||n.psd.finalize()}}function lg(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function lb(){lv()&&lw()}function lv(){var e=s8;return s8=!1,le=!1,e}function lw(){var e,t,n;do for(;ls.length>0;)for(e=ls,ls=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}while(ls.length>0);s8=!0,le=!0}function l_(){var e=lt;lt=[],e.forEach(e=>{e._PSD.onunhandled.call(null,e._value,e)});for(var t=lu.slice(0),n=t.length;n;)t[--n]()}function lx(e){return new lc(sX,!1,e)}function lS(e,t){var n=la;return function(){var r=lv(),o=la;try{return lI(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{lI(o,!1),r&&lw()}}}se(lc.prototype,{then:ld,_then:function(e,t){lm(this,new lf(null,null,e,t,la))},catch:function(e){if(1==arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,e=>e instanceof t?n(e):lx(e)):this.then(null,e=>e&&e.name===t?n(e):lx(e))},finally:function(e){return this.then(t=>(e(),t),t=>(e(),lx(t)))},stack:{get:function(){if(this._stack)return this._stack;try{s5=!0;var e=(function e(t,n,r){if(n.length===r)return n;var o="";if(!1===t._state){var i,a,s=t._value;null!=s?(i=s.name||"Error",a=s.message||s,o=sR(s,0)):(i=s,a=""),n.push(i+(a?": "+a:"")+o)}return sk&&((o=sR(t._stackHolder,2))&&-1===n.indexOf(o)&&n.push(o),t._prev&&e(t._prev,n,r)),n})(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{s5=!1}}},timeout:function(e,t){return e<1/0?new lc((n,r)=>{var o=setTimeout(()=>r(new sV.Timeout(t)),e);this.then(n,r).finally(clearTimeout.bind(null,o))}):this}}),"u">typeof Symbol&&Symbol.toStringTag&&sn(lc.prototype,Symbol.toStringTag,"Dexie.Promise"),li.env=l$(),se(lc,{all:function(){var e=sO.apply(null,arguments).map(lA);return new lc(function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((o,i)=>lc.resolve(o).then(n=>{e[i]=n,--r||t(e)},n))})},resolve:e=>{if(e instanceof lc)return e;if(e&&"function"==typeof e.then)return new lc((t,n)=>{e.then(t,n)});var t=new lc(sX,!0,e);return lg(t,lr),t},reject:lx,race:function(){var e=sO.apply(null,arguments).map(lA);return new lc((t,n)=>{e.map(e=>lc.resolve(e).then(t,n))})},PSD:{get:()=>la,set:e=>la=e},totalEchoes:{get:()=>lk},newPSD:lj,usePSD:lL,scheduler:{get:()=>s9,set:e=>{s9=e}},rejectionMapper:{get:()=>lo,set:e=>{lo=e}},follow:(e,t)=>new lc((n,r)=>lj((t,n)=>{var r=la;r.unhandleds=[],r.onunhandled=n,r.finalize=sG(function(){var e;e=()=>{0===this.unhandleds.length?t():n(this.unhandleds[0])},lu.push(function t(){e(),lu.splice(lu.indexOf(t),1)}),++ll,s9(()=>{0==--ll&&l_()},[])},r.finalize),e()},t,n,r))}),s3&&(s3.allSettled&&sn(lc,"allSettled",function(){let e=sO.apply(null,arguments).map(lA);return new lc(t=>{0===e.length&&t([]);let n=e.length,r=Array(n);e.forEach((e,o)=>lc.resolve(e).then(e=>r[o]={status:"fulfilled",value:e},e=>r[o]={status:"rejected",reason:e}).then(()=>--n||t(r)))})}),s3.any&&"u">typeof AggregateError&&sn(lc,"any",function(){let e=sO.apply(null,arguments).map(lA);return new lc((t,n)=>{0===e.length&&n(AggregateError([]));let r=e.length,o=Array(r);e.forEach((e,i)=>lc.resolve(e).then(e=>t(e),e=>{o[i]=e,--r||n(AggregateError(o))}))})}));let lE={awaits:0,echoes:0,id:0};var lD=0,lO=[],lP=0,lk=0,lC=0;function lj(e,t,n,r){var o=la,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++lC;var a=li.env;i.env=s6?{Promise:lc,PromiseProp:{value:lc,configurable:!0,writable:!0},all:lc.all,race:lc.race,allSettled:lc.allSettled,any:lc.any,resolve:lc.resolve,reject:lc.reject,nthen:lB(a.nthen,i),gthen:lB(a.gthen,i)}:{},t&&a5(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=lL(i,e,n,r);return 0===i.ref&&i.finalize(),s}function lT(){return lE.id||(lE.id=++lD),++lE.awaits,lE.echoes+=100,lE.id}function lR(){return!!lE.awaits&&(0==--lE.awaits&&(lE.id=0),lE.echoes=100*lE.awaits,!0)}function lA(e){return lE.echoes&&e&&e.constructor===s3?(lT(),e.then(e=>(lR(),e),e=>(lR(),lU(e)))):e}function lM(e){++lk,lE.echoes&&0!=--lE.echoes||(lE.echoes=lE.id=0),lO.push(la),lI(e,!0)}function lN(){var e=lO[lO.length-1];lO.pop(),lI(e,!1)}function lI(e,t){var n,r=la;if((t?!lE.echoes||lP++&&e===la:!lP||--lP&&e===la)||(n=t?lM.bind(null,e):lN,s4.call(s0,n)),e!==la&&(la=e,r===li&&(li.env=l$()),s6)){var o=li.env.Promise,i=e.env;s1.then=i.nthen,o.prototype.then=i.gthen,(r.global||e.global)&&(Object.defineProperty(a4,"Promise",i.PromiseProp),o.all=i.all,o.race=i.race,o.resolve=i.resolve,o.reject=i.reject,i.allSettled&&(o.allSettled=i.allSettled),i.any&&(o.any=i.any))}}function l$(){var e=a4.Promise;return s6?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(a4,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:s1.then,gthen:e.prototype.then}:{}}function lL(e,t,n,r,o){var i=la;try{return lI(e,!0),t(n,r,o)}finally{lI(i,!1)}}function lF(e,t,n,r){return"function"!=typeof e?e:function(){var o,i=la;n&&lT(),lI(t,!0);try{return e.apply(this,arguments)}finally{lI(i,!1),r&&(o=lR,s4.call(s0,o))}}}function lB(e,t){return function(n,r){return e.call(this,lF(n,t),lF(r,t))}}function lV(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,o={promise:t,reason:e};if(a4.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),a5(r,o)):a4.CustomEvent&&a5(r=new CustomEvent("unhandledrejection",{detail:o}),o),r&&a4.dispatchEvent&&(dispatchEvent(r),!a4.PromiseRejectionEvent&&a4.onunhandledrejection))try{a4.onunhandledrejection(r)}catch(e){}sk&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+s4).indexOf("[native code]")&&(lT=lR=sK);var lU=lc.reject;let lW=String.fromCharCode(65535),lK="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",lz=[],lH="u">typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),lG=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function lq(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}let lZ={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function lY(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=sw(t))[e],t)}class lJ{_trans(e,t,n){let r=this._tx||la.trans,o=this.name;function i(e,n,r){if(!r.schema[o])throw new sV.NotFound("Table "+o+" not part of transaction");return t(r.idbtrans,r)}let a=lv();try{return r&&r.db===this.db?r===la.trans?r._promise(e,i,n):lj(()=>r._promise(e,i,n),{trans:r,transless:la.transless||la}):function e(t,n,r,o){if(t.idbdb&&(t._state.openComplete||la.letThrough||t._vip)){var i=t._createTransaction(n,r,t._dbSchema);try{i.create(),t._state.PR1398_maxLoop=3}catch(i){return i.name===sB.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,n,r,o))):lU(i)}return i._promise(n,(e,t)=>lj(()=>(la.trans=i,o(e,t,i)))).then(e=>i._completion.then(()=>e))}if(t._state.openComplete)return lU(new sV.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return lU(new sV.DatabaseClosed);t.open().catch(sK)}return t._state.dbReadyPromise.then(()=>e(t,n,r,o))}(this.db,e,[this.name],i)}finally{a&&lw()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",t=>this.core.get({trans:t,key:e}).then(e=>this.hook.reading.fire(e))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(a6(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);let t=a3(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);let n=this.schema.indexes.concat(this.schema.primKey).filter(e=>e.compound&&t.every(t=>e.keyPath.indexOf(t)>=0)&&e.keyPath.every(e=>t.indexOf(e)>=0))[0];if(n&&this.db._maxKey!==lW)return this.where(n.name).equals(n.keyPath.map(t=>e[t]));!n&&sk&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);let{idxByName:r}=this.schema,o=this.db._deps.indexedDB;function i(e,t){try{return 0===o.cmp(e,t)}catch(e){return!1}}let[a,s]=t.reduce(([t,n],o)=>{let a=r[o],s=e[o];return[t||a,t||!a?lq(n,a&&a.multi?e=>{let t=sf(e,o);return a6(t)&&t.some(e=>i(s,e))}:e=>i(s,sf(e,o))):n]},[null,null]);return a?this.where(a.name).equals(e[a.keyPath]).filter(s):n?this.filter(s):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,a6(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;let t=t=>{if(!t)return t;let n=Object.create(e.prototype);for(var r in t)if(a8(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}defineClass(){return this.mapToClass(function(e){a5(this,e)})}add(e,t){let{auto:n,keyPath:r}=this.schema.primKey,o=e;return r&&n&&(o=lY(r)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[o]})).then(e=>e.numFailures?lc.reject(e.failures[0]):e.lastResult).then(t=>{if(r)try{sp(e,r,t)}catch(e){}return t})}update(e,t){if("object"!=typeof e||a6(e))return this.where(":id").equals(e).modify(t);{let n=sf(e,this.schema.primKey.keyPath);if(void 0===n)return lU(new sV.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?a3(t).forEach(n=>{sp(e,n,t[n])}):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}}put(e,t){let{auto:n,keyPath:r}=this.schema.primKey,o=e;return r&&n&&(o=lY(r)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"put",values:[o],keys:null!=t?[t]:null})).then(e=>e.numFailures?lc.reject(e.failures[0]):e.lastResult).then(t=>{if(r)try{sp(e,r,t)}catch(e){}return t})}delete(e){return this._trans("readwrite",t=>this.core.mutate({trans:t,type:"delete",keys:[e]})).then(e=>e.numFailures?lc.reject(e.failures[0]):void 0)}clear(){return this._trans("readwrite",e=>this.core.mutate({trans:e,type:"deleteRange",range:lZ})).then(e=>e.numFailures?lc.reject(e.failures[0]):void 0)}bulkGet(e){return this._trans("readonly",t=>this.core.getMany({keys:e,trans:t}).then(e=>e.map(e=>this.hook.reading.fire(e))))}bulkAdd(e,t,n){let r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new sV.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new sV.InvalidArgument("Arguments objects and keys must have the same length");let a=e.length,s=i&&n?e.map(lY(i)):e;return this.core.mutate({trans:t,type:"add",keys:r,values:s,wantResults:o}).then(({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new sF(`${this.name}.bulkAdd(): ${e} of ${a} operations failed`,r)})})}bulkPut(e,t,n){let r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new sV.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new sV.InvalidArgument("Arguments objects and keys must have the same length");let a=e.length,s=i&&n?e.map(lY(i)):e;return this.core.mutate({trans:t,type:"put",keys:r,values:s,wantResults:o}).then(({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new sF(`${this.name}.bulkPut(): ${e} of ${a} operations failed`,r)})})}bulkDelete(e){let t=e.length;return this._trans("readwrite",t=>this.core.mutate({trans:t,type:"delete",keys:e})).then(({numFailures:e,lastResult:n,failures:r})=>{if(0===e)return n;throw new sF(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,r)})}}function lQ(e){var t={},n=function(n,r){if(r){for(var o=arguments.length,i=Array(o-1);--o;)i[o-1]=arguments[o];return t[n].subscribe.apply(null,i),e}if("string"==typeof n)return t[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(e,r,o){if("object"==typeof e){var a;return void a3(a=e).forEach(function(e){var t=a[e];if(a6(t))i(e,a[e][0],a[e][1]);else{if("asap"!==t)throw new sV.InvalidArgument("Invalid event config");var n=i(e,sz,function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach(function(e){sc(function(){e.apply(null,t)})})})}})}r||(r=sJ),o||(o=sK);var s={subscribers:[],fire:o,subscribe:function(e){-1===s.subscribers.indexOf(e)&&(s.subscribers.push(e),s.fire=r(s.fire,e))},unsubscribe:function(e){s.subscribers=s.subscribers.filter(function(t){return t!==e}),s.fire=s.subscribers.reduce(r,o)}};return t[e]=n[e]=s,s}}function lX(e,t){return sr(t).from({prototype:e}),t}function l0(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function l1(e,t){e.filter=lq(e.filter,t)}function l2(e,t,n){var r=e.replayFilter;e.replayFilter=r?()=>lq(r(),t()):t,e.justLimit=n&&!r}function l4(e,t){if(e.isPrimKey)return t.primaryKey;let n=t.getIndexByKeyPath(e.index);if(!n)throw new sV.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function l3(e,t,n){let r=l4(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function l6(e,t,n,r){let o=e.replayFilter?lq(e.filter,e.replayFilter()):e.filter;if(e.or){let i={},a=(e,n,r)=>{if(!o||o(n,r,e=>n.stop(e),e=>n.fail(e))){var a=n.primaryKey,s=""+a;"[object ArrayBuffer]"===s&&(s=""+new Uint8Array(a)),a8(i,s)||(i[s]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(a,n),l5(l3(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return l5(l3(e,r,n),lq(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function l5(e,t,n,r){var o=lS(r?(e,t,o)=>n(r(e),t,o):n);return e.then(e=>{if(e)return e.start(()=>{var n=()=>e.continue();t&&!t(e,e=>n=e,t=>{e.stop(t),n=sK},t=>{e.fail(t),n=sK})||o(e.value,e,e=>n=e),n()})})}function l7(e,t){try{let n=l9(e),r=l9(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){let n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return n===r?0:n<r?-1:1}(l8(e),l8(t));case"Array":return function(e,t){let n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n){let r=l7(e[n],t[n]);if(0!==r)return r}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function l9(e){let t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";let n=sx(e);return"ArrayBuffer"===n?"binary":n}function l8(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class ue{_read(e,t){var n=this._ctx;return n.error?n.table._trans(null,lU.bind(null,n.error)):n.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,lU.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=lq(t.algorithm,e)}_iterate(e,t){return l6(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&a5(n,e),t._ctx=n,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read(n=>l6(t,e,n,t.table.core))}count(e){return this._read(e=>{let t=this._ctx,n=t.table.core;if(l0(t,!0))return n.count({trans:e,query:{index:l4(t,n.schema),range:t.range}}).then(e=>Math.min(e,t.limit));var r=0;return l6(t,()=>(++r,!1),e,n).then(()=>r)}).then(e)}sortBy(e,t){let n=e.split(".").reverse(),r=n[0],o=n.length-1;function i(e,t){return t?i(e[n[t]],t-1):e[r]}var a="next"===this._ctx.dir?1:-1;function s(e,t){var n=i(e,o),r=i(t,o);return n<r?-a:n>r?a:0}return this.toArray(function(e){return e.sort(s)}).then(t)}toArray(e){return this._read(e=>{var t=this._ctx;if("next"===t.dir&&l0(t,!0)&&t.limit>0){let{valueMapper:n}=t,r=l4(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:r,range:t.range}}).then(({result:e})=>n?e.map(n):e)}{let n=[];return l6(t,e=>n.push(e),e,t.table.core).then(()=>n)}},e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,l0(t)?l2(t,()=>{var t=e;return(e,n)=>0===t||(1===t?--t:n(()=>{e.advance(t),t=0}),!1)}):l2(t,()=>{var t=e;return()=>--t<0})),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),l2(this._ctx,()=>{var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}},!0),this}until(e,t){return l1(this._ctx,function(n,r,o){return!e(n.value)||(r(o),t)}),this}first(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)}last(e){return this.reverse().first(e)}filter(e){var t;return l1(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=lq(t.isMatch,e),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.key,n)})}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.primaryKey,n)})}keys(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.key)}).then(function(){return n}).then(e)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&l0(t,!0)&&t.limit>0)return this._read(e=>{var n=l4(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})}).then(({result:e})=>e).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.primaryKey)}).then(function(){return n}).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys(function(e){return e[0]}).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return l1(this._ctx,function(e){var t=e.primaryKey.toString(),r=a8(n,t);return n[t]=!0,!r}),this}modify(e){var t=this._ctx;return this._write(n=>{var r;if("function"==typeof e)r=e;else{var o=a3(e),i=o.length;r=function(t){for(var n=!1,r=0;r<i;++r){var a=o[r],s=e[a];sf(t,a)!==s&&(sp(t,a,s),n=!0)}return n}}let a=t.table.core,{outbound:s,extractKey:l}=a.schema.primaryKey,u=this.db._options.modifyChunkSize||200,c=[],d=0,f=[],p=(e,t)=>{let{failures:n,numFailures:r}=t;for(let t of(d+=e-r,a3(n)))c.push(n[t])};return this.clone().primaryKeys().then(o=>{let i=c=>{let d=Math.min(u,o.length-c);return a.getMany({trans:n,keys:o.slice(c,c+d),cache:"immutable"}).then(f=>{let h=[],m=[],y=s?[]:null,g=[];for(let e=0;e<d;++e){let t=f[e],n={value:sw(t),primKey:o[c+e]};!1!==r.call(n,n.value,n)&&(null==n.value?g.push(o[c+e]):s||0===l7(l(t),l(n.value))?(m.push(n.value),s&&y.push(o[c+e])):(g.push(o[c+e]),h.push(n.value)))}let b=l0(t)&&t.limit===1/0&&("function"!=typeof e||e===ut)&&{index:t.index,range:t.range};return Promise.resolve(h.length>0&&a.mutate({trans:n,type:"add",values:h}).then(e=>{for(let t in e.failures)g.splice(parseInt(t),1);p(h.length,e)})).then(()=>(m.length>0||b&&"object"==typeof e)&&a.mutate({trans:n,type:"put",keys:y,values:m,criteria:b,changeSpec:"function"!=typeof e&&e}).then(e=>p(m.length,e))).then(()=>(g.length>0||b&&e===ut)&&a.mutate({trans:n,type:"delete",keys:g,criteria:b}).then(e=>p(g.length,e))).then(()=>o.length>c+d&&i(c+u))})};return i(0).then(()=>{if(c.length>0)throw new sL("Error modifying one or more objects",c,d,f);return o.length})})})}delete(){var e=this._ctx,t=e.range;return l0(e)&&(e.isPrimKey&&!lH||3===t.type)?this._write(n=>{let{primaryKey:r}=e.table.core.schema;return e.table.core.count({trans:n,query:{index:r,range:t}}).then(r=>e.table.core.mutate({trans:n,type:"deleteRange",range:t}).then(({failures:e,lastResult:t,results:n,numFailures:o})=>{if(o)throw new sL("Could not delete some values",Object.keys(e).map(t=>e[t]),r-o);return r-o}))}):this.modify(ut)}}let ut=(e,t)=>t.value=null;function un(e,t){return e<t?-1:+(e!==t)}function ur(e,t){return e>t?-1:+(e!==t)}function uo(e,t,n){var r=e instanceof uu?new e.Collection(e):e;return r._ctx.error=n?new n(t):TypeError(t),r}function ui(e){return new e.Collection(e,()=>ul("")).limit(0)}function ua(e,t,n,r){var o,i,a,s,l,u,c,d=n.length;if(!n.every(e=>"string"==typeof e))return uo(e,"String expected.");function f(e){o="next"===e?e=>e.toUpperCase():e=>e.toLowerCase(),i="next"===e?e=>e.toLowerCase():e=>e.toUpperCase(),a="next"===e?un:ur;var t=n.map(function(e){return{lower:i(e),upper:o(e)}}).sort(function(e,t){return a(e.lower,t.lower)});s=t.map(function(e){return e.upper}),l=t.map(function(e){return e.lower}),u=e,c="next"===e?"":r}f("next");var p=new e.Collection(e,()=>us(s[0],l[d-1]+r));p._ondirectionchange=function(e){f(e)};var h=0;return p._addAlgorithm(function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var f=i(o);if(t(f,l,h))return!0;for(var p=null,m=h;m<d;++m){var y=function(e,t,n,r,o,i){for(var a=Math.min(e.length,r.length),s=-1,l=0;l<a;++l){var u=t[l];if(u!==r[l])return 0>o(e[l],n[l])?e.substr(0,l)+n[l]+n.substr(l+1):0>o(e[l],r[l])?e.substr(0,l)+r[l]+n.substr(l+1):s>=0?e.substr(0,s)+t[s]+n.substr(s+1):null;0>o(e[l],u)&&(s=l)}return a<r.length&&"next"===i?e+n.substr(e.length):a<e.length&&"prev"===i?e.substr(0,n.length):s<0?null:e.substr(0,s)+r[s]+n.substr(s+1)}(o,f,s[m],l[m],a,u);null===y&&null===p?h=m+1:(null===p||a(p,y)>0)&&(p=y)}return n(null!==p?function(){e.continue(p+c)}:r),!1}),p}function us(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function ul(e){return{type:1,lower:e,upper:e}}class uu{get Collection(){return this._ctx.table.db.Collection}between(e,t,n,r){n=!1!==n,r=!0===r;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?ui(this):new this.Collection(this,()=>us(e,t,!n,!r))}catch(e){return uo(this,lK)}}equals(e){return null==e?uo(this,lK):new this.Collection(this,()=>ul(e))}above(e){return null==e?uo(this,lK):new this.Collection(this,()=>us(e,void 0,!0))}aboveOrEqual(e){return null==e?uo(this,lK):new this.Collection(this,()=>us(e,void 0,!1))}below(e){return null==e?uo(this,lK):new this.Collection(this,()=>us(void 0,e,!1,!0))}belowOrEqual(e){return null==e?uo(this,lK):new this.Collection(this,()=>us(void 0,e))}startsWith(e){return"string"!=typeof e?uo(this,"String expected."):this.between(e,e+lW,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):ua(this,(e,t)=>0===e.indexOf(t[0]),[e],lW)}equalsIgnoreCase(e){return ua(this,(e,t)=>e===t[0],[e],"")}anyOfIgnoreCase(){var e=sO.apply(sD,arguments);return 0===e.length?ui(this):ua(this,(e,t)=>-1!==t.indexOf(e),e,"")}startsWithAnyOfIgnoreCase(){var e=sO.apply(sD,arguments);return 0===e.length?ui(this):ua(this,(e,t)=>t.some(t=>0===e.indexOf(t)),e,lW)}anyOf(){let e=sO.apply(sD,arguments),t=this._cmp;try{e.sort(t)}catch(e){return uo(this,lK)}if(0===e.length)return ui(this);let n=new this.Collection(this,()=>us(e[0],e[e.length-1]));n._ondirectionchange=n=>{t="next"===n?this._ascending:this._descending,e.sort(t)};let r=0;return n._addAlgorithm((n,o,i)=>{let a=n.key;for(;t(a,e[r])>0;)if(++r===e.length)return o(i),!1;return 0===t(a,e[r])||(o(()=>{n.continue(e[r])}),!1)}),n}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){let e=sO.apply(sD,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return uo(this,lK)}let t=e.reduce((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]],null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,t){let n=this._cmp,r=this._ascending,o=this._descending,i=this._min,a=this._max;if(0===e.length)return ui(this);if(!e.every(e=>void 0!==e[0]&&void 0!==e[1]&&0>=r(e[0],e[1])))return uo(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",sV.InvalidArgument);let s=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,u,c=r;function d(e,t){return c(e[0],t[0])}try{(u=e.reduce(function(e,t){let r=0,o=e.length;for(;r<o;++r){let o=e[r];if(0>n(t[0],o[1])&&n(t[1],o[0])>0){o[0]=i(o[0],t[0]),o[1]=a(o[1],t[1]);break}}return r===o&&e.push(t),e},[])).sort(d)}catch(e){return uo(this,lK)}let f=0,p=l?e=>r(e,u[f][1])>0:e=>r(e,u[f][1])>=0,h=s?e=>o(e,u[f][0])>0:e=>o(e,u[f][0])>=0,m=p,y=new this.Collection(this,()=>us(u[0][0],u[u.length-1][1],!s,!l));return y._ondirectionchange=e=>{"next"===e?(m=p,c=r):(m=h,c=o),u.sort(d)},y._addAlgorithm((e,t,n)=>{for(var o=e.key;m(o);)if(++f===u.length)return t(n),!1;return!!(!p(o)&&!h(o))||(0===this._cmp(o,u[f][1])||0===this._cmp(o,u[f][0])||t(()=>{c===r?e.continue(u[f][0]):e.continue(u[f][1])}),!1)}),y}startsWithAnyOf(){let e=sO.apply(sD,arguments);return e.every(e=>"string"==typeof e)?0===e.length?ui(this):this.inAnyRange(e.map(e=>[e,e+lW])):uo(this,"startsWithAnyOf() only works with strings")}}function uc(e){return lS(function(t){return ud(t),e(t.target.error),!1})}function ud(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}let uf=lQ(null,"storagemutated");class up{_lock(){return su(!la.global),++this._reculock,1!==this._reculock||la.global||(la.lockOwnerFor=this),this}_unlock(){if(su(!la.global),0==--this._reculock)for(la.global||(la.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{lL(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&la.lockOwnerFor!==this}create(e){if(!this.mode)return this;let t=this.db.idbdb,n=this.db._state.dbOpenError;if(su(!this.idbtrans),!e&&!t)switch(n&&n.name){case"DatabaseClosedError":throw new sV.DatabaseClosed(n);case"MissingAPIError":throw new sV.MissingAPI(n.message,n);default:throw new sV.OpenFailed(n)}if(!this.active)throw new sV.TransactionInactive;return su(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=lS(t=>{ud(t),this._reject(e.error)}),e.onabort=lS(t=>{ud(t),this.active&&this._reject(new sV.Abort(e.error)),this.active=!1,this.on("abort").fire(t)}),e.oncomplete=lS(()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&uf.storagemutated.fire(e.mutatedParts)}),this}_promise(e,t,n){if("readwrite"===e&&"readwrite"!==this.mode)return lU(new sV.ReadOnly("Transaction is readonly"));if(!this.active)return lU(new sV.TransactionInactive);if(this._locked())return new lc((r,o)=>{this._blockedFuncs.push([()=>{this._promise(e,t,n).then(r,o)},la])});if(n)return lj(()=>{var e=new lc((e,n)=>{this._lock();let r=t(e,n,this);r&&r.then&&r.then(e,n)});return e.finally(()=>this._unlock()),e._lib=!0,e});var r=new lc((e,n)=>{var r=t(e,n,this);r&&r.then&&r.then(e,n)});return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();let n=lc.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then(()=>n);else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var o=t._waitingFor;return new lc((e,r)=>{n.then(n=>t._waitingQueue.push(lS(e.bind(null,n))),e=>t._waitingQueue.push(lS(r.bind(null,e)))).finally(()=>{t._waitingFor===o&&(t._waitingFor=null)})})}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new sV.Abort))}table(e){let t=this._memoizedTables||(this._memoizedTables={});if(a8(t,e))return t[e];let n=this.schema[e];if(!n)throw new sV.NotFound("Table "+e+" not part of transaction");let r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}}function uh(e,t,n,r,o,i,a){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+um(t)}}function um(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function uy(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:sd(n,e=>[e.name,e])}}let ug=e=>{try{return e.only([[]]),ug=()=>[[]],[[]]}catch(e){return ug=()=>lW,lW}};function ub(e){return null==e?()=>{}:"string"==typeof e?1===e.split(".").length?t=>t[e]:t=>sf(t,e):t=>sf(t,e)}function uv(e){return[].slice.call(e)}let uw=0;function u_(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function ux({_novip:e},t){let n=t.db,r=function(e,t,{IDBKeyRange:n,indexedDB:r},o){var i;return{dbcore:(i=function(e,t,n){let r;function o(e){if(3===e.type)return null;if(4===e.type)throw Error("Cannot convert never type to IDBKeyRange");let{lower:n,upper:r,lowerOpen:o,upperOpen:i}=e;return void 0===n?void 0===r?null:t.upperBound(r,!!i):void 0===r?t.lowerBound(n,!!o):t.bound(n,r,!!o,!!i)}let{schema:i,hasGetAll:a}=(r=uv(e.objectStoreNames),{schema:{name:e.name,tables:r.map(e=>n.objectStore(e)).map(e=>{let{keyPath:t,autoIncrement:n}=e,r=a6(t),o=null==t,i={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:ub(t)},indexes:uv(e.indexNames).map(t=>e.index(t)).map(e=>{let{name:t,unique:n,multiEntry:r,keyPath:o}=e,a={name:t,compound:a6(o),keyPath:o,unique:n,multiEntry:r,extractKey:ub(o)};return i[u_(o)]=a,a}),getIndexByKeyPath:e=>i[u_(e)]};return i[":id"]=a.primaryKey,null!=t&&(i[u_(t)]=a.primaryKey),a})},hasGetAll:r.length>0&&"getAll"in n.objectStore(r[0])&&!("u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),s=i.tables.map(e=>{let t;return{name:t=e.name,schema:e,mutate:function({trans:e,type:n,keys:r,values:i,range:a}){return new Promise((s,l)=>{let u;s=lS(s);let c=e.objectStore(t),d=null==c.keyPath,f="put"===n||"add"===n;if(!f&&"delete"!==n&&"deleteRange"!==n)throw Error("Invalid operation type: "+n);let{length:p}=r||i||{length:1};if(r&&i&&r.length!==i.length)throw Error("Given keys array must have same length as given values array.");if(0===p)return s({numFailures:0,failures:{},results:[],lastResult:void 0});let h=[],m=[],y=0,g=e=>{++y,ud(e)};if("deleteRange"===n){if(4===a.type)return s({numFailures:y,failures:m,results:[],lastResult:void 0});3===a.type?h.push(u=c.clear()):h.push(u=c.delete(o(a)))}else{let[e,t]=f?d?[i,r]:[i,null]:[r,null];if(f)for(let r=0;r<p;++r)h.push(u=t&&void 0!==t[r]?c[n](e[r],t[r]):c[n](e[r])),u.onerror=g;else for(let t=0;t<p;++t)h.push(u=c[n](e[t])),u.onerror=g}let b=e=>{let t=e.target.result;h.forEach((e,t)=>null!=e.error&&(m[t]=e.error)),s({numFailures:y,failures:m,results:"delete"===n?r:h.map(e=>e.result),lastResult:t})};u.onerror=e=>{g(e),b(e)},u.onsuccess=b})},getMany:({trans:e,keys:n})=>new Promise((r,o)=>{r=lS(r);let i=e.objectStore(t),a=n.length,s=Array(a),l,u=0,c=0,d=e=>{let t=e.target;s[t._pos]=t.result,++c===u&&r(s)},f=uc(o);for(let e=0;e<a;++e)null!=n[e]&&((l=i.get(n[e]))._pos=e,l.onsuccess=d,l.onerror=f,++u);0===u&&r(s)}),get:({trans:e,key:n})=>new Promise((r,o)=>{r=lS(r);let i=e.objectStore(t).get(n);i.onsuccess=e=>r(e.target.result),i.onerror=uc(o)}),query:e=>new Promise((n,r)=>{n=lS(n);let{trans:i,values:s,limit:l,query:u}=e,c=l===1/0?void 0:l,{index:d,range:f}=u,p=i.objectStore(t),h=d.isPrimaryKey?p:p.index(d.name),m=o(f);if(0===l)return n({result:[]});if(a){let e=s?h.getAll(m,c):h.getAllKeys(m,c);e.onsuccess=e=>n({result:e.target.result}),e.onerror=uc(r)}else{let e=0,t=!s&&"openKeyCursor"in h?h.openKeyCursor(m):h.openCursor(m),o=[];t.onsuccess=r=>{let i=t.result;return i?(o.push(s?i.value:i.primaryKey),++e===l?n({result:o}):void i.continue()):n({result:o})},t.onerror=uc(r)}}),openCursor:function({trans:e,values:n,query:r,reverse:i,unique:a}){return new Promise((s,l)=>{s=lS(s);let{index:u,range:c}=r,d=e.objectStore(t),f=u.isPrimaryKey?d:d.index(u.name),p=i?a?"prevunique":"prev":a?"nextunique":"next",h=!n&&"openKeyCursor"in f?f.openKeyCursor(o(c),p):f.openCursor(o(c),p);h.onerror=uc(l),h.onsuccess=lS(t=>{let n=h.result;if(!n)return void s(null);n.___id=++uw,n.done=!1;let r=n.continue.bind(n),o=n.continuePrimaryKey;o&&(o=o.bind(n));let i=n.advance.bind(n),a=()=>{throw Error("Cursor not stopped")};n.trans=e,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw Error("Cursor not started")},n.fail=lS(l),n.next=function(){let e=1;return this.start(()=>e--?this.continue():this.stop()).then(()=>this)},n.start=e=>{let t=new Promise((e,t)=>{e=lS(e),h.onerror=uc(t),n.fail=t,n.stop=t=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=a,e(t)}}),s=()=>{if(h.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=()=>{throw Error("Cursor behind last entry")},n.stop()};return h.onsuccess=lS(e=>{h.onsuccess=s,s()}),n.continue=r,n.continuePrimaryKey=o,n.advance=i,s(),t},s(n)},l)})},count({query:e,trans:n}){let{index:r,range:i}=e;return new Promise((e,a)=>{let s=n.objectStore(t),l=r.isPrimaryKey?s:s.index(r.name),u=o(i),c=u?l.count(u):l.count();c.onsuccess=lS(t=>e(t.target.result)),c.onerror=uc(a)})}}}),l={};return s.forEach(e=>l[e.name]=e),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!l[e])throw Error(`Table '${e}' not found`);return l[e]},MIN_KEY:-1/0,MAX_KEY:ug(t),schema:i}}(t,n,o),e.dbcore.reduce((e,{create:t})=>({...e,...t(e)}),i))}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach(t=>{let n=t.name;e.core.schema.tables.some(e=>e.name===n)&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))})}function uS({_novip:e},t,n,r){n.forEach(n=>{let o=r[n];t.forEach(t=>{let r=si(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?sn(t,n,{get(){return this.table(n)},set(e){st(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,o))})})}function uE({_novip:e},t){t.forEach(t=>{for(let n in t)t[n]instanceof e.Table&&delete t[n]})}function uD(e,t){return e._cfg.version-t._cfg.version}function uO(e,t){let n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){let o=e[n],i=t[n];if(o){let e={name:n,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")==""+(i.primKey.keyPath||"")&&(o.primKey.auto===i.primKey.auto||lH)){let t,n=o.idxByName,a=i.idxByName;for(t in n)a[t]||e.del.push(t);for(t in a){let r=n[t],o=a[t];r?r.src!==o.src&&e.change.push(o):e.add.push(o)}(e.del.length>0||e.add.length>0||e.change.length>0)&&r.change.push(e)}else e.recreate=!0,r.change.push(e)}else r.add.push([n,i])}return r}function uP(e,t,n,r){let o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(e=>uk(o,e)),o}function uk(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function uC(e,t,n){let r={};return ss(t.objectStoreNames,0).forEach(e=>{let t=n.objectStore(e),o=t.keyPath,i=uh(um(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),a=[];for(let e=0;e<t.indexNames.length;++e){let n=t.index(t.indexNames[e]);o=n.keyPath;var s=uh(n.name,o,!!n.unique,!!n.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(s)}r[e]=uy(e,i,a)}),r}function uj({_novip:e},t,n){let r=n.db.objectStoreNames;for(let o=0;o<r.length;++o){let i=r[o],a=n.objectStore(i);e._hasGetAll="getAll"in a;for(let e=0;e<a.indexNames.length;++e){let n=a.indexNames[e],r=a.index(n).keyPath,o="string"==typeof r?r:"["+ss(r).join("+")+"]";if(t[i]){let e=t[i].idxByName[o];e&&(e.name=n,delete t[i].idxByName[o],t[i].idxByName[n]=e)}}}"u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a4.WorkerGlobalScope&&a4 instanceof a4.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class uT{_parseStoresSpec(e,t){a3(e).forEach(n=>{if(null!==e[n]){var r=e[n].split(",").map((e,t)=>{let n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return uh(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),a6(r),0===t)}),o=r.shift();if(o.multi)throw new sV.Schema("Primary key cannot be multi-valued");r.forEach(e=>{if(e.auto)throw new sV.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new sV.Schema("Index must have a name and cannot be an empty string")}),t[n]=uy(n,o,r)}})}stores(e){let t=this.db;this._cfg.storesSource=this._cfg.storesSource?a5(this._cfg.storesSource,e):e;let n=t._versions,r={},o={};return n.forEach(e=>{a5(r,e._cfg.storesSource),o=e._cfg.dbschema={},e._parseStoresSpec(r,o)}),t._dbSchema=o,uE(t,[t._allTables,t,t.Transaction.prototype]),uS(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],a3(o),o),t._storeNames=a3(o),this}upgrade(e){return this._cfg.contentUpgrade=sQ(this._cfg.contentUpgrade||sK,e),this}}function uR(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new uJ("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function uA(e){return e&&"function"==typeof e.databases}function uM(e){return lj(function(){return la.letThrough=!0,e()})}function uN(e){var t=t=>e.next(t),n=o(t),r=o(t=>e.throw(t));function o(e){return t=>{var o=e(t),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):a6(i)?Promise.all(i).then(n,r):n(i)}}return o(t)()}function uI(e,t,n){var r=arguments.length;if(r<2)throw new sV.InvalidArgument("Too few arguments");for(var o=Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[e,sy(o),n]}function u$(e,t,n){let r=a6(e)?e.slice():[e];for(let e=0;e<n;++e)r.push(t);return r}let uL={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){let n=e.table(t),{schema:r}=n,o={},i=[];function a(e,t,n){let r=u_(e),s=o[r]=o[r]||[],l=null==e?0:"string"==typeof e?1:e.length,u=t>0,c={...n,isVirtual:u,keyTail:t,keyLength:l,extractKey:ub(e),unique:!u&&n.unique};return s.push(c),c.isPrimaryKey||i.push(c),l>1&&a(2===l?e[0]:e.slice(0,l-1),t+1,n),s.sort((e,t)=>e.keyTail-t.keyTail),c}let s=a(r.primaryKey.keyPath,0,r.primaryKey);for(let e of(o[":id"]=[s],r.indexes))a(e.keyPath,0,e);function l(t){var n,r;let o=t.query.index;return o.isVirtual?{...t,query:{index:o,range:(n=t.query.range,r=o.keyTail,{type:1===n.type?2:n.type,lower:u$(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,r),lowerOpen:!0,upper:u$(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,r),upperOpen:!0})}}:t}return{...n,schema:{...r,primaryKey:s,indexes:i,getIndexByKeyPath:function(e){let t=o[u_(e)];return t&&t[0]}},count:e=>n.count(l(e)),query:e=>n.query(l(e)),openCursor(t){let{keyTail:r,isVirtual:o,keyLength:i}=t.query.index;return o?n.openCursor(l(t)).then(n=>n&&Object.create(n,{continue:{value:function(o){null!=o?n.continue(u$(o,t.reverse?e.MAX_KEY:e.MIN_KEY,r)):t.unique?n.continue(n.key.slice(0,i).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,r)):n.continue()}},continuePrimaryKey:{value(t,o){n.continuePrimaryKey(u$(t,e.MAX_KEY,r),o)}},primaryKey:{get:()=>n.primaryKey},key:{get(){let e=n.key;return 1===i?e[0]:e.slice(0,i)}},value:{get:()=>n.value}})):n.openCursor(t)}}}}}};function uF(e,t,n,r){return n=n||{},r=r||"",a3(e).forEach(o=>{if(a8(t,o)){var i=e[o],a=t[o];if("object"==typeof i&&"object"==typeof a&&i&&a){let e=sx(i);e!==sx(a)?n[r+o]=t[o]:"Object"===e?uF(i,a,n,r+o+"."):i!==a&&(n[r+o]=t[o])}else i!==a&&(n[r+o]=t[o])}else n[r+o]=void 0}),a3(t).forEach(o=>{a8(e,o)||(n[r+o]=t[o])}),n}let uB={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){let n=e.table(t),{primaryKey:r}=n.schema;return{...n,mutate(e){let o=la.trans,{deleting:i,creating:a,updating:s}=o.table(t).hook;switch(e.type){case"add":if(a.fire===sK)break;return o._promise("readwrite",()=>l(e),!0);case"put":if(a.fire===sK&&s.fire===sK)break;return o._promise("readwrite",()=>l(e),!0);case"delete":if(i.fire===sK)break;return o._promise("readwrite",()=>l(e),!0);case"deleteRange":if(i.fire===sK)break;return o._promise("readwrite",()=>(function e(t,o,i){return n.query({trans:t,values:!1,query:{index:r,range:o},limit:i}).then(({result:n})=>l({type:"delete",keys:n,trans:t}).then(r=>r.numFailures>0?Promise.reject(r.failures[0]):n.length<i?{failures:[],numFailures:0,lastResult:void 0}:e(t,{...o,lower:n[n.length-1],lowerOpen:!0},i)))})(e.trans,e.range,1e4),!0)}return n.mutate(e);function l(e){var t,o;let l=la.trans,u=e.keys||("delete"===(t=e).type?t.keys:t.keys||t.values.map(r.extractKey));if(!u)throw Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:u}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),("add"===(o=e).type?Promise.resolve([]):n.getMany({trans:o.trans,keys:u,cache:"immutable"})).then(t=>{let o=u.map((n,o)=>{let u=t[o],c={onerror:null,onsuccess:null};if("delete"===e.type)i.fire.call(c,n,u,l);else if("add"===e.type||void 0===u){let t=a.fire.call(c,n,e.values[o],l);null==n&&null!=t&&(n=t,e.keys[o]=n,r.outbound||sp(e.values[o],r.keyPath,n))}else{let t=uF(u,e.values[o]),r=s.fire.call(c,t,n,u,l);if(r){let t=e.values[o];Object.keys(r).forEach(e=>{a8(t,e)?t[e]=r[e]:sp(t,e,r[e])})}}return c});return n.mutate(e).then(({failures:n,results:r,numFailures:i,lastResult:a})=>{for(let i=0;i<u.length;++i){let a=r?r[i]:u[i],s=o[i];null==a?s.onerror&&s.onerror(n[i]):s.onsuccess&&s.onsuccess("put"===e.type&&t[i]?e.values[i]:a)}return{failures:n,results:r,numFailures:i,lastResult:a}}).catch(e=>(o.forEach(t=>t.onerror&&t.onerror(e)),Promise.reject(e)))})}}}}})};function uV(e,t,n){try{if(!t||t.keys.length<e.length)return null;let r=[];for(let o=0,i=0;o<t.keys.length&&i<e.length;++o)0===l7(t.keys[o],e[i])&&(r.push(n?sw(t.values[o]):t.values[o]),++i);return r.length===e.length?r:null}catch(e){return null}}let uU={stack:"dbcore",level:-1,create:e=>({table:t=>{let n=e.table(t);return{...n,getMany:e=>{if(!e.cache)return n.getMany(e);let t=uV(e.keys,e.trans._cache,"clone"===e.cache);return t?lc.resolve(t):n.getMany(e).then(t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?sw(t):t},t))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),n.mutate(e))}}})};function uW(e){return!("from"in e)}let uK=function(e,t){if(!this){let t=new uK;return e&&"d"in e&&a5(t,e),t}a5(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function uz(e,t,n){let r=l7(t,n);if(isNaN(r))return;if(r>0)throw RangeError();if(uW(e))return a5(e,{from:t,to:n,d:1});let o=e.l,i=e.r;if(0>l7(n,e.from))return o?uz(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},uq(e);if(l7(t,e.to)>0)return i?uz(i,t,n):e.r={from:t,to:n,d:1,l:null,r:null},uq(e);0>l7(t,e.from)&&(e.from=t,e.l=null,e.d=i?i.d+1:1),l7(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);let a=!e.r;o&&!e.l&&uH(e,o),i&&a&&uH(e,i)}function uH(e,t){uW(t)||function e(t,{from:n,to:r,l:o,r:i}){uz(t,n,r),o&&e(t,o),i&&e(t,i)}(e,t)}function uG(e){let t=uW(e)?null:{s:0,n:e};return{next(e){let n=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&0>l7(e,t.n.from);)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||0>=l7(e,t.n.to))return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function uq(e){var t,n;let r=((null==(t=e.r)?void 0:t.d)||0)-((null==(n=e.l)?void 0:n.d)||0),o=r>1?"r":r<-1?"l":"";if(o){let t="r"===o?"l":"r",n={...e},r=e[o];e.from=r.from,e.to=r.to,e[o]=r[o],n[o]=r[t],e[t]=n,n.d=uZ(n)}e.d=uZ(e)}function uZ({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}se(uK.prototype,{add(e){return uH(this,e),this},addKey(e){return uz(this,e,e),this},addKeys(e){return e.forEach(e=>uz(this,e,e)),this},[sS](){return uG(this)}});let uY={stack:"dbcore",level:0,create:e=>{let t=e.schema.name,n=new uK(e.MIN_KEY,e.MAX_KEY);return{...e,table:r=>{let o=e.table(r),{schema:i}=o,{primaryKey:a}=i,{extractKey:s,outbound:l}=a,u={...o,mutate:e=>{let a=e.trans,s=a.mutatedParts||(a.mutatedParts={}),l=e=>{let n=`idb://${t}/${r}/${e}`;return s[n]||(s[n]=new uK)},u=l(""),c=l(":dels"),{type:d}=e,[f,p]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],h=e.trans._cache;return o.mutate(e).then(e=>{if(a6(f)){"delete"!==d&&(f=e.results),u.addKeys(f);let t=uV(f,h);t||"add"===d||c.addKeys(f),(t||p)&&i.indexes.forEach(function(e){let n=l(e.name||"");function r(t){return null!=t?e.extractKey(t):null}let o=t=>e.multiEntry&&a6(t)?t.forEach(e=>n.addKey(e)):n.addKey(t);(t||p).forEach((e,n)=>{let i=t&&r(t[n]),a=p&&r(p[n]);0!==l7(i,a)&&(null!=i&&o(i),null!=a&&o(a))})})}else if(f){let e={from:f.lower,to:f.upper};c.add(e),u.add(e)}else u.add(n),c.add(n),i.indexes.forEach(e=>l(e.name).add(n));return e})}},c=({query:{index:t,range:n}})=>{var r,o;return[t,new uK(null!=(r=n.lower)?r:e.MIN_KEY,null!=(o=n.upper)?o:e.MAX_KEY)]},d={get:e=>[a,new uK(e.key)],getMany:e=>[a,(new uK).addKeys(e.keys)],count:c,query:c,openCursor:c};return a3(d).forEach(e=>{u[e]=function(i){let{subscr:a}=la;if(a){let u=e=>{let n=`idb://${t}/${r}/${e}`;return a[n]||(a[n]=new uK)},c=u(""),f=u(":dels"),[p,h]=d[e](i);if(u(p.name||"").add(h),!p.isPrimaryKey){if("count"!==e){let t="query"===e&&l&&i.values&&o.query({...i,values:!1});return o[e].apply(this,arguments).then(n=>{if("query"===e){if(l&&i.values)return t.then(({result:e})=>(c.addKeys(e),n));let e=i.values?n.result.map(s):n.result;i.values?c.addKeys(e):f.addKeys(e)}else if("openCursor"===e){let e=i.values;return n&&Object.create(n,{key:{get:()=>(f.addKey(n.primaryKey),n.key)},primaryKey:{get(){let e=n.primaryKey;return f.addKey(e),e}},value:{get:()=>(e&&c.addKey(n.primaryKey),n.value)}})}return n})}f.add(n)}}return o[e].apply(this,arguments)}}),u}}}};class uJ{constructor(e,t){var n;this._middlewares={},this.verno=0;const r=uJ.dependencies;this._options=t={addons:uJ.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:o}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const i={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:sK,dbReadyPromise:null,cancelOpen:sK,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};i.dbReadyPromise=new lc(e=>{i.dbReadyResolve=e}),i.openCanceller=new lc((e,t)=>{i.cancelOpen=t}),this._state=i,this.name=e,this.on=lQ(this,"populate","blocked","versionchange","close",{ready:[sQ,sK]}),this.on.ready.subscribe=sl(this.on.ready.subscribe,e=>(t,n)=>{uJ.vip(()=>{let r=this._state;if(r.openComplete)r.dbOpenError||lc.resolve().then(t),n&&e(t);else if(r.onReadyBeingFired)r.onReadyBeingFired.push(t),n&&e(t);else{e(t);let r=this;n||e(function e(){r.on.ready.unsubscribe(t),r.on.ready.unsubscribe(e)})}})}),this.Collection=(n=this,lX(ue.prototype,function(e,t){this.db=n;let r=lZ,o=null;if(t)try{r=t()}catch(e){o=e}let i=e._ctx,a=i.table,s=a.hook.reading.fire;this._ctx={table:a,index:i.index,isPrimKey:!i.index||a.schema.primKey.keyPath&&i.index===a.schema.primKey.name,range:r,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:o,or:i.or,valueMapper:s!==sz?s:null}})),this.Table=function(e){return lX(lJ.prototype,function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:lQ(null,{creating:[sq,sK],reading:[sH,sz],updating:[sY,sK],deleting:[sZ,sK]})})}(this),this.Transaction=function(e){return lX(up.prototype,function(t,n,r,o,i){this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=lQ(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new lc((e,t)=>{this._resolve=e,this._reject=t}),this._completion.then(()=>{this.active=!1,this.on.complete.fire()},e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),lU(e)})})}(this),this.Version=function(e){return lX(uT.prototype,function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}(this),this.WhereClause=function(e){return lX(uu.prototype,function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};let o=e._deps.indexedDB;if(!o)throw new sV.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=(e,t)=>o.cmp(t,e),this._max=(e,t)=>o.cmp(e,t)>0?e:t,this._min=(e,t)=>0>o.cmp(e,t)?e:t,this._IDBKeyRange=e._deps.IDBKeyRange})}(this),this.on("versionchange",e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()}),this.on("blocked",e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)}),this._maxKey=ug(t.IDBKeyRange),this._createTransaction=(e,t,n,r)=>new this.Transaction(e,t,n,this._options.chromeTransactionDurability,r),this._fireOnBlocked=e=>{this.on("blocked").fire(e),lz.filter(e=>e.name===this.name&&e!==this&&!e._state.vcFired).map(t=>t.on("versionchange").fire(e))},this.use(uL),this.use(uB),this.use(uY),this.use(uU),this.vip=Object.create(this,{_vip:{value:!0}}),o.forEach(e=>e(this))}version(e){if(isNaN(e)||e<.1)throw new sV.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new sV.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);let t=this._versions;var n=t.filter(t=>t._cfg.version===e)[0];return n||(n=new this.Version(e),t.push(n),t.sort(uD),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(e){return this.idbdb&&(this._state.openComplete||la.letThrough||this._vip)?e():new lc((e,t)=>{if(this._state.openComplete)return t(new sV.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new sV.DatabaseClosed);this.open().catch(sK)}this._state.dbReadyPromise.then(e,t)}).then(e)}use({stack:e,create:t,level:n,name:r}){r&&this.unuse({stack:e,name:r});let o=this._middlewares[e]||(this._middlewares[e]=[]);return o.push({stack:e,create:t,level:null==n?10:n,name:r}),o.sort((e,t)=>e.level-t.level),this}unuse({stack:e,name:t,create:n}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter(e=>n?e.create!==n:!!t&&e.name!==t)),this}open(){return function(e){var t;let n=e._state,{indexedDB:r}=e._deps;if(n.isBeingOpened||e.idbdb)return n.dbReadyPromise.then(()=>n.dbOpenError?lU(n.dbOpenError):e);sk&&(n.openCanceller._stackHolder=sT()),n.isBeingOpened=!0,n.dbOpenError=null,n.openComplete=!1;let o=n.openCanceller;function i(){if(n.openCanceller!==o)throw new sV.DatabaseClosed("db.open() was cancelled")}let a=n.dbReadyResolve,s=null,l=!1;return lc.race([o,("u"<typeof navigator?lc.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){var n=function(){return indexedDB.databases().finally(e)};t=setInterval(n,100),n()}).finally(function(){return clearInterval(t)}):Promise.resolve()).then(()=>new lc((t,o)=>{if(i(),!r)throw new sV.MissingAPI;let a=e.name,u=n.autoSchema?r.open(a):r.open(a,Math.round(10*e.verno));if(!u)throw new sV.MissingAPI;u.onerror=uc(o),u.onblocked=lS(e._fireOnBlocked),u.onupgradeneeded=lS(t=>{if(s=u.transaction,n.autoSchema&&!e._options.allowEmptyDB){u.onerror=ud,s.abort(),u.result.close();let e=r.deleteDatabase(a);e.onsuccess=e.onerror=lS(()=>{o(new sV.NoSuchDatabase(`Database ${a} doesnt exist`))})}else{let n,r,a,f;s.onerror=uc(o);var i,c,d=t.oldVersion>0x4000000000000000?0:t.oldVersion;l=d<1,e._novip.idbdb=u.result,i=d/10,c=s,n=e._dbSchema,(r=e._createTransaction("readwrite",e._storeNames,n)).create(c),r._completion.catch(o),a=r._reject.bind(r),f=la.transless||la,lj(()=>{la.trans=r,la.transless=f,0===i?(a3(n).forEach(e=>{uP(c,e,n[e].primKey,n[e].indexes)}),ux(e,c),lc.follow(()=>e.on.populate.fire(r)).catch(a)):(function({_novip:e},t,n,r){let o=[],i=e._versions,a=e._dbSchema=uC(e,e.idbdb,r),s=!1;return i.filter(e=>e._cfg.version>=t).forEach(i=>{o.push(()=>{let o=a,l=i._cfg.dbschema;uj(e,o,r),uj(e,l,r),a=e._dbSchema=l;let u=uO(o,l);u.add.forEach(e=>{uP(r,e[0],e[1].primKey,e[1].indexes)}),u.change.forEach(e=>{if(e.recreate)throw new sV.Upgrade("Not yet support for changing primary key");{let t=r.objectStore(e.name);e.add.forEach(e=>uk(t,e)),e.change.forEach(e=>{t.deleteIndex(e.name),uk(t,e)}),e.del.forEach(e=>t.deleteIndex(e))}});let c=i._cfg.contentUpgrade;if(c&&i._cfg.version>t){let t;ux(e,r),n._memoizedTables={},s=!0;let i=sh(l);u.del.forEach(e=>{i[e]=o[e]}),uE(e,[e.Transaction.prototype]),uS(e,[e.Transaction.prototype],a3(i),i),n.schema=i;let a=sP(c);a&&lT();let d=lc.follow(()=>{if((t=c(n))&&a){var e=lR.bind(null,null);t.then(e,e)}});return t&&"function"==typeof t.then?lc.resolve(t):d.then(()=>t)}}),o.push(t=>{var r;s&&lH||(r=i._cfg.dbschema,[].slice.call(t.db.objectStoreNames).forEach(e=>null==r[e]&&t.db.deleteObjectStore(e))),uE(e,[e.Transaction.prototype]),uS(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema})}),(function e(){return o.length?lc.resolve(o.shift()(n.idbtrans)).then(e):lc.resolve()})().then(()=>{var e;a3(e=a).forEach(t=>{r.db.objectStoreNames.contains(t)||uP(r,t,e[t].primKey,e[t].indexes)})})})(e,i,r,c).catch(a)})}},o),u.onsuccess=lS(()=>{s=null;let r=e._novip.idbdb=u.result,o=ss(r.objectStoreNames);if(o.length>0)try{let t,i=r.transaction(1===o.length?o[0]:o,"readonly");n.autoSchema?function({_novip:e},t,n){e.verno=t.version/10;let r=e._dbSchema=uC(0,t,n);e._storeNames=ss(t.objectStoreNames,0),uS(e,[e._allTables],a3(r),r)}(e,r,i):(uj(e,e._dbSchema,i),((t=uO(uC(0,e.idbdb,i),e._dbSchema)).add.length||t.change.some(e=>e.add.length||e.change.length))&&console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),ux(e,i)}catch(e){}lz.push(e),r.onversionchange=lS(t=>{n.vcFired=!0,e.on("versionchange").fire(t)}),r.onclose=lS(t=>{e.on("close").fire(t)}),l&&function({indexedDB:e,IDBKeyRange:t},n){uA(e)||"__dbnames"===n||uR(e,t).put({name:n}).catch(sK)}(e._deps,a),t()},o)}))]).then(()=>(i(),n.onReadyBeingFired=[],lc.resolve(uM(()=>e.on.ready.fire(e.vip))).then(function t(){if(n.onReadyBeingFired.length>0){let r=n.onReadyBeingFired.reduce(sQ,sK);return n.onReadyBeingFired=[],lc.resolve(uM(()=>r(e.vip))).then(t)}}))).finally(()=>{n.onReadyBeingFired=null,n.isBeingOpened=!1}).then(()=>e).catch(t=>{n.dbOpenError=t;try{s&&s.abort()}catch(e){}return o===n.openCanceller&&e._close(),lU(t)}).finally(()=>{n.openComplete=!0,a()})}(this)}_close(){let e=this._state,t=lz.indexOf(this);if(t>=0&&lz.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new lc(t=>{e.dbReadyResolve=t}),e.openCanceller=new lc((t,n)=>{e.cancelOpen=n})}close(){this._close();let e=this._state;this._options.autoOpen=!1,e.dbOpenError=new sV.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){let e=arguments.length>0,t=this._state;return new lc((n,r)=>{let o=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=lS(()=>{!function({indexedDB:e,IDBKeyRange:t},n){uA(e)||"__dbnames"===n||uR(e,t).delete(n).catch(sK)}(this._deps,this.name),n()}),e.onerror=uc(r),e.onblocked=this._fireOnBlocked};if(e)throw new sV.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(o):o()})}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){let e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return a3(this._allTables).map(e=>this._allTables[e])}transaction(){let e=uI.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,n){let r,o,i=la.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);let a=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(o=t.map(e=>{var t=e instanceof this.Table?e.name:e;if("string"!=typeof t)throw TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t}),"r"==e||"readonly"===e)r="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new sV.InvalidArgument("Invalid transaction mode: "+e);r="readwrite"}if(i){if("readonly"===i.mode&&"readwrite"===r){if(!a)throw new sV.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&o.forEach(e=>{if(i&&-1===i.storeNames.indexOf(e)){if(!a)throw new sV.SubTransaction("Table "+e+" not included in parent transaction.");i=null}}),a&&i&&!i.active&&(i=null)}}catch(e){return i?i._promise(null,(t,n)=>{n(e)}):lU(e)}let s=(function e(t,n,r,o,i){return lc.resolve().then(()=>{let a,s=la.transless||la,l=t._createTransaction(n,r,t._dbSchema,o);if(o)l.idbtrans=o.idbtrans;else try{l.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===sB.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,n,r,null,i))):lU(o)}let u=sP(i);u&&lT();let c=lc.follow(()=>{if(a=i.call(l,l))if(u){var e=lR.bind(null,null);a.then(e,e)}else"function"==typeof a.next&&"function"==typeof a.throw&&(a=uN(a))},{trans:l,transless:s});return(a&&"function"==typeof a.then?lc.resolve(a).then(e=>l.active?e:lU(new sV.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))):c.then(()=>a)).then(e=>(o&&l._resolve(),l._completion.then(()=>e))).catch(e=>(l._reject(e),lU(e)))})}).bind(null,this,r,o,i,n);return i?i._promise(r,s,"lock"):la.trans?lL(la.transless,()=>this._whenReady(s)):this._whenReady(s)}table(e){if(!a8(this._allTables,e))throw new sV.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}let uQ="u">typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class uX{constructor(e){this._subscribe=e}subscribe(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}[uQ](){return this}}function u0(e,t){return a3(t).forEach(n=>{uH(e[n]||(e[n]=new uK),t[n])}),e}try{i={indexedDB:a4.indexedDB||a4.mozIndexedDB||a4.webkitIndexedDB||a4.msIndexedDB,IDBKeyRange:a4.IDBKeyRange||a4.webkitIDBKeyRange}}catch(e){i={indexedDB:null,IDBKeyRange:null}}function u1(e){let t=u2;try{u2=!0,uf.storagemutated.fire(e)}finally{u2=t}}se(uJ,{...sW,delete:e=>new uJ(e,{addons:[]}).delete(),exists:e=>new uJ(e,{addons:[]}).open().then(e=>(e.close(),!0)).catch("NoSuchDatabaseError",()=>!1),getDatabaseNames(e){try{return(function({indexedDB:e,IDBKeyRange:t}){return uA(e)?Promise.resolve(e.databases()).then(e=>e.map(e=>e.name).filter(e=>"__dbnames"!==e)):uR(e,t).toCollection().primaryKeys()})(uJ.dependencies).then(e)}catch(e){return lU(new sV.MissingAPI)}},defineClass:()=>function(e){a5(this,e)},ignoreTransaction:e=>la.trans?lL(la.transless,e):e(),vip:uM,async:function(e){return function(){try{var t=uN(e.apply(this,arguments));return t&&"function"==typeof t.then?t:lc.resolve(t)}catch(e){return lU(e)}}},spawn:function(e,t,n){try{var r=uN(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:lc.resolve(r)}catch(e){return lU(e)}},currentTransaction:{get:()=>la.trans||null},waitFor:function(e,t){let n=lc.resolve("function"==typeof e?uJ.ignoreTransaction(e):e).timeout(t||6e4);return la.trans?la.trans.waitFor(n):n},Promise:lc,debug:{get:()=>sk,set:e=>{sk=e,sC="dexie"===e?()=>!0:lG}},derive:sr,extend:a5,props:se,override:sl,Events:lQ,on:uf,liveQuery:function(e){return new uX(t=>{let n=sP(e),r=!1,o={},i={},a={get closed(){return r},unsubscribe:()=>{r=!0,uf.storagemutated.unsubscribe(c)}};t.start&&t.start(a);let s=!1,l=!1;function u(){return a3(i).some(e=>o[e]&&function(e,t){let n=uG(t),r=n.next();if(r.done)return!1;let o=r.value,i=uG(e),a=i.next(o.from),s=a.value;for(;!r.done&&!a.done;){if(0>=l7(s.from,o.to)&&l7(s.to,o.from)>=0)return!0;0>l7(o.from,s.from)?o=(r=n.next(s.from)).value:s=(a=i.next(o.from)).value}return!1}(o[e],i[e]))}let c=e=>{u0(o,e),u()&&d()},d=()=>{let f,p;if(s||r)return;o={};let h={},m=(n&&lT(),f=()=>lj(e,{subscr:h,trans:null}),p=la.trans?lL(la.transless,f):f(),n&&p.then(lR,lR),p);l||(uf("storagemutated",c),l=!0),s=!0,Promise.resolve(m).then(e=>{s=!1,r||(u()?d():(o={},i=h,t.next&&t.next(e)))},e=>{s=!1,t.error&&t.error(e),a.unsubscribe()})};return d(),a})},extendObservabilitySet:u0,getByKeyPath:sf,setByKeyPath:sp,delByKeyPath:function(e,t){"string"==typeof t?sp(e,t,void 0):"length"in t&&[].map.call(t,function(t){sp(e,t,void 0)})},shallowClone:sh,deepClone:sw,getObjectDiff:uF,cmp:l7,asap:sc,minKey:-1/0,addons:[],connections:lz,errnames:sB,dependencies:i,semVer:"3.2.2",version:"3.2.2".split(".").map(e=>parseInt(e)).reduce((e,t,n)=>e+t/Math.pow(10,2*n))}),uJ.maxKey=ug(uJ.dependencies.IDBKeyRange),"u">typeof dispatchEvent&&"u">typeof addEventListener&&(uf("storagemutated",e=>{if(!u2){let t;lH?(t=document.createEvent("CustomEvent")).initCustomEvent("x-storagemutated-1",!0,!0,e):t=new CustomEvent("x-storagemutated-1",{detail:e}),u2=!0,dispatchEvent(t),u2=!1}}),addEventListener("x-storagemutated-1",({detail:e})=>{u2||u1(e)}));let u2=!1;if("u">typeof BroadcastChannel){let e=new BroadcastChannel("x-storagemutated-1");uf("storagemutated",t=>{u2||e.postMessage(t)}),e.onmessage=e=>{e.data&&u1(e.data)}}else if("u">typeof self&&"u">typeof navigator){uf("storagemutated",e=>{try{u2||("u">typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach(t=>t.postMessage({type:"x-storagemutated-1",changedParts:e})))}catch(e){}}),"u">typeof addEventListener&&addEventListener("storage",e=>{if("x-storagemutated-1"===e.key){let t=JSON.parse(e.newValue);t&&u1(t.changedParts)}});let e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",function({data:e}){e&&"x-storagemutated-1"===e.type&&u1(e.changedParts)})}function u4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}lc.rejectionMapper=function(e,t){if(!e||e instanceof sI||e instanceof TypeError||e instanceof SyntaxError||!e.name||!sU[e.name])return e;var n=new sU[e.name](t||e.message,e);return"stack"in e&&sn(n,"stack",{get:function(){return this.inner.stack}}),n},sC=lG;class u3 extends uJ{constructor(){super("EsmOffline"),u4(this,"syncQueue",void 0),u4(this,"dynamicOfflineData",void 0),this.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),this.syncQueue=this.table("syncQueue"),this.dynamicOfflineData=this.table("dynamicOfflineData")}}function u6(){return new u3}let u5=new u3,u7={},u9=Z("offline-synchronization",{});function u8(){return u9}async function ce(){if(u9.getState().synchronization)return;let e=await u5.syncQueue.count(),t={},n=Object.entries(u7),r=n.length,o={},i=new AbortController,a=()=>{let e=u9.getState().synchronization;u9.setState({synchronization:{...e,pendingCount:e.pendingCount-1}})};try{u9.setState({synchronization:{totalCount:e,pendingCount:e,abortController:i}});for(let e=0;e<r&&n.length>0;e++)for(let e=n.length;e--;){let[r,s]=n[e],l=s.dependsOn.map(e=>t[e]);l.every(Boolean)&&(o[r]={},await Promise.all(l),t[r]=ct(s,o,i,a),n.splice(e,1))}await Promise.allSettled(Object.values(t))}finally{u9.setState({synchronization:void 0})}}async function ct({type:e,dependsOn:t,process:n},r,o,i){let a=[],s=[],l=await cn();await u5.syncQueue.where({type:e,userId:l}).each((e,t)=>{a.push([t.primaryKey,e.content,e.descriptor]),s.push(e.content)});for(let u=0;u<a.length;u++){let[c,d,{id:f,dependencies:p=[]}]=a[u];try{let i=await n(d,{abort:o,index:u,items:s,userId:l,dependencies:p.map(({id:e,type:n})=>t.includes(n)?r[n][e]:void 0)});void 0!==f&&(r[e][f]=i),await u5.syncQueue.delete(c)}catch(e){await u5.syncQueue.update(c,{lastError:{name:e?.name,message:e?.message??e?.toString()}})}finally{i()}}}async function cn(){let e=await oY();return e?.uuid||"*"}async function cr(e,t,n,r){let o=r&&r.id;return void 0!==o&&await u5.syncQueue.where({type:t,userId:e}).filter(e=>e?.descriptor.id===o).delete().catch(uJ.errnames.DatabaseClosed),await u5.syncQueue.add({type:t,content:n,userId:e,descriptor:r||{},createdOn:new Date}).catch(uJ.errnames.DatabaseClosed,()=>-1)}async function co(e,t,n){let r=await cn();return await cr(r,e,t,n)}async function ci(e,t){return(await ca(e,t)).map(e=>e.content)}async function ca(e,t){return await u5.syncQueue.where(t?{type:t,userId:e}:{userId:e}).toArray().catch(uJ.errnames.DatabaseClosed,()=>[])}async function cs(e){let t=await cn();return await ci(t,e)}async function cl(e){let t=await cn();return await ca(t,e)}async function cu(e){return await u5.syncQueue.get(e).catch(uJ.errnames.DatabaseClosed,()=>void 0)}function cc(e){return!!u7[e]?.options.onBeginEditSyncItem}async function cd(e){let t=await cu(e);if(!t)throw Error(`No sync item with the ID ${e} exists.`);let n=u7[t.type]?.options.onBeginEditSyncItem;if(!n)throw Error(`A sync item with the ID ${e} exists, but the associated handler (if one exists) doesn't support editing the item. You can avoid this error by either verifying that sync items of this type can be edited via the "canEditSynchronizationItemsOfType(type: string)" function or alternatively ensure that the synchronizaton handler for sync items of type "${t.type}" supports editing items.`);n(t)}async function cf(e){await u5.syncQueue.delete(e).catch(uJ.errnames.DatabaseClosed)}function cp(e,t,n,r={}){u7[e]={type:e,dependsOn:t,process:n,options:r}}let ch="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),cm=new Uint8Array(16),cy=[];for(let e=0;e<256;++e)cy.push((e+256).toString(16).slice(1));let cg=function(e,t,n){if(ch&&!t&&!e)return ch();let r=(e=e||{}).random||(e.rng||function(){if(!a&&!(a="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(cm)})();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return cy[e[t+0]]+cy[e[t+1]]+cy[e[t+2]]+cy[e[t+3]]+"-"+cy[e[t+4]]+cy[e[t+5]]+"-"+cy[e[t+6]]+cy[e[t+7]]+"-"+cy[e[t+8]]+cy[e[t+9]]+"-"+cy[e[t+10]]+cy[e[t+11]]+cy[e[t+12]]+cy[e[t+13]]+cy[e[t+14]]+cy[e[t+15]]}(r)},cb="OFFLINE+";function cv(){return cb+cg()}function cw(e){return e.startsWith(cb)}let c_={};function cx(){return Object.values(c_)}function cS(e){c_[e.id]&&console.warn(`[setupDynamicOfflineDataHandler] Another second handler with the ID "${e.id}" was registered. This handler will override the previous one. This could be unintended as the previous handler might run different flows than the newly registered one. If this is the case, ensure that you are setting up the handlers with different IDs.`),c_[e.id]=e}async function cE(e){let t=await cR();return await cD(t,e)}async function cD(e,t){let n=new u3;return await n.dynamicOfflineData.where(t?{type:t,users:e}:{users:e}).toArray().catch(uJ.errnames.DatabaseClosed,()=>[])}async function cO(e,t){let n=await cR();return await cP(n,e,t)}async function cP(e,t,n){let r=new u3,o=await r.dynamicOfflineData.get({type:t,identifier:n}).catch(uJ.errnames.DatabaseClosed,()=>void 0);o?o.users.includes(e)||await r.dynamicOfflineData.update(o.id,{users:[...o.users,e]}).catch(uJ.errnames.DatabaseClosed):await r.dynamicOfflineData.add({users:[e],type:t,identifier:n}).catch(uJ.errnames.DatabaseClosed)}async function ck(e,t){let n=await cR();return await cC(n,e,t)}async function cC(e,t,n){let r=new u3,o=await r.dynamicOfflineData.get({type:t,identifier:n,users:e}).catch(uJ.errnames.DatabaseClosed,()=>void 0);o&&(o.users.length>1?await r.dynamicOfflineData.update(o.id,{users:o.users.filter(t=>t!==e)}).catch(uJ.errnames.DatabaseClosed):await r.dynamicOfflineData.delete(o.id).catch(uJ.errnames.DatabaseClosed))}async function cj(e,t){let n=await cE(e);await Promise.all(n.map(async e=>cT(e.type,e.identifier,t)))}async function cT(e,t,n){await cO(e,t);let r=new u3,o=await cR(),i=await r.dynamicOfflineData.get({type:e,identifier:t}).catch(uJ.errnames.DatabaseClosed,()=>void 0),a=cx().filter(t=>t.type===e);if(!i)return;let s=await Promise.all(a.map(async e=>{try{return e.sync(t,n),{id:e.id,error:void 0}}catch(n){let t=n.message?.toString()??n.toString();return{id:e.id,error:t}}})),l=s.filter(e=>!e.error).map(e=>e.id),u=s.filter(e=>e.error).map(e=>e.id),c=s.filter(e=>e.error).map(e=>({handlerId:e.id,message:e.error})),d={syncedOn:new Date,syncedBy:o,succeededHandlers:l,erroredHandlers:u,errors:c};i.id&&await r.dynamicOfflineData.update(i.id,{syncState:d}).catch(uJ.errnames.DatabaseClosed)}async function cR(){let e=(await oY()).uuid;if(!e)throw Error("Using the dynamic offline data API requires a logged in user.");return e}let cA=Z("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function cM(){return c$(),cA}function cN(e,t){c$(),cS({type:"patient",displayName:t.displayName,id:e,isSynced:()=>Promise.resolve(!0),sync:(e,n)=>t.onOfflinePatientAdded({patientUuid:e,signal:n??new AbortController().signal})})}async function cI(e){c$(),await cT("patient",e)}function c$(){console.warn("The offline patient API has been deprecated and will be removed in a future release. To prevent future crashes, the functions remain available for the moment, but any invocations should be migrated ASAP.")}async function cL(e,t,n=!0){if(e){let r=null,[o,i]=await Promise.all([oF(`${oI}/Patient/${e}`,t).catch(e=>r=e),n?cF(e):Promise.resolve(null)]);if(o.ok)return o.data;if(i)return i;if(r)throw r}return null}async function cF(e){let t=(await cs("patient-registration")).find(t=>t.fhirPatient.id===e);return t?.fhirPatient??null}function cB(e,t){let n=new CustomEvent(`openmrs:${e}`,{detail:t??void 0,cancelable:!0,bubbles:!0});return window.dispatchEvent(n)}function cV(e,t){let n=e=>{t("detail"in e&&null!==e.detail?e.detail:void 0)};return window.addEventListener(`openmrs:${e}`,n),()=>{window.removeEventListener(`openmrs:${e}`,n)}}var cU=n(99549);function cW(e){return{uuid:e.uuid,display:e.display}}function cK(e=null,t=null){let n=new URLSearchParams;e&&n.set("tag",e),t&&n.set("q",t);let r=n.toString();return oB(`${oN}/location${r?"?"+r:""}`).pipe((0,cU.map)(e=>e.data.results.map(cW))).pipe((0,cU.take)(1))}function cz(e){return{uuid:e.uuid,display:e.display,name:e.name}}function cH(){return oB(`${oN}/visittype`).pipe((0,cU.map)(e=>e.data.results.map(cz))).pipe((0,cU.take)(1))}var cG=n(29827),cq=((es={}).NEWVISIT="startVisit",es.EDITVISIT="editVisit",es.LOADING="loadingVisit",es),cZ=((el={}).NOTSTARTED="notStarted",el.ONGOING="ongoing",el);let cY="custom:(uuid,display,voided,indication,startDatetime,stopDatetime,encounters:(uuid,display,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,display),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display))",cJ=function(){try{return JSON.parse(sessionStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};function cQ(){return J("visit",cJ)}function cX(e,t){cQ().setState({patientUuid:e,manuallySetVisitUuid:t})}function c0(e,t){return oF(`${oN}/visit`,{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function c1(e,t,n){return oF(`${oN}/visit/${e}`,{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}function c2(e,t,n){return oF(`${oN}/visit?patient=${e}&v=${n??cY}`,{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}})}cQ().subscribe(e=>{var t;t=e,sessionStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))});let c4=new cG.t(null);class c3{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+c3.version}static addUnaryOp(e){return c3.max_unop_len=Math.max(e.length,c3.max_unop_len),c3.unary_ops[e]=1,c3}static addBinaryOp(e,t,n){return c3.max_binop_len=Math.max(e.length,c3.max_binop_len),c3.binary_ops[e]=t,n?c3.right_associative.add(e):c3.right_associative.delete(e),c3}static addIdentifierChar(e){return c3.additional_identifier_chars.add(e),c3}static addLiteral(e,t){return c3.literals[e]=t,c3}static removeUnaryOp(e){return delete c3.unary_ops[e],e.length===c3.max_unop_len&&(c3.max_unop_len=c3.getMaxKeyLen(c3.unary_ops)),c3}static removeAllUnaryOps(){return c3.unary_ops={},c3.max_unop_len=0,c3}static removeIdentifierChar(e){return c3.additional_identifier_chars.delete(e),c3}static removeBinaryOp(e){return delete c3.binary_ops[e],e.length===c3.max_binop_len&&(c3.max_binop_len=c3.getMaxKeyLen(c3.binary_ops)),c3.right_associative.delete(e),c3}static removeAllBinaryOps(){return c3.binary_ops={},c3.max_binop_len=0,c3}static removeLiteral(e){return delete c3.literals[e],c3}static removeAllLiterals(){return c3.literals={},c3}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new c3(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return c3.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!c3.binary_ops[String.fromCharCode(e)]||c3.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return c3.isIdentifierStart(e)||c3.isDecimalDigit(e)}throwError(e){let t=Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(c3.hooks[e]){let n={context:this,node:t};return c3.hooks.run(e,n),n.node}return t}searchHook(e){if(c3.hooks[e]){let t={context:this};return c3.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===c3.SPACE_CODE||e===c3.TAB_CODE||e===c3.LF_CODE||e===c3.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:c3.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t=[],n,r;for(;this.index<this.expr.length;)if((n=this.code)===c3.SEMCOL_CODE||n===c3.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())t.push(r);else if(this.index<this.expr.length){if(n===e)break;this.throwError('Unexpected "'+this.char+'"')}return t}gobbleExpression(){let e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,c3.max_binop_len),t=e.length;for(;t>0;){if(c3.binary_ops.hasOwnProperty(e)&&(!c3.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!c3.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,n,r,o,i,a,s,l;if(!(i=this.gobbleToken())||!(t=this.gobbleBinaryOp()))return i;for(o={value:t,prec:c3.binaryPrecedence(t),right_a:c3.right_associative.has(t)},(a=this.gobbleToken())||this.throwError("Expected expression after "+t),r=[i,o,a];t=this.gobbleBinaryOp();){if(0===(n=c3.binaryPrecedence(t))){this.index-=t.length;break}o={value:t,prec:n,right_a:c3.right_associative.has(t)},l=t;let s=e=>o.right_a&&e.right_a?n>e.prec:n<=e.prec;for(;r.length>2&&s(r[r.length-2]);)a=r.pop(),t=r.pop().value,i=r.pop(),e={type:c3.BINARY_EXP,operator:t,left:i,right:a},r.push(e);(e=this.gobbleToken())||this.throwError("Expected expression after "+l),r.push(o,e)}for(s=r.length-1,e=r[s];s>1;)e={type:c3.BINARY_EXP,operator:r[s-1].value,left:r[s-2],right:e},s-=2;return e}gobbleToken(){let e,t,n,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"))return this.runHook("after-token",r);if(e=this.code,c3.isDecimalDigit(e)||e===c3.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===c3.SQUOTE_CODE||e===c3.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(e===c3.OBRACK_CODE)r=this.gobbleArray();else{for(n=(t=this.expr.substr(this.index,c3.max_unop_len)).length;n>0;){if(c3.unary_ops.hasOwnProperty(t)&&(!c3.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!c3.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=n;let e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:c3.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--n)}c3.isIdentifierStart(e)?(r=this.gobbleIdentifier(),c3.literals.hasOwnProperty(r.name)?r={type:c3.LITERAL,value:c3.literals[r.name],raw:r.name}:r.name===c3.this_str&&(r={type:c3.THIS_EXP})):e===c3.OPAREN_CODE&&(r=this.gobbleGroup())}return r?(r=this.gobbleTokenProperty(r),this.runHook("after-token",r)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===c3.PERIOD_CODE||t===c3.OBRACK_CODE||t===c3.OPAREN_CODE||t===c3.QUMARK_CODE;){let n;if(t===c3.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==c3.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===c3.OBRACK_CODE?((e={type:c3.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),(t=this.code)!==c3.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===c3.OPAREN_CODE?e={type:c3.CALL_EXP,arguments:this.gobbleArguments(c3.CPAREN_CODE),callee:e}:(t===c3.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),e={type:c3.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),n&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e="",t,n;for(;c3.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===c3.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);c3.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if("e"===(t=this.char)||"E"===t){for(e+=this.expr.charAt(this.index++),("+"===(t=this.char)||"-"===t)&&(e+=this.expr.charAt(this.index++));c3.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);c3.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return n=this.code,c3.isIdentifierStart(n)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(n===c3.PERIOD_CODE||1===e.length&&e.charCodeAt(0)===c3.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:c3.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="",t=this.index,n=this.expr.charAt(this.index++),r=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===n){r=!0;break}if("\\"===t)switch(t=this.expr.charAt(this.index++)){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return r||this.throwError('Unclosed quote after "'+e+'"'),{type:c3.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(c3.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length;)if(e=this.code,c3.isIdentifierPart(e))this.index++;else break;return{type:c3.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){let t=[],n=!1,r=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===e){n=!0,this.index++,e===c3.CPAREN_CODE&&r&&r>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(o===c3.COMMA_CODE){if(this.index++,++r!==t.length){if(e===c3.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===c3.CBRACK_CODE)for(let e=t.length;e<r;e++)t.push(null)}}else if(t.length!==r&&0!==r)this.throwError("Expected comma");else{let e=this.gobbleExpression();e&&e.type!==c3.COMPOUND||this.throwError("Expected comma"),t.push(e)}}return n||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(c3.CPAREN_CODE);if(this.code===c3.CPAREN_CODE)return(this.index++,1===e.length)?e[0]:!!e.length&&{type:c3.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:c3.ARRAY_EXP,elements:this.gobbleArguments(c3.CBRACK_CODE)}}}Object.assign(c3,{hooks:new class{add(e,t,n){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][n?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}},plugins:new class{constructor(e){this.jsep=e,this.registered={}}register(...e){e.forEach(e=>{if("object"!=typeof e||!e.name||!e.init)throw Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(c3),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),c3.max_unop_len=c3.getMaxKeyLen(c3.unary_ops),c3.max_binop_len=c3.getMaxKeyLen(c3.binary_ops);let c6=e=>new c3(e).parse(),c5=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(c3).filter(e=>!c5.includes(e)&&void 0===c6[e]).forEach(e=>{c6[e]=c3[e]}),c6.Jsep=c3,c6.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let n=t.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:n,consequent:r,alternate:o},n.operator&&e.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&e.binary_ops[r.right.operator]<=.9;)r=r.right;t.node.test=r.right,r.right=t.node,t.node=n}}else this.throwError("Expected :")}})}});let c7="ArrowFunctionExpression",c9={Array,Boolean,Symbol,Infinity,NaN,Math,Number,BigInt,String,RegExp,JSON,isFinite,isNaN,parseFloat,parseInt,decodeURI,encodeURI,encodeURIComponent,Object:{__proto__:void 0,assign:Object.assign.bind(null),fromEntries:Object.fromEntries.bind(null),hasOwn:Object.hasOwn.bind(null),keys:Object.keys.bind(null),is:Object.is.bind(null),values:Object.values.bind(null)}},c8={...c9,Promise};function de(e,t={}){return ds(e,t,dc)}async function dt(e,t={}){return dl(e,t,dc)}function dn(e,t={}){return ds(e,t,dd)}function dr(e,t={}){return dl(e,t,dd)}function di(e,t={}){return ds(e,t,df)}function da(e,t={}){return dl(e,t,df)}function ds(e,t={},n){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))throw`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`;if("string"==typeof e&&0===e.trim().length)throw{type:"Empty expression",message:"Expression cannot be an empty string"};null==t&&(t={});let r=dg(t,c9),o=dp("string"==typeof e?c6(e):e,r);if(n(o))return o;throw{type:"Invalid result",message:"string"==typeof e?`The expression ${e} did not produce a valid result`:"The expression did not produce a valid result"}}async function dl(e,t={},n){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))return Promise.reject(`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`);if("string"==typeof e&&0===e.trim().length)throw{type:"Empty expression",message:"Expression cannot be an empty string"};null==t&&(t={});let r=dg(t,c8);return Promise.resolve(dp("string"==typeof e?c6(e):e,r)).then(t=>{if(n(t))return t;throw{type:"Invalid result",message:"string"==typeof e?`The expression ${e} did not produce a valid result`:"The expression did not produce a valid result"}})}function du(e){return c6(e)}function dc(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e||e instanceof Date}function dd(e){return"boolean"==typeof e}function df(e){return"number"==typeof e}function dp(e,t){switch(e.type){case"UnaryExpression":var n,r,o,i,a,s,l,u,c,d,f,p,h,m=e,y=t;let g=dp(m.argument,y);switch(m.operator){case"+":return+g;case"-":return-g;case"~":return~g;case"!":return!g;default:throw`Expression evaluator does not support operator '${m.operator}''`}case"BinaryExpression":var b=e,v=t;switch(b.operator){case"&&":return dp(b.left,v)&&dp(b.right,v);case"||":return dp(b.left,v)||dp(b.right,v);case"??":return dp(b.left,v)??dp(b.right,v)}let w=dp(b.left,v),x=dp(b.right,v);switch(b.operator){case"+":return w+x;case"-":return w-x;case"*":return w*x;case"/":return w/x;case"%":return w%x;case"**":return w**x;case"==":return w==x;case"===":return w===x;case"!=":return w!=x;case"!==":return w!==x;case">":return w>x;case">=":return w>=x;case"<":return w<x;case"<=":return w<=x;case"in":return w in x;default:throw`Expression evaluator does not support operator '${b.operator}' operator`}case"ConditionalExpression":return n=e,r=t,dp(n.test,r)?dp(n.consequent,r):dp(n.alternate,r);case"CallExpression":return dw(dm(e,t));case"ArrowFunctionExpression":let S;return o=e,i=t,S=o.params?.map(e=>{if("Identifier"===e.type)return e.name;throw`Cannot handle parameter of type ${e.type}`})??[],(function(...e){if(e.length<S.length)throw`Required argument(s) ${S.slice(e.length,-1).join(", ")} were not provided`;let t=Object.fromEntries(S.reduce((t,n,r)=>{let o=e[r];return function e(t){if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"function"==typeof t||null===t||t instanceof RegExp)return!0;if("object"==typeof t){for(let n of Object.keys(t))if(!e(t[n]))return!1;return!0}if(Array.isArray(t)){for(let n of t)if(!e(n))break}return!1}(o)&&t.push([n,o]),t},[]));return dp(o.body,i.addVariables(t))}).bind(null);case"MemberExpression":return dw(dy(e,t));case"ArrayExpression":return a=e,s=t,a.elements?.map(d_(s));case"SequenceExpression":let E;return l=e,u=t,(E=l.expressions.map(d_(u)))[E.length-1];case"NewExpression":var D=e,O=t;if(D.callee&&"Identifier"===D.callee.type){let e=D.arguments?.map(d_(O));switch(D.callee.name){case"Date":return new Date(...e);case"RegExp":return new RegExp(...e);default:throw`Cannot instantiate object of type ${D.callee.name}`}}if(D.callee)throw"new must be called with either Date or RegExp";throw'Could not handle "new" without a specified class';case"Literal":return e.value;case"Identifier":return c=e,d=t,(dx(c.name),d.variables&&Object.hasOwn(d.variables,c.name))?d.variables[c.name]:Object.hasOwn(d.globals,c.name)?d.globals[c.name]:void 0;case"TemplateLiteral":let P,k;return f=e,p=t,P=f.expressions?.map(d_(p))??[],(k=f.quasis?.map(d_(p))??[]).filter(e=>!e.tail).map(e=>e.value).join("")+P.join("")+k.filter(e=>e.tail).map(e=>e.value).join("");case"TemplateElement":return{value:(h=e).cooked,tail:h.tail};default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function dh(e,t){switch(e.type){case"Literal":return e.value;case"Identifier":return e.name;case"MemberExpression":return dh(e.property,t);default:throw`VisitExpressionName does not support expression of type '${e.type}'`}}function dm(e,t){let n=dv(e.callee,t);if(n===db||e.optional&&null==n)return db;let r=e.arguments?.map(d_(t));if(n){if("function"!=typeof n)throw`${dD(e.callee)} is not a function`}else throw`No function named ${dD(e.callee)} is defined in this context`;return n(...r)}function dy(e,t){let n=dv(e.object,t);if(n===db||e.optional&&null==n)return db;if(null===n)throw TypeError(`TypeError: cannot read properties of null (reading '${dE(e.property,t)}')`);if(void 0===n)switch(e.object.type){case"Identifier":{let n=dh(e.object,t);throw ReferenceError(`ReferenceError: ${n} is not defined`)}case"MemberExpression":throw TypeError(`TypeError: cannot read properties of undefined (reading '${dE(e.property,t)}')`);default:throw`VisitMemberExpression does not support operator '${e.object.type}' type`}if("object"!=typeof n&&"function"!=typeof n&&"string"!=typeof n&&"number"!=typeof n)throw`VisitMemberExpression does not support member access on type ${typeof n}`;let r=e.computed?function(e){if(void 0===e)throw{type:"Illegal property access",message:"No property was supplied to the property access"};if("string"!=typeof e&&"number"!=typeof e)throw{type:"Illegal property access",message:`Cannot use a value of type ${null===e?"null":typeof e} as a property name`};return e}(dp(e.property,t)):function(e){if("Identifier"!==e.type)throw`VisitMemberExpression does not support a property of type '${e.type}'`;return e.name}(e.property);dx(r),function(e,t){if(dS.has(String(t)))return;let n=Object(e);for(;null!==n;){if(Object.hasOwn(n,t)){if(n===Object.prototype||n===Function.prototype)throw{type:"Illegal property access",message:`Cannot access the ${t} property of objects`};return}n=Object.getPrototypeOf(n)}}(n,r);let o=n[r];return"function"==typeof o?o.bind(n):o}function dg(e,t){let n={variables:{...e},globals:{...t},addVariables(e){return this.variables={...this.variables,...e},this}};return n.addVariables.bind(n),n}c6.plugins.register({name:"arrow",init(e){e.addBinaryOp("=>",.1,!0),e.hooks.add("gobble-expression",function(t){if(this.gobbleSpaces(),this.code===e.OPAREN_CODE){let n=this.index;if(this.index++,this.gobbleSpaces(),this.code===e.CPAREN_CODE){this.index++;let e=this.gobbleBinaryOp();if("=>"===e){let n=this.gobbleBinaryExpression();n||this.throwError("Expected expression after "+e),t.node={type:c7,params:null,body:n};return}}this.index=n}}),e.hooks.add("after-expression",function(t){!function t(n){n&&(Object.values(n).forEach(e=>{e&&"object"==typeof e&&t(e)}),"=>"===n.operator&&(n.type=c7,n.params=n.left?[n.left]:null,n.body=n.right,n.params&&n.params[0].type===e.SEQUENCE_EXP&&(n.params=n.params[0].expressions),delete n.left,delete n.right,delete n.operator))}(t.node)})}}),c6.plugins.register({name:"new",init(e){e.addUnaryOp("new"),e.hooks.add("after-token",function(t){let n=t.node;if(n&&"new"===n.operator){n.argument&&[e.CALL_EXP,e.MEMBER_EXP].includes(n.argument.type)||this.throwError("Expected new function()"),t.node=n.argument;let r=t.node;for(;r.type===e.MEMBER_EXP||r.type===e.CALL_EXP&&r.callee.type===e.MEMBER_EXP;)r=r.type===e.MEMBER_EXP?r.object:r.callee.object;r.type="NewExpression"}})}}),c6.plugins.register({name:"numbers",init(e){function t(e){return"x"===e||"X"===e?(this.index+=2,[[48,57],[65,70],[97,102]]):"b"===e||"B"===e?(this.index+=2,[[48,49]]):"o"===e||"O"===e||e>="0"&&e<="7"?(this.index+=e<="7"?1:2,[[48,55]]):null}function n(t){let n=this.index,r="",o=()=>{for(;e.isDecimalDigit(this.code)||95===this.code;)95===this.code?this.index++:r+=this.expr.charAt(this.index++)};o(),this.code===e.PERIOD_CODE&&(r+=this.expr.charAt(this.index++),o());let i=this.char;("e"===i||"E"===i)&&(r+=this.expr.charAt(this.index++),("+"===(i=this.char)||"-"===i)&&(r+=this.expr.charAt(this.index++)),o(),e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+r+this.char+")"));let a=this.code;if(e.isIdentifierStart(a))this.throwError("Variable names cannot start with a number ("+r+this.char+")");else if(a===e.PERIOD_CODE){r.length>1&&this.throwError(`Unexpected period ${JSON.stringify({chCode:a,number:r},null,2)}`),this.index=n;return}t.node={type:e.LITERAL,value:parseFloat(r),raw:this.expr.substring(n,this.index)}}e.hooks.add("gobble-token",function(r){if(48===this.code){var o,i,a;let s=this.index,l=this.expr.charAt(this.index+1),u=t.call(this,l);if(!u)return;let c="";for(;o=this.code,i=u,95===o||i.some(([e,t])=>o>=e&&o<=t);)95===this.code?this.index++:c+=this.expr.charAt(this.index++);if(e.isIdentifierPart(this.code)){if(e.isDecimalDigit(this.code)&&e.isDecimalDigit(l.charCodeAt(0))){this.index=s+1,n.call(this,r);return}this.throwError("unexpected char within number")}r.node={type:e.LITERAL,value:parseInt(c,"x"===(a=l)||"X"===a?16:"b"===a||"B"===a?2:8),raw:this.expr.substring(s,this.index)}}else(e.isDecimalDigit(this.code)||this.code===e.PERIOD_CODE)&&n.call(this,r)})}}),c6.plugins.register({name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){let n=++this.index,r=!1;for(;this.index<this.expr.length;){if(47===this.code&&!r){let r,o=this.expr.slice(n,this.index),i="";for(;++this.index<this.expr.length;){let e=this.code;if(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57)i+=this.char;else break}try{r=new RegExp(o,i)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:r,raw:this.expr.slice(n-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?r=!0:r&&this.code===e.CBRACK_CODE&&(r=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}}),c6.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let n=t.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:n,consequent:r,alternate:o},n.operator&&e.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&e.binary_ops[r.right.operator]<=.9;)r=r.right;t.node.test=r.right,r.right=t.node,t.node=n}}else this.throwError("Expected :")}})}}),c6.plugins.register({name:"jsepTemplateLiteral",init(e){function t(e,n=!0){if(96===this.code){let t={type:"TemplateLiteral",quasis:[],expressions:[]},r="",o="",i=!1,a=this.expr.length,s=()=>t.quasis.push({type:"TemplateElement",value:{raw:o,cooked:r},tail:i});for(;this.index<a;){let a=this.expr.charAt(++this.index);if("`"===a)return this.index+=1,i=!0,s(),e.node=t,n&&(e.node=this.gobbleTokenProperty(e.node)),e.node;if("$"===a&&"{"===this.expr.charAt(this.index+1))this.index+=2,s(),o="",r="",t.expressions.push(...this.gobbleExpressions(125)),125!==this.code&&this.throwError("unclosed ${");else if("\\"===a)switch(o+=a,a=this.expr.charAt(++this.index),o+=a,a){case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+=" ";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:r+=a}else r+=a,o+=a}this.throwError("Unclosed `")}}e.hooks.add("gobble-token",t),e.hooks.add("after-token",function(n){if((n.node.type===e.IDENTIFIER||n.node.type===e.MEMBER_EXP)&&96===this.code)return n.node={type:"TaggedTemplateExpression",tag:n.node,quasi:t.bind(this)(n,!1)},n.node=this.gobbleTokenProperty(n.node),n.node})}}),c6.addBinaryOp("in",7),c6.addBinaryOp("??",1);let db=Symbol("optional chain short-circuited");function dv(e,t){switch(e.type){case"MemberExpression":return dy(e,t);case"CallExpression":return dm(e,t);default:return dp(e,t)}}function dw(e){return e===db?void 0:e}function d_(e){return function(t){return null===t?null:dp(t,e)}}function dx(e){if("__proto__"===e||"prototype"===e||"constructor"===e)throw{type:"Illegal property access",message:`Cannot access the ${e} property of objects`}}let dS=new Set(["toString","valueOf","hasOwnProperty"]);function dE(e,t){try{return dh(e,t)}catch{return"<computed>"}}function dD(e){return e?"MemberExpression"===e.type?e.property?.name:e.name:null}function dO(e){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))throw`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`;let t={globals:{...c8},isLocalExpression:!1,variables:new Set};return dP("string"==typeof e?c6(e):e,t),[...t.variables]}function dP(e,t){switch(e.type){case"UnaryExpression":return r=e,o=t,dP(r.argument,o);case"BinaryExpression":return i=e,a=t,[dP(i.left,a),dP(i.right,a)].filter(Boolean);case"ConditionalExpression":return s=e,l=t,[dP(s.consequent,l),dP(s.test,l),dP(s.alternate,l)].filter(Boolean);case"CallExpression":let n;return u=e,c=t,n=dP(u.callee,c),u.arguments?.map(dk(c)),n;case"ArrowFunctionExpression":var r,o,i,a,s,l,u,c,d,f,p,h,m,y,g,b,v=e,w=t;let x={...w};x.isLocalExpression=!0;let S=v.params?.map(dk(x))??[],E=dP(v.body,x)??[];if(E&&Array.isArray(E))for(let e of E)S.includes(e)||w.variables.add(e);return;case"MemberExpression":var D=e,O=t;if(dP(D.object,O),D.computed)return void dP(D.property,O);let P={...O};P.isLocalExpression=!0,dP(D.property,P);return;case"ArrayExpression":return d=e,f=t,void d.elements?.map(dk(f));case"SequenceExpression":return p=e,h=t,void p.expressions?.map(dk(h));case"NewExpression":return m=e,y=t,void m.arguments?.map(dk(y));case"Literal":case"TemplateElement":return;case"Identifier":var k=e,C=t;if(!(k.name in C.globals))if(C.isLocalExpression)return k.name;else C.variables.add(k.name);return;case"TemplateLiteral":return g=e,b=t,void(g.expressions?.map(dk(b)),g.quasis?.map(dk(b)));default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function dk(e){return function(t){return null===t?null:dP(t,e)}}let dC=J("feature-flags",{flags:function(){let e={};for(let t of Object.keys(localStorage))if(t.startsWith("openmrs:feature-flag:")){let n=t.replace("openmrs:feature-flag:",""),r=JSON.parse(localStorage.getItem(`openmrs:feature-flag-meta:${n}`)||"{}");e[n]={enabled:"true"===localStorage.getItem(t),...r}}return e}()});function dj(e,t,n){dC.setState(r=>({flags:{...r.flags,[e]:{enabled:r.flags[e]?.enabled??!1,label:t,description:n}}}))}function dT(){let e=dC.getState().flags;Object.keys(localStorage).filter(e=>e.startsWith("openmrs:feature-flag:")).forEach(t=>{let n=t.replace("openmrs:feature-flag:","");e[n]||(localStorage.removeItem(t),localStorage.removeItem(`openmrs:feature-flag-meta:${n}`))})}function dR(e){return dC.getState().flags[e].enabled}function dA(e,t){dC.subscribe(n=>{t(n.flags[e].enabled)})}function dM(e,t){dC.setState(n=>({flags:{...n.flags,[e]:{...n.flags[e],enabled:t}}}))}function dN(e){return!window.offlineEnabled||(e??navigator.onLine)}dC.subscribe(e=>{for(let[t,n]of Object.entries(e.flags))localStorage.setItem(`openmrs:feature-flag:${t}`,n.enabled.toString()),localStorage.setItem(`openmrs:feature-flag-meta:${t}`,JSON.stringify({label:n.label,description:n.description}))});var dI=e4(function(e,t,n){eH(e,t,n)});function d$(e=!0,t=!1){return dL(dN(),e,t)}function dL(e,t=!0,n=!1){return!!(e?t:n)}let dF=Z("extensionsInternal",{slots:{},extensions:{}}),dB=Z("extensionRenderings",{renderings:new Map}),dV=()=>J("extensionsInternal",{slots:{},extensions:{}}),dU=()=>J("extensionRenderings",{renderings:new Map});function dW(e){let t=dF.getState(),n=e(t);n!==t&&dF.setState(n)}let dK=null,dz=null;function dH(){let e=dB.getState();return dK&&e===dz||(dK=new Map(e.renderings),dz=e,function(e){for(let t of(d2.clear(),e.values()))d3(t,1);d4=!0}(dK)),dK}function dG(e){dz={renderings:e},dB.setState(dz,!0)}function dq(e){let t=dH();t.has(e.renderingId)||(t.set(e.renderingId,e),d3(e,1),dG(t))}function dZ(e){let t=dH(),n=t.get(e);n&&(t.delete(e),d3(n,-1),dG(t))}let dY=()=>J("extensions",{slots:{}}),dJ=0,dQ=new Set;function dX(e){dJ++;try{return e()}finally{if(0==--dJ&&dQ.size>0){let e=Array.from(dQ);for(let t of(dQ.clear(),e))d0(t)}}}function d0(e){try{e()}catch(t){console.error(`The extension system's '${e.name}' recomputation failed`,t)}}function d1(e){dJ>0?dQ.add(e):d0(e)}let d2=new Map,d4=!1;function d3(e,t){let n=JSON.stringify([e.slotName,e.extensionId,e.slotModuleName,e.extensionModuleName]),r=d2.get(n);if(!r){if(t<0)return;d2.set(n,{count:1,record:{slotModuleName:e.slotModuleName,extensionModuleName:e.extensionModuleName,slotName:e.slotName,extensionId:e.extensionId}}),d4=!0;return}r.count+=t,r.count<1&&(d2.delete(n),d4=!0)}function d6(){var e,t;if(dH(),!d4)return;d4=!1;let n=Array.from(d2.values(),({record:e})=>e);n.sort(d5),e=t4.getState().mountedExtensions,t=n,e.length===t.length&&e.every((e,n)=>0===d5(e,t[n]))||t4.setState({mountedExtensions:n})}function d5(e,t){return d7(e.slotName,t.slotName)||d7(e.extensionId,t.extensionId)||d7(e.slotModuleName,t.slotModuleName)||d7(e.extensionModuleName,t.extensionModuleName)}function d7(e,t){return e===t?0:e<t?-1:1}d6(),dB.subscribe(()=>d1(d6));let d9=dV(),d8=dY(),fe=t6(),ft=t9(),fn=new Set,fr=!1;function fo(e){if(null===e)fn=null;else if(null!==fn)for(let t of e)fn.add(t);d1(fi)}function fi(){if(!fr){fr=!0;try{for(let e=1;;e++){let t=fn;if(null!==t&&0===t.size)return;fn=new Set;try{!function(e,t,n,r,o,i=null){let a=d8.getState().slots,s={},l=!1,u=dN(),c=Object.entries(r.flags).filter(([,{enabled:e}])=>e).map(([e])=>e);for(let[r,d]of Object.entries(e.slots)){let f=a[r];if(f&&i&&!i.has(r)){s[r]=f;continue}let{config:p}=t7(t,d.name),h=function(e,t,n,r,o,i,a){let s=function(e,t){let n=e.add||[],r=e.remove||[],o=e.order||[],{extensions:i}=d9.getState();return[...t,...n].filter(e=>!r.includes(e)).sort((e,n)=>fy(e,o,i[fu(e)]?.order,t)-fy(n,o,i[fu(n)]?.order,t))}(n,t.slots[e].attachedIds),l=[];for(let u of s){let{config:s}=ne(r,e,u),c=nt(n,e,u),d=c?dI({},s,c):s,f=fu(u),p=t.extensions[f];if(p){let e=d?.["Display conditions"]?.privileges??p.privileges??[];if(e&&("string"==typeof e||Array.isArray(e)&&e.length>0)&&(!a?.user||!oZ(e,a.user))||p.featureFlag&&!o.includes(p.featureFlag)||window.offlineEnabled&&!dL(i,p.online,p.offline))continue;l.push({id:u,name:f,moduleName:p.moduleName,config:d,featureFlag:p.featureFlag,meta:p.meta,online:d?.["Display conditions"]?.online??p.online??!0,offline:d?.["Display conditions"]?.offline??p.offline??!1,displayConditionExpression:d?.["Display conditions"]?.expression||p.displayExpression})}}return l}(r,e,p,n,c,u,o.session);f&&f.moduleName===d.moduleName&&tm(f.candidateExtensions,h)?s[r]=f:(s[r]={moduleName:d.moduleName,candidateExtensions:h},l=!0)}(l||Object.keys(a).length!==Object.keys(s).length)&&d8.setState({slots:s})}(d9.getState(),fe.getState(),ft.getState(),dC.getState(),oU.getState(),t)}catch(e){throw fn=null===t||null===fn?null:new Set([...t,...fn]),e}if(e>=20)return void console.error("The extension system stopped recomputing after 20 passes because something keeps invalidating slots in response to the extension store being written. Some slots are left stale until the next write.")}}finally{fr=!1}}}function fa(e,t){let n=new Set;for(let r of Object.keys(e))e[r]!==t[r]&&n.add(r);for(let r of Object.keys(t))r in e||n.add(r);return n}function fs(){fo(null)}function fl(e,t){return{moduleName:t,name:e,attachedIds:[]}}function fu(e){let[t]=e.split("#");return t}function fc(e,t){let n=fu(t);return e.extensions[n]}function fd(e){return fc(d9.getState(),e)}d9.subscribe((e,t)=>{fo(e.extensions!==t.extensions?null:fa(e.slots,t.slots))}),fe.subscribe((e,t)=>{fo(fa(e.slots,t.slots))}),ft.subscribe((e,t)=>{fo(fa(e.configs,t.configs))}),dC.subscribe(()=>fo(null)),oU.subscribe(()=>fo(null)),fs(),b(fs);let ff=e=>dW(t=>({...t,extensions:{...t.extensions,[e.name]:{...e}}}));function fp(e,t){dW(n=>{let r=n.slots[e];return r?{...n,slots:{...n.slots,[e]:{...r,attachedIds:[...r.attachedIds,t]}}}:{...n,slots:{...n.slots,[e]:{...fl(e),attachedIds:[t]}}}})}function fh(e,t){dW(n=>{let r=n.slots[e];return r&&r.attachedIds.includes(t)?{...n,slots:{...n.slots,[e]:{...r,attachedIds:r.attachedIds.filter(e=>e!==t)}}}:n})}function fm(e){dW(t=>{let n=t.slots[e];return n?{...t,slots:{...t.slots,[e]:{...n,attachedIds:[]}}}:t})}function fy(e,t,n,r){let o=t.indexOf(e);if(-1!==o)return o;{if(void 0!==n)return 1e3+n;let t=r.indexOf(e);return -1!==t?2e3+t:3e3}}function fg(e,t){return function(e,t,n=null,r){let o;return e.filter(e=>{let i=e.displayConditionExpression;if("string"!=typeof i||0===i.trim().length)return!0;o??(o=t&&"object"==typeof t?{session:n,...t}:{session:n});try{return!!dn(i,o)}catch(t){return console.error(`Error while evaluating expression '${i}' for ${e.id}`+(r?` in ${r}`:""),t),!1}})}(fb(e),t,oU.getState().session,e)}function fb(e){return d8.getState().slots[e]?.candidateExtensions??[]}let fv=(e,t)=>d9.setState(n=>{let r=n.slots[t]?.moduleName;if(r&&r!=e)return console.warn(`An extension slot with the name '${t}' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ${r}.`),n;if(r&&r==e)return n;if(n.slots[t])return{...n,slots:{...n.slots,[t]:{...n.slots[t],moduleName:e}}};let o=fl(t,e);return{...n,slots:{...n.slots,[t]:{...o}}}}),fw=()=>{fn=null,dW(()=>({slots:{},extensions:{}})),dU().setState({renderings:new Map}),d8.setState({slots:{}})},f_=Z("left-nav",{slotName:null,basePath:window.spaBase,mode:"normal"});function fx({name:e,basePath:t,mode:n,componentContext:r,state:o}){f_.setState({slotName:e,basePath:t,mode:n??"normal",componentContext:r,state:o})}function fS(e){f_.getState().slotName===e&&f_.setState(f_.getInitialState(),!0)}let fE=Z("modalRegistry",{modals:{}});function fD(e){fE.setState(t=>(t.modals[e.name]=e,t))}function fO(e){let t=fE.getState().modals[e];if(!t){let n=fd(e);n&&(t={name:e,load:n.load,moduleName:n.moduleName},console.warn(`Modal ${e} was registered as an extension. This is deprecated and will be removed in the future. Please register it in the "modals" section of routes.json instead of the "extensions" section.`),fD(t))}return t}let fP=Z("workspaceRegistrations",{workspaces:{}}),fk=Z("workspaceGroups",{workspaceGroups:{}});function fC(e){fP.setState(t=>({workspaces:{...t.workspaces,[e.name]:{...e,load:e.load,preferredWindowSize:e.preferredWindowSize??"normal",type:e.type??"form",canHide:e.canHide??!1,canMaximize:e.canMaximize??!1,width:e.width??"narrow",groups:e.groups??[]}}}))}function fj(e){fk.setState(t=>{let n=t.workspaceGroups[e.name];return n?{workspaceGroups:{...t.workspaceGroups,[e.name]:{...n,members:Array.from(new Set([...n.members,...e.members]))}}}:{workspaceGroups:{...t.workspaceGroups,[e.name]:{name:e.name,members:e.members}}}})}let fT=new Set;function fR(e){let t=fP.getState().workspaces;if(t[e])return t[e];{let t=fd(e);if(t){var n;let r;return fT.has(e)||(console.warn(`The workspace '${e}' is registered as an extension. This is deprecated. Please register it in the "workspaces" section of the routes.json file.`),fT.add(e)),{name:t.name,title:(n=t,"string"==typeof(r=n?.meta?.title)?r:r&&"object"==typeof r?iB(n.moduleName,r.key,r.default):n.name),moduleName:t.moduleName,preferredWindowSize:t.meta?.screenSize??"normal",load:t.load,type:t.meta?.type??"form",canHide:t.meta?.canHide??!1,canMaximize:t.meta?.canMaximize??!1,width:t.meta?.width??"narrow",groups:t.meta?.groups??[]}}throw Error(`No workspace named '${e}' has been registered.`)}}function fA(e){let t=fk.getState().workspaceGroups;if(t[e])return t[e];throw Error(`No workspace group named '${e}' has been registered.`)}let fM=Z("workspace2",{registeredGroupsByName:{},registeredWindowsByName:{},registeredWorkspacesByName:{},openedGroup:null,openedWindows:[],workspaceTitleByWorkspaceName:{},isMostRecentlyOpenedWindowHidden:!1});function fN(e){let{registeredWorkspacesByName:t,registeredWindowsByName:n}=fM.getState(),r=t[e];if(r){let t=n[r.window];if(t)return t;throw Error(`No workspace window found with name: ${r.window} for workspace: ${e}`)}throw Error(`No workspace found with name: ${e}`)}function fI(e){let{registeredGroupsByName:t,registeredWindowsByName:n}=fM.getState(),r=n[e];if(r){let n=t[r.group];if(n)return n;throw Error(`No workspace group found with name: ${r.group} for window: ${e}`)}throw Error(`No workspace window found with name: ${e}`)}function f$(e){let{openedWindows:t}=fM.getState();return t.findIndex(t=>t.openedWorkspaces.find(t=>t.workspaceName===e))}function fL(e,t){if(0==t.length)return;let{registeredGroupsByName:n}=fM.getState(),r={...n};for(let n of t){if(r[n.name])throw Error(`Cannot register workspace group ${n.name} more than once`);r[n.name]={...n,moduleName:e}}fM.setState({registeredGroupsByName:r})}function fF(e,t){if(0==t.length)return;let{registeredWindowsByName:n}=fM.getState(),r={...n};for(let n of t){if(r[n.name])throw Error(`Cannot register workspace window ${n.name} more than once`);let t={...n,moduleName:e};r[n.name]=t}fM.setState({registeredWindowsByName:r})}function fB(e,t){if(0==t.length)return;let{registeredWorkspacesByName:n}=fM.getState(),r={...n};for(let n of t){if(r[n.name])throw Error(`Cannot register workspace ${n.name} more than once`);let t={...n,moduleName:e};r[n.name]=t}fM.setState({registeredWorkspacesByName:r})}let fV=0,fU=null,fW={bootstrap:15e3,mount:15e3,unmount:15e3};function fK(e,t){if(e.timeouts)return e;let n=e.name??"parcel",r=Object.fromEntries(Object.keys(fW).filter(t=>e[t]).map(r=>{var o,i;let a,s;return[r,(o=e[r],i=fW[r],a=Array.isArray(o)?o:[o],s=e=>a.reduce((t,o,i)=>t.then(()=>{let t=o(e);return"function"==typeof t?.then&&"function"==typeof t?.catch?t:Promise.reject(Error(`Lifecycle function ${r} at array index ${i} for parcel ${n} did not return a promise`))}),Promise.resolve(void 0)),e=>{let o,a=new Promise((e,t)=>{o=setTimeout(()=>t(Error(`Lifecycle function ${r} for parcel ${n} did not settle within ${i}ms`)),i)});return Promise.race([s(e),a]).finally(()=>clearTimeout(o)).then(e=>(t(r,!1),e),e=>{throw t(r,!0),e})})]}));return{...e,...r}}async function fz(e,t){var n,r;let o,i,a,s,l,u=await (fU??(fU=new Promise((e,t)=>{r$({name:"openmrs-extension-host",bootstrap:()=>Promise.resolve(),mount:t=>(e(t.mountParcel),Promise.resolve()),unmount:()=>Promise.resolve()},{domElement:document.createElement("div")}).mountPromise.catch(t)}).catch(e=>(console.error("The host parcel used to mount extensions could not be mounted. Falling back to mounting extensions as root parcels, which leaks their DOM elements.",e),r$))),fU),c={...t},d=(o=c,i=!1,{retarget:e=>o={...e},release:a=()=>(function(e){for(let t of Object.keys(e))delete e[t]})(o),onSettled(e,t){switch(e){case"bootstrap":t&&a();return;case"mount":i||(i=t);return;case"unmount":(t||i)&&a();return}}});return r=u((n=d.onSettled,"function"==typeof e?()=>e().then(e=>fK(e,n)):fK(e,n)),c),s=e=>t=>e.call(r,d.retarget(t)).catch(e=>{throw"SKIP_BECAUSE_BROKEN"===r.getStatus()&&d.release(),e}),l=r.update&&s(r.update),Object.defineProperty(r,"update",{configurable:!0,enumerable:!0,get:()=>l,set:e=>{l=e&&s(e)}})}function fH(){return fG}function fG(e,t){let n,r=fz(e,t).then(e=>n=e);return{mount:()=>r.then(e=>e.mount()),unmount:()=>r.then(e=>e.unmount()),update:e=>r.then(t=>t.update?.(e)),getStatus:()=>n?.getStatus()??"LOADING_SOURCE_CODE",get loadPromise(){return r.then(e=>e.loadPromise)},get bootstrapPromise(){return r.then(e=>e.bootstrapPromise)},get mountPromise(){return r.then(e=>e.mountPromise)},get unmountPromise(){return r.then(e=>e.unmountPromise)}}}async function fq(e,t,n,r,o=e=>e,i={}){let a=fu(r),s=fd(r),l=null;if(e){if(!s)throw Error(`Couldn't find extension '${a}' to attach to '${t}'`);let{meta:u,moduleName:c,online:d,offline:f,load:p}=s;if(d$(d,f)){let s,d=fV++,f=`${t}/${r}-${d}`;e.dataset.extensionRenderingId=f;let h=e=>{try{dZ(f)}catch(t){console.error(e,t)}};try{dq({renderingId:f,extensionName:a,extensionModuleName:c,extensionId:r,slotName:t,slotModuleName:n})}catch(e){throw h(`Recomputing configuration after registering '${r}' failed also failed`),e}try{s=await p()}catch(e){throw h(`Recomputing configuration after '${r}' failed to load also failed`),e}try{l=await fz(o({...s,name:`${t}/${a}-${d}`}),{...i,_meta:u,_extensionContext:{extensionId:r,extensionSlotName:t,extensionSlotModuleName:n,extensionModuleName:c},domElement:e})}catch(e){throw h(`Recomputing configuration after '${r}' failed to mount also failed`),e}l.mountPromise.then(void 0,e=>{console.error(`Extension '${r}' in slot '${t}' failed to mount`,e),h(`Recomputing configuration after '${r}' failed to mount also failed`)}),l.unmountPromise.then(()=>h(`Recomputing configuration after unmounting '${r}' failed`),e=>{console.error(`Extension '${r}' in slot '${t}' failed to unmount`,e),h(`Recomputing configuration after '${r}' failed to unmount also failed`)})}}else console.warn(`Tried to render ${r} into ${t} but no DOM element was available.`);return l}var fZ=n(35399),fY=n.n(fZ);let fJ=(0,fZ.createContext)({moduleName:"",featureName:""});function fQ({to:e,templateParams:t,onBeforeNavigate:n,children:r,...o}){return(0,fZ.useEffect)(()=>{o.href&&console.warn(`ConfigurableLink does not support the href prop. Use the 'to' prop instead. The provided href value is '${o.href}'`),o.onClick&&console.warn(`ConfigurableLink does not support the onClick prop. Use the 'onBeforeNavigate' prop instead. The 'to' prop of the offending link is ${e}`)},[]),fY().createElement("a",{onClick:r=>{0===r.button&&!r.ctrlKey&&!r.shiftKey&&!r.altKey&&!r.metaKey&&(r.preventDefault(),n?.(r),oD({to:e,templateParams:t})),0===r.button&&(r.ctrlKey||r.metaKey)&&n?.(r),0===r.button&&r.shiftKey&&n?.(r),1===r.button&&n?.(r)},href:oS(e,t),...o},r)}let fX=({state:e,children:t,...n})=>{let{extension:r}=(0,fZ.useContext)(fJ),o=(0,fZ.useRef)(null),i=(0,fZ.useRef)(Promise.resolve()),a=(0,fZ.useRef)(!1),s=(0,fZ.useRef)(!1),l=(0,fZ.useRef)(e),u=(0,fZ.useCallback)(e=>{if(!e)return;let t=()=>{"MOUNTED"===e.getStatus()&&e.unmount()};switch(e.getStatus()){case"MOUNTED":e.unmount();break;case"UPDATING":i.current?.then(t,t);break;default:e.mountPromise.then(t,()=>{})}},[]),c=(0,fZ.useCallback)((e,t)=>{e.update&&"UNMOUNTING"!==e.getStatus()&&(i.current=Promise.all([e.mountPromise,i.current]).then(()=>{if(o.current?.getStatus()==="MOUNTED"&&o.current.update)return o.current.update({...t})}).catch(e=>{let t=o.current?.getStatus();"UNMOUNTING"!==t&&"NOT_MOUNTED"!==t&&"UNLOADING"!==t&&console.error(`The extension '${r?.extensionId}' failed to update`,e)}))},[]),d=(0,fZ.useCallback)(t=>{t&&!o.current&&!s.current&&r?.extensionSlotName&&r.extensionSlotModuleName&&(s.current=!0,fq(t,r.extensionSlotName,r.extensionSlotModuleName,r.extensionId,void 0,e).then(t=>{(s.current=!1,o.current=t,a.current)?u(t):t&&l.current!==e&&c(t,l.current)},()=>{s.current=!1}))},[]);return(0,fZ.useEffect)(()=>(a.current=!1,()=>{a.current=!0,u(o.current)}),[]),(0,fZ.useEffect)(()=>{l.current=e,o.current&&c(o.current,e)},[e]),r?fY().createElement("div",{ref:d,"data-extension-id":r?.extensionId,style:{position:"relative"},...n}):null};function f0(e){let t=(0,fZ.useRef)(e);return F(t.current,e)||(t.current=e),t.current}function f1(e,t){"function"==typeof t&&(t=t(e));let n={};for(let[r,o]of Object.entries(t)){let t=function(...t){e.setState(e=>o(e,...t))};n[r]=t}return n}let f2=e=>e;function f4(e,t=f2,n){let r=(0,fZ.useCallback)(t=>e.subscribe(t),[e]),o=(0,fZ.useCallback)(()=>t(e.getState()),[e,t]),i=(0,fZ.useSyncExternalStore)(r,o,o),a=(0,fZ.useMemo)(()=>n?f1(e,n):null,[e,n]);return(0,fZ.useMemo)(()=>a?{...i,...a}:i,[i,a])}function f3(e,t){return f4(e,f2,t)}function f6(e){return function(t){let n=(0,fZ.useCallback)(t=>e.subscribe(t),[]),r=(0,fZ.useCallback)(()=>e.getState(),[]),o=(0,fZ.useSyncExternalStore)(n,r,r),i=(0,fZ.useMemo)(()=>t?f1(e,t):null,[t]);return(0,fZ.useMemo)(()=>i?{...o,...i}:o,[o,i])}}let f5=[];Object.freeze(f5);let f7={candidateExtensions:f5};Object.freeze(f7);let f9=e=>{let t=(0,fZ.useCallback)(t=>t.slots?.[e]??f7,[e]);return f4(dY(),t)},f8=e=>e.session;function pe(e,t){let{candidateExtensions:n}=f9(e),r=f4(oU,f8),o=f0(t);return(0,fZ.useMemo)(()=>fg(e,o),[e,o,r,n])}function pt(e,t){let{moduleName:n}=(0,fZ.useContext)(fJ);if(!n)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,fZ.useEffect)(()=>{fv(n,e)},[n,e]),{extensions:pe(e,t),extensionSlotName:e,extensionSlotModuleName:n}}function pn(e){return e}function pr({name:e,extensionSlotName:t,select:n=pn,children:r,state:o,style:i,...a}){if(r&&o)throw Error("Both children and state have been provided. If children are provided, the state must be passed as a prop to the `Extension` component.");let s=e??t,l=(0,fZ.useRef)(null),{extensions:u,extensionSlotModuleName:c}=pt(s,o),d=(0,fZ.useMemo)(()=>n(u),[n,u]),f=(0,fZ.useMemo)(()=>{if("function"==typeof r&&!fY().isValidElement(r))return d.map(e=>r(e,o))},[r,d]);return fY().createElement("div",{ref:l,"data-extension-slot-name":s,"data-extension-slot-module-name":c,style:{...i,position:"relative"},...a},s&&d?.map((e,t)=>fY().createElement(fJ.Provider,{key:e.id,value:{moduleName:c,featureName:"",extension:{extensionId:e.id,extensionSlotName:s,extensionSlotModuleName:c}}},f?.[t]??("function"!=typeof r?r:null)??fY().createElement(fX,{state:o}))))}var po=n(25873);function pi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pi(Object(n),!0).forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ps(e){return(ps="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pl(e){return(pl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pu(e,t){var n;if("function"!=typeof(n=t.domElement?function(){return t.domElement}:t.domElementGetter?t.domElementGetter:e.domElementGetter?e.domElementGetter:function(e){var t=e.appName||e.name;if(!t)throw Error("single-spa's dom-element-getter-helpers was not given an application name as a prop, so it can't make a unique dom element container for the react application");var n="single-spa-application:".concat(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)))throw Error("single-spa's dom-element-getter-helpers was given an invalid domElementGetter for application or parcel '".concat(t.name,"'. Expected a function, received ").concat(pl(n)));return function(){var e=n(t);if(!(e instanceof HTMLElement))throw Error("single-spa's dom-element-getter-helpers: domElementGetter returned an invalid dom element for application or parcel '".concat(t.name,"'. Expected HTMLElement, received ").concat(pl(e)));return e}}var pc=null;try{pc=require("react").createContext()}catch(e){}var pd={React:null,ReactDOM:null,ReactDOMClient:null,rootComponent:null,loadRootComponent:null,errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{},unmountResolves:{}};function pf(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then(function(t){e.rootComponent=t})}function pp(e,t){return new Promise(function(n,r){e.suppressComponentDidCatchWarning||!function(e){if(!(e&&"string"==typeof e.version&&e.version.indexOf(".")>=0))return!1;var t=e.version.slice(0,e.version.indexOf("."));try{return Number(t)>=16}catch(e){return!1}}(e.React)||e.errorBoundary||e.errorBoundaryClass||(e.rootComponent.prototype?e.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var o,i=pg(e,t,function(){n(this)}),a=pu(e,t)(),s=function(e){var t=e.reactDom,n=e.renderType,r=e.elementToRender,o=e.domElement,i=t[n];if("function"!=typeof i)throw Error('renderType "'.concat(n,'" did not return a function.'));switch(n){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var a=i(o);return a.render(r),a;case"hydrateRoot":return i(o,r);default:return i(r,o),null}}({elementToRender:i,domElement:a,reactDom:py(e),renderType:"function"==typeof(o=e).renderType?o.renderType():o.renderType});e.domElements[t.name]=a,e.renderResults[t.name]=s})}function ph(e,t){return new Promise(function(n){e.unmountResolves[t.name]=n;var r=e.renderResults[t.name];r&&r.unmount?r.unmount():py(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]})}function pm(e,t){return new Promise(function(n){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(n);var r=pg(e,t,null),o=e.renderResults[t.name];if(o&&o.render)o.render(r);else{var i=pu(e,t)();py(e).render(r,i)}})}function py(e){return e.ReactDOMClient||e.ReactDOM}function pg(e,t,n){var r=e.React.createElement(e.rootComponent,t),o=pc?e.React.createElement(pc.Provider,{value:t},r):r;return(e.errorBoundary||t.errorBoundary||e.errorBoundaryClass||t.errorBoundaryClass)&&(e.errorBoundaryClass=e.errorBoundaryClass||t.errorBoundaryClass||function(e,t){function n(t){e.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},n.displayName="SingleSpaReactErrorBoundary(".concat(t.name,")")}return n.prototype=Object.create(e.React.Component.prototype),n.prototype.render=function(){return this.state.caughtError?(e.errorBoundary||t.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},n.prototype.componentDidCatch=function(e,t){this.setState({caughtError:e,caughtErrorInfo:t})},n}(e,t),o=e.React.createElement(e.errorBoundaryClass,t,o)),o=e.React.createElement(e.SingleSpaRoot,pa(pa({},t),{},{mountFinished:n,updateFinished:function(){e.updateResolves[t.name]&&(e.updateResolves[t.name].forEach(function(e){return e()}),delete e.updateResolves[t.name])},unmountFinished:function(){e.unmountResolves[t.name]&&(e.unmountResolves[t.name](),delete e.unmountResolves[t.name])}}),o)}var pb=n(27807),pv=n(1619),pw=n.n(pv),p_=n(43432);let px={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},pS=new Map;(0,p_.initCache)(pS);let pE={errorRetryCount:3,fetcher:oF,focusThrottleInterval:18e5,revalidateIfStale:!0,revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshInterval:0,shouldRetryOnError:e=>{if(e instanceof oV){let t=e.response.status;return!!(t>=500)||401===t||403===t||429===t}return!0},provider:()=>pS};function pD(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw Error("Invalid options");let t=Object.assign({},px,e),n={...pE,...t.swrConfig};return function(e){var r,o,i,a,s;return i=o=class extends(r=fY().Component){componentDidCatch(e,n){n&&n.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:n.componentStack})),t.throwErrorsToConsole&&setTimeout(()=>{throw e}),this.setState({caughtError:e,caughtErrorInfo:n})}render(){if(this.state.caughtError)return fY().createElement("div",null,"An error has occurred. Please try reloading the page.");{let r=fY().createElement(fZ.Suspense,{fallback:null},fY().createElement(pv.SWRConfig,{value:n},fY().createElement(fJ.Provider,{value:this.state.config},t.disableTranslations?fY().createElement(e,this.props):fY().createElement(pb.I18nextProvider,{i18n:window.i18next,defaultNS:this.state.config.extension?`${this.state.config.moduleName}___${this.state.config.extension.extensionSlotName}___${this.state.config.extension.extensionId}`:this.state.config.moduleName},fY().createElement(e,this.props)))));return t.strictMode&&fY().StrictMode?fY().createElement(fY().StrictMode,null,r):r}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,featureName:t.featureName,extension:e._extensionContext}}}},a="displayName",s=`OpenmrsReactComponent(${t.featureName})`,a in i?Object.defineProperty(i,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[a]=s,o}}function pO(e,t){return function(e){if("object"!==ps(e))throw Error("single-spa-react requires a configuration object");var t,n=pa(pa({},pd),e);if(!n.React)throw Error("single-spa-react must be passed opts.React");if(!n.ReactDOM&&!n.ReactDOMClient)throw Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(n.renderType||(null!=(t=n.ReactDOMClient)&&t.createRoot?n.renderType="createRoot":n.renderType="render"),!n.rootComponent&&!n.loadRootComponent)throw 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");!pc&&n.React.createContext&&(pc=n.React.createContext()),n.SingleSpaRoot=function(e){function t(e){t.displayName="SingleSpaRoot(".concat(e.name,")")}return t.prototype=Object.create(e.React.Component.prototype),t.prototype.componentDidMount=function(){setTimeout(this.props.mountFinished)},t.prototype.componentWillUnmount=function(){setTimeout(this.props.unmountFinished)},t.prototype.render=function(){return setTimeout(this.props.updateFinished),this.props.children},t}(n);var r={bootstrap:pf.bind(null,n),mount:pp.bind(null,n),unmount:ph.bind(null,n)};return n.parcelCanUpdate&&(r.update=pm.bind(null,n)),r}({React:fY(),ReactDOMClient:po,rootComponent:pD(t)(e)})}function pP(e,t){return()=>e().then(({default:e})=>pO(e,t))}function pk(e,t){return()=>Promise.resolve(pO(e,t))}let pC=pP,pj=W()(()=>({}));Y("openmrs-app-context",pj);let pT={};function pR(e,t=e=>e){let n=pj.getState();return e in n?Object.freeze(Object.assign({},t?t(n[e]):n[e])):null}function pA(e,t){pj.setState(n=>(e in n||(n[e]={}),n[e]=t(n[e]),Object.assign({},n)))}function pM(e){return null===e?null:Object.freeze(Object.assign({},e))}let pN=new Map;function pI(e,t){let n=(0,fZ.useRef)(t??{}),r=(0,fZ.useRef)(t=>pA(e,t)),o=(0,fZ.useRef)(Symbol());return(0,fZ.useEffect)(()=>{let n=t??{},r=o.current;return null===pR(e)?!function(e,t=pT){pj.setState(n=>{if(e in n)throw Error(`Attempted to re-register namespace ${e} in the app context. Each namespace must be unregistered before the name can be registered again.`);return Object.assign({},n,{[e]:t===pT?{}:t})})}(e,n):(console.warn(`Namespace ${e} is already registered in the app context. This is likely a race condition during navigation, but may indicate two components are trying to own the same namespace. Updating the existing context.`),pA(e,()=>n)),pN.set(e,r),()=>{pN.get(e)===r&&(pj.setState(t=>(e in t&&delete t[e],t)),pN.delete(e))}},[e]),(0,fZ.useEffect)(()=>{let r=t??{};F(n.current,r)||(pA(e,()=>r),n.current=r)},[t]),r.current}function p$({namespace:e,value:t}){return pI(e,t),null}let pL=({children:e,value:t,fallback:n})=>t?fY().createElement(fY().Fragment,null,e):n?fY().createElement(fY().Fragment,null,n):null;function pF(){let e=(0,fZ.useRef)();return(!e.current||e.current.signal.aborted)&&(e.current=new AbortController),(0,fZ.useEffect)(()=>{let t=e.current;return()=>t?.abort()},[]),e.current}function pB(e,t=e=>e??{}){let[n,r]=(0,fZ.useState)(()=>{if(pV(e))return;let n=pR(e);if(null!==n)return t?t(n):n});return(0,fZ.useEffect)(()=>{if(pV(e))throw Error(`The namespace supplied to useAppContext must be a non-empty string, but was "${e}".`)},[e]),(0,fZ.useEffect)(()=>{var n;let o;return(n=e=>{if(null==e)return void r(void 0);let n=t?t(e):e;r(e=>F(e,n)?e:n)})(pM(o=pR(e))),pj.subscribe(t=>{let r=e in t?t[e]:null;r!==o&&(o=r,n(pM(r)))})},[e,t]),n}function pV(e){return"string"!=typeof e||0===e.trim().length}function pU(e){let t=pe(e);return(0,fZ.useMemo)(()=>t.map(e=>e.id),[t])}function pW(e){return f9(e).candidateExtensions}function pK(e,t,n){let{data:r,error:o,mutate:i,isLoading:a,isValidating:s}=pw()(e?ak(e,t,n):null,oF);return(0,fZ.useMemo)(()=>({isLoading:a,data:r?.data.results??[],error:o,mutate:i,isValidating:s}),[r,o,a,s,i])}function pz(e){(0,fZ.useEffect)(()=>{if(e){let e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[e])}let pH={},pG=`No ComponentContext has been provided. This should come from "openmrsComponentDecorator".
16
+ Usually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".`;function pq(e){let{moduleName:t,extension:n}=(0,fZ.useContext)(fJ),r=e?.externalModuleName??t;if(!r&&!n)throw Error(pG);let o=function(e){let t=(0,fZ.useMemo)(()=>t3(e),[e]),n=function(e){let[t,n]=(0,fZ.useState)(()=>{let t=e.getState();return t.loaded&&t.config?t.config:null});return(0,fZ.useEffect)(()=>e?.subscribe(e=>{e.loaded&&e.config&&n(e.config)}),[e]),t}(t);if(!n)throw pH[e]||(pH[e]=new Promise(e=>{let n=t.subscribe(t=>{t.loaded&&t.config&&(e(t.config),n())})})),pH[e];return n}(r),i=function(e){let t=(0,fZ.useMemo)(t9,[]),n=function(e,t){let[n,r]=(0,fZ.useState)(t?()=>{let n=ne(e.getState(),t.extensionSlotName,t.extensionId);if(n.loaded&&n.config)return n.config}:null);return(0,fZ.useEffect)(()=>{if(t)return e.subscribe(e=>{let o=ne(e,t.extensionSlotName,t.extensionId);o.loaded&&o.config&&!tm(o.config,n)&&r(o.config)})},[e,t,n]),n}(t,e);if(!n&&e){let n=`${e.extensionSlotName}-${e.extensionId}`;throw!pH[n]&&t&&(pH[n]=new Promise(n=>{let r=t.subscribe(t=>{let o=ne(t,e.extensionSlotName,e.extensionId);o.loaded&&o.config&&(n(o.config),r())})})),pH[n]}return n||{}}(n);return(0,fZ.useMemo)(()=>e?.externalModuleName&&r===e.externalModuleName?{...o}:{...o,...i},[r,e?.externalModuleName,o,i])}let pZ=pe;function pY(){let[e,t]=(0,fZ.useState)(dN());return(0,fZ.useEffect)(()=>b(({online:e})=>t(e)),[]),e}function pJ(e,t=300){let[n,r]=(0,fZ.useState)(e);return(0,fZ.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}var pQ=n(13660),pX=n.n(pQ);let p0=`custom:${[["admissionDecisionConcept","ref"],["admissionEncounterType","ref"],["admissionForm","ref"],["atFacilityVisitType","ref"],["bedAssignmentEncounterType","ref"],["cancelADTRequestEncounterType","ref"],["checkInClerkEncounterRole","ref"],["checkInEncounterType","ref"],["clinicianEncounterRole","ref"],["conceptSourcesForDiagnosisSearch","ref"],["consultEncounterType","ref"],["consultFreeTextCommentsConcept","ref"],["denyAdmissionConcept","ref"],["diagnosisMetadata","ref"],["diagnosisSets","ref"],["dischargeForm","ref"],["dispositionDescriptor","ref"],["dispositions","ref"],["emrApiConceptSource","ref"],["exitFromInpatientEncounterType","ref"],["extraPatientIdentifierTypes","ref"],["fullPrivilegeLevel","ref"],["highPrivilegeLevel","ref"],["identifierTypesToSearch","ref"],["inpatientNoteEncounterType","ref"],["lastViewedPatientSizeLimit","ref"],["metadataSourceName","ref"],["motherChildRelationshipType","ref"],["narrowerThanConceptMapType","ref"],["nonDiagnosisConceptSets","ref"],["orderingProviderEncounterRole","ref"],["patientDiedConcept","ref"],["personImageDirectory","ref"],["primaryIdentifierType","ref"],["sameAsConceptMapType","ref"],["suppressedDiagnosisConcepts","ref"],["supportsAdmissionLocationTag","(uuid,display,name,links)"],["supportsLoginLocationTag","(uuid,display,name,links)"],["supportsTransferLocationTag","(uuid,display,name,links)"],["supportsVisitsLocationTag","(uuid,display,name,links)"],["telephoneAttributeType","ref"],["testPatientPersonAttributeType","ref"],["transferForm","ref"],["transferRequestEncounterType","ref"],["transferWithinHospitalEncounterType","ref"],["unknownCauseOfDeathConcept","ref"],["unknownLocation","ref"],["unknownPatientPersonAttributeType","ref"],["unknownProvider","ref"],["visitAssignmentHandlerAdjustEncounterTimeOfDayIfNecessary","ref"],["visitExpireHours","ref"],["visitNoteEncounterType","ref"]].map(([e,t])=>`${e}:${t}`).join(",")}`;function p1(){let e=`${oN}/emrapi/configuration?v=${p0}`,t=pX()(e,oF);return(0,fZ.useMemo)(()=>({emrConfiguration:t.data?.data,isLoadingEmrConfiguration:t.isLoading,mutateEmrConfiguration:t.mutate,errorFetchingEmrConfiguration:t.error}),[t])}let p2=f6(dV());function p4(e){let t=pe(e);return(0,fZ.useMemo)(()=>Object.fromEntries(t.map(e=>[e.name,e.meta])),[t])}let p3=f6(dY());function p6(e){let{flags:t}=f4(dC);return t[e]?.enabled??!1}function p5(){let[,e]=(0,fZ.useState)(0);return(0,fZ.useCallback)(()=>{e(e=>e+1)},[])}function p7(e,t,n={}){return p8(e,t,p9,n)}let p9={getPaginatedUrl:(e,t,n)=>{if(!e)return null;{let r=new URL(oL(e.toString()),window.location.toString());return r.searchParams.set("limit",""+t),r.searchParams.set("startIndex",""+n),r.searchParams.set("totalCount","true"),r.toString()}},getNextUrl:e=>{let t=e?.links?.find(e=>"next"==e.rel)?.uri;if(!t)return null;{let e=new URL(t);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.totalCount??NaN,getCurrentPageSize:e=>e?.results?.length??NaN,getData:e=>e?.results};function p8(e,t,n,r={}){let{getPaginatedUrl:o,getTotalCount:i,getCurrentPageSize:a,getData:s}=n,{immutable:l,swrConfig:u}=r,c=r.fetcher??oF,[d,f]=(0,fZ.useState)(1),p=(0,fZ.useRef)(NaN),h=(0,fZ.useRef)(NaN),m=(0,fZ.useRef)(d),y=(0,fZ.useRef)(!1),g=(0,fZ.useRef)(!1),b=e?.toString()??"",[v,w]=(0,fZ.useState)(b);b!==v&&(w(b),f(1),m.current=1,p.current=NaN,h.current=NaN,y.current=!1,g.current=!1);let x=(d-1)*t,S=(0,fZ.useMemo)(()=>o(e,t,x),[e,t,x]),{data:E,...D}=(l?pX():pw())(S,c,u);E?.data&&(p.current=i(E?.data),h.current=a(E?.data),y.current=!0);let O=Math.ceil(p.current/t),P=(0,fZ.useCallback)(e=>{if(!Number.isInteger(e)||e<1)return void console.warn(`useServerPagination: ignoring goTo(${e}); page must be a positive integer.`);let n=Math.ceil(p.current/t);!y.current||Number.isNaN(n)||e<=n?(m.current=e,f(e)):console.warn("Invalid attempt to go to out of bounds page: "+e)},[t]);(0,fZ.useEffect)(()=>{if(!y.current)return;if(Number.isNaN(p.current)){g.current||(g.current=!0,console.warn(`useServerPagination: ${b} returned no total count, so out-of-range pages cannot be detected.`));return}let e=Math.max(1,Math.ceil(p.current/t));d>e&&(console.warn(`Invalid attempt to go to out of bounds page: ${d}; returning to page ${e}.`),m.current=e,f(e))},[d,t,b,E]);let k=(0,fZ.useCallback)(()=>{P(m.current+1)},[P]),C=(0,fZ.useCallback)(()=>{P(m.current-1)},[P]);return{data:s(E?.data),totalPages:O,totalCount:p.current,currentPage:d,currentPageSize:h.current,paginated:O>1,showNextButton:d<O,showPreviousButton:d>1,goTo:P,goToNext:k,goToPrevious:C,...D}}function he(e,t,n={}){return p8(e,t,ht(),n)}function ht(){return{getPaginatedUrl:(e,t,n)=>{if(!e)return null;{let r=new URL(oL(e.toString()),window.location.toString());return r.searchParams.set("_count",""+t),r.searchParams.set("_getpagesoffset",""+n),r.toString()}},getNextUrl:e=>{let t=e?.link?.find(e=>"next"==e.relation)?.url;if(!t)return null;{let e=new URL(t);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.total??NaN,getCurrentPageSize:e=>e?.entry?.length??NaN,getData:e=>e?.entry?.map(e=>e.resource)}}var hn=n(30682),hr=n.n(hn);function ho(e,t={}){return hi(e,p9,t)}function hi(e,t,n={}){let{swrInfiniteConfig:r,immutable:o}=n,{getNextUrl:i,getTotalCount:a,getData:s}=t,l=n.fetcher??oF,u=(0,fZ.useCallback)((n,r)=>0==n?e?.toString()??null:t.getNextUrl(r.data),[e]),{data:c,size:d,setSize:f,...p}=hr()(u,l,{...r,...o?{revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1}:{}}),h=i(c?.[c.length-1].data),m=a(c?.[0]?.data);return{data:c?.flatMap(e=>s(e.data)),totalCount:m,hasMore:null!=h,loadMore:()=>{f((c?.length??0)+1)},nextUri:h,...p}}function ha(e,t={}){return hs(e,p9,t)}function hs(e,t,n={}){let r=hi(e,t,n),{hasMore:o,error:i,data:a,loadMore:s,isLoading:l,nextUri:u}=r;return((0,fZ.useEffect)(()=>{o&&!i&&s()},[o,u]),n.partialData)?r:{...r,data:o||i?void 0:a,isLoading:l||o}}function hl(e,t={}){return hs(e,ht(),t)}function hu(e,t={}){return hi(e,ht(),t)}function hc(){let e="tablet";return document.body.classList.forEach(t=>{switch(t){case"omrs-breakpoint-lt-tablet":e="phone";break;case"omrs-breakpoint-gt-small-desktop":e="large-desktop";break;case"omrs-breakpoint-gt-tablet":e="small-desktop"}}),e}function hd(){let[e,t]=(0,fZ.useState)(hc);return(0,fZ.useEffect)(()=>{let e=()=>{t(hc())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}let hf=e=>"small-desktop"===e||"large-desktop"===e;function hp(e){let t=(0,fZ.useContext)(fJ);(0,fZ.useEffect)(()=>(t&&t.moduleName&&(e.componentContext=t),fx(e),()=>{fS(e.name)}),[t,e])}function hh(){return f4(f_)}function hm(e=null,t=null){let[n,r]=(0,fZ.useState)([]);return(0,fZ.useEffect)(()=>{let n=cK(e,t).subscribe(e=>{r(e)},e=>{console.error(e)});return()=>n.unsubscribe()},[e,t]),n}function hy(e,t=!0){let n=(0,fZ.useRef)(null);return(0,fZ.useEffect)(()=>{let r=r=>{t&&n.current&&r.target&&r.target instanceof Node&&(n.current.contains(r.target)||e(r))};return window.addEventListener("mousedown",r),window.addEventListener("touchstart",r),()=>{window.removeEventListener("mousedown",r),window.removeEventListener("touchstart",r)}},[e,t]),n}function hg(e){let t=(0,fZ.useRef)();return(0,fZ.useEffect)(()=>{let n=new IntersectionObserver(t=>{for(let n of t)if(n.isIntersecting)return void e()},{threshold:1});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current,e]),t}function hb(e,t={}){let{abortController:n,fetchInit:r,url:o,swrConfig:i}=t,a=pF(),s=(0,fZ.useMemo)(()=>r?.signal??n?.signal??a.signal,[n?.signal,r?.signal,a.signal]),l=(0,fZ.useCallback)(e=>oF(function(e,t){if(t)return"function"==typeof t?t(e):t;if("string"==typeof e)return e;throw Error(`When using useOpenmrsSWR with a key that is not a string, you must provide a url() function that converts the key to a valid url. The key for this hook is ${e}.`)}(e,o),{...r,signal:s}),[s,r,o]);return pw()(e,l,i)}function hv(e=[],t=10){let[n,r]=(0,fZ.useState)(1),o=(0,fZ.useMemo)(()=>"number"==typeof t&&t>0?Math.max(1,Math.ceil(e.length/t)):1,[e.length,t]);n>o&&r(o);let i=Math.min(Math.max(1,n),o),a=(0,fZ.useMemo)(()=>{let n=(i-1)*t,r=(i+0)*t;return e.slice(n,r)},[e,i,t]),s=(0,fZ.useCallback)(e=>{!Number.isInteger(e)||e<1?console.warn(`usePagination: ignoring goTo(${e}); page must be a positive integer.`):r(e)},[]),l=(0,fZ.useCallback)(()=>{r(e=>e+1)},[]),u=(0,fZ.useCallback)(()=>{r(e=>Math.max(1,e-1))},[]);return(0,fZ.useMemo)(()=>({results:a,totalPages:o,currentPage:i,paginated:e.length>t,showNextButton:i<o,showPreviousButton:i>1,goTo:s,goToNext:l,goToPrevious:u}),[a,o,e.length,t,i,s,l,u])}function hw(e,t,n,r){return{pageSizes:(0,fZ.useMemo)(()=>{let n=Math.ceil(t/e);return isNaN(n)&&(n=0),[...Array(n).keys()].map(t=>(t+1)*e)},[e,t]),pageItemsCount:(0,fZ.useMemo)(()=>e>t?t:e*n>t?e*(n-1)+r:e*n,[e,t,n,r])}}function h_(){let e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function hx(e){let[t,n]=(0,fZ.useState)(e??h_()),{data:r,error:o,isValidating:i}=pw()(t?["patient",t]:null,()=>cL(t,{}));return(0,fZ.useEffect)(()=>{let e=()=>{let e=h_();e!==t&&n(e)};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)},[t]),(0,fZ.useMemo)(()=>({isLoading:i&&!o&&!r,patient:r,patientUuid:t,error:o}),[i,o,r,t])}function hS(){let e=`${oN}/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType`,{data:t,error:n,isLoading:r}=pw()(e,oF);return(0,fZ.useMemo)(()=>({primaryIdentifierCode:t?.data?.results[0]?.metadataUuid,isLoading:r,error:n}),[t,n,r])}function hE(e){let{extensions:t,extensionSlotModuleName:n}=pt(e);return e?t.map(t=>({state:r})=>fY().createElement(fJ.Provider,{value:{moduleName:n,featureName:"",extension:{extensionId:t.id,extensionSlotName:e,extensionSlotModuleName:n}}},fY().createElement(fX,{state:r}))):[]}function hD(){let e=(0,fZ.useRef)(),[t,n]=(0,fZ.useState)(null),r=null;if(!t){if(s){let e=oz().getState();e.loaded&&(r=e.session)}else s=new Promise(t=>{let n=({loaded:n,session:o})=>{n&&(t(o),r=o,e.current&&(e.current(),e.current=void 0))};n(oz().getState()),r||(e.current=oz().subscribe(n))});if(r)n(r);else throw s}(0,fZ.useEffect)(()=>(e.current||(e.current=oz().subscribe(({loaded:e,session:t})=>{e&&(r=t,n(t))})),()=>{e.current&&(e.current(),e.current=void 0)}),[]);let o=t||r;if(!o)if(s)throw console.warn("useSession is in an unexpected state. Attempting to recover."),s;else throw Error("useSession is in an invalid state.");return o}let hO=({privilege:e,fallback:t,children:n})=>{let[r,o]=(0,fZ.useState)(null);return((0,fZ.useEffect)(()=>{let e=oK({includeAuthStatus:!1}).subscribe(o);return()=>e.unsubscribe()},[]),r&&oZ(e,r))?fY().createElement(fY().Fragment,null,n):t?fY().createElement(fY().Fragment,null,t):null};var hP=n(80222),hk=n.n(hP),hC=n(85602);let hj=new Map;function hT(){for(let e of Array.from(hj.values()))e()}let hR={setVisitContext:(e,t)=>null==t?{manuallySetVisitUuid:null}:{manuallySetVisitUuid:t.uuid,patientUuid:t.patient?.uuid}};function hA(e){let t=(0,fZ.useId)();return(0,fZ.useEffect)(()=>{if(e)return hj.set(t,e),()=>{hj.delete(t)}},[t,e]),{...f3(cQ(),hR),mutateVisit:hT}}function hM(e,t=cY){let n=(0,fZ.useRef)(void 0),{patientUuid:r,manuallySetVisitUuid:o,setVisitContext:i}=hA((0,fZ.useCallback)(()=>n.current?.(),[])),a=e&&r==e?o:null,s=`?patient=${e}&v=${t}&includeInactive=false`,l=`/${a}?v=${t}`,{data:u,error:c,mutate:d,isValidating:f}=pw()(e?`${oN}/visit${s}`:null,oF),{data:p,error:h,mutate:m,isValidating:y}=pw()(e&&a?`${oN}/visit${l}`:null,oF),g=(0,fZ.useMemo)(()=>u?.data.results.find(e=>null===e.stopDatetime)??null,[u]),b=(0,fZ.useMemo)(()=>a&&p?p.data:null,[p,a]),v=(0,fZ.useRef)(null);(0,fZ.useEffect)(()=>{!f&&g&&r===e&&null===o&&i(g),y||(v.current&&b&&v.current.uuid===b.uuid&&!v.current.stopDatetime&&b.stopDatetime&&i(null),v.current=b)},[b,o,g,f,y,r]);let w=(0,fZ.useCallback)(()=>{d(),m()},[d,m]);(0,fZ.useEffect)(()=>{n.current=w},[w]);let x=!!(!u||a&&!p),S=!!(a?h:c);return{error:c||h,mutate:w,isValidating:f||y,activeVisit:g,currentVisit:b,currentVisitIsRetrospective:!!a,isLoading:x&&!S}}function hN(){let[e,t]=(0,fZ.useState)([]);return(0,fZ.useEffect)(()=>{let e=cH().subscribe(e=>{t(e)},e=>console.error(e));return()=>e.unsubscribe()},[]),e}hk().extend(hC);let hI=new Map;async function h$(e,t){let n=t.indexOf("#"),r=n>=0,o=r?t.substring(0,n):e,i=r?t.substring(n+1):t,a=await at(o);return a&&Object.hasOwn(a,i)&&"function"==typeof a[i]?hF(o,a).then(()=>a[i]()):(a?a&&Object.hasOwn(a,i)?console.warn(`The export ${t}, defined in ${e}'s routes.json, is not a function`):console.warn(`${o} does not define a component called "${i}", referenced in ${e}'s routes.json. This cannot be loaded.`):console.warn(`Unknown app ${o} for ${t} defined in ${e}'s routes.json`),hL)}let hL={bootstrap:()=>Promise.resolve(),mount:()=>Promise.resolve(),unmount:()=>Promise.resolve()};async function hF(e,t){if(e in hI)await hI[e];else{let n=t??await at(e);await (hI[e]=new Promise((t,r)=>{if(Object.hasOwn(n,"startupApp")){let o=n.startupApp;if("function"==typeof o)return Promise.resolve(o()).then(()=>{n_(e),t(null)}).catch(r)}n_(e),t(null)}))}}function hB(e,t){let n=t.name;if(!n)return void console.error(`An extension definition in ${e} is missing an name and thus cannot be
17
17
  registered. To fix this, ensure that you define the "name" field inside the
18
18
  extension definition.`,t);t.slots&&t.slot&&console.warn(`The extension ${n} from ${e} declares both a 'slots' property and
19
19
  a 'slot' property. Only the 'slots' property will be honored.`);let r=t.slots?t.slots:t.slot?[t.slot]:[];if(!t.component)return void console.error(`The extension ${n} from ${e} is missing a 'component' entry and thus cannot be registered.
@@ -29,15 +29,15 @@ To fix this, ensure that you define the "description" field inside the feature f
29
29
  To fix this, ensure that you define the "label" field inside the feature flag definition.`,t):console.error(`A feature flag definition in ${e} is missing a name and thus cannot be registered.
30
30
  To fix this, ensure that you define the "name" field inside the feature flag definition.`,t);else console.warn(`A feature flag for ${e} could not be registered as it does not appear to have the required properties`,t)})}})(e,t))}function hW(){hV.sort((e,t)=>e.appName.localeCompare(t.appName,"en"));let e=new Map;for(let t of hV){e.has(t.appName)?e.set(t.appName,e.get(t.appName)+1):e.set(t.appName,0);let n=e.get(t.appName),r=`${t.appName}-page-${n}`,o=t.containerDomId??"omrs-apps-container",i=document.getElementById(o),a=`single-spa-application:${r}`;if(i){let e=document.createElement("div");e.id=a,i?.appendChild(e)}else throw Error(`${t.appName} ${t.component} cannot be mounted to "${o}"; DOM element does not exist.`);!function(e,t){let n=void 0!==t.route?t.route:void 0!==t.routeRegex&&new RegExp(t.routeRegex);!1===n?console.warn(`A registered page definition is missing a route and thus cannot be registered.
31
31
  To fix this, ensure that you define the "route" (or alternatively the "routeRegex") field inside the extension definition.`,e):t.component?ol(e,()=>h$(t.appName,t.component),function(e,{online:t,offline:n,featureFlag:r}){return window.offlineEnabled?o=>!!(navigator.onLine&&(t??!0)||!navigator.onLine&&n)&&(!r||!!dR(r))&&e(o):e}(function e(t){if(Array.isArray(t)){let n=t.map(e);return e=>n.some(t=>t(e))}return"string"==typeof t?oh(window.getOpenmrsSpaBase()+t):t instanceof RegExp?e=>t.test(e.pathname.replace(window.getOpenmrsSpaBase(),"")):()=>t}(n),t)):console.warn(`A registered page definition is missing a component and thus cannot be registered.
32
- To fix this, ensure that you define the "component" field inside the page definition.`,e)}(r,t)}}let hK={PHONE_MIN:0,PHONE_MAX:600,TABLET_MIN:601,TABLET_MAX:1023,SMALL_DESKTOP_MIN:1024,SMALL_DESKTOP_MAX:1439,LARGE_DESKTOP_MIN:1440,LARGE_DESKTOP_MAX:Number.MAX_SAFE_INTEGER};function hz(){document.body.classList.toggle("omrs-breakpoint-lt-tablet",window.innerWidth<hK.TABLET_MIN),document.body.classList.toggle("omrs-breakpoint-gt-phone",window.innerWidth>hK.PHONE_MAX),document.body.classList.toggle("omrs-breakpoint-gt-tablet",window.innerWidth>hK.TABLET_MAX),document.body.classList.toggle("omrs-breakpoint-lt-desktop",window.innerWidth<hK.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-small-desktop",window.innerWidth<hK.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-large-desktop",window.innerWidth<hK.LARGE_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-gt-small-desktop",window.innerWidth>hK.SMALL_DESKTOP_MAX)}let hH=!1;function hG(){hH||(window.addEventListener("resize",hz),hz(),hH=!0)}var hq=n(31085),hZ=n(53373),hY=n.n(hZ);function hJ({title:e,children:t}){let n="tablet"===hd();return(0,hq.jsxs)("div",{className:hY()({"-esm-form-engine__card-header-module__tabletHeader___xhRSy":n,"-esm-form-engine__card-header-module__desktopHeader___aPTXc":!n}),children:[(0,hq.jsx)("h4",{children:e}),t]})}let hQ=["red","magenta","purple","blue","teal","cyan","gray","green","warm-gray","cool-gray","high-contrast","outline"],hX={primaryColor:{_type:tG.String,_description:"The color for displaying primary diagnoses tags",_default:"red",_validators:[nX.oneOf(hQ)]},secondaryColor:{_type:tG.String,_description:"The color for displaying secondary diagnoses tags",_default:"blue",_validators:[nX.oneOf(hQ)]}},h0={"Brand color #1":{_default:"#005d5d",_type:tG.String},"Brand color #2":{_default:"#004144",_type:tG.String},"Brand color #3":{_default:"#007d79",_type:tG.String},excludePatientIdentifierCodeTypes:{uuids:{_type:tG.Array,_description:"List of UUIDs of patient identifier types to exclude from rendering in the patient banner",_default:[],_elements:{_type:tG.UUID}}},implementationName:{_type:tG.String,_description:"A name of the place (or authority) where all possible locations a user can choose are located.",_default:"Clinic"},patientPhotoConceptUuid:{_type:tG.ConceptUuid,_default:"736e8771-e501-4615-bfa7-570c03f4bef5",_description:"Used to look up the patient photo, which is stored as an attachment obs. Set to `null` in order to disable the feature and use only generated avatars. To remove the avatars entirely, use extension configuration's `remove` feature."},preferredCalendar:{_type:tG.Object,_description:"Keys should be locale codes, and values should be the preferred calendar for that locale. For example, {'am': 'ethiopic'}.",_default:{am:"ethiopic"},_elements:{_validators:[nX.oneOf(["buddhist","chinese","coptic","dangi","ethioaa","ethiopic","gregory","hebrew","indian","islamic","islamic-umalqura","islamic-tbla","islamic-civil","islamic-rgsa","iso8601","japanese","persian","roc","islamicc"])]}},preferredDateLocale:{_type:tG.Object,_description:"Allows setting the locale used for date formatting for any browser locale. Does not affect time formatting. Keys should be locale codes, and values should be the preferred locale for formatting dates. For example, {'en': 'en-US', 'fr-CA': 'en-CA'}.",_default:{en:"en-GB"},_elements:{_type:tG.String}},diagnosisTags:hX};var h1=n(52697);let h2={"carbon.table.batch.cancel":"cancel","carbon.table.batch.items.selected":"batchActionsItemsSelected","carbon.table.batch.item.selected":"batchActionItemSelected","carbon.table.batch.selectAll":"selectAll"},h4=e=>(0,hq.jsx)(h1.GGC,{translateWithId:(e,t)=>{let n=h2[e];return n?iV(n,e,t):e},...e}),h3="-esm-form-engine__custom-overflow-menu-module__container___QIBvW",h6="-esm-form-engine__custom-overflow-menu-module__menu___ZppPo",h5="-esm-form-engine__custom-overflow-menu-module__show___8rVUu",h7="-esm-form-engine__custom-overflow-menu-module__overflowMenuButton___0VKUu",h9=(0,fZ.createContext)(null);function h8(){let e=(0,fZ.useContext)(h9);if(!e)throw Error("useCustomOverflowMenu must be used within a CustomOverflowMenu");return e}function me({menuTitle:e,children:t}){let[n,r]=fY().useState(!1),o=hy(()=>r(!1),n),i="tablet"===hd(),a=(0,fZ.useCallback)(()=>r(e=>!e),[]),s=(0,fZ.useRef)(null),l=(0,fZ.useRef)(null),u=(0,fZ.useId)(),c=`custom-overflow-menu-trigger-${u}`,d=`custom-overflow-menu-${u}`,f=(0,fZ.useCallback)(()=>{r(!1),s.current?.focus()},[]),p=(0,fZ.useMemo)(()=>({closeMenu:f}),[f]),h=(0,fZ.useCallback)(e=>{"Escape"===e.key&&n&&(e.stopPropagation(),f())},[f,n]),m=fZ.Children.toArray(t);(0,fZ.useEffect)(()=>{if(n&&l.current){let e=l.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[n]);let y=(0,fZ.useCallback)(({currentIndex:e,direction:t})=>{let n=l.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!n?.length)return;let r=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,o=Array.from(n).indexOf(r);if(-1===o)return void n[t>0?0:n.length-1]?.focus();let i=o+t,a=i<0?n.length-1:i>=n.length?0:i;n[a]?.focus()},[]),g=m.map((e,t)=>(0,fZ.isValidElement)(e)?(0,fZ.cloneElement)(e,{closeMenu:f,handleOverflowMenuItemFocus:y,index:t}):e);return(0,hq.jsxs)("div",{"data-overflow-menu":!0,className:hY()("cds--overflow-menu",h3),ref:o,children:[(0,hq.jsx)("button",{className:hY()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":n},h7),"aria-controls":d,"aria-expanded":n,"aria-haspopup":"true",id:c,onClick:a,onKeyDown:h,ref:s,children:e}),(0,hq.jsxs)("div",{className:hY()("cds--overflow-menu-options","cds--overflow-menu--flip",h6,{[h5]:n}),"aria-labelledby":c,"data-floating-menu-direction":"bottom",id:d,onKeyDown:h,ref:l,role:"menu",tabIndex:-1,children:[(0,hq.jsx)("ul",{className:hY()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":i}),children:(0,hq.jsx)(h9.Provider,{value:p,children:g})}),(0,hq.jsx)("span",{})]})]})}function mt(e){let t=(0,fZ.useContext)(h9);return(0,hq.jsx)(h1.XSD,{...e,closeMenu:t?.closeMenu})}var mn=n(95571);let mr=["omrs-icon-activity","omrs-icon-add","omrs-icon-arrow-down","omrs-icon-arrow-left","omrs-icon-arrow-right","omrs-icon-arrow-up","omrs-icon-baby","omrs-icon-calendar-heat-map","omrs-icon-calendar","omrs-icon-caret-down","omrs-icon-caret-left","omrs-icon-caret-right","omrs-icon-caret-up","omrs-icon-chart-average","omrs-icon-chart-line","omrs-icon-checkmark-filled","omrs-icon-checkmark-outline","omrs-icon-chemistry","omrs-icon-chevron-down","omrs-icon-chevron-left","omrs-icon-chevron-right","omrs-icon-chevron-up","omrs-icon-close","omrs-icon-close-filled","omrs-icon-close-outline","omrs-icon-document","omrs-icon-document-attachment","omrs-icon-download","omrs-icon-drug-order","omrs-icon-edit","omrs-icon-event-schedule","omrs-icon-events","omrs-icon-gender-female","omrs-icon-gender-male","omrs-icon-gender-other","omrs-icon-gender-unknown","omrs-icon-generic-order-type","omrs-icon-group","omrs-icon-group-access","omrs-icon-hospital-bed","omrs-icon-image-medical","omrs-icon-information","omrs-icon-information-filled","omrs-icon-information-square","omrs-icon-inventory-management","omrs-icon-lab-order","omrs-icon-list-checked","omrs-icon-location","omrs-icon-material-order","omrs-icon-maximize","omrs-icon-medication","omrs-icon-message-queue","omrs-icon-microscope","omrs-icon-mobile-check","omrs-icon-money","omrs-icon-mother","omrs-icon-movement","omrs-icon-overflow-menu--horizontal","omrs-icon-overflow-menu--vertical","omrs-icon-password","omrs-icon-pedestrian-family","omrs-icon-pen","omrs-icon-printer","omrs-icon-procedure-order","omrs-icon-programs","omrs-icon-renew","omrs-icon-referral-order","omrs-icon-report","omrs-icon-reset","omrs-icon-save","omrs-icon-search","omrs-icon-settings","omrs-icon-shopping-cart","omrs-icon-shopping-cart--arrow-down","omrs-icon-sticky-note-add","omrs-icon-switcher","omrs-icon-syringe","omrs-icon-table-of-contents","omrs-icon-table","omrs-icon-time","omrs-icon-tools","omrs-icon-translate","omrs-icon-trash-can","omrs-icon-tree-view--alt","omrs-icon-two-factor-authentication","omrs-icon-user-avatar","omrs-icon-user-follow","omrs-icon-user-xray","omrs-icon-user","omrs-icon-view-off","omrs-icon-view","omrs-icon-warning"],mo=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-activity",iconProps:e})})),mi=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-add",iconProps:e})})),ma=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-arrow-down",iconProps:e})})),ms=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-arrow-left",iconProps:e})})),ml=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-arrow-right",iconProps:e})})),mu=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-arrow-up",iconProps:e})})),mc=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-baby",iconProps:e})})),md=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-calendar-heat-map",iconProps:e})})),mf=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-calendar",iconProps:e})})),mp=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-caret-down",iconProps:e})})),mh=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-caret-left",iconProps:e})})),mm=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-caret-right",iconProps:e})})),my=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-caret-up",iconProps:e})})),mg=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-chart-average",iconProps:e})})),mb=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-chart-line",iconProps:e})})),mv=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-checkmark-filled",iconProps:e})})),mw=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-checkmark-outline",iconProps:e})})),m_=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-chemistry",iconProps:e})})),mx=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-chevron-down",iconProps:e})})),mS=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-chevron-left",iconProps:e})})),mE=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-chevron-right",iconProps:e})})),mD=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-chevron-up",iconProps:e})})),mO=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-close",iconProps:e})})),mk=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-close-filled",iconProps:e})})),mP=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-close-outline",iconProps:e})})),mC=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-document",iconProps:e})})),mj=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-document-attachment",iconProps:e})})),mT=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-download",iconProps:e})})),mR=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-drug-order",iconProps:e})})),mA=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-edit",iconProps:e})})),mN=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-event-schedule",iconProps:e})})),mM=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-events",iconProps:e})})),mI=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-gender-female",iconProps:e})})),m$=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-gender-male",iconProps:e})})),mL=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-gender-other",iconProps:e})})),mF=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-gender-unknown",iconProps:e})})),mB=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-generic-order-type",iconProps:e})})),mV=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-group",iconProps:e})})),mU=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-group-access",iconProps:e})})),mW=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-hospital-bed",iconProps:e})})),mK=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-image-medical",iconProps:e})})),mz=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-information",iconProps:e})})),mH=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-information-filled",iconProps:e})})),mG=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-information-square",iconProps:e})})),mq=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-inventory-management",iconProps:e})})),mZ=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-lab-order",iconProps:e})})),mY=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-list-checked",iconProps:e})})),mJ=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-location",iconProps:e})})),mQ=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-material-order",iconProps:e})})),mX=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-maximize",iconProps:e})})),m0=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-medication",iconProps:e})})),m1=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-message-queue",iconProps:e})})),m2=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-microscope",iconProps:e})})),m4=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-mobile-check",iconProps:e})})),m3=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-money",iconProps:e})})),m6=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-mother",iconProps:e})})),m5=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-movement",iconProps:e})})),m7=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),m9=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),m8=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-password",iconProps:e})})),ye=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-pedestrian-family",iconProps:e})})),yt=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-pen",iconProps:e})})),yn=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-printer",iconProps:e})})),yr=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-procedure-order",iconProps:e})})),yo=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-programs",iconProps:e})})),yi=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-referral-order",iconProps:e})})),ya=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-renew",iconProps:e})})),ys=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-report",iconProps:e})})),yl=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-reset",iconProps:e})})),yu=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-save",iconProps:e})})),yc=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-search",iconProps:e})})),yd=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-settings",iconProps:e})})),yf=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-switcher",iconProps:e})})),yp=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-shopping-cart",iconProps:e})})),yh=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-shopping-cart--arrow-down",iconProps:e})})),ym=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-sticky-note-add",iconProps:e})})),yy=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-syringe",iconProps:e})})),yg=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-table-of-contents",iconProps:e})})),yb=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-table",iconProps:e})})),yv=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-time",iconProps:e})})),yw=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-tools",iconProps:e})})),y_=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-translate",iconProps:e})})),yx=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-trash-can",iconProps:e})})),yS=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-tree-view--alt",iconProps:e})})),yE=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-two-factor-authentication",iconProps:e})})),yD=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-user-avatar",iconProps:e})})),yO=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-user-follow",iconProps:e})})),yk=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-user-xray",iconProps:e})})),yP=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-user",iconProps:e})})),yC=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-view-off",iconProps:e})})),yj=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-view",iconProps:e})})),yT=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-warning",iconProps:e})})),yR=yT,yA=mj,yN=mY,yM=mK,yI=yh,y$=(0,fZ.memo)((0,fZ.forwardRef)(function({icon:e,fallback:t,...n},r){let o=(0,fZ.useRef)(e?document.getElementById(e):void 0);return(0,fZ.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),n=new MutationObserver(t=>{for(let n of t)"childList"===n.type&&(o.current=e?document.getElementById(e):void 0)});return t&&n.observe(t,{childList:!0}),()=>n.disconnect()},[e]),(0,hq.jsx)(pL,{value:o.current,fallback:t,children:(0,hq.jsx)(yL,{ref:r,icon:e,iconProps:n})})})),yL=(0,fZ.memo)((0,fZ.forwardRef)(function({icon:e,iconProps:t},n){let{className:r,fill:o,size:i}=Object.assign({},{fill:"currentColor",size:20},t);(i<=0||i>72)&&(console.error(`Invalid size '${i}' specified for ${e}. Defaulting to 20.`),i=20);let a=(0,fZ.useRef)(null);return(0,fZ.useImperativeHandle)(n,()=>a.current),(0,fZ.useEffect)(()=>{a.current&&"currentColor"!==o&&a.current.style.setProperty("--omrs-icon-fill",o)},[]),(0,hq.jsx)("svg",{ref:a,className:hY()("omrs-icon","-esm-form-engine__icons-module__icon___uq4qr",r),height:i,width:i,viewBox:"0 0 16 16",children:(0,hq.jsx)("use",{href:`#${e}`})})})),yF=({path:e,title:t,basePath:n,icon:r})=>{let{t:o}=(0,pb.useTranslation)(),i=(0,mn.useLocation)(),a=(0,fZ.useMemo)(()=>{if(!e)return!1;let t=e.startsWith("/")?e.slice(1):e;if(t.startsWith("http"))return t===window.location.href;let n=t.split("/").map(e=>decodeURIComponent(e)),r=(i.pathname??"").split("/").slice(1).map(e=>decodeURIComponent(e));return r.some((e,t)=>n.every((e,n)=>r[t+n]===e))},[i.pathname,e]);return(0,hq.jsx)("div",{children:(0,hq.jsx)(fQ,{className:hY()("cds--side-nav__link",{"active-left-nav-link":a}),to:`${n}/${encodeURIComponent(e)}`,children:(0,hq.jsxs)("span",{className:"-esm-form-engine__dashboard-module__menu___WbY42",children:[(0,hq.jsx)(y$,{icon:r,className:"-esm-form-engine__dashboard-module__icon___L-hKL",size:16}),(0,hq.jsx)("span",{children:o(t)})]})})},e)};function yB(e){return function({basePath:t}){return(0,hq.jsx)(mn.BrowserRouter,{children:(0,hq.jsx)(yF,{basePath:t,...e})})}}function yV(e){let t=(0,fZ.useRef)(null),n=(0,fZ.useRef)(void 0),r=(0,fZ.useCallback)(t=>{if("function"==typeof e){let n=e(t);return()=>{"function"==typeof n?n():e(null)}}if(e)return e.current=t,()=>{e.current=null}},[e]);return(0,fZ.useMemo)(()=>({get current(){return t.current},set current(value){t.current=value,n.current&&(n.current(),n.current=void 0),null!=value&&(n.current=r(value))}}),[r])}function yU(...e){return 1===e.length&&e[0]?e[0]:t=>{let n=!1,r=e.map(e=>{let r=yW(e,t);return n||="function"==typeof r,r});if(n)return()=>{r.forEach((t,n)=>{"function"==typeof t?t():yW(e[n],null)})}}}function yW(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function yK(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}let yz="u">typeof document?fY().useLayoutEffect:()=>{},yH={prefix:String(Math.round(1e10*Math.random())),current:0},yG=fY().createContext(yH),yq=fY().createContext(!1),yZ=("u">typeof window&&window.document&&window.document.createElement,new WeakMap),yY="function"==typeof fY().useId?function(e){let t=fY().useId(),[n]=(0,fZ.useState)(y0()),r=n?"react-aria":`react-aria${yH.prefix}`;return e||`${r}-${t}`}:function(e){let t=(0,fZ.useContext)(yG),n=function(e=!1){let t=(0,fZ.useContext)(yG),n=(0,fZ.useRef)(null);if(null===n.current&&!e){let e=fY().__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(e){let n=yZ.get(e);null==n?yZ.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==n.state&&(t.current=n.id,yZ.delete(e))}n.current=++t.current}return n.current}(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`};function yJ(){return!1}function yQ(){return!0}function yX(e){return()=>{}}function y0(){return"function"==typeof fY().useSyncExternalStore?fY().useSyncExternalStore(yX,yJ,yQ):(0,fZ.useContext)(yq)}let y1=!!("u">typeof window&&window.document&&window.document.createElement),y2=new Map;function y4(e){let[t,n]=(0,fZ.useState)(e),r=(0,fZ.useRef)(null),o=yY(t),i=(0,fZ.useRef)(null);if(l&&l.register(i,o),y1){let e=y2.get(o);e&&!e.includes(r)?e.push(r):y2.set(o,[r])}return yz(()=>()=>{l&&l.unregister(i),y2.delete(o)},[o]),(0,fZ.useEffect)(()=>{let e=r.current;return e&&n(e),()=>{e&&(r.current=null)}}),o}function y3(e=[]){let t=y4(),[n,r]=function(e){let[t,n]=(0,fZ.useState)(e),r=(0,fZ.useRef)(t),o=(0,fZ.useRef)(null),i=(0,fZ.useRef)(()=>{if(!o.current)return;let e=o.current.next();if(e.done){o.current=null;return}r.current===e.value?i.current():n(e.value)});return yz(()=>{r.current=t,o.current&&i.current()}),[t,(0,fZ.useCallback)(e=>{o.current=e(r.current),i.current()},[i])]}(t),o=(0,fZ.useCallback)(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return yz(o,[t,o,...e]),n}"u">typeof FinalizationRegistry&&(l=new FinalizationRegistry(e=>{y2.delete(e)}));let y6=function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=function e(t){var n,r,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var i=t.length;for(n=0;n<i;n++)t[n]&&(r=e(t[n]))&&(o&&(o+=" "),o+=r)}else for(r in t)t[r]&&(o&&(o+=" "),o+=r);return o}(e))&&(r&&(r+=" "),r+=t);return r};function y5(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let e in r){let n=t[e],o=r[e];"function"==typeof n&&"function"==typeof o&&"o"===e[0]&&"n"===e[1]&&e.charCodeAt(2)>=65&&90>=e.charCodeAt(2)?t[e]=yK(n,o):("className"===e||"UNSAFE_className"===e)&&"string"==typeof n&&"string"==typeof o?t[e]=y6(n,o):"id"===e&&n&&o?t.id=function(e,t){if(e===t)return e;let n=y2.get(e);if(n)return n.forEach(e=>e.current=t),t;let r=y2.get(t);return r?(r.forEach(t=>t.current=e),e):t}(n,o):"ref"===e&&n&&o?t.ref=yU(n,o):t[e]=void 0!==o?o:n}}return t}let y7=Symbol("default");function y9({values:e,children:t}){for(let[n,r]of e)t=fY().createElement(n.Provider,{value:r},t);return t}function y8(e){let{className:t,style:n,children:r,defaultClassName:o,defaultChildren:i,defaultStyle:a,values:s}=e;return(0,fZ.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:o}):t,l="function"==typeof n?n({...s,defaultStyle:a||{}}):n,u="function"==typeof r?r({...s,defaultChildren:i}):null==r?i:r,{className:null!=e?e:o,style:l||a?{...a,...l}:void 0,children:null!=u?u:i,"data-rac":""}},[t,n,r,o,i,a,s])}function ge(e,t){let n=(0,fZ.useContext)(e);if(null===t)return null;if(n&&"object"==typeof n&&"slots"in n&&n.slots){let e=t||y7;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:"A slot prop is required.";throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function gt(e,t,n){let{ref:r,...o}=ge(n,e.slot)||{},i=yV((0,fZ.useMemo)(()=>yU(t,r),[t,r])),a=y5(o,e);return"style"in o&&o.style&&"style"in e&&e.style&&("function"==typeof o.style||"function"==typeof e.style?a.style=t=>{let n="function"==typeof o.style?o.style(t):o.style,r={...t.defaultStyle,...n},i="function"==typeof e.style?e.style({...t,defaultStyle:r}):e.style;return{...r,...i}}:a.style={...o.style,...e.style}),[a,i]}function gn(e=!0){let[t,n]=(0,fZ.useState)(e),r=(0,fZ.useRef)(!1),o=(0,fZ.useCallback)(e=>{r.current=!0,n(!!e)},[]);return yz(()=>{r.current||n(!1)},[]),[o,t]}function gr(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}let go=(0,fZ.createContext)(null),gi=null;function ga(e,t="assertive",n=7e3){gi?gi.announce(e,t,n):(gi=new gs,("boolean"==typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:"u">typeof jest)?gi.announce(e,t,n):setTimeout(()=>{(null==gi?void 0:gi.isAttached())&&(null==gi||gi.announce(e,t,n))},100))}class gs{isAttached(){var e;return null==(e=this.node)?void 0:e.isConnected}createLog(e){let t=document.createElement("div");return t.setAttribute("role","log"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions"),t}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,t="assertive",n=7e3){var r,o;if(!this.node)return;let i=document.createElement("div");"object"==typeof e?(i.setAttribute("role","img"),i.setAttribute("aria-labelledby",e["aria-labelledby"])):i.textContent=e,"assertive"===t?null==(r=this.assertiveLog)||r.appendChild(i):null==(o=this.politeLog)||o.appendChild(i),""!==e&&setTimeout(()=>{i.remove()},n)}clear(e){this.node&&((!e||"assertive"===e)&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||"polite"===e)&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,"u">typeof document&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}let gl=new Set(["id"]),gu=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),gc=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),gd=new Set(["dir","lang","hidden","inert","translate"]),gf=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),gp=/^(data-.*)$/;function gh(e,t={}){let{labelable:n,isLink:r,global:o,events:i=o,propNames:a}=t,s={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(gl.has(t)||n&&gu.has(t)||r&&gc.has(t)||o&&gd.has(t)||i&&(gf.has(t)||t.endsWith("Capture")&&gf.has(t.slice(0,-7)))||a?.has(t)||gp.test(t))&&(s[t]=e[t]);return s}function gm(e){if(function(){if(null==gy){gy=!1;try{document.createElement("div").focus({get preventScroll(){return gy=!0,!0}})}catch{}}return gy}())e.focus({preventScroll:!0});else{let t=function(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}(e);e.focus(),function(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}let gy=null,gg=e=>e?.ownerDocument??document,gb=e=>e&&"window"in e&&e.window===e?e:gg(e).defaultView||window;function gv(e,t){return!!t&&!!e&&e.contains(t)}function gw(e){return e.target}function g_(e){if(!e)return!1;let t=e.getRootNode(),n=gb(e);if(!(t instanceof n.Document||t instanceof n.ShadowRoot))return!1;let r=t.activeElement;return null!=r&&e.contains(r)}let gx="u">typeof Element&&"checkVisibility"in Element.prototype;function gS(e,t){return gx?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):"#comment"!==e.nodeName&&function(e){let t=gb(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,o="none"!==n&&"hidden"!==r&&"collapse"!==r;if(o){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:r}=t(e);o="none"!==n&&"hidden"!==r&&"collapse"!==r}return o}(e)&&!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))&&(!e.parentElement||gS(e.parentElement,e))}let gE=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],gD=gE.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";gE.push('[tabindex]:not([tabindex="-1"]):not([disabled])');let gO=gE.join(':not([hidden]):not([tabindex="-1"]),');function gk(e,t){return e.matches(gD)&&!gC(e)&&(t?.skipVisibilityCheck||gS(e))}function gP(e){return e.matches(gO)&&gS(e)&&!gC(e)}function gC(e){let t=e;for(;null!=t;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function gj(e){return e.nativeEvent=e,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function gT(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function gR(e){let t=(0,fZ.useRef)({isFocused:!1,observer:null});return yz(()=>{let e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}},[]),(0,fZ.useCallback)(n=>{let r=gw(n);(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement)&&(t.current.isFocused=!0,r.addEventListener("focusout",n=>{if(t.current.isFocused=!1,r.disabled){let t=gj(n);e?.(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&r.disabled){t.current.observer?.disconnect();let e=r===((e=document)=>e.activeElement)()?null:((e=document)=>e.activeElement)();r.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}}),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]}))},[e])}let gA=!1;function gN(e){if("u"<typeof window||null==window.navigator)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function gM(e){return"u">typeof window&&null!=window.navigator&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function gI(e){let t=null;return()=>(null==t&&(t=e()),t)}let g$=gI(function(){return gM(/^Mac/i)}),gL=gI(function(){return gM(/^iPhone/i)}),gF=gI(function(){return gM(/^iPad/i)||g$()&&navigator.maxTouchPoints>1}),gB=gI(function(){return gL()||gF()});gI(function(){return g$()||gB()});let gV=gI(function(){return gN(/AppleWebKit/i)&&!gU()}),gU=gI(function(){return gN(/Chrome/i)}),gW=gI(function(){return gN(/Android/i)}),gK=gI(function(){return gN(/Firefox/i)});function gz(e){return""===e.pointerType&&!!e.isTrusted||(gW()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function gH(e,t,n=!0){let{metaKey:r,ctrlKey:o,altKey:i,shiftKey:a}=t;gK()&&window.event?.type?.startsWith("key")&&"_blank"===e.target&&(g$()?r=!0:o=!0);let s=gV()&&g$()&&!gF()&&1?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:r,ctrlKey:o,altKey:i,shiftKey:a}):new MouseEvent("click",{metaKey:r,ctrlKey:o,altKey:i,shiftKey:a,detail:1,bubbles:!0,cancelable:!0});gH.isOpening=n,gm(e),e.dispatchEvent(s),gH.isOpening=!1}gH.isOpening=!1;let gG=null,gq=new Set,gZ=new Map,gY=!1,gJ=!1,gQ={Tab:!0,Escape:!0};function gX(e,t){for(let n of gq)n(e,t)}function g0(e){gY=!0,gH.isOpening||e.metaKey||!g$()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key||(gG="keyboard",gX("keyboard",e))}function g1(e){gG="pointer","pointerType"in e&&e.pointerType,("mousedown"===e.type||"pointerdown"===e.type)&&(gY=!0,gX("pointer",e))}function g2(e){!gH.isOpening&&gz(e)&&(gY=!0,gG="virtual")}function g4(e){let t=gb(gw(e)),n=gg(gw(e));gw(e)!==t&&gw(e)!==n&&!gA&&e.isTrusted&&(gY||gJ||(gG="virtual",gX("virtual",e)),gY=!1,gJ=!1)}function g3(){gA||(gY=!1,gJ=!0)}function g6(e){if("u"<typeof window||"u"<typeof document)return;let t=gb(e),n=gg(e);if(gZ.get(t))return;let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){gY=!0,r.apply(this,arguments)},n.addEventListener("keydown",g0,!0),n.addEventListener("keyup",g0,!0),n.addEventListener("click",g2,!0),t.addEventListener("focus",g4,!0),t.addEventListener("blur",g3,!1),"u">typeof PointerEvent&&(n.addEventListener("pointerdown",g1,!0),n.addEventListener("pointermove",g1,!0),n.addEventListener("pointerup",g1,!0)),t.addEventListener("beforeunload",()=>{g5(e)},{once:!0}),gZ.set(t,{focus:r})}let g5=(e,t)=>{let n=gb(e),r=gg(e);t&&r.removeEventListener("DOMContentLoaded",t),gZ.has(n)&&(n.HTMLElement.prototype.focus=gZ.get(n).focus,r.removeEventListener("keydown",g0,!0),r.removeEventListener("keyup",g0,!0),r.removeEventListener("click",g2,!0),n.removeEventListener("focus",g4,!0),n.removeEventListener("blur",g3,!1),"u">typeof PointerEvent&&(r.removeEventListener("pointerdown",g1,!0),r.removeEventListener("pointermove",g1,!0),r.removeEventListener("pointerup",g1,!0)),gZ.delete(n))};function g7(){return"pointer"!==gG}"u">typeof document&&("loading"!==(p=gg(void 0)).readyState?g6(void 0):p.addEventListener("DOMContentLoaded",()=>{g6(void 0)}));let g9=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),g8=new Map,be=new Set;function bt(){if("u"<typeof window)return;function e(e){return"propertyName"in e}let t=n=>{let r=gw(n);if(!e(n)||!r)return;let o=g8.get(r);if(o&&(o.delete(n.propertyName),0===o.size&&(r.removeEventListener("transitioncancel",t),g8.delete(r)),0===g8.size)){for(let e of be)e();be.clear()}};document.body.addEventListener("transitionrun",n=>{let r=gw(n);if(!e(n)||!r)return;let o=g8.get(r);o||(o=new Set,g8.set(r,o),r.addEventListener("transitioncancel",t,{once:!0})),o.add(n.propertyName)}),document.body.addEventListener("transitionend",t)}function bn(e){requestAnimationFrame(()=>{for(let[e]of g8)"isConnected"in e&&!e.isConnected&&g8.delete(e);0===g8.size?e():be.add(e)})}function br(e){if(!e.isConnected)return;let t=gg(e);if("virtual"===gG){let n=((e=document)=>e.activeElement)(t);bn(()=>{let r=((e=document)=>e.activeElement)(t);(r===n||r===t.body)&&e.isConnected&&gm(e)})}else gm(e)}function bo(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e,i=(0,fZ.useCallback)(e=>{if(gw(e)===e.currentTarget)return r&&r(e),o&&o(!1),!0},[r,o]),a=gR(i),s=(0,fZ.useCallback)(e=>{let t=gw(e),r=gg(t),i=r?((e=document)=>e.activeElement)(r):((e=document)=>e.activeElement)();t===e.currentTarget&&t===i&&(n&&n(e),o&&o(!0),a(e))},[o,n,a]);return{focusProps:{onFocus:!t&&(n||o||r)?s:void 0,onBlur:!t&&(r||o)?i:void 0}}}function bi(e){if(!e)return;let t=!0;return n=>{e({...n,preventDefault(){n.preventDefault()},isDefaultPrevented:()=>n.isDefaultPrevented(),stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped:()=>t}),t&&n.stopPropagation()}}function ba(e,t){yz(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}"u">typeof document&&("loading"!==document.readyState?bt():document.addEventListener("DOMContentLoaded",bt));let bs=fY().createContext(null);function bl(e,t){let{focusProps:n}=bo(e),{keyboardProps:r}={keyboardProps:e.isDisabled?{}:{onKeyDown:bi(e.onKeyDown),onKeyUp:bi(e.onKeyUp)}},o=y5(n,r),i=function(e){let t=(0,fZ.useContext)(bs)||{};ba(t,e);let{ref:n,...r}=t;return r}(t),a=e.isDisabled?{}:i,s=(0,fZ.useRef)(e.autoFocus);(0,fZ.useEffect)(()=>{s.current&&t.current&&br(t.current),s.current=!1},[t]);let l=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(l=void 0),{focusableProps:y5({...o,tabIndex:l},a)}}fY().forwardRef(function(e,t){let{children:n,...r}=e,o=yV(t),i={...r,ref:o};return fY().createElement(bs.Provider,{value:i},n)});let bu="default",bc="",bd=new WeakMap;function bf(e){if(gB())"disabled"===bu&&(bu="restoring",setTimeout(()=>{bn(()=>{if("restoring"===bu){let t=gg(e);"none"===t.documentElement.style.webkitUserSelect&&(t.documentElement.style.webkitUserSelect=bc||""),bc="",bu="default"}})},300));else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&bd.has(e)){let t=bd.get(e),n="userSelect"in e.style?"userSelect":"webkitUserSelect";"none"===e.style[n]&&(e.style[n]=t),""===e.getAttribute("style")&&e.removeAttribute("style"),bd.delete(e)}}function bp(e){let t=e?.defaultView;return t?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let bh=new WeakMap;function bm(e){let t=e??("u">typeof document?document:void 0);if(!t)return bp(t);if(bh.has(t))return bh.get(t);let n=t.querySelector('meta[property="csp-nonce"]'),r=n&&n instanceof gb(n).HTMLMetaElement&&(n.nonce||n.content)||bp(t)||void 0;return void 0!==r&&bh.set(t,r),r}let by=fY().createContext({register:()=>{}});by.displayName="PressResponderContext";let bg=fY().useInsertionEffect??yz;function bb(e){let t=(0,fZ.useRef)(null);return bg(()=>{t.current=e},[e]),(0,fZ.useCallback)((...e)=>{let n=t.current;return n?.(...e)},[])}function bv(){let e=(0,fZ.useRef)(new Map),t=(0,fZ.useCallback)((t,n,r,o)=>{let i=o?.once?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:i,options:o}),t.addEventListener(n,i,o)},[]),n=(0,fZ.useCallback)((t,n,r,o)=>{let i=e.current.get(r)?.fn||r;t.removeEventListener(n,i,o),e.current.delete(r)},[]),r=(0,fZ.useCallback)(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return(0,fZ.useEffect)(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}var bw=n(43144);class b_{#e;constructor(e,t,n,r){this.#e=!0;let o=r?.target??n.currentTarget;const i=o?.getBoundingClientRect();let a,s=0,l,u=null;null!=n.clientX&&null!=n.clientY&&(l=n.clientX,u=n.clientY),i&&(null!=l&&null!=u?(a=l-i.left,s=u-i.top):(a=i.width/2,s=i.height/2)),this.type=e,this.pointerType=t,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=a,this.y=s,this.key=n.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}}let bx=Symbol("linkClicked"),bS="react-aria-pressable-style",bE="data-react-aria-pressable";function bD(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:o,onPressUp:i,onClick:a,isDisabled:s,isPressed:l,preventFocusOnPress:u,shouldCancelOnPointerExit:c,allowTextSelectionOnPress:d,ref:f,...p}=function(e){let t=(0,fZ.useContext)(by);if(t){let{register:n,ref:r,...o}=t;e=y5(o,e),n()}return ba(t,e.ref),e}(e),[h,m]=(0,fZ.useState)(!1),y=(0,fZ.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:g,removeAllGlobalListeners:b}=bv(),v=(0,fZ.useCallback)((e,t)=>{let o=y.current;if(s||o.didFirePressStart)return!1;let i=!0;if(o.isTriggeringEvent=!0,r){let n=new b_("pressstart",t,e);r(n),i=n.shouldStopPropagation}return n&&n(!0),o.isTriggeringEvent=!1,o.didFirePressStart=!0,m(!0),i},[s,r,n]),w=(0,fZ.useCallback)((e,r,i=!0)=>{let a=y.current;if(!a.didFirePressStart)return!1;a.didFirePressStart=!1,a.isTriggeringEvent=!0;let l=!0;if(o){let t=new b_("pressend",r,e);o(t),l=t.shouldStopPropagation}if(n&&n(!1),m(!1),t&&i&&!s){let n=new b_("press",r,e);t(n),l&&=n.shouldStopPropagation}return a.isTriggeringEvent=!1,l},[s,o,n,t]),x=bb(w),S=bb((0,fZ.useCallback)((e,t)=>{let n=y.current;if(s)return!1;if(i){n.isTriggeringEvent=!0;let r=new b_("pressup",t,e);return i(r),n.isTriggeringEvent=!1,r.shouldStopPropagation}return!0},[s,i])),E=(0,fZ.useCallback)(e=>{let t=y.current;if(t.isPressed&&t.target){for(let n of(t.didFirePressStart&&null!=t.pointerType&&w(bP(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,b(),d||bf(t.target),t.disposables))n();t.disposables=[]}},[d,b,w]),D=bb(E),O=(0,fZ.useCallback)(e=>{c&&E(e)},[c,E]),k=(0,fZ.useCallback)(e=>{s||a?.(e)},[s,a]),P=(0,fZ.useCallback)((e,t)=>{if(!s&&a){let n=new MouseEvent("click",e);gT(n,t),a(gj(n))}},[s,a]),C=(0,fZ.useMemo)(()=>{let e=y.current,t={onKeyDown(t){if(bk(t.nativeEvent,t.currentTarget)&&gv(t.currentTarget,gw(t))){bC(gw(t),t.key)&&t.preventDefault();let r=!0;e.isPressed||t.repeat||(e.target=t.currentTarget,e.isPressed=!0,e.pointerType="keyboard",r=v(t,"keyboard"));let o=t.currentTarget;g(gg(t.currentTarget),"keyup",yK(t=>{bk(t,o)&&!t.repeat&&gv(o,gw(t))&&e.target&&S(bP(e.target,t),"keyboard")},n),!0),r&&t.stopPropagation(),t.metaKey&&g$()&&e.metaKeyEvents?.set(t.key,t.nativeEvent)}else"Meta"===t.key&&(e.metaKeyEvents=new Map)},onClick(t){if((!t||gv(t.currentTarget,gw(t)))&&t&&0===t.button&&!e.isTriggeringEvent&&!gH.isOpening){let n=!0;if(s&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&("virtual"===e.pointerType||gz(t.nativeEvent))){let e=v(t,"virtual"),r=S(t,"virtual"),o=x(t,"virtual");k(t),n=e&&r&&o}else if(e.isPressed&&"keyboard"!==e.pointerType){let r=e.pointerType||t.nativeEvent.pointerType||"virtual",o=S(bP(t.currentTarget,t),r),i=x(bP(t.currentTarget,t),r,!0);n=o&&i,e.isOverTarget=!1,k(t),D(t)}e.ignoreEmulatedMouseEvents=!1,n&&t.stopPropagation()}}},n=t=>{if(e.isPressed&&e.target&&bk(t,e.target)){bC(gw(t),t.key)&&t.preventDefault();let n=gw(t),r=gv(e.target,n);x(bP(e.target,t),"keyboard",r),r&&P(t,e.target),b(),"Enter"!==t.key&&bO(e.target)&&gv(e.target,n)&&!t[bx]&&(t[bx]=!0,gH(e.target,t,!1)),e.isPressed=!1,e.metaKeyEvents?.delete(t.key)}else if("Meta"===t.key&&e.metaKeyEvents?.size){let t=e.metaKeyEvents;for(let n of(e.metaKeyEvents=void 0,t.values()))e.target?.dispatchEvent(new KeyboardEvent("keyup",n))}};if("u">typeof PointerEvent){t.onPointerDown=t=>{var o;if(0!==t.button||!gv(t.currentTarget,gw(t)))return;if(o=t.nativeEvent,!gW()&&0===o.width&&0===o.height||1===o.width&&1===o.height&&0===o.pressure&&0===o.detail&&"mouse"===o.pointerType){e.pointerType="virtual";return}e.pointerType=t.pointerType;let i=!0;if(!e.isPressed){e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=t.pointerId,e.target=t.currentTarget,d||function(e){if(gB()){if("default"===bu){let t=gg(e);bc=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}bu="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";bd.set(e,e.style[t]),e.style[t]="none"}}(e.target),i=v(t,e.pointerType);let o=gw(t);"releasePointerCapture"in o&&("hasPointerCapture"in o?o.hasPointerCapture(t.pointerId)&&o.releasePointerCapture(t.pointerId):o.releasePointerCapture(t.pointerId)),g(gg(t.currentTarget),"pointerup",n,!1),g(gg(t.currentTarget),"pointercancel",r,!1)}i&&t.stopPropagation()},t.onMouseDown=t=>{if(gv(t.currentTarget,gw(t))&&0===t.button){if(u){let n=function(e){for(;e&&!gk(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=gb(e),n=t.document.activeElement;if(!n||n===e)return;gA=!0;let r=!1,o=e=>{(gw(e)===n||r)&&e.stopImmediatePropagation()},i=t=>{(gw(t)===n||r)&&(t.stopImmediatePropagation(),e||r||(r=!0,gm(n),l()))},a=t=>{(gw(t)===e||r)&&t.stopImmediatePropagation()},s=t=>{(gw(t)===e||r)&&(t.stopImmediatePropagation(),r||(r=!0,gm(n),l()))};t.addEventListener("blur",o,!0),t.addEventListener("focusout",i,!0),t.addEventListener("focusin",s,!0),t.addEventListener("focus",a,!0);let l=()=>{cancelAnimationFrame(u),t.removeEventListener("blur",o,!0),t.removeEventListener("focusout",i,!0),t.removeEventListener("focusin",s,!0),t.removeEventListener("focus",a,!0),gA=!1,r=!1},u=requestAnimationFrame(l);return l}(t.target);n&&e.disposables.push(n)}t.stopPropagation()}},t.onPointerUp=t=>{gv(t.currentTarget,gw(t))&&"virtual"!==e.pointerType&&(0!==t.button||e.isPressed||S(t,e.pointerType||t.pointerType))},t.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!0,v(bP(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!1,x(bP(e.target,t),e.pointerType,!1),O(t))};let n=t=>{if(t.pointerId===e.activePointerId&&e.isPressed&&0===t.button&&e.target){if(gv(e.target,gw(t))&&null!=e.pointerType){let n=!1,r=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(n?D(t):(gm(e.target),e.target.click()))},80);g(t.currentTarget,"click",()=>n=!0,!0),e.disposables.push(()=>clearTimeout(r))}else D(t);e.isOverTarget=!1}},r=e=>{D(e)};t.onDragStart=e=>{gv(e.currentTarget,gw(e))&&D(e)}}return t},[g,s,u,b,d,O,v,k,P]);return(0,fZ.useEffect)(()=>{if(!f)return;let e=gg(f.current);if(!e||!e.head||e.getElementById(bS))return;let t=e.createElement("style");t.id=bS;let n=bm(e);n&&(t.nonce=n),t.textContent=`
32
+ To fix this, ensure that you define the "component" field inside the page definition.`,e)}(r,t)}}let hK={PHONE_MIN:0,PHONE_MAX:600,TABLET_MIN:601,TABLET_MAX:1023,SMALL_DESKTOP_MIN:1024,SMALL_DESKTOP_MAX:1439,LARGE_DESKTOP_MIN:1440,LARGE_DESKTOP_MAX:Number.MAX_SAFE_INTEGER};function hz(){document.body.classList.toggle("omrs-breakpoint-lt-tablet",window.innerWidth<hK.TABLET_MIN),document.body.classList.toggle("omrs-breakpoint-gt-phone",window.innerWidth>hK.PHONE_MAX),document.body.classList.toggle("omrs-breakpoint-gt-tablet",window.innerWidth>hK.TABLET_MAX),document.body.classList.toggle("omrs-breakpoint-lt-desktop",window.innerWidth<hK.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-small-desktop",window.innerWidth<hK.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-large-desktop",window.innerWidth<hK.LARGE_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-gt-small-desktop",window.innerWidth>hK.SMALL_DESKTOP_MAX)}let hH=!1;function hG(){hH||(window.addEventListener("resize",hz),hz(),hH=!0)}var hq=n(31085),hZ=n(53373),hY=n.n(hZ);function hJ({title:e,children:t}){let n="tablet"===hd();return(0,hq.jsxs)("div",{className:hY()({"-esm-form-engine__card-header-module__tabletHeader___xhRSy":n,"-esm-form-engine__card-header-module__desktopHeader___aPTXc":!n}),children:[(0,hq.jsx)("h4",{children:e}),t]})}let hQ=["red","magenta","purple","blue","teal","cyan","gray","green","warm-gray","cool-gray","high-contrast","outline"],hX={primaryColor:{_type:tG.String,_description:"The color for displaying primary diagnoses tags",_default:"red",_validators:[nX.oneOf(hQ)]},secondaryColor:{_type:tG.String,_description:"The color for displaying secondary diagnoses tags",_default:"blue",_validators:[nX.oneOf(hQ)]}},h0={"Brand color #1":{_default:"#005d5d",_type:tG.String},"Brand color #2":{_default:"#004144",_type:tG.String},"Brand color #3":{_default:"#007d79",_type:tG.String},excludePatientIdentifierCodeTypes:{uuids:{_type:tG.Array,_description:"List of UUIDs of patient identifier types to exclude from rendering in the patient banner",_default:[],_elements:{_type:tG.UUID}}},implementationName:{_type:tG.String,_description:"A name of the place (or authority) where all possible locations a user can choose are located.",_default:"Clinic"},patientPhotoConceptUuid:{_type:tG.ConceptUuid,_default:"736e8771-e501-4615-bfa7-570c03f4bef5",_description:"Used to look up the patient photo, which is stored as an attachment obs. Set to `null` in order to disable the feature and use only generated avatars. To remove the avatars entirely, use extension configuration's `remove` feature."},preferredCalendar:{_type:tG.Object,_description:"Keys should be locale codes, and values should be the preferred calendar for that locale. For example, {'am': 'ethiopic'}.",_default:{am:"ethiopic"},_elements:{_validators:[nX.oneOf(["buddhist","chinese","coptic","dangi","ethioaa","ethiopic","gregory","hebrew","indian","islamic","islamic-umalqura","islamic-tbla","islamic-civil","islamic-rgsa","iso8601","japanese","persian","roc","islamicc"])]}},preferredDateLocale:{_type:tG.Object,_description:"Allows setting the locale used for date formatting for any browser locale. Does not affect time formatting. Keys should be locale codes, and values should be the preferred locale for formatting dates. For example, {'en': 'en-US', 'fr-CA': 'en-CA'}.",_default:{en:"en-GB"},_elements:{_type:tG.String}},diagnosisTags:hX};var h1=n(52697);let h2={"carbon.table.batch.cancel":"cancel","carbon.table.batch.items.selected":"batchActionsItemsSelected","carbon.table.batch.item.selected":"batchActionItemSelected","carbon.table.batch.selectAll":"selectAll"},h4=e=>(0,hq.jsx)(h1.GGC,{translateWithId:(e,t)=>{let n=h2[e];return n?iV(n,e,t):e},...e}),h3="-esm-form-engine__custom-overflow-menu-module__container___QIBvW",h6="-esm-form-engine__custom-overflow-menu-module__menu___ZppPo",h5="-esm-form-engine__custom-overflow-menu-module__show___8rVUu",h7="-esm-form-engine__custom-overflow-menu-module__overflowMenuButton___0VKUu",h9=(0,fZ.createContext)(null);function h8(){let e=(0,fZ.useContext)(h9);if(!e)throw Error("useCustomOverflowMenu must be used within a CustomOverflowMenu");return e}function me({menuTitle:e,children:t}){let[n,r]=fY().useState(!1),o=hy(()=>r(!1),n),i="tablet"===hd(),a=(0,fZ.useCallback)(()=>r(e=>!e),[]),s=(0,fZ.useRef)(null),l=(0,fZ.useRef)(null),u=(0,fZ.useId)(),c=`custom-overflow-menu-trigger-${u}`,d=`custom-overflow-menu-${u}`,f=(0,fZ.useCallback)(()=>{r(!1),s.current?.focus()},[]),p=(0,fZ.useMemo)(()=>({closeMenu:f}),[f]),h=(0,fZ.useCallback)(e=>{"Escape"===e.key&&n&&(e.stopPropagation(),f())},[f,n]),m=fZ.Children.toArray(t);(0,fZ.useEffect)(()=>{if(n&&l.current){let e=l.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[n]);let y=(0,fZ.useCallback)(({currentIndex:e,direction:t})=>{let n=l.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!n?.length)return;let r=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,o=Array.from(n).indexOf(r);if(-1===o)return void n[t>0?0:n.length-1]?.focus();let i=o+t,a=i<0?n.length-1:i>=n.length?0:i;n[a]?.focus()},[]),g=m.map((e,t)=>(0,fZ.isValidElement)(e)?(0,fZ.cloneElement)(e,{closeMenu:f,handleOverflowMenuItemFocus:y,index:t}):e);return(0,hq.jsxs)("div",{"data-overflow-menu":!0,className:hY()("cds--overflow-menu",h3),ref:o,children:[(0,hq.jsx)("button",{className:hY()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":n},h7),"aria-controls":d,"aria-expanded":n,"aria-haspopup":"true",id:c,onClick:a,onKeyDown:h,ref:s,children:e}),(0,hq.jsxs)("div",{className:hY()("cds--overflow-menu-options","cds--overflow-menu--flip",h6,{[h5]:n}),"aria-labelledby":c,"data-floating-menu-direction":"bottom",id:d,onKeyDown:h,ref:l,role:"menu",tabIndex:-1,children:[(0,hq.jsx)("ul",{className:hY()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":i}),children:(0,hq.jsx)(h9.Provider,{value:p,children:g})}),(0,hq.jsx)("span",{})]})]})}function mt(e){let t=(0,fZ.useContext)(h9);return(0,hq.jsx)(h1.XSD,{...e,closeMenu:t?.closeMenu})}var mn=n(95571);let mr=["omrs-icon-activity","omrs-icon-add","omrs-icon-arrow-down","omrs-icon-arrow-left","omrs-icon-arrow-right","omrs-icon-arrow-up","omrs-icon-baby","omrs-icon-calendar-heat-map","omrs-icon-calendar","omrs-icon-caret-down","omrs-icon-caret-left","omrs-icon-caret-right","omrs-icon-caret-up","omrs-icon-chart-average","omrs-icon-chart-line","omrs-icon-checkmark-filled","omrs-icon-checkmark-outline","omrs-icon-chemistry","omrs-icon-chevron-down","omrs-icon-chevron-left","omrs-icon-chevron-right","omrs-icon-chevron-up","omrs-icon-close","omrs-icon-close-filled","omrs-icon-close-outline","omrs-icon-document","omrs-icon-document-attachment","omrs-icon-download","omrs-icon-drug-order","omrs-icon-edit","omrs-icon-event-schedule","omrs-icon-events","omrs-icon-gender-female","omrs-icon-gender-male","omrs-icon-gender-other","omrs-icon-gender-unknown","omrs-icon-generic-order-type","omrs-icon-group","omrs-icon-group-access","omrs-icon-hospital-bed","omrs-icon-image-medical","omrs-icon-information","omrs-icon-information-filled","omrs-icon-information-square","omrs-icon-inventory-management","omrs-icon-lab-order","omrs-icon-list-checked","omrs-icon-location","omrs-icon-material-order","omrs-icon-maximize","omrs-icon-medication","omrs-icon-message-queue","omrs-icon-microscope","omrs-icon-mobile-check","omrs-icon-money","omrs-icon-mother","omrs-icon-movement","omrs-icon-overflow-menu--horizontal","omrs-icon-overflow-menu--vertical","omrs-icon-password","omrs-icon-pedestrian-family","omrs-icon-pen","omrs-icon-printer","omrs-icon-procedure-order","omrs-icon-programs","omrs-icon-renew","omrs-icon-referral-order","omrs-icon-report","omrs-icon-reset","omrs-icon-save","omrs-icon-search","omrs-icon-settings","omrs-icon-shopping-cart","omrs-icon-shopping-cart--arrow-down","omrs-icon-sticky-note-add","omrs-icon-switcher","omrs-icon-syringe","omrs-icon-table-of-contents","omrs-icon-table","omrs-icon-time","omrs-icon-tools","omrs-icon-translate","omrs-icon-trash-can","omrs-icon-tree-view--alt","omrs-icon-two-factor-authentication","omrs-icon-user-avatar","omrs-icon-user-follow","omrs-icon-user-xray","omrs-icon-user","omrs-icon-view-off","omrs-icon-view","omrs-icon-warning"],mo=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-activity",iconProps:e})})),mi=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-add",iconProps:e})})),ma=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-arrow-down",iconProps:e})})),ms=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-arrow-left",iconProps:e})})),ml=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-arrow-right",iconProps:e})})),mu=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-arrow-up",iconProps:e})})),mc=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-baby",iconProps:e})})),md=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-calendar-heat-map",iconProps:e})})),mf=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-calendar",iconProps:e})})),mp=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-caret-down",iconProps:e})})),mh=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-caret-left",iconProps:e})})),mm=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-caret-right",iconProps:e})})),my=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-caret-up",iconProps:e})})),mg=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-chart-average",iconProps:e})})),mb=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-chart-line",iconProps:e})})),mv=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-checkmark-filled",iconProps:e})})),mw=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-checkmark-outline",iconProps:e})})),m_=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-chemistry",iconProps:e})})),mx=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-chevron-down",iconProps:e})})),mS=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-chevron-left",iconProps:e})})),mE=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-chevron-right",iconProps:e})})),mD=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-chevron-up",iconProps:e})})),mO=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-close",iconProps:e})})),mP=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-close-filled",iconProps:e})})),mk=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-close-outline",iconProps:e})})),mC=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-document",iconProps:e})})),mj=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-document-attachment",iconProps:e})})),mT=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-download",iconProps:e})})),mR=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-drug-order",iconProps:e})})),mA=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-edit",iconProps:e})})),mM=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-event-schedule",iconProps:e})})),mN=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-events",iconProps:e})})),mI=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-gender-female",iconProps:e})})),m$=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-gender-male",iconProps:e})})),mL=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-gender-other",iconProps:e})})),mF=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-gender-unknown",iconProps:e})})),mB=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-generic-order-type",iconProps:e})})),mV=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-group",iconProps:e})})),mU=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-group-access",iconProps:e})})),mW=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-hospital-bed",iconProps:e})})),mK=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-image-medical",iconProps:e})})),mz=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-information",iconProps:e})})),mH=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-information-filled",iconProps:e})})),mG=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-information-square",iconProps:e})})),mq=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-inventory-management",iconProps:e})})),mZ=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-lab-order",iconProps:e})})),mY=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-list-checked",iconProps:e})})),mJ=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-location",iconProps:e})})),mQ=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-material-order",iconProps:e})})),mX=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-maximize",iconProps:e})})),m0=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-medication",iconProps:e})})),m1=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-message-queue",iconProps:e})})),m2=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-microscope",iconProps:e})})),m4=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-mobile-check",iconProps:e})})),m3=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-money",iconProps:e})})),m6=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-mother",iconProps:e})})),m5=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-movement",iconProps:e})})),m7=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),m9=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),m8=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-password",iconProps:e})})),ye=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-pedestrian-family",iconProps:e})})),yt=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-pen",iconProps:e})})),yn=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-printer",iconProps:e})})),yr=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-procedure-order",iconProps:e})})),yo=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-programs",iconProps:e})})),yi=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-referral-order",iconProps:e})})),ya=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-renew",iconProps:e})})),ys=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-report",iconProps:e})})),yl=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-reset",iconProps:e})})),yu=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-save",iconProps:e})})),yc=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-search",iconProps:e})})),yd=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-settings",iconProps:e})})),yf=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-switcher",iconProps:e})})),yp=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-shopping-cart",iconProps:e})})),yh=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-shopping-cart--arrow-down",iconProps:e})})),ym=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-sticky-note-add",iconProps:e})})),yy=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-syringe",iconProps:e})})),yg=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-table-of-contents",iconProps:e})})),yb=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-table",iconProps:e})})),yv=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-time",iconProps:e})})),yw=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-tools",iconProps:e})})),y_=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-translate",iconProps:e})})),yx=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-trash-can",iconProps:e})})),yS=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-tree-view--alt",iconProps:e})})),yE=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-two-factor-authentication",iconProps:e})})),yD=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-user-avatar",iconProps:e})})),yO=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-user-follow",iconProps:e})})),yP=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-user-xray",iconProps:e})})),yk=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-user",iconProps:e})})),yC=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-view-off",iconProps:e})})),yj=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-view",iconProps:e})})),yT=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(yL,{ref:t,icon:"omrs-icon-warning",iconProps:e})})),yR=yT,yA=mj,yM=mY,yN=mK,yI=yh,y$=(0,fZ.memo)((0,fZ.forwardRef)(function({icon:e,fallback:t,...n},r){let o=(0,fZ.useRef)(e?document.getElementById(e):void 0);return(0,fZ.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),n=new MutationObserver(t=>{for(let n of t)"childList"===n.type&&(o.current=e?document.getElementById(e):void 0)});return t&&n.observe(t,{childList:!0}),()=>n.disconnect()},[e]),(0,hq.jsx)(pL,{value:o.current,fallback:t,children:(0,hq.jsx)(yL,{ref:r,icon:e,iconProps:n})})})),yL=(0,fZ.memo)((0,fZ.forwardRef)(function({icon:e,iconProps:t},n){let{className:r,fill:o,size:i}=Object.assign({},{fill:"currentColor",size:20},t);(i<=0||i>72)&&(console.error(`Invalid size '${i}' specified for ${e}. Defaulting to 20.`),i=20);let a=(0,fZ.useRef)(null);return(0,fZ.useImperativeHandle)(n,()=>a.current),(0,fZ.useEffect)(()=>{a.current&&"currentColor"!==o&&a.current.style.setProperty("--omrs-icon-fill",o)},[]),(0,hq.jsx)("svg",{ref:a,className:hY()("omrs-icon","-esm-form-engine__icons-module__icon___uq4qr",r),height:i,width:i,viewBox:"0 0 16 16",children:(0,hq.jsx)("use",{href:`#${e}`})})})),yF=({path:e,title:t,basePath:n,icon:r})=>{let{t:o}=(0,pb.useTranslation)(),i=(0,mn.useLocation)(),a=(0,fZ.useMemo)(()=>{if(!e)return!1;let t=e.startsWith("/")?e.slice(1):e;if(t.startsWith("http"))return t===window.location.href;let n=t.split("/").map(e=>decodeURIComponent(e)),r=(i.pathname??"").split("/").slice(1).map(e=>decodeURIComponent(e));return r.some((e,t)=>n.every((e,n)=>r[t+n]===e))},[i.pathname,e]);return(0,hq.jsx)("div",{children:(0,hq.jsx)(fQ,{className:hY()("cds--side-nav__link",{"active-left-nav-link":a}),to:`${n}/${encodeURIComponent(e)}`,children:(0,hq.jsxs)("span",{className:"-esm-form-engine__dashboard-module__menu___WbY42",children:[(0,hq.jsx)(y$,{icon:r,className:"-esm-form-engine__dashboard-module__icon___L-hKL",size:16}),(0,hq.jsx)("span",{children:o(t)})]})})},e)};function yB(e){return function({basePath:t}){return(0,hq.jsx)(mn.BrowserRouter,{children:(0,hq.jsx)(yF,{basePath:t,...e})})}}function yV(e){let t=(0,fZ.useRef)(null),n=(0,fZ.useRef)(void 0),r=(0,fZ.useCallback)(t=>{if("function"==typeof e){let n=e(t);return()=>{"function"==typeof n?n():e(null)}}if(e)return e.current=t,()=>{e.current=null}},[e]);return(0,fZ.useMemo)(()=>({get current(){return t.current},set current(value){t.current=value,n.current&&(n.current(),n.current=void 0),null!=value&&(n.current=r(value))}}),[r])}function yU(...e){return 1===e.length&&e[0]?e[0]:t=>{let n=!1,r=e.map(e=>{let r=yW(e,t);return n||="function"==typeof r,r});if(n)return()=>{r.forEach((t,n)=>{"function"==typeof t?t():yW(e[n],null)})}}}function yW(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function yK(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}let yz="u">typeof document?fY().useLayoutEffect:()=>{},yH={prefix:String(Math.round(1e10*Math.random())),current:0},yG=fY().createContext(yH),yq=fY().createContext(!1),yZ=("u">typeof window&&window.document&&window.document.createElement,new WeakMap),yY="function"==typeof fY().useId?function(e){let t=fY().useId(),[n]=(0,fZ.useState)(y0()),r=n?"react-aria":`react-aria${yH.prefix}`;return e||`${r}-${t}`}:function(e){let t=(0,fZ.useContext)(yG),n=function(e=!1){let t=(0,fZ.useContext)(yG),n=(0,fZ.useRef)(null);if(null===n.current&&!e){let e=fY().__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(e){let n=yZ.get(e);null==n?yZ.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==n.state&&(t.current=n.id,yZ.delete(e))}n.current=++t.current}return n.current}(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`};function yJ(){return!1}function yQ(){return!0}function yX(e){return()=>{}}function y0(){return"function"==typeof fY().useSyncExternalStore?fY().useSyncExternalStore(yX,yJ,yQ):(0,fZ.useContext)(yq)}let y1=!!("u">typeof window&&window.document&&window.document.createElement),y2=new Map;function y4(e){let[t,n]=(0,fZ.useState)(e),r=(0,fZ.useRef)(null),o=yY(t),i=(0,fZ.useRef)(null);if(l&&l.register(i,o),y1){let e=y2.get(o);e&&!e.includes(r)?e.push(r):y2.set(o,[r])}return yz(()=>()=>{l&&l.unregister(i),y2.delete(o)},[o]),(0,fZ.useEffect)(()=>{let e=r.current;return e&&n(e),()=>{e&&(r.current=null)}}),o}function y3(e=[]){let t=y4(),[n,r]=function(e){let[t,n]=(0,fZ.useState)(e),r=(0,fZ.useRef)(t),o=(0,fZ.useRef)(null),i=(0,fZ.useRef)(()=>{if(!o.current)return;let e=o.current.next();if(e.done){o.current=null;return}r.current===e.value?i.current():n(e.value)});return yz(()=>{r.current=t,o.current&&i.current()}),[t,(0,fZ.useCallback)(e=>{o.current=e(r.current),i.current()},[i])]}(t),o=(0,fZ.useCallback)(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return yz(o,[t,o,...e]),n}"u">typeof FinalizationRegistry&&(l=new FinalizationRegistry(e=>{y2.delete(e)}));let y6=function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=function e(t){var n,r,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var i=t.length;for(n=0;n<i;n++)t[n]&&(r=e(t[n]))&&(o&&(o+=" "),o+=r)}else for(r in t)t[r]&&(o&&(o+=" "),o+=r);return o}(e))&&(r&&(r+=" "),r+=t);return r};function y5(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let e in r){let n=t[e],o=r[e];"function"==typeof n&&"function"==typeof o&&"o"===e[0]&&"n"===e[1]&&e.charCodeAt(2)>=65&&90>=e.charCodeAt(2)?t[e]=yK(n,o):("className"===e||"UNSAFE_className"===e)&&"string"==typeof n&&"string"==typeof o?t[e]=y6(n,o):"id"===e&&n&&o?t.id=function(e,t){if(e===t)return e;let n=y2.get(e);if(n)return n.forEach(e=>e.current=t),t;let r=y2.get(t);return r?(r.forEach(t=>t.current=e),e):t}(n,o):"ref"===e&&n&&o?t.ref=yU(n,o):t[e]=void 0!==o?o:n}}return t}let y7=Symbol("default");function y9({values:e,children:t}){for(let[n,r]of e)t=fY().createElement(n.Provider,{value:r},t);return t}function y8(e){let{className:t,style:n,children:r,defaultClassName:o,defaultChildren:i,defaultStyle:a,values:s}=e;return(0,fZ.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:o}):t,l="function"==typeof n?n({...s,defaultStyle:a||{}}):n,u="function"==typeof r?r({...s,defaultChildren:i}):null==r?i:r,{className:null!=e?e:o,style:l||a?{...a,...l}:void 0,children:null!=u?u:i,"data-rac":""}},[t,n,r,o,i,a,s])}function ge(e,t){let n=(0,fZ.useContext)(e);if(null===t)return null;if(n&&"object"==typeof n&&"slots"in n&&n.slots){let e=t||y7;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:"A slot prop is required.";throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function gt(e,t,n){let{ref:r,...o}=ge(n,e.slot)||{},i=yV((0,fZ.useMemo)(()=>yU(t,r),[t,r])),a=y5(o,e);return"style"in o&&o.style&&"style"in e&&e.style&&("function"==typeof o.style||"function"==typeof e.style?a.style=t=>{let n="function"==typeof o.style?o.style(t):o.style,r={...t.defaultStyle,...n},i="function"==typeof e.style?e.style({...t,defaultStyle:r}):e.style;return{...r,...i}}:a.style={...o.style,...e.style}),[a,i]}function gn(e=!0){let[t,n]=(0,fZ.useState)(e),r=(0,fZ.useRef)(!1),o=(0,fZ.useCallback)(e=>{r.current=!0,n(!!e)},[]);return yz(()=>{r.current||n(!1)},[]),[o,t]}function gr(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}let go=(0,fZ.createContext)(null),gi=null;function ga(e,t="assertive",n=7e3){gi?gi.announce(e,t,n):(gi=new gs,("boolean"==typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:"u">typeof jest)?gi.announce(e,t,n):setTimeout(()=>{(null==gi?void 0:gi.isAttached())&&(null==gi||gi.announce(e,t,n))},100))}class gs{isAttached(){var e;return null==(e=this.node)?void 0:e.isConnected}createLog(e){let t=document.createElement("div");return t.setAttribute("role","log"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions"),t}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,t="assertive",n=7e3){var r,o;if(!this.node)return;let i=document.createElement("div");"object"==typeof e?(i.setAttribute("role","img"),i.setAttribute("aria-labelledby",e["aria-labelledby"])):i.textContent=e,"assertive"===t?null==(r=this.assertiveLog)||r.appendChild(i):null==(o=this.politeLog)||o.appendChild(i),""!==e&&setTimeout(()=>{i.remove()},n)}clear(e){this.node&&((!e||"assertive"===e)&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||"polite"===e)&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,"u">typeof document&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}let gl=new Set(["id"]),gu=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),gc=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),gd=new Set(["dir","lang","hidden","inert","translate"]),gf=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),gp=/^(data-.*)$/;function gh(e,t={}){let{labelable:n,isLink:r,global:o,events:i=o,propNames:a}=t,s={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(gl.has(t)||n&&gu.has(t)||r&&gc.has(t)||o&&gd.has(t)||i&&(gf.has(t)||t.endsWith("Capture")&&gf.has(t.slice(0,-7)))||a?.has(t)||gp.test(t))&&(s[t]=e[t]);return s}function gm(e){if(function(){if(null==gy){gy=!1;try{document.createElement("div").focus({get preventScroll(){return gy=!0,!0}})}catch{}}return gy}())e.focus({preventScroll:!0});else{let t=function(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}(e);e.focus(),function(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}let gy=null,gg=e=>e?.ownerDocument??document,gb=e=>e&&"window"in e&&e.window===e?e:gg(e).defaultView||window;function gv(e,t){return!!t&&!!e&&e.contains(t)}function gw(e){return e.target}function g_(e){if(!e)return!1;let t=e.getRootNode(),n=gb(e);if(!(t instanceof n.Document||t instanceof n.ShadowRoot))return!1;let r=t.activeElement;return null!=r&&e.contains(r)}let gx="u">typeof Element&&"checkVisibility"in Element.prototype;function gS(e,t){return gx?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):"#comment"!==e.nodeName&&function(e){let t=gb(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,o="none"!==n&&"hidden"!==r&&"collapse"!==r;if(o){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:r}=t(e);o="none"!==n&&"hidden"!==r&&"collapse"!==r}return o}(e)&&!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))&&(!e.parentElement||gS(e.parentElement,e))}let gE=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],gD=gE.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";gE.push('[tabindex]:not([tabindex="-1"]):not([disabled])');let gO=gE.join(':not([hidden]):not([tabindex="-1"]),');function gP(e,t){return e.matches(gD)&&!gC(e)&&(t?.skipVisibilityCheck||gS(e))}function gk(e){return e.matches(gO)&&gS(e)&&!gC(e)}function gC(e){let t=e;for(;null!=t;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function gj(e){return e.nativeEvent=e,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function gT(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function gR(e){let t=(0,fZ.useRef)({isFocused:!1,observer:null});return yz(()=>{let e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}},[]),(0,fZ.useCallback)(n=>{let r=gw(n);(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement)&&(t.current.isFocused=!0,r.addEventListener("focusout",n=>{if(t.current.isFocused=!1,r.disabled){let t=gj(n);e?.(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&r.disabled){t.current.observer?.disconnect();let e=r===((e=document)=>e.activeElement)()?null:((e=document)=>e.activeElement)();r.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}}),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]}))},[e])}let gA=!1;function gM(e){if("u"<typeof window||null==window.navigator)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function gN(e){return"u">typeof window&&null!=window.navigator&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function gI(e){let t=null;return()=>(null==t&&(t=e()),t)}let g$=gI(function(){return gN(/^Mac/i)}),gL=gI(function(){return gN(/^iPhone/i)}),gF=gI(function(){return gN(/^iPad/i)||g$()&&navigator.maxTouchPoints>1}),gB=gI(function(){return gL()||gF()});gI(function(){return g$()||gB()});let gV=gI(function(){return gM(/AppleWebKit/i)&&!gU()}),gU=gI(function(){return gM(/Chrome/i)}),gW=gI(function(){return gM(/Android/i)}),gK=gI(function(){return gM(/Firefox/i)});function gz(e){return""===e.pointerType&&!!e.isTrusted||(gW()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function gH(e,t,n=!0){let{metaKey:r,ctrlKey:o,altKey:i,shiftKey:a}=t;gK()&&window.event?.type?.startsWith("key")&&"_blank"===e.target&&(g$()?r=!0:o=!0);let s=gV()&&g$()&&!gF()&&1?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:r,ctrlKey:o,altKey:i,shiftKey:a}):new MouseEvent("click",{metaKey:r,ctrlKey:o,altKey:i,shiftKey:a,detail:1,bubbles:!0,cancelable:!0});gH.isOpening=n,gm(e),e.dispatchEvent(s),gH.isOpening=!1}gH.isOpening=!1;let gG=null,gq=new Set,gZ=new Map,gY=!1,gJ=!1,gQ={Tab:!0,Escape:!0};function gX(e,t){for(let n of gq)n(e,t)}function g0(e){gY=!0,gH.isOpening||e.metaKey||!g$()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key||(gG="keyboard",gX("keyboard",e))}function g1(e){gG="pointer","pointerType"in e&&e.pointerType,("mousedown"===e.type||"pointerdown"===e.type)&&(gY=!0,gX("pointer",e))}function g2(e){!gH.isOpening&&gz(e)&&(gY=!0,gG="virtual")}function g4(e){let t=gb(gw(e)),n=gg(gw(e));gw(e)!==t&&gw(e)!==n&&!gA&&e.isTrusted&&(gY||gJ||(gG="virtual",gX("virtual",e)),gY=!1,gJ=!1)}function g3(){gA||(gY=!1,gJ=!0)}function g6(e){if("u"<typeof window||"u"<typeof document)return;let t=gb(e),n=gg(e);if(gZ.get(t))return;let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){gY=!0,r.apply(this,arguments)},n.addEventListener("keydown",g0,!0),n.addEventListener("keyup",g0,!0),n.addEventListener("click",g2,!0),t.addEventListener("focus",g4,!0),t.addEventListener("blur",g3,!1),"u">typeof PointerEvent&&(n.addEventListener("pointerdown",g1,!0),n.addEventListener("pointermove",g1,!0),n.addEventListener("pointerup",g1,!0)),t.addEventListener("beforeunload",()=>{g5(e)},{once:!0}),gZ.set(t,{focus:r})}let g5=(e,t)=>{let n=gb(e),r=gg(e);t&&r.removeEventListener("DOMContentLoaded",t),gZ.has(n)&&(n.HTMLElement.prototype.focus=gZ.get(n).focus,r.removeEventListener("keydown",g0,!0),r.removeEventListener("keyup",g0,!0),r.removeEventListener("click",g2,!0),n.removeEventListener("focus",g4,!0),n.removeEventListener("blur",g3,!1),"u">typeof PointerEvent&&(r.removeEventListener("pointerdown",g1,!0),r.removeEventListener("pointermove",g1,!0),r.removeEventListener("pointerup",g1,!0)),gZ.delete(n))};function g7(){return"pointer"!==gG}"u">typeof document&&("loading"!==(p=gg(void 0)).readyState?g6(void 0):p.addEventListener("DOMContentLoaded",()=>{g6(void 0)}));let g9=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),g8=new Map,be=new Set;function bt(){if("u"<typeof window)return;function e(e){return"propertyName"in e}let t=n=>{let r=gw(n);if(!e(n)||!r)return;let o=g8.get(r);if(o&&(o.delete(n.propertyName),0===o.size&&(r.removeEventListener("transitioncancel",t),g8.delete(r)),0===g8.size)){for(let e of be)e();be.clear()}};document.body.addEventListener("transitionrun",n=>{let r=gw(n);if(!e(n)||!r)return;let o=g8.get(r);o||(o=new Set,g8.set(r,o),r.addEventListener("transitioncancel",t,{once:!0})),o.add(n.propertyName)}),document.body.addEventListener("transitionend",t)}function bn(e){requestAnimationFrame(()=>{for(let[e]of g8)"isConnected"in e&&!e.isConnected&&g8.delete(e);0===g8.size?e():be.add(e)})}function br(e){if(!e.isConnected)return;let t=gg(e);if("virtual"===gG){let n=((e=document)=>e.activeElement)(t);bn(()=>{let r=((e=document)=>e.activeElement)(t);(r===n||r===t.body)&&e.isConnected&&gm(e)})}else gm(e)}function bo(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e,i=(0,fZ.useCallback)(e=>{if(gw(e)===e.currentTarget)return r&&r(e),o&&o(!1),!0},[r,o]),a=gR(i),s=(0,fZ.useCallback)(e=>{let t=gw(e),r=gg(t),i=r?((e=document)=>e.activeElement)(r):((e=document)=>e.activeElement)();t===e.currentTarget&&t===i&&(n&&n(e),o&&o(!0),a(e))},[o,n,a]);return{focusProps:{onFocus:!t&&(n||o||r)?s:void 0,onBlur:!t&&(r||o)?i:void 0}}}function bi(e){if(!e)return;let t=!0;return n=>{e({...n,preventDefault(){n.preventDefault()},isDefaultPrevented:()=>n.isDefaultPrevented(),stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped:()=>t}),t&&n.stopPropagation()}}function ba(e,t){yz(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}"u">typeof document&&("loading"!==document.readyState?bt():document.addEventListener("DOMContentLoaded",bt));let bs=fY().createContext(null);function bl(e,t){let{focusProps:n}=bo(e),{keyboardProps:r}={keyboardProps:e.isDisabled?{}:{onKeyDown:bi(e.onKeyDown),onKeyUp:bi(e.onKeyUp)}},o=y5(n,r),i=function(e){let t=(0,fZ.useContext)(bs)||{};ba(t,e);let{ref:n,...r}=t;return r}(t),a=e.isDisabled?{}:i,s=(0,fZ.useRef)(e.autoFocus);(0,fZ.useEffect)(()=>{s.current&&t.current&&br(t.current),s.current=!1},[t]);let l=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(l=void 0),{focusableProps:y5({...o,tabIndex:l},a)}}fY().forwardRef(function(e,t){let{children:n,...r}=e,o=yV(t),i={...r,ref:o};return fY().createElement(bs.Provider,{value:i},n)});let bu="default",bc="",bd=new WeakMap;function bf(e){if(gB())"disabled"===bu&&(bu="restoring",setTimeout(()=>{bn(()=>{if("restoring"===bu){let t=gg(e);"none"===t.documentElement.style.webkitUserSelect&&(t.documentElement.style.webkitUserSelect=bc||""),bc="",bu="default"}})},300));else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&bd.has(e)){let t=bd.get(e),n="userSelect"in e.style?"userSelect":"webkitUserSelect";"none"===e.style[n]&&(e.style[n]=t),""===e.getAttribute("style")&&e.removeAttribute("style"),bd.delete(e)}}function bp(e){let t=e?.defaultView;return t?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let bh=new WeakMap;function bm(e){let t=e??("u">typeof document?document:void 0);if(!t)return bp(t);if(bh.has(t))return bh.get(t);let n=t.querySelector('meta[property="csp-nonce"]'),r=n&&n instanceof gb(n).HTMLMetaElement&&(n.nonce||n.content)||bp(t)||void 0;return void 0!==r&&bh.set(t,r),r}let by=fY().createContext({register:()=>{}});by.displayName="PressResponderContext";let bg=fY().useInsertionEffect??yz;function bb(e){let t=(0,fZ.useRef)(null);return bg(()=>{t.current=e},[e]),(0,fZ.useCallback)((...e)=>{let n=t.current;return n?.(...e)},[])}function bv(){let e=(0,fZ.useRef)(new Map),t=(0,fZ.useCallback)((t,n,r,o)=>{let i=o?.once?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:i,options:o}),t.addEventListener(n,i,o)},[]),n=(0,fZ.useCallback)((t,n,r,o)=>{let i=e.current.get(r)?.fn||r;t.removeEventListener(n,i,o),e.current.delete(r)},[]),r=(0,fZ.useCallback)(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return(0,fZ.useEffect)(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}var bw=n(43144);class b_{#e;constructor(e,t,n,r){this.#e=!0;let o=r?.target??n.currentTarget;const i=o?.getBoundingClientRect();let a,s=0,l,u=null;null!=n.clientX&&null!=n.clientY&&(l=n.clientX,u=n.clientY),i&&(null!=l&&null!=u?(a=l-i.left,s=u-i.top):(a=i.width/2,s=i.height/2)),this.type=e,this.pointerType=t,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=a,this.y=s,this.key=n.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}}let bx=Symbol("linkClicked"),bS="react-aria-pressable-style",bE="data-react-aria-pressable";function bD(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:o,onPressUp:i,onClick:a,isDisabled:s,isPressed:l,preventFocusOnPress:u,shouldCancelOnPointerExit:c,allowTextSelectionOnPress:d,ref:f,...p}=function(e){let t=(0,fZ.useContext)(by);if(t){let{register:n,ref:r,...o}=t;e=y5(o,e),n()}return ba(t,e.ref),e}(e),[h,m]=(0,fZ.useState)(!1),y=(0,fZ.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:g,removeAllGlobalListeners:b}=bv(),v=(0,fZ.useCallback)((e,t)=>{let o=y.current;if(s||o.didFirePressStart)return!1;let i=!0;if(o.isTriggeringEvent=!0,r){let n=new b_("pressstart",t,e);r(n),i=n.shouldStopPropagation}return n&&n(!0),o.isTriggeringEvent=!1,o.didFirePressStart=!0,m(!0),i},[s,r,n]),w=(0,fZ.useCallback)((e,r,i=!0)=>{let a=y.current;if(!a.didFirePressStart)return!1;a.didFirePressStart=!1,a.isTriggeringEvent=!0;let l=!0;if(o){let t=new b_("pressend",r,e);o(t),l=t.shouldStopPropagation}if(n&&n(!1),m(!1),t&&i&&!s){let n=new b_("press",r,e);t(n),l&&=n.shouldStopPropagation}return a.isTriggeringEvent=!1,l},[s,o,n,t]),x=bb(w),S=bb((0,fZ.useCallback)((e,t)=>{let n=y.current;if(s)return!1;if(i){n.isTriggeringEvent=!0;let r=new b_("pressup",t,e);return i(r),n.isTriggeringEvent=!1,r.shouldStopPropagation}return!0},[s,i])),E=(0,fZ.useCallback)(e=>{let t=y.current;if(t.isPressed&&t.target){for(let n of(t.didFirePressStart&&null!=t.pointerType&&w(bk(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,b(),d||bf(t.target),t.disposables))n();t.disposables=[]}},[d,b,w]),D=bb(E),O=(0,fZ.useCallback)(e=>{c&&E(e)},[c,E]),P=(0,fZ.useCallback)(e=>{s||a?.(e)},[s,a]),k=(0,fZ.useCallback)((e,t)=>{if(!s&&a){let n=new MouseEvent("click",e);gT(n,t),a(gj(n))}},[s,a]),C=(0,fZ.useMemo)(()=>{let e=y.current,t={onKeyDown(t){if(bP(t.nativeEvent,t.currentTarget)&&gv(t.currentTarget,gw(t))){bC(gw(t),t.key)&&t.preventDefault();let r=!0;e.isPressed||t.repeat||(e.target=t.currentTarget,e.isPressed=!0,e.pointerType="keyboard",r=v(t,"keyboard"));let o=t.currentTarget;g(gg(t.currentTarget),"keyup",yK(t=>{bP(t,o)&&!t.repeat&&gv(o,gw(t))&&e.target&&S(bk(e.target,t),"keyboard")},n),!0),r&&t.stopPropagation(),t.metaKey&&g$()&&e.metaKeyEvents?.set(t.key,t.nativeEvent)}else"Meta"===t.key&&(e.metaKeyEvents=new Map)},onClick(t){if((!t||gv(t.currentTarget,gw(t)))&&t&&0===t.button&&!e.isTriggeringEvent&&!gH.isOpening){let n=!0;if(s&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&("virtual"===e.pointerType||gz(t.nativeEvent))){let e=v(t,"virtual"),r=S(t,"virtual"),o=x(t,"virtual");P(t),n=e&&r&&o}else if(e.isPressed&&"keyboard"!==e.pointerType){let r=e.pointerType||t.nativeEvent.pointerType||"virtual",o=S(bk(t.currentTarget,t),r),i=x(bk(t.currentTarget,t),r,!0);n=o&&i,e.isOverTarget=!1,P(t),D(t)}e.ignoreEmulatedMouseEvents=!1,n&&t.stopPropagation()}}},n=t=>{if(e.isPressed&&e.target&&bP(t,e.target)){bC(gw(t),t.key)&&t.preventDefault();let n=gw(t),r=gv(e.target,n);x(bk(e.target,t),"keyboard",r),r&&k(t,e.target),b(),"Enter"!==t.key&&bO(e.target)&&gv(e.target,n)&&!t[bx]&&(t[bx]=!0,gH(e.target,t,!1)),e.isPressed=!1,e.metaKeyEvents?.delete(t.key)}else if("Meta"===t.key&&e.metaKeyEvents?.size){let t=e.metaKeyEvents;for(let n of(e.metaKeyEvents=void 0,t.values()))e.target?.dispatchEvent(new KeyboardEvent("keyup",n))}};if("u">typeof PointerEvent){t.onPointerDown=t=>{var o;if(0!==t.button||!gv(t.currentTarget,gw(t)))return;if(o=t.nativeEvent,!gW()&&0===o.width&&0===o.height||1===o.width&&1===o.height&&0===o.pressure&&0===o.detail&&"mouse"===o.pointerType){e.pointerType="virtual";return}e.pointerType=t.pointerType;let i=!0;if(!e.isPressed){e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=t.pointerId,e.target=t.currentTarget,d||function(e){if(gB()){if("default"===bu){let t=gg(e);bc=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}bu="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";bd.set(e,e.style[t]),e.style[t]="none"}}(e.target),i=v(t,e.pointerType);let o=gw(t);"releasePointerCapture"in o&&("hasPointerCapture"in o?o.hasPointerCapture(t.pointerId)&&o.releasePointerCapture(t.pointerId):o.releasePointerCapture(t.pointerId)),g(gg(t.currentTarget),"pointerup",n,!1),g(gg(t.currentTarget),"pointercancel",r,!1)}i&&t.stopPropagation()},t.onMouseDown=t=>{if(gv(t.currentTarget,gw(t))&&0===t.button){if(u){let n=function(e){for(;e&&!gP(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=gb(e),n=t.document.activeElement;if(!n||n===e)return;gA=!0;let r=!1,o=e=>{(gw(e)===n||r)&&e.stopImmediatePropagation()},i=t=>{(gw(t)===n||r)&&(t.stopImmediatePropagation(),e||r||(r=!0,gm(n),l()))},a=t=>{(gw(t)===e||r)&&t.stopImmediatePropagation()},s=t=>{(gw(t)===e||r)&&(t.stopImmediatePropagation(),r||(r=!0,gm(n),l()))};t.addEventListener("blur",o,!0),t.addEventListener("focusout",i,!0),t.addEventListener("focusin",s,!0),t.addEventListener("focus",a,!0);let l=()=>{cancelAnimationFrame(u),t.removeEventListener("blur",o,!0),t.removeEventListener("focusout",i,!0),t.removeEventListener("focusin",s,!0),t.removeEventListener("focus",a,!0),gA=!1,r=!1},u=requestAnimationFrame(l);return l}(t.target);n&&e.disposables.push(n)}t.stopPropagation()}},t.onPointerUp=t=>{gv(t.currentTarget,gw(t))&&"virtual"!==e.pointerType&&(0!==t.button||e.isPressed||S(t,e.pointerType||t.pointerType))},t.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!0,v(bk(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!1,x(bk(e.target,t),e.pointerType,!1),O(t))};let n=t=>{if(t.pointerId===e.activePointerId&&e.isPressed&&0===t.button&&e.target){if(gv(e.target,gw(t))&&null!=e.pointerType){let n=!1,r=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(n?D(t):(gm(e.target),e.target.click()))},80);g(t.currentTarget,"click",()=>n=!0,!0),e.disposables.push(()=>clearTimeout(r))}else D(t);e.isOverTarget=!1}},r=e=>{D(e)};t.onDragStart=e=>{gv(e.currentTarget,gw(e))&&D(e)}}return t},[g,s,u,b,d,O,v,P,k]);return(0,fZ.useEffect)(()=>{if(!f)return;let e=gg(f.current);if(!e||!e.head||e.getElementById(bS))return;let t=e.createElement("style");t.id=bS;let n=bm(e);n&&(t.nonce=n),t.textContent=`
33
33
  @layer {
34
34
  [${bE}] {
35
35
  touch-action: pan-x pan-y pinch-zoom;
36
36
  }
37
37
  }
38
- `.trim(),e.head.prepend(t)},[f]),(0,fZ.useEffect)(()=>{let e=y.current;return()=>{for(let t of(d||bf(e.target??void 0),e.disposables))t();e.disposables=[]}},[d]),{isPressed:l||h,pressProps:y5(p,C,{[bE]:!0})}}function bO(e){return"A"===e.tagName&&e.hasAttribute("href")}function bk(e,t){let{key:n,code:r}=e,o=t.getAttribute("role");return("Enter"===n||" "===n||"Spacebar"===n||"Space"===r)&&!(t instanceof gb(t).HTMLInputElement&&!bT(t,n)||t instanceof gb(t).HTMLTextAreaElement||t.isContentEditable)&&!(("link"===o||!o&&bO(t))&&"Enter"!==n)}function bP(e,t){let n=t.clientX,r=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r,key:t.key}}function bC(e,t){return e instanceof HTMLInputElement?!bT(e,t):!(e instanceof HTMLInputElement)&&(e instanceof HTMLButtonElement?"submit"!==e.type&&"reset"!==e.type:!bO(e))}let bj=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function bT(e,t){return"checkbox"===e.type||"radio"===e.type?" "===t:bj.has(e.type)}function bR(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=(0,fZ.useRef)({isFocusWithin:!1}),{addGlobalListener:a,removeAllGlobalListeners:s}=bv(),l=(0,fZ.useCallback)(e=>{gv(e.currentTarget,gw(e))&&i.current.isFocusWithin&&!gv(e.currentTarget,e.relatedTarget)&&(i.current.isFocusWithin=!1,s(),n&&n(e),o&&o(!1))},[n,o,i,s]),u=gR(l),c=(0,fZ.useCallback)(e=>{if(!gv(e.currentTarget,gw(e)))return;let t=gw(e),n=gg(t),s=((e=document)=>e.activeElement)(n);if(!i.current.isFocusWithin&&s===t){r&&r(e),o&&o(!0),i.current.isFocusWithin=!0,u(e);let t=e.currentTarget;a(n,"focus",e=>{let r=gw(e);if(i.current.isFocusWithin&&!gv(t,r)){let e=new n.defaultView.FocusEvent("blur",{relatedTarget:r});gT(e,t),l(gj(e))}},{capture:!0})}},[r,o,u,a,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:l}}}function bA(e={}){var t;let{autoFocus:n=!1,isTextInput:r,within:o}=e,i=(0,fZ.useRef)({isFocused:!1,isFocusVisible:n||g7()}),[a,s]=(0,fZ.useState)(!1),[l,u]=(0,fZ.useState)(()=>i.current.isFocused&&i.current.isFocusVisible),c=(0,fZ.useCallback)(()=>u(i.current.isFocused&&i.current.isFocusVisible),[]),d=(0,fZ.useCallback)(e=>{i.current.isFocused=e,i.current.isFocusVisible=g7(),s(e),c()},[c]);t={enabled:a,isTextInput:r},g6(),(0,fZ.useEffect)(()=>{if(t?.enabled===!1)return;let e=(e,n)=>{var r;let o,a,s,l,u,d,f,p;r=!!t?.isTextInput,a=gg(o=n?gw(n):void 0),l=void 0!==(s=gb(o))?s.HTMLInputElement:HTMLInputElement,u=void 0!==s?s.HTMLTextAreaElement:HTMLTextAreaElement,d=void 0!==s?s.HTMLElement:HTMLElement,f=void 0!==s?s.KeyboardEvent:KeyboardEvent,p=((e=document)=>e.activeElement)(a),(r=r||p instanceof l&&!g9.has(p.type)||p instanceof u||p instanceof d&&p.isContentEditable)&&"keyboard"===e&&n instanceof f&&!gQ[n.key]||(e=>{i.current.isFocusVisible=e,c()})(g7())};return gq.add(e),()=>{gq.delete(e)}},[r,a]);let{focusProps:f}=bo({isDisabled:o,onFocusChange:d}),{focusWithinProps:p}=bR({isDisabled:!o,onFocusWithinChange:d});return{isFocused:a,isFocusVisible:l,focusProps:o?p:f}}let bN=!1,bM=0;function bI(e){"touch"===e.pointerType&&(bN=!0,setTimeout(()=>{bN=!1},500))}function b$(){let e=gg(null);if(void 0!==e)return 0===bM&&"u">typeof PointerEvent&&e.addEventListener("pointerup",bI),bM++,()=>{!(--bM>0)&&"u">typeof PointerEvent&&e.removeEventListener("pointerup",bI)}}function bL(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,a]=(0,fZ.useState)(!1),s=(0,fZ.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;(0,fZ.useEffect)(b$,[]);let{addGlobalListener:l,removeAllGlobalListeners:u}=bv(),{hoverProps:c,triggerHoverEnd:d}=(0,fZ.useMemo)(()=>{let e=(e,t)=>{let o=s.target;s.pointerType="",s.target=null,"touch"!==t&&s.isHovered&&o&&(s.isHovered=!1,u(),r&&r({type:"hoverend",target:o,pointerType:t}),n&&n(!1),a(!1))},i={};return"u">typeof PointerEvent&&(i.onPointerEnter=r=>{bN&&"mouse"===r.pointerType||((r,i)=>{if(s.pointerType=i,o||"touch"===i||s.isHovered||!gv(r.currentTarget,gw(r)))return;s.isHovered=!0;let u=r.currentTarget;s.target=u,l(gg(gw(r)),"pointerover",t=>{s.isHovered&&s.target&&!gv(s.target,gw(t))&&e(t,t.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:u,pointerType:i}),n&&n(!0),a(!0)})(r,r.pointerType)},i.onPointerLeave=t=>{!o&&gv(t.currentTarget,gw(t))&&e(t,t.pointerType)}),{hoverProps:i,triggerHoverEnd:e}},[t,n,r,o,s,l,u]);return(0,fZ.useEffect)(()=>{o&&d({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:c,isHovered:i}}if("u">typeof HTMLTemplateElement){let e=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild").get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}let bF=(0,fZ.createContext)(!1);function bB(e){let t=(t,n)=>(0,fZ.useContext)(bF)?null:e(t,n);return t.displayName=e.displayName||e.name,(0,fZ.forwardRef)(t)}let bV=new Set(["form","formAction","formEncType","formMethod","formNoValidate","formTarget","name","value"]),bU=(0,fZ.createContext)({}),bW=bB(function(e,t){var n;[e,t]=gt(e,t,bU);let r=((n=e).isPending&&(n.onPress=void 0,n.onPressStart=void 0,n.onPressEnd=void 0,n.onPressChange=void 0,n.onPressUp=void 0,n.onKeyDown=void 0,n.onKeyUp=void 0,n.onClick=void 0,n.href=void 0),e=n),{isPending:o}=r,{buttonProps:i,isPressed:a}=function(e,t){let n,{elementType:r="button",isDisabled:o,onPress:i,onPressStart:a,onPressEnd:s,onPressUp:l,onPressChange:u,preventFocusOnPress:c,allowFocusWhenDisabled:d,onClick:f,href:p,target:h,rel:m,type:y="button"}=e;n="button"===r?{type:y,disabled:o,form:e.form,formAction:e.formAction,formEncType:e.formEncType,formMethod:e.formMethod,formNoValidate:e.formNoValidate,formTarget:e.formTarget,name:e.name,value:e.value}:{role:"button",href:"a"!==r||o?void 0:p,target:"a"===r?h:void 0,type:"input"===r?y:void 0,disabled:"input"===r?o:void 0,"aria-disabled":o&&"input"!==r?o:void 0,rel:"a"===r?m:void 0};let{pressProps:g,isPressed:b}=bD({onPressStart:a,onPressEnd:s,onPressChange:u,onPress:i,onPressUp:l,onClick:f,isDisabled:o,preventFocusOnPress:c,ref:t}),{focusableProps:v}=bl(e,t);d&&(v.tabIndex=o?-1:v.tabIndex);let w=y5(v,g,gh(e,{labelable:!0}));return{isPressed:b,buttonProps:y5(n,w,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],"aria-current":e["aria-current"],"aria-disabled":e["aria-disabled"]})}}(e,t),{focusProps:s,isFocused:l,isFocusVisible:u}=bA(e),{hoverProps:c,isHovered:d}=bL({...e,isDisabled:e.isDisabled||o}),f={isHovered:d,isPressed:(r.isPressed||a)&&!o,isFocused:l,isFocusVisible:u,isDisabled:e.isDisabled||!1,isPending:null!=o&&o},p=y8({...e,values:f,defaultClassName:"react-aria-Button"}),h=y4(i.id),m=y4(),y=i["aria-labelledby"];o&&(y?y=`${y} ${m}`:i["aria-label"]&&(y=`${h} ${m}`));let g=(0,fZ.useRef)(o);return(0,fZ.useEffect)(()=>{let e={"aria-labelledby":y||h};!g.current&&l&&o?ga(e,"assertive"):g.current&&l&&!o&&ga(e,"assertive"),g.current=o},[o,l,y,h]),fY().createElement("button",{...gh(e,{propNames:bV}),...y5(i,s,c),...p,type:"submit"===i.type&&o?"button":i.type,id:h,ref:t,"aria-labelledby":y,slot:e.slot||void 0,"aria-disabled":o?"true":i["aria-disabled"],"data-disabled":e.isDisabled||void 0,"data-pressed":f.isPressed||void 0,"data-hovered":d||void 0,"data-focused":l||void 0,"data-pending":o||void 0,"data-focus-visible":u||void 0},fY().createElement(go.Provider,{value:{id:m}},p.children))});(0,fZ.createContext)(null),(0,fZ.createContext)(null),(0,fZ.createContext)(null),(0,fZ.createContext)(null),(0,fZ.createContext)(null);let bK=(0,fZ.createContext)({}),bz=(0,fZ.createContext)({}),bH=(0,fZ.forwardRef)(function(e,t){[e,t]=gt(e,t,bz);let{elementType:n="span",...r}=e;return fY().createElement(n,{className:"react-aria-Text",...r,ref:t})}),bG=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),bq=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function bZ(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize(),n="function"==typeof t.getTextInfo?t.getTextInfo():t.textInfo;if(n)return"rtl"===n.direction;if(t.script)return bG.has(t.script)}let t=e.split("-")[0];return bq.has(t)}let bY=Symbol.for("react-aria.i18n.locale");function bJ(){let e="u">typeof window&&window[bY]||"u">typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:bZ(e)?"rtl":"ltr"}}let bQ=bJ(),bX=new Set;function b0(){for(let e of(bQ=bJ(),bX))e(bQ)}function b1(){let e=y0(),[t,n]=(0,fZ.useState)(bQ);return((0,fZ.useEffect)(()=>(0===bX.size&&window.addEventListener("languagechange",b0),bX.add(n),()=>{bX.delete(n),0===bX.size&&window.removeEventListener("languagechange",b0)}),[]),e)?{locale:"u">typeof window&&window[bY]||"en-US",direction:"ltr"}:t}let b2=fY().createContext(null);function b4(e){let{locale:t,children:n}=e,r=fY().useMemo(()=>({locale:t,direction:bZ(t)?"rtl":"ltr"}),[t]);return fY().createElement(b2.Provider,{value:r},n)}function b3(e){let{children:t}=e,n=b1();return fY().createElement(b2.Provider,{value:n},t)}function b6(e){let{locale:t,children:n}=e;return t?fY().createElement(b4,{locale:t,children:n}):fY().createElement(b3,{children:n})}function b5(){let e=b1();return(0,fZ.useContext)(b2)||e}let b7=null;function b9(e,t="assertive",n=7e3){b7?b7.announce(e,t,n):(b7=new b8,("boolean"==typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:"u">typeof jest)?b7.announce(e,t,n):setTimeout(()=>{b7?.isAttached()&&b7?.announce(e,t,n)},100))}class b8{constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,"u">typeof document&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}isAttached(){return this.node?.isConnected}createLog(e){let t=document.createElement("div");return t.setAttribute("role","log"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions"),t}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,t="assertive",n=7e3){if(!this.node)return;let r=document.createElement("div");"object"==typeof e?(r.setAttribute("role","img"),r.setAttribute("aria-labelledby",e["aria-labelledby"])):r.textContent=e,"assertive"===t?this.assertiveLog?.appendChild(r):this.politeLog?.appendChild(r),""!==e&&setTimeout(()=>{r.remove()},n)}clear(e){this.node&&((!e||"assertive"===e)&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||"polite"===e)&&this.politeLog&&(this.politeLog.innerHTML=""))}}var ve={};function vt(e,t){let n=(0,fZ.useRef)(null);return e&&n.current&&t(e,n.current)&&(e=n.current),n.current=e,e}ve={"ar-AE":{dateRange:e=>`${e.startDate} \u{625}\u{644}\u{649} ${e.endDate}`,dateSelected:e=>`${e.date} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}`,finishRangeSelectionPrompt:"انقر لإنهاء عملية تحديد نطاق التاريخ",maximumDate:"آخر تاريخ متاح",minimumDate:"أول تاريخ متاح",next:"التالي",previous:"السابق",selectedDateDescription:e=>`\u{62A}\u{627}\u{631}\u{64A}\u{62E} \u{645}\u{62D}\u{62F}\u{62F}: ${e.date}`,selectedRangeDescription:e=>`\u{627}\u{644}\u{645}\u{62F}\u{649} \u{627}\u{644}\u{632}\u{645}\u{646}\u{64A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.dateRange}`,startRangeSelectionPrompt:"انقر لبدء عملية تحديد نطاق التاريخ",todayDate:e=>`\u{627}\u{644}\u{64A}\u{648}\u{645}\u{60C} ${e.date}`,todayDateSelected:e=>`\u{627}\u{644}\u{64A}\u{648}\u{645}\u{60C} ${e.date} \u{645}\u{62D}\u{62F}\u{62F}`},"bg-BG":{dateRange:e=>`${e.startDate} \u{434}\u{43E} ${e.endDate}`,dateSelected:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{43E} \u{435} ${e.date}`,finishRangeSelectionPrompt:"Натиснете, за да довършите избора на времеви интервал",maximumDate:"Последна налична дата",minimumDate:"Първа налична дата",next:"Напред",previous:"Назад",selectedDateDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:"Натиснете, за да пристъпите към избора на времеви интервал",todayDate:e=>`\u{414}\u{43D}\u{435}\u{441}, ${e.date}`,todayDateSelected:e=>`\u{414}\u{43D}\u{435}\u{441}, ${e.date} \u{441}\u{430} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{438}`},"cs-CZ":{dateRange:e=>`${e.startDate} a\u{17E} ${e.endDate}`,dateSelected:e=>`Vybr\xe1no ${e.date}`,finishRangeSelectionPrompt:"Kliknut\xedm dokonč\xedte v\xfdběr rozsahu dat",maximumDate:"Posledn\xed dostupn\xe9 datum",minimumDate:"Prvn\xed dostupn\xe9 datum",next:"Dalš\xed",previous:"Předchoz\xed",selectedDateDescription:e=>`Vybran\xe9 datum: ${e.date}`,selectedRangeDescription:e=>`Vybran\xe9 obdob\xed: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknut\xedm zah\xe1j\xedte v\xfdběr rozsahu dat",todayDate:e=>`Dnes, ${e.date}`,todayDateSelected:e=>`Dnes, vybr\xe1no ${e.date}`},"da-DK":{dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:"Klik for at fuldf\xf8re valg af datoomr\xe5de",maximumDate:"Sidste ledige dato",minimumDate:"F\xf8rste ledige dato",next:"N\xe6ste",previous:"Forrige",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.dateRange}`,startRangeSelectionPrompt:"Klik for at starte valg af datoomr\xe5de",todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`},"de-DE":{dateRange:e=>`${e.startDate} bis ${e.endDate}`,dateSelected:e=>`${e.date} ausgew\xe4hlt`,finishRangeSelectionPrompt:"Klicken, um die Auswahl des Datumsbereichs zu beenden",maximumDate:"Letztes verf\xfcgbares Datum",minimumDate:"Erstes verf\xfcgbares Datum",next:"Weiter",previous:"Zur\xfcck",selectedDateDescription:e=>`Ausgew\xe4hltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgew\xe4hlter Bereich: ${e.dateRange}`,startRangeSelectionPrompt:"Klicken, um die Auswahl des Datumsbereichs zu beginnen",todayDate:e=>`Heute, ${e.date}`,todayDateSelected:e=>`Heute, ${e.date} ausgew\xe4hlt`},"el-GR":{dateRange:e=>`${e.startDate} \u{3AD}\u{3C9}\u{3C2} ${e.endDate}`,dateSelected:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B5} ${e.date}`,finishRangeSelectionPrompt:"Κάντε κλικ για να ολοκληρώσετε την επιλογή εύρους ημερομηνιών",maximumDate:"Τελευταία διαθέσιμη ημερομηνία",minimumDate:"Πρώτη διαθέσιμη ημερομηνία",next:"Επόμενο",previous:"Προηγούμενο",selectedDateDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3B7}\u{3BC}\u{3B5}\u{3C1}\u{3BF}\u{3BC}\u{3B7}\u{3BD}\u{3AF}\u{3B1}: ${e.date}`,selectedRangeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3BF} \u{3B5}\u{3CD}\u{3C1}\u{3BF}\u{3C2}: ${e.dateRange}`,startRangeSelectionPrompt:"Κάντε κλικ για να ξεκινήσετε την επιλογή εύρους ημερομηνιών",todayDate:e=>`\u{3A3}\u{3AE}\u{3BC}\u{3B5}\u{3C1}\u{3B1}, ${e.date}`,todayDateSelected:e=>`\u{3A3}\u{3AE}\u{3BC}\u{3B5}\u{3C1}\u{3B1}, \u{3B5}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3C4}\u{3B7}\u{3BA}\u{3B5} ${e.date}`},"en-US":{previous:"Previous",next:"Next",selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.dateRange}`,todayDate:e=>`Today, ${e.date}`,todayDateSelected:e=>`Today, ${e.date} selected`,dateSelected:e=>`${e.date} selected`,startRangeSelectionPrompt:"Click to start selecting date range",finishRangeSelectionPrompt:"Click to finish selecting date range",minimumDate:"First available date",maximumDate:"Last available date",dateRange:e=>`${e.startDate} to ${e.endDate}`},"es-ES":{dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} seleccionado`,finishRangeSelectionPrompt:"Haga clic para terminar de seleccionar rango de fechas",maximumDate:"\xdaltima fecha disponible",minimumDate:"Primera fecha disponible",next:"Siguiente",previous:"Anterior",selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo seleccionado: ${e.dateRange}`,startRangeSelectionPrompt:"Haga clic para comenzar a seleccionar un rango de fechas",todayDate:e=>`Hoy, ${e.date}`,todayDateSelected:e=>`Hoy, ${e.date} seleccionado`},"et-EE":{dateRange:e=>`${e.startDate} kuni ${e.endDate}`,dateSelected:e=>`${e.date} valitud`,finishRangeSelectionPrompt:"Kl\xf5psake kuup\xe4evavahemiku valimise l\xf5petamiseks",maximumDate:"Viimane saadaolev kuup\xe4ev",minimumDate:"Esimene saadaolev kuup\xe4ev",next:"J\xe4rgmine",previous:"Eelmine",selectedDateDescription:e=>`Valitud kuup\xe4ev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.dateRange}`,startRangeSelectionPrompt:"Kl\xf5psake kuup\xe4evavahemiku valimiseks",todayDate:e=>`T\xe4na, ${e.date}`,todayDateSelected:e=>`T\xe4na, ${e.date} valitud`},"fi-FI":{dateRange:e=>`${e.startDate} \u{2013} ${e.endDate}`,dateSelected:e=>`${e.date} valittu`,finishRangeSelectionPrompt:"Lopeta p\xe4iv\xe4m\xe4\xe4r\xe4alueen valinta napsauttamalla t\xe4t\xe4.",maximumDate:"Viimeinen varattavissa oleva p\xe4iv\xe4m\xe4\xe4r\xe4",minimumDate:"Ensimm\xe4inen varattavissa oleva p\xe4iv\xe4m\xe4\xe4r\xe4",next:"Seuraava",previous:"Edellinen",selectedDateDescription:e=>`Valittu p\xe4iv\xe4m\xe4\xe4r\xe4: ${e.date}`,selectedRangeDescription:e=>`Valittu aikav\xe4li: ${e.dateRange}`,startRangeSelectionPrompt:"Aloita p\xe4iv\xe4m\xe4\xe4r\xe4alueen valinta napsauttamalla t\xe4t\xe4.",todayDate:e=>`T\xe4n\xe4\xe4n, ${e.date}`,todayDateSelected:e=>`T\xe4n\xe4\xe4n, ${e.date} valittu`},"fr-FR":{dateRange:e=>`${e.startDate} \xe0 ${e.endDate}`,dateSelected:e=>`${e.date} s\xe9lectionn\xe9`,finishRangeSelectionPrompt:"Cliquer pour finir de s\xe9lectionner la plage de dates",maximumDate:"Derni\xe8re date disponible",minimumDate:"Premi\xe8re date disponible",next:"Suivant",previous:"Pr\xe9c\xe9dent",selectedDateDescription:e=>`Date s\xe9lectionn\xe9e\xa0: ${e.date}`,selectedRangeDescription:e=>`Plage s\xe9lectionn\xe9e\xa0: ${e.dateRange}`,startRangeSelectionPrompt:"Cliquer pour commencer \xe0 s\xe9lectionner la plage de dates",todayDate:e=>`Aujourd'hui, ${e.date}`,todayDateSelected:e=>`Aujourd\u{2019}hui, ${e.date} s\xe9lectionn\xe9`},"he-IL":{dateRange:e=>`${e.startDate} \u{5E2}\u{5D3} ${e.endDate}`,dateSelected:e=>`${e.date} \u{5E0}\u{5D1}\u{5D7}\u{5E8}`,finishRangeSelectionPrompt:"חץ כדי לסיים את בחירת טווח התאריכים",maximumDate:"תאריך פנוי אחרון",minimumDate:"תאריך פנוי ראשון",next:"הבא",previous:"הקודם",selectedDateDescription:e=>`\u{5EA}\u{5D0}\u{5E8}\u{5D9}\u{5DA} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.date}`,selectedRangeDescription:e=>`\u{5D8}\u{5D5}\u{5D5}\u{5D7} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.dateRange}`,startRangeSelectionPrompt:"לחץ כדי להתחיל בבחירת טווח התאריכים",todayDate:e=>`\u{5D4}\u{5D9}\u{5D5}\u{5DD}, ${e.date}`,todayDateSelected:e=>`\u{5D4}\u{5D9}\u{5D5}\u{5DD}, ${e.date} \u{5E0}\u{5D1}\u{5D7}\u{5E8}`},"hr-HR":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} odabran`,finishRangeSelectionPrompt:"Kliknite da dovršite raspon odabranih datuma",maximumDate:"Posljednji raspoloživi datum",minimumDate:"Prvi raspoloživi datum",next:"Sljedeći",previous:"Prethodni",selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite da započnete raspon odabranih datuma",todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, odabran ${e.date}`},"hu-HU":{dateRange:e=>`${e.startDate}\u{2013}${e.endDate}`,dateSelected:e=>`${e.date} kiv\xe1lasztva`,finishRangeSelectionPrompt:"Kattintson a d\xe1tumtartom\xe1ny kijel\xf6l\xe9s\xe9nek befejez\xe9s\xe9hez",maximumDate:"Utols\xf3 el\xe9rhető d\xe1tum",minimumDate:"Az első el\xe9rhető d\xe1tum",next:"K\xf6vetkező",previous:"Előző",selectedDateDescription:e=>`Kijel\xf6lt d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Kijel\xf6lt tartom\xe1ny: ${e.dateRange}`,startRangeSelectionPrompt:"Kattintson a d\xe1tumtartom\xe1ny kijel\xf6l\xe9s\xe9nek ind\xedt\xe1s\xe1hoz",todayDate:e=>`Ma, ${e.date}`,todayDateSelected:e=>`Ma, ${e.date} kijel\xf6lve`},"it-IT":{dateRange:e=>`Da ${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selezionata`,finishRangeSelectionPrompt:"Fai clic per completare la selezione dell’intervallo di date",maximumDate:"Ultima data disponibile",minimumDate:"Prima data disponibile",next:"Successivo",previous:"Precedente",selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: ${e.dateRange}`,startRangeSelectionPrompt:"Fai clic per selezionare l’intervallo di date",todayDate:e=>`Oggi, ${e.date}`,todayDateSelected:e=>`Oggi, ${e.date} selezionata`},"ja-JP":{dateRange:e=>`${e.startDate} \u{304B}\u{3089} ${e.endDate}`,dateSelected:e=>`${e.date} \u{3092}\u{9078}\u{629E}`,finishRangeSelectionPrompt:"クリックして日付範囲の選択を終了",maximumDate:"最終利用可能日",minimumDate:"最初の利用可能日",next:"次へ",previous:"前へ",selectedDateDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{65E5}\u{4ED8} : ${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{629E}\u{7BC4}\u{56F2} : ${e.dateRange}`,startRangeSelectionPrompt:"クリックして日付範囲の選択を開始",todayDate:e=>`\u{672C}\u{65E5}\u{3001}${e.date}`,todayDateSelected:e=>`\u{672C}\u{65E5}\u{3001}${e.date} \u{3092}\u{9078}\u{629E}`},"ko-KR":{dateRange:e=>`${e.startDate} ~ ${e.endDate}`,dateSelected:e=>`${e.date} \u{C120}\u{D0DD}\u{B428}`,finishRangeSelectionPrompt:"날짜 범위 선택을 완료하려면 클릭하십시오.",maximumDate:"마지막으로 사용 가능한 일자",minimumDate:"처음으로 사용 가능한 일자",next:"다음",previous:"이전",selectedDateDescription:e=>`\u{C120}\u{D0DD} \u{C77C}\u{C790}: ${e.date}`,selectedRangeDescription:e=>`\u{C120}\u{D0DD} \u{BC94}\u{C704}: ${e.dateRange}`,startRangeSelectionPrompt:"날짜 범위 선택을 시작하려면 클릭하십시오.",todayDate:e=>`\u{C624}\u{B298}, ${e.date}`,todayDateSelected:e=>`\u{C624}\u{B298}, ${e.date} \u{C120}\u{D0DD}\u{B428}`},"lt-LT":{dateRange:e=>`Nuo ${e.startDate} iki ${e.endDate}`,dateSelected:e=>`Pasirinkta ${e.date}`,finishRangeSelectionPrompt:"Spustelėkite, kad baigtumėte pasirinkti datų intervalą",maximumDate:"Paskutinė galima data",minimumDate:"Pirmoji galima data",next:"Paskesnis",previous:"Ankstesnis",selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: ${e.dateRange}`,startRangeSelectionPrompt:"Spustelėkite, kad pradėtumėte pasirinkti datų intervalą",todayDate:e=>`\u{160}iandien, ${e.date}`,todayDateSelected:e=>`\u{160}iandien, pasirinkta ${e.date}`},"lv-LV":{dateRange:e=>`No ${e.startDate} l\u{12B}dz ${e.endDate}`,dateSelected:e=>`Atlas\u{12B}ts: ${e.date}`,finishRangeSelectionPrompt:"Noklikšķiniet, lai pabeigtu datumu diapazona atlasi",maximumDate:"Pēdējais pieejamais datums",minimumDate:"Pirmais pieejamais datums",next:"Tālāk",previous:"Atpakaļ",selectedDateDescription:e=>`Atlas\u{12B}tais datums: ${e.date}`,selectedRangeDescription:e=>`Atlas\u{12B}tais diapazons: ${e.dateRange}`,startRangeSelectionPrompt:"Noklikšķiniet, lai sāktu datumu diapazona atlasi",todayDate:e=>`\u{160}odien, ${e.date}`,todayDateSelected:e=>`Atlas\u{12B}ta \u{161}odiena, ${e.date}`},"nb-NO":{dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:"Klikk for \xe5 fullf\xf8re valg av datoomr\xe5de",maximumDate:"Siste tilgjengelige dato",minimumDate:"F\xf8rste tilgjengelige dato",next:"Neste",previous:"Forrige",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt omr\xe5de: ${e.dateRange}`,startRangeSelectionPrompt:"Klikk for \xe5 starte valg av datoomr\xe5de",todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`},"nl-NL":{dateRange:e=>`${e.startDate} tot ${e.endDate}`,dateSelected:e=>`${e.date} geselecteerd`,finishRangeSelectionPrompt:"Klik om de selectie van het datumbereik te voltooien",maximumDate:"Laatste beschikbare datum",minimumDate:"Eerste beschikbare datum",next:"Volgende",previous:"Vorige",selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.dateRange}`,startRangeSelectionPrompt:"Klik om het datumbereik te selecteren",todayDate:e=>`Vandaag, ${e.date}`,todayDateSelected:e=>`Vandaag, ${e.date} geselecteerd`},"pl-PL":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`Wybrano ${e.date}`,finishRangeSelectionPrompt:"Kliknij, aby zakończyć wyb\xf3r zakresu dat",maximumDate:"Ostatnia dostępna data",minimumDate:"Pierwsza dostępna data",next:"Dalej",previous:"Wstecz",selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknij, aby rozpocząć wyb\xf3r zakresu dat",todayDate:e=>`Dzisiaj, ${e.date}`,todayDateSelected:e=>`Dzisiaj wybrano ${e.date}`},"pt-BR":{dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:"Clique para concluir a sele\xe7\xe3o do intervalo de datas",maximumDate:"\xdaltima data dispon\xedvel",minimumDate:"Primeira data dispon\xedvel",next:"Pr\xf3ximo",previous:"Anterior",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:"Clique para iniciar a sele\xe7\xe3o do intervalo de datas",todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`},"pt-PT":{dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:"Clique para terminar de selecionar o intervalo de datas",maximumDate:"\xdaltima data dispon\xedvel",minimumDate:"Primeira data dispon\xedvel",next:"Pr\xf3ximo",previous:"Anterior",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:"Clique para come\xe7ar a selecionar o intervalo de datas",todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`},"ro-RO":{dateRange:e=>`De la ${e.startDate} p\xe2n\u{103} la ${e.endDate}`,dateSelected:e=>`${e.date} selectat\u{103}`,finishRangeSelectionPrompt:"Apăsaţi pentru a finaliza selecţia razei pentru dată",maximumDate:"Ultima dată disponibilă",minimumDate:"Prima dată disponibilă",next:"Următorul",previous:"\xcenainte",selectedDateDescription:e=>`Dat\u{103} selectat\u{103}: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: ${e.dateRange}`,startRangeSelectionPrompt:"Apăsaţi pentru a \xeencepe selecţia razei pentru dată",todayDate:e=>`Ast\u{103}zi, ${e.date}`,todayDateSelected:e=>`Azi, ${e.date} selectat\u{103}`},"ru-RU":{dateRange:e=>`\u{421} ${e.startDate} \u{43F}\u{43E} ${e.endDate}`,dateSelected:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`,finishRangeSelectionPrompt:"Щелкните, чтобы завершить выбор диапазона дат",maximumDate:"Последняя доступная дата",minimumDate:"Первая доступная дата",next:"Далее",previous:"Назад",selectedDateDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{430}\u{44F} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{44B}\u{439} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:"Щелкните, чтобы начать выбор диапазона дат",todayDate:e=>`\u{421}\u{435}\u{433}\u{43E}\u{434}\u{43D}\u{44F}, ${e.date}`,todayDateSelected:e=>`\u{421}\u{435}\u{433}\u{43E}\u{434}\u{43D}\u{44F}, \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`},"sk-SK":{dateRange:e=>`Od ${e.startDate} do ${e.endDate}`,dateSelected:e=>`Vybrat\xfd d\xe1tum ${e.date}`,finishRangeSelectionPrompt:"Kliknut\xedm dokonč\xedte v\xfdber rozsahu d\xe1tumov",maximumDate:"Posledn\xfd dostupn\xfd d\xe1tum",minimumDate:"Prv\xfd dostupn\xfd d\xe1tum",next:"Nasleduj\xface",previous:"Predch\xe1dzaj\xface",selectedDateDescription:e=>`Vybrat\xfd d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Vybrat\xfd rozsah: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknut\xedm spust\xedte v\xfdber rozsahu d\xe1tumov",todayDate:e=>`Dnes ${e.date}`,todayDateSelected:e=>`Vybrat\xfd dne\u{161}n\xfd d\xe1tum ${e.date}`},"sl-SI":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izbrano`,finishRangeSelectionPrompt:"Kliknite za dokončanje izbire datumskega obsega",maximumDate:"Zadnji razpoložljivi datum",minimumDate:"Prvi razpoložljivi datum",next:"Naprej",previous:"Nazaj",selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano obmo\u{10D}je: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite za začetek izbire datumskega obsega",todayDate:e=>`Danes, ${e.date}`,todayDateSelected:e=>`Danes, ${e.date} izbrano`},"sr-SP":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izabran`,finishRangeSelectionPrompt:"Kliknite da dovršite opseg izabranih datuma",maximumDate:"Zadnji raspoloživi datum",minimumDate:"Prvi raspoloživi datum",next:"Sledeći",previous:"Prethodni",selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani period: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite da započnete opseg izabranih datuma",todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, izabran ${e.date}`},"sv-SE":{dateRange:e=>`${e.startDate} till ${e.endDate}`,dateSelected:e=>`${e.date} har valts`,finishRangeSelectionPrompt:"Klicka f\xf6r att avsluta val av datumintervall",maximumDate:"Sista tillg\xe4ngliga datum",minimumDate:"F\xf6rsta tillg\xe4ngliga datum",next:"N\xe4sta",previous:"F\xf6reg\xe5ende",selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.dateRange}`,startRangeSelectionPrompt:"Klicka f\xf6r att v\xe4lja datumintervall",todayDate:e=>`Idag, ${e.date}`,todayDateSelected:e=>`Idag, ${e.date} har valts`},"tr-TR":{dateRange:e=>`${e.startDate} - ${e.endDate}`,dateSelected:e=>`${e.date} se\xe7ildi`,finishRangeSelectionPrompt:"Tarih aralığı se\xe7imini tamamlamak i\xe7in tıklayın",maximumDate:"Son m\xfcsait tarih",minimumDate:"İlk m\xfcsait tarih",next:"Sonraki",previous:"\xd6nceki",selectedDateDescription:e=>`Se\xe7ilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Se\xe7ilen Aral\u{131}k: ${e.dateRange}`,startRangeSelectionPrompt:"Tarih aralığı se\xe7imini başlatmak i\xe7in tıklayın",todayDate:e=>`Bug\xfcn, ${e.date}`,todayDateSelected:e=>`Bug\xfcn, ${e.date} se\xe7ildi`},"uk-UA":{dateRange:e=>`${e.startDate} \u{2014} ${e.endDate}`,dateSelected:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`,finishRangeSelectionPrompt:"Натисніть, щоб завершити вибір діапазону дат",maximumDate:"Остання доступна дата",minimumDate:"Перша доступна дата",next:"Наступний",previous:"Попередній",selectedDateDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:"Натисніть, щоб почати вибір діапазону дат",todayDate:e=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, ${e.date}`,todayDateSelected:e=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`},"zh-CN":{dateRange:e=>`${e.startDate} \u{81F3} ${e.endDate}`,dateSelected:e=>`\u{5DF2}\u{9009}\u{62E9} ${e.date}`,finishRangeSelectionPrompt:"单击以完成选择日期范围",maximumDate:"最后一个可用日期",minimumDate:"第一个可用日期",next:"下一页",previous:"上一页",selectedDateDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{8303}\u{56F4}\u{FF1A}${e.dateRange}`,startRangeSelectionPrompt:"单击以开始选择日期范围",todayDate:e=>`\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${e.date}`,todayDateSelected:e=>`\u{5DF2}\u{9009}\u{62E9}\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${e.date}`},"zh-TW":{dateRange:e=>`${e.startDate} \u{81F3} ${e.endDate}`,dateSelected:e=>`\u{5DF2}\u{9078}\u{53D6} ${e.date}`,finishRangeSelectionPrompt:"按一下以完成選取日期範圍",maximumDate:"最後一個可用日期",minimumDate:"第一個可用日期",next:"下一頁",previous:"上一頁",selectedDateDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{7BC4}\u{570D}\u{FF1A}${e.dateRange}`,startRangeSelectionPrompt:"按一下以開始選取日期範圍",todayDate:e=>`\u{4ECA}\u{5929}\u{FF0C}${e.date}`,todayDateSelected:e=>`\u{5DF2}\u{9078}\u{53D6}\u{4ECA}\u{5929}\u{FF0C}${e.date}`}};let vn=new Map;class vr{constructor(e,t={}){this.formatter=vi(e,t),this.options=t}format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,t){if("function"==typeof this.formatter.formatRange)return this.formatter.formatRange(e,t);if(t<e)throw RangeError("End date must be >= start date");return`${this.formatter.format(e)} \u{2013} ${this.formatter.format(t)}`}formatRangeToParts(e,t){if("function"==typeof this.formatter.formatRangeToParts)return this.formatter.formatRangeToParts(e,t);if(t<e)throw RangeError("End date must be >= start date");let n=this.formatter.formatToParts(e),r=this.formatter.formatToParts(t);return[...n.map(e=>({...e,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...r.map(e=>({...e,source:"endRange"}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return null==vs&&(vs="h12"===new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle),vs&&(this.resolvedHourCycle||(this.resolvedHourCycle=function(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,"");let n=vi(e+=(e.includes("-u-")?"":"-u")+"-nu-latn",{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(e=>"hour"===e.type).value,10),o=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(e=>"hour"===e.type).value,10);if(0===r&&23===o)return"h23";if(24===r&&23===o)return"h24";if(0===r&&11===o)return"h11";if(12===r&&11===o)return"h12";throw Error("Unexpected hour cycle result")}(e.locale,this.options)),e.hourCycle=this.resolvedHourCycle,e.hour12="h11"===this.resolvedHourCycle||"h12"===this.resolvedHourCycle),"ethiopic-amete-alem"===e.calendar&&(e.calendar="ethioaa"),e}}let vo={true:{ja:"h11"},false:{}};function vi(e,t={}){if("boolean"==typeof t.hour12&&(null==va&&(va="24"===new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))),va)){let n=vo[String((t={...t}).hour12)][e.split("-")[0]],r=t.hour12?"h12":"h23";t.hourCycle=n??r,delete t.hour12}let n=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(vn.has(n))return vn.get(n);let r=new Intl.DateTimeFormat(e,t);return vn.set(n,r),r}let va=null,vs=null;function vl(e){e=vt(e??{},vu);let{locale:t}=b5();return(0,fZ.useMemo)(()=>new vr(t,e),[t,e])}function vu(e,t){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(t[r]!==e[r])return!1;return!0}let vc=Symbol.for("react-aria.i18n.locale"),vd=Symbol.for("react-aria.i18n.strings");class vf{constructor(e,t="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}getStringForLocale(e,t){let n=this.getStringsForLocale(t)[e];if(!n)throw Error(`Could not find intl message ${e} in ${t} locale`);return n}getStringsForLocale(e){let t=this.strings[e];return t||(t=function(e,t,n="en-US"){var r;if(t[e])return t[e];let o=(r=e,Intl.Locale?new Intl.Locale(r).language:r.split("-")[0]);if(t[o])return t[o];for(let e in t)if(e.startsWith(o+"-"))return t[e];return t[n]}(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(e){if("u"<typeof window)return null;let t=window[vc];if(void 0===h){let e=window[vd];if(!e)return null;for(let n in h={},e)h[n]=new vf({[t]:e[n]},t)}let n=h?.[e];if(!n)throw Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return n}}let vp=new Map,vh=new Map;class vm{constructor(e,t){this.locale=e,this.strings=t}format(e,t){let n=this.strings.getStringForLocale(e,this.locale);return"function"==typeof n?n(t,this):n}plural(e,t,n="cardinal"){let r=t["="+e];if(r)return"function"==typeof r?r():r;let o=this.locale+":"+n,i=vp.get(o);return i||(i=new Intl.PluralRules(this.locale,{type:n}),vp.set(o,i)),"function"==typeof(r=t[i.select(e)]||t.other)?r():r}number(e){let t=vh.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),vh.set(this.locale,t)),t.format(e)}select(e,t){let n=e[t]||e.other;return"function"==typeof n?n():n}}let vy=new WeakMap;function vg(e,t){let n;return t&&vf.getGlobalDictionaryForPackage(t)||((n=vy.get(e))||(n=new vf(e),vy.set(e,n)),n)}function vb(e,t){let{locale:n}=b5(),r=vg(e,t);return(0,fZ.useMemo)(()=>new vm(n,r),[n,r])}function vv(e,t){return e-t*Math.floor(e/t)}function vw(e,t,n,r){let o=(t=vx(e,t))-1,i=-2;return n<=2?i=0:v_(t)&&(i=-1),1721425+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)}function v_(e){return e%4==0&&(e%100!=0||e%400==0)}function vx(e,t){return"BC"===e?1-t:t}function vS(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}let vE={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class vD{fromJulianDay(e){let t=e-1721426,n=Math.floor(t/146097),r=vv(t,146097),o=Math.floor(r/36524),i=vv(r,36524),a=Math.floor(i/1461),s=Math.floor(vv(i,1461)/365),[l,u]=vS(400*n+100*o+4*a+s+ +(4!==o&&4!==s)),c=e-vw(l,u,1,1),d=2;e<vw(l,u,3,1)?d=0:v_(u)&&(d=1);let f=Math.floor(((c+d)*12+373)/367),p=e-vw(l,u,f,1)+1;return new vH(l,u,f,p)}toJulianDay(e){return vw(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return vE[v_(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return v_(e.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(e){return 9999}getEras(){return["BC","AD"]}isInverseEra(e){return"BC"===e.era}balanceDate(e){e.year<=0&&(e.era="BC"===e.era?"AD":"BC",e.year=1-e.year)}constructor(){this.identifier="gregory"}}function vO(e,t){let n=e.copy(),r="hour"in n?vI(n,t):0;vk(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,vP(n),vC(n),n.day+=7*(t.weeks||0),n.day+=t.days||0,n.day+=r,function(e){for(;e.day<1;)e.month--,vP(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,vP(e)}(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let o=n.calendar.getYearsInEra(n);if(n.year>o){let e=n.calendar.isInverseEra?.(n);n.year=o,n.month=e?1:n.calendar.getMonthsInYear(n),n.day=e?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let i=n.calendar.getMonthsInYear(n);return n.month>i&&(n.month=i,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function vk(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function vP(e){for(;e.month<1;)vk(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,vk(e,1)}function vC(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function vj(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),vC(e)}function vT(e){let t={};for(let n in e)"number"==typeof e[n]&&(t[n]=-e[n]);return t}function vR(e,t){let n=e.copy();return null!=t.era&&(n.era=t.era),null!=t.year&&(n.year=t.year),null!=t.month&&(n.month=t.month),null!=t.day&&(n.day=t.day),vj(n),n}function vA(e,t){let n=e.copy();return null!=t.hour&&(n.hour=t.hour),null!=t.minute&&(n.minute=t.minute),null!=t.second&&(n.second=t.second),null!=t.millisecond&&(n.millisecond=t.millisecond),vN(n),n}function vN(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function vM(e,t){let n=e%t;return n<0&&(n+=t),n}function vI(e,t){let n;return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,e.second+=Math.floor(e.millisecond/1e3),e.millisecond=vM(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=vM(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=vM(e.minute,60),n=Math.floor(e.hour/24),e.hour=vM(e.hour,24),n}function v$(e,t){let n=e.copy();return vI(n,t),n}function vL(e,t,n,r){let o=e.copy();switch(t){case"era":{let t=e.calendar.getEras(),i=t.indexOf(e.era);if(i<0)throw Error("Invalid era: "+e.era);i=vB(i,n,0,t.length-1,r?.round),o.era=t[i],vj(o);break}case"year":o.calendar.isInverseEra?.(o)&&(n=-n),o.year=vB(e.year,n,-1/0,9999,r?.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,e);break;case"month":o.month=vB(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case"day":o.day=vB(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(o),vj(o),o}function vF(e,t,n,r){let o=e.copy();switch(t){case"hour":{let t=e.hour,i=0,a=23;if(r?.hourCycle===12){let e=t>=12;i=12*!!e,a=e?23:11}o.hour=vB(t,n,i,a,r?.round);break}case"minute":o.minute=vB(e.minute,n,0,59,r?.round);break;case"second":o.second=vB(e.second,n,0,59,r?.round);break;case"millisecond":o.millisecond=vB(e.millisecond,n,0,999,r?.round);break;default:throw Error("Unsupported field "+t)}return o}function vB(e,t,n,r,o=!1){if(o){(e+=Math.sign(t))<n&&(e=r);let o=Math.abs(t);(e=t>0?Math.ceil(e/o)*o:Math.floor(e/o)*o)>r&&(e=n)}else(e+=t)<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function vV(e,t){let n;return n=(null!=t.years&&0!==t.years||null!=t.months&&0!==t.months||null!=t.weeks&&0!==t.weeks||null!=t.days&&0!==t.days?v1(vO(v6(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days}),e.timeZone):vY(e)-e.offset)+(t.milliseconds||0),n+=1e3*(t.seconds||0),n+=6e4*(t.minutes||0),v5(v4(n+=36e5*(t.hours||0),e.timeZone),e.calendar)}function vU(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function vW(e){let t,n=v5(e,new vD);return t="BC"===n.era?1===n.year?"0000":"-"+String(Math.abs(1-n.year)).padStart(6,"00"):String(n.year).padStart(4,"0"),`${t}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")}`}function vK(e){return`${vW(e)}T${vU(e)}`}function vz(e){let t,n="object"==typeof e[0]?e.shift():new vD;if("string"==typeof e[0])t=e.shift();else{let e=n.getEras();t=e[e.length-1]}return[n,t,e.shift(),e.shift(),e.shift()]}class vH{#t;constructor(...e){let[t,n,r,o,i]=vz(e);this.calendar=t,this.era=n,this.year=r,this.month=o,this.day=i,vj(this)}copy(){return this.era?new vH(this.calendar,this.era,this.year,this.month,this.day):new vH(this.calendar,this.year,this.month,this.day)}add(e){return vO(this,e)}subtract(e){return vO(this,vT(e))}set(e){return vR(this,e)}cycle(e,t,n){return vL(this,e,t,n)}toDate(e){return v2(this,e)}toString(){return vW(this)}compare(e){return wi(this,e)}}class vG{#t;constructor(e=0,t=0,n=0,r=0){this.hour=e,this.minute=t,this.second=n,this.millisecond=r,vN(this)}copy(){return new vG(this.hour,this.minute,this.second,this.millisecond)}add(e){return v$(this,e)}subtract(e){return v$(this,vT(e))}set(e){return vA(this,e)}cycle(e,t,n){return vF(this,e,t,n)}toString(){return vU(this)}compare(e){var t,n;return t=this,n=e,wa(t)-wa(n)}}class vq{#t;constructor(...e){let[t,n,r,o,i]=vz(e);this.calendar=t,this.era=n,this.year=r,this.month=o,this.day=i,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,vj(this)}copy(){return this.era?new vq(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new vq(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return vO(this,e)}subtract(e){return vO(this,vT(e))}set(e){return vR(vA(this,e),e)}cycle(e,t,n){switch(e){case"era":case"year":case"month":case"day":return vL(this,e,t,n);default:return vF(this,e,t,n)}}toDate(e,t){return v2(this,e,t)}toString(){return vK(this)}compare(e){var t,n;let r=wi(this,e);return 0===r?(t=this,n=v6(e),wa(t)-wa(n)):r}}class vZ{#t;constructor(...e){let[t,n,r,o,i]=vz(e),a=e.shift(),s=e.shift();this.calendar=t,this.era=n,this.year=r,this.month=o,this.day=i,this.timeZone=a,this.offset=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,vj(this)}copy(){return this.era?new vZ(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new vZ(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return vV(this,e)}subtract(e){return vV(this,vT(e))}set(e,t){let n,r;return 0===(r=vA(vR(n=v6(this),e),e)).compare(n)?this:v5(v4(v1(r,this.timeZone,t),this.timeZone),this.calendar)}cycle(e,t,n){return function(e,t,n,r){switch(t){case"hour":{let t=0,o=23;if(r?.hourCycle===12){let n=e.hour>=12;t=12*!!n,o=n?23:11}let i=v6(e),a=v5(vA(i,{hour:t}),new vD),s=[v1(a,e.timeZone,"earlier"),v1(a,e.timeZone,"later")].filter(t=>v4(t,e.timeZone).day===a.day)[0],l=v5(vA(i,{hour:o}),new vD),u=[v1(l,e.timeZone,"earlier"),v1(l,e.timeZone,"later")].filter(t=>v4(t,e.timeZone).day===l.day).pop(),c=vY(e)-e.offset,d=Math.floor(c/36e5),f=c%36e5;return v5(v4(c=36e5*vB(d,n,Math.floor(s/36e5),Math.floor(u/36e5),r?.round)+f,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return vF(e,t,n,r);case"era":case"year":case"month":case"day":return v5(v4(v1(vL(v6(e),t,n,r),e.timeZone),e.timeZone),e.calendar);default:throw Error("Unsupported field "+t)}}(this,e,t,n)}toDate(){var e;return e=this,new Date(vY(e)-e.offset)}toString(){var e;let t,n,r,o,i;return`${vK(this)}${t=0>Math.sign(e=this.offset)?"-":"+",n=Math.floor((e=Math.abs(e))/36e5),r=Math.floor(e%36e5/6e4),o=Math.floor(e%36e5%6e4/1e3),i=`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`,0!==o&&(i+=`:${String(o).padStart(2,"0")}`),i}[${this.timeZone}]`}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-(function(e,t){if(e instanceof vZ){var n,r;return e.timeZone===t?e:(n=e,r=t,v5(v4(vY(n)-n.offset,r),n.calendar))}return v4(v1(e,t,void 0),t)})(e,this.timeZone).toDate().getTime()}}function vY(e){return vJ(vx((e=v5(e,new vD)).era,e.year),e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function vJ(e,t,n,r,o,i,a){let s=new Date;return s.setUTCHours(r,o,i,a),s.setUTCFullYear(e,t-1,n),s.getTime()}function vQ(e,t){if("UTC"===t)return 0;if(e>0&&t===wl())return -6e4*new Date(e).getTimezoneOffset();let{year:n,month:r,day:o,hour:i,minute:a,second:s}=v0(e,t);return vJ(n,r,o,i,a,s,0)-1e3*Math.floor(e/1e3)}let vX=new Map;function v0(e,t){let n=vX.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),vX.set(t,n));let r=n.formatToParts(new Date(e)),o={};for(let e of r)"literal"!==e.type&&(o[e.type]=e.value);return{year:"BC"===o.era||"B"===o.era?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:"24"===o.hour?0:+o.hour,minute:+o.minute,second:+o.second}}function v1(e,t,n="compatible"){var r,o,i;let a=v6(e);if("UTC"===t)return vY(a);if(t===wl()&&"compatible"===n){a=v5(a,new vD);let e=new Date,t=vx(a.era,a.year);return e.setFullYear(t,a.month-1,a.day),e.setHours(a.hour,a.minute,a.second,a.millisecond),e.getTime()}let s=vY(a),l=vQ(s-864e5,t),u=vQ(s+864e5,t),c=(r=a,((o=s-l)==(i=s-u)?[o]:[o,i]).filter(e=>{var n;let o;return n=r,o=v0(e,t),n.year===o.year&&n.month===o.month&&n.day===o.day&&n.hour===o.hour&&n.minute===o.minute&&n.second===o.second}));if(1===c.length)return c[0];if(c.length>1)switch(n){case"compatible":case"earlier":return c[0];case"later":return c[c.length-1];case"reject":throw RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(s-l,s-u);case"compatible":case"later":return Math.max(s-l,s-u);case"reject":throw RangeError("No such absolute time found")}}function v2(e,t,n="compatible"){return new Date(v1(e,t,n))}function v4(e,t){let n=vQ(e,t),r=new Date(e+n),o=r.getUTCFullYear();return new vZ(o<1?"BC":"AD",o<1?-o+1:o,r.getUTCMonth()+1,r.getUTCDate(),t,n,r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds())}function v3(e){return new vH(e.calendar,e.era,e.year,e.month,e.day)}function v6(e,t){let n=0,r=0,o=0,i=0;if("timeZone"in e)({hour:n,minute:r,second:o,millisecond:i}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:o,millisecond:i}=t),new vq(e.calendar,e.era,e.year,e.month,e.day,n,r,o,i)}function v5(e,t){if(we(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,vj(r),r}let v7={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function v9(e,t){return t=v5(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function v8(e,t){return we(e.calendar,t.calendar)&&v9(e,t)}function we(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}let wt={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function wn(e,t,n){let r=Math.ceil(e.calendar.toJulianDay(e)+1-(n?wt[n]:function(e){let t=wp.get(e);if(!t){if(Intl.Locale){let n=new Intl.Locale(e);if("getWeekInfo"in n&&(t=n.getWeekInfo()))return wp.set(e,t),t.firstDay}let n=function(e){if(Intl.Locale){let t=wf.get(e);return!t&&(t=new Intl.Locale(e).maximize().region)&&wf.set(e,t),t}let t=e.split("-")[1];return"u"===t?void 0:t}(e);if(e.includes("-fw-")){let n=e.split("-fw-")[1].split("-")[0];t="mon"===n?{firstDay:1}:"tue"===n?{firstDay:2}:"wed"===n?{firstDay:3}:"thu"===n?{firstDay:4}:"fri"===n?{firstDay:5}:"sat"===n?{firstDay:6}:{firstDay:0}}else t=e.includes("-ca-iso8601")?{firstDay:1}:{firstDay:n&&v7[n]||0};wp.set(e,t)}return t.firstDay}(t)))%7;return r<0&&(r+=7),r}function wr(e){return v4(Date.now(),e)}function wo(e){return v3(wr(e))}function wi(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function wa(e){return 36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond}let ws=null;function wl(){return null==ws&&(ws=new Intl.DateTimeFormat().resolvedOptions().timeZone),ws}function wu(e){return e.subtract({days:e.day-1})}function wc(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function wd(e,t,n){let r=wn(e,t,n);return e.subtract({days:r})}let wf=new Map,wp=new Map;function wh(e,t,n){let r=e.calendar.getDaysInMonth(e);return Math.ceil((wn(wu(e),t,n)+r)/7)}function wm(e,t){return e&&t?0>=e.compare(t)?e:t:e||t}function wy(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}function wg(e){return e&&e.__esModule?e.default:e}let wb=new WeakMap;function wv(e){return e?.calendar.identifier==="gregory"&&"BC"===e.era?"short":void 0}function ww(e,t,n,r){let o=vb(wg(ve),"@react-aria/calendar"),i=wv(e)||wv(t),a=vl({month:"long",year:"numeric",era:i,calendar:e.calendar.identifier,timeZone:n}),s=vl({month:"long",year:"numeric",day:"numeric",era:i,calendar:e.calendar.identifier,timeZone:n});return(0,fZ.useMemo)(()=>{if(v9(e,wu(e))){let i=e,s=t;if(e.calendar.getFormattableMonth&&(i=e.calendar.getFormattableMonth(e)),t.calendar.getFormattableMonth&&(s=t.calendar.getFormattableMonth(t)),v9(t,wc(e)))return a.format(i.toDate(n));if(v9(t,wc(t)))return r?w_(a,o,i,s,n):a.formatRange(i.toDate(n),s.toDate(n))}return r?w_(s,o,e,t,n):s.formatRange(e.toDate(n),t.toDate(n))},[e,t,a,s,o,n,r])}function w_(e,t,n,r,o){let i=e.formatRangeToParts(n.toDate(o),r.toDate(o)),a=-1;for(let e=0;e<i.length;e++){let t=i[e];if("shared"===t.source&&"literal"===t.type)a=e;else if("endRange"===t.source)break}let s="",l="";for(let e=0;e<i.length;e++)e<a?s+=i[e].value:e>a&&(l+=i[e].value);return t.format("dateRange",{startDate:s,endDate:l})}function wx(e,t){let{id:n,"aria-label":r,"aria-labelledby":o}=e;return n=y4(n),o&&r?o=[...new Set([n,...o.trim().split(/\s+/)])].join(" "):o&&(o=o.trim().split(/\s+/).join(" ")),r||o||!t||(r=t),{id:n,"aria-label":r,"aria-labelledby":o}}function wS(e,t){let n=(0,fZ.useRef)(!0),r=(0,fZ.useRef)(null),o=bb(e);(0,fZ.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),(0,fZ.useEffect)(()=>{let e=r.current;n.current?n.current=!1:(!e||t.some((t,n)=>!Object.is(t,e[n])))&&o(),r.current=t},t)}function wE(e,t){var n;let r,o,i,a,s,l=vb((n=ve)&&n.__esModule?n.default:n,"@react-aria/calendar"),u=gh(e),c=ww(t.visibleRange.start,t.visibleRange.end,t.timeZone,!1),d=ww(t.visibleRange.start,t.visibleRange.end,t.timeZone,!0);wS(()=>{t.isFocused||b9(d)},[d]);let f=(i=vb(wg(ve),"@react-aria/calendar"),"highlightedRange"in t?{start:r,end:o}=t.highlightedRange||{}:r=o=t.value??void 0,a=vl({weekday:"long",month:"long",year:"numeric",day:"numeric",era:wv(r)||wv(o),timeZone:t.timeZone}),s="anchorDate"in t?t.anchorDate:null,(0,fZ.useMemo)(()=>{if(!s&&r&&o)if(v9(r,o)){let e=a.format(r.toDate(t.timeZone));return i.format("selectedDateDescription",{date:e})}else{let e=w_(a,i,r,o,t.timeZone);return i.format("selectedRangeDescription",{dateRange:e})}return""},[r,o,s,t.timeZone,i,a]));wS(()=>{f&&b9(f,"polite",4e3)},[f]);let p=y3([!!e.errorMessage,e.isInvalid,e.validationState]);wb.set(t,{ariaLabel:e["aria-label"],ariaLabelledBy:e["aria-labelledby"],errorMessageId:p,selectedDateDescription:f});let[h,m]=(0,fZ.useState)(!1),y=e.isDisabled||t.isNextVisibleRangeInvalid();y&&h&&(m(!1),t.setFocused(!0));let[g,b]=(0,fZ.useState)(!1),v=e.isDisabled||t.isPreviousVisibleRangeInvalid();return v&&g&&(b(!1),t.setFocused(!0)),{calendarProps:y5(u,wx({id:e.id,"aria-label":[e["aria-label"],d].filter(Boolean).join(", "),"aria-labelledby":e["aria-labelledby"]}),{role:"application","aria-details":e["aria-details"]||void 0,"aria-describedby":e["aria-describedby"]||void 0}),nextButtonProps:{onPress:()=>t.focusNextPage(),"aria-label":l.format("next"),isDisabled:y,onFocusChange:m},prevButtonProps:{onPress:()=>t.focusPreviousPage(),"aria-label":l.format("previous"),isDisabled:v,onFocusChange:b},errorMessageProps:{id:p},title:c}}let wD={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function wO(e){let{children:t,elementType:n="div",isFocusable:r,style:o,...i}=e,{visuallyHiddenProps:a}=function(e={}){let{style:t,isFocusable:n}=e,[r,o]=(0,fZ.useState)(!1),{focusWithinProps:i}=bR({isDisabled:!n,onFocusWithinChange:e=>o(e)}),a=(0,fZ.useMemo)(()=>r?t:t?{...wD,...t}:wD,[r]);return{visuallyHiddenProps:{...i,style:a}}}(e);return fY().createElement(n,y5(i,a),t)}function wk(e,t,n,r){let o=bb(n),i=null==n;(0,fZ.useEffect)(()=>{if(i||!e.current)return;let n=e.current;return n.addEventListener(t,o,r),()=>{n.removeEventListener(t,o,r)}},[e,t,r,i])}function wP(e,t){if(!e)return!1;let n=window.getComputedStyle(e),r=document.scrollingElement||document.documentElement,o=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return e===r&&"hidden"!==n.overflow&&(o=!0),o&&t&&(o=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),o}function wC(e,t){let n=e;for(wP(n,t)&&(n=n.parentElement);n&&!wP(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function wj(e,t){let n=[],r=document.scrollingElement||document.documentElement;do wP(e,t)&&n.push(e),e=e.parentElement;while(e&&e!==r);return n}function wT(e,t,n={}){let{block:r="nearest",inline:o="nearest"}=n;if(e===t)return;let i=e.scrollTop,a=e.scrollLeft,s=t.getBoundingClientRect(),l=e.getBoundingClientRect(),u=window.getComputedStyle(t),c=window.getComputedStyle(e),d=document.scrollingElement||document.documentElement,f=e===d?0:l.top,p=e===d?e.clientHeight:l.bottom,h=e===d?0:l.left,m=e===d?e.clientWidth:l.right,y=parseInt(u.scrollMarginTop,10)||0,g=parseInt(u.scrollMarginBottom,10)||0,b=parseInt(u.scrollMarginLeft,10)||0,v=parseInt(u.scrollMarginRight,10)||0,w=parseInt(c.scrollPaddingTop,10)||0,x=parseInt(c.scrollPaddingBottom,10)||0,S=parseInt(c.scrollPaddingLeft,10)||0,E=parseInt(c.scrollPaddingRight,10)||0,D=parseInt(c.borderTopWidth,10)||0,O=parseInt(c.borderBottomWidth,10)||0,k=parseInt(c.borderLeftWidth,10)||0,P=parseInt(c.borderRightWidth,10)||0,C=s.top-y,j=s.bottom+g,T=s.left-b,R=s.right+v,A=e===d?0:k+P,N=e===d?0:D+O,M=e.offsetWidth-e.clientWidth-A,I=e.offsetHeight-e.clientHeight-N,$=f+D+w,L=p-O-x-I,F=h+k+S,B=m-P-E;"rtl"!==c.direction||gB()?B-=M:F+=M;let V=C<$||j>L,U=T<F||R>B;if(V&&"start"===r)i+=C-$;else if(V&&"center"===r)i+=(C+j)/2-($+L)/2;else if(V&&"end"===r)i+=j-L;else if(V&&"nearest"===r){let e=C-$,t=j-L;i+=Math.abs(e)<=Math.abs(t)?e:t}if(U&&"start"===o)a+=T-F;else if(U&&"center"===o)a+=(T+R)/2-(F+B)/2;else if(U&&"end"===o)a+=R-B;else if(U&&"nearest"===o){let e=T-F,t=R-B;a+=Math.abs(e)<=Math.abs(t)?e:t}e.scrollTo({left:a,top:i})}function wR(e,t={}){let{containingElement:n}=t;if(e&&e.isConnected){let t=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(t).overflow){let{left:t,top:r}=e.getBoundingClientRect(),o=wj(e,!0);for(let t of o)wT(t,e);let{left:i,top:a}=e.getBoundingClientRect();if(Math.abs(t-i)>1||Math.abs(r-a)>1)for(let e of o=n?wj(n,!0):[])wT(e,n,{block:"center",inline:"center"})}else{let{left:t,top:r}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});let{left:o,top:i}=e.getBoundingClientRect();(Math.abs(t-o)>1||Math.abs(r-i)>1)&&(n?.scrollIntoView?.({block:"center",inline:"center"}),e.scrollIntoView?.({block:"nearest"}))}}}let wA=0,wN=new Map;function wM(e){let[t,n]=(0,fZ.useState)();return yz(()=>{if(!e)return;let t=wN.get(e);if(t)n(t.element.id);else{let r=`react-aria-description-${wA++}`;n(r);let o=document.createElement("div");o.id=r,o.style.display="none",o.textContent=e,document.body.appendChild(o),t={refCount:0,element:o},wN.set(e,t)}return t.refCount++,()=>{t&&0==--t.refCount&&(t.element.remove(),wN.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}class wI extends vD{fromJulianDay(e){let t=super.fromJulianDay(e);return new vH(this,vx(t.era,t.year)- -543,t.month,t.day)}toJulianDay(e){return super.toJulianDay(w$(e))}getEras(){return["BE"]}getDaysInMonth(e){return super.getDaysInMonth(w$(e))}balanceDate(){}constructor(...e){super(...e),this.identifier="buddhist"}}function w$(e){let[t,n]=vS(e.year+-543);return new vH(t,n,e.month,e.day)}function wL(e,t,n,r){return e+365*t+Math.floor(t/4)+30*(n-1)+r-1}function wF(e,t){let n=Math.floor(4*(t-e)/1461),r=1+Math.floor((t-wL(e,n,1,1))/30),o=t+1-wL(e,n,r,1);return[n,r,o]}function wB(e){return Math.floor(e%4/3)}function wV(e,t){return t%13!=0?30:wB(e)+5}class wU{fromJulianDay(e){let[t,n,r]=wF(1723856,e),o="AM";return t<=0&&(o="AA",t+=5500),new vH(this,o,t,n,r)}toJulianDay(e){let t=e.year;return"AA"===e.era&&(t-=5500),wL(1723856,t,e.month,e.day)}getDaysInMonth(e){return wV(e.year,e.month)}getMonthsInYear(){return 13}getDaysInYear(e){return 365+wB(e.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(e){return"AA"===e.era?9999:9991}getEras(){return["AA","AM"]}constructor(){this.identifier="ethiopic"}}class wW extends wU{fromJulianDay(e){let[t,n,r]=wF(1723856,e);return new vH(this,"AA",t+=5500,n,r)}getEras(){return["AA"]}getYearsInEra(){return 9999}constructor(...e){super(...e),this.identifier="ethioaa"}}class wK extends wU{fromJulianDay(e){let[t,n,r]=wF(1824665,e),o="CE";return t<=0&&(o="BCE",t=1-t),new vH(this,o,t,n,r)}toJulianDay(e){let t=e.year;return"BCE"===e.era&&(t=1-t),wL(1824665,t,e.month,e.day)}getDaysInMonth(e){let t=e.year;return"BCE"===e.era&&(t=1-t),wV(t,e.month)}isInverseEra(e){return"BCE"===e.era}balanceDate(e){e.year<=0&&(e.era="BCE"===e.era?"CE":"BCE",e.year=1-e.year)}getEras(){return["BCE","CE"]}getYearsInEra(e){return"BCE"===e.era?9999:9715}constructor(...e){super(...e),this.identifier="coptic"}}let wz=765433;function wH(e){return 7>vv(7*e+1,19)}function wG(e){let t=Math.floor((235*e-234)/19),n=29*t+Math.floor((12084+13753*t)/25920);return 3>vv(3*(n+1),7)&&(n+=1),n}function wq(e){let t,n;return wG(e)+(t=wG(e-1),n=wG(e),wG(e+1)-n==356?2:+(n-t==382))}function wZ(e){return wq(e+1)-wq(e)}function wY(e,t){if(t>=6&&!wH(e)&&t++,4===t||7===t||9===t||11===t||13===t)return 29;let n=function(e){let t=wZ(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}(e);return 2===t?2===n?30:29:3===t?0===n?29:30:6===t?30*!!wH(e):30}class wJ{fromJulianDay(e){let t=e-347997,n=Math.floor((25920*t/wz*19+234)/235)+1,r=wq(n),o=Math.floor(t-r);for(;o<1;)o=Math.floor(t-(r=wq(--n)));let i=1,a=0;for(;a<o;)a+=wY(n,i),i++;let s=o-(a-=wY(n,--i));return new vH(this,n,i,s)}toJulianDay(e){let t=wq(e.year);for(let n=1;n<e.month;n++)t+=wY(e.year,n);return t+e.day+347997}getDaysInMonth(e){return wY(e.year,e.month)}getMonthsInYear(e){return wH(e.year)?13:12}getDaysInYear(e){return wZ(e.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9999}getEras(){return["AM"]}balanceYearMonth(e,t){t.year!==e.year&&(wH(t.year)&&!wH(e.year)&&t.month>6?e.month--:!wH(t.year)&&wH(e.year)&&t.month>6&&e.month++)}constructor(){this.identifier="hebrew"}}class wQ extends vD{fromJulianDay(e){let t,n,r,o=super.fromJulianDay(e),i=o.year-78,a=e-vw(o.era,o.year,1,1);if(a<80?(i--,a+=(t=v_(o.year-1)?31:30)+155+90+10):(t=v_(o.year)?31:30,a-=80),a<t)n=1,r=a+1;else{let e=a-t;e<155?(n=Math.floor(e/31)+2,r=e%31+1):(e-=155,n=Math.floor(e/30)+7,r=e%30+1)}return new vH(this,i,n,r)}toJulianDay(e){let t,n,[r,o]=vS(e.year+78);return(v_(o)?(t=31,n=vw(r,o,3,21)):(t=30,n=vw(r,o,3,22)),1===e.month)?n+e.day-1:(n+=t+31*Math.min(e.month-2,5),e.month>=8&&(n+=(e.month-7)*30),n+=e.day-1)}getDaysInMonth(e){return 1===e.month&&v_(e.year+78)||e.month>=2&&e.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return["saka"]}balanceDate(){}constructor(...e){super(...e),this.identifier="indian"}}function wX(e,t,n,r){return r+Math.ceil(29.5*(n-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function w0(e,t,n){let r=Math.floor((30*(n-t)+10646)/10631),o=Math.min(12,Math.ceil((n-(29+wX(t,r,1,1)))/29.5)+1),i=n-wX(t,r,o,1)+1;return new vH(e,r,o,i)}function w1(e){return(14+11*e)%30<11}class w2{fromJulianDay(e){return w0(this,1948440,e)}toJulianDay(e){return wX(1948440,e.year,e.month,e.day)}getDaysInMonth(e){let t=29+e.month%2;return 12===e.month&&w1(e.year)&&t++,t}getMonthsInYear(){return 12}getDaysInYear(e){return w1(e.year)?355:354}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9665}getEras(){return["AH"]}constructor(){this.identifier="islamic-civil"}}class w4 extends w2{fromJulianDay(e){return w0(this,1948439,e)}toJulianDay(e){return wX(1948439,e.year,e.month,e.day)}constructor(...e){super(...e),this.identifier="islamic-tbla"}}function w3(e){return 460322+c[e-1300]}function w6(e,t){return(u[e-1300]&1<<11-(t-1))==0?29:30}function w5(e,t){let n=w3(e);for(let r=1;r<t;r++)n+=w6(e,r);return n}function w7(e){return c[e+1-1300]-c[e-1300]}class w9 extends w2{constructor(){if(super(),this.identifier="islamic-umalqura",u||(u=new Uint16Array(Uint8Array.from(atob("qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI="),e=>e.charCodeAt(0)).buffer)),!c){c=new Uint32Array(301);let e=0;for(let t=1300;t<=1600;t++){c[t-1300]=e;for(let n=1;n<=12;n++)e+=w6(t,n)}}}fromJulianDay(e){let t=e-1948440,n=w3(1300),r=w3(1600);if(t<n||t>r)return super.fromJulianDay(e);{let e=1299,n=1,r=1;for(;r>0;){r=t-w3(++e)+1;let o=w7(e);if(r===o){n=12;break}if(r<o){let t=w6(e,n);for(n=1;r>t;)r-=t,t=w6(e,++n);break}}return new vH(this,e,n,t-w5(e,n)+1)}}toJulianDay(e){return e.year<1300||e.year>1600?super.toJulianDay(e):1948440+w5(e.year,e.month)+(e.day-1)}getDaysInMonth(e){return e.year<1300||e.year>1600?super.getDaysInMonth(e):w6(e.year,e.month)}getDaysInYear(e){return e.year<1300||e.year>1600?super.getDaysInYear(e):w7(e.year)}}let w8=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],_e=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],_t=[1867,1911,1925,1988,2018],_n=["meiji","taisho","showa","heisei","reiwa"];function _r(e){let t=w8.findIndex(([t,n,r])=>!!(e.year<t)||e.year===t&&!!(e.month<n)||e.year===t&&e.month===n&&!!(e.day<r));return -1===t?w8.length-1:0===t?0:t-1}function _o(e){let t=_t[_n.indexOf(e.era)];if(!t)throw Error("Unknown era: "+e.era);return new vH(e.year+t,e.month,e.day)}class _i extends vD{fromJulianDay(e){let t=super.fromJulianDay(e),n=_r(t);return new vH(this,_n[n],t.year-_t[n],t.month,t.day)}toJulianDay(e){return super.toJulianDay(_o(e))}balanceDate(e){let t=_o(e),n=_r(t);_n[n]!==e.era&&(e.era=_n[n],e.year=t.year-_t[n]),this.constrainDate(e)}constrainDate(e){let t=_n.indexOf(e.era),n=_e[t];if(null!=n){let[r,o,i]=n,a=r-_t[t];e.year=Math.max(1,Math.min(a,e.year)),e.year===a&&(e.month=Math.min(o,e.month),e.month===o&&(e.day=Math.min(i,e.day)))}if(1===e.year&&t>=0){let[,n,r]=w8[t];e.month=Math.max(n,e.month),e.month===n&&(e.day=Math.max(r,e.day))}}getEras(){return _n}getYearsInEra(e){let t=_n.indexOf(e.era),n=w8[t],r=w8[t+1];if(null==r)return 9999-n[0]+1;let o=r[0]-n[0];return(e.month<r[1]||e.month===r[1]&&e.day<r[2])&&o++,o}getDaysInMonth(e){return super.getDaysInMonth(_o(e))}getMinimumMonthInYear(e){let t=_a(e);return t?t[1]:1}getMinimumDayInMonth(e){let t=_a(e);return t&&e.month===t[1]?t[2]:1}constructor(...e){super(...e),this.identifier="japanese"}}function _a(e){if(1===e.year)return w8[_n.indexOf(e.era)]}let _s=[0,31,62,93,124,155,186,216,246,276,306,336];class _l{fromJulianDay(e){let t=e-1948320,n=1+Math.floor((33*t+3)/12053),r=t-(365*(n-1)+Math.floor((8*n+21)/33)),o=r<216?Math.floor(r/31):Math.floor((r-6)/30),i=r-_s[o]+1;return new vH(this,n,o+1,i)}toJulianDay(e){let t=1948319+365*(e.year-1)+Math.floor((8*e.year+21)/33);return t+=_s[e.month-1],t+=e.day}getMonthsInYear(){return 12}getDaysInMonth(e){return e.month<=6?31:e.month<=11||8>vv(25*e.year+11,33)?30:29}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getEras(){return["AP"]}getYearsInEra(){return 9377}constructor(){this.identifier="persian"}}function _u(e){return"minguo"===e.era?e.year+1911:1-e.year+1911}function _c(e){let t=e-1911;return t>0?["minguo",t]:["before_minguo",1-t]}class _d extends vD{fromJulianDay(e){let t=super.fromJulianDay(e),[n,r]=_c(vx(t.era,t.year));return new vH(this,n,r,t.month,t.day)}toJulianDay(e){return super.toJulianDay(_f(e))}getEras(){return["before_minguo","minguo"]}balanceDate(e){let[t,n]=_c(_u(e));e.era=t,e.year=n}isInverseEra(e){return"before_minguo"===e.era}getDaysInMonth(e){return super.getDaysInMonth(_f(e))}getYearsInEra(e){return"before_minguo"===e.era?9999:8088}constructor(...e){super(...e),this.identifier="roc"}}function _f(e){let[t,n]=vS(_u(e));return new vH(t,n,e.month,e.day)}function _p(e){switch(e){case"buddhist":return new wI;case"ethiopic":return new wU;case"ethioaa":return new wW;case"coptic":return new wK;case"hebrew":return new wJ;case"indian":return new wQ;case"islamic-civil":return new w2;case"islamic-tbla":return new w4;case"islamic-umalqura":return new w9;case"japanese":return new _i;case"persian":return new _l;case"roc":return new _d;default:return new vD}}function _h(e,t,n){return null!=t&&0>e.compare(t)||null!=n&&e.compare(n)>0}function _m(e,t,n,r,o){let i={};for(let e in t)i[e]=Math.floor(t[e]/2),i[e]>0&&t[e]%2==0&&i[e]--;let a=_y(e,t,n).subtract(i);return _b(e,a,t,n,r,o)}function _y(e,t,n,r,o){let i=e;if(t.years)i=wu(e.subtract({months:e.month-1}));else t.months?i=wu(e):t.weeks&&(i=wd(e,n));return _b(e,i,t,n,r,o)}function _g(e,t,n,r,o){let i={...t};i.days?i.days--:i.weeks?i.weeks--:i.months?i.months--:i.years&&i.years--;let a=_y(e,t,n).subtract(i);return _b(e,a,t,n,r,o)}function _b(e,t,n,r,o,i){if(o&&e.compare(o)>=0){let e=wy(t,_y(v3(o),n,r));e&&(t=e)}if(i&&0>=e.compare(i)){let e=wm(t,_g(v3(i),n,r));e&&(t=e)}return t}function _v(e,t,n){if(t){let n=wy(e,v3(t));n&&(e=n)}if(n){let t=wm(e,v3(n));t&&(e=t)}return e}function _w(e,t,n){if(!n)return e;for(;e.compare(t)>=0&&n(e);)e=e.subtract({days:1});return e.compare(t)>=0?e:null}let __="u">typeof document?fY().useInsertionEffect??fY().useLayoutEffect:()=>{};function _x(e,t,n){let[r,o]=(0,fZ.useState)(e||t),i=(0,fZ.useRef)(r),a=(0,fZ.useRef)(void 0!==e),s=void 0!==e;(0,fZ.useEffect)(()=>{a.current,a.current=s},[s]);let l=s?e:r;__(()=>{i.current=l});let[,u]=(0,fZ.useReducer)(()=>({}),{});return[l,(0,fZ.useCallback)((e,...t)=>{let r="function"==typeof e?e(i.current):e;Object.is(i.current,r)||(i.current=r,o(r),u(),n?.(r,...t))},[n])]}function _S(e){let t=(0,fZ.useMemo)(()=>new vr(e.locale),[e.locale]),n=(0,fZ.useMemo)(()=>t.resolvedOptions(),[t]),{locale:r,createCalendar:o,visibleDuration:i={months:1},minValue:a,maxValue:s,selectionAlignment:l,isDateUnavailable:u,pageBehavior:c="visible",firstDayOfWeek:d}=e,f=(0,fZ.useMemo)(()=>o(n.calendar),[o,n.calendar]),[p,h]=_x(e.value,e.defaultValue??null,e.onChange),m=(0,fZ.useMemo)(()=>p?v5(v3(p),f):null,[p,f]),y=(0,fZ.useMemo)(()=>p&&"timeZone"in p?p.timeZone:n.timeZone,[p,n.timeZone]),[g,b]=_x((0,fZ.useMemo)(()=>e.focusedValue?_v(v5(v3(e.focusedValue),f),a,s):void 0,[e.focusedValue,f,a,s]),(0,fZ.useMemo)(()=>_v(e.defaultFocusedValue?v5(v3(e.defaultFocusedValue),f):m||v5(wo(y),f),a,s),[e.defaultFocusedValue,m,y,f,a,s]),e.onFocusChange),[v,w]=(0,fZ.useState)(()=>{switch(l){case"start":return _y(g,i,r,a,s);case"end":return _g(g,i,r,a,s);default:return _m(g,i,r,a,s)}}),[x,S]=(0,fZ.useState)(e.autoFocus||!1),E=(0,fZ.useMemo)(()=>{let e={...i};return e.days?e.days--:e.days=-1,v.add(e)},[v,i]),[D,O]=(0,fZ.useState)(f);if(!we(f,D)){let e=v5(g,f);w(_m(e,i,r,a,s)),b(e),O(f)}function k(e){b(e=_v(e,a,s))}function P(t){if(!e.isDisabled&&!e.isReadOnly){let e=t;if(null===e)return void h(null);(e=_w(e=_v(e,a,s),v,u))&&(e=v5(e,p?.calendar||new vD),p&&"hour"in p?h(p.set(e)):h(e))}}_h(g,a,s)?b(_v(g,a,s)):0>g.compare(v)?w(_g(g,i,r,a,s)):g.compare(E)>0&&w(_y(g,i,r,a,s));let C=(0,fZ.useMemo)(()=>!!m&&(!!(u&&u(m))||_h(m,a,s)),[m,u,a,s]),j=e.isInvalid||"invalid"===e.validationState||C,T=(0,fZ.useMemo)(()=>"visible"===c?i:_E(i),[c,i]);return{isDisabled:e.isDisabled??!1,isReadOnly:e.isReadOnly??!1,value:m,setValue:P,visibleRange:{start:v,end:E},minValue:a,maxValue:s,focusedDate:g,timeZone:y,validationState:j?"invalid":null,isValueInvalid:j,setFocusedDate(e){k(e)},focusNextDay(){k(g.add({days:1}))},focusPreviousDay(){k(g.subtract({days:1}))},focusNextRow(){i.days?this.focusNextPage():(i.weeks||i.months||i.years)&&k(g.add({weeks:1}))},focusPreviousRow(){i.days?this.focusPreviousPage():(i.weeks||i.months||i.years)&&k(g.subtract({weeks:1}))},focusNextPage(){let e=v.add(T);b(_v(g.add(T),a,s)),w(_y(_b(g,e,T,r,a,s),T,r))},focusPreviousPage(){let e=v.subtract(T);b(_v(g.subtract(T),a,s)),w(_y(_b(g,e,T,r,a,s),T,r))},focusSectionStart(){i.days?k(v):i.weeks?k(wd(g,r)):(i.months||i.years)&&k(wu(g))},focusSectionEnd(){i.days?k(E):i.weeks?k(wd(g,r,void 0).add({days:6})):(i.months||i.years)&&k(wc(g))},focusNextSection(e){e||i.days?i.days?this.focusNextPage():i.weeks?k(g.add({months:1})):(i.months||i.years)&&k(g.add({years:1})):k(g.add(_E(i)))},focusPreviousSection(e){e||i.days?i.days?this.focusPreviousPage():i.weeks?k(g.subtract({months:1})):(i.months||i.years)&&k(g.subtract({years:1})):k(g.subtract(_E(i)))},selectFocusedDate(){u&&u(g)||P(g)},selectDate(e){P(e)},isFocused:x,setFocused:S,isInvalid:e=>_h(e,a,s),isSelected(e){return null!=m&&v9(e,m)&&!this.isCellDisabled(e)&&!this.isCellUnavailable(e)},isCellFocused:e=>x&&g&&v9(e,g),isCellDisabled(t){return e.isDisabled||0>t.compare(v)||t.compare(E)>0||this.isInvalid(t)},isCellUnavailable:t=>!!e.isDateUnavailable&&e.isDateUnavailable(t),isPreviousVisibleRangeInvalid(){let e=v.subtract({days:1});return v9(e,v)||this.isInvalid(e)},isNextVisibleRangeInvalid(){let e=E.add({days:1});return v9(e,E)||this.isInvalid(e)},getDatesInWeek(e,t=v){let n=t.add({weeks:e}),o=[],i=wn(n=wd(n,r,d),r,d);for(let e=0;e<i;e++)o.push(null);for(;o.length<7;){o.push(n);let e=n.add({days:1});if(v9(n,e))break;n=e}for(;o.length<7;)o.push(null);return o}}}function _E(e){let t={...e};for(let n in e)t[n]=1;return t}function _D(e,t){return e&&t?(0>t.compare(e)&&([e,t]=[t,e]),{start:v3(e),end:v3(t)}):null}function _O(e,t){return(e=v5(e,t?.calendar||new vD),t&&"hour"in t)?t.set(e):e}function _k(e,t,n){let r=e.add({days:n});for(;(n<0?r.compare(t.visibleRange.start)>=0:0>=r.compare(t.visibleRange.end))&&!t.isCellUnavailable(r);)r=r.add({days:n});if(t.isCellUnavailable(r))return r.add({days:-n})}let _P=(0,fZ.createContext)(null),_C=(0,fZ.createContext)(null),_j=(0,fZ.createContext)(null),_T=(0,fZ.createContext)(null),_R=(0,fZ.forwardRef)(function(e,t){[e,t]=gt(e,t,_P);let{locale:n}=b5(),r=_S({...e,locale:n,createCalendar:_p}),{calendarProps:o,prevButtonProps:i,nextButtonProps:a,errorMessageProps:s,title:l}=wE(e,r),u=y8({...e,values:{state:r,isDisabled:e.isDisabled||!1,isInvalid:r.isValueInvalid},defaultClassName:"react-aria-Calendar"});return fY().createElement("div",{...u,...o,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":r.isValueInvalid||void 0},fY().createElement(y9,{values:[[bU,{slots:{previous:i,next:a}}],[bK,{"aria-hidden":!0,level:2,children:l}],[_j,r],[_P,e],[bz,{slots:{errorMessage:s}}]]},fY().createElement(wO,null,fY().createElement("h2",null,o["aria-label"])),u.children,fY().createElement(wO,null,fY().createElement("button",{"aria-label":a["aria-label"],disabled:a.isDisabled,onClick:()=>r.focusNextPage(),tabIndex:-1}))))}),_A=(0,fZ.forwardRef)(function(e,t){[e,t]=gt(e,t,_C);let{locale:n}=b5(),r=function(e){let{value:t,defaultValue:n,onChange:r,createCalendar:o,locale:i,visibleDuration:a={months:1},minValue:s,maxValue:l,...u}=e,[c,d]=_x(t,n||null,r),[f,p]=(0,fZ.useState)(null),h="center";if(c&&c.start&&c.end){let e=_m(v3(c.start),a,i,s,l).add(a).subtract({days:1});c.end.compare(e)>0&&(h="start")}let m=(0,fZ.useRef)(null),[y,g]=(0,fZ.useState)(null),b=(0,fZ.useMemo)(()=>wy(s,y?.start),[s,y]),v=(0,fZ.useMemo)(()=>wm(l,y?.end),[l,y]),w=_S({...u,value:c&&c.start,createCalendar:o,locale:i,visibleDuration:a,minValue:b,maxValue:v,selectionAlignment:e.selectionAlignment||h}),x=t=>{t&&e.isDateUnavailable&&!e.allowsNonContiguousRanges?(m.current={start:_k(t,w,-1),end:_k(t,w,1)},g(m.current)):(m.current=null,g(null))},[S,E]=(0,fZ.useState)(w.visibleRange);v8(w.visibleRange.start,S.start)&&v8(w.visibleRange.end,S.end)||(x(f),E(w.visibleRange));let D=e=>{e?(p(e),x(e)):(p(null),x(null))},O=f?_D(f,w.focusedDate):c&&_D(c.start,c.end),k=t=>{if(e.isReadOnly)return;let n=_w(_v(t,b,v),w.visibleRange.start,e.isDateUnavailable);if(n)if(f){let e=_D(f,n);e&&d({start:_O(e.start,c?.start),end:_O(e.end,c?.end)}),D(null)}else D(n)},[P,C]=(0,fZ.useState)(!1),{isDateUnavailable:j}=e,T=(0,fZ.useMemo)(()=>!!c&&!f&&(!!(j&&(j(c.start)||j(c.end)))||_h(c.start,s,l)||_h(c.end,s,l)),[j,c,f,s,l]),R=e.isInvalid||"invalid"===e.validationState||T;return{...w,value:c,setValue:d,anchorDate:f,setAnchorDate:D,highlightedRange:O,validationState:R?"invalid":null,isValueInvalid:R,selectFocusedDate(){k(w.focusedDate)},selectDate:k,highlightDate(e){f&&w.setFocusedDate(e)},isSelected:e=>!!(O&&e.compare(O.start)>=0&&0>=e.compare(O.end)&&!w.isCellDisabled(e)&&!w.isCellUnavailable(e)),isInvalid:e=>w.isInvalid(e)||_h(e,m.current?.start,m.current?.end),isDragging:P,setDragging:C,clearSelection(){D(null),d(null)}}}({...e,locale:n,createCalendar:_p}),{calendarProps:o,prevButtonProps:i,nextButtonProps:a,errorMessageProps:s,title:l}=function(e,t,n){let{commitBehavior:r="select",...o}=e,i=wE(o,t),a=(0,fZ.useRef)(!1),s=(0,fZ.useRef)("u">typeof window?window:null);wk(s,"pointerdown",e=>{a.current=0===e.width&&0===e.height});let l={clear:()=>t.clearSelection(),reset:()=>t.setAnchorDate(null),select:()=>t.selectFocusedDate()};return wk(s,"pointerup",e=>{if(a.current){a.current=!1;return}if(t.setDragging(!1),!t.anchorDate)return;let o=e.target;n.current&&g_(n.current)&&(!gv(n.current,o)||!o.closest('button, [role="button"]'))&&l[r]()}),i.calendarProps.onBlur=e=>{n.current&&(e.relatedTarget&&gv(n.current,e.relatedTarget)||!t.anchorDate||l[r]())},wk(n,"touchmove",e=>{t.isDragging&&e.preventDefault()},{passive:!1,capture:!0}),i}(e,r,t),u=y8({...e,values:{state:r,isDisabled:e.isDisabled||!1,isInvalid:r.isValueInvalid},defaultClassName:"react-aria-RangeCalendar"});return fY().createElement("div",{...u,...o,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":r.isValueInvalid||void 0},fY().createElement(y9,{values:[[bU,{slots:{previous:i,next:a}}],[bK,{"aria-hidden":!0,level:2,children:l}],[_T,r],[_C,e],[bz,{slots:{errorMessage:s}}]]},fY().createElement(wO,null,fY().createElement("h2",null,o["aria-label"])),u.children,fY().createElement(wO,null,fY().createElement("button",{"aria-label":a["aria-label"],disabled:a.isDisabled,onClick:()=>r.focusNextPage(),tabIndex:-1}))))}),_N=(0,fZ.createContext)(null),_M=(0,fZ.forwardRef)(function(e,t){var n,r;let o=(0,fZ.useContext)(_j),i=(0,fZ.useContext)(_T),a=ge(_P),s=ge(_C),l=null!=o?o:i,u=l.visibleRange.start;e.offset&&(u=u.add(e.offset));let c=null!=(n=null==a?void 0:a.firstDayOfWeek)?n:null==s?void 0:s.firstDayOfWeek,{gridProps:d,headerProps:f,weekDays:p}=function(e,t){let{startDate:n=t.visibleRange.start,endDate:r=t.visibleRange.end,firstDayOfWeek:o}=e,{direction:i}=b5(),a=ww(n,r,t.timeZone,!0),{ariaLabel:s,ariaLabelledBy:l}=wb.get(t),u=wx({"aria-label":[s,a].filter(Boolean).join(", "),"aria-labelledby":l}),c=vl({weekday:e.weekdayStyle||"narrow",timeZone:t.timeZone}),{locale:d}=b5(),f=(0,fZ.useMemo)(()=>{let e=wd(wo(t.timeZone),d,o);return[...Array(7).keys()].map(n=>{let r=e.add({days:n}).toDate(t.timeZone);return c.format(r)})},[d,t.timeZone,c,o]),p=wh(n,d,o);return{gridProps:y5(u,{role:"grid","aria-readonly":t.isReadOnly||void 0,"aria-disabled":t.isDisabled||void 0,"aria-multiselectable":"highlightedRange"in t||void 0,onKeyDown:e=>{switch(e.key){case"Enter":case" ":e.preventDefault(),t.selectFocusedDate();break;case"PageUp":e.preventDefault(),e.stopPropagation(),t.focusPreviousSection(e.shiftKey);break;case"PageDown":e.preventDefault(),e.stopPropagation(),t.focusNextSection(e.shiftKey);break;case"End":e.preventDefault(),e.stopPropagation(),t.focusSectionEnd();break;case"Home":e.preventDefault(),e.stopPropagation(),t.focusSectionStart();break;case"ArrowLeft":e.preventDefault(),e.stopPropagation(),"rtl"===i?t.focusNextDay():t.focusPreviousDay();break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),t.focusPreviousRow();break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),"rtl"===i?t.focusPreviousDay():t.focusNextDay();break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),t.focusNextRow();break;case"Escape":"setAnchorDate"in t&&(e.preventDefault(),t.setAnchorDate(null))}},onFocus:()=>t.setFocused(!0),onBlur:()=>t.setFocused(!1)}),headerProps:{"aria-hidden":!0},weekDays:f,weeksInMonth:p}}({startDate:u,endDate:wc(u),weekdayStyle:e.weekdayStyle,firstDayOfWeek:c},l);return fY().createElement(_N.Provider,{value:{headerProps:f,weekDays:p,startDate:u,firstDayOfWeek:c}},fY().createElement("table",{...gh(e),...d,ref:t,style:e.style,className:null!=(r=e.className)?r:"react-aria-CalendarGrid"},"function"!=typeof e.children?e.children:fY().createElement(fY().Fragment,null,fY().createElement(_I,null,e=>fY().createElement(_$,null,e)),fY().createElement(_L,null,e.children))))}),_I=(0,fZ.forwardRef)(function(e,t){let{children:n,style:r,className:o}=e,{headerProps:i,weekDays:a}=(0,fZ.useContext)(_N);return fY().createElement("thead",{...gh(e),...i,ref:t,style:r,className:o||"react-aria-CalendarGridHeader"},fY().createElement("tr",null,a.map((e,t)=>fY().cloneElement(n(e),{key:t}))))}),_$=(0,fZ.forwardRef)(function(e,t){let{children:n,style:r,className:o}=e;return fY().createElement("th",{...gh(e),ref:t,style:r,className:o||"react-aria-CalendarHeaderCell"},n)}),_L=(0,fZ.forwardRef)(function(e,t){let{children:n,style:r,className:o}=e,i=(0,fZ.useContext)(_j),a=(0,fZ.useContext)(_T),s=null!=i?i:a,{startDate:l,firstDayOfWeek:u}=(0,fZ.useContext)(_N),{locale:c}=b5(),d=wh(l,c,u);return fY().createElement("tbody",{...gh(e),ref:t,style:r,className:o||"react-aria-CalendarGridBody"},[...Array(d).keys()].map(e=>fY().createElement("tr",{key:e},s.getDatesInWeek(e,l).map((e,t)=>e?fY().cloneElement(n(e),{key:t}):fY().createElement("td",{key:t})))))}),_F=(0,fZ.forwardRef)(function({date:e,...t},n){var r,o,i;let a=(0,fZ.useContext)(_j),s=(0,fZ.useContext)(_T),l=null!=a?a:s,{startDate:u}=null!=(r=(0,fZ.useContext)(_N))?r:{startDate:l.visibleRange.start},c=(0,fZ.useRef)(null),{cellProps:d,buttonProps:f,...p}=function(e,t,n){var r;let o,{date:i,isDisabled:a}=e,{errorMessageId:s,selectedDateDescription:l}=wb.get(t),u=vb((r=ve)&&r.__esModule?r.default:r,"@react-aria/calendar"),c=vl({weekday:"long",day:"numeric",month:"long",year:"numeric",era:wv(i),timeZone:t.timeZone}),d=t.isSelected(i),f=t.isCellFocused(i)&&!e.isOutsideMonth;a=a||t.isCellDisabled(i);let p=t.isCellUnavailable(i),h=!a&&!p,m=t.isValueInvalid&&!!("highlightedRange"in t?!t.anchorDate&&t.highlightedRange&&i.compare(t.highlightedRange.start)>=0&&0>=i.compare(t.highlightedRange.end):t.value&&v9(t.value,i));m&&(d=!0),i=vt(i,v8);let y=(0,fZ.useMemo)(()=>i.toDate(t.timeZone),[i,t.timeZone]),g=v9(i,wo(t.timeZone)),b=(0,fZ.useMemo)(()=>{let e="";return"highlightedRange"in t&&t.value&&!t.anchorDate&&(v9(i,t.value.start)||v9(i,t.value.end))&&(e=l+", "),e+=c.format(y),g?e=u.format(d?"todayDateSelected":"todayDate",{date:e}):d&&(e=u.format("dateSelected",{date:e})),t.minValue&&v9(i,t.minValue)?e+=", "+u.format("minimumDate"):t.maxValue&&v9(i,t.maxValue)&&(e+=", "+u.format("maximumDate")),e},[c,y,u,d,g,i,t,l]),v="";"anchorDate"in t&&f&&!t.isReadOnly&&h&&(v=t.anchorDate?u.format("finishRangeSelectionPrompt"):u.format("startRangeSelectionPrompt"));let w=wM(v),x=(0,fZ.useRef)(!1),S=(0,fZ.useRef)(!1),E=(0,fZ.useRef)(void 0),{pressProps:D,isPressed:O}=bD({shouldCancelOnPointerExit:"anchorDate"in t&&!!t.anchorDate,preventFocusOnPress:!0,isDisabled:!h||t.isReadOnly,onPressStart(e){if(t.isReadOnly){t.setFocusedDate(i),t.setFocused(!0);return}if("highlightedRange"in t&&!t.anchorDate&&("mouse"===e.pointerType||"touch"===e.pointerType)){if(t.highlightedRange&&!m){if(v9(i,t.highlightedRange.start)){t.setAnchorDate(t.highlightedRange.end),t.setFocusedDate(i),t.setFocused(!0),t.setDragging(!0),S.current=!0;return}else if(v9(i,t.highlightedRange.end)){t.setAnchorDate(t.highlightedRange.start),t.setFocusedDate(i),t.setFocused(!0),t.setDragging(!0),S.current=!0;return}}let n=()=>{t.setDragging(!0),E.current=void 0,t.selectDate(i),t.setFocusedDate(i),t.setFocused(!0),x.current=!0};"touch"===e.pointerType?E.current=setTimeout(n,200):n()}},onPressEnd(){S.current=!1,x.current=!1,clearTimeout(E.current),E.current=void 0},onPress(){"anchorDate"in t||t.isReadOnly||(t.selectDate(i),t.setFocusedDate(i),t.setFocused(!0))},onPressUp(e){if(!t.isReadOnly&&("anchorDate"in t&&E.current&&(t.selectDate(i),t.setFocusedDate(i),t.setFocused(!0)),"anchorDate"in t))if(S.current)t.setAnchorDate(i);else if(t.anchorDate&&!x.current)t.selectDate(i),t.setFocusedDate(i),t.setFocused(!0);else if("keyboard"!==e.pointerType||t.anchorDate)"virtual"===e.pointerType&&(t.selectDate(i),t.setFocusedDate(i),t.setFocused(!0));else{t.selectDate(i);let e=i.add({days:1});t.isInvalid(e)&&(e=i.subtract({days:1})),t.isInvalid(e)||(t.setFocusedDate(e),t.setFocused(!0))}}});a||(o=v9(i,t.focusedDate)?0:-1),(0,fZ.useEffect)(()=>{f&&n.current&&(gm(n.current),"pointer"!==gG&&((e=document)=>e.activeElement)()===n.current&&wR(n.current,{containingElement:wC(n.current)}))},[f,n]);let k=vl({day:"numeric",timeZone:t.timeZone,calendar:i.calendar.identifier}),P=(0,fZ.useMemo)(()=>k.formatToParts(y).find(e=>"day"===e.type).value,[k,y]);return{cellProps:{role:"gridcell","aria-disabled":!h||void 0,"aria-selected":d||void 0,"aria-invalid":m||void 0},buttonProps:y5(D,{onFocus(){a||(t.setFocusedDate(i),t.setFocused(!0))},tabIndex:o,role:"button","aria-disabled":!h||void 0,"aria-label":b,"aria-invalid":m||void 0,"aria-describedby":[m?s:void 0,w["aria-describedby"]].filter(Boolean).join(" ")||void 0,onPointerEnter(e){"highlightDate"in t&&("touch"!==e.pointerType||t.isDragging)&&h&&t.highlightDate(i)},onPointerDown(e){let t=gw(e);t instanceof HTMLElement&&"releasePointerCapture"in t&&("hasPointerCapture"in t?t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId):t.releasePointerCapture(e.pointerId))},onContextMenu(e){e.preventDefault()}}),isPressed:O,isFocused:f,isSelected:d,isDisabled:a,isUnavailable:p,isOutsideVisibleRange:0>i.compare(t.visibleRange.start)||i.compare(t.visibleRange.end)>0,isInvalid:m,formattedDate:P}}({date:e},l,c),{hoverProps:h,isHovered:m}=bL({...t,isDisabled:p.isDisabled}),{focusProps:y,isFocusVisible:g}=bA();g&&(g=p.isFocused);let b=(o=u,i=v5(i=e,o.calendar),o=wu(o),i=wu(i),o.era!==i.era||o.year!==i.year||o.month!==i.month),v=!1,w=!1;"highlightedRange"in l&&l.highlightedRange&&(v=v9(e,l.highlightedRange.start),w=v9(e,l.highlightedRange.end));let x=y8({...t,defaultChildren:p.formattedDate,defaultClassName:"react-aria-CalendarCell",values:{date:e,isHovered:m,isOutsideMonth:b,isFocusVisible:g,isSelectionStart:v,isSelectionEnd:w,...p}}),S={"data-focused":p.isFocused||void 0,"data-hovered":m||void 0,"data-pressed":p.isPressed||void 0,"data-unavailable":p.isUnavailable||void 0,"data-disabled":p.isDisabled||void 0,"data-focus-visible":g||void 0,"data-outside-visible-range":p.isOutsideVisibleRange||void 0,"data-outside-month":b||void 0,"data-selected":p.isSelected||void 0,"data-selection-start":v||void 0,"data-selection-end":w||void 0,"data-invalid":p.isInvalid||void 0};return fY().createElement("td",{...d,ref:n},fY().createElement("div",{...y5(gh(t),f,y,h,S,x),ref:c}))}),_B=(0,fZ.createContext)({}),_V=(0,fZ.forwardRef)(function(e,t){var n,r;[e,t]=gt(e,t,_B);let{isDisabled:o,isInvalid:i,onHoverStart:a,onHoverChange:s,onHoverEnd:l,...u}=e,{hoverProps:c,isHovered:d}=bL({onHoverStart:a,onHoverChange:s,onHoverEnd:l,isDisabled:o}),{isFocused:f,isFocusVisible:p,focusProps:h}=bA({within:!0});null!=o||(o=!!e["aria-disabled"]&&"false"!==e["aria-disabled"]),null!=i||(i=!!e["aria-invalid"]&&"false"!==e["aria-invalid"]);let m=y8({...e,values:{isHovered:d,isFocusWithin:f,isFocusVisible:p,isDisabled:o,isInvalid:i},defaultClassName:"react-aria-Group"});return fY().createElement("div",{...y5(u,h,c),...m,ref:t,role:null!=(n=e.role)?n:"group",slot:null!=(r=e.slot)?r:void 0,"data-focus-within":f||void 0,"data-hovered":d||void 0,"data-focus-visible":p||void 0,"data-disabled":o||void 0,"data-invalid":i||void 0},m.children)}),_U=(0,fZ.createContext)({}),_W=bB(function(e,t){[e,t]=gt(e,t,_U);let{hoverProps:n,isHovered:r}=bL(e),{isFocused:o,isFocusVisible:i,focusProps:a}=bA({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e["aria-invalid"]&&"false"!==e["aria-invalid"],l=y8({...e,values:{isHovered:r,isFocused:o,isFocusVisible:i,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:"react-aria-Input"});return fY().createElement("input",{...y5((e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...o}=e;return o})(e),a,n),...l,ref:t,"data-focused":o||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":i||void 0,"data-invalid":s||void 0})});function _K(e,t,n,r){return e.createTreeWalker(t,n,r)}let _z=fY().createContext(null),_H="react-aria-focus-scope-restore",_G=null;function _q(e){var t,n,r,o,i,a,s,l,u,c;let d,f,p,h,{children:m,contain:y,restoreFocus:g,autoFocus:b}=e,v=(0,fZ.useRef)(null),w=(0,fZ.useRef)(null),x=(0,fZ.useRef)([]),{parentNode:S}=(0,fZ.useContext)(_z)||{},E=(0,fZ.useMemo)(()=>new _8({scopeRef:x}),[x]);yz(()=>{let e=S||xe.root;if(xe.getTreeNode(e.scopeRef)&&_G&&!_X(_G,e.scopeRef)){let t=xe.getTreeNode(_G);t&&(e=t)}e.addChild(E),xe.addNode(E)},[E,S]),yz(()=>{let e=xe.getTreeNode(x);e&&(e.contain=!!y)},[y]),yz(()=>{let e=v.current?.nextSibling,t=[],n=e=>e.stopPropagation();for(;e&&e!==w.current;)t.push(e),e.addEventListener(_H,n),e=e.nextSibling;return x.current=t,()=>{for(let e of t)e.removeEventListener(_H,n)}},[m]),yz(()=>{if(n||r)return;let e=t.current,o=gg(e?e[0]:void 0),i=e=>{let n=gw(e);_J(n,t.current)?_G=t:_Q(n)||(_G=null)};return o.addEventListener("focusin",i,!1),e?.forEach(e=>e.addEventListener("focusin",i,!1)),()=>{o.removeEventListener("focusin",i,!1),e?.forEach(e=>e.removeEventListener("focusin",i,!1))}},[t=x,n=g,r=y]),o=x,i=y,d=(0,fZ.useRef)(void 0),f=(0,fZ.useRef)(void 0),yz(()=>{let e=o.current;if(!i){f.current&&(cancelAnimationFrame(f.current),f.current=void 0);return}let t=gg(e?e[0]:void 0),n=e=>{if("Tab"!==e.key||e.altKey||e.ctrlKey||e.metaKey||!_Y(o)||e.isComposing)return;let n=((e=document)=>e.activeElement)(t),r=o.current;if(!r||!_J(n,r))return;let i=_6(_Z(r),{tabbable:!0},r);if(!n)return;i.currentNode=n;let a=e.shiftKey?i.previousNode():i.nextNode();a||(i.currentNode=e.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,a=e.shiftKey?i.previousNode():i.nextNode()),e.preventDefault(),a&&(_0(a,!0),a instanceof gb(a).HTMLInputElement&&a.select())},r=e=>{(!_G||_X(_G,o))&&_J(gw(e),o.current)?(_G=o,d.current=gw(e)):_Y(o)&&!_Q(gw(e),o)?d.current?d.current.focus():_G&&_G.current&&_2(_G.current):_Y(o)&&(d.current=gw(e))},a=e=>{f.current&&cancelAnimationFrame(f.current),f.current=requestAnimationFrame(()=>{let n=gG,r=("virtual"===n||null===n)&&gW()&&gU(),i=((e=document)=>e.activeElement)(t);if(!r&&i&&_Y(o)&&!_Q(i,o)){_G=o;let t=gw(e);t&&t.isConnected?(d.current=t,d.current?.focus()):_G.current&&_2(_G.current)}})};return t.addEventListener("keydown",n,!1),t.addEventListener("focusin",r,!1),e?.forEach(e=>e.addEventListener("focusin",r,!1)),e?.forEach(e=>e.addEventListener("focusout",a,!1)),()=>{t.removeEventListener("keydown",n,!1),t.removeEventListener("focusin",r,!1),e?.forEach(e=>e.removeEventListener("focusin",r,!1)),e?.forEach(e=>e.removeEventListener("focusout",a,!1))}},[o,i]),yz(()=>()=>{f.current&&cancelAnimationFrame(f.current)},[f]),a=x,s=g,l=y,p=(0,fZ.useRef)("u">typeof document?((e=document)=>e.activeElement)(gg(a.current?a.current[0]:void 0)):null),yz(()=>{let e=a.current,t=gg(e?e[0]:void 0);if(!s||l)return;let n=()=>{(!_G||_X(_G,a))&&_J(((e=document)=>e.activeElement)(t),a.current)&&(_G=a)};return t.addEventListener("focusin",n,!1),e?.forEach(e=>e.addEventListener("focusin",n,!1)),()=>{t.removeEventListener("focusin",n,!1),e?.forEach(e=>e.removeEventListener("focusin",n,!1))}},[a,l]),yz(()=>{let e=gg(a.current?a.current[0]:void 0);if(!s)return;let t=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!_Y(a)||t.isComposing)return;let n=e.activeElement;if(!_Q(n,a)||!_4(a))return;let r=xe.getTreeNode(a);if(!r)return;let o=r.nodeToRestore,i=_6(e.body,{tabbable:!0});i.currentNode=n;let s=t.shiftKey?i.previousNode():i.nextNode();if(o&&o.isConnected&&o!==e.body||(o=void 0,r.nodeToRestore=void 0),(!s||!_Q(s,a))&&o){i.currentNode=o;do s=t.shiftKey?i.previousNode():i.nextNode();while(_Q(s,a));(t.preventDefault(),t.stopPropagation(),s)?_0(s,!0):_Q(o)?_0(o,!0):n.blur()}};return l||e.addEventListener("keydown",t,!0),()=>{l||e.removeEventListener("keydown",t,!0)}},[a,s,l]),yz(()=>{let e=gg(a.current?a.current[0]:void 0);if(!s)return;let t=xe.getTreeNode(a);if(t)return t.nodeToRestore=p.current??void 0,()=>{let t=xe.getTreeNode(a);if(!t)return;let n=t.nodeToRestore,r=((e=document)=>e.activeElement)(e);if(s&&n&&(r&&_Q(r,a)||r===e.body&&_4(a))){let t=xe.clone();requestAnimationFrame(()=>{if(e.activeElement===e.body){let e=t.getTreeNode(a);for(;e;){if(e.nodeToRestore&&e.nodeToRestore.isConnected)return void _3(e.nodeToRestore);e=e.parent}for(e=t.getTreeNode(a);e;){if(e.scopeRef&&e.scopeRef.current&&xe.getTreeNode(e.scopeRef))return void _3(_1(e.scopeRef.current,!0));e=e.parent}}})}}},[a,s]),u=x,c=b,h=fY().useRef(c),(0,fZ.useEffect)(()=>{h.current&&(_G=u,!_J(((e=document)=>e.activeElement)(gg(u.current?u.current[0]:void 0)),_G.current)&&u.current&&_2(u.current)),h.current=!1},[u]),(0,fZ.useEffect)(()=>{let e=((e=document)=>e.activeElement)(gg(x.current?x.current[0]:void 0)),t=null;if(_J(e,x.current)){for(let n of xe.traverse())n.scopeRef&&_J(e,n.scopeRef.current)&&(t=n);t===xe.getTreeNode(x)&&(_G=t.scopeRef)}},[x]),yz(()=>()=>{let e=xe.getTreeNode(x)?.parent?.scopeRef??null;(x===_G||_X(x,_G))&&(!e||xe.getTreeNode(e))&&(_G=e),xe.removeTreeNode(x)},[x]);let D=(0,fZ.useMemo)(()=>{var e;return e=x,{focusNext(t={}){let n=e.current,{from:r,tabbable:o,wrap:i,accept:a}=t,s=r||((e=document)=>e.activeElement)(gg(n[0]??void 0)),l=n[0].previousElementSibling,u=_6(_Z(n),{tabbable:o,accept:a},n);u.currentNode=_J(s,n)?s:l;let c=u.nextNode();return!c&&i&&(u.currentNode=l,c=u.nextNode()),c&&_0(c,!0),c},focusPrevious(t={}){let n=e.current,{from:r,tabbable:o,wrap:i,accept:a}=t,s=r||((e=document)=>e.activeElement)(gg(n[0]??void 0)),l=n[n.length-1].nextElementSibling,u=_6(_Z(n),{tabbable:o,accept:a},n);u.currentNode=_J(s,n)?s:l;let c=u.previousNode();return!c&&i&&(u.currentNode=l,c=u.previousNode()),c&&_0(c,!0),c},focusFirst(t={}){let n=e.current,{tabbable:r,accept:o}=t,i=_6(_Z(n),{tabbable:r,accept:o},n);i.currentNode=n[0].previousElementSibling;let a=i.nextNode();return a&&_0(a,!0),a},focusLast(t={}){let n=e.current,{tabbable:r,accept:o}=t,i=_6(_Z(n),{tabbable:r,accept:o},n);i.currentNode=n[n.length-1].nextElementSibling;let a=i.previousNode();return a&&_0(a,!0),a}}},[]),O=(0,fZ.useMemo)(()=>({focusManager:D,parentNode:E}),[E,D]);return fY().createElement(_z.Provider,{value:O},fY().createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:v}),m,fY().createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:w}))}function _Z(e){return e[0].parentElement}function _Y(e){let t=xe.getTreeNode(_G);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function _J(e,t){return!!e&&!!t&&t.some(t=>gv(t,e))}function _Q(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of xe.traverse(xe.getTreeNode(t)))if(n&&_J(e,n.current))return!0;return!1}function _X(e,t){let n=xe.getTreeNode(t)?.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function _0(e,t=!1){if(null==e||t){if(null!=e)try{e.focus()}catch{}}else try{br(e)}catch{}}function _1(e,t=!0){let n=e[0].previousElementSibling,r=_Z(e),o=_6(r,{tabbable:t},e);o.currentNode=n;let i=o.nextNode();return t&&!i&&((o=_6(r=_Z(e),{tabbable:!1},e)).currentNode=n,i=o.nextNode()),i}function _2(e,t=!0){_0(_1(e,t))}function _4(e){let t=xe.getTreeNode(_G);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function _3(e){e.dispatchEvent(new CustomEvent(_H,{bubbles:!0,cancelable:!0}))&&_0(e)}function _6(e,t,n){let r=t?.tabbable?gP:gk,o=gg(e?.nodeType===Node.ELEMENT_NODE?e:null),i=_K(o,e||o,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>gv(t?.from,e)||t?.tabbable&&"INPUT"===e.tagName&&"radio"===e.getAttribute("type")&&(!function(e){if(e.checked)return!0;let t=function(e){if(!e.form)return Array.from(gg(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(e=>!e.form);let t=e.form.elements.namedItem(e.name),n=gb(e);return t instanceof n.RadioNodeList?Array.from(t).filter(e=>e instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}(e);return t.length>0&&!t.some(e=>e.checked)}(e)||"INPUT"===i.currentNode.tagName&&"radio"===i.currentNode.type&&i.currentNode.name===e.name)?NodeFilter.FILTER_REJECT:r(e)&&(!n||_J(e,n))&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});return t?.from&&(i.currentNode=t.from),i}function _5(e,t={}){return{focusNext(n={}){let r=e.current;if(!r)return null;let{from:o,tabbable:i=t.tabbable,wrap:a=t.wrap,accept:s=t.accept}=n,l=o||((e=document)=>e.activeElement)(gg(r)),u=_6(r,{tabbable:i,accept:s});gv(r,l)&&(u.currentNode=l);let c=u.nextNode();return!c&&a&&(u.currentNode=r,c=u.nextNode()),c&&_0(c,!0),c},focusPrevious(n=t){let r=e.current;if(!r)return null;let{from:o,tabbable:i=t.tabbable,wrap:a=t.wrap,accept:s=t.accept}=n,l=o||((e=document)=>e.activeElement)(gg(r)),u=_6(r,{tabbable:i,accept:s});if(gv(r,l))u.currentNode=l;else{let e=_7(u);return e&&_0(e,!0),e??null}let c=u.previousNode();if(!c&&a){u.currentNode=r;let e=_7(u);if(!e)return null;c=e}return c&&_0(c,!0),c??null},focusFirst(n=t){let r=e.current;if(!r)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=n,a=_6(r,{tabbable:o,accept:i}).nextNode();return a&&_0(a,!0),a},focusLast(n=t){let r=e.current;if(!r)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=n,a=_7(_6(r,{tabbable:o,accept:i}));return a&&_0(a,!0),a??null}}}function _7(e){let t,n;do(t=e.lastChild())&&(n=t);while(t);return n}class _9{constructor(){this.fastMap=new Map,this.root=new _8({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(t??null);if(!r)return;let o=new _8({scopeRef:e});r.addChild(o),o.parent=r,this.fastMap.set(e,o),n&&(o.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(null===e)return;let t=this.fastMap.get(e);if(!t)return;let n=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&_J(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let r=t.children;n&&(n.removeChild(t),r.size>0&&r.forEach(e=>n&&n.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(null!=e.scopeRef&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){let e=new _9;for(let t of this.traverse())e.addTreeNode(t.scopeRef,t.parent?.scopeRef??null,t.nodeToRestore);return e}}class _8{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}}let xe=new _9;var xt={};function xn(e,t,n){let{direction:r}=b5(),o=(0,fZ.useMemo)(()=>_5(t),[t]),i=()=>{if(!t.current)return;let e=window.event?gw(window.event):null,n=_6(t.current,{tabbable:!0});if(e&&(n.currentNode=e,e=n.previousNode()),!e){let t;do(t=n.lastChild())&&(e=t);while(t)}for(;e?.hasAttribute("data-placeholder");){let t=n.previousNode();if(t&&t.hasAttribute("data-placeholder"))e=t;else break}e&&e.focus()},{pressProps:a}=bD({preventFocusOnPress:!0,allowTextSelectionOnPress:!0,onPressStart(e){"mouse"===e.pointerType&&i()},onPress(e){("touch"===e.pointerType||"pen"===e.pointerType)&&i()}});return y5(a,{onKeyDown:i=>{if(gv(i.currentTarget,gw(i))&&(i.altKey&&("ArrowDown"===i.key||"ArrowUp"===i.key)&&"setOpen"in e&&(i.preventDefault(),i.stopPropagation(),e.setOpen(!0)),!n))switch(i.key){case"ArrowLeft":if(i.preventDefault(),i.stopPropagation(),"rtl"===r){if(t.current){let e=gw(i),n=xr(t.current,e.getBoundingClientRect().left,-1);n&&n.focus()}}else o.focusPrevious();break;case"ArrowRight":if(i.preventDefault(),i.stopPropagation(),"rtl"===r){if(t.current){let e=gw(i),n=xr(t.current,e.getBoundingClientRect().left,1);n&&n.focus()}}else o.focusNext()}}})}function xr(e,t,n){let r=_6(e,{tabbable:!0}),o=r.nextNode(),i=null,a=1/0;for(;o;){let e=o.getBoundingClientRect().left-t,s=Math.abs(e);Math.sign(e)===n&&s<a&&(i=o,a=s),o=r.nextNode()}return i}function xo(e){let{description:t,errorMessage:n,isInvalid:r,validationState:o}=e,{labelProps:i,fieldProps:a}=function(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":o,labelElementType:i="label"}=e;t=y4(t);let a=y4(),s={};return n&&(r=r?`${a} ${r}`:a,s={id:a,htmlFor:"label"===i?t:void 0}),{labelProps:s,fieldProps:wx({id:t,"aria-label":o,"aria-labelledby":r})}}(e),s=y3([!!t,!!n,r,o]),l=y3([!!t,!!n,r,o]);return{labelProps:i,fieldProps:a=y5(a,{"aria-describedby":[s,l,e["aria-describedby"]].filter(Boolean).join(" ")||void 0}),descriptionProps:{id:s},errorMessageProps:{id:l}}}function xi(e,t,n){let r=bb(e=>{n&&!e.defaultPrevented&&n(t)});(0,fZ.useEffect)(()=>{let t=e?.current?.form;return t?.addEventListener("reset",r),()=>{t?.removeEventListener("reset",r)}},[e])}function xa(e,t,n){let{validationBehavior:r,focus:o}=e;yz(()=>{if("native"===r&&n?.current&&!n.current.disabled){var e;let r,o=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(o),n.current.hasAttribute("title")||(n.current.title=""),t.realtimeValidation.isInvalid||t.updateValidation({isInvalid:!(e=n.current).validity.valid,validationDetails:{badInput:(r=e.validity).badInput,customError:r.customError,patternMismatch:r.patternMismatch,rangeOverflow:r.rangeOverflow,rangeUnderflow:r.rangeUnderflow,stepMismatch:r.stepMismatch,tooLong:r.tooLong,tooShort:r.tooShort,typeMismatch:r.typeMismatch,valueMissing:r.valueMissing,valid:r.valid},validationErrors:e.validationMessage?[e.validationMessage]:[]})}});let i=(0,fZ.useRef)(!1),a=bb(()=>{i.current||t.resetValidation()}),s=bb(e=>{t.displayValidation.isInvalid||t.commitValidation();let r=n?.current?.form;!e.defaultPrevented&&n&&r&&function(e){for(let t=0;t<e.elements.length;t++){let n=e.elements[t];if(n.validity?.valid===!1)return n}return null}(r)===n.current&&(o?o():n.current?.focus(),gG="keyboard",gX("keyboard",null));e.preventDefault()}),l=bb(()=>{t.commitValidation()});(0,fZ.useEffect)(()=>{let e=n?.current;if(!e)return;let t=e.form,r=t?.reset;return t&&(t.reset=()=>{i.current=!window.event||"message"===window.event.type&&gw(window.event)instanceof MessagePort,r?.call(t),i.current=!1}),e.addEventListener("invalid",s),e.addEventListener("change",l),t?.addEventListener("reset",a),()=>{e.removeEventListener("invalid",s),e.removeEventListener("change",l),t?.removeEventListener("reset",a),t&&(t.reset=r)}},[n,r])}xt={"ar-AE":{calendar:"التقويم",day:"يوم",dayPeriod:"ص/م",endDate:"تاريخ الانتهاء",era:"العصر",hour:"الساعات",minute:"الدقائق",month:"الشهر",second:"الثواني",selectedDateDescription:e=>`\u{62A}\u{627}\u{631}\u{64A}\u{62E} \u{645}\u{62D}\u{62F}\u{62F}: ${e.date}`,selectedRangeDescription:e=>`\u{627}\u{644}\u{645}\u{62F}\u{649} \u{627}\u{644}\u{632}\u{645}\u{646}\u{64A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.startDate} \u{625}\u{644}\u{649} ${e.endDate}`,selectedTimeDescription:e=>`\u{627}\u{644}\u{648}\u{642}\u{62A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.time}`,startDate:"تاريخ البدء",timeZoneName:"التوقيت",weekday:"اليوم",year:"السنة"},"bg-BG":{calendar:"Календар",day:"ден",dayPeriod:"пр.об./сл.об.",endDate:"Крайна дата",era:"ера",hour:"час",minute:"минута",month:"месец",second:"секунда",selectedDateDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.startDate} \u{434}\u{43E} ${e.endDate}`,selectedTimeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{43E} \u{432}\u{440}\u{435}\u{43C}\u{435}: ${e.time}`,startDate:"Начална дата",timeZoneName:"часова зона",weekday:"ден от седмицата",year:"година"},"cs-CZ":{calendar:"Kalend\xe1ř",day:"den",dayPeriod:"č\xe1st dne",endDate:"Konečn\xe9 datum",era:"letopočet",hour:"hodina",minute:"minuta",month:"měs\xedc",second:"sekunda",selectedDateDescription:e=>`Vybran\xe9 datum: ${e.date}`,selectedRangeDescription:e=>`Vybran\xe9 obdob\xed: ${e.startDate} a\u{17E} ${e.endDate}`,selectedTimeDescription:e=>`Vybran\xfd \u{10D}as: ${e.time}`,startDate:"Poč\xe1tečn\xed datum",timeZoneName:"časov\xe9 p\xe1smo",weekday:"den v t\xfddnu",year:"rok"},"da-DK":{calendar:"Kalender",day:"dag",dayPeriod:"AM/PM",endDate:"Slutdato",era:"\xe6ra",hour:"time",minute:"minut",month:"m\xe5ned",second:"sekund",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tidspunkt: ${e.time}`,startDate:"Startdato",timeZoneName:"tidszone",weekday:"ugedag",year:"\xe5r"},"de-DE":{calendar:"Kalender",day:"Tag",dayPeriod:"Tagesh\xe4lfte",endDate:"Enddatum",era:"Epoche",hour:"Stunde",minute:"Minute",month:"Monat",second:"Sekunde",selectedDateDescription:e=>`Ausgew\xe4hltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgew\xe4hlter Bereich: ${e.startDate} bis ${e.endDate}`,selectedTimeDescription:e=>`Ausgew\xe4hlte Zeit: ${e.time}`,startDate:"Startdatum",timeZoneName:"Zeitzone",weekday:"Wochentag",year:"Jahr"},"el-GR":{calendar:"Ημερολόγιο",day:"ημέρα",dayPeriod:"π.μ./μ.μ.",endDate:"Ημερομηνία λήξης",era:"περίοδος",hour:"ώρα",minute:"λεπτό",month:"μήνας",second:"δευτερόλεπτο",selectedDateDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3B7}\u{3BC}\u{3B5}\u{3C1}\u{3BF}\u{3BC}\u{3B7}\u{3BD}\u{3AF}\u{3B1}: ${e.date}`,selectedRangeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3BF} \u{3B5}\u{3CD}\u{3C1}\u{3BF}\u{3C2}: ${e.startDate} \u{3AD}\u{3C9}\u{3C2} ${e.endDate}`,selectedTimeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3CE}\u{3C1}\u{3B1}: ${e.time}`,startDate:"Ημερομηνία έναρξης",timeZoneName:"ζώνη ώρας",weekday:"καθημερινή",year:"έτος"},"en-US":{era:"era",year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",dayPeriod:"AM/PM",calendar:"Calendar",startDate:"Start Date",endDate:"End Date",weekday:"day of the week",timeZoneName:"time zone",selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.startDate} to ${e.endDate}`,selectedTimeDescription:e=>`Selected Time: ${e.time}`},"es-ES":{calendar:"Calendario",day:"d\xeda",dayPeriod:"a.\xa0m./p.\xa0m.",endDate:"Fecha final",era:"era",hour:"hora",minute:"minuto",month:"mes",second:"segundo",selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Rango seleccionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora seleccionada: ${e.time}`,startDate:"Fecha de inicio",timeZoneName:"zona horaria",weekday:"d\xeda de la semana",year:"a\xf1o"},"et-EE":{calendar:"Kalender",day:"p\xe4ev",dayPeriod:"enne/p\xe4rast l\xf5unat",endDate:"L\xf5ppkuup\xe4ev",era:"ajastu",hour:"tund",minute:"minut",month:"kuu",second:"sekund",selectedDateDescription:e=>`Valitud kuup\xe4ev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.startDate} kuni ${e.endDate}`,selectedTimeDescription:e=>`Valitud aeg: ${e.time}`,startDate:"Alguskuup\xe4ev",timeZoneName:"ajav\xf6\xf6nd",weekday:"n\xe4dalap\xe4ev",year:"aasta"},"fi-FI":{calendar:"Kalenteri",day:"p\xe4iv\xe4",dayPeriod:"vuorokaudenaika",endDate:"P\xe4\xe4ttymisp\xe4iv\xe4",era:"aikakausi",hour:"tunti",minute:"minuutti",month:"kuukausi",second:"sekunti",selectedDateDescription:e=>`Valittu p\xe4iv\xe4m\xe4\xe4r\xe4: ${e.date}`,selectedRangeDescription:e=>`Valittu aikav\xe4li: ${e.startDate} \u{2013} ${e.endDate}`,selectedTimeDescription:e=>`Valittu aika: ${e.time}`,startDate:"Alkamisp\xe4iv\xe4",timeZoneName:"aikavy\xf6hyke",weekday:"viikonp\xe4iv\xe4",year:"vuosi"},"fr-FR":{calendar:"Calendrier",day:"jour",dayPeriod:"cadran",endDate:"Date de fin",era:"\xe8re",hour:"heure",minute:"minute",month:"mois",second:"seconde",selectedDateDescription:e=>`Date s\xe9lectionn\xe9e\xa0: ${e.date}`,selectedRangeDescription:e=>`Plage s\xe9lectionn\xe9e\xa0: ${e.startDate} au ${e.endDate}`,selectedTimeDescription:e=>`Heure choisie\xa0: ${e.time}`,startDate:"Date de d\xe9but",timeZoneName:"fuseau horaire",weekday:"jour de la semaine",year:"ann\xe9e"},"he-IL":{calendar:"לוח שנה",day:"יום",dayPeriod:"לפנה״צ/אחה״צ",endDate:"תאריך סיום",era:"תקופה",hour:"שעה",minute:"דקה",month:"חודש",second:"שנייה",selectedDateDescription:e=>`\u{5EA}\u{5D0}\u{5E8}\u{5D9}\u{5DA} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.date}`,selectedRangeDescription:e=>`\u{5D8}\u{5D5}\u{5D5}\u{5D7} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.startDate} \u{5E2}\u{5D3} ${e.endDate}`,selectedTimeDescription:e=>`\u{5D6}\u{5DE}\u{5DF} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.time}`,startDate:"תאריך התחלה",timeZoneName:"אזור זמן",weekday:"יום בשבוע",year:"שנה"},"hr-HR":{calendar:"Kalendar",day:"dan",dayPeriod:"AM/PM",endDate:"Datum završetka",era:"era",hour:"sat",minute:"minuta",month:"mjesec",second:"sekunda",selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Odabrano vrijeme: ${e.time}`,startDate:"Datum početka",timeZoneName:"vremenska zona",weekday:"dan u tjednu",year:"godina"},"hu-HU":{calendar:"Napt\xe1r",day:"nap",dayPeriod:"napszak",endDate:"Befejező d\xe1tum",era:"\xe9ra",hour:"\xf3ra",minute:"perc",month:"h\xf3nap",second:"m\xe1sodperc",selectedDateDescription:e=>`Kijel\xf6lt d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Kijel\xf6lt tartom\xe1ny: ${e.startDate}\u{2013}${e.endDate}`,selectedTimeDescription:e=>`Kijel\xf6lt id\u{151}: ${e.time}`,startDate:"Kezdő d\xe1tum",timeZoneName:"időz\xf3na",weekday:"h\xe9t napja",year:"\xe9v"},"it-IT":{calendar:"Calendario",day:"giorno",dayPeriod:"AM/PM",endDate:"Data finale",era:"era",hour:"ora",minute:"minuto",month:"mese",second:"secondo",selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: da ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Ora selezionata: ${e.time}`,startDate:"Data iniziale",timeZoneName:"fuso orario",weekday:"giorno della settimana",year:"anno"},"ja-JP":{calendar:"カレンダー",day:"日",dayPeriod:"午前/午後",endDate:"終了日",era:"時代",hour:"時",minute:"分",month:"月",second:"秒",selectedDateDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{65E5}\u{4ED8} : ${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{629E}\u{7BC4}\u{56F2} : ${e.startDate} \u{304B}\u{3089} ${e.endDate}`,selectedTimeDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{6642}\u{9593} : ${e.time}`,startDate:"開始日",timeZoneName:"タイムゾーン",weekday:"曜日",year:"年"},"ko-KR":{calendar:"달력",day:"일",dayPeriod:"오전/오후",endDate:"종료일",era:"연호",hour:"시",minute:"분",month:"월",second:"초",selectedDateDescription:e=>`\u{C120}\u{D0DD} \u{C77C}\u{C790}: ${e.date}`,selectedRangeDescription:e=>`\u{C120}\u{D0DD} \u{BC94}\u{C704}: ${e.startDate} ~ ${e.endDate}`,selectedTimeDescription:e=>`\u{C120}\u{D0DD} \u{C2DC}\u{AC04}: ${e.time}`,startDate:"시작일",timeZoneName:"시간대",weekday:"요일",year:"년"},"lt-LT":{calendar:"Kalendorius",day:"diena",dayPeriod:"iki pietų / po pietų",endDate:"Pabaigos data",era:"era",hour:"valanda",minute:"minutė",month:"mėnuo",second:"sekundė",selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: nuo ${e.startDate} iki ${e.endDate}`,selectedTimeDescription:e=>`Pasirinktas laikas: ${e.time}`,startDate:"Pradžios data",timeZoneName:"laiko juosta",weekday:"savaitės diena",year:"metai"},"lv-LV":{calendar:"Kalendārs",day:"diena",dayPeriod:"priekšpusdienā/pēcpusdienā",endDate:"Beigu datums",era:"ēra",hour:"stundas",minute:"minūtes",month:"mēnesis",second:"sekundes",selectedDateDescription:e=>`Atlas\u{12B}tais datums: ${e.date}`,selectedRangeDescription:e=>`Atlas\u{12B}tais diapazons: no ${e.startDate} l\u{12B}dz ${e.endDate}`,selectedTimeDescription:e=>`Atlas\u{12B}tais laiks: ${e.time}`,startDate:"Sākuma datums",timeZoneName:"laika josla",weekday:"nedēļas diena",year:"gads"},"nb-NO":{calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Sluttdato",era:"tidsalder",hour:"time",minute:"minutt",month:"m\xe5ned",second:"sekund",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt omr\xe5de: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tid: ${e.time}`,startDate:"Startdato",timeZoneName:"tidssone",weekday:"ukedag",year:"\xe5r"},"nl-NL":{calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Einddatum",era:"tijdperk",hour:"uur",minute:"minuut",month:"maand",second:"seconde",selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.startDate} tot ${e.endDate}`,selectedTimeDescription:e=>`Geselecteerde tijd: ${e.time}`,startDate:"Startdatum",timeZoneName:"tijdzone",weekday:"dag van de week",year:"jaar"},"pl-PL":{calendar:"Kalendarz",day:"dzień",dayPeriod:"rano / po południu / wieczorem",endDate:"Data końcowa",era:"era",hour:"godzina",minute:"minuta",month:"miesiąc",second:"sekunda",selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Wybrany czas: ${e.time}`,startDate:"Data początkowa",timeZoneName:"strefa czasowa",weekday:"dzień tygodnia",year:"rok"},"pt-BR":{calendar:"Calend\xe1rio",day:"dia",dayPeriod:"AM/PM",endDate:"Data final",era:"era",hour:"hora",minute:"minuto",month:"m\xeas",second:"segundo",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:"Data inicial",timeZoneName:"fuso hor\xe1rio",weekday:"dia da semana",year:"ano"},"pt-PT":{calendar:"Calend\xe1rio",day:"dia",dayPeriod:"am/pm",endDate:"Data de T\xe9rmino",era:"era",hour:"hora",minute:"minuto",month:"m\xeas",second:"segundo",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:"Data de In\xedcio",timeZoneName:"fuso hor\xe1rio",weekday:"dia da semana",year:"ano"},"ro-RO":{calendar:"Calendar",day:"zi",dayPeriod:"a.m/p.m.",endDate:"Dată final",era:"eră",hour:"oră",minute:"minut",month:"lună",second:"secundă",selectedDateDescription:e=>`Dat\u{103} selectat\u{103}: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: de la ${e.startDate} p\xe2n\u{103} la ${e.endDate}`,selectedTimeDescription:e=>`Ora selectat\u{103}: ${e.time}`,startDate:"Dată \xeenceput",timeZoneName:"fus orar",weekday:"ziua din săptăm\xe2nă",year:"an"},"ru-RU":{calendar:"Календарь",day:"день",dayPeriod:"AM/PM",endDate:"Дата окончания",era:"эра",hour:"час",minute:"минута",month:"месяц",second:"секунда",selectedDateDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{430}\u{44F} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{44B}\u{439} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: \u{441} ${e.startDate} \u{43F}\u{43E} ${e.endDate}`,selectedTimeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{43E}\u{435} \u{432}\u{440}\u{435}\u{43C}\u{44F}: ${e.time}`,startDate:"Дата начала",timeZoneName:"часовой пояс",weekday:"день недели",year:"год"},"sk-SK":{calendar:"Kalend\xe1r",day:"deň",dayPeriod:"AM/PM",endDate:"D\xe1tum ukončenia",era:"letopočet",hour:"hodina",minute:"min\xfata",month:"mesiac",second:"sekunda",selectedDateDescription:e=>`Vybrat\xfd d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Vybrat\xfd rozsah: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Vybrat\xfd \u{10D}as: ${e.time}`,startDate:"D\xe1tum začatia",timeZoneName:"časov\xe9 p\xe1smo",weekday:"deň t\xfdždňa",year:"rok"},"sl-SI":{calendar:"Koledar",day:"dan",dayPeriod:"dop/pop",endDate:"Datum konca",era:"doba",hour:"ura",minute:"minuta",month:"mesec",second:"sekunda",selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano obmo\u{10D}je: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izbrani \u{10D}as: ${e.time}`,startDate:"Datum začetka",timeZoneName:"časovni pas",weekday:"dan v tednu",year:"leto"},"sr-SP":{calendar:"Kalendar",day:"дан",dayPeriod:"пре подне/по подне",endDate:"Datum završetka",era:"ера",hour:"сат",minute:"минут",month:"месец",second:"секунд",selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani opseg: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izabrano vreme: ${e.time}`,startDate:"Datum početka",timeZoneName:"временска зона",weekday:"дан у недељи",year:"година"},"sv-SE":{calendar:"Kalender",day:"dag",dayPeriod:"fm/em",endDate:"Slutdatum",era:"era",hour:"timme",minute:"minut",month:"m\xe5nad",second:"sekund",selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.startDate} till ${e.endDate}`,selectedTimeDescription:e=>`Vald tid: ${e.time}`,startDate:"Startdatum",timeZoneName:"tidszon",weekday:"veckodag",year:"\xe5r"},"tr-TR":{calendar:"Takvim",day:"g\xfcn",dayPeriod:"\xd6\xd6/\xd6S",endDate:"Bitiş Tarihi",era:"\xe7ağ",hour:"saat",minute:"dakika",month:"ay",second:"saniye",selectedDateDescription:e=>`Se\xe7ilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Se\xe7ilen Aral\u{131}k: ${e.startDate} - ${e.endDate}`,selectedTimeDescription:e=>`Se\xe7ilen Zaman: ${e.time}`,startDate:"Başlangı\xe7 Tarihi",timeZoneName:"saat dilimi",weekday:"haftanın g\xfcn\xfc",year:"yıl"},"uk-UA":{calendar:"Календар",day:"день",dayPeriod:"дп/пп",endDate:"Дата завершення",era:"ера",hour:"година",minute:"хвилина",month:"місяць",second:"секунда",selectedDateDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.startDate} \u{2014} ${e.endDate}`,selectedTimeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{447}\u{430}\u{441}: ${e.time}`,startDate:"Дата початку",timeZoneName:"часовий пояс",weekday:"день тижня",year:"рік"},"zh-CN":{calendar:"日历",day:"日",dayPeriod:"上午/下午",endDate:"结束日期",era:"纪元",hour:"小时",minute:"分钟",month:"月",second:"秒",selectedDateDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{8303}\u{56F4}\u{FF1A}${e.startDate} \u{81F3} ${e.endDate}`,selectedTimeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65F6}\u{95F4}\u{FF1A}${e.time}`,startDate:"开始日期",timeZoneName:"时区",weekday:"工作日",year:"年"},"zh-TW":{calendar:"日曆",day:"日",dayPeriod:"上午/下午",endDate:"結束日期",era:"纪元",hour:"小时",minute:"分钟",month:"月",second:"秒",selectedDateDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{7BC4}\u{570D}\u{FF1A}${e.startDate} \u{81F3} ${e.endDate}`,selectedTimeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{6642}\u{9593}\u{FF1A}${e.time}`,startDate:"開始日期",timeZoneName:"时区",weekday:"工作日",year:"年"}};let xs=new WeakMap,xl="__reactAriaDateFieldRole",xu="__reactAriaDateFieldFocusManager";function xc(e,t,n){var r;let o,{isInvalid:i,validationErrors:a,validationDetails:s}=t.displayValidation,{labelProps:l,fieldProps:u,descriptionProps:c,errorMessageProps:d}=xo({...e,labelElementType:"span",isInvalid:i,errorMessage:e.errorMessage||a}),f=(0,fZ.useRef)(null),{focusWithinProps:p}=bR({...e,onFocusWithin(n){f.current=t.value,e.onFocus?.(n)},onBlurWithin:n=>{t.confirmPlaceholder(),t.value!==f.current&&t.commitValidation(),e.onBlur?.(n)},onFocusWithinChange:e.onFocusChange}),h=vb((r=xt)&&r.__esModule?r.default:r,"@react-aria/datepicker"),m="hour"===t.maxGranularity?"selectedTimeDescription":"selectedDateDescription",y="hour"===t.maxGranularity?"time":"date",g=wM(t.value?h.format(m,{[y]:t.formatValue({month:"long"})}):""),b="presentation"===e[xl]?u["aria-describedby"]:[g["aria-describedby"],u["aria-describedby"]].filter(Boolean).join(" ")||void 0,v=e[xu],w=(0,fZ.useMemo)(()=>v||_5(n),[v,n]),x=xn(t,n,"presentation"===e[xl]);xs.set(t,{ariaLabel:e["aria-label"],ariaLabelledBy:[l.id,e["aria-labelledby"]].filter(Boolean).join(" ")||void 0,ariaDescribedBy:b,focusManager:w});let S=(0,fZ.useRef)(e.autoFocus);o="presentation"===e[xl]?{role:"presentation"}:y5(u,{role:"group","aria-disabled":e.isDisabled||void 0,"aria-describedby":b}),(0,fZ.useEffect)(()=>{S.current&&w.focusFirst(),S.current=!1},[w]),xi(e.inputRef,t.defaultValue,t.setValue),xa({...e,focus(){w.focusFirst()}},t,e.inputRef);let E={type:"hidden",name:e.name,form:e.form,value:t.value?.toString()||"",disabled:e.isDisabled};"native"===e.validationBehavior&&(E.type="text",E.hidden=!0,E.required=e.isRequired,E.onChange=()=>{});let D=gh(e);return{labelProps:{...l,onClick:()=>{w.focusFirst()}},fieldProps:y5(D,o,x,p,{onKeyDown(t){e.onKeyDown&&e.onKeyDown(t)},onKeyUp(t){e.onKeyUp&&e.onKeyUp(t)},style:{unicodeBidi:"isolate"}}),inputProps:E,descriptionProps:c,errorMessageProps:d,isInvalid:i,validationErrors:a,validationDetails:s}}var xd={};xd={"ar-AE":{rangeOverflow:e=>`\u{64A}\u{62C}\u{628} \u{623}\u{646} \u{62A}\u{643}\u{648}\u{646} \u{627}\u{644}\u{642}\u{64A}\u{645}\u{629} ${e.maxValue} \u{623}\u{648} \u{642}\u{628}\u{644} \u{630}\u{644}\u{643}.`,rangeReversed:"تاريخ البدء يجب أن يكون قبل تاريخ الانتهاء.",rangeUnderflow:e=>`\u{64A}\u{62C}\u{628} \u{623}\u{646} \u{62A}\u{643}\u{648}\u{646} \u{627}\u{644}\u{642}\u{64A}\u{645}\u{629} ${e.minValue} \u{623}\u{648} \u{628}\u{639}\u{62F} \u{630}\u{644}\u{643}.`,unavailableDate:"البيانات المحددة غير متاحة."},"bg-BG":{rangeOverflow:e=>`\u{421}\u{442}\u{43E}\u{439}\u{43D}\u{43E}\u{441}\u{442}\u{442}\u{430} \u{442}\u{440}\u{44F}\u{431}\u{432}\u{430} \u{434}\u{430} \u{435} ${e.maxValue} \u{438}\u{43B}\u{438} \u{43F}\u{43E}-\u{440}\u{430}\u{43D}\u{43D}\u{430}.`,rangeReversed:"Началната дата трябва да е преди крайната.",rangeUnderflow:e=>`\u{421}\u{442}\u{43E}\u{439}\u{43D}\u{43E}\u{441}\u{442}\u{442}\u{430} \u{442}\u{440}\u{44F}\u{431}\u{432}\u{430} \u{434}\u{430} \u{435} ${e.minValue} \u{438}\u{43B}\u{438} \u{43F}\u{43E}-\u{43A}\u{44A}\u{441}\u{43D}\u{43E}.`,unavailableDate:"Избраната дата не е налична."},"cs-CZ":{rangeOverflow:e=>`Hodnota mus\xed b\xfdt ${e.maxValue} nebo d\u{159}\xedv\u{11B}j\u{161}\xed.`,rangeReversed:"Datum zah\xe1jen\xed mus\xed předch\xe1zet datu ukončen\xed.",rangeUnderflow:e=>`Hodnota mus\xed b\xfdt ${e.minValue} nebo pozd\u{11B}j\u{161}\xed.`,unavailableDate:"Vybran\xe9 datum nen\xed k dispozici."},"da-DK":{rangeOverflow:e=>`V\xe6rdien skal v\xe6re ${e.maxValue} eller tidligere.`,rangeReversed:"Startdatoen skal v\xe6re f\xf8r slutdatoen.",rangeUnderflow:e=>`V\xe6rdien skal v\xe6re ${e.minValue} eller nyere.`,unavailableDate:"Den valgte dato er ikke tilg\xe6ngelig."},"de-DE":{rangeOverflow:e=>`Der Wert muss ${e.maxValue} oder fr\xfcher sein.`,rangeReversed:"Das Startdatum muss vor dem Enddatum liegen.",rangeUnderflow:e=>`Der Wert muss ${e.minValue} oder sp\xe4ter sein.`,unavailableDate:"Das ausgew\xe4hlte Datum ist nicht verf\xfcgbar."},"el-GR":{rangeOverflow:e=>`\u{397} \u{3C4}\u{3B9}\u{3BC}\u{3AE} \u{3C0}\u{3C1}\u{3AD}\u{3C0}\u{3B5}\u{3B9} \u{3BD}\u{3B1} \u{3B5}\u{3AF}\u{3BD}\u{3B1}\u{3B9} ${e.maxValue} \u{3AE} \u{3C0}\u{3B1}\u{3BB}\u{3B1}\u{3B9}\u{3CC}\u{3C4}\u{3B5}\u{3C1}\u{3B7}.`,rangeReversed:"Η ημερομηνία έναρξης πρέπει να είναι πριν από την ημερομηνία λήξης.",rangeUnderflow:e=>`\u{397} \u{3C4}\u{3B9}\u{3BC}\u{3AE} \u{3C0}\u{3C1}\u{3AD}\u{3C0}\u{3B5}\u{3B9} \u{3BD}\u{3B1} \u{3B5}\u{3AF}\u{3BD}\u{3B1}\u{3B9} ${e.minValue} \u{3AE} \u{3BC}\u{3B5}\u{3C4}\u{3B1}\u{3B3}\u{3B5}\u{3BD}\u{3AD}\u{3C3}\u{3C4}\u{3B5}\u{3C1}\u{3B7}.`,unavailableDate:"Η επιλεγμένη ημερομηνία δεν είναι διαθέσιμη."},"en-US":{rangeUnderflow:e=>`Value must be ${e.minValue} or later.`,rangeOverflow:e=>`Value must be ${e.maxValue} or earlier.`,rangeReversed:"Start date must be before end date.",unavailableDate:"Selected date unavailable."},"es-ES":{rangeOverflow:e=>`El valor debe ser ${e.maxValue} o anterior.`,rangeReversed:"La fecha de inicio debe ser anterior a la fecha de finalizaci\xf3n.",rangeUnderflow:e=>`El valor debe ser ${e.minValue} o posterior.`,unavailableDate:"Fecha seleccionada no disponible."},"et-EE":{rangeOverflow:e=>`V\xe4\xe4rtus peab olema ${e.maxValue} v\xf5i varasem.`,rangeReversed:"Alguskuup\xe4ev peab olema enne l\xf5ppkuup\xe4eva.",rangeUnderflow:e=>`V\xe4\xe4rtus peab olema ${e.minValue} v\xf5i hilisem.`,unavailableDate:"Valitud kuup\xe4ev pole saadaval."},"fi-FI":{rangeOverflow:e=>`Arvon on oltava ${e.maxValue} tai sit\xe4 aikaisempi.`,rangeReversed:"Aloitusp\xe4iv\xe4n on oltava ennen lopetusp\xe4iv\xe4\xe4.",rangeUnderflow:e=>`Arvon on oltava ${e.minValue} tai sit\xe4 my\xf6h\xe4isempi.`,unavailableDate:"Valittu p\xe4iv\xe4m\xe4\xe4r\xe4 ei ole k\xe4ytett\xe4viss\xe4."},"fr-FR":{rangeOverflow:e=>`La valeur doit \xeatre ${e.maxValue} ou ant\xe9rieure.`,rangeReversed:"La date de d\xe9but doit \xeatre ant\xe9rieure \xe0 la date de fin.",rangeUnderflow:e=>`La valeur doit \xeatre ${e.minValue} ou ult\xe9rieure.`,unavailableDate:"La date s\xe9lectionn\xe9e n’est pas disponible."},"he-IL":{rangeOverflow:e=>`\u{5D4}\u{5E2}\u{5E8}\u{5DA} \u{5D7}\u{5D9}\u{5D9}\u{5D1} \u{5DC}\u{5D4}\u{5D9}\u{5D5}\u{5EA} ${e.maxValue} \u{5D0}\u{5D5} \u{5DE}\u{5D5}\u{5E7}\u{5D3}\u{5DD} \u{5D9}\u{5D5}\u{5EA}\u{5E8}.`,rangeReversed:"תאריך ההתחלה חייב להיות לפני תאריך הסיום.",rangeUnderflow:e=>`\u{5D4}\u{5E2}\u{5E8}\u{5DA} \u{5D7}\u{5D9}\u{5D9}\u{5D1} \u{5DC}\u{5D4}\u{5D9}\u{5D5}\u{5EA} ${e.minValue} \u{5D0}\u{5D5} \u{5DE}\u{5D0}\u{5D5}\u{5D7}\u{5E8} \u{5D9}\u{5D5}\u{5EA}\u{5E8}.`,unavailableDate:"התאריך הנבחר אינו זמין."},"hr-HR":{rangeOverflow:e=>`Vrijednost mora biti ${e.maxValue} ili ranije.`,rangeReversed:"Datum početka mora biti prije datuma završetka.",rangeUnderflow:e=>`Vrijednost mora biti ${e.minValue} ili kasnije.`,unavailableDate:"Odabrani datum nije dostupan."},"hu-HU":{rangeOverflow:e=>`Az \xe9rt\xe9knek ${e.maxValue} vagy kor\xe1bbinak kell lennie.`,rangeReversed:"A kezdő d\xe1tumnak a befejező d\xe1tumn\xe1l kor\xe1bbinak kell lennie.",rangeUnderflow:e=>`Az \xe9rt\xe9knek ${e.minValue} vagy k\xe9s\u{151}bbinek kell lennie.`,unavailableDate:"A kiv\xe1lasztott d\xe1tum nem \xe9rhető el."},"it-IT":{rangeOverflow:e=>`Il valore deve essere ${e.maxValue} o precedente.`,rangeReversed:"La data di inizio deve essere antecedente alla data di fine.",rangeUnderflow:e=>`Il valore deve essere ${e.minValue} o successivo.`,unavailableDate:"Data selezionata non disponibile."},"ja-JP":{rangeOverflow:e=>`\u{5024}\u{306F} ${e.maxValue} \u{4EE5}\u{4E0B}\u{306B}\u{3059}\u{308B}\u{5FC5}\u{8981}\u{304C}\u{3042}\u{308A}\u{307E}\u{3059}\u{3002}`,rangeReversed:"開始日は終了日より前にする必要があります。",rangeUnderflow:e=>`\u{5024}\u{306F} ${e.minValue} \u{4EE5}\u{4E0A}\u{306B}\u{3059}\u{308B}\u{5FC5}\u{8981}\u{304C}\u{3042}\u{308A}\u{307E}\u{3059}\u{3002}`,unavailableDate:"選択した日付は使用できません。"},"ko-KR":{rangeOverflow:e=>`\u{AC12}\u{C740} ${e.maxValue} \u{C774}\u{C804}\u{C774}\u{C5B4}\u{C57C} \u{D569}\u{B2C8}\u{B2E4}.`,rangeReversed:"시작일은 종료일 이전이어야 합니다.",rangeUnderflow:e=>`\u{AC12}\u{C740} ${e.minValue} \u{C774}\u{D6C4}\u{C5EC}\u{C57C} \u{D569}\u{B2C8}\u{B2E4}.`,unavailableDate:"선택한 날짜를 사용할 수 없습니다."},"lt-LT":{rangeOverflow:e=>`Reik\u{161}m\u{117} turi b\u{16B}ti ${e.maxValue} arba ankstesn\u{117}.`,rangeReversed:"Pradžios data turi būti ankstesnė nei pabaigos data.",rangeUnderflow:e=>`Reik\u{161}m\u{117} turi b\u{16B}ti ${e.minValue} arba naujesn\u{117}.`,unavailableDate:"Pasirinkta data nepasiekiama."},"lv-LV":{rangeOverflow:e=>`V\u{113}rt\u{12B}bai ir j\u{101}b\u{16B}t ${e.maxValue} vai agr\u{101}kai.`,rangeReversed:"Sākuma datumam ir jābūt pirms beigu datuma.",rangeUnderflow:e=>`V\u{113}rt\u{12B}bai ir j\u{101}b\u{16B}t ${e.minValue} vai v\u{113}l\u{101}kai.`,unavailableDate:"Atlasītais datums nav pieejams."},"nb-NO":{rangeOverflow:e=>`Verdien m\xe5 v\xe6re ${e.maxValue} eller tidligere.`,rangeReversed:"Startdatoen m\xe5 v\xe6re f\xf8r sluttdatoen.",rangeUnderflow:e=>`Verdien m\xe5 v\xe6re ${e.minValue} eller senere.`,unavailableDate:"Valgt dato utilgjengelig."},"nl-NL":{rangeOverflow:e=>`Waarde moet ${e.maxValue} of eerder zijn.`,rangeReversed:"De startdatum moet voor de einddatum liggen.",rangeUnderflow:e=>`Waarde moet ${e.minValue} of later zijn.`,unavailableDate:"Geselecteerde datum niet beschikbaar."},"pl-PL":{rangeOverflow:e=>`Warto\u{15B}\u{107} musi mie\u{107} warto\u{15B}\u{107} ${e.maxValue} lub wcze\u{15B}niejsz\u{105}.`,rangeReversed:"Data rozpoczęcia musi być wcześniejsza niż data zakończenia.",rangeUnderflow:e=>`Warto\u{15B}\u{107} musi mie\u{107} warto\u{15B}\u{107} ${e.minValue} lub p\xf3\u{17A}niejsz\u{105}.`,unavailableDate:"Wybrana data jest niedostępna."},"pt-BR":{rangeOverflow:e=>`O valor deve ser ${e.maxValue} ou anterior.`,rangeReversed:"A data inicial deve ser anterior \xe0 data final.",rangeUnderflow:e=>`O valor deve ser ${e.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xedvel."},"pt-PT":{rangeOverflow:e=>`O valor tem de ser ${e.maxValue} ou anterior.`,rangeReversed:"A data de in\xedcio deve ser anterior \xe0 data de fim.",rangeUnderflow:e=>`O valor tem de ser ${e.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xedvel."},"ro-RO":{rangeOverflow:e=>`Valoarea trebuie s\u{103} fie ${e.maxValue} sau anterioar\u{103}.`,rangeReversed:"Data de \xeenceput trebuie să fie anterioară datei de sf\xe2rșit.",rangeUnderflow:e=>`Valoarea trebuie s\u{103} fie ${e.minValue} sau ulterioar\u{103}.`,unavailableDate:"Data selectată nu este disponibilă."},"ru-RU":{rangeOverflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{438}\u{435} \u{434}\u{43E}\u{43B}\u{436}\u{43D}\u{43E} \u{431}\u{44B}\u{442}\u{44C} \u{43D}\u{435} \u{43F}\u{43E}\u{437}\u{436}\u{435} ${e.maxValue}.`,rangeReversed:"Дата начала должна предшествовать дате окончания.",rangeUnderflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{438}\u{435} \u{434}\u{43E}\u{43B}\u{436}\u{43D}\u{43E} \u{431}\u{44B}\u{442}\u{44C} \u{43D}\u{435} \u{440}\u{430}\u{43D}\u{44C}\u{448}\u{435} ${e.minValue}.`,unavailableDate:"Выбранная дата недоступна."},"sk-SK":{rangeOverflow:e=>`Hodnota mus\xed by\u{165} ${e.maxValue} alebo skor\u{161}ia.`,rangeReversed:"D\xe1tum začiatku mus\xed byť skorš\xed ako d\xe1tum konca.",rangeUnderflow:e=>`Hodnota mus\xed by\u{165} ${e.minValue} alebo neskor\u{161}ia.`,unavailableDate:"Vybrat\xfd d\xe1tum je nedostupn\xfd."},"sl-SI":{rangeOverflow:e=>`Vrednost mora biti ${e.maxValue} ali starej\u{161}a.`,rangeReversed:"Začetni datum mora biti pred končnim datumom.",rangeUnderflow:e=>`Vrednost mora biti ${e.minValue} ali novej\u{161}a.`,unavailableDate:"Izbrani datum ni na voljo."},"sr-SP":{rangeOverflow:e=>`Vrednost mora da bude ${e.maxValue} ili starija.`,rangeReversed:"Datum početka mora biti pre datuma završetka.",rangeUnderflow:e=>`Vrednost mora da bude ${e.minValue} ili novija.`,unavailableDate:"Izabrani datum nije dostupan."},"sv-SE":{rangeOverflow:e=>`V\xe4rdet m\xe5ste vara ${e.maxValue} eller tidigare.`,rangeReversed:"Startdatumet m\xe5ste vara f\xf6re slutdatumet.",rangeUnderflow:e=>`V\xe4rdet m\xe5ste vara ${e.minValue} eller senare.`,unavailableDate:"Det valda datumet \xe4r inte tillg\xe4ngligt."},"tr-TR":{rangeOverflow:e=>`De\u{11F}er, ${e.maxValue} veya \xf6ncesi olmal\u{131}d\u{131}r.`,rangeReversed:"Başlangı\xe7 tarihi bitiş tarihinden \xf6nce olmalıdır.",rangeUnderflow:e=>`De\u{11F}er, ${e.minValue} veya sonras\u{131} olmal\u{131}d\u{131}r.`,unavailableDate:"Se\xe7ilen tarih kullanılamıyor."},"uk-UA":{rangeOverflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{43D}\u{44F} \u{43C}\u{430}\u{454} \u{431}\u{443}\u{442}\u{438} \u{43D}\u{435} \u{43F}\u{456}\u{437}\u{43D}\u{456}\u{448}\u{435} ${e.maxValue}.`,rangeReversed:"Дата початку має передувати даті завершення.",rangeUnderflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{43D}\u{44F} \u{43C}\u{430}\u{454} \u{431}\u{443}\u{442}\u{438} \u{43D}\u{435} \u{440}\u{430}\u{43D}\u{456}\u{448}\u{435} ${e.minValue}.`,unavailableDate:"Вибрана дата недоступна."},"zh-CN":{rangeOverflow:e=>`\u{503C}\u{5FC5}\u{987B}\u{662F} ${e.maxValue} \u{6216}\u{66F4}\u{65E9}\u{65E5}\u{671F}\u{3002}`,rangeReversed:"开始日期必须早于结束日期。",rangeUnderflow:e=>`\u{503C}\u{5FC5}\u{987B}\u{662F} ${e.minValue} \u{6216}\u{66F4}\u{665A}\u{65E5}\u{671F}\u{3002}`,unavailableDate:"所选日期不可用。"},"zh-TW":{rangeOverflow:e=>`\u{503C}\u{5FC5}\u{9808}\u{662F} ${e.maxValue} \u{6216}\u{66F4}\u{65E9}\u{3002}`,rangeReversed:"開始日期必須在結束日期之前。",rangeUnderflow:e=>`\u{503C}\u{5FC5}\u{9808}\u{662F} ${e.minValue} \u{6216}\u{66F4}\u{665A}\u{3002}`,unavailableDate:"所選日期無法使用。"}};let xf={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},xp={...xf,customError:!0,valid:!1},xh={isInvalid:!1,validationDetails:xf,validationErrors:[]},xm=(0,fZ.createContext)({}),xy="__reactAriaFormValidationState";function xg(e){if(e[xy]){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:i}=e[xy];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:i}}return function(e){let{isInvalid:t,validationState:n,name:r,value:o,builtinValidation:i,validate:a,validationBehavior:s="aria"}=e;n&&(t||="invalid"===n);let l=void 0!==t?{isInvalid:t,validationErrors:[],validationDetails:xp}:null,u=(0,fZ.useMemo)(()=>a&&null!=o?xv(function(e,t){if("function"==typeof e){let n=e(t);if(n&&"boolean"!=typeof n)return xb(n)}return[]}(a,o)):null,[a,o]);i?.validationDetails.valid&&(i=void 0);let c=(0,fZ.useContext)(xm),d=(0,fZ.useMemo)(()=>r?Array.isArray(r)?r.flatMap(e=>xb(c[e])):xb(c[r]):[],[c,r]),[f,p]=(0,fZ.useState)(c),[h,m]=(0,fZ.useState)(!1);c!==f&&(p(c),m(!1));let y=(0,fZ.useMemo)(()=>xv(h?[]:d),[h,d]),g=(0,fZ.useRef)(xh),[b,v]=(0,fZ.useState)(xh),w=(0,fZ.useRef)(xh),[x,S]=(0,fZ.useState)(!1);return(0,fZ.useEffect)(()=>{if(!x)return;S(!1);let e=u||i||g.current;xw(e,w.current)||(w.current=e,v(e))}),{realtimeValidation:l||y||u||i||xh,displayValidation:"native"===s?l||y||b:l||y||u||i||b,updateValidation(e){"aria"!==s||xw(b,e)?g.current=e:v(e)},resetValidation(){xw(xh,w.current)||(w.current=xh,v(xh)),"native"===s&&S(!1),m(!0)},commitValidation(){"native"===s&&S(!0),m(!0)}}}(e)}function xb(e){return e?Array.isArray(e)?e:[e]:[]}function xv(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:xp}:null}function xw(e,t){return e===t||!!e&&!!t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((e,n)=>e===t.validationErrors[n])&&Object.entries(e.validationDetails).every(([e,n])=>t.validationDetails[e]===n)}function x_(...e){let t=new Set,n=!1,r={...xf};for(let o of e){for(let e of o.validationErrors)t.add(e);for(let e in n||=o.isInvalid,r)r[e]||=o.validationDetails[e]}return r.valid=!n,{isInvalid:n,validationErrors:[...t],validationDetails:r}}let xx=new vf((eu=xd)&&eu.__esModule?eu.default:eu);function xS(){let e="u">typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return e}function xE(e,t,n,r,o){let i=null!=e&&null!=n&&e.compare(n)>0,a=null!=e&&null!=t&&0>e.compare(t),s=null!=e&&r?.(e)||!1,l=i||a||s,u=[];if(l){let e=xS(),r=new vm(e,vf.getGlobalDictionaryForPackage("@react-stately/datepicker")||xx),l=new vr(e,xk({},o)),c=l.resolvedOptions().timeZone;a&&null!=t&&u.push(r.format("rangeUnderflow",{minValue:l.format(t.toDate(c))})),i&&null!=n&&u.push(r.format("rangeOverflow",{maxValue:l.format(n.toDate(c))})),s&&u.push(r.format("unavailableDate"))}return{isInvalid:l,validationErrors:u,validationDetails:{badInput:s,customError:!1,patternMismatch:!1,rangeOverflow:i,rangeUnderflow:a,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!l}}}let xD={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},xO={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};function xk(e,t){e={...t.shouldForceLeadingZeros?xO:xD,...e};let n=t.granularity||"minute",r=Object.keys(e),o=r.indexOf(t.maxGranularity??"year");o<0&&(o=0);let i=r.indexOf(n);if(i<0&&(i=2),o>i)throw Error("maxGranularity must be greater than granularity");let a=r.slice(o,i+1).reduce((t,n)=>(t[n]=e[n],t),{});return null!=t.hourCycle&&(a.hour12=12===t.hourCycle),a.timeZone=t.timeZone||"UTC",("hour"===n||"minute"===n||"second"===n)&&t.timeZone&&!t.hideTimeZone&&(a.timeZoneName="short"),t.showEra&&0===o&&(a.era="short"),a}function xP(e){return e&&"hour"in e?e:new vG}function xC(e,t){return null===e?null:e?v5(e,t):void 0}function xj(e,t){let n=e&&"timeZone"in e?e.timeZone:void 0,r=e&&"minute"in e?"minute":"day";if(e&&t&&!(t in e))throw Error("Invalid granularity "+t+" for value "+e.toString());let[o,i]=(0,fZ.useState)([r,n]);return e&&(o[0]!==r||o[1]!==n)&&i([r,n]),t||(t=e?r:o[0]),[t,e?n:o[1]]}let xT=new vf({ach:{year:"mwaka",month:"dwe",day:"nino"},af:{year:"jjjj",month:"mm",day:"dd"},am:{year:"ዓዓዓዓ",month:"ሚሜ",day:"ቀቀ"},an:{year:"aaaa",month:"mm",day:"dd"},ar:{year:"سنة",month:"شهر",day:"يوم"},ast:{year:"aaaa",month:"mm",day:"dd"},az:{year:"iiii",month:"aa",day:"gg"},be:{year:"гггг",month:"мм",day:"дд"},bg:{year:"гггг",month:"мм",day:"дд"},bn:{year:"yyyy",month:"মিমি",day:"dd"},br:{year:"bbbb",month:"mm",day:"dd"},bs:{year:"gggg",month:"mm",day:"dd"},ca:{year:"aaaa",month:"mm",day:"dd"},cak:{year:"jjjj",month:"ii",day:"q'q'"},ckb:{year:"ساڵ",month:"مانگ",day:"ڕۆژ"},cs:{year:"rrrr",month:"mm",day:"dd"},cy:{year:"bbbb",month:"mm",day:"dd"},da:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},de:{year:"jjjj",month:"mm",day:"tt"},dsb:{year:"llll",month:"mm",day:"źź"},el:{year:"εεεε",month:"μμ",day:"ηη"},en:{year:"yyyy",month:"mm",day:"dd"},eo:{year:"jjjj",month:"mm",day:"tt"},es:{year:"aaaa",month:"mm",day:"dd"},et:{year:"aaaa",month:"kk",day:"pp"},eu:{year:"uuuu",month:"hh",day:"ee"},fa:{year:"سال",month:"ماه",day:"روز"},ff:{year:"hhhh",month:"ll",day:"\xf1\xf1"},fi:{year:"vvvv",month:"kk",day:"pp"},fr:{year:"aaaa",month:"mm",day:"jj"},fy:{year:"jjjj",month:"mm",day:"dd"},ga:{year:"bbbb",month:"mm",day:"ll"},gd:{year:"bbbb",month:"mm",day:"ll"},gl:{year:"aaaa",month:"mm",day:"dd"},he:{year:"שנה",month:"חודש",day:"יום"},hr:{year:"gggg",month:"mm",day:"dd"},hsb:{year:"llll",month:"mm",day:"dd"},hu:{year:"\xe9\xe9\xe9\xe9",month:"hh",day:"nn"},ia:{year:"aaaa",month:"mm",day:"dd"},id:{year:"tttt",month:"bb",day:"hh"},is:{year:"\xe1\xe1\xe1\xe1",month:"mm",day:"dd"},it:{year:"aaaa",month:"mm",day:"gg"},ja:{year:"年",month:"月",day:"日"},ka:{year:"წწწწ",month:"თთ",day:"რრ"},kk:{year:"жжжж",month:"аа",day:"кк"},kn:{year:"ವವವವ",month:"ಮಿಮೀ",day:"ದಿದಿ"},ko:{year:"연도",month:"월",day:"일"},lb:{year:"jjjj",month:"mm",day:"dd"},lo:{year:"ປປປປ",month:"ດດ",day:"ວວ"},lt:{year:"mmmm",month:"mm",day:"dd"},lv:{year:"gggg",month:"mm",day:"dd"},meh:{year:"aaaa",month:"mm",day:"dd"},ml:{year:"വർഷം",month:"മാസം",day:"തീയതി"},ms:{year:"tttt",month:"mm",day:"hh"},nb:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},nl:{year:"jjjj",month:"mm",day:"dd"},nn:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},no:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},oc:{year:"aaaa",month:"mm",day:"jj"},pl:{year:"rrrr",month:"mm",day:"dd"},pt:{year:"aaaa",month:"mm",day:"dd"},rm:{year:"oooo",month:"mm",day:"dd"},ro:{year:"aaaa",month:"ll",day:"zz"},ru:{year:"гггг",month:"мм",day:"дд"},sc:{year:"aaaa",month:"mm",day:"dd"},scn:{year:"aaaa",month:"mm",day:"jj"},sk:{year:"rrrr",month:"mm",day:"dd"},sl:{year:"llll",month:"mm",day:"dd"},sr:{year:"гггг",month:"мм",day:"дд"},sv:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},szl:{year:"rrrr",month:"mm",day:"dd"},tg:{year:"сссс",month:"мм",day:"рр"},th:{year:"ปปปป",month:"ดด",day:"วว"},tr:{year:"yyyy",month:"aa",day:"gg"},uk:{year:"рррр",month:"мм",day:"дд"},"zh-CN":{year:"年",month:"月",day:"日"},"zh-TW":{year:"年",month:"月",day:"日"}},"en");class xR{constructor(e,t,n){if(this.era=n?.era??null,this.calendar=e,this.year=n?.year??null,this.month=n?.month??null,this.day=n?.day??null,this.hour=n?.hour??null,this.hourCycle=t,this.dayPeriod=null,this.minute=n?.minute??null,this.second=n?.second??null,this.millisecond=n?.millisecond??null,this.offset="offset"in(n??{})?n.offset:null,null!=this.hour){let[e,n]=xN(this.hour,t);this.dayPeriod=e,this.hour=n}}copy(){let e=new xR(this.calendar,this.hourCycle);return e.era=this.era,e.year=this.year,e.month=this.month,e.day=this.day,e.hour=this.hour,e.dayPeriod=this.dayPeriod,e.minute=this.minute,e.second=this.second,e.millisecond=this.millisecond,e.offset=this.offset,e}isComplete(e){return e.every(e=>null!=this[e])}validate(e,t){return t.every(t=>{if(("hour"===t||"dayPeriod"===t)&&"hour"in e){let[t,n]=xN(e.hour,this.hourCycle);return this.dayPeriod===t&&this.hour===n}return this[t]===e[t]})}isCleared(e){return e.every(e=>null===this[e])}set(e,t,n){let r=this.copy();return r[e]=t,"hour"===e&&null==r.dayPeriod&&"hour"in n&&(r.dayPeriod=xN(n.hour,this.hourCycle)[0]),"year"===e&&null==r.era&&(r.era=n.era),"second"!==e&&"literal"!==e&&"timeZoneName"!==e&&(r.offset=null),r}clear(e){let t=this.copy();return t[e]=null,"year"===e&&(t.era=null),t.offset=null,t}cycle(e,t,n,r){let o=this.copy();if(null==o[e]&&"dayPeriod"!==e&&"era"!==e){if("hour"===e&&"hour"in n){let[e,t]=xN(n.hour,this.hourCycle);o.dayPeriod=e,o.hour=t}else o[e]=n[e];return"year"===e&&null==o.era&&(o.era=n.era),o}switch(e){case"era":{let e=this.calendar.getEras(),n=e.indexOf(o.era);n=xA(n,t,0,e.length-1),o.era=e[n];break}case"year":{let r=new vH(this.calendar,this.era??n.era,this.year??n.year,this.month??1,this.day??1);o.era=(r=r.cycle(e,t,{round:"year"===e})).era,o.year=r.year;break}case"month":o.month=xA(o.month??1,t,1,this.calendar.getMaximumMonthsInYear());break;case"day":o.day=xA(o.day??1,t,1,this.calendar.getMaximumDaysInMonth());break;case"hour":{let e=r.some(e=>["year","month","day"].includes(e));if("timeZone"in n&&(!e||null!=o.year&&null!=o.month&&null!=o.day)){let e=this.toValue(n),[r,i]=xN((e=e.cycle("hour",t,{hourCycle:"h12"===this.hourCycle?12:24,round:!1})).hour,this.hourCycle);o.hour=i,o.dayPeriod=r,o.offset=e.offset}else{let e=o.hour??0,r=this.getSegmentLimits("hour");o.hour=xA(e,t,r.minValue,r.maxValue),null==o.dayPeriod&&"hour"in n&&(o.dayPeriod=xN(n.hour,this.hourCycle)[0])}break}case"dayPeriod":o.dayPeriod=xA(o.dayPeriod??0,t,0,1);break;case"minute":o.minute=xA(o.minute??0,t,0,59,!0);break;case"second":o.second=xA(o.second??0,t,0,59,!0)}return o}toValue(e){if(!("hour"in e))return e.set({era:this.era??e.era,year:this.year??e.year,month:this.month??e.month,day:this.day??e.day});{let t=this.hour;null!=t?t=function(e,t,n){switch(n){case"h11":1===t&&(e+=12);break;case"h12":12===e&&(e=0),1===t&&(e+=12);break;case"h24":e-=1}return e}(t,this.dayPeriod??0,this.hourCycle):("h12"===this.hourCycle||"h11"===this.hourCycle)&&(t=12*(1===this.dayPeriod));let n=e.set({era:this.era??e.era,year:this.year??e.year,month:this.month??e.month,day:this.day??e.day,hour:t??e.hour,minute:this.minute??e.minute,second:this.second??e.second,millisecond:this.millisecond??e.millisecond});return"offset"in n&&null!=this.offset&&n.offset!==this.offset&&(n=n.add({milliseconds:n.offset-this.offset})),n}}getSegmentLimits(e){switch(e){case"era":{let e=this.calendar.getEras();return{value:null!=this.era?e.indexOf(this.era):e.length-1,minValue:0,maxValue:e.length-1}}case"year":return{value:this.year,minValue:1,maxValue:9999};case"month":return{value:this.month,minValue:1,maxValue:this.calendar.getMaximumMonthsInYear()};case"day":return{value:this.day,minValue:1,maxValue:this.calendar.getMaximumDaysInMonth()};case"dayPeriod":return{value:this.dayPeriod,minValue:0,maxValue:1};case"hour":{let e=0,t=23;return"h12"===this.hourCycle?(e=1,t=12):"h11"===this.hourCycle&&(e=0,t=11),{value:this.hour,minValue:e,maxValue:t}}case"minute":return{value:this.minute,minValue:0,maxValue:59};case"second":return{value:this.second,minValue:0,maxValue:59}}}}function xA(e,t,n,r,o=!1){if(o){(e+=Math.sign(t))<n&&(e=r);let o=Math.abs(t);(e=t>0?Math.ceil(e/o)*o:Math.floor(e/o)*o)>r&&(e=n)}else(e+=t)<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function xN(e,t){let n=+(e>=12);switch(t){case"h11":e>=12&&(e-=12);break;case"h12":0===e?e=12:e>12&&(e-=12);break;case"h23":n=null;break;case"h24":e+=1,n=null}return[n,e]}var xM=n(19264);let xI={year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!0,dayPeriod:!0,era:!0},x$={year:5,month:2,day:7,hour:2,minute:15,second:15},xL={dayperiod:"dayPeriod",relatedYear:"year",yearName:"literal",unknown:"literal"};function xF(e){let{locale:t,createCalendar:n,hideTimeZone:r,isDisabled:o=!1,isReadOnly:i=!1,isRequired:a=!1,minValue:s,maxValue:l,isDateUnavailable:u}=e,c=e.value||e.defaultValue||e.placeholderValue||null,[d,f]=xj(c,e.granularity),p=f||"UTC";if(c&&!(d in c))throw Error("Invalid granularity "+d+" for value "+c.toString());let[h,m]=(0,fZ.useMemo)(()=>{let r=new vr(t,{dateStyle:"short",timeStyle:"short",hour12:null!=e.hourCycle?12===e.hourCycle:void 0}).resolvedOptions();return[n(r.calendar),r.hourCycle]},[t,e.hourCycle,n]),[y,g]=_x(e.value,e.defaultValue??null,e.onChange),[b]=(0,fZ.useState)(y),v=(0,fZ.useMemo)(()=>xC(y,h)??null,[y,h]),[w,x]=(0,fZ.useState)(()=>new xR(h,m,v)),S="gregory"===h.identifier&&"BC"===w.era,E=(0,fZ.useMemo)(()=>({granularity:d,maxGranularity:e.maxGranularity??"year",timeZone:f,hideTimeZone:r,hourCycle:e.hourCycle,showEra:S,shouldForceLeadingZeros:e.shouldForceLeadingZeros}),[e.maxGranularity,d,e.hourCycle,e.shouldForceLeadingZeros,f,r,S]),D=(0,fZ.useMemo)(()=>xk({},E),[E]),O=(0,fZ.useMemo)(()=>new vr(t,D),[t,D]),k=(0,fZ.useMemo)(()=>O.resolvedOptions(),[O]),P=(0,fZ.useMemo)(()=>(function(e,t,n,r){if(e)return xC(e,n);let o=v5(wr(r??wl()).set({hour:0,minute:0,second:0,millisecond:0}),n);return"year"===t||"month"===t||"day"===t?v3(o):r?o:v6(o)})(e.placeholderValue,d,h,f),[e.placeholderValue,d,h,f]),C=(0,fZ.useMemo)(()=>{let t="h11"===m||"h12"===m,n=["era","year","month","day","hour",...t?["dayPeriod"]:[],"minute","second"],r=n.indexOf(e.maxGranularity||"era"),o=n.indexOf("hour"===d&&t?"dayPeriod":d);return n.slice(r,o+1)},[e.maxGranularity,d,m]),[j,T]=(0,fZ.useState)(v),[R,A]=(0,fZ.useState)(h),[N,M]=(0,fZ.useState)(m);v===j&&m===N&&we(h,R)||(w=new xR(h,m,v),T(v),A(h),M(m),x(w));let I=t=>{if(!e.isDisabled&&!e.isReadOnly)if(null==t||t instanceof xR&&t.isCleared(C))x(new xR(h,m,v)),g(null);else if(t instanceof xR){if(t.isComplete(C)){let e=t.toValue(v??P);if(t.validate(e,C)){let t=v5(e,c?.calendar||new vD);if(!y||0!==t.compare(y)){x(new xR(h,m,v)),g(t);return}}}x(t)}else t=v5(t,c?.calendar||new vD),x(new xR(h,m,v)),g(t)},$=(0,fZ.useMemo)(()=>w.toValue(v??P).toDate(p),[w,p,v,P]),L=(0,fZ.useMemo)(()=>(function(e,t,n,r,o,i,a){let s=["hour","minute","second"],l=n.formatToParts(e),u=new(0,xM.K)(i,{useGrouping:!1}),c=new(0,xM.K)(i,{useGrouping:!1,minimumIntegerDigits:2});for(let e of l)if("year"===e.type||"month"===e.type||"day"===e.type||"hour"===e.type){let n=t[e.type]??0;"2-digit"===r[e.type]?e.value=c.format(n):e.value=u.format(n)}let d=[];for(let e of l){var f;let n=xL[e.type]||e.type,r=xI[n];"era"===n&&1===o.getEras().length&&(r=!1);let l=xI[n]&&null==t[e.type],u=xI[n]?(f=e.value,"era"===n||"dayPeriod"===n?f:"year"===n||"month"===n||"day"===n?xT.getStringForLocale(n,i):"––"):null,c={type:n,text:l?u:e.value,...t.getSegmentLimits(n),isPlaceholder:l,placeholder:u,isEditable:r};"hour"===n?(d.push({type:"literal",text:"⁦",isPlaceholder:!1,placeholder:"",isEditable:!1}),d.push(c),n===a&&d.push({type:"literal",text:"⁩",isPlaceholder:!1,placeholder:"",isEditable:!1})):s.includes(n)&&n===a?(d.push(c),d.push({type:"literal",text:"⁩",isPlaceholder:!1,placeholder:"",isEditable:!1})):d.push(c)}return d})($,w,O,k,h,t,d),[$,O,k,w,h,t,d]),F=(e,t)=>{I(w.cycle(e,t,P,C))},B=(0,fZ.useMemo)(()=>xE(y,s,l,u,E),[y,s,l,u,E]),V=xg({...e,value:y,builtinValidation:B}),U=V.displayValidation.isInvalid,W=e.validationState||(U?"invalid":null);return{...V,value:v,defaultValue:e.defaultValue??b,dateValue:$,calendar:h,setValue:I,segments:L,dateFormatter:O,validationState:W,isInvalid:U,granularity:d,maxGranularity:e.maxGranularity??"year",isDisabled:o,isReadOnly:i,isRequired:a,increment(e){F(e,1)},decrement(e){F(e,-1)},incrementPage(e){F(e,x$[e]||1)},decrementPage(e){F(e,-(x$[e]||1))},incrementToMax(e){let t="hour"===e&&"h12"===m?11:w.getSegmentLimits(e).maxValue;I(w.set(e,t,P))},decrementToMin(e){let t="hour"===e&&"h12"===m?12:w.getSegmentLimits(e).minValue;I(w.set(e,t,P))},setSegment(e,t){I(w.set(e,t,P))},confirmPlaceholder(){if(!e.isDisabled&&!e.isReadOnly&&w.isComplete(C)){let e=v5(w.toValue(v??P),c?.calendar||new vD);y&&0===e.compare(y)||g(e),x(new xR(h,m,v))}},clearSegment(e){let t=w;"timeZoneName"!==e&&"literal"!==e&&(t=w.clear(e)),I(t)},formatValue:e=>v?new vr(t,xk(e,E)).format($):"",getDateFormatter:(e,t)=>new vr(e,xk({},{...E,...t}))}}let xB=(0,fZ.createContext)(null),xV=(0,fZ.createContext)(null),xU=(0,fZ.createContext)(null),xW=(0,fZ.forwardRef)(function(e,t){let n=(0,fZ.useContext)(xV),r=(0,fZ.useContext)(xU);return n||r?fY().createElement(xz,{...e,ref:t}):fY().createElement(xK,{...e,ref:t})}),xK=(0,fZ.forwardRef)((e,t)=>{let[n,r]=gt({slot:e.slot},t,xB),{locale:o}=b5(),i=xF({...n,locale:o,createCalendar:_p}),a=(0,fZ.useRef)(null),{fieldProps:s,inputProps:l}=xc({...n,inputRef:a},i,r);return fY().createElement(y9,{values:[[xV,i],[_U,{...l,ref:a}],[_B,{...s,ref:r,isInvalid:i.isInvalid}]]},fY().createElement(xz,e))}),xz=(0,fZ.forwardRef)((e,t)=>{let{className:n,children:r}=e,o=(0,fZ.useContext)(xV),i=(0,fZ.useContext)(xU),a=null!=o?o:i;return fY().createElement(fY().Fragment,null,fY().createElement(_V,{...e,ref:t,slot:e.slot||void 0,className:null!=n?n:"react-aria-DateInput",isInvalid:a.isInvalid},a.segments.map((e,t)=>(0,fZ.cloneElement)(r(e),{key:t}))),fY().createElement(_W,null))});function xH({children:e}){let t=(0,fZ.useMemo)(()=>({register:()=>{}}),[]);return fY().createElement(by.Provider,{value:t},e)}fY().forwardRef(({children:e,...t},n)=>{let r=(0,fZ.useRef)(!1),o=(0,fZ.useContext)(by),i=y5(o||{},{...t,register(){r.current=!0,o&&o.register()}});return i.ref=yV(n||o?.ref),ba(o,i.ref),(0,fZ.useEffect)(()=>{r.current||(r.current=!0)},[]),fY().createElement(by.Provider,{value:i},e)});let xG=(0,fZ.createContext)({}),xq=fY().createContext(null);function xZ(e){let t=y0(),{portalContainer:n=t?null:document.body,isExiting:r}=e,[o,i]=(0,fZ.useState)(!1),a=(0,fZ.useMemo)(()=>({contain:o,setContain:i}),[o,i]),{getContainer:s}=(0,fZ.useContext)(xG)??{};if(!e.portalContainer&&s&&(n=s()),!n)return null;let l=e.children;return e.disableFocusManagement||(l=fY().createElement(_q,{restoreFocus:!0,contain:(e.shouldContainFocus||o)&&!r},l)),l=fY().createElement(xq.Provider,{value:a},fY().createElement(xH,null,l)),bw.createPortal(l,n)}let xY=(0,fZ.createContext)(null),xJ=(0,fZ.createContext)(null),xQ=(0,fZ.forwardRef)(function(e,t){let n=e["aria-labelledby"];[e,t]=gt(e,t,xY);let{dialogProps:r,titleProps:o}=function(e,t){let n,r,{role:o="dialog"}=e,i=y3();i=e["aria-label"]?void 0:i;let a=(0,fZ.useRef)(!1);return(0,fZ.useEffect)(()=>{if(t.current&&!g_(t.current)){br(t.current);let e=setTimeout(()=>{(((e=document)=>e.activeElement)()===t.current||((e=document)=>e.activeElement)()===document.body)&&(a.current=!0,t.current&&(t.current.blur(),br(t.current)),a.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),n=(0,fZ.useContext)(xq),yz(()=>{r?.(!0)},[r=n?.setContain]),(0,fZ.useRef)(!1),(0,fZ.useEffect)(()=>{}),{dialogProps:{...gh(e,{labelable:!0}),role:o,tabIndex:-1,"aria-labelledby":e["aria-labelledby"]||i,onBlur:e=>{a.current&&e.stopPropagation()}},titleProps:{id:i}}}({...e,"aria-labelledby":n},t),i=(0,fZ.useContext)(xJ);r["aria-label"]||r["aria-labelledby"]||(e["aria-labelledby"]?r["aria-labelledby"]=e["aria-labelledby"]:console.warn('If a Dialog does not contain a <Heading slot="title">, it must have an aria-label or aria-labelledby attribute for accessibility.'));let a=y8({defaultClassName:"react-aria-Dialog",className:e.className,style:e.style,children:e.children,values:{close:(null==i?void 0:i.close)||(()=>{})}});return fY().createElement("section",{...gh(e),...r,...a,ref:t,slot:e.slot||void 0},fY().createElement(y9,{values:[[bK,{slots:{[y7]:{},title:{...o,level:2}}}],[bU,{slots:{[y7]:{},close:{onPress:()=>null==i?void 0:i.close()}}}]]},a.children))}),xX=(0,fZ.createContext)(null),x0=(0,fZ.forwardRef)(function(e,t){let n=(0,fZ.useContext)(xX);return(null==n?void 0:n.isInvalid)?fY().createElement(x1,{...e,ref:t}):null}),x1=(0,fZ.forwardRef)((e,t)=>{let n=(0,fZ.useContext)(xX),r=gh(e),o=y8({...e,defaultClassName:"react-aria-FieldError",defaultChildren:0===n.validationErrors.length?void 0:n.validationErrors.join(" "),values:n});return null==o.children?null:fY().createElement(bH,{slot:"errorMessage",...r,...o,ref:t})}),x2=(0,fZ.createContext)(null),x4=(0,fZ.createContext)({}),x3=bB(function(e,t){[e,t]=gt(e,t,x4);let{elementType:n="label",...r}=e;return fY().createElement(n,{className:"react-aria-Label",...r,ref:t})}),x6=(0,fZ.createContext)({placement:"bottom"}),x5="u">typeof HTMLElement&&"inert"in HTMLElement.prototype,x7=new WeakMap,x9=[];function x8(e,t=-1/0,n=1/0){return Math.min(Math.max(e,t),n)}function Se(e,t){let n=e,r=0,o=t.toString(),i=o.toLowerCase().indexOf("e-");if(i>0)r=Math.abs(Math.floor(Math.log10(Math.abs(t))))+i;else{let e=o.indexOf(".");e>=0&&(r=o.length-e)}if(r>0){let e=Math.pow(10,r);n=Math.round(n*e)/e}return n}function St(e,t,n,r){t=Number(t),n=Number(n);let o=(e-(isNaN(t)?0:t))%r,i=Se(2*Math.abs(o)>=r?e+Math.sign(o)*(r-Math.abs(o)):e-o,r);return isNaN(t)?!isNaN(n)&&i>n&&(i=Math.floor(Se(n/r,r))*r):i<t?i=t:!isNaN(n)&&i>n&&(i=t+Math.floor(Se((n-t)/r,r))*r),i=Se(i,r)}let Sn={top:"top",bottom:"top",left:"left",right:"left"},Sr={top:"bottom",bottom:"top",left:"right",right:"left"},So={top:"left",left:"top"},Si={top:"height",left:"width"},Sa={width:"totalWidth",height:"totalHeight"},Ss={};function Sl(e,t){let n=0,r=0,o=0,i=0,a=0,s=0,l={},u=(t?.scale??1)>1;if("BODY"===e.tagName||"HTML"===e.tagName){let u=document.documentElement;o=u.clientWidth,i=u.clientHeight,n=t?.width??o,r=t?.height??i,l.top=u.scrollTop||e.scrollTop,l.left=u.scrollLeft||e.scrollLeft,t&&(a=t.offsetTop,s=t.offsetLeft)}else({width:n,height:r,top:a,left:s}=Sh(e,!1)),l.top=e.scrollTop,l.left=e.scrollLeft,o=n,i=r;return gV()&&("BODY"===e.tagName||"HTML"===e.tagName)&&u&&(l.top=0,l.left=0,a=t?.pageTop??0,s=t?.pageLeft??0),{width:n,height:r,totalWidth:o,totalHeight:i,scroll:l,top:a,left:s}}function Su(e,t,n,r,o,i,a){let s=o.scroll[e]??0,l=r[Si[e]],u=a[e]+r.scroll[Sn[e]]+i,c=a[e]+r.scroll[Sn[e]]+l-i,d=t-s+r.scroll[Sn[e]]+a[e]-r[Sn[e]],f=t-s+n+r.scroll[Sn[e]]+a[e]-r[Sn[e]];return d<u?u-d:f>c?Math.max(c-f,u-d):0}function Sc(e){if(Ss[e])return Ss[e];let[t,n]=e.split(" "),r=Sn[t]||"right",o=So[r];Sn[n]||(n="center");let i=Si[r],a=Si[o];return Ss[e]={placement:t,crossPlacement:n,axis:r,crossAxis:o,size:i,crossSize:a},Ss[e]}function Sd(e,t,n,r,o,i,a,s,l,u,c){let{placement:d,crossPlacement:f,axis:p,crossAxis:h,size:m,crossSize:y}=r,g={};g[h]=e[h]??0,"center"===f?g[h]+=((e[y]??0)-(n[y]??0))/2:f!==h&&(g[h]+=(e[y]??0)-(n[y]??0)),g[h]+=i;let b=e[h]-n[y]+l+u,v=e[h]+e[y]-l-u;if(g[h]=x8(g[h],b,v),d===p){let t=s?c[m]:c[Sa[m]];g[Sr[p]]=Math.floor(t-e[p]+o)}else g[p]=Math.floor(e[p]+e[m]+o);return g}function Sf(e,t,n,r,o,i,a,s){let{placement:l,axis:u,size:c}=i;return l===u?Math.max(0,n[u]-(a.scroll[u]??0)-(e[u]+(s?t[u]:0))-(r[u]??0)-r[Sr[u]]-o):Math.max(0,e[c]+e[u]+(s?t[u]:0)-n[u]-n[c]+(a.scroll[u]??0)-(r[u]??0)-r[Sr[u]]-o)}function Sp(e,t){let{top:n,left:r,width:o,height:i}=e.getBoundingClientRect();return t&&e instanceof e.ownerDocument.defaultView.HTMLElement&&(o=e.offsetWidth,i=e.offsetHeight),{top:n,left:r,width:o,height:i}}function Sh(e,t){let{top:n,left:r,width:o,height:i}=Sp(e,t),{scrollTop:a,scrollLeft:s,clientTop:l,clientLeft:u}=document.documentElement;return{top:n+a-l,left:r+s-u,width:o,height:i}}function Sm(e,t,n){let r,o=window.getComputedStyle(e);if("fixed"===o.position)r=Sp(e,n);else{r=Sh(e,n);let o=Sh(t,n),i=window.getComputedStyle(t);o.top+=(parseInt(i.borderTopWidth,10)||0)-t.scrollTop,o.left+=(parseInt(i.borderLeftWidth,10)||0)-t.scrollLeft,r.top-=o.top,r.left-=o.left}return r.top-=parseInt(o.marginTop,10)||0,r.left-=parseInt(o.marginLeft,10)||0,r}function Sy(e){let t=window.getComputedStyle(e);return"none"!==t.transform||/transform|perspective/.test(t.willChange)||"none"!==t.filter||"paint"===t.contain||"backdropFilter"in t&&"none"!==t.backdropFilter||"WebkitBackdropFilter"in t&&"none"!==t.WebkitBackdropFilter}let Sg=new WeakMap;function Sb(e){let{ref:t,box:n,onResize:r}=e,o=bb(r);(0,fZ.useEffect)(()=>{let e=t?.current;if(e)if(void 0===window.ResizeObserver)return window.addEventListener("resize",o,!1),()=>{window.removeEventListener("resize",o,!1)};else{let t=new window.ResizeObserver(e=>{e.length&&o()});return t.observe(e,{box:n}),()=>{e&&t.unobserve(e)}}},[t,n])}let Sv="u">typeof document?window.visualViewport:null;function Sw(e,t){if(e.button>0)return!1;let n=gw(e);if(n){let e=n.ownerDocument;if(!e||!gv(e.documentElement,n)||n.closest("[data-react-aria-top-layer]"))return!1}return!!t.current&&!e.composedPath().includes(t.current)}let S_=[],Sx=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function SS(e){return e instanceof HTMLInputElement&&!Sx.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}let SE="u">typeof document&&window.visualViewport,SD=0;function SO(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Sk(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function SP(e,t){t||!SE?SC(e):SE.addEventListener("resize",()=>SC(e),{once:!0})}function SC(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let e=wC(n);if(e!==document.documentElement&&e!==document.body&&e!==n){let t=e.getBoundingClientRect(),r=n.getBoundingClientRect();if(r.top<t.top||r.bottom>t.top+n.clientHeight){let n=t.bottom;SE&&(n=Math.min(n,SE.offsetTop+SE.height));let o=r.top-t.top-((n-t.top)/2-r.height/2);e.scrollTo({top:Math.max(0,Math.min(e.scrollHeight-e.clientHeight,e.scrollTop+o)),behavior:"smooth"})}}n=e.parentElement}}var Sj={};function ST(e){var t;let{onDismiss:n,...r}=e,o=wx(r,vb((t=Sj)&&t.__esModule?t.default:t,"@react-aria/overlays").format("dismiss"));return fY().createElement(wO,null,fY().createElement("button",{...o,tabIndex:-1,onClick:()=>{n&&n()},style:{width:1,height:1}}))}function SR(e,t,n){yz(()=>{if(t&&e.current){if(!("getAnimations"in e.current))return void n();let t=e.current.getAnimations();if(0===t.length)return void n();let r=!1;return Promise.allSettled(t.map(e=>e.finished)).then(()=>{r||(0,bw.flushSync)(()=>{n()})}),()=>{r=!0}}},[e,t,n])}Sj={"ar-AE":{dismiss:"تجاهل"},"bg-BG":{dismiss:"Отхвърляне"},"cs-CZ":{dismiss:"Odstranit"},"da-DK":{dismiss:"Luk"},"de-DE":{dismiss:"Schlie\xdfen"},"el-GR":{dismiss:"Απόρριψη"},"en-US":{dismiss:"Dismiss"},"es-ES":{dismiss:"Descartar"},"et-EE":{dismiss:"L\xf5peta"},"fi-FI":{dismiss:"Hylk\xe4\xe4"},"fr-FR":{dismiss:"Rejeter"},"he-IL":{dismiss:"התעלם"},"hr-HR":{dismiss:"Odbaci"},"hu-HU":{dismiss:"Elutas\xedt\xe1s"},"it-IT":{dismiss:"Ignora"},"ja-JP":{dismiss:"閉じる"},"ko-KR":{dismiss:"무시"},"lt-LT":{dismiss:"Atmesti"},"lv-LV":{dismiss:"Nerādīt"},"nb-NO":{dismiss:"Lukk"},"nl-NL":{dismiss:"Negeren"},"pl-PL":{dismiss:"Zignoruj"},"pt-BR":{dismiss:"Descartar"},"pt-PT":{dismiss:"Dispensar"},"ro-RO":{dismiss:"Revocare"},"ru-RU":{dismiss:"Пропустить"},"sk-SK":{dismiss:"Zrušiť"},"sl-SI":{dismiss:"Opusti"},"sr-SP":{dismiss:"Odbaci"},"sv-SE":{dismiss:"Avvisa"},"tr-TR":{dismiss:"Kapat"},"uk-UA":{dismiss:"Скасувати"},"zh-CN":{dismiss:"取消"},"zh-TW":{dismiss:"關閉"}};let SA=null,SN=new Set,SM=new Map,SI=!1,S$=!1;function SL(e,t){for(let n of SN)n(e,t)}function SF(e){SI=!0,e.metaKey||!g$()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key||(SA="keyboard",SL("keyboard",e))}function SB(e){SA="pointer",("mousedown"===e.type||"pointerdown"===e.type)&&(SI=!0,SL("pointer",e))}function SV(e){gz(e)&&(SI=!0,SA="virtual")}function SU(e){e.target!==window&&e.target!==document&&e.isTrusted&&(SI||S$||(SA="virtual",SL("virtual",e)),SI=!1,S$=!1)}function SW(){SI=!1,S$=!0}function SK(e){if("u"<typeof window||SM.get(gb(e)))return;let t=gb(e),n=gg(e),r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){SI=!0,r.apply(this,arguments)},n.addEventListener("keydown",SF,!0),n.addEventListener("keyup",SF,!0),n.addEventListener("click",SV,!0),t.addEventListener("focus",SU,!0),t.addEventListener("blur",SW,!1),"u">typeof PointerEvent?(n.addEventListener("pointerdown",SB,!0),n.addEventListener("pointermove",SB,!0),n.addEventListener("pointerup",SB,!0)):(n.addEventListener("mousedown",SB,!0),n.addEventListener("mousemove",SB,!0),n.addEventListener("mouseup",SB,!0)),t.addEventListener("beforeunload",()=>{Sz(e)},{once:!0}),SM.set(t,{focus:r})}let Sz=(e,t)=>{let n=gb(e),r=gg(e);t&&r.removeEventListener("DOMContentLoaded",t),SM.has(n)&&(n.HTMLElement.prototype.focus=SM.get(n).focus,r.removeEventListener("keydown",SF,!0),r.removeEventListener("keyup",SF,!0),r.removeEventListener("click",SV,!0),n.removeEventListener("focus",SU,!0),n.removeEventListener("blur",SW,!1),"u">typeof PointerEvent?(r.removeEventListener("pointerdown",SB,!0),r.removeEventListener("pointermove",SB,!0),r.removeEventListener("pointerup",SB,!0)):(r.removeEventListener("mousedown",SB,!0),r.removeEventListener("mousemove",SB,!0),r.removeEventListener("mouseup",SB,!0)),SM.delete(n))};function SH(e){let[t,n]=_x(e.isOpen,e.defaultOpen||!1,e.onOpenChange),r=(0,fZ.useCallback)(()=>{n(!0)},[n]),o=(0,fZ.useCallback)(()=>{n(!1)},[n]),i=(0,fZ.useCallback)(()=>{n(!t)},[n,t]);return{isOpen:t,setOpen:n,open:r,close:o,toggle:i}}"u">typeof document&&("loading"!==(m=gg(void 0)).readyState?SK(void 0):m.addEventListener("DOMContentLoaded",()=>{SK(void 0)}));let SG=(0,fZ.createContext)(null),Sq=(0,fZ.createContext)(null),SZ=(0,fZ.forwardRef)(function(e,t){[e,t]=gt(e,t,SG);let n=(0,fZ.useContext)(xJ),r=SH(e),o=null==e.isOpen&&null==e.defaultOpen&&n?n:r,i=function(e,t){let[n,r]=(0,fZ.useState)(t?"open":"closed");switch(n){case"open":t||r("exiting");break;case"closed":case"exiting":t&&r("open")}let o="exiting"===n;return SR(e,o,(0,fZ.useCallback)(()=>{r(e=>"exiting"===e?"closed":e)},[])),o}(t,o.isOpen)||e.isExiting||!1,a=(0,fZ.useContext)(bF),{direction:s}=b5();if(a){let t=e.children;return"function"==typeof t&&(t=t({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),fY().createElement(fY().Fragment,null,t)}return!o||o.isOpen||i?fY().createElement(SY,{...e,triggerRef:e.triggerRef,state:o,popoverRef:t,isExiting:i,dir:s}):null});function SY({state:e,isExiting:t,UNSTABLE_portalContainer:n,...r}){var o,i;let a=(0,fZ.useRef)(null),[s,l]=(0,fZ.useState)(0),u=(0,fZ.useRef)(null),c=(0,fZ.useContext)(Sq),f=c&&"SubmenuTrigger"===r.trigger;yz(()=>{a.current&&e.isOpen&&l(a.current.getBoundingClientRect().width)},[e.isOpen,a]);let{popoverProps:p,underlayProps:h,arrowProps:m,placement:y}=function(e,t){let{triggerRef:n,popoverRef:r,groupRef:o,isNonModal:i,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:s,...l}=e,u="SubmenuTrigger"===l.trigger,{overlayProps:c,underlayProps:f}=function(e,t){let{onClose:n,shouldCloseOnBlur:r,isOpen:o,isDismissable:i=!1,isKeyboardDismissDisabled:a=!1,shouldCloseOnInteractOutside:s}=e,l=(0,fZ.useRef)(void 0);(0,fZ.useEffect)(()=>{if(o&&!S_.includes(t))return S_.push(t),()=>{let e=S_.indexOf(t);e>=0&&S_.splice(e,1)}},[o,t]);let u=()=>{S_[S_.length-1]===t&&n&&n()};!function(e){let{ref:t,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:o}=e,i=(0,fZ.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),a=bb(e=>{n&&Sw(e,t)&&(o&&o(e),i.current.isPointerDown=!0)}),s=bb(e=>{n&&n(e)});(0,fZ.useEffect)(()=>{let e=i.current;if(r)return;let n=gg(t.current);if("u">typeof PointerEvent){let r=n=>{e.isPointerDown&&Sw(n,t)&&s(n),e.isPointerDown=!1};return n.addEventListener("pointerdown",a,!0),n.addEventListener("click",r,!0),()=>{n.removeEventListener("pointerdown",a,!0),n.removeEventListener("click",r,!0)}}},[t,r])}({ref:t,onInteractOutside:i&&o?e=>{(!s||s(gw(e)))&&(S_[S_.length-1]===t&&e.stopPropagation(),l.current===t&&u()),l.current=void 0}:void 0,onInteractOutsideStart:e=>{let n=S_[S_.length-1];l.current=n,(!s||s(gw(e)))&&n===t&&e.stopPropagation()}});let{focusWithinProps:c}=bR({isDisabled:!r,onBlurWithin:e=>{!(!e.relatedTarget||_Q(e.relatedTarget,_G))&&(!s||s(e.relatedTarget))&&n?.()}});return{overlayProps:{onKeyDown:e=>{"Escape"!==e.key||a||e.nativeEvent.isComposing||(e.stopPropagation(),e.preventDefault(),u())},...c},underlayProps:{}}}({isOpen:t.isOpen,onClose:t.close,shouldCloseOnBlur:!0,isDismissable:!i||u,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:s},o??r),{overlayProps:p,arrowProps:h,placement:m,triggerAnchorPoint:y}=function(e){var t;let{direction:n}=b5(),{arrowSize:r,targetRef:o,overlayRef:i,arrowRef:a,scrollRef:s=i,placement:l="bottom",containerPadding:u=12,shouldFlip:c=!0,boundaryElement:d="u">typeof document?document.body:null,offset:f=0,crossOffset:p=0,shouldUpdatePosition:h=!0,isOpen:m=!0,onClose:y,maxHeight:g,arrowBoundaryOffset:b=0}=e,[v,w]=(0,fZ.useState)(null),x=[h,l,i.current,o.current,a?.current,s.current,u,c,d,f,p,m,n,g,b,r],S=(0,fZ.useRef)(Sv?.scale);(0,fZ.useEffect)(()=>{m&&(S.current=Sv?.scale)},[m]);let E=(0,fZ.useCallback)(()=>{var e;if(!1===h||!m||!i.current||!o.current||!d||Sv?.scale!==S.current)return;let t=null;if(s.current&&g_(s.current)){let e=((e=document)=>e.activeElement)()?.getBoundingClientRect(),n=s.current.getBoundingClientRect();(t={type:"top",offset:(e?.top??0)-n.top}).offset>n.height/2&&(t.type="bottom",t.offset=(e?.bottom??0)-n.bottom)}let y=i.current;!g&&i.current&&(y.style.top="0px",y.style.bottom="",y.style.maxHeight=(window.visualViewport?.height??window.innerHeight)+"px");let v=function(e){let t,n,{placement:r,targetNode:o,overlayNode:i,scrollNode:a,padding:s,shouldFlip:l,boundaryElement:u,offset:c,crossOffset:d,maxHeight:f,arrowSize:p=0,arrowBoundaryOffset:h=0}=e,m="u">typeof document?window.visualViewport:null,y=i instanceof HTMLElement?function(e){let t=e.offsetParent;if(t&&t===document.body&&"static"===window.getComputedStyle(t).position&&!Sy(t)&&(t=document.documentElement),null==t)for(t=e.parentElement;t&&!Sy(t);)t=t.parentElement;return t||document.documentElement}(i):document.documentElement,g=y===document.documentElement,b=window.getComputedStyle(y).position,v=g?Sh(o,!1):Sm(o,y,!1);if(!g){let{marginTop:e,marginLeft:t}=window.getComputedStyle(o);v.top+=parseInt(e,10)||0,v.left+=parseInt(t,10)||0}let w=Sh(i,!0),x={top:parseInt((t=window.getComputedStyle(i)).marginTop,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0,right:parseInt(t.marginRight,10)||0};w.width+=(x.left??0)+(x.right??0),w.height+=(x.top??0)+(x.bottom??0),a.scrollTop,a.scrollLeft,a.scrollWidth,a.scrollHeight;let S=Sl(u,m),E=Sl(y,m);if("BODY"!==u.tagName&&"HTML"!==u.tagName||g)n=("BODY"===u.tagName||"HTML"===u.tagName)&&g?{top:0,left:0,width:0,height:0}:Sm(u,y,!1);else{let e=Sp(y,!1);n={top:-(e.top-S.top),left:-(e.left-S.left),width:0,height:0}}return function(e,t,n,r,o,i,a,s,l,u,c,d,f,p,h,m,y){var g,b,v;let w,x,S,E=Sc(e),{size:D,crossAxis:O,crossSize:k,placement:P,crossPlacement:C}=E,j=Sd(t,a,n,E,u,c,l,d,p,h,s),T=u,R=Sf(a,l,t,r,o+u,E,s,m);if(i&&n[D]>R){let e=Sc(`${Sr[P]} ${C}`),i=Sd(t,a,n,e,u,c,l,d,p,h,s);Sf(a,l,t,r,o+u,e,s,m)>R&&(E=e,j=i,T=u)}let A="bottom";"top"===E.axis?"top"===E.placement?A="top":"bottom"===E.placement&&(A="bottom"):"top"===E.crossAxis&&("top"===E.crossPlacement?A="bottom":"bottom"===E.crossPlacement&&(A="top"));let N=Su(O,j[O],n[k],a,s,o,l);j[O]+=N;let M=(g=j,b=n.height,v=A,w=(null!=g.top?g.top:s[Sa.height]-(g.bottom??0)-b)-(s.scroll.top??0),x=m?l.top:0,S={top:Math.max(a.top+x,(y?.offsetTop??a.top)+x),bottom:Math.min(a.top+a.height+x,(y?.offsetTop??0)+(y?.height??0))},"top"!==v?Math.max(0,S.bottom-w-((r.top??0)+(r.bottom??0)+o)):Math.max(0,w+b-S.top-((r.top??0)+(r.bottom??0)+o)));f&&f<M&&(M=f),n.height=Math.min(n.height,M),N=Su(O,(j=Sd(t,a,n,E,T,c,l,d,p,h,s))[O],n[k],a,s,o,l),j[O]+=N;let I={},$=t[O]-j[O]-r[Sn[O]],L=$+.5*t[k],F=p/2+h,B="left"===Sn[O]?(r.left??0)+(r.right??0):(r.top??0)+(r.bottom??0),V=n[k]-B-p/2-h,U=x8(L,t[O]+p/2-(j[O]+r[Sn[O]]),t[O]+t[k]-p/2-(j[O]+r[Sn[O]]));I[O]=x8(U,F,V),({placement:P,crossPlacement:C}=E),p?$=I[O]:"right"===C?$+=t[k]:"center"===C&&($+=t[k]/2);let W="left"===P||"top"===P?n[D]:0,K={x:"top"===P||"bottom"===P?$:W,y:"left"===P||"right"===P?$:W};return{position:j,maxHeight:M,arrowOffsetLeft:I.left,arrowOffsetTop:I.top,placement:P,triggerAnchorPoint:K}}(r,v,w,x,s,l,S,E,n,c,d,!!b&&"static"!==b,f,p,h,gv(u,y),m)}({placement:(e=l,"rtl"===n?e.replace("start","right").replace("end","left"):e.replace("start","left").replace("end","right")),overlayNode:i.current,targetNode:o.current,scrollNode:s.current||i.current,padding:u,shouldFlip:c,boundaryElement:d,offset:f,crossOffset:p,maxHeight:g,arrowSize:r??(a?.current?Sp(a.current,!0).width:0),arrowBoundaryOffset:b});if(!v.position)return;y.style.top="",y.style.bottom="",y.style.left="",y.style.right="",Object.keys(v.position).forEach(e=>y.style[e]=v.position[e]+"px"),y.style.maxHeight=null!=v.maxHeight?v.maxHeight+"px":"";let x=((e=document)=>e.activeElement)();if(t&&x&&s.current){let e=x.getBoundingClientRect(),n=s.current.getBoundingClientRect(),r=e[t.type]-n[t.type];s.current.scrollTop+=r-t.offset}w(v)},x);yz(E,x),yz(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t=E]),Sb({ref:i,onResize:E}),Sb({ref:o,onResize:E});let D=(0,fZ.useRef)(!1);yz(()=>{let e,t=()=>{D.current=!0,clearTimeout(e),e=setTimeout(()=>{D.current=!1},500),E()},n=()=>{D.current&&t()};return Sv?.addEventListener("resize",t),Sv?.addEventListener("scroll",n),()=>{Sv?.removeEventListener("resize",t),Sv?.removeEventListener("scroll",n)}},[E]);let O=(0,fZ.useCallback)(()=>{D.current||y?.()},[y,D]);return!function(e){let{triggerRef:t,isOpen:n,onClose:r}=e;(0,fZ.useEffect)(()=>{if(!n||null===r)return;let e=e=>{let n=gw(e);if(!t.current||n instanceof Node&&!gv(n,t.current)||n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)return;let o=r||Sg.get(t.current);o&&o()};return window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}},[n,r,t])}({triggerRef:o,isOpen:m,onClose:y&&O}),{overlayProps:{style:{position:v?"absolute":"fixed",top:v?void 0:0,left:v?void 0:0,zIndex:1e5,...v?.position,maxHeight:v?.maxHeight??"100vh"}},placement:v?.placement??null,triggerAnchorPoint:v?.triggerAnchorPoint??null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:v?.arrowOffsetLeft,top:v?.arrowOffsetTop}},updatePosition:E}}({...l,targetRef:n,overlayRef:r,isOpen:t.isOpen,onClose:i&&!u?t.close:null});return!function(e={}){let{isDisabled:t}=e;yz(()=>{if(!t){let e,t,n,r,o,i,a,s;return 1==++SD&&(d=gB()?(t=SO(document.documentElement,"overflow","hidden"),n=!1,r=document.createElement("style"),(o=bm())&&(r.nonce=o),r.textContent=`
38
+ `.trim(),e.head.prepend(t)},[f]),(0,fZ.useEffect)(()=>{let e=y.current;return()=>{for(let t of(d||bf(e.target??void 0),e.disposables))t();e.disposables=[]}},[d]),{isPressed:l||h,pressProps:y5(p,C,{[bE]:!0})}}function bO(e){return"A"===e.tagName&&e.hasAttribute("href")}function bP(e,t){let{key:n,code:r}=e,o=t.getAttribute("role");return("Enter"===n||" "===n||"Spacebar"===n||"Space"===r)&&!(t instanceof gb(t).HTMLInputElement&&!bT(t,n)||t instanceof gb(t).HTMLTextAreaElement||t.isContentEditable)&&!(("link"===o||!o&&bO(t))&&"Enter"!==n)}function bk(e,t){let n=t.clientX,r=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r,key:t.key}}function bC(e,t){return e instanceof HTMLInputElement?!bT(e,t):!(e instanceof HTMLInputElement)&&(e instanceof HTMLButtonElement?"submit"!==e.type&&"reset"!==e.type:!bO(e))}let bj=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function bT(e,t){return"checkbox"===e.type||"radio"===e.type?" "===t:bj.has(e.type)}function bR(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=(0,fZ.useRef)({isFocusWithin:!1}),{addGlobalListener:a,removeAllGlobalListeners:s}=bv(),l=(0,fZ.useCallback)(e=>{gv(e.currentTarget,gw(e))&&i.current.isFocusWithin&&!gv(e.currentTarget,e.relatedTarget)&&(i.current.isFocusWithin=!1,s(),n&&n(e),o&&o(!1))},[n,o,i,s]),u=gR(l),c=(0,fZ.useCallback)(e=>{if(!gv(e.currentTarget,gw(e)))return;let t=gw(e),n=gg(t),s=((e=document)=>e.activeElement)(n);if(!i.current.isFocusWithin&&s===t){r&&r(e),o&&o(!0),i.current.isFocusWithin=!0,u(e);let t=e.currentTarget;a(n,"focus",e=>{let r=gw(e);if(i.current.isFocusWithin&&!gv(t,r)){let e=new n.defaultView.FocusEvent("blur",{relatedTarget:r});gT(e,t),l(gj(e))}},{capture:!0})}},[r,o,u,a,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:l}}}function bA(e={}){var t;let{autoFocus:n=!1,isTextInput:r,within:o}=e,i=(0,fZ.useRef)({isFocused:!1,isFocusVisible:n||g7()}),[a,s]=(0,fZ.useState)(!1),[l,u]=(0,fZ.useState)(()=>i.current.isFocused&&i.current.isFocusVisible),c=(0,fZ.useCallback)(()=>u(i.current.isFocused&&i.current.isFocusVisible),[]),d=(0,fZ.useCallback)(e=>{i.current.isFocused=e,i.current.isFocusVisible=g7(),s(e),c()},[c]);t={enabled:a,isTextInput:r},g6(),(0,fZ.useEffect)(()=>{if(t?.enabled===!1)return;let e=(e,n)=>{var r;let o,a,s,l,u,d,f,p;r=!!t?.isTextInput,a=gg(o=n?gw(n):void 0),l=void 0!==(s=gb(o))?s.HTMLInputElement:HTMLInputElement,u=void 0!==s?s.HTMLTextAreaElement:HTMLTextAreaElement,d=void 0!==s?s.HTMLElement:HTMLElement,f=void 0!==s?s.KeyboardEvent:KeyboardEvent,p=((e=document)=>e.activeElement)(a),(r=r||p instanceof l&&!g9.has(p.type)||p instanceof u||p instanceof d&&p.isContentEditable)&&"keyboard"===e&&n instanceof f&&!gQ[n.key]||(e=>{i.current.isFocusVisible=e,c()})(g7())};return gq.add(e),()=>{gq.delete(e)}},[r,a]);let{focusProps:f}=bo({isDisabled:o,onFocusChange:d}),{focusWithinProps:p}=bR({isDisabled:!o,onFocusWithinChange:d});return{isFocused:a,isFocusVisible:l,focusProps:o?p:f}}let bM=!1,bN=0;function bI(e){"touch"===e.pointerType&&(bM=!0,setTimeout(()=>{bM=!1},500))}function b$(){let e=gg(null);if(void 0!==e)return 0===bN&&"u">typeof PointerEvent&&e.addEventListener("pointerup",bI),bN++,()=>{!(--bN>0)&&"u">typeof PointerEvent&&e.removeEventListener("pointerup",bI)}}function bL(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,a]=(0,fZ.useState)(!1),s=(0,fZ.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;(0,fZ.useEffect)(b$,[]);let{addGlobalListener:l,removeAllGlobalListeners:u}=bv(),{hoverProps:c,triggerHoverEnd:d}=(0,fZ.useMemo)(()=>{let e=(e,t)=>{let o=s.target;s.pointerType="",s.target=null,"touch"!==t&&s.isHovered&&o&&(s.isHovered=!1,u(),r&&r({type:"hoverend",target:o,pointerType:t}),n&&n(!1),a(!1))},i={};return"u">typeof PointerEvent&&(i.onPointerEnter=r=>{bM&&"mouse"===r.pointerType||((r,i)=>{if(s.pointerType=i,o||"touch"===i||s.isHovered||!gv(r.currentTarget,gw(r)))return;s.isHovered=!0;let u=r.currentTarget;s.target=u,l(gg(gw(r)),"pointerover",t=>{s.isHovered&&s.target&&!gv(s.target,gw(t))&&e(t,t.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:u,pointerType:i}),n&&n(!0),a(!0)})(r,r.pointerType)},i.onPointerLeave=t=>{!o&&gv(t.currentTarget,gw(t))&&e(t,t.pointerType)}),{hoverProps:i,triggerHoverEnd:e}},[t,n,r,o,s,l,u]);return(0,fZ.useEffect)(()=>{o&&d({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:c,isHovered:i}}if("u">typeof HTMLTemplateElement){let e=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild").get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}let bF=(0,fZ.createContext)(!1);function bB(e){let t=(t,n)=>(0,fZ.useContext)(bF)?null:e(t,n);return t.displayName=e.displayName||e.name,(0,fZ.forwardRef)(t)}let bV=new Set(["form","formAction","formEncType","formMethod","formNoValidate","formTarget","name","value"]),bU=(0,fZ.createContext)({}),bW=bB(function(e,t){var n;[e,t]=gt(e,t,bU);let r=((n=e).isPending&&(n.onPress=void 0,n.onPressStart=void 0,n.onPressEnd=void 0,n.onPressChange=void 0,n.onPressUp=void 0,n.onKeyDown=void 0,n.onKeyUp=void 0,n.onClick=void 0,n.href=void 0),e=n),{isPending:o}=r,{buttonProps:i,isPressed:a}=function(e,t){let n,{elementType:r="button",isDisabled:o,onPress:i,onPressStart:a,onPressEnd:s,onPressUp:l,onPressChange:u,preventFocusOnPress:c,allowFocusWhenDisabled:d,onClick:f,href:p,target:h,rel:m,type:y="button"}=e;n="button"===r?{type:y,disabled:o,form:e.form,formAction:e.formAction,formEncType:e.formEncType,formMethod:e.formMethod,formNoValidate:e.formNoValidate,formTarget:e.formTarget,name:e.name,value:e.value}:{role:"button",href:"a"!==r||o?void 0:p,target:"a"===r?h:void 0,type:"input"===r?y:void 0,disabled:"input"===r?o:void 0,"aria-disabled":o&&"input"!==r?o:void 0,rel:"a"===r?m:void 0};let{pressProps:g,isPressed:b}=bD({onPressStart:a,onPressEnd:s,onPressChange:u,onPress:i,onPressUp:l,onClick:f,isDisabled:o,preventFocusOnPress:c,ref:t}),{focusableProps:v}=bl(e,t);d&&(v.tabIndex=o?-1:v.tabIndex);let w=y5(v,g,gh(e,{labelable:!0}));return{isPressed:b,buttonProps:y5(n,w,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],"aria-current":e["aria-current"],"aria-disabled":e["aria-disabled"]})}}(e,t),{focusProps:s,isFocused:l,isFocusVisible:u}=bA(e),{hoverProps:c,isHovered:d}=bL({...e,isDisabled:e.isDisabled||o}),f={isHovered:d,isPressed:(r.isPressed||a)&&!o,isFocused:l,isFocusVisible:u,isDisabled:e.isDisabled||!1,isPending:null!=o&&o},p=y8({...e,values:f,defaultClassName:"react-aria-Button"}),h=y4(i.id),m=y4(),y=i["aria-labelledby"];o&&(y?y=`${y} ${m}`:i["aria-label"]&&(y=`${h} ${m}`));let g=(0,fZ.useRef)(o);return(0,fZ.useEffect)(()=>{let e={"aria-labelledby":y||h};!g.current&&l&&o?ga(e,"assertive"):g.current&&l&&!o&&ga(e,"assertive"),g.current=o},[o,l,y,h]),fY().createElement("button",{...gh(e,{propNames:bV}),...y5(i,s,c),...p,type:"submit"===i.type&&o?"button":i.type,id:h,ref:t,"aria-labelledby":y,slot:e.slot||void 0,"aria-disabled":o?"true":i["aria-disabled"],"data-disabled":e.isDisabled||void 0,"data-pressed":f.isPressed||void 0,"data-hovered":d||void 0,"data-focused":l||void 0,"data-pending":o||void 0,"data-focus-visible":u||void 0},fY().createElement(go.Provider,{value:{id:m}},p.children))});(0,fZ.createContext)(null),(0,fZ.createContext)(null),(0,fZ.createContext)(null),(0,fZ.createContext)(null),(0,fZ.createContext)(null);let bK=(0,fZ.createContext)({}),bz=(0,fZ.createContext)({}),bH=(0,fZ.forwardRef)(function(e,t){[e,t]=gt(e,t,bz);let{elementType:n="span",...r}=e;return fY().createElement(n,{className:"react-aria-Text",...r,ref:t})}),bG=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),bq=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function bZ(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize(),n="function"==typeof t.getTextInfo?t.getTextInfo():t.textInfo;if(n)return"rtl"===n.direction;if(t.script)return bG.has(t.script)}let t=e.split("-")[0];return bq.has(t)}let bY=Symbol.for("react-aria.i18n.locale");function bJ(){let e="u">typeof window&&window[bY]||"u">typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:bZ(e)?"rtl":"ltr"}}let bQ=bJ(),bX=new Set;function b0(){for(let e of(bQ=bJ(),bX))e(bQ)}function b1(){let e=y0(),[t,n]=(0,fZ.useState)(bQ);return((0,fZ.useEffect)(()=>(0===bX.size&&window.addEventListener("languagechange",b0),bX.add(n),()=>{bX.delete(n),0===bX.size&&window.removeEventListener("languagechange",b0)}),[]),e)?{locale:"u">typeof window&&window[bY]||"en-US",direction:"ltr"}:t}let b2=fY().createContext(null);function b4(e){let{locale:t,children:n}=e,r=fY().useMemo(()=>({locale:t,direction:bZ(t)?"rtl":"ltr"}),[t]);return fY().createElement(b2.Provider,{value:r},n)}function b3(e){let{children:t}=e,n=b1();return fY().createElement(b2.Provider,{value:n},t)}function b6(e){let{locale:t,children:n}=e;return t?fY().createElement(b4,{locale:t,children:n}):fY().createElement(b3,{children:n})}function b5(){let e=b1();return(0,fZ.useContext)(b2)||e}let b7=null;function b9(e,t="assertive",n=7e3){b7?b7.announce(e,t,n):(b7=new b8,("boolean"==typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:"u">typeof jest)?b7.announce(e,t,n):setTimeout(()=>{b7?.isAttached()&&b7?.announce(e,t,n)},100))}class b8{constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,"u">typeof document&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}isAttached(){return this.node?.isConnected}createLog(e){let t=document.createElement("div");return t.setAttribute("role","log"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions"),t}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,t="assertive",n=7e3){if(!this.node)return;let r=document.createElement("div");"object"==typeof e?(r.setAttribute("role","img"),r.setAttribute("aria-labelledby",e["aria-labelledby"])):r.textContent=e,"assertive"===t?this.assertiveLog?.appendChild(r):this.politeLog?.appendChild(r),""!==e&&setTimeout(()=>{r.remove()},n)}clear(e){this.node&&((!e||"assertive"===e)&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||"polite"===e)&&this.politeLog&&(this.politeLog.innerHTML=""))}}var ve={};function vt(e,t){let n=(0,fZ.useRef)(null);return e&&n.current&&t(e,n.current)&&(e=n.current),n.current=e,e}ve={"ar-AE":{dateRange:e=>`${e.startDate} \u{625}\u{644}\u{649} ${e.endDate}`,dateSelected:e=>`${e.date} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}`,finishRangeSelectionPrompt:"انقر لإنهاء عملية تحديد نطاق التاريخ",maximumDate:"آخر تاريخ متاح",minimumDate:"أول تاريخ متاح",next:"التالي",previous:"السابق",selectedDateDescription:e=>`\u{62A}\u{627}\u{631}\u{64A}\u{62E} \u{645}\u{62D}\u{62F}\u{62F}: ${e.date}`,selectedRangeDescription:e=>`\u{627}\u{644}\u{645}\u{62F}\u{649} \u{627}\u{644}\u{632}\u{645}\u{646}\u{64A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.dateRange}`,startRangeSelectionPrompt:"انقر لبدء عملية تحديد نطاق التاريخ",todayDate:e=>`\u{627}\u{644}\u{64A}\u{648}\u{645}\u{60C} ${e.date}`,todayDateSelected:e=>`\u{627}\u{644}\u{64A}\u{648}\u{645}\u{60C} ${e.date} \u{645}\u{62D}\u{62F}\u{62F}`},"bg-BG":{dateRange:e=>`${e.startDate} \u{434}\u{43E} ${e.endDate}`,dateSelected:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{43E} \u{435} ${e.date}`,finishRangeSelectionPrompt:"Натиснете, за да довършите избора на времеви интервал",maximumDate:"Последна налична дата",minimumDate:"Първа налична дата",next:"Напред",previous:"Назад",selectedDateDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:"Натиснете, за да пристъпите към избора на времеви интервал",todayDate:e=>`\u{414}\u{43D}\u{435}\u{441}, ${e.date}`,todayDateSelected:e=>`\u{414}\u{43D}\u{435}\u{441}, ${e.date} \u{441}\u{430} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{438}`},"cs-CZ":{dateRange:e=>`${e.startDate} a\u{17E} ${e.endDate}`,dateSelected:e=>`Vybr\xe1no ${e.date}`,finishRangeSelectionPrompt:"Kliknut\xedm dokonč\xedte v\xfdběr rozsahu dat",maximumDate:"Posledn\xed dostupn\xe9 datum",minimumDate:"Prvn\xed dostupn\xe9 datum",next:"Dalš\xed",previous:"Předchoz\xed",selectedDateDescription:e=>`Vybran\xe9 datum: ${e.date}`,selectedRangeDescription:e=>`Vybran\xe9 obdob\xed: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknut\xedm zah\xe1j\xedte v\xfdběr rozsahu dat",todayDate:e=>`Dnes, ${e.date}`,todayDateSelected:e=>`Dnes, vybr\xe1no ${e.date}`},"da-DK":{dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:"Klik for at fuldf\xf8re valg af datoomr\xe5de",maximumDate:"Sidste ledige dato",minimumDate:"F\xf8rste ledige dato",next:"N\xe6ste",previous:"Forrige",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.dateRange}`,startRangeSelectionPrompt:"Klik for at starte valg af datoomr\xe5de",todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`},"de-DE":{dateRange:e=>`${e.startDate} bis ${e.endDate}`,dateSelected:e=>`${e.date} ausgew\xe4hlt`,finishRangeSelectionPrompt:"Klicken, um die Auswahl des Datumsbereichs zu beenden",maximumDate:"Letztes verf\xfcgbares Datum",minimumDate:"Erstes verf\xfcgbares Datum",next:"Weiter",previous:"Zur\xfcck",selectedDateDescription:e=>`Ausgew\xe4hltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgew\xe4hlter Bereich: ${e.dateRange}`,startRangeSelectionPrompt:"Klicken, um die Auswahl des Datumsbereichs zu beginnen",todayDate:e=>`Heute, ${e.date}`,todayDateSelected:e=>`Heute, ${e.date} ausgew\xe4hlt`},"el-GR":{dateRange:e=>`${e.startDate} \u{3AD}\u{3C9}\u{3C2} ${e.endDate}`,dateSelected:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B5} ${e.date}`,finishRangeSelectionPrompt:"Κάντε κλικ για να ολοκληρώσετε την επιλογή εύρους ημερομηνιών",maximumDate:"Τελευταία διαθέσιμη ημερομηνία",minimumDate:"Πρώτη διαθέσιμη ημερομηνία",next:"Επόμενο",previous:"Προηγούμενο",selectedDateDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3B7}\u{3BC}\u{3B5}\u{3C1}\u{3BF}\u{3BC}\u{3B7}\u{3BD}\u{3AF}\u{3B1}: ${e.date}`,selectedRangeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3BF} \u{3B5}\u{3CD}\u{3C1}\u{3BF}\u{3C2}: ${e.dateRange}`,startRangeSelectionPrompt:"Κάντε κλικ για να ξεκινήσετε την επιλογή εύρους ημερομηνιών",todayDate:e=>`\u{3A3}\u{3AE}\u{3BC}\u{3B5}\u{3C1}\u{3B1}, ${e.date}`,todayDateSelected:e=>`\u{3A3}\u{3AE}\u{3BC}\u{3B5}\u{3C1}\u{3B1}, \u{3B5}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3C4}\u{3B7}\u{3BA}\u{3B5} ${e.date}`},"en-US":{previous:"Previous",next:"Next",selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.dateRange}`,todayDate:e=>`Today, ${e.date}`,todayDateSelected:e=>`Today, ${e.date} selected`,dateSelected:e=>`${e.date} selected`,startRangeSelectionPrompt:"Click to start selecting date range",finishRangeSelectionPrompt:"Click to finish selecting date range",minimumDate:"First available date",maximumDate:"Last available date",dateRange:e=>`${e.startDate} to ${e.endDate}`},"es-ES":{dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} seleccionado`,finishRangeSelectionPrompt:"Haga clic para terminar de seleccionar rango de fechas",maximumDate:"\xdaltima fecha disponible",minimumDate:"Primera fecha disponible",next:"Siguiente",previous:"Anterior",selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo seleccionado: ${e.dateRange}`,startRangeSelectionPrompt:"Haga clic para comenzar a seleccionar un rango de fechas",todayDate:e=>`Hoy, ${e.date}`,todayDateSelected:e=>`Hoy, ${e.date} seleccionado`},"et-EE":{dateRange:e=>`${e.startDate} kuni ${e.endDate}`,dateSelected:e=>`${e.date} valitud`,finishRangeSelectionPrompt:"Kl\xf5psake kuup\xe4evavahemiku valimise l\xf5petamiseks",maximumDate:"Viimane saadaolev kuup\xe4ev",minimumDate:"Esimene saadaolev kuup\xe4ev",next:"J\xe4rgmine",previous:"Eelmine",selectedDateDescription:e=>`Valitud kuup\xe4ev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.dateRange}`,startRangeSelectionPrompt:"Kl\xf5psake kuup\xe4evavahemiku valimiseks",todayDate:e=>`T\xe4na, ${e.date}`,todayDateSelected:e=>`T\xe4na, ${e.date} valitud`},"fi-FI":{dateRange:e=>`${e.startDate} \u{2013} ${e.endDate}`,dateSelected:e=>`${e.date} valittu`,finishRangeSelectionPrompt:"Lopeta p\xe4iv\xe4m\xe4\xe4r\xe4alueen valinta napsauttamalla t\xe4t\xe4.",maximumDate:"Viimeinen varattavissa oleva p\xe4iv\xe4m\xe4\xe4r\xe4",minimumDate:"Ensimm\xe4inen varattavissa oleva p\xe4iv\xe4m\xe4\xe4r\xe4",next:"Seuraava",previous:"Edellinen",selectedDateDescription:e=>`Valittu p\xe4iv\xe4m\xe4\xe4r\xe4: ${e.date}`,selectedRangeDescription:e=>`Valittu aikav\xe4li: ${e.dateRange}`,startRangeSelectionPrompt:"Aloita p\xe4iv\xe4m\xe4\xe4r\xe4alueen valinta napsauttamalla t\xe4t\xe4.",todayDate:e=>`T\xe4n\xe4\xe4n, ${e.date}`,todayDateSelected:e=>`T\xe4n\xe4\xe4n, ${e.date} valittu`},"fr-FR":{dateRange:e=>`${e.startDate} \xe0 ${e.endDate}`,dateSelected:e=>`${e.date} s\xe9lectionn\xe9`,finishRangeSelectionPrompt:"Cliquer pour finir de s\xe9lectionner la plage de dates",maximumDate:"Derni\xe8re date disponible",minimumDate:"Premi\xe8re date disponible",next:"Suivant",previous:"Pr\xe9c\xe9dent",selectedDateDescription:e=>`Date s\xe9lectionn\xe9e\xa0: ${e.date}`,selectedRangeDescription:e=>`Plage s\xe9lectionn\xe9e\xa0: ${e.dateRange}`,startRangeSelectionPrompt:"Cliquer pour commencer \xe0 s\xe9lectionner la plage de dates",todayDate:e=>`Aujourd'hui, ${e.date}`,todayDateSelected:e=>`Aujourd\u{2019}hui, ${e.date} s\xe9lectionn\xe9`},"he-IL":{dateRange:e=>`${e.startDate} \u{5E2}\u{5D3} ${e.endDate}`,dateSelected:e=>`${e.date} \u{5E0}\u{5D1}\u{5D7}\u{5E8}`,finishRangeSelectionPrompt:"חץ כדי לסיים את בחירת טווח התאריכים",maximumDate:"תאריך פנוי אחרון",minimumDate:"תאריך פנוי ראשון",next:"הבא",previous:"הקודם",selectedDateDescription:e=>`\u{5EA}\u{5D0}\u{5E8}\u{5D9}\u{5DA} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.date}`,selectedRangeDescription:e=>`\u{5D8}\u{5D5}\u{5D5}\u{5D7} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.dateRange}`,startRangeSelectionPrompt:"לחץ כדי להתחיל בבחירת טווח התאריכים",todayDate:e=>`\u{5D4}\u{5D9}\u{5D5}\u{5DD}, ${e.date}`,todayDateSelected:e=>`\u{5D4}\u{5D9}\u{5D5}\u{5DD}, ${e.date} \u{5E0}\u{5D1}\u{5D7}\u{5E8}`},"hr-HR":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} odabran`,finishRangeSelectionPrompt:"Kliknite da dovršite raspon odabranih datuma",maximumDate:"Posljednji raspoloživi datum",minimumDate:"Prvi raspoloživi datum",next:"Sljedeći",previous:"Prethodni",selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite da započnete raspon odabranih datuma",todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, odabran ${e.date}`},"hu-HU":{dateRange:e=>`${e.startDate}\u{2013}${e.endDate}`,dateSelected:e=>`${e.date} kiv\xe1lasztva`,finishRangeSelectionPrompt:"Kattintson a d\xe1tumtartom\xe1ny kijel\xf6l\xe9s\xe9nek befejez\xe9s\xe9hez",maximumDate:"Utols\xf3 el\xe9rhető d\xe1tum",minimumDate:"Az első el\xe9rhető d\xe1tum",next:"K\xf6vetkező",previous:"Előző",selectedDateDescription:e=>`Kijel\xf6lt d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Kijel\xf6lt tartom\xe1ny: ${e.dateRange}`,startRangeSelectionPrompt:"Kattintson a d\xe1tumtartom\xe1ny kijel\xf6l\xe9s\xe9nek ind\xedt\xe1s\xe1hoz",todayDate:e=>`Ma, ${e.date}`,todayDateSelected:e=>`Ma, ${e.date} kijel\xf6lve`},"it-IT":{dateRange:e=>`Da ${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selezionata`,finishRangeSelectionPrompt:"Fai clic per completare la selezione dell’intervallo di date",maximumDate:"Ultima data disponibile",minimumDate:"Prima data disponibile",next:"Successivo",previous:"Precedente",selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: ${e.dateRange}`,startRangeSelectionPrompt:"Fai clic per selezionare l’intervallo di date",todayDate:e=>`Oggi, ${e.date}`,todayDateSelected:e=>`Oggi, ${e.date} selezionata`},"ja-JP":{dateRange:e=>`${e.startDate} \u{304B}\u{3089} ${e.endDate}`,dateSelected:e=>`${e.date} \u{3092}\u{9078}\u{629E}`,finishRangeSelectionPrompt:"クリックして日付範囲の選択を終了",maximumDate:"最終利用可能日",minimumDate:"最初の利用可能日",next:"次へ",previous:"前へ",selectedDateDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{65E5}\u{4ED8} : ${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{629E}\u{7BC4}\u{56F2} : ${e.dateRange}`,startRangeSelectionPrompt:"クリックして日付範囲の選択を開始",todayDate:e=>`\u{672C}\u{65E5}\u{3001}${e.date}`,todayDateSelected:e=>`\u{672C}\u{65E5}\u{3001}${e.date} \u{3092}\u{9078}\u{629E}`},"ko-KR":{dateRange:e=>`${e.startDate} ~ ${e.endDate}`,dateSelected:e=>`${e.date} \u{C120}\u{D0DD}\u{B428}`,finishRangeSelectionPrompt:"날짜 범위 선택을 완료하려면 클릭하십시오.",maximumDate:"마지막으로 사용 가능한 일자",minimumDate:"처음으로 사용 가능한 일자",next:"다음",previous:"이전",selectedDateDescription:e=>`\u{C120}\u{D0DD} \u{C77C}\u{C790}: ${e.date}`,selectedRangeDescription:e=>`\u{C120}\u{D0DD} \u{BC94}\u{C704}: ${e.dateRange}`,startRangeSelectionPrompt:"날짜 범위 선택을 시작하려면 클릭하십시오.",todayDate:e=>`\u{C624}\u{B298}, ${e.date}`,todayDateSelected:e=>`\u{C624}\u{B298}, ${e.date} \u{C120}\u{D0DD}\u{B428}`},"lt-LT":{dateRange:e=>`Nuo ${e.startDate} iki ${e.endDate}`,dateSelected:e=>`Pasirinkta ${e.date}`,finishRangeSelectionPrompt:"Spustelėkite, kad baigtumėte pasirinkti datų intervalą",maximumDate:"Paskutinė galima data",minimumDate:"Pirmoji galima data",next:"Paskesnis",previous:"Ankstesnis",selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: ${e.dateRange}`,startRangeSelectionPrompt:"Spustelėkite, kad pradėtumėte pasirinkti datų intervalą",todayDate:e=>`\u{160}iandien, ${e.date}`,todayDateSelected:e=>`\u{160}iandien, pasirinkta ${e.date}`},"lv-LV":{dateRange:e=>`No ${e.startDate} l\u{12B}dz ${e.endDate}`,dateSelected:e=>`Atlas\u{12B}ts: ${e.date}`,finishRangeSelectionPrompt:"Noklikšķiniet, lai pabeigtu datumu diapazona atlasi",maximumDate:"Pēdējais pieejamais datums",minimumDate:"Pirmais pieejamais datums",next:"Tālāk",previous:"Atpakaļ",selectedDateDescription:e=>`Atlas\u{12B}tais datums: ${e.date}`,selectedRangeDescription:e=>`Atlas\u{12B}tais diapazons: ${e.dateRange}`,startRangeSelectionPrompt:"Noklikšķiniet, lai sāktu datumu diapazona atlasi",todayDate:e=>`\u{160}odien, ${e.date}`,todayDateSelected:e=>`Atlas\u{12B}ta \u{161}odiena, ${e.date}`},"nb-NO":{dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:"Klikk for \xe5 fullf\xf8re valg av datoomr\xe5de",maximumDate:"Siste tilgjengelige dato",minimumDate:"F\xf8rste tilgjengelige dato",next:"Neste",previous:"Forrige",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt omr\xe5de: ${e.dateRange}`,startRangeSelectionPrompt:"Klikk for \xe5 starte valg av datoomr\xe5de",todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`},"nl-NL":{dateRange:e=>`${e.startDate} tot ${e.endDate}`,dateSelected:e=>`${e.date} geselecteerd`,finishRangeSelectionPrompt:"Klik om de selectie van het datumbereik te voltooien",maximumDate:"Laatste beschikbare datum",minimumDate:"Eerste beschikbare datum",next:"Volgende",previous:"Vorige",selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.dateRange}`,startRangeSelectionPrompt:"Klik om het datumbereik te selecteren",todayDate:e=>`Vandaag, ${e.date}`,todayDateSelected:e=>`Vandaag, ${e.date} geselecteerd`},"pl-PL":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`Wybrano ${e.date}`,finishRangeSelectionPrompt:"Kliknij, aby zakończyć wyb\xf3r zakresu dat",maximumDate:"Ostatnia dostępna data",minimumDate:"Pierwsza dostępna data",next:"Dalej",previous:"Wstecz",selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknij, aby rozpocząć wyb\xf3r zakresu dat",todayDate:e=>`Dzisiaj, ${e.date}`,todayDateSelected:e=>`Dzisiaj wybrano ${e.date}`},"pt-BR":{dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:"Clique para concluir a sele\xe7\xe3o do intervalo de datas",maximumDate:"\xdaltima data dispon\xedvel",minimumDate:"Primeira data dispon\xedvel",next:"Pr\xf3ximo",previous:"Anterior",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:"Clique para iniciar a sele\xe7\xe3o do intervalo de datas",todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`},"pt-PT":{dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:"Clique para terminar de selecionar o intervalo de datas",maximumDate:"\xdaltima data dispon\xedvel",minimumDate:"Primeira data dispon\xedvel",next:"Pr\xf3ximo",previous:"Anterior",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:"Clique para come\xe7ar a selecionar o intervalo de datas",todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`},"ro-RO":{dateRange:e=>`De la ${e.startDate} p\xe2n\u{103} la ${e.endDate}`,dateSelected:e=>`${e.date} selectat\u{103}`,finishRangeSelectionPrompt:"Apăsaţi pentru a finaliza selecţia razei pentru dată",maximumDate:"Ultima dată disponibilă",minimumDate:"Prima dată disponibilă",next:"Următorul",previous:"\xcenainte",selectedDateDescription:e=>`Dat\u{103} selectat\u{103}: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: ${e.dateRange}`,startRangeSelectionPrompt:"Apăsaţi pentru a \xeencepe selecţia razei pentru dată",todayDate:e=>`Ast\u{103}zi, ${e.date}`,todayDateSelected:e=>`Azi, ${e.date} selectat\u{103}`},"ru-RU":{dateRange:e=>`\u{421} ${e.startDate} \u{43F}\u{43E} ${e.endDate}`,dateSelected:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`,finishRangeSelectionPrompt:"Щелкните, чтобы завершить выбор диапазона дат",maximumDate:"Последняя доступная дата",minimumDate:"Первая доступная дата",next:"Далее",previous:"Назад",selectedDateDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{430}\u{44F} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{44B}\u{439} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:"Щелкните, чтобы начать выбор диапазона дат",todayDate:e=>`\u{421}\u{435}\u{433}\u{43E}\u{434}\u{43D}\u{44F}, ${e.date}`,todayDateSelected:e=>`\u{421}\u{435}\u{433}\u{43E}\u{434}\u{43D}\u{44F}, \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`},"sk-SK":{dateRange:e=>`Od ${e.startDate} do ${e.endDate}`,dateSelected:e=>`Vybrat\xfd d\xe1tum ${e.date}`,finishRangeSelectionPrompt:"Kliknut\xedm dokonč\xedte v\xfdber rozsahu d\xe1tumov",maximumDate:"Posledn\xfd dostupn\xfd d\xe1tum",minimumDate:"Prv\xfd dostupn\xfd d\xe1tum",next:"Nasleduj\xface",previous:"Predch\xe1dzaj\xface",selectedDateDescription:e=>`Vybrat\xfd d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Vybrat\xfd rozsah: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknut\xedm spust\xedte v\xfdber rozsahu d\xe1tumov",todayDate:e=>`Dnes ${e.date}`,todayDateSelected:e=>`Vybrat\xfd dne\u{161}n\xfd d\xe1tum ${e.date}`},"sl-SI":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izbrano`,finishRangeSelectionPrompt:"Kliknite za dokončanje izbire datumskega obsega",maximumDate:"Zadnji razpoložljivi datum",minimumDate:"Prvi razpoložljivi datum",next:"Naprej",previous:"Nazaj",selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano obmo\u{10D}je: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite za začetek izbire datumskega obsega",todayDate:e=>`Danes, ${e.date}`,todayDateSelected:e=>`Danes, ${e.date} izbrano`},"sr-SP":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izabran`,finishRangeSelectionPrompt:"Kliknite da dovršite opseg izabranih datuma",maximumDate:"Zadnji raspoloživi datum",minimumDate:"Prvi raspoloživi datum",next:"Sledeći",previous:"Prethodni",selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani period: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite da započnete opseg izabranih datuma",todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, izabran ${e.date}`},"sv-SE":{dateRange:e=>`${e.startDate} till ${e.endDate}`,dateSelected:e=>`${e.date} har valts`,finishRangeSelectionPrompt:"Klicka f\xf6r att avsluta val av datumintervall",maximumDate:"Sista tillg\xe4ngliga datum",minimumDate:"F\xf6rsta tillg\xe4ngliga datum",next:"N\xe4sta",previous:"F\xf6reg\xe5ende",selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.dateRange}`,startRangeSelectionPrompt:"Klicka f\xf6r att v\xe4lja datumintervall",todayDate:e=>`Idag, ${e.date}`,todayDateSelected:e=>`Idag, ${e.date} har valts`},"tr-TR":{dateRange:e=>`${e.startDate} - ${e.endDate}`,dateSelected:e=>`${e.date} se\xe7ildi`,finishRangeSelectionPrompt:"Tarih aralığı se\xe7imini tamamlamak i\xe7in tıklayın",maximumDate:"Son m\xfcsait tarih",minimumDate:"İlk m\xfcsait tarih",next:"Sonraki",previous:"\xd6nceki",selectedDateDescription:e=>`Se\xe7ilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Se\xe7ilen Aral\u{131}k: ${e.dateRange}`,startRangeSelectionPrompt:"Tarih aralığı se\xe7imini başlatmak i\xe7in tıklayın",todayDate:e=>`Bug\xfcn, ${e.date}`,todayDateSelected:e=>`Bug\xfcn, ${e.date} se\xe7ildi`},"uk-UA":{dateRange:e=>`${e.startDate} \u{2014} ${e.endDate}`,dateSelected:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`,finishRangeSelectionPrompt:"Натисніть, щоб завершити вибір діапазону дат",maximumDate:"Остання доступна дата",minimumDate:"Перша доступна дата",next:"Наступний",previous:"Попередній",selectedDateDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:"Натисніть, щоб почати вибір діапазону дат",todayDate:e=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, ${e.date}`,todayDateSelected:e=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`},"zh-CN":{dateRange:e=>`${e.startDate} \u{81F3} ${e.endDate}`,dateSelected:e=>`\u{5DF2}\u{9009}\u{62E9} ${e.date}`,finishRangeSelectionPrompt:"单击以完成选择日期范围",maximumDate:"最后一个可用日期",minimumDate:"第一个可用日期",next:"下一页",previous:"上一页",selectedDateDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{8303}\u{56F4}\u{FF1A}${e.dateRange}`,startRangeSelectionPrompt:"单击以开始选择日期范围",todayDate:e=>`\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${e.date}`,todayDateSelected:e=>`\u{5DF2}\u{9009}\u{62E9}\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${e.date}`},"zh-TW":{dateRange:e=>`${e.startDate} \u{81F3} ${e.endDate}`,dateSelected:e=>`\u{5DF2}\u{9078}\u{53D6} ${e.date}`,finishRangeSelectionPrompt:"按一下以完成選取日期範圍",maximumDate:"最後一個可用日期",minimumDate:"第一個可用日期",next:"下一頁",previous:"上一頁",selectedDateDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{7BC4}\u{570D}\u{FF1A}${e.dateRange}`,startRangeSelectionPrompt:"按一下以開始選取日期範圍",todayDate:e=>`\u{4ECA}\u{5929}\u{FF0C}${e.date}`,todayDateSelected:e=>`\u{5DF2}\u{9078}\u{53D6}\u{4ECA}\u{5929}\u{FF0C}${e.date}`}};let vn=new Map;class vr{constructor(e,t={}){this.formatter=vi(e,t),this.options=t}format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,t){if("function"==typeof this.formatter.formatRange)return this.formatter.formatRange(e,t);if(t<e)throw RangeError("End date must be >= start date");return`${this.formatter.format(e)} \u{2013} ${this.formatter.format(t)}`}formatRangeToParts(e,t){if("function"==typeof this.formatter.formatRangeToParts)return this.formatter.formatRangeToParts(e,t);if(t<e)throw RangeError("End date must be >= start date");let n=this.formatter.formatToParts(e),r=this.formatter.formatToParts(t);return[...n.map(e=>({...e,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...r.map(e=>({...e,source:"endRange"}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return null==vs&&(vs="h12"===new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle),vs&&(this.resolvedHourCycle||(this.resolvedHourCycle=function(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,"");let n=vi(e+=(e.includes("-u-")?"":"-u")+"-nu-latn",{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(e=>"hour"===e.type).value,10),o=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(e=>"hour"===e.type).value,10);if(0===r&&23===o)return"h23";if(24===r&&23===o)return"h24";if(0===r&&11===o)return"h11";if(12===r&&11===o)return"h12";throw Error("Unexpected hour cycle result")}(e.locale,this.options)),e.hourCycle=this.resolvedHourCycle,e.hour12="h11"===this.resolvedHourCycle||"h12"===this.resolvedHourCycle),"ethiopic-amete-alem"===e.calendar&&(e.calendar="ethioaa"),e}}let vo={true:{ja:"h11"},false:{}};function vi(e,t={}){if("boolean"==typeof t.hour12&&(null==va&&(va="24"===new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))),va)){let n=vo[String((t={...t}).hour12)][e.split("-")[0]],r=t.hour12?"h12":"h23";t.hourCycle=n??r,delete t.hour12}let n=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(vn.has(n))return vn.get(n);let r=new Intl.DateTimeFormat(e,t);return vn.set(n,r),r}let va=null,vs=null;function vl(e){e=vt(e??{},vu);let{locale:t}=b5();return(0,fZ.useMemo)(()=>new vr(t,e),[t,e])}function vu(e,t){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(t[r]!==e[r])return!1;return!0}let vc=Symbol.for("react-aria.i18n.locale"),vd=Symbol.for("react-aria.i18n.strings");class vf{constructor(e,t="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}getStringForLocale(e,t){let n=this.getStringsForLocale(t)[e];if(!n)throw Error(`Could not find intl message ${e} in ${t} locale`);return n}getStringsForLocale(e){let t=this.strings[e];return t||(t=function(e,t,n="en-US"){var r;if(t[e])return t[e];let o=(r=e,Intl.Locale?new Intl.Locale(r).language:r.split("-")[0]);if(t[o])return t[o];for(let e in t)if(e.startsWith(o+"-"))return t[e];return t[n]}(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(e){if("u"<typeof window)return null;let t=window[vc];if(void 0===h){let e=window[vd];if(!e)return null;for(let n in h={},e)h[n]=new vf({[t]:e[n]},t)}let n=h?.[e];if(!n)throw Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return n}}let vp=new Map,vh=new Map;class vm{constructor(e,t){this.locale=e,this.strings=t}format(e,t){let n=this.strings.getStringForLocale(e,this.locale);return"function"==typeof n?n(t,this):n}plural(e,t,n="cardinal"){let r=t["="+e];if(r)return"function"==typeof r?r():r;let o=this.locale+":"+n,i=vp.get(o);return i||(i=new Intl.PluralRules(this.locale,{type:n}),vp.set(o,i)),"function"==typeof(r=t[i.select(e)]||t.other)?r():r}number(e){let t=vh.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),vh.set(this.locale,t)),t.format(e)}select(e,t){let n=e[t]||e.other;return"function"==typeof n?n():n}}let vy=new WeakMap;function vg(e,t){let n;return t&&vf.getGlobalDictionaryForPackage(t)||((n=vy.get(e))||(n=new vf(e),vy.set(e,n)),n)}function vb(e,t){let{locale:n}=b5(),r=vg(e,t);return(0,fZ.useMemo)(()=>new vm(n,r),[n,r])}function vv(e,t){return e-t*Math.floor(e/t)}function vw(e,t,n,r){let o=(t=vx(e,t))-1,i=-2;return n<=2?i=0:v_(t)&&(i=-1),1721425+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)}function v_(e){return e%4==0&&(e%100!=0||e%400==0)}function vx(e,t){return"BC"===e?1-t:t}function vS(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}let vE={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class vD{fromJulianDay(e){let t=e-1721426,n=Math.floor(t/146097),r=vv(t,146097),o=Math.floor(r/36524),i=vv(r,36524),a=Math.floor(i/1461),s=Math.floor(vv(i,1461)/365),[l,u]=vS(400*n+100*o+4*a+s+ +(4!==o&&4!==s)),c=e-vw(l,u,1,1),d=2;e<vw(l,u,3,1)?d=0:v_(u)&&(d=1);let f=Math.floor(((c+d)*12+373)/367),p=e-vw(l,u,f,1)+1;return new vH(l,u,f,p)}toJulianDay(e){return vw(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return vE[v_(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return v_(e.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(e){return 9999}getEras(){return["BC","AD"]}isInverseEra(e){return"BC"===e.era}balanceDate(e){e.year<=0&&(e.era="BC"===e.era?"AD":"BC",e.year=1-e.year)}constructor(){this.identifier="gregory"}}function vO(e,t){let n=e.copy(),r="hour"in n?vI(n,t):0;vP(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,vk(n),vC(n),n.day+=7*(t.weeks||0),n.day+=t.days||0,n.day+=r,function(e){for(;e.day<1;)e.month--,vk(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,vk(e)}(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let o=n.calendar.getYearsInEra(n);if(n.year>o){let e=n.calendar.isInverseEra?.(n);n.year=o,n.month=e?1:n.calendar.getMonthsInYear(n),n.day=e?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let i=n.calendar.getMonthsInYear(n);return n.month>i&&(n.month=i,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function vP(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function vk(e){for(;e.month<1;)vP(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,vP(e,1)}function vC(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function vj(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),vC(e)}function vT(e){let t={};for(let n in e)"number"==typeof e[n]&&(t[n]=-e[n]);return t}function vR(e,t){let n=e.copy();return null!=t.era&&(n.era=t.era),null!=t.year&&(n.year=t.year),null!=t.month&&(n.month=t.month),null!=t.day&&(n.day=t.day),vj(n),n}function vA(e,t){let n=e.copy();return null!=t.hour&&(n.hour=t.hour),null!=t.minute&&(n.minute=t.minute),null!=t.second&&(n.second=t.second),null!=t.millisecond&&(n.millisecond=t.millisecond),vM(n),n}function vM(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function vN(e,t){let n=e%t;return n<0&&(n+=t),n}function vI(e,t){let n;return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,e.second+=Math.floor(e.millisecond/1e3),e.millisecond=vN(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=vN(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=vN(e.minute,60),n=Math.floor(e.hour/24),e.hour=vN(e.hour,24),n}function v$(e,t){let n=e.copy();return vI(n,t),n}function vL(e,t,n,r){let o=e.copy();switch(t){case"era":{let t=e.calendar.getEras(),i=t.indexOf(e.era);if(i<0)throw Error("Invalid era: "+e.era);i=vB(i,n,0,t.length-1,r?.round),o.era=t[i],vj(o);break}case"year":o.calendar.isInverseEra?.(o)&&(n=-n),o.year=vB(e.year,n,-1/0,9999,r?.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,e);break;case"month":o.month=vB(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case"day":o.day=vB(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(o),vj(o),o}function vF(e,t,n,r){let o=e.copy();switch(t){case"hour":{let t=e.hour,i=0,a=23;if(r?.hourCycle===12){let e=t>=12;i=12*!!e,a=e?23:11}o.hour=vB(t,n,i,a,r?.round);break}case"minute":o.minute=vB(e.minute,n,0,59,r?.round);break;case"second":o.second=vB(e.second,n,0,59,r?.round);break;case"millisecond":o.millisecond=vB(e.millisecond,n,0,999,r?.round);break;default:throw Error("Unsupported field "+t)}return o}function vB(e,t,n,r,o=!1){if(o){(e+=Math.sign(t))<n&&(e=r);let o=Math.abs(t);(e=t>0?Math.ceil(e/o)*o:Math.floor(e/o)*o)>r&&(e=n)}else(e+=t)<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function vV(e,t){let n;return n=(null!=t.years&&0!==t.years||null!=t.months&&0!==t.months||null!=t.weeks&&0!==t.weeks||null!=t.days&&0!==t.days?v1(vO(v6(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days}),e.timeZone):vY(e)-e.offset)+(t.milliseconds||0),n+=1e3*(t.seconds||0),n+=6e4*(t.minutes||0),v5(v4(n+=36e5*(t.hours||0),e.timeZone),e.calendar)}function vU(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function vW(e){let t,n=v5(e,new vD);return t="BC"===n.era?1===n.year?"0000":"-"+String(Math.abs(1-n.year)).padStart(6,"00"):String(n.year).padStart(4,"0"),`${t}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")}`}function vK(e){return`${vW(e)}T${vU(e)}`}function vz(e){let t,n="object"==typeof e[0]?e.shift():new vD;if("string"==typeof e[0])t=e.shift();else{let e=n.getEras();t=e[e.length-1]}return[n,t,e.shift(),e.shift(),e.shift()]}class vH{#t;constructor(...e){let[t,n,r,o,i]=vz(e);this.calendar=t,this.era=n,this.year=r,this.month=o,this.day=i,vj(this)}copy(){return this.era?new vH(this.calendar,this.era,this.year,this.month,this.day):new vH(this.calendar,this.year,this.month,this.day)}add(e){return vO(this,e)}subtract(e){return vO(this,vT(e))}set(e){return vR(this,e)}cycle(e,t,n){return vL(this,e,t,n)}toDate(e){return v2(this,e)}toString(){return vW(this)}compare(e){return wi(this,e)}}class vG{#t;constructor(e=0,t=0,n=0,r=0){this.hour=e,this.minute=t,this.second=n,this.millisecond=r,vM(this)}copy(){return new vG(this.hour,this.minute,this.second,this.millisecond)}add(e){return v$(this,e)}subtract(e){return v$(this,vT(e))}set(e){return vA(this,e)}cycle(e,t,n){return vF(this,e,t,n)}toString(){return vU(this)}compare(e){var t,n;return t=this,n=e,wa(t)-wa(n)}}class vq{#t;constructor(...e){let[t,n,r,o,i]=vz(e);this.calendar=t,this.era=n,this.year=r,this.month=o,this.day=i,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,vj(this)}copy(){return this.era?new vq(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new vq(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return vO(this,e)}subtract(e){return vO(this,vT(e))}set(e){return vR(vA(this,e),e)}cycle(e,t,n){switch(e){case"era":case"year":case"month":case"day":return vL(this,e,t,n);default:return vF(this,e,t,n)}}toDate(e,t){return v2(this,e,t)}toString(){return vK(this)}compare(e){var t,n;let r=wi(this,e);return 0===r?(t=this,n=v6(e),wa(t)-wa(n)):r}}class vZ{#t;constructor(...e){let[t,n,r,o,i]=vz(e),a=e.shift(),s=e.shift();this.calendar=t,this.era=n,this.year=r,this.month=o,this.day=i,this.timeZone=a,this.offset=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,vj(this)}copy(){return this.era?new vZ(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new vZ(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return vV(this,e)}subtract(e){return vV(this,vT(e))}set(e,t){let n,r;return 0===(r=vA(vR(n=v6(this),e),e)).compare(n)?this:v5(v4(v1(r,this.timeZone,t),this.timeZone),this.calendar)}cycle(e,t,n){return function(e,t,n,r){switch(t){case"hour":{let t=0,o=23;if(r?.hourCycle===12){let n=e.hour>=12;t=12*!!n,o=n?23:11}let i=v6(e),a=v5(vA(i,{hour:t}),new vD),s=[v1(a,e.timeZone,"earlier"),v1(a,e.timeZone,"later")].filter(t=>v4(t,e.timeZone).day===a.day)[0],l=v5(vA(i,{hour:o}),new vD),u=[v1(l,e.timeZone,"earlier"),v1(l,e.timeZone,"later")].filter(t=>v4(t,e.timeZone).day===l.day).pop(),c=vY(e)-e.offset,d=Math.floor(c/36e5),f=c%36e5;return v5(v4(c=36e5*vB(d,n,Math.floor(s/36e5),Math.floor(u/36e5),r?.round)+f,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return vF(e,t,n,r);case"era":case"year":case"month":case"day":return v5(v4(v1(vL(v6(e),t,n,r),e.timeZone),e.timeZone),e.calendar);default:throw Error("Unsupported field "+t)}}(this,e,t,n)}toDate(){var e;return e=this,new Date(vY(e)-e.offset)}toString(){var e;let t,n,r,o,i;return`${vK(this)}${t=0>Math.sign(e=this.offset)?"-":"+",n=Math.floor((e=Math.abs(e))/36e5),r=Math.floor(e%36e5/6e4),o=Math.floor(e%36e5%6e4/1e3),i=`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`,0!==o&&(i+=`:${String(o).padStart(2,"0")}`),i}[${this.timeZone}]`}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-(function(e,t){if(e instanceof vZ){var n,r;return e.timeZone===t?e:(n=e,r=t,v5(v4(vY(n)-n.offset,r),n.calendar))}return v4(v1(e,t,void 0),t)})(e,this.timeZone).toDate().getTime()}}function vY(e){return vJ(vx((e=v5(e,new vD)).era,e.year),e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function vJ(e,t,n,r,o,i,a){let s=new Date;return s.setUTCHours(r,o,i,a),s.setUTCFullYear(e,t-1,n),s.getTime()}function vQ(e,t){if("UTC"===t)return 0;if(e>0&&t===wl())return -6e4*new Date(e).getTimezoneOffset();let{year:n,month:r,day:o,hour:i,minute:a,second:s}=v0(e,t);return vJ(n,r,o,i,a,s,0)-1e3*Math.floor(e/1e3)}let vX=new Map;function v0(e,t){let n=vX.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),vX.set(t,n));let r=n.formatToParts(new Date(e)),o={};for(let e of r)"literal"!==e.type&&(o[e.type]=e.value);return{year:"BC"===o.era||"B"===o.era?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:"24"===o.hour?0:+o.hour,minute:+o.minute,second:+o.second}}function v1(e,t,n="compatible"){var r,o,i;let a=v6(e);if("UTC"===t)return vY(a);if(t===wl()&&"compatible"===n){a=v5(a,new vD);let e=new Date,t=vx(a.era,a.year);return e.setFullYear(t,a.month-1,a.day),e.setHours(a.hour,a.minute,a.second,a.millisecond),e.getTime()}let s=vY(a),l=vQ(s-864e5,t),u=vQ(s+864e5,t),c=(r=a,((o=s-l)==(i=s-u)?[o]:[o,i]).filter(e=>{var n;let o;return n=r,o=v0(e,t),n.year===o.year&&n.month===o.month&&n.day===o.day&&n.hour===o.hour&&n.minute===o.minute&&n.second===o.second}));if(1===c.length)return c[0];if(c.length>1)switch(n){case"compatible":case"earlier":return c[0];case"later":return c[c.length-1];case"reject":throw RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(s-l,s-u);case"compatible":case"later":return Math.max(s-l,s-u);case"reject":throw RangeError("No such absolute time found")}}function v2(e,t,n="compatible"){return new Date(v1(e,t,n))}function v4(e,t){let n=vQ(e,t),r=new Date(e+n),o=r.getUTCFullYear();return new vZ(o<1?"BC":"AD",o<1?-o+1:o,r.getUTCMonth()+1,r.getUTCDate(),t,n,r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds())}function v3(e){return new vH(e.calendar,e.era,e.year,e.month,e.day)}function v6(e,t){let n=0,r=0,o=0,i=0;if("timeZone"in e)({hour:n,minute:r,second:o,millisecond:i}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:o,millisecond:i}=t),new vq(e.calendar,e.era,e.year,e.month,e.day,n,r,o,i)}function v5(e,t){if(we(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,vj(r),r}let v7={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function v9(e,t){return t=v5(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function v8(e,t){return we(e.calendar,t.calendar)&&v9(e,t)}function we(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}let wt={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function wn(e,t,n){let r=Math.ceil(e.calendar.toJulianDay(e)+1-(n?wt[n]:function(e){let t=wp.get(e);if(!t){if(Intl.Locale){let n=new Intl.Locale(e);if("getWeekInfo"in n&&(t=n.getWeekInfo()))return wp.set(e,t),t.firstDay}let n=function(e){if(Intl.Locale){let t=wf.get(e);return!t&&(t=new Intl.Locale(e).maximize().region)&&wf.set(e,t),t}let t=e.split("-")[1];return"u"===t?void 0:t}(e);if(e.includes("-fw-")){let n=e.split("-fw-")[1].split("-")[0];t="mon"===n?{firstDay:1}:"tue"===n?{firstDay:2}:"wed"===n?{firstDay:3}:"thu"===n?{firstDay:4}:"fri"===n?{firstDay:5}:"sat"===n?{firstDay:6}:{firstDay:0}}else t=e.includes("-ca-iso8601")?{firstDay:1}:{firstDay:n&&v7[n]||0};wp.set(e,t)}return t.firstDay}(t)))%7;return r<0&&(r+=7),r}function wr(e){return v4(Date.now(),e)}function wo(e){return v3(wr(e))}function wi(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function wa(e){return 36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond}let ws=null;function wl(){return null==ws&&(ws=new Intl.DateTimeFormat().resolvedOptions().timeZone),ws}function wu(e){return e.subtract({days:e.day-1})}function wc(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function wd(e,t,n){let r=wn(e,t,n);return e.subtract({days:r})}let wf=new Map,wp=new Map;function wh(e,t,n){let r=e.calendar.getDaysInMonth(e);return Math.ceil((wn(wu(e),t,n)+r)/7)}function wm(e,t){return e&&t?0>=e.compare(t)?e:t:e||t}function wy(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}function wg(e){return e&&e.__esModule?e.default:e}let wb=new WeakMap;function wv(e){return e?.calendar.identifier==="gregory"&&"BC"===e.era?"short":void 0}function ww(e,t,n,r){let o=vb(wg(ve),"@react-aria/calendar"),i=wv(e)||wv(t),a=vl({month:"long",year:"numeric",era:i,calendar:e.calendar.identifier,timeZone:n}),s=vl({month:"long",year:"numeric",day:"numeric",era:i,calendar:e.calendar.identifier,timeZone:n});return(0,fZ.useMemo)(()=>{if(v9(e,wu(e))){let i=e,s=t;if(e.calendar.getFormattableMonth&&(i=e.calendar.getFormattableMonth(e)),t.calendar.getFormattableMonth&&(s=t.calendar.getFormattableMonth(t)),v9(t,wc(e)))return a.format(i.toDate(n));if(v9(t,wc(t)))return r?w_(a,o,i,s,n):a.formatRange(i.toDate(n),s.toDate(n))}return r?w_(s,o,e,t,n):s.formatRange(e.toDate(n),t.toDate(n))},[e,t,a,s,o,n,r])}function w_(e,t,n,r,o){let i=e.formatRangeToParts(n.toDate(o),r.toDate(o)),a=-1;for(let e=0;e<i.length;e++){let t=i[e];if("shared"===t.source&&"literal"===t.type)a=e;else if("endRange"===t.source)break}let s="",l="";for(let e=0;e<i.length;e++)e<a?s+=i[e].value:e>a&&(l+=i[e].value);return t.format("dateRange",{startDate:s,endDate:l})}function wx(e,t){let{id:n,"aria-label":r,"aria-labelledby":o}=e;return n=y4(n),o&&r?o=[...new Set([n,...o.trim().split(/\s+/)])].join(" "):o&&(o=o.trim().split(/\s+/).join(" ")),r||o||!t||(r=t),{id:n,"aria-label":r,"aria-labelledby":o}}function wS(e,t){let n=(0,fZ.useRef)(!0),r=(0,fZ.useRef)(null),o=bb(e);(0,fZ.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),(0,fZ.useEffect)(()=>{let e=r.current;n.current?n.current=!1:(!e||t.some((t,n)=>!Object.is(t,e[n])))&&o(),r.current=t},t)}function wE(e,t){var n;let r,o,i,a,s,l=vb((n=ve)&&n.__esModule?n.default:n,"@react-aria/calendar"),u=gh(e),c=ww(t.visibleRange.start,t.visibleRange.end,t.timeZone,!1),d=ww(t.visibleRange.start,t.visibleRange.end,t.timeZone,!0);wS(()=>{t.isFocused||b9(d)},[d]);let f=(i=vb(wg(ve),"@react-aria/calendar"),"highlightedRange"in t?{start:r,end:o}=t.highlightedRange||{}:r=o=t.value??void 0,a=vl({weekday:"long",month:"long",year:"numeric",day:"numeric",era:wv(r)||wv(o),timeZone:t.timeZone}),s="anchorDate"in t?t.anchorDate:null,(0,fZ.useMemo)(()=>{if(!s&&r&&o)if(v9(r,o)){let e=a.format(r.toDate(t.timeZone));return i.format("selectedDateDescription",{date:e})}else{let e=w_(a,i,r,o,t.timeZone);return i.format("selectedRangeDescription",{dateRange:e})}return""},[r,o,s,t.timeZone,i,a]));wS(()=>{f&&b9(f,"polite",4e3)},[f]);let p=y3([!!e.errorMessage,e.isInvalid,e.validationState]);wb.set(t,{ariaLabel:e["aria-label"],ariaLabelledBy:e["aria-labelledby"],errorMessageId:p,selectedDateDescription:f});let[h,m]=(0,fZ.useState)(!1),y=e.isDisabled||t.isNextVisibleRangeInvalid();y&&h&&(m(!1),t.setFocused(!0));let[g,b]=(0,fZ.useState)(!1),v=e.isDisabled||t.isPreviousVisibleRangeInvalid();return v&&g&&(b(!1),t.setFocused(!0)),{calendarProps:y5(u,wx({id:e.id,"aria-label":[e["aria-label"],d].filter(Boolean).join(", "),"aria-labelledby":e["aria-labelledby"]}),{role:"application","aria-details":e["aria-details"]||void 0,"aria-describedby":e["aria-describedby"]||void 0}),nextButtonProps:{onPress:()=>t.focusNextPage(),"aria-label":l.format("next"),isDisabled:y,onFocusChange:m},prevButtonProps:{onPress:()=>t.focusPreviousPage(),"aria-label":l.format("previous"),isDisabled:v,onFocusChange:b},errorMessageProps:{id:p},title:c}}let wD={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function wO(e){let{children:t,elementType:n="div",isFocusable:r,style:o,...i}=e,{visuallyHiddenProps:a}=function(e={}){let{style:t,isFocusable:n}=e,[r,o]=(0,fZ.useState)(!1),{focusWithinProps:i}=bR({isDisabled:!n,onFocusWithinChange:e=>o(e)}),a=(0,fZ.useMemo)(()=>r?t:t?{...wD,...t}:wD,[r]);return{visuallyHiddenProps:{...i,style:a}}}(e);return fY().createElement(n,y5(i,a),t)}function wP(e,t,n,r){let o=bb(n),i=null==n;(0,fZ.useEffect)(()=>{if(i||!e.current)return;let n=e.current;return n.addEventListener(t,o,r),()=>{n.removeEventListener(t,o,r)}},[e,t,r,i])}function wk(e,t){if(!e)return!1;let n=window.getComputedStyle(e),r=document.scrollingElement||document.documentElement,o=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return e===r&&"hidden"!==n.overflow&&(o=!0),o&&t&&(o=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),o}function wC(e,t){let n=e;for(wk(n,t)&&(n=n.parentElement);n&&!wk(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function wj(e,t){let n=[],r=document.scrollingElement||document.documentElement;do wk(e,t)&&n.push(e),e=e.parentElement;while(e&&e!==r);return n}function wT(e,t,n={}){let{block:r="nearest",inline:o="nearest"}=n;if(e===t)return;let i=e.scrollTop,a=e.scrollLeft,s=t.getBoundingClientRect(),l=e.getBoundingClientRect(),u=window.getComputedStyle(t),c=window.getComputedStyle(e),d=document.scrollingElement||document.documentElement,f=e===d?0:l.top,p=e===d?e.clientHeight:l.bottom,h=e===d?0:l.left,m=e===d?e.clientWidth:l.right,y=parseInt(u.scrollMarginTop,10)||0,g=parseInt(u.scrollMarginBottom,10)||0,b=parseInt(u.scrollMarginLeft,10)||0,v=parseInt(u.scrollMarginRight,10)||0,w=parseInt(c.scrollPaddingTop,10)||0,x=parseInt(c.scrollPaddingBottom,10)||0,S=parseInt(c.scrollPaddingLeft,10)||0,E=parseInt(c.scrollPaddingRight,10)||0,D=parseInt(c.borderTopWidth,10)||0,O=parseInt(c.borderBottomWidth,10)||0,P=parseInt(c.borderLeftWidth,10)||0,k=parseInt(c.borderRightWidth,10)||0,C=s.top-y,j=s.bottom+g,T=s.left-b,R=s.right+v,A=e===d?0:P+k,M=e===d?0:D+O,N=e.offsetWidth-e.clientWidth-A,I=e.offsetHeight-e.clientHeight-M,$=f+D+w,L=p-O-x-I,F=h+P+S,B=m-k-E;"rtl"!==c.direction||gB()?B-=N:F+=N;let V=C<$||j>L,U=T<F||R>B;if(V&&"start"===r)i+=C-$;else if(V&&"center"===r)i+=(C+j)/2-($+L)/2;else if(V&&"end"===r)i+=j-L;else if(V&&"nearest"===r){let e=C-$,t=j-L;i+=Math.abs(e)<=Math.abs(t)?e:t}if(U&&"start"===o)a+=T-F;else if(U&&"center"===o)a+=(T+R)/2-(F+B)/2;else if(U&&"end"===o)a+=R-B;else if(U&&"nearest"===o){let e=T-F,t=R-B;a+=Math.abs(e)<=Math.abs(t)?e:t}e.scrollTo({left:a,top:i})}function wR(e,t={}){let{containingElement:n}=t;if(e&&e.isConnected){let t=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(t).overflow){let{left:t,top:r}=e.getBoundingClientRect(),o=wj(e,!0);for(let t of o)wT(t,e);let{left:i,top:a}=e.getBoundingClientRect();if(Math.abs(t-i)>1||Math.abs(r-a)>1)for(let e of o=n?wj(n,!0):[])wT(e,n,{block:"center",inline:"center"})}else{let{left:t,top:r}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});let{left:o,top:i}=e.getBoundingClientRect();(Math.abs(t-o)>1||Math.abs(r-i)>1)&&(n?.scrollIntoView?.({block:"center",inline:"center"}),e.scrollIntoView?.({block:"nearest"}))}}}let wA=0,wM=new Map;function wN(e){let[t,n]=(0,fZ.useState)();return yz(()=>{if(!e)return;let t=wM.get(e);if(t)n(t.element.id);else{let r=`react-aria-description-${wA++}`;n(r);let o=document.createElement("div");o.id=r,o.style.display="none",o.textContent=e,document.body.appendChild(o),t={refCount:0,element:o},wM.set(e,t)}return t.refCount++,()=>{t&&0==--t.refCount&&(t.element.remove(),wM.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}class wI extends vD{fromJulianDay(e){let t=super.fromJulianDay(e);return new vH(this,vx(t.era,t.year)- -543,t.month,t.day)}toJulianDay(e){return super.toJulianDay(w$(e))}getEras(){return["BE"]}getDaysInMonth(e){return super.getDaysInMonth(w$(e))}balanceDate(){}constructor(...e){super(...e),this.identifier="buddhist"}}function w$(e){let[t,n]=vS(e.year+-543);return new vH(t,n,e.month,e.day)}function wL(e,t,n,r){return e+365*t+Math.floor(t/4)+30*(n-1)+r-1}function wF(e,t){let n=Math.floor(4*(t-e)/1461),r=1+Math.floor((t-wL(e,n,1,1))/30),o=t+1-wL(e,n,r,1);return[n,r,o]}function wB(e){return Math.floor(e%4/3)}function wV(e,t){return t%13!=0?30:wB(e)+5}class wU{fromJulianDay(e){let[t,n,r]=wF(1723856,e),o="AM";return t<=0&&(o="AA",t+=5500),new vH(this,o,t,n,r)}toJulianDay(e){let t=e.year;return"AA"===e.era&&(t-=5500),wL(1723856,t,e.month,e.day)}getDaysInMonth(e){return wV(e.year,e.month)}getMonthsInYear(){return 13}getDaysInYear(e){return 365+wB(e.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(e){return"AA"===e.era?9999:9991}getEras(){return["AA","AM"]}constructor(){this.identifier="ethiopic"}}class wW extends wU{fromJulianDay(e){let[t,n,r]=wF(1723856,e);return new vH(this,"AA",t+=5500,n,r)}getEras(){return["AA"]}getYearsInEra(){return 9999}constructor(...e){super(...e),this.identifier="ethioaa"}}class wK extends wU{fromJulianDay(e){let[t,n,r]=wF(1824665,e),o="CE";return t<=0&&(o="BCE",t=1-t),new vH(this,o,t,n,r)}toJulianDay(e){let t=e.year;return"BCE"===e.era&&(t=1-t),wL(1824665,t,e.month,e.day)}getDaysInMonth(e){let t=e.year;return"BCE"===e.era&&(t=1-t),wV(t,e.month)}isInverseEra(e){return"BCE"===e.era}balanceDate(e){e.year<=0&&(e.era="BCE"===e.era?"CE":"BCE",e.year=1-e.year)}getEras(){return["BCE","CE"]}getYearsInEra(e){return"BCE"===e.era?9999:9715}constructor(...e){super(...e),this.identifier="coptic"}}let wz=765433;function wH(e){return 7>vv(7*e+1,19)}function wG(e){let t=Math.floor((235*e-234)/19),n=29*t+Math.floor((12084+13753*t)/25920);return 3>vv(3*(n+1),7)&&(n+=1),n}function wq(e){let t,n;return wG(e)+(t=wG(e-1),n=wG(e),wG(e+1)-n==356?2:+(n-t==382))}function wZ(e){return wq(e+1)-wq(e)}function wY(e,t){if(t>=6&&!wH(e)&&t++,4===t||7===t||9===t||11===t||13===t)return 29;let n=function(e){let t=wZ(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}(e);return 2===t?2===n?30:29:3===t?0===n?29:30:6===t?30*!!wH(e):30}class wJ{fromJulianDay(e){let t=e-347997,n=Math.floor((25920*t/wz*19+234)/235)+1,r=wq(n),o=Math.floor(t-r);for(;o<1;)o=Math.floor(t-(r=wq(--n)));let i=1,a=0;for(;a<o;)a+=wY(n,i),i++;let s=o-(a-=wY(n,--i));return new vH(this,n,i,s)}toJulianDay(e){let t=wq(e.year);for(let n=1;n<e.month;n++)t+=wY(e.year,n);return t+e.day+347997}getDaysInMonth(e){return wY(e.year,e.month)}getMonthsInYear(e){return wH(e.year)?13:12}getDaysInYear(e){return wZ(e.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9999}getEras(){return["AM"]}balanceYearMonth(e,t){t.year!==e.year&&(wH(t.year)&&!wH(e.year)&&t.month>6?e.month--:!wH(t.year)&&wH(e.year)&&t.month>6&&e.month++)}constructor(){this.identifier="hebrew"}}class wQ extends vD{fromJulianDay(e){let t,n,r,o=super.fromJulianDay(e),i=o.year-78,a=e-vw(o.era,o.year,1,1);if(a<80?(i--,a+=(t=v_(o.year-1)?31:30)+155+90+10):(t=v_(o.year)?31:30,a-=80),a<t)n=1,r=a+1;else{let e=a-t;e<155?(n=Math.floor(e/31)+2,r=e%31+1):(e-=155,n=Math.floor(e/30)+7,r=e%30+1)}return new vH(this,i,n,r)}toJulianDay(e){let t,n,[r,o]=vS(e.year+78);return(v_(o)?(t=31,n=vw(r,o,3,21)):(t=30,n=vw(r,o,3,22)),1===e.month)?n+e.day-1:(n+=t+31*Math.min(e.month-2,5),e.month>=8&&(n+=(e.month-7)*30),n+=e.day-1)}getDaysInMonth(e){return 1===e.month&&v_(e.year+78)||e.month>=2&&e.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return["saka"]}balanceDate(){}constructor(...e){super(...e),this.identifier="indian"}}function wX(e,t,n,r){return r+Math.ceil(29.5*(n-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function w0(e,t,n){let r=Math.floor((30*(n-t)+10646)/10631),o=Math.min(12,Math.ceil((n-(29+wX(t,r,1,1)))/29.5)+1),i=n-wX(t,r,o,1)+1;return new vH(e,r,o,i)}function w1(e){return(14+11*e)%30<11}class w2{fromJulianDay(e){return w0(this,1948440,e)}toJulianDay(e){return wX(1948440,e.year,e.month,e.day)}getDaysInMonth(e){let t=29+e.month%2;return 12===e.month&&w1(e.year)&&t++,t}getMonthsInYear(){return 12}getDaysInYear(e){return w1(e.year)?355:354}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9665}getEras(){return["AH"]}constructor(){this.identifier="islamic-civil"}}class w4 extends w2{fromJulianDay(e){return w0(this,1948439,e)}toJulianDay(e){return wX(1948439,e.year,e.month,e.day)}constructor(...e){super(...e),this.identifier="islamic-tbla"}}function w3(e){return 460322+c[e-1300]}function w6(e,t){return(u[e-1300]&1<<11-(t-1))==0?29:30}function w5(e,t){let n=w3(e);for(let r=1;r<t;r++)n+=w6(e,r);return n}function w7(e){return c[e+1-1300]-c[e-1300]}class w9 extends w2{constructor(){if(super(),this.identifier="islamic-umalqura",u||(u=new Uint16Array(Uint8Array.from(atob("qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI="),e=>e.charCodeAt(0)).buffer)),!c){c=new Uint32Array(301);let e=0;for(let t=1300;t<=1600;t++){c[t-1300]=e;for(let n=1;n<=12;n++)e+=w6(t,n)}}}fromJulianDay(e){let t=e-1948440,n=w3(1300),r=w3(1600);if(t<n||t>r)return super.fromJulianDay(e);{let e=1299,n=1,r=1;for(;r>0;){r=t-w3(++e)+1;let o=w7(e);if(r===o){n=12;break}if(r<o){let t=w6(e,n);for(n=1;r>t;)r-=t,t=w6(e,++n);break}}return new vH(this,e,n,t-w5(e,n)+1)}}toJulianDay(e){return e.year<1300||e.year>1600?super.toJulianDay(e):1948440+w5(e.year,e.month)+(e.day-1)}getDaysInMonth(e){return e.year<1300||e.year>1600?super.getDaysInMonth(e):w6(e.year,e.month)}getDaysInYear(e){return e.year<1300||e.year>1600?super.getDaysInYear(e):w7(e.year)}}let w8=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],_e=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],_t=[1867,1911,1925,1988,2018],_n=["meiji","taisho","showa","heisei","reiwa"];function _r(e){let t=w8.findIndex(([t,n,r])=>!!(e.year<t)||e.year===t&&!!(e.month<n)||e.year===t&&e.month===n&&!!(e.day<r));return -1===t?w8.length-1:0===t?0:t-1}function _o(e){let t=_t[_n.indexOf(e.era)];if(!t)throw Error("Unknown era: "+e.era);return new vH(e.year+t,e.month,e.day)}class _i extends vD{fromJulianDay(e){let t=super.fromJulianDay(e),n=_r(t);return new vH(this,_n[n],t.year-_t[n],t.month,t.day)}toJulianDay(e){return super.toJulianDay(_o(e))}balanceDate(e){let t=_o(e),n=_r(t);_n[n]!==e.era&&(e.era=_n[n],e.year=t.year-_t[n]),this.constrainDate(e)}constrainDate(e){let t=_n.indexOf(e.era),n=_e[t];if(null!=n){let[r,o,i]=n,a=r-_t[t];e.year=Math.max(1,Math.min(a,e.year)),e.year===a&&(e.month=Math.min(o,e.month),e.month===o&&(e.day=Math.min(i,e.day)))}if(1===e.year&&t>=0){let[,n,r]=w8[t];e.month=Math.max(n,e.month),e.month===n&&(e.day=Math.max(r,e.day))}}getEras(){return _n}getYearsInEra(e){let t=_n.indexOf(e.era),n=w8[t],r=w8[t+1];if(null==r)return 9999-n[0]+1;let o=r[0]-n[0];return(e.month<r[1]||e.month===r[1]&&e.day<r[2])&&o++,o}getDaysInMonth(e){return super.getDaysInMonth(_o(e))}getMinimumMonthInYear(e){let t=_a(e);return t?t[1]:1}getMinimumDayInMonth(e){let t=_a(e);return t&&e.month===t[1]?t[2]:1}constructor(...e){super(...e),this.identifier="japanese"}}function _a(e){if(1===e.year)return w8[_n.indexOf(e.era)]}let _s=[0,31,62,93,124,155,186,216,246,276,306,336];class _l{fromJulianDay(e){let t=e-1948320,n=1+Math.floor((33*t+3)/12053),r=t-(365*(n-1)+Math.floor((8*n+21)/33)),o=r<216?Math.floor(r/31):Math.floor((r-6)/30),i=r-_s[o]+1;return new vH(this,n,o+1,i)}toJulianDay(e){let t=1948319+365*(e.year-1)+Math.floor((8*e.year+21)/33);return t+=_s[e.month-1],t+=e.day}getMonthsInYear(){return 12}getDaysInMonth(e){return e.month<=6?31:e.month<=11||8>vv(25*e.year+11,33)?30:29}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getEras(){return["AP"]}getYearsInEra(){return 9377}constructor(){this.identifier="persian"}}function _u(e){return"minguo"===e.era?e.year+1911:1-e.year+1911}function _c(e){let t=e-1911;return t>0?["minguo",t]:["before_minguo",1-t]}class _d extends vD{fromJulianDay(e){let t=super.fromJulianDay(e),[n,r]=_c(vx(t.era,t.year));return new vH(this,n,r,t.month,t.day)}toJulianDay(e){return super.toJulianDay(_f(e))}getEras(){return["before_minguo","minguo"]}balanceDate(e){let[t,n]=_c(_u(e));e.era=t,e.year=n}isInverseEra(e){return"before_minguo"===e.era}getDaysInMonth(e){return super.getDaysInMonth(_f(e))}getYearsInEra(e){return"before_minguo"===e.era?9999:8088}constructor(...e){super(...e),this.identifier="roc"}}function _f(e){let[t,n]=vS(_u(e));return new vH(t,n,e.month,e.day)}function _p(e){switch(e){case"buddhist":return new wI;case"ethiopic":return new wU;case"ethioaa":return new wW;case"coptic":return new wK;case"hebrew":return new wJ;case"indian":return new wQ;case"islamic-civil":return new w2;case"islamic-tbla":return new w4;case"islamic-umalqura":return new w9;case"japanese":return new _i;case"persian":return new _l;case"roc":return new _d;default:return new vD}}function _h(e,t,n){return null!=t&&0>e.compare(t)||null!=n&&e.compare(n)>0}function _m(e,t,n,r,o){let i={};for(let e in t)i[e]=Math.floor(t[e]/2),i[e]>0&&t[e]%2==0&&i[e]--;let a=_y(e,t,n).subtract(i);return _b(e,a,t,n,r,o)}function _y(e,t,n,r,o){let i=e;if(t.years)i=wu(e.subtract({months:e.month-1}));else t.months?i=wu(e):t.weeks&&(i=wd(e,n));return _b(e,i,t,n,r,o)}function _g(e,t,n,r,o){let i={...t};i.days?i.days--:i.weeks?i.weeks--:i.months?i.months--:i.years&&i.years--;let a=_y(e,t,n).subtract(i);return _b(e,a,t,n,r,o)}function _b(e,t,n,r,o,i){if(o&&e.compare(o)>=0){let e=wy(t,_y(v3(o),n,r));e&&(t=e)}if(i&&0>=e.compare(i)){let e=wm(t,_g(v3(i),n,r));e&&(t=e)}return t}function _v(e,t,n){if(t){let n=wy(e,v3(t));n&&(e=n)}if(n){let t=wm(e,v3(n));t&&(e=t)}return e}function _w(e,t,n){if(!n)return e;for(;e.compare(t)>=0&&n(e);)e=e.subtract({days:1});return e.compare(t)>=0?e:null}let __="u">typeof document?fY().useInsertionEffect??fY().useLayoutEffect:()=>{};function _x(e,t,n){let[r,o]=(0,fZ.useState)(e||t),i=(0,fZ.useRef)(r),a=(0,fZ.useRef)(void 0!==e),s=void 0!==e;(0,fZ.useEffect)(()=>{a.current,a.current=s},[s]);let l=s?e:r;__(()=>{i.current=l});let[,u]=(0,fZ.useReducer)(()=>({}),{});return[l,(0,fZ.useCallback)((e,...t)=>{let r="function"==typeof e?e(i.current):e;Object.is(i.current,r)||(i.current=r,o(r),u(),n?.(r,...t))},[n])]}function _S(e){let t=(0,fZ.useMemo)(()=>new vr(e.locale),[e.locale]),n=(0,fZ.useMemo)(()=>t.resolvedOptions(),[t]),{locale:r,createCalendar:o,visibleDuration:i={months:1},minValue:a,maxValue:s,selectionAlignment:l,isDateUnavailable:u,pageBehavior:c="visible",firstDayOfWeek:d}=e,f=(0,fZ.useMemo)(()=>o(n.calendar),[o,n.calendar]),[p,h]=_x(e.value,e.defaultValue??null,e.onChange),m=(0,fZ.useMemo)(()=>p?v5(v3(p),f):null,[p,f]),y=(0,fZ.useMemo)(()=>p&&"timeZone"in p?p.timeZone:n.timeZone,[p,n.timeZone]),[g,b]=_x((0,fZ.useMemo)(()=>e.focusedValue?_v(v5(v3(e.focusedValue),f),a,s):void 0,[e.focusedValue,f,a,s]),(0,fZ.useMemo)(()=>_v(e.defaultFocusedValue?v5(v3(e.defaultFocusedValue),f):m||v5(wo(y),f),a,s),[e.defaultFocusedValue,m,y,f,a,s]),e.onFocusChange),[v,w]=(0,fZ.useState)(()=>{switch(l){case"start":return _y(g,i,r,a,s);case"end":return _g(g,i,r,a,s);default:return _m(g,i,r,a,s)}}),[x,S]=(0,fZ.useState)(e.autoFocus||!1),E=(0,fZ.useMemo)(()=>{let e={...i};return e.days?e.days--:e.days=-1,v.add(e)},[v,i]),[D,O]=(0,fZ.useState)(f);if(!we(f,D)){let e=v5(g,f);w(_m(e,i,r,a,s)),b(e),O(f)}function P(e){b(e=_v(e,a,s))}function k(t){if(!e.isDisabled&&!e.isReadOnly){let e=t;if(null===e)return void h(null);(e=_w(e=_v(e,a,s),v,u))&&(e=v5(e,p?.calendar||new vD),p&&"hour"in p?h(p.set(e)):h(e))}}_h(g,a,s)?b(_v(g,a,s)):0>g.compare(v)?w(_g(g,i,r,a,s)):g.compare(E)>0&&w(_y(g,i,r,a,s));let C=(0,fZ.useMemo)(()=>!!m&&(!!(u&&u(m))||_h(m,a,s)),[m,u,a,s]),j=e.isInvalid||"invalid"===e.validationState||C,T=(0,fZ.useMemo)(()=>"visible"===c?i:_E(i),[c,i]);return{isDisabled:e.isDisabled??!1,isReadOnly:e.isReadOnly??!1,value:m,setValue:k,visibleRange:{start:v,end:E},minValue:a,maxValue:s,focusedDate:g,timeZone:y,validationState:j?"invalid":null,isValueInvalid:j,setFocusedDate(e){P(e)},focusNextDay(){P(g.add({days:1}))},focusPreviousDay(){P(g.subtract({days:1}))},focusNextRow(){i.days?this.focusNextPage():(i.weeks||i.months||i.years)&&P(g.add({weeks:1}))},focusPreviousRow(){i.days?this.focusPreviousPage():(i.weeks||i.months||i.years)&&P(g.subtract({weeks:1}))},focusNextPage(){let e=v.add(T);b(_v(g.add(T),a,s)),w(_y(_b(g,e,T,r,a,s),T,r))},focusPreviousPage(){let e=v.subtract(T);b(_v(g.subtract(T),a,s)),w(_y(_b(g,e,T,r,a,s),T,r))},focusSectionStart(){i.days?P(v):i.weeks?P(wd(g,r)):(i.months||i.years)&&P(wu(g))},focusSectionEnd(){i.days?P(E):i.weeks?P(wd(g,r,void 0).add({days:6})):(i.months||i.years)&&P(wc(g))},focusNextSection(e){e||i.days?i.days?this.focusNextPage():i.weeks?P(g.add({months:1})):(i.months||i.years)&&P(g.add({years:1})):P(g.add(_E(i)))},focusPreviousSection(e){e||i.days?i.days?this.focusPreviousPage():i.weeks?P(g.subtract({months:1})):(i.months||i.years)&&P(g.subtract({years:1})):P(g.subtract(_E(i)))},selectFocusedDate(){u&&u(g)||k(g)},selectDate(e){k(e)},isFocused:x,setFocused:S,isInvalid:e=>_h(e,a,s),isSelected(e){return null!=m&&v9(e,m)&&!this.isCellDisabled(e)&&!this.isCellUnavailable(e)},isCellFocused:e=>x&&g&&v9(e,g),isCellDisabled(t){return e.isDisabled||0>t.compare(v)||t.compare(E)>0||this.isInvalid(t)},isCellUnavailable:t=>!!e.isDateUnavailable&&e.isDateUnavailable(t),isPreviousVisibleRangeInvalid(){let e=v.subtract({days:1});return v9(e,v)||this.isInvalid(e)},isNextVisibleRangeInvalid(){let e=E.add({days:1});return v9(e,E)||this.isInvalid(e)},getDatesInWeek(e,t=v){let n=t.add({weeks:e}),o=[],i=wn(n=wd(n,r,d),r,d);for(let e=0;e<i;e++)o.push(null);for(;o.length<7;){o.push(n);let e=n.add({days:1});if(v9(n,e))break;n=e}for(;o.length<7;)o.push(null);return o}}}function _E(e){let t={...e};for(let n in e)t[n]=1;return t}function _D(e,t){return e&&t?(0>t.compare(e)&&([e,t]=[t,e]),{start:v3(e),end:v3(t)}):null}function _O(e,t){return(e=v5(e,t?.calendar||new vD),t&&"hour"in t)?t.set(e):e}function _P(e,t,n){let r=e.add({days:n});for(;(n<0?r.compare(t.visibleRange.start)>=0:0>=r.compare(t.visibleRange.end))&&!t.isCellUnavailable(r);)r=r.add({days:n});if(t.isCellUnavailable(r))return r.add({days:-n})}let _k=(0,fZ.createContext)(null),_C=(0,fZ.createContext)(null),_j=(0,fZ.createContext)(null),_T=(0,fZ.createContext)(null),_R=(0,fZ.forwardRef)(function(e,t){[e,t]=gt(e,t,_k);let{locale:n}=b5(),r=_S({...e,locale:n,createCalendar:_p}),{calendarProps:o,prevButtonProps:i,nextButtonProps:a,errorMessageProps:s,title:l}=wE(e,r),u=y8({...e,values:{state:r,isDisabled:e.isDisabled||!1,isInvalid:r.isValueInvalid},defaultClassName:"react-aria-Calendar"});return fY().createElement("div",{...u,...o,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":r.isValueInvalid||void 0},fY().createElement(y9,{values:[[bU,{slots:{previous:i,next:a}}],[bK,{"aria-hidden":!0,level:2,children:l}],[_j,r],[_k,e],[bz,{slots:{errorMessage:s}}]]},fY().createElement(wO,null,fY().createElement("h2",null,o["aria-label"])),u.children,fY().createElement(wO,null,fY().createElement("button",{"aria-label":a["aria-label"],disabled:a.isDisabled,onClick:()=>r.focusNextPage(),tabIndex:-1}))))}),_A=(0,fZ.forwardRef)(function(e,t){[e,t]=gt(e,t,_C);let{locale:n}=b5(),r=function(e){let{value:t,defaultValue:n,onChange:r,createCalendar:o,locale:i,visibleDuration:a={months:1},minValue:s,maxValue:l,...u}=e,[c,d]=_x(t,n||null,r),[f,p]=(0,fZ.useState)(null),h="center";if(c&&c.start&&c.end){let e=_m(v3(c.start),a,i,s,l).add(a).subtract({days:1});c.end.compare(e)>0&&(h="start")}let m=(0,fZ.useRef)(null),[y,g]=(0,fZ.useState)(null),b=(0,fZ.useMemo)(()=>wy(s,y?.start),[s,y]),v=(0,fZ.useMemo)(()=>wm(l,y?.end),[l,y]),w=_S({...u,value:c&&c.start,createCalendar:o,locale:i,visibleDuration:a,minValue:b,maxValue:v,selectionAlignment:e.selectionAlignment||h}),x=t=>{t&&e.isDateUnavailable&&!e.allowsNonContiguousRanges?(m.current={start:_P(t,w,-1),end:_P(t,w,1)},g(m.current)):(m.current=null,g(null))},[S,E]=(0,fZ.useState)(w.visibleRange);v8(w.visibleRange.start,S.start)&&v8(w.visibleRange.end,S.end)||(x(f),E(w.visibleRange));let D=e=>{e?(p(e),x(e)):(p(null),x(null))},O=f?_D(f,w.focusedDate):c&&_D(c.start,c.end),P=t=>{if(e.isReadOnly)return;let n=_w(_v(t,b,v),w.visibleRange.start,e.isDateUnavailable);if(n)if(f){let e=_D(f,n);e&&d({start:_O(e.start,c?.start),end:_O(e.end,c?.end)}),D(null)}else D(n)},[k,C]=(0,fZ.useState)(!1),{isDateUnavailable:j}=e,T=(0,fZ.useMemo)(()=>!!c&&!f&&(!!(j&&(j(c.start)||j(c.end)))||_h(c.start,s,l)||_h(c.end,s,l)),[j,c,f,s,l]),R=e.isInvalid||"invalid"===e.validationState||T;return{...w,value:c,setValue:d,anchorDate:f,setAnchorDate:D,highlightedRange:O,validationState:R?"invalid":null,isValueInvalid:R,selectFocusedDate(){P(w.focusedDate)},selectDate:P,highlightDate(e){f&&w.setFocusedDate(e)},isSelected:e=>!!(O&&e.compare(O.start)>=0&&0>=e.compare(O.end)&&!w.isCellDisabled(e)&&!w.isCellUnavailable(e)),isInvalid:e=>w.isInvalid(e)||_h(e,m.current?.start,m.current?.end),isDragging:k,setDragging:C,clearSelection(){D(null),d(null)}}}({...e,locale:n,createCalendar:_p}),{calendarProps:o,prevButtonProps:i,nextButtonProps:a,errorMessageProps:s,title:l}=function(e,t,n){let{commitBehavior:r="select",...o}=e,i=wE(o,t),a=(0,fZ.useRef)(!1),s=(0,fZ.useRef)("u">typeof window?window:null);wP(s,"pointerdown",e=>{a.current=0===e.width&&0===e.height});let l={clear:()=>t.clearSelection(),reset:()=>t.setAnchorDate(null),select:()=>t.selectFocusedDate()};return wP(s,"pointerup",e=>{if(a.current){a.current=!1;return}if(t.setDragging(!1),!t.anchorDate)return;let o=e.target;n.current&&g_(n.current)&&(!gv(n.current,o)||!o.closest('button, [role="button"]'))&&l[r]()}),i.calendarProps.onBlur=e=>{n.current&&(e.relatedTarget&&gv(n.current,e.relatedTarget)||!t.anchorDate||l[r]())},wP(n,"touchmove",e=>{t.isDragging&&e.preventDefault()},{passive:!1,capture:!0}),i}(e,r,t),u=y8({...e,values:{state:r,isDisabled:e.isDisabled||!1,isInvalid:r.isValueInvalid},defaultClassName:"react-aria-RangeCalendar"});return fY().createElement("div",{...u,...o,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":r.isValueInvalid||void 0},fY().createElement(y9,{values:[[bU,{slots:{previous:i,next:a}}],[bK,{"aria-hidden":!0,level:2,children:l}],[_T,r],[_C,e],[bz,{slots:{errorMessage:s}}]]},fY().createElement(wO,null,fY().createElement("h2",null,o["aria-label"])),u.children,fY().createElement(wO,null,fY().createElement("button",{"aria-label":a["aria-label"],disabled:a.isDisabled,onClick:()=>r.focusNextPage(),tabIndex:-1}))))}),_M=(0,fZ.createContext)(null),_N=(0,fZ.forwardRef)(function(e,t){var n,r;let o=(0,fZ.useContext)(_j),i=(0,fZ.useContext)(_T),a=ge(_k),s=ge(_C),l=null!=o?o:i,u=l.visibleRange.start;e.offset&&(u=u.add(e.offset));let c=null!=(n=null==a?void 0:a.firstDayOfWeek)?n:null==s?void 0:s.firstDayOfWeek,{gridProps:d,headerProps:f,weekDays:p}=function(e,t){let{startDate:n=t.visibleRange.start,endDate:r=t.visibleRange.end,firstDayOfWeek:o}=e,{direction:i}=b5(),a=ww(n,r,t.timeZone,!0),{ariaLabel:s,ariaLabelledBy:l}=wb.get(t),u=wx({"aria-label":[s,a].filter(Boolean).join(", "),"aria-labelledby":l}),c=vl({weekday:e.weekdayStyle||"narrow",timeZone:t.timeZone}),{locale:d}=b5(),f=(0,fZ.useMemo)(()=>{let e=wd(wo(t.timeZone),d,o);return[...Array(7).keys()].map(n=>{let r=e.add({days:n}).toDate(t.timeZone);return c.format(r)})},[d,t.timeZone,c,o]),p=wh(n,d,o);return{gridProps:y5(u,{role:"grid","aria-readonly":t.isReadOnly||void 0,"aria-disabled":t.isDisabled||void 0,"aria-multiselectable":"highlightedRange"in t||void 0,onKeyDown:e=>{switch(e.key){case"Enter":case" ":e.preventDefault(),t.selectFocusedDate();break;case"PageUp":e.preventDefault(),e.stopPropagation(),t.focusPreviousSection(e.shiftKey);break;case"PageDown":e.preventDefault(),e.stopPropagation(),t.focusNextSection(e.shiftKey);break;case"End":e.preventDefault(),e.stopPropagation(),t.focusSectionEnd();break;case"Home":e.preventDefault(),e.stopPropagation(),t.focusSectionStart();break;case"ArrowLeft":e.preventDefault(),e.stopPropagation(),"rtl"===i?t.focusNextDay():t.focusPreviousDay();break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),t.focusPreviousRow();break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),"rtl"===i?t.focusPreviousDay():t.focusNextDay();break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),t.focusNextRow();break;case"Escape":"setAnchorDate"in t&&(e.preventDefault(),t.setAnchorDate(null))}},onFocus:()=>t.setFocused(!0),onBlur:()=>t.setFocused(!1)}),headerProps:{"aria-hidden":!0},weekDays:f,weeksInMonth:p}}({startDate:u,endDate:wc(u),weekdayStyle:e.weekdayStyle,firstDayOfWeek:c},l);return fY().createElement(_M.Provider,{value:{headerProps:f,weekDays:p,startDate:u,firstDayOfWeek:c}},fY().createElement("table",{...gh(e),...d,ref:t,style:e.style,className:null!=(r=e.className)?r:"react-aria-CalendarGrid"},"function"!=typeof e.children?e.children:fY().createElement(fY().Fragment,null,fY().createElement(_I,null,e=>fY().createElement(_$,null,e)),fY().createElement(_L,null,e.children))))}),_I=(0,fZ.forwardRef)(function(e,t){let{children:n,style:r,className:o}=e,{headerProps:i,weekDays:a}=(0,fZ.useContext)(_M);return fY().createElement("thead",{...gh(e),...i,ref:t,style:r,className:o||"react-aria-CalendarGridHeader"},fY().createElement("tr",null,a.map((e,t)=>fY().cloneElement(n(e),{key:t}))))}),_$=(0,fZ.forwardRef)(function(e,t){let{children:n,style:r,className:o}=e;return fY().createElement("th",{...gh(e),ref:t,style:r,className:o||"react-aria-CalendarHeaderCell"},n)}),_L=(0,fZ.forwardRef)(function(e,t){let{children:n,style:r,className:o}=e,i=(0,fZ.useContext)(_j),a=(0,fZ.useContext)(_T),s=null!=i?i:a,{startDate:l,firstDayOfWeek:u}=(0,fZ.useContext)(_M),{locale:c}=b5(),d=wh(l,c,u);return fY().createElement("tbody",{...gh(e),ref:t,style:r,className:o||"react-aria-CalendarGridBody"},[...Array(d).keys()].map(e=>fY().createElement("tr",{key:e},s.getDatesInWeek(e,l).map((e,t)=>e?fY().cloneElement(n(e),{key:t}):fY().createElement("td",{key:t})))))}),_F=(0,fZ.forwardRef)(function({date:e,...t},n){var r,o,i;let a=(0,fZ.useContext)(_j),s=(0,fZ.useContext)(_T),l=null!=a?a:s,{startDate:u}=null!=(r=(0,fZ.useContext)(_M))?r:{startDate:l.visibleRange.start},c=(0,fZ.useRef)(null),{cellProps:d,buttonProps:f,...p}=function(e,t,n){var r;let o,{date:i,isDisabled:a}=e,{errorMessageId:s,selectedDateDescription:l}=wb.get(t),u=vb((r=ve)&&r.__esModule?r.default:r,"@react-aria/calendar"),c=vl({weekday:"long",day:"numeric",month:"long",year:"numeric",era:wv(i),timeZone:t.timeZone}),d=t.isSelected(i),f=t.isCellFocused(i)&&!e.isOutsideMonth;a=a||t.isCellDisabled(i);let p=t.isCellUnavailable(i),h=!a&&!p,m=t.isValueInvalid&&!!("highlightedRange"in t?!t.anchorDate&&t.highlightedRange&&i.compare(t.highlightedRange.start)>=0&&0>=i.compare(t.highlightedRange.end):t.value&&v9(t.value,i));m&&(d=!0),i=vt(i,v8);let y=(0,fZ.useMemo)(()=>i.toDate(t.timeZone),[i,t.timeZone]),g=v9(i,wo(t.timeZone)),b=(0,fZ.useMemo)(()=>{let e="";return"highlightedRange"in t&&t.value&&!t.anchorDate&&(v9(i,t.value.start)||v9(i,t.value.end))&&(e=l+", "),e+=c.format(y),g?e=u.format(d?"todayDateSelected":"todayDate",{date:e}):d&&(e=u.format("dateSelected",{date:e})),t.minValue&&v9(i,t.minValue)?e+=", "+u.format("minimumDate"):t.maxValue&&v9(i,t.maxValue)&&(e+=", "+u.format("maximumDate")),e},[c,y,u,d,g,i,t,l]),v="";"anchorDate"in t&&f&&!t.isReadOnly&&h&&(v=t.anchorDate?u.format("finishRangeSelectionPrompt"):u.format("startRangeSelectionPrompt"));let w=wN(v),x=(0,fZ.useRef)(!1),S=(0,fZ.useRef)(!1),E=(0,fZ.useRef)(void 0),{pressProps:D,isPressed:O}=bD({shouldCancelOnPointerExit:"anchorDate"in t&&!!t.anchorDate,preventFocusOnPress:!0,isDisabled:!h||t.isReadOnly,onPressStart(e){if(t.isReadOnly){t.setFocusedDate(i),t.setFocused(!0);return}if("highlightedRange"in t&&!t.anchorDate&&("mouse"===e.pointerType||"touch"===e.pointerType)){if(t.highlightedRange&&!m){if(v9(i,t.highlightedRange.start)){t.setAnchorDate(t.highlightedRange.end),t.setFocusedDate(i),t.setFocused(!0),t.setDragging(!0),S.current=!0;return}else if(v9(i,t.highlightedRange.end)){t.setAnchorDate(t.highlightedRange.start),t.setFocusedDate(i),t.setFocused(!0),t.setDragging(!0),S.current=!0;return}}let n=()=>{t.setDragging(!0),E.current=void 0,t.selectDate(i),t.setFocusedDate(i),t.setFocused(!0),x.current=!0};"touch"===e.pointerType?E.current=setTimeout(n,200):n()}},onPressEnd(){S.current=!1,x.current=!1,clearTimeout(E.current),E.current=void 0},onPress(){"anchorDate"in t||t.isReadOnly||(t.selectDate(i),t.setFocusedDate(i),t.setFocused(!0))},onPressUp(e){if(!t.isReadOnly&&("anchorDate"in t&&E.current&&(t.selectDate(i),t.setFocusedDate(i),t.setFocused(!0)),"anchorDate"in t))if(S.current)t.setAnchorDate(i);else if(t.anchorDate&&!x.current)t.selectDate(i),t.setFocusedDate(i),t.setFocused(!0);else if("keyboard"!==e.pointerType||t.anchorDate)"virtual"===e.pointerType&&(t.selectDate(i),t.setFocusedDate(i),t.setFocused(!0));else{t.selectDate(i);let e=i.add({days:1});t.isInvalid(e)&&(e=i.subtract({days:1})),t.isInvalid(e)||(t.setFocusedDate(e),t.setFocused(!0))}}});a||(o=v9(i,t.focusedDate)?0:-1),(0,fZ.useEffect)(()=>{f&&n.current&&(gm(n.current),"pointer"!==gG&&((e=document)=>e.activeElement)()===n.current&&wR(n.current,{containingElement:wC(n.current)}))},[f,n]);let P=vl({day:"numeric",timeZone:t.timeZone,calendar:i.calendar.identifier}),k=(0,fZ.useMemo)(()=>P.formatToParts(y).find(e=>"day"===e.type).value,[P,y]);return{cellProps:{role:"gridcell","aria-disabled":!h||void 0,"aria-selected":d||void 0,"aria-invalid":m||void 0},buttonProps:y5(D,{onFocus(){a||(t.setFocusedDate(i),t.setFocused(!0))},tabIndex:o,role:"button","aria-disabled":!h||void 0,"aria-label":b,"aria-invalid":m||void 0,"aria-describedby":[m?s:void 0,w["aria-describedby"]].filter(Boolean).join(" ")||void 0,onPointerEnter(e){"highlightDate"in t&&("touch"!==e.pointerType||t.isDragging)&&h&&t.highlightDate(i)},onPointerDown(e){let t=gw(e);t instanceof HTMLElement&&"releasePointerCapture"in t&&("hasPointerCapture"in t?t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId):t.releasePointerCapture(e.pointerId))},onContextMenu(e){e.preventDefault()}}),isPressed:O,isFocused:f,isSelected:d,isDisabled:a,isUnavailable:p,isOutsideVisibleRange:0>i.compare(t.visibleRange.start)||i.compare(t.visibleRange.end)>0,isInvalid:m,formattedDate:k}}({date:e},l,c),{hoverProps:h,isHovered:m}=bL({...t,isDisabled:p.isDisabled}),{focusProps:y,isFocusVisible:g}=bA();g&&(g=p.isFocused);let b=(o=u,i=v5(i=e,o.calendar),o=wu(o),i=wu(i),o.era!==i.era||o.year!==i.year||o.month!==i.month),v=!1,w=!1;"highlightedRange"in l&&l.highlightedRange&&(v=v9(e,l.highlightedRange.start),w=v9(e,l.highlightedRange.end));let x=y8({...t,defaultChildren:p.formattedDate,defaultClassName:"react-aria-CalendarCell",values:{date:e,isHovered:m,isOutsideMonth:b,isFocusVisible:g,isSelectionStart:v,isSelectionEnd:w,...p}}),S={"data-focused":p.isFocused||void 0,"data-hovered":m||void 0,"data-pressed":p.isPressed||void 0,"data-unavailable":p.isUnavailable||void 0,"data-disabled":p.isDisabled||void 0,"data-focus-visible":g||void 0,"data-outside-visible-range":p.isOutsideVisibleRange||void 0,"data-outside-month":b||void 0,"data-selected":p.isSelected||void 0,"data-selection-start":v||void 0,"data-selection-end":w||void 0,"data-invalid":p.isInvalid||void 0};return fY().createElement("td",{...d,ref:n},fY().createElement("div",{...y5(gh(t),f,y,h,S,x),ref:c}))}),_B=(0,fZ.createContext)({}),_V=(0,fZ.forwardRef)(function(e,t){var n,r;[e,t]=gt(e,t,_B);let{isDisabled:o,isInvalid:i,onHoverStart:a,onHoverChange:s,onHoverEnd:l,...u}=e,{hoverProps:c,isHovered:d}=bL({onHoverStart:a,onHoverChange:s,onHoverEnd:l,isDisabled:o}),{isFocused:f,isFocusVisible:p,focusProps:h}=bA({within:!0});null!=o||(o=!!e["aria-disabled"]&&"false"!==e["aria-disabled"]),null!=i||(i=!!e["aria-invalid"]&&"false"!==e["aria-invalid"]);let m=y8({...e,values:{isHovered:d,isFocusWithin:f,isFocusVisible:p,isDisabled:o,isInvalid:i},defaultClassName:"react-aria-Group"});return fY().createElement("div",{...y5(u,h,c),...m,ref:t,role:null!=(n=e.role)?n:"group",slot:null!=(r=e.slot)?r:void 0,"data-focus-within":f||void 0,"data-hovered":d||void 0,"data-focus-visible":p||void 0,"data-disabled":o||void 0,"data-invalid":i||void 0},m.children)}),_U=(0,fZ.createContext)({}),_W=bB(function(e,t){[e,t]=gt(e,t,_U);let{hoverProps:n,isHovered:r}=bL(e),{isFocused:o,isFocusVisible:i,focusProps:a}=bA({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e["aria-invalid"]&&"false"!==e["aria-invalid"],l=y8({...e,values:{isHovered:r,isFocused:o,isFocusVisible:i,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:"react-aria-Input"});return fY().createElement("input",{...y5((e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...o}=e;return o})(e),a,n),...l,ref:t,"data-focused":o||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":i||void 0,"data-invalid":s||void 0})});function _K(e,t,n,r){return e.createTreeWalker(t,n,r)}let _z=fY().createContext(null),_H="react-aria-focus-scope-restore",_G=null;function _q(e){var t,n,r,o,i,a,s,l,u,c;let d,f,p,h,{children:m,contain:y,restoreFocus:g,autoFocus:b}=e,v=(0,fZ.useRef)(null),w=(0,fZ.useRef)(null),x=(0,fZ.useRef)([]),{parentNode:S}=(0,fZ.useContext)(_z)||{},E=(0,fZ.useMemo)(()=>new _8({scopeRef:x}),[x]);yz(()=>{let e=S||xe.root;if(xe.getTreeNode(e.scopeRef)&&_G&&!_X(_G,e.scopeRef)){let t=xe.getTreeNode(_G);t&&(e=t)}e.addChild(E),xe.addNode(E)},[E,S]),yz(()=>{let e=xe.getTreeNode(x);e&&(e.contain=!!y)},[y]),yz(()=>{let e=v.current?.nextSibling,t=[],n=e=>e.stopPropagation();for(;e&&e!==w.current;)t.push(e),e.addEventListener(_H,n),e=e.nextSibling;return x.current=t,()=>{for(let e of t)e.removeEventListener(_H,n)}},[m]),yz(()=>{if(n||r)return;let e=t.current,o=gg(e?e[0]:void 0),i=e=>{let n=gw(e);_J(n,t.current)?_G=t:_Q(n)||(_G=null)};return o.addEventListener("focusin",i,!1),e?.forEach(e=>e.addEventListener("focusin",i,!1)),()=>{o.removeEventListener("focusin",i,!1),e?.forEach(e=>e.removeEventListener("focusin",i,!1))}},[t=x,n=g,r=y]),o=x,i=y,d=(0,fZ.useRef)(void 0),f=(0,fZ.useRef)(void 0),yz(()=>{let e=o.current;if(!i){f.current&&(cancelAnimationFrame(f.current),f.current=void 0);return}let t=gg(e?e[0]:void 0),n=e=>{if("Tab"!==e.key||e.altKey||e.ctrlKey||e.metaKey||!_Y(o)||e.isComposing)return;let n=((e=document)=>e.activeElement)(t),r=o.current;if(!r||!_J(n,r))return;let i=_6(_Z(r),{tabbable:!0},r);if(!n)return;i.currentNode=n;let a=e.shiftKey?i.previousNode():i.nextNode();a||(i.currentNode=e.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,a=e.shiftKey?i.previousNode():i.nextNode()),e.preventDefault(),a&&(_0(a,!0),a instanceof gb(a).HTMLInputElement&&a.select())},r=e=>{(!_G||_X(_G,o))&&_J(gw(e),o.current)?(_G=o,d.current=gw(e)):_Y(o)&&!_Q(gw(e),o)?d.current?d.current.focus():_G&&_G.current&&_2(_G.current):_Y(o)&&(d.current=gw(e))},a=e=>{f.current&&cancelAnimationFrame(f.current),f.current=requestAnimationFrame(()=>{let n=gG,r=("virtual"===n||null===n)&&gW()&&gU(),i=((e=document)=>e.activeElement)(t);if(!r&&i&&_Y(o)&&!_Q(i,o)){_G=o;let t=gw(e);t&&t.isConnected?(d.current=t,d.current?.focus()):_G.current&&_2(_G.current)}})};return t.addEventListener("keydown",n,!1),t.addEventListener("focusin",r,!1),e?.forEach(e=>e.addEventListener("focusin",r,!1)),e?.forEach(e=>e.addEventListener("focusout",a,!1)),()=>{t.removeEventListener("keydown",n,!1),t.removeEventListener("focusin",r,!1),e?.forEach(e=>e.removeEventListener("focusin",r,!1)),e?.forEach(e=>e.removeEventListener("focusout",a,!1))}},[o,i]),yz(()=>()=>{f.current&&cancelAnimationFrame(f.current)},[f]),a=x,s=g,l=y,p=(0,fZ.useRef)("u">typeof document?((e=document)=>e.activeElement)(gg(a.current?a.current[0]:void 0)):null),yz(()=>{let e=a.current,t=gg(e?e[0]:void 0);if(!s||l)return;let n=()=>{(!_G||_X(_G,a))&&_J(((e=document)=>e.activeElement)(t),a.current)&&(_G=a)};return t.addEventListener("focusin",n,!1),e?.forEach(e=>e.addEventListener("focusin",n,!1)),()=>{t.removeEventListener("focusin",n,!1),e?.forEach(e=>e.removeEventListener("focusin",n,!1))}},[a,l]),yz(()=>{let e=gg(a.current?a.current[0]:void 0);if(!s)return;let t=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!_Y(a)||t.isComposing)return;let n=e.activeElement;if(!_Q(n,a)||!_4(a))return;let r=xe.getTreeNode(a);if(!r)return;let o=r.nodeToRestore,i=_6(e.body,{tabbable:!0});i.currentNode=n;let s=t.shiftKey?i.previousNode():i.nextNode();if(o&&o.isConnected&&o!==e.body||(o=void 0,r.nodeToRestore=void 0),(!s||!_Q(s,a))&&o){i.currentNode=o;do s=t.shiftKey?i.previousNode():i.nextNode();while(_Q(s,a));(t.preventDefault(),t.stopPropagation(),s)?_0(s,!0):_Q(o)?_0(o,!0):n.blur()}};return l||e.addEventListener("keydown",t,!0),()=>{l||e.removeEventListener("keydown",t,!0)}},[a,s,l]),yz(()=>{let e=gg(a.current?a.current[0]:void 0);if(!s)return;let t=xe.getTreeNode(a);if(t)return t.nodeToRestore=p.current??void 0,()=>{let t=xe.getTreeNode(a);if(!t)return;let n=t.nodeToRestore,r=((e=document)=>e.activeElement)(e);if(s&&n&&(r&&_Q(r,a)||r===e.body&&_4(a))){let t=xe.clone();requestAnimationFrame(()=>{if(e.activeElement===e.body){let e=t.getTreeNode(a);for(;e;){if(e.nodeToRestore&&e.nodeToRestore.isConnected)return void _3(e.nodeToRestore);e=e.parent}for(e=t.getTreeNode(a);e;){if(e.scopeRef&&e.scopeRef.current&&xe.getTreeNode(e.scopeRef))return void _3(_1(e.scopeRef.current,!0));e=e.parent}}})}}},[a,s]),u=x,c=b,h=fY().useRef(c),(0,fZ.useEffect)(()=>{h.current&&(_G=u,!_J(((e=document)=>e.activeElement)(gg(u.current?u.current[0]:void 0)),_G.current)&&u.current&&_2(u.current)),h.current=!1},[u]),(0,fZ.useEffect)(()=>{let e=((e=document)=>e.activeElement)(gg(x.current?x.current[0]:void 0)),t=null;if(_J(e,x.current)){for(let n of xe.traverse())n.scopeRef&&_J(e,n.scopeRef.current)&&(t=n);t===xe.getTreeNode(x)&&(_G=t.scopeRef)}},[x]),yz(()=>()=>{let e=xe.getTreeNode(x)?.parent?.scopeRef??null;(x===_G||_X(x,_G))&&(!e||xe.getTreeNode(e))&&(_G=e),xe.removeTreeNode(x)},[x]);let D=(0,fZ.useMemo)(()=>{var e;return e=x,{focusNext(t={}){let n=e.current,{from:r,tabbable:o,wrap:i,accept:a}=t,s=r||((e=document)=>e.activeElement)(gg(n[0]??void 0)),l=n[0].previousElementSibling,u=_6(_Z(n),{tabbable:o,accept:a},n);u.currentNode=_J(s,n)?s:l;let c=u.nextNode();return!c&&i&&(u.currentNode=l,c=u.nextNode()),c&&_0(c,!0),c},focusPrevious(t={}){let n=e.current,{from:r,tabbable:o,wrap:i,accept:a}=t,s=r||((e=document)=>e.activeElement)(gg(n[0]??void 0)),l=n[n.length-1].nextElementSibling,u=_6(_Z(n),{tabbable:o,accept:a},n);u.currentNode=_J(s,n)?s:l;let c=u.previousNode();return!c&&i&&(u.currentNode=l,c=u.previousNode()),c&&_0(c,!0),c},focusFirst(t={}){let n=e.current,{tabbable:r,accept:o}=t,i=_6(_Z(n),{tabbable:r,accept:o},n);i.currentNode=n[0].previousElementSibling;let a=i.nextNode();return a&&_0(a,!0),a},focusLast(t={}){let n=e.current,{tabbable:r,accept:o}=t,i=_6(_Z(n),{tabbable:r,accept:o},n);i.currentNode=n[n.length-1].nextElementSibling;let a=i.previousNode();return a&&_0(a,!0),a}}},[]),O=(0,fZ.useMemo)(()=>({focusManager:D,parentNode:E}),[E,D]);return fY().createElement(_z.Provider,{value:O},fY().createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:v}),m,fY().createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:w}))}function _Z(e){return e[0].parentElement}function _Y(e){let t=xe.getTreeNode(_G);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function _J(e,t){return!!e&&!!t&&t.some(t=>gv(t,e))}function _Q(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of xe.traverse(xe.getTreeNode(t)))if(n&&_J(e,n.current))return!0;return!1}function _X(e,t){let n=xe.getTreeNode(t)?.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function _0(e,t=!1){if(null==e||t){if(null!=e)try{e.focus()}catch{}}else try{br(e)}catch{}}function _1(e,t=!0){let n=e[0].previousElementSibling,r=_Z(e),o=_6(r,{tabbable:t},e);o.currentNode=n;let i=o.nextNode();return t&&!i&&((o=_6(r=_Z(e),{tabbable:!1},e)).currentNode=n,i=o.nextNode()),i}function _2(e,t=!0){_0(_1(e,t))}function _4(e){let t=xe.getTreeNode(_G);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function _3(e){e.dispatchEvent(new CustomEvent(_H,{bubbles:!0,cancelable:!0}))&&_0(e)}function _6(e,t,n){let r=t?.tabbable?gk:gP,o=gg(e?.nodeType===Node.ELEMENT_NODE?e:null),i=_K(o,e||o,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>gv(t?.from,e)||t?.tabbable&&"INPUT"===e.tagName&&"radio"===e.getAttribute("type")&&(!function(e){if(e.checked)return!0;let t=function(e){if(!e.form)return Array.from(gg(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(e=>!e.form);let t=e.form.elements.namedItem(e.name),n=gb(e);return t instanceof n.RadioNodeList?Array.from(t).filter(e=>e instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}(e);return t.length>0&&!t.some(e=>e.checked)}(e)||"INPUT"===i.currentNode.tagName&&"radio"===i.currentNode.type&&i.currentNode.name===e.name)?NodeFilter.FILTER_REJECT:r(e)&&(!n||_J(e,n))&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});return t?.from&&(i.currentNode=t.from),i}function _5(e,t={}){return{focusNext(n={}){let r=e.current;if(!r)return null;let{from:o,tabbable:i=t.tabbable,wrap:a=t.wrap,accept:s=t.accept}=n,l=o||((e=document)=>e.activeElement)(gg(r)),u=_6(r,{tabbable:i,accept:s});gv(r,l)&&(u.currentNode=l);let c=u.nextNode();return!c&&a&&(u.currentNode=r,c=u.nextNode()),c&&_0(c,!0),c},focusPrevious(n=t){let r=e.current;if(!r)return null;let{from:o,tabbable:i=t.tabbable,wrap:a=t.wrap,accept:s=t.accept}=n,l=o||((e=document)=>e.activeElement)(gg(r)),u=_6(r,{tabbable:i,accept:s});if(gv(r,l))u.currentNode=l;else{let e=_7(u);return e&&_0(e,!0),e??null}let c=u.previousNode();if(!c&&a){u.currentNode=r;let e=_7(u);if(!e)return null;c=e}return c&&_0(c,!0),c??null},focusFirst(n=t){let r=e.current;if(!r)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=n,a=_6(r,{tabbable:o,accept:i}).nextNode();return a&&_0(a,!0),a},focusLast(n=t){let r=e.current;if(!r)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=n,a=_7(_6(r,{tabbable:o,accept:i}));return a&&_0(a,!0),a??null}}}function _7(e){let t,n;do(t=e.lastChild())&&(n=t);while(t);return n}class _9{constructor(){this.fastMap=new Map,this.root=new _8({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(t??null);if(!r)return;let o=new _8({scopeRef:e});r.addChild(o),o.parent=r,this.fastMap.set(e,o),n&&(o.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(null===e)return;let t=this.fastMap.get(e);if(!t)return;let n=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&_J(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let r=t.children;n&&(n.removeChild(t),r.size>0&&r.forEach(e=>n&&n.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(null!=e.scopeRef&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){let e=new _9;for(let t of this.traverse())e.addTreeNode(t.scopeRef,t.parent?.scopeRef??null,t.nodeToRestore);return e}}class _8{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}}let xe=new _9;var xt={};function xn(e,t,n){let{direction:r}=b5(),o=(0,fZ.useMemo)(()=>_5(t),[t]),i=()=>{if(!t.current)return;let e=window.event?gw(window.event):null,n=_6(t.current,{tabbable:!0});if(e&&(n.currentNode=e,e=n.previousNode()),!e){let t;do(t=n.lastChild())&&(e=t);while(t)}for(;e?.hasAttribute("data-placeholder");){let t=n.previousNode();if(t&&t.hasAttribute("data-placeholder"))e=t;else break}e&&e.focus()},{pressProps:a}=bD({preventFocusOnPress:!0,allowTextSelectionOnPress:!0,onPressStart(e){"mouse"===e.pointerType&&i()},onPress(e){("touch"===e.pointerType||"pen"===e.pointerType)&&i()}});return y5(a,{onKeyDown:i=>{if(gv(i.currentTarget,gw(i))&&(i.altKey&&("ArrowDown"===i.key||"ArrowUp"===i.key)&&"setOpen"in e&&(i.preventDefault(),i.stopPropagation(),e.setOpen(!0)),!n))switch(i.key){case"ArrowLeft":if(i.preventDefault(),i.stopPropagation(),"rtl"===r){if(t.current){let e=gw(i),n=xr(t.current,e.getBoundingClientRect().left,-1);n&&n.focus()}}else o.focusPrevious();break;case"ArrowRight":if(i.preventDefault(),i.stopPropagation(),"rtl"===r){if(t.current){let e=gw(i),n=xr(t.current,e.getBoundingClientRect().left,1);n&&n.focus()}}else o.focusNext()}}})}function xr(e,t,n){let r=_6(e,{tabbable:!0}),o=r.nextNode(),i=null,a=1/0;for(;o;){let e=o.getBoundingClientRect().left-t,s=Math.abs(e);Math.sign(e)===n&&s<a&&(i=o,a=s),o=r.nextNode()}return i}function xo(e){let{description:t,errorMessage:n,isInvalid:r,validationState:o}=e,{labelProps:i,fieldProps:a}=function(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":o,labelElementType:i="label"}=e;t=y4(t);let a=y4(),s={};return n&&(r=r?`${a} ${r}`:a,s={id:a,htmlFor:"label"===i?t:void 0}),{labelProps:s,fieldProps:wx({id:t,"aria-label":o,"aria-labelledby":r})}}(e),s=y3([!!t,!!n,r,o]),l=y3([!!t,!!n,r,o]);return{labelProps:i,fieldProps:a=y5(a,{"aria-describedby":[s,l,e["aria-describedby"]].filter(Boolean).join(" ")||void 0}),descriptionProps:{id:s},errorMessageProps:{id:l}}}function xi(e,t,n){let r=bb(e=>{n&&!e.defaultPrevented&&n(t)});(0,fZ.useEffect)(()=>{let t=e?.current?.form;return t?.addEventListener("reset",r),()=>{t?.removeEventListener("reset",r)}},[e])}function xa(e,t,n){let{validationBehavior:r,focus:o}=e;yz(()=>{if("native"===r&&n?.current&&!n.current.disabled){var e;let r,o=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(o),n.current.hasAttribute("title")||(n.current.title=""),t.realtimeValidation.isInvalid||t.updateValidation({isInvalid:!(e=n.current).validity.valid,validationDetails:{badInput:(r=e.validity).badInput,customError:r.customError,patternMismatch:r.patternMismatch,rangeOverflow:r.rangeOverflow,rangeUnderflow:r.rangeUnderflow,stepMismatch:r.stepMismatch,tooLong:r.tooLong,tooShort:r.tooShort,typeMismatch:r.typeMismatch,valueMissing:r.valueMissing,valid:r.valid},validationErrors:e.validationMessage?[e.validationMessage]:[]})}});let i=(0,fZ.useRef)(!1),a=bb(()=>{i.current||t.resetValidation()}),s=bb(e=>{t.displayValidation.isInvalid||t.commitValidation();let r=n?.current?.form;!e.defaultPrevented&&n&&r&&function(e){for(let t=0;t<e.elements.length;t++){let n=e.elements[t];if(n.validity?.valid===!1)return n}return null}(r)===n.current&&(o?o():n.current?.focus(),gG="keyboard",gX("keyboard",null));e.preventDefault()}),l=bb(()=>{t.commitValidation()});(0,fZ.useEffect)(()=>{let e=n?.current;if(!e)return;let t=e.form,r=t?.reset;return t&&(t.reset=()=>{i.current=!window.event||"message"===window.event.type&&gw(window.event)instanceof MessagePort,r?.call(t),i.current=!1}),e.addEventListener("invalid",s),e.addEventListener("change",l),t?.addEventListener("reset",a),()=>{e.removeEventListener("invalid",s),e.removeEventListener("change",l),t?.removeEventListener("reset",a),t&&(t.reset=r)}},[n,r])}xt={"ar-AE":{calendar:"التقويم",day:"يوم",dayPeriod:"ص/م",endDate:"تاريخ الانتهاء",era:"العصر",hour:"الساعات",minute:"الدقائق",month:"الشهر",second:"الثواني",selectedDateDescription:e=>`\u{62A}\u{627}\u{631}\u{64A}\u{62E} \u{645}\u{62D}\u{62F}\u{62F}: ${e.date}`,selectedRangeDescription:e=>`\u{627}\u{644}\u{645}\u{62F}\u{649} \u{627}\u{644}\u{632}\u{645}\u{646}\u{64A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.startDate} \u{625}\u{644}\u{649} ${e.endDate}`,selectedTimeDescription:e=>`\u{627}\u{644}\u{648}\u{642}\u{62A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.time}`,startDate:"تاريخ البدء",timeZoneName:"التوقيت",weekday:"اليوم",year:"السنة"},"bg-BG":{calendar:"Календар",day:"ден",dayPeriod:"пр.об./сл.об.",endDate:"Крайна дата",era:"ера",hour:"час",minute:"минута",month:"месец",second:"секунда",selectedDateDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.startDate} \u{434}\u{43E} ${e.endDate}`,selectedTimeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{43E} \u{432}\u{440}\u{435}\u{43C}\u{435}: ${e.time}`,startDate:"Начална дата",timeZoneName:"часова зона",weekday:"ден от седмицата",year:"година"},"cs-CZ":{calendar:"Kalend\xe1ř",day:"den",dayPeriod:"č\xe1st dne",endDate:"Konečn\xe9 datum",era:"letopočet",hour:"hodina",minute:"minuta",month:"měs\xedc",second:"sekunda",selectedDateDescription:e=>`Vybran\xe9 datum: ${e.date}`,selectedRangeDescription:e=>`Vybran\xe9 obdob\xed: ${e.startDate} a\u{17E} ${e.endDate}`,selectedTimeDescription:e=>`Vybran\xfd \u{10D}as: ${e.time}`,startDate:"Poč\xe1tečn\xed datum",timeZoneName:"časov\xe9 p\xe1smo",weekday:"den v t\xfddnu",year:"rok"},"da-DK":{calendar:"Kalender",day:"dag",dayPeriod:"AM/PM",endDate:"Slutdato",era:"\xe6ra",hour:"time",minute:"minut",month:"m\xe5ned",second:"sekund",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tidspunkt: ${e.time}`,startDate:"Startdato",timeZoneName:"tidszone",weekday:"ugedag",year:"\xe5r"},"de-DE":{calendar:"Kalender",day:"Tag",dayPeriod:"Tagesh\xe4lfte",endDate:"Enddatum",era:"Epoche",hour:"Stunde",minute:"Minute",month:"Monat",second:"Sekunde",selectedDateDescription:e=>`Ausgew\xe4hltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgew\xe4hlter Bereich: ${e.startDate} bis ${e.endDate}`,selectedTimeDescription:e=>`Ausgew\xe4hlte Zeit: ${e.time}`,startDate:"Startdatum",timeZoneName:"Zeitzone",weekday:"Wochentag",year:"Jahr"},"el-GR":{calendar:"Ημερολόγιο",day:"ημέρα",dayPeriod:"π.μ./μ.μ.",endDate:"Ημερομηνία λήξης",era:"περίοδος",hour:"ώρα",minute:"λεπτό",month:"μήνας",second:"δευτερόλεπτο",selectedDateDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3B7}\u{3BC}\u{3B5}\u{3C1}\u{3BF}\u{3BC}\u{3B7}\u{3BD}\u{3AF}\u{3B1}: ${e.date}`,selectedRangeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3BF} \u{3B5}\u{3CD}\u{3C1}\u{3BF}\u{3C2}: ${e.startDate} \u{3AD}\u{3C9}\u{3C2} ${e.endDate}`,selectedTimeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3CE}\u{3C1}\u{3B1}: ${e.time}`,startDate:"Ημερομηνία έναρξης",timeZoneName:"ζώνη ώρας",weekday:"καθημερινή",year:"έτος"},"en-US":{era:"era",year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",dayPeriod:"AM/PM",calendar:"Calendar",startDate:"Start Date",endDate:"End Date",weekday:"day of the week",timeZoneName:"time zone",selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.startDate} to ${e.endDate}`,selectedTimeDescription:e=>`Selected Time: ${e.time}`},"es-ES":{calendar:"Calendario",day:"d\xeda",dayPeriod:"a.\xa0m./p.\xa0m.",endDate:"Fecha final",era:"era",hour:"hora",minute:"minuto",month:"mes",second:"segundo",selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Rango seleccionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora seleccionada: ${e.time}`,startDate:"Fecha de inicio",timeZoneName:"zona horaria",weekday:"d\xeda de la semana",year:"a\xf1o"},"et-EE":{calendar:"Kalender",day:"p\xe4ev",dayPeriod:"enne/p\xe4rast l\xf5unat",endDate:"L\xf5ppkuup\xe4ev",era:"ajastu",hour:"tund",minute:"minut",month:"kuu",second:"sekund",selectedDateDescription:e=>`Valitud kuup\xe4ev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.startDate} kuni ${e.endDate}`,selectedTimeDescription:e=>`Valitud aeg: ${e.time}`,startDate:"Alguskuup\xe4ev",timeZoneName:"ajav\xf6\xf6nd",weekday:"n\xe4dalap\xe4ev",year:"aasta"},"fi-FI":{calendar:"Kalenteri",day:"p\xe4iv\xe4",dayPeriod:"vuorokaudenaika",endDate:"P\xe4\xe4ttymisp\xe4iv\xe4",era:"aikakausi",hour:"tunti",minute:"minuutti",month:"kuukausi",second:"sekunti",selectedDateDescription:e=>`Valittu p\xe4iv\xe4m\xe4\xe4r\xe4: ${e.date}`,selectedRangeDescription:e=>`Valittu aikav\xe4li: ${e.startDate} \u{2013} ${e.endDate}`,selectedTimeDescription:e=>`Valittu aika: ${e.time}`,startDate:"Alkamisp\xe4iv\xe4",timeZoneName:"aikavy\xf6hyke",weekday:"viikonp\xe4iv\xe4",year:"vuosi"},"fr-FR":{calendar:"Calendrier",day:"jour",dayPeriod:"cadran",endDate:"Date de fin",era:"\xe8re",hour:"heure",minute:"minute",month:"mois",second:"seconde",selectedDateDescription:e=>`Date s\xe9lectionn\xe9e\xa0: ${e.date}`,selectedRangeDescription:e=>`Plage s\xe9lectionn\xe9e\xa0: ${e.startDate} au ${e.endDate}`,selectedTimeDescription:e=>`Heure choisie\xa0: ${e.time}`,startDate:"Date de d\xe9but",timeZoneName:"fuseau horaire",weekday:"jour de la semaine",year:"ann\xe9e"},"he-IL":{calendar:"לוח שנה",day:"יום",dayPeriod:"לפנה״צ/אחה״צ",endDate:"תאריך סיום",era:"תקופה",hour:"שעה",minute:"דקה",month:"חודש",second:"שנייה",selectedDateDescription:e=>`\u{5EA}\u{5D0}\u{5E8}\u{5D9}\u{5DA} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.date}`,selectedRangeDescription:e=>`\u{5D8}\u{5D5}\u{5D5}\u{5D7} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.startDate} \u{5E2}\u{5D3} ${e.endDate}`,selectedTimeDescription:e=>`\u{5D6}\u{5DE}\u{5DF} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.time}`,startDate:"תאריך התחלה",timeZoneName:"אזור זמן",weekday:"יום בשבוע",year:"שנה"},"hr-HR":{calendar:"Kalendar",day:"dan",dayPeriod:"AM/PM",endDate:"Datum završetka",era:"era",hour:"sat",minute:"minuta",month:"mjesec",second:"sekunda",selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Odabrano vrijeme: ${e.time}`,startDate:"Datum početka",timeZoneName:"vremenska zona",weekday:"dan u tjednu",year:"godina"},"hu-HU":{calendar:"Napt\xe1r",day:"nap",dayPeriod:"napszak",endDate:"Befejező d\xe1tum",era:"\xe9ra",hour:"\xf3ra",minute:"perc",month:"h\xf3nap",second:"m\xe1sodperc",selectedDateDescription:e=>`Kijel\xf6lt d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Kijel\xf6lt tartom\xe1ny: ${e.startDate}\u{2013}${e.endDate}`,selectedTimeDescription:e=>`Kijel\xf6lt id\u{151}: ${e.time}`,startDate:"Kezdő d\xe1tum",timeZoneName:"időz\xf3na",weekday:"h\xe9t napja",year:"\xe9v"},"it-IT":{calendar:"Calendario",day:"giorno",dayPeriod:"AM/PM",endDate:"Data finale",era:"era",hour:"ora",minute:"minuto",month:"mese",second:"secondo",selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: da ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Ora selezionata: ${e.time}`,startDate:"Data iniziale",timeZoneName:"fuso orario",weekday:"giorno della settimana",year:"anno"},"ja-JP":{calendar:"カレンダー",day:"日",dayPeriod:"午前/午後",endDate:"終了日",era:"時代",hour:"時",minute:"分",month:"月",second:"秒",selectedDateDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{65E5}\u{4ED8} : ${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{629E}\u{7BC4}\u{56F2} : ${e.startDate} \u{304B}\u{3089} ${e.endDate}`,selectedTimeDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{6642}\u{9593} : ${e.time}`,startDate:"開始日",timeZoneName:"タイムゾーン",weekday:"曜日",year:"年"},"ko-KR":{calendar:"달력",day:"일",dayPeriod:"오전/오후",endDate:"종료일",era:"연호",hour:"시",minute:"분",month:"월",second:"초",selectedDateDescription:e=>`\u{C120}\u{D0DD} \u{C77C}\u{C790}: ${e.date}`,selectedRangeDescription:e=>`\u{C120}\u{D0DD} \u{BC94}\u{C704}: ${e.startDate} ~ ${e.endDate}`,selectedTimeDescription:e=>`\u{C120}\u{D0DD} \u{C2DC}\u{AC04}: ${e.time}`,startDate:"시작일",timeZoneName:"시간대",weekday:"요일",year:"년"},"lt-LT":{calendar:"Kalendorius",day:"diena",dayPeriod:"iki pietų / po pietų",endDate:"Pabaigos data",era:"era",hour:"valanda",minute:"minutė",month:"mėnuo",second:"sekundė",selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: nuo ${e.startDate} iki ${e.endDate}`,selectedTimeDescription:e=>`Pasirinktas laikas: ${e.time}`,startDate:"Pradžios data",timeZoneName:"laiko juosta",weekday:"savaitės diena",year:"metai"},"lv-LV":{calendar:"Kalendārs",day:"diena",dayPeriod:"priekšpusdienā/pēcpusdienā",endDate:"Beigu datums",era:"ēra",hour:"stundas",minute:"minūtes",month:"mēnesis",second:"sekundes",selectedDateDescription:e=>`Atlas\u{12B}tais datums: ${e.date}`,selectedRangeDescription:e=>`Atlas\u{12B}tais diapazons: no ${e.startDate} l\u{12B}dz ${e.endDate}`,selectedTimeDescription:e=>`Atlas\u{12B}tais laiks: ${e.time}`,startDate:"Sākuma datums",timeZoneName:"laika josla",weekday:"nedēļas diena",year:"gads"},"nb-NO":{calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Sluttdato",era:"tidsalder",hour:"time",minute:"minutt",month:"m\xe5ned",second:"sekund",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt omr\xe5de: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tid: ${e.time}`,startDate:"Startdato",timeZoneName:"tidssone",weekday:"ukedag",year:"\xe5r"},"nl-NL":{calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Einddatum",era:"tijdperk",hour:"uur",minute:"minuut",month:"maand",second:"seconde",selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.startDate} tot ${e.endDate}`,selectedTimeDescription:e=>`Geselecteerde tijd: ${e.time}`,startDate:"Startdatum",timeZoneName:"tijdzone",weekday:"dag van de week",year:"jaar"},"pl-PL":{calendar:"Kalendarz",day:"dzień",dayPeriod:"rano / po południu / wieczorem",endDate:"Data końcowa",era:"era",hour:"godzina",minute:"minuta",month:"miesiąc",second:"sekunda",selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Wybrany czas: ${e.time}`,startDate:"Data początkowa",timeZoneName:"strefa czasowa",weekday:"dzień tygodnia",year:"rok"},"pt-BR":{calendar:"Calend\xe1rio",day:"dia",dayPeriod:"AM/PM",endDate:"Data final",era:"era",hour:"hora",minute:"minuto",month:"m\xeas",second:"segundo",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:"Data inicial",timeZoneName:"fuso hor\xe1rio",weekday:"dia da semana",year:"ano"},"pt-PT":{calendar:"Calend\xe1rio",day:"dia",dayPeriod:"am/pm",endDate:"Data de T\xe9rmino",era:"era",hour:"hora",minute:"minuto",month:"m\xeas",second:"segundo",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:"Data de In\xedcio",timeZoneName:"fuso hor\xe1rio",weekday:"dia da semana",year:"ano"},"ro-RO":{calendar:"Calendar",day:"zi",dayPeriod:"a.m/p.m.",endDate:"Dată final",era:"eră",hour:"oră",minute:"minut",month:"lună",second:"secundă",selectedDateDescription:e=>`Dat\u{103} selectat\u{103}: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: de la ${e.startDate} p\xe2n\u{103} la ${e.endDate}`,selectedTimeDescription:e=>`Ora selectat\u{103}: ${e.time}`,startDate:"Dată \xeenceput",timeZoneName:"fus orar",weekday:"ziua din săptăm\xe2nă",year:"an"},"ru-RU":{calendar:"Календарь",day:"день",dayPeriod:"AM/PM",endDate:"Дата окончания",era:"эра",hour:"час",minute:"минута",month:"месяц",second:"секунда",selectedDateDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{430}\u{44F} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{44B}\u{439} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: \u{441} ${e.startDate} \u{43F}\u{43E} ${e.endDate}`,selectedTimeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{43E}\u{435} \u{432}\u{440}\u{435}\u{43C}\u{44F}: ${e.time}`,startDate:"Дата начала",timeZoneName:"часовой пояс",weekday:"день недели",year:"год"},"sk-SK":{calendar:"Kalend\xe1r",day:"deň",dayPeriod:"AM/PM",endDate:"D\xe1tum ukončenia",era:"letopočet",hour:"hodina",minute:"min\xfata",month:"mesiac",second:"sekunda",selectedDateDescription:e=>`Vybrat\xfd d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Vybrat\xfd rozsah: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Vybrat\xfd \u{10D}as: ${e.time}`,startDate:"D\xe1tum začatia",timeZoneName:"časov\xe9 p\xe1smo",weekday:"deň t\xfdždňa",year:"rok"},"sl-SI":{calendar:"Koledar",day:"dan",dayPeriod:"dop/pop",endDate:"Datum konca",era:"doba",hour:"ura",minute:"minuta",month:"mesec",second:"sekunda",selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano obmo\u{10D}je: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izbrani \u{10D}as: ${e.time}`,startDate:"Datum začetka",timeZoneName:"časovni pas",weekday:"dan v tednu",year:"leto"},"sr-SP":{calendar:"Kalendar",day:"дан",dayPeriod:"пре подне/по подне",endDate:"Datum završetka",era:"ера",hour:"сат",minute:"минут",month:"месец",second:"секунд",selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani opseg: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izabrano vreme: ${e.time}`,startDate:"Datum početka",timeZoneName:"временска зона",weekday:"дан у недељи",year:"година"},"sv-SE":{calendar:"Kalender",day:"dag",dayPeriod:"fm/em",endDate:"Slutdatum",era:"era",hour:"timme",minute:"minut",month:"m\xe5nad",second:"sekund",selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.startDate} till ${e.endDate}`,selectedTimeDescription:e=>`Vald tid: ${e.time}`,startDate:"Startdatum",timeZoneName:"tidszon",weekday:"veckodag",year:"\xe5r"},"tr-TR":{calendar:"Takvim",day:"g\xfcn",dayPeriod:"\xd6\xd6/\xd6S",endDate:"Bitiş Tarihi",era:"\xe7ağ",hour:"saat",minute:"dakika",month:"ay",second:"saniye",selectedDateDescription:e=>`Se\xe7ilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Se\xe7ilen Aral\u{131}k: ${e.startDate} - ${e.endDate}`,selectedTimeDescription:e=>`Se\xe7ilen Zaman: ${e.time}`,startDate:"Başlangı\xe7 Tarihi",timeZoneName:"saat dilimi",weekday:"haftanın g\xfcn\xfc",year:"yıl"},"uk-UA":{calendar:"Календар",day:"день",dayPeriod:"дп/пп",endDate:"Дата завершення",era:"ера",hour:"година",minute:"хвилина",month:"місяць",second:"секунда",selectedDateDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.startDate} \u{2014} ${e.endDate}`,selectedTimeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{447}\u{430}\u{441}: ${e.time}`,startDate:"Дата початку",timeZoneName:"часовий пояс",weekday:"день тижня",year:"рік"},"zh-CN":{calendar:"日历",day:"日",dayPeriod:"上午/下午",endDate:"结束日期",era:"纪元",hour:"小时",minute:"分钟",month:"月",second:"秒",selectedDateDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{8303}\u{56F4}\u{FF1A}${e.startDate} \u{81F3} ${e.endDate}`,selectedTimeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65F6}\u{95F4}\u{FF1A}${e.time}`,startDate:"开始日期",timeZoneName:"时区",weekday:"工作日",year:"年"},"zh-TW":{calendar:"日曆",day:"日",dayPeriod:"上午/下午",endDate:"結束日期",era:"纪元",hour:"小时",minute:"分钟",month:"月",second:"秒",selectedDateDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{7BC4}\u{570D}\u{FF1A}${e.startDate} \u{81F3} ${e.endDate}`,selectedTimeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{6642}\u{9593}\u{FF1A}${e.time}`,startDate:"開始日期",timeZoneName:"时区",weekday:"工作日",year:"年"}};let xs=new WeakMap,xl="__reactAriaDateFieldRole",xu="__reactAriaDateFieldFocusManager";function xc(e,t,n){var r;let o,{isInvalid:i,validationErrors:a,validationDetails:s}=t.displayValidation,{labelProps:l,fieldProps:u,descriptionProps:c,errorMessageProps:d}=xo({...e,labelElementType:"span",isInvalid:i,errorMessage:e.errorMessage||a}),f=(0,fZ.useRef)(null),{focusWithinProps:p}=bR({...e,onFocusWithin(n){f.current=t.value,e.onFocus?.(n)},onBlurWithin:n=>{t.confirmPlaceholder(),t.value!==f.current&&t.commitValidation(),e.onBlur?.(n)},onFocusWithinChange:e.onFocusChange}),h=vb((r=xt)&&r.__esModule?r.default:r,"@react-aria/datepicker"),m="hour"===t.maxGranularity?"selectedTimeDescription":"selectedDateDescription",y="hour"===t.maxGranularity?"time":"date",g=wN(t.value?h.format(m,{[y]:t.formatValue({month:"long"})}):""),b="presentation"===e[xl]?u["aria-describedby"]:[g["aria-describedby"],u["aria-describedby"]].filter(Boolean).join(" ")||void 0,v=e[xu],w=(0,fZ.useMemo)(()=>v||_5(n),[v,n]),x=xn(t,n,"presentation"===e[xl]);xs.set(t,{ariaLabel:e["aria-label"],ariaLabelledBy:[l.id,e["aria-labelledby"]].filter(Boolean).join(" ")||void 0,ariaDescribedBy:b,focusManager:w});let S=(0,fZ.useRef)(e.autoFocus);o="presentation"===e[xl]?{role:"presentation"}:y5(u,{role:"group","aria-disabled":e.isDisabled||void 0,"aria-describedby":b}),(0,fZ.useEffect)(()=>{S.current&&w.focusFirst(),S.current=!1},[w]),xi(e.inputRef,t.defaultValue,t.setValue),xa({...e,focus(){w.focusFirst()}},t,e.inputRef);let E={type:"hidden",name:e.name,form:e.form,value:t.value?.toString()||"",disabled:e.isDisabled};"native"===e.validationBehavior&&(E.type="text",E.hidden=!0,E.required=e.isRequired,E.onChange=()=>{});let D=gh(e);return{labelProps:{...l,onClick:()=>{w.focusFirst()}},fieldProps:y5(D,o,x,p,{onKeyDown(t){e.onKeyDown&&e.onKeyDown(t)},onKeyUp(t){e.onKeyUp&&e.onKeyUp(t)},style:{unicodeBidi:"isolate"}}),inputProps:E,descriptionProps:c,errorMessageProps:d,isInvalid:i,validationErrors:a,validationDetails:s}}var xd={};xd={"ar-AE":{rangeOverflow:e=>`\u{64A}\u{62C}\u{628} \u{623}\u{646} \u{62A}\u{643}\u{648}\u{646} \u{627}\u{644}\u{642}\u{64A}\u{645}\u{629} ${e.maxValue} \u{623}\u{648} \u{642}\u{628}\u{644} \u{630}\u{644}\u{643}.`,rangeReversed:"تاريخ البدء يجب أن يكون قبل تاريخ الانتهاء.",rangeUnderflow:e=>`\u{64A}\u{62C}\u{628} \u{623}\u{646} \u{62A}\u{643}\u{648}\u{646} \u{627}\u{644}\u{642}\u{64A}\u{645}\u{629} ${e.minValue} \u{623}\u{648} \u{628}\u{639}\u{62F} \u{630}\u{644}\u{643}.`,unavailableDate:"البيانات المحددة غير متاحة."},"bg-BG":{rangeOverflow:e=>`\u{421}\u{442}\u{43E}\u{439}\u{43D}\u{43E}\u{441}\u{442}\u{442}\u{430} \u{442}\u{440}\u{44F}\u{431}\u{432}\u{430} \u{434}\u{430} \u{435} ${e.maxValue} \u{438}\u{43B}\u{438} \u{43F}\u{43E}-\u{440}\u{430}\u{43D}\u{43D}\u{430}.`,rangeReversed:"Началната дата трябва да е преди крайната.",rangeUnderflow:e=>`\u{421}\u{442}\u{43E}\u{439}\u{43D}\u{43E}\u{441}\u{442}\u{442}\u{430} \u{442}\u{440}\u{44F}\u{431}\u{432}\u{430} \u{434}\u{430} \u{435} ${e.minValue} \u{438}\u{43B}\u{438} \u{43F}\u{43E}-\u{43A}\u{44A}\u{441}\u{43D}\u{43E}.`,unavailableDate:"Избраната дата не е налична."},"cs-CZ":{rangeOverflow:e=>`Hodnota mus\xed b\xfdt ${e.maxValue} nebo d\u{159}\xedv\u{11B}j\u{161}\xed.`,rangeReversed:"Datum zah\xe1jen\xed mus\xed předch\xe1zet datu ukončen\xed.",rangeUnderflow:e=>`Hodnota mus\xed b\xfdt ${e.minValue} nebo pozd\u{11B}j\u{161}\xed.`,unavailableDate:"Vybran\xe9 datum nen\xed k dispozici."},"da-DK":{rangeOverflow:e=>`V\xe6rdien skal v\xe6re ${e.maxValue} eller tidligere.`,rangeReversed:"Startdatoen skal v\xe6re f\xf8r slutdatoen.",rangeUnderflow:e=>`V\xe6rdien skal v\xe6re ${e.minValue} eller nyere.`,unavailableDate:"Den valgte dato er ikke tilg\xe6ngelig."},"de-DE":{rangeOverflow:e=>`Der Wert muss ${e.maxValue} oder fr\xfcher sein.`,rangeReversed:"Das Startdatum muss vor dem Enddatum liegen.",rangeUnderflow:e=>`Der Wert muss ${e.minValue} oder sp\xe4ter sein.`,unavailableDate:"Das ausgew\xe4hlte Datum ist nicht verf\xfcgbar."},"el-GR":{rangeOverflow:e=>`\u{397} \u{3C4}\u{3B9}\u{3BC}\u{3AE} \u{3C0}\u{3C1}\u{3AD}\u{3C0}\u{3B5}\u{3B9} \u{3BD}\u{3B1} \u{3B5}\u{3AF}\u{3BD}\u{3B1}\u{3B9} ${e.maxValue} \u{3AE} \u{3C0}\u{3B1}\u{3BB}\u{3B1}\u{3B9}\u{3CC}\u{3C4}\u{3B5}\u{3C1}\u{3B7}.`,rangeReversed:"Η ημερομηνία έναρξης πρέπει να είναι πριν από την ημερομηνία λήξης.",rangeUnderflow:e=>`\u{397} \u{3C4}\u{3B9}\u{3BC}\u{3AE} \u{3C0}\u{3C1}\u{3AD}\u{3C0}\u{3B5}\u{3B9} \u{3BD}\u{3B1} \u{3B5}\u{3AF}\u{3BD}\u{3B1}\u{3B9} ${e.minValue} \u{3AE} \u{3BC}\u{3B5}\u{3C4}\u{3B1}\u{3B3}\u{3B5}\u{3BD}\u{3AD}\u{3C3}\u{3C4}\u{3B5}\u{3C1}\u{3B7}.`,unavailableDate:"Η επιλεγμένη ημερομηνία δεν είναι διαθέσιμη."},"en-US":{rangeUnderflow:e=>`Value must be ${e.minValue} or later.`,rangeOverflow:e=>`Value must be ${e.maxValue} or earlier.`,rangeReversed:"Start date must be before end date.",unavailableDate:"Selected date unavailable."},"es-ES":{rangeOverflow:e=>`El valor debe ser ${e.maxValue} o anterior.`,rangeReversed:"La fecha de inicio debe ser anterior a la fecha de finalizaci\xf3n.",rangeUnderflow:e=>`El valor debe ser ${e.minValue} o posterior.`,unavailableDate:"Fecha seleccionada no disponible."},"et-EE":{rangeOverflow:e=>`V\xe4\xe4rtus peab olema ${e.maxValue} v\xf5i varasem.`,rangeReversed:"Alguskuup\xe4ev peab olema enne l\xf5ppkuup\xe4eva.",rangeUnderflow:e=>`V\xe4\xe4rtus peab olema ${e.minValue} v\xf5i hilisem.`,unavailableDate:"Valitud kuup\xe4ev pole saadaval."},"fi-FI":{rangeOverflow:e=>`Arvon on oltava ${e.maxValue} tai sit\xe4 aikaisempi.`,rangeReversed:"Aloitusp\xe4iv\xe4n on oltava ennen lopetusp\xe4iv\xe4\xe4.",rangeUnderflow:e=>`Arvon on oltava ${e.minValue} tai sit\xe4 my\xf6h\xe4isempi.`,unavailableDate:"Valittu p\xe4iv\xe4m\xe4\xe4r\xe4 ei ole k\xe4ytett\xe4viss\xe4."},"fr-FR":{rangeOverflow:e=>`La valeur doit \xeatre ${e.maxValue} ou ant\xe9rieure.`,rangeReversed:"La date de d\xe9but doit \xeatre ant\xe9rieure \xe0 la date de fin.",rangeUnderflow:e=>`La valeur doit \xeatre ${e.minValue} ou ult\xe9rieure.`,unavailableDate:"La date s\xe9lectionn\xe9e n’est pas disponible."},"he-IL":{rangeOverflow:e=>`\u{5D4}\u{5E2}\u{5E8}\u{5DA} \u{5D7}\u{5D9}\u{5D9}\u{5D1} \u{5DC}\u{5D4}\u{5D9}\u{5D5}\u{5EA} ${e.maxValue} \u{5D0}\u{5D5} \u{5DE}\u{5D5}\u{5E7}\u{5D3}\u{5DD} \u{5D9}\u{5D5}\u{5EA}\u{5E8}.`,rangeReversed:"תאריך ההתחלה חייב להיות לפני תאריך הסיום.",rangeUnderflow:e=>`\u{5D4}\u{5E2}\u{5E8}\u{5DA} \u{5D7}\u{5D9}\u{5D9}\u{5D1} \u{5DC}\u{5D4}\u{5D9}\u{5D5}\u{5EA} ${e.minValue} \u{5D0}\u{5D5} \u{5DE}\u{5D0}\u{5D5}\u{5D7}\u{5E8} \u{5D9}\u{5D5}\u{5EA}\u{5E8}.`,unavailableDate:"התאריך הנבחר אינו זמין."},"hr-HR":{rangeOverflow:e=>`Vrijednost mora biti ${e.maxValue} ili ranije.`,rangeReversed:"Datum početka mora biti prije datuma završetka.",rangeUnderflow:e=>`Vrijednost mora biti ${e.minValue} ili kasnije.`,unavailableDate:"Odabrani datum nije dostupan."},"hu-HU":{rangeOverflow:e=>`Az \xe9rt\xe9knek ${e.maxValue} vagy kor\xe1bbinak kell lennie.`,rangeReversed:"A kezdő d\xe1tumnak a befejező d\xe1tumn\xe1l kor\xe1bbinak kell lennie.",rangeUnderflow:e=>`Az \xe9rt\xe9knek ${e.minValue} vagy k\xe9s\u{151}bbinek kell lennie.`,unavailableDate:"A kiv\xe1lasztott d\xe1tum nem \xe9rhető el."},"it-IT":{rangeOverflow:e=>`Il valore deve essere ${e.maxValue} o precedente.`,rangeReversed:"La data di inizio deve essere antecedente alla data di fine.",rangeUnderflow:e=>`Il valore deve essere ${e.minValue} o successivo.`,unavailableDate:"Data selezionata non disponibile."},"ja-JP":{rangeOverflow:e=>`\u{5024}\u{306F} ${e.maxValue} \u{4EE5}\u{4E0B}\u{306B}\u{3059}\u{308B}\u{5FC5}\u{8981}\u{304C}\u{3042}\u{308A}\u{307E}\u{3059}\u{3002}`,rangeReversed:"開始日は終了日より前にする必要があります。",rangeUnderflow:e=>`\u{5024}\u{306F} ${e.minValue} \u{4EE5}\u{4E0A}\u{306B}\u{3059}\u{308B}\u{5FC5}\u{8981}\u{304C}\u{3042}\u{308A}\u{307E}\u{3059}\u{3002}`,unavailableDate:"選択した日付は使用できません。"},"ko-KR":{rangeOverflow:e=>`\u{AC12}\u{C740} ${e.maxValue} \u{C774}\u{C804}\u{C774}\u{C5B4}\u{C57C} \u{D569}\u{B2C8}\u{B2E4}.`,rangeReversed:"시작일은 종료일 이전이어야 합니다.",rangeUnderflow:e=>`\u{AC12}\u{C740} ${e.minValue} \u{C774}\u{D6C4}\u{C5EC}\u{C57C} \u{D569}\u{B2C8}\u{B2E4}.`,unavailableDate:"선택한 날짜를 사용할 수 없습니다."},"lt-LT":{rangeOverflow:e=>`Reik\u{161}m\u{117} turi b\u{16B}ti ${e.maxValue} arba ankstesn\u{117}.`,rangeReversed:"Pradžios data turi būti ankstesnė nei pabaigos data.",rangeUnderflow:e=>`Reik\u{161}m\u{117} turi b\u{16B}ti ${e.minValue} arba naujesn\u{117}.`,unavailableDate:"Pasirinkta data nepasiekiama."},"lv-LV":{rangeOverflow:e=>`V\u{113}rt\u{12B}bai ir j\u{101}b\u{16B}t ${e.maxValue} vai agr\u{101}kai.`,rangeReversed:"Sākuma datumam ir jābūt pirms beigu datuma.",rangeUnderflow:e=>`V\u{113}rt\u{12B}bai ir j\u{101}b\u{16B}t ${e.minValue} vai v\u{113}l\u{101}kai.`,unavailableDate:"Atlasītais datums nav pieejams."},"nb-NO":{rangeOverflow:e=>`Verdien m\xe5 v\xe6re ${e.maxValue} eller tidligere.`,rangeReversed:"Startdatoen m\xe5 v\xe6re f\xf8r sluttdatoen.",rangeUnderflow:e=>`Verdien m\xe5 v\xe6re ${e.minValue} eller senere.`,unavailableDate:"Valgt dato utilgjengelig."},"nl-NL":{rangeOverflow:e=>`Waarde moet ${e.maxValue} of eerder zijn.`,rangeReversed:"De startdatum moet voor de einddatum liggen.",rangeUnderflow:e=>`Waarde moet ${e.minValue} of later zijn.`,unavailableDate:"Geselecteerde datum niet beschikbaar."},"pl-PL":{rangeOverflow:e=>`Warto\u{15B}\u{107} musi mie\u{107} warto\u{15B}\u{107} ${e.maxValue} lub wcze\u{15B}niejsz\u{105}.`,rangeReversed:"Data rozpoczęcia musi być wcześniejsza niż data zakończenia.",rangeUnderflow:e=>`Warto\u{15B}\u{107} musi mie\u{107} warto\u{15B}\u{107} ${e.minValue} lub p\xf3\u{17A}niejsz\u{105}.`,unavailableDate:"Wybrana data jest niedostępna."},"pt-BR":{rangeOverflow:e=>`O valor deve ser ${e.maxValue} ou anterior.`,rangeReversed:"A data inicial deve ser anterior \xe0 data final.",rangeUnderflow:e=>`O valor deve ser ${e.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xedvel."},"pt-PT":{rangeOverflow:e=>`O valor tem de ser ${e.maxValue} ou anterior.`,rangeReversed:"A data de in\xedcio deve ser anterior \xe0 data de fim.",rangeUnderflow:e=>`O valor tem de ser ${e.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xedvel."},"ro-RO":{rangeOverflow:e=>`Valoarea trebuie s\u{103} fie ${e.maxValue} sau anterioar\u{103}.`,rangeReversed:"Data de \xeenceput trebuie să fie anterioară datei de sf\xe2rșit.",rangeUnderflow:e=>`Valoarea trebuie s\u{103} fie ${e.minValue} sau ulterioar\u{103}.`,unavailableDate:"Data selectată nu este disponibilă."},"ru-RU":{rangeOverflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{438}\u{435} \u{434}\u{43E}\u{43B}\u{436}\u{43D}\u{43E} \u{431}\u{44B}\u{442}\u{44C} \u{43D}\u{435} \u{43F}\u{43E}\u{437}\u{436}\u{435} ${e.maxValue}.`,rangeReversed:"Дата начала должна предшествовать дате окончания.",rangeUnderflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{438}\u{435} \u{434}\u{43E}\u{43B}\u{436}\u{43D}\u{43E} \u{431}\u{44B}\u{442}\u{44C} \u{43D}\u{435} \u{440}\u{430}\u{43D}\u{44C}\u{448}\u{435} ${e.minValue}.`,unavailableDate:"Выбранная дата недоступна."},"sk-SK":{rangeOverflow:e=>`Hodnota mus\xed by\u{165} ${e.maxValue} alebo skor\u{161}ia.`,rangeReversed:"D\xe1tum začiatku mus\xed byť skorš\xed ako d\xe1tum konca.",rangeUnderflow:e=>`Hodnota mus\xed by\u{165} ${e.minValue} alebo neskor\u{161}ia.`,unavailableDate:"Vybrat\xfd d\xe1tum je nedostupn\xfd."},"sl-SI":{rangeOverflow:e=>`Vrednost mora biti ${e.maxValue} ali starej\u{161}a.`,rangeReversed:"Začetni datum mora biti pred končnim datumom.",rangeUnderflow:e=>`Vrednost mora biti ${e.minValue} ali novej\u{161}a.`,unavailableDate:"Izbrani datum ni na voljo."},"sr-SP":{rangeOverflow:e=>`Vrednost mora da bude ${e.maxValue} ili starija.`,rangeReversed:"Datum početka mora biti pre datuma završetka.",rangeUnderflow:e=>`Vrednost mora da bude ${e.minValue} ili novija.`,unavailableDate:"Izabrani datum nije dostupan."},"sv-SE":{rangeOverflow:e=>`V\xe4rdet m\xe5ste vara ${e.maxValue} eller tidigare.`,rangeReversed:"Startdatumet m\xe5ste vara f\xf6re slutdatumet.",rangeUnderflow:e=>`V\xe4rdet m\xe5ste vara ${e.minValue} eller senare.`,unavailableDate:"Det valda datumet \xe4r inte tillg\xe4ngligt."},"tr-TR":{rangeOverflow:e=>`De\u{11F}er, ${e.maxValue} veya \xf6ncesi olmal\u{131}d\u{131}r.`,rangeReversed:"Başlangı\xe7 tarihi bitiş tarihinden \xf6nce olmalıdır.",rangeUnderflow:e=>`De\u{11F}er, ${e.minValue} veya sonras\u{131} olmal\u{131}d\u{131}r.`,unavailableDate:"Se\xe7ilen tarih kullanılamıyor."},"uk-UA":{rangeOverflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{43D}\u{44F} \u{43C}\u{430}\u{454} \u{431}\u{443}\u{442}\u{438} \u{43D}\u{435} \u{43F}\u{456}\u{437}\u{43D}\u{456}\u{448}\u{435} ${e.maxValue}.`,rangeReversed:"Дата початку має передувати даті завершення.",rangeUnderflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{43D}\u{44F} \u{43C}\u{430}\u{454} \u{431}\u{443}\u{442}\u{438} \u{43D}\u{435} \u{440}\u{430}\u{43D}\u{456}\u{448}\u{435} ${e.minValue}.`,unavailableDate:"Вибрана дата недоступна."},"zh-CN":{rangeOverflow:e=>`\u{503C}\u{5FC5}\u{987B}\u{662F} ${e.maxValue} \u{6216}\u{66F4}\u{65E9}\u{65E5}\u{671F}\u{3002}`,rangeReversed:"开始日期必须早于结束日期。",rangeUnderflow:e=>`\u{503C}\u{5FC5}\u{987B}\u{662F} ${e.minValue} \u{6216}\u{66F4}\u{665A}\u{65E5}\u{671F}\u{3002}`,unavailableDate:"所选日期不可用。"},"zh-TW":{rangeOverflow:e=>`\u{503C}\u{5FC5}\u{9808}\u{662F} ${e.maxValue} \u{6216}\u{66F4}\u{65E9}\u{3002}`,rangeReversed:"開始日期必須在結束日期之前。",rangeUnderflow:e=>`\u{503C}\u{5FC5}\u{9808}\u{662F} ${e.minValue} \u{6216}\u{66F4}\u{665A}\u{3002}`,unavailableDate:"所選日期無法使用。"}};let xf={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},xp={...xf,customError:!0,valid:!1},xh={isInvalid:!1,validationDetails:xf,validationErrors:[]},xm=(0,fZ.createContext)({}),xy="__reactAriaFormValidationState";function xg(e){if(e[xy]){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:i}=e[xy];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:i}}return function(e){let{isInvalid:t,validationState:n,name:r,value:o,builtinValidation:i,validate:a,validationBehavior:s="aria"}=e;n&&(t||="invalid"===n);let l=void 0!==t?{isInvalid:t,validationErrors:[],validationDetails:xp}:null,u=(0,fZ.useMemo)(()=>a&&null!=o?xv(function(e,t){if("function"==typeof e){let n=e(t);if(n&&"boolean"!=typeof n)return xb(n)}return[]}(a,o)):null,[a,o]);i?.validationDetails.valid&&(i=void 0);let c=(0,fZ.useContext)(xm),d=(0,fZ.useMemo)(()=>r?Array.isArray(r)?r.flatMap(e=>xb(c[e])):xb(c[r]):[],[c,r]),[f,p]=(0,fZ.useState)(c),[h,m]=(0,fZ.useState)(!1);c!==f&&(p(c),m(!1));let y=(0,fZ.useMemo)(()=>xv(h?[]:d),[h,d]),g=(0,fZ.useRef)(xh),[b,v]=(0,fZ.useState)(xh),w=(0,fZ.useRef)(xh),[x,S]=(0,fZ.useState)(!1);return(0,fZ.useEffect)(()=>{if(!x)return;S(!1);let e=u||i||g.current;xw(e,w.current)||(w.current=e,v(e))}),{realtimeValidation:l||y||u||i||xh,displayValidation:"native"===s?l||y||b:l||y||u||i||b,updateValidation(e){"aria"!==s||xw(b,e)?g.current=e:v(e)},resetValidation(){xw(xh,w.current)||(w.current=xh,v(xh)),"native"===s&&S(!1),m(!0)},commitValidation(){"native"===s&&S(!0),m(!0)}}}(e)}function xb(e){return e?Array.isArray(e)?e:[e]:[]}function xv(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:xp}:null}function xw(e,t){return e===t||!!e&&!!t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((e,n)=>e===t.validationErrors[n])&&Object.entries(e.validationDetails).every(([e,n])=>t.validationDetails[e]===n)}function x_(...e){let t=new Set,n=!1,r={...xf};for(let o of e){for(let e of o.validationErrors)t.add(e);for(let e in n||=o.isInvalid,r)r[e]||=o.validationDetails[e]}return r.valid=!n,{isInvalid:n,validationErrors:[...t],validationDetails:r}}let xx=new vf((eu=xd)&&eu.__esModule?eu.default:eu);function xS(){let e="u">typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return e}function xE(e,t,n,r,o){let i=null!=e&&null!=n&&e.compare(n)>0,a=null!=e&&null!=t&&0>e.compare(t),s=null!=e&&r?.(e)||!1,l=i||a||s,u=[];if(l){let e=xS(),r=new vm(e,vf.getGlobalDictionaryForPackage("@react-stately/datepicker")||xx),l=new vr(e,xP({},o)),c=l.resolvedOptions().timeZone;a&&null!=t&&u.push(r.format("rangeUnderflow",{minValue:l.format(t.toDate(c))})),i&&null!=n&&u.push(r.format("rangeOverflow",{maxValue:l.format(n.toDate(c))})),s&&u.push(r.format("unavailableDate"))}return{isInvalid:l,validationErrors:u,validationDetails:{badInput:s,customError:!1,patternMismatch:!1,rangeOverflow:i,rangeUnderflow:a,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!l}}}let xD={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},xO={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};function xP(e,t){e={...t.shouldForceLeadingZeros?xO:xD,...e};let n=t.granularity||"minute",r=Object.keys(e),o=r.indexOf(t.maxGranularity??"year");o<0&&(o=0);let i=r.indexOf(n);if(i<0&&(i=2),o>i)throw Error("maxGranularity must be greater than granularity");let a=r.slice(o,i+1).reduce((t,n)=>(t[n]=e[n],t),{});return null!=t.hourCycle&&(a.hour12=12===t.hourCycle),a.timeZone=t.timeZone||"UTC",("hour"===n||"minute"===n||"second"===n)&&t.timeZone&&!t.hideTimeZone&&(a.timeZoneName="short"),t.showEra&&0===o&&(a.era="short"),a}function xk(e){return e&&"hour"in e?e:new vG}function xC(e,t){return null===e?null:e?v5(e,t):void 0}function xj(e,t){let n=e&&"timeZone"in e?e.timeZone:void 0,r=e&&"minute"in e?"minute":"day";if(e&&t&&!(t in e))throw Error("Invalid granularity "+t+" for value "+e.toString());let[o,i]=(0,fZ.useState)([r,n]);return e&&(o[0]!==r||o[1]!==n)&&i([r,n]),t||(t=e?r:o[0]),[t,e?n:o[1]]}let xT=new vf({ach:{year:"mwaka",month:"dwe",day:"nino"},af:{year:"jjjj",month:"mm",day:"dd"},am:{year:"ዓዓዓዓ",month:"ሚሜ",day:"ቀቀ"},an:{year:"aaaa",month:"mm",day:"dd"},ar:{year:"سنة",month:"شهر",day:"يوم"},ast:{year:"aaaa",month:"mm",day:"dd"},az:{year:"iiii",month:"aa",day:"gg"},be:{year:"гггг",month:"мм",day:"дд"},bg:{year:"гггг",month:"мм",day:"дд"},bn:{year:"yyyy",month:"মিমি",day:"dd"},br:{year:"bbbb",month:"mm",day:"dd"},bs:{year:"gggg",month:"mm",day:"dd"},ca:{year:"aaaa",month:"mm",day:"dd"},cak:{year:"jjjj",month:"ii",day:"q'q'"},ckb:{year:"ساڵ",month:"مانگ",day:"ڕۆژ"},cs:{year:"rrrr",month:"mm",day:"dd"},cy:{year:"bbbb",month:"mm",day:"dd"},da:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},de:{year:"jjjj",month:"mm",day:"tt"},dsb:{year:"llll",month:"mm",day:"źź"},el:{year:"εεεε",month:"μμ",day:"ηη"},en:{year:"yyyy",month:"mm",day:"dd"},eo:{year:"jjjj",month:"mm",day:"tt"},es:{year:"aaaa",month:"mm",day:"dd"},et:{year:"aaaa",month:"kk",day:"pp"},eu:{year:"uuuu",month:"hh",day:"ee"},fa:{year:"سال",month:"ماه",day:"روز"},ff:{year:"hhhh",month:"ll",day:"\xf1\xf1"},fi:{year:"vvvv",month:"kk",day:"pp"},fr:{year:"aaaa",month:"mm",day:"jj"},fy:{year:"jjjj",month:"mm",day:"dd"},ga:{year:"bbbb",month:"mm",day:"ll"},gd:{year:"bbbb",month:"mm",day:"ll"},gl:{year:"aaaa",month:"mm",day:"dd"},he:{year:"שנה",month:"חודש",day:"יום"},hr:{year:"gggg",month:"mm",day:"dd"},hsb:{year:"llll",month:"mm",day:"dd"},hu:{year:"\xe9\xe9\xe9\xe9",month:"hh",day:"nn"},ia:{year:"aaaa",month:"mm",day:"dd"},id:{year:"tttt",month:"bb",day:"hh"},is:{year:"\xe1\xe1\xe1\xe1",month:"mm",day:"dd"},it:{year:"aaaa",month:"mm",day:"gg"},ja:{year:"年",month:"月",day:"日"},ka:{year:"წწწწ",month:"თთ",day:"რრ"},kk:{year:"жжжж",month:"аа",day:"кк"},kn:{year:"ವವವವ",month:"ಮಿಮೀ",day:"ದಿದಿ"},ko:{year:"연도",month:"월",day:"일"},lb:{year:"jjjj",month:"mm",day:"dd"},lo:{year:"ປປປປ",month:"ດດ",day:"ວວ"},lt:{year:"mmmm",month:"mm",day:"dd"},lv:{year:"gggg",month:"mm",day:"dd"},meh:{year:"aaaa",month:"mm",day:"dd"},ml:{year:"വർഷം",month:"മാസം",day:"തീയതി"},ms:{year:"tttt",month:"mm",day:"hh"},nb:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},nl:{year:"jjjj",month:"mm",day:"dd"},nn:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},no:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},oc:{year:"aaaa",month:"mm",day:"jj"},pl:{year:"rrrr",month:"mm",day:"dd"},pt:{year:"aaaa",month:"mm",day:"dd"},rm:{year:"oooo",month:"mm",day:"dd"},ro:{year:"aaaa",month:"ll",day:"zz"},ru:{year:"гггг",month:"мм",day:"дд"},sc:{year:"aaaa",month:"mm",day:"dd"},scn:{year:"aaaa",month:"mm",day:"jj"},sk:{year:"rrrr",month:"mm",day:"dd"},sl:{year:"llll",month:"mm",day:"dd"},sr:{year:"гггг",month:"мм",day:"дд"},sv:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},szl:{year:"rrrr",month:"mm",day:"dd"},tg:{year:"сссс",month:"мм",day:"рр"},th:{year:"ปปปป",month:"ดด",day:"วว"},tr:{year:"yyyy",month:"aa",day:"gg"},uk:{year:"рррр",month:"мм",day:"дд"},"zh-CN":{year:"年",month:"月",day:"日"},"zh-TW":{year:"年",month:"月",day:"日"}},"en");class xR{constructor(e,t,n){if(this.era=n?.era??null,this.calendar=e,this.year=n?.year??null,this.month=n?.month??null,this.day=n?.day??null,this.hour=n?.hour??null,this.hourCycle=t,this.dayPeriod=null,this.minute=n?.minute??null,this.second=n?.second??null,this.millisecond=n?.millisecond??null,this.offset="offset"in(n??{})?n.offset:null,null!=this.hour){let[e,n]=xM(this.hour,t);this.dayPeriod=e,this.hour=n}}copy(){let e=new xR(this.calendar,this.hourCycle);return e.era=this.era,e.year=this.year,e.month=this.month,e.day=this.day,e.hour=this.hour,e.dayPeriod=this.dayPeriod,e.minute=this.minute,e.second=this.second,e.millisecond=this.millisecond,e.offset=this.offset,e}isComplete(e){return e.every(e=>null!=this[e])}validate(e,t){return t.every(t=>{if(("hour"===t||"dayPeriod"===t)&&"hour"in e){let[t,n]=xM(e.hour,this.hourCycle);return this.dayPeriod===t&&this.hour===n}return this[t]===e[t]})}isCleared(e){return e.every(e=>null===this[e])}set(e,t,n){let r=this.copy();return r[e]=t,"hour"===e&&null==r.dayPeriod&&"hour"in n&&(r.dayPeriod=xM(n.hour,this.hourCycle)[0]),"year"===e&&null==r.era&&(r.era=n.era),"second"!==e&&"literal"!==e&&"timeZoneName"!==e&&(r.offset=null),r}clear(e){let t=this.copy();return t[e]=null,"year"===e&&(t.era=null),t.offset=null,t}cycle(e,t,n,r){let o=this.copy();if(null==o[e]&&"dayPeriod"!==e&&"era"!==e){if("hour"===e&&"hour"in n){let[e,t]=xM(n.hour,this.hourCycle);o.dayPeriod=e,o.hour=t}else o[e]=n[e];return"year"===e&&null==o.era&&(o.era=n.era),o}switch(e){case"era":{let e=this.calendar.getEras(),n=e.indexOf(o.era);n=xA(n,t,0,e.length-1),o.era=e[n];break}case"year":{let r=new vH(this.calendar,this.era??n.era,this.year??n.year,this.month??1,this.day??1);o.era=(r=r.cycle(e,t,{round:"year"===e})).era,o.year=r.year;break}case"month":o.month=xA(o.month??1,t,1,this.calendar.getMaximumMonthsInYear());break;case"day":o.day=xA(o.day??1,t,1,this.calendar.getMaximumDaysInMonth());break;case"hour":{let e=r.some(e=>["year","month","day"].includes(e));if("timeZone"in n&&(!e||null!=o.year&&null!=o.month&&null!=o.day)){let e=this.toValue(n),[r,i]=xM((e=e.cycle("hour",t,{hourCycle:"h12"===this.hourCycle?12:24,round:!1})).hour,this.hourCycle);o.hour=i,o.dayPeriod=r,o.offset=e.offset}else{let e=o.hour??0,r=this.getSegmentLimits("hour");o.hour=xA(e,t,r.minValue,r.maxValue),null==o.dayPeriod&&"hour"in n&&(o.dayPeriod=xM(n.hour,this.hourCycle)[0])}break}case"dayPeriod":o.dayPeriod=xA(o.dayPeriod??0,t,0,1);break;case"minute":o.minute=xA(o.minute??0,t,0,59,!0);break;case"second":o.second=xA(o.second??0,t,0,59,!0)}return o}toValue(e){if(!("hour"in e))return e.set({era:this.era??e.era,year:this.year??e.year,month:this.month??e.month,day:this.day??e.day});{let t=this.hour;null!=t?t=function(e,t,n){switch(n){case"h11":1===t&&(e+=12);break;case"h12":12===e&&(e=0),1===t&&(e+=12);break;case"h24":e-=1}return e}(t,this.dayPeriod??0,this.hourCycle):("h12"===this.hourCycle||"h11"===this.hourCycle)&&(t=12*(1===this.dayPeriod));let n=e.set({era:this.era??e.era,year:this.year??e.year,month:this.month??e.month,day:this.day??e.day,hour:t??e.hour,minute:this.minute??e.minute,second:this.second??e.second,millisecond:this.millisecond??e.millisecond});return"offset"in n&&null!=this.offset&&n.offset!==this.offset&&(n=n.add({milliseconds:n.offset-this.offset})),n}}getSegmentLimits(e){switch(e){case"era":{let e=this.calendar.getEras();return{value:null!=this.era?e.indexOf(this.era):e.length-1,minValue:0,maxValue:e.length-1}}case"year":return{value:this.year,minValue:1,maxValue:9999};case"month":return{value:this.month,minValue:1,maxValue:this.calendar.getMaximumMonthsInYear()};case"day":return{value:this.day,minValue:1,maxValue:this.calendar.getMaximumDaysInMonth()};case"dayPeriod":return{value:this.dayPeriod,minValue:0,maxValue:1};case"hour":{let e=0,t=23;return"h12"===this.hourCycle?(e=1,t=12):"h11"===this.hourCycle&&(e=0,t=11),{value:this.hour,minValue:e,maxValue:t}}case"minute":return{value:this.minute,minValue:0,maxValue:59};case"second":return{value:this.second,minValue:0,maxValue:59}}}}function xA(e,t,n,r,o=!1){if(o){(e+=Math.sign(t))<n&&(e=r);let o=Math.abs(t);(e=t>0?Math.ceil(e/o)*o:Math.floor(e/o)*o)>r&&(e=n)}else(e+=t)<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function xM(e,t){let n=+(e>=12);switch(t){case"h11":e>=12&&(e-=12);break;case"h12":0===e?e=12:e>12&&(e-=12);break;case"h23":n=null;break;case"h24":e+=1,n=null}return[n,e]}var xN=n(19264);let xI={year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!0,dayPeriod:!0,era:!0},x$={year:5,month:2,day:7,hour:2,minute:15,second:15},xL={dayperiod:"dayPeriod",relatedYear:"year",yearName:"literal",unknown:"literal"};function xF(e){let{locale:t,createCalendar:n,hideTimeZone:r,isDisabled:o=!1,isReadOnly:i=!1,isRequired:a=!1,minValue:s,maxValue:l,isDateUnavailable:u}=e,c=e.value||e.defaultValue||e.placeholderValue||null,[d,f]=xj(c,e.granularity),p=f||"UTC";if(c&&!(d in c))throw Error("Invalid granularity "+d+" for value "+c.toString());let[h,m]=(0,fZ.useMemo)(()=>{let r=new vr(t,{dateStyle:"short",timeStyle:"short",hour12:null!=e.hourCycle?12===e.hourCycle:void 0}).resolvedOptions();return[n(r.calendar),r.hourCycle]},[t,e.hourCycle,n]),[y,g]=_x(e.value,e.defaultValue??null,e.onChange),[b]=(0,fZ.useState)(y),v=(0,fZ.useMemo)(()=>xC(y,h)??null,[y,h]),[w,x]=(0,fZ.useState)(()=>new xR(h,m,v)),S="gregory"===h.identifier&&"BC"===w.era,E=(0,fZ.useMemo)(()=>({granularity:d,maxGranularity:e.maxGranularity??"year",timeZone:f,hideTimeZone:r,hourCycle:e.hourCycle,showEra:S,shouldForceLeadingZeros:e.shouldForceLeadingZeros}),[e.maxGranularity,d,e.hourCycle,e.shouldForceLeadingZeros,f,r,S]),D=(0,fZ.useMemo)(()=>xP({},E),[E]),O=(0,fZ.useMemo)(()=>new vr(t,D),[t,D]),P=(0,fZ.useMemo)(()=>O.resolvedOptions(),[O]),k=(0,fZ.useMemo)(()=>(function(e,t,n,r){if(e)return xC(e,n);let o=v5(wr(r??wl()).set({hour:0,minute:0,second:0,millisecond:0}),n);return"year"===t||"month"===t||"day"===t?v3(o):r?o:v6(o)})(e.placeholderValue,d,h,f),[e.placeholderValue,d,h,f]),C=(0,fZ.useMemo)(()=>{let t="h11"===m||"h12"===m,n=["era","year","month","day","hour",...t?["dayPeriod"]:[],"minute","second"],r=n.indexOf(e.maxGranularity||"era"),o=n.indexOf("hour"===d&&t?"dayPeriod":d);return n.slice(r,o+1)},[e.maxGranularity,d,m]),[j,T]=(0,fZ.useState)(v),[R,A]=(0,fZ.useState)(h),[M,N]=(0,fZ.useState)(m);v===j&&m===M&&we(h,R)||(w=new xR(h,m,v),T(v),A(h),N(m),x(w));let I=t=>{if(!e.isDisabled&&!e.isReadOnly)if(null==t||t instanceof xR&&t.isCleared(C))x(new xR(h,m,v)),g(null);else if(t instanceof xR){if(t.isComplete(C)){let e=t.toValue(v??k);if(t.validate(e,C)){let t=v5(e,c?.calendar||new vD);if(!y||0!==t.compare(y)){x(new xR(h,m,v)),g(t);return}}}x(t)}else t=v5(t,c?.calendar||new vD),x(new xR(h,m,v)),g(t)},$=(0,fZ.useMemo)(()=>w.toValue(v??k).toDate(p),[w,p,v,k]),L=(0,fZ.useMemo)(()=>(function(e,t,n,r,o,i,a){let s=["hour","minute","second"],l=n.formatToParts(e),u=new(0,xN.K)(i,{useGrouping:!1}),c=new(0,xN.K)(i,{useGrouping:!1,minimumIntegerDigits:2});for(let e of l)if("year"===e.type||"month"===e.type||"day"===e.type||"hour"===e.type){let n=t[e.type]??0;"2-digit"===r[e.type]?e.value=c.format(n):e.value=u.format(n)}let d=[];for(let e of l){var f;let n=xL[e.type]||e.type,r=xI[n];"era"===n&&1===o.getEras().length&&(r=!1);let l=xI[n]&&null==t[e.type],u=xI[n]?(f=e.value,"era"===n||"dayPeriod"===n?f:"year"===n||"month"===n||"day"===n?xT.getStringForLocale(n,i):"––"):null,c={type:n,text:l?u:e.value,...t.getSegmentLimits(n),isPlaceholder:l,placeholder:u,isEditable:r};"hour"===n?(d.push({type:"literal",text:"⁦",isPlaceholder:!1,placeholder:"",isEditable:!1}),d.push(c),n===a&&d.push({type:"literal",text:"⁩",isPlaceholder:!1,placeholder:"",isEditable:!1})):s.includes(n)&&n===a?(d.push(c),d.push({type:"literal",text:"⁩",isPlaceholder:!1,placeholder:"",isEditable:!1})):d.push(c)}return d})($,w,O,P,h,t,d),[$,O,P,w,h,t,d]),F=(e,t)=>{I(w.cycle(e,t,k,C))},B=(0,fZ.useMemo)(()=>xE(y,s,l,u,E),[y,s,l,u,E]),V=xg({...e,value:y,builtinValidation:B}),U=V.displayValidation.isInvalid,W=e.validationState||(U?"invalid":null);return{...V,value:v,defaultValue:e.defaultValue??b,dateValue:$,calendar:h,setValue:I,segments:L,dateFormatter:O,validationState:W,isInvalid:U,granularity:d,maxGranularity:e.maxGranularity??"year",isDisabled:o,isReadOnly:i,isRequired:a,increment(e){F(e,1)},decrement(e){F(e,-1)},incrementPage(e){F(e,x$[e]||1)},decrementPage(e){F(e,-(x$[e]||1))},incrementToMax(e){let t="hour"===e&&"h12"===m?11:w.getSegmentLimits(e).maxValue;I(w.set(e,t,k))},decrementToMin(e){let t="hour"===e&&"h12"===m?12:w.getSegmentLimits(e).minValue;I(w.set(e,t,k))},setSegment(e,t){I(w.set(e,t,k))},confirmPlaceholder(){if(!e.isDisabled&&!e.isReadOnly&&w.isComplete(C)){let e=v5(w.toValue(v??k),c?.calendar||new vD);y&&0===e.compare(y)||g(e),x(new xR(h,m,v))}},clearSegment(e){let t=w;"timeZoneName"!==e&&"literal"!==e&&(t=w.clear(e)),I(t)},formatValue:e=>v?new vr(t,xP(e,E)).format($):"",getDateFormatter:(e,t)=>new vr(e,xP({},{...E,...t}))}}let xB=(0,fZ.createContext)(null),xV=(0,fZ.createContext)(null),xU=(0,fZ.createContext)(null),xW=(0,fZ.forwardRef)(function(e,t){let n=(0,fZ.useContext)(xV),r=(0,fZ.useContext)(xU);return n||r?fY().createElement(xz,{...e,ref:t}):fY().createElement(xK,{...e,ref:t})}),xK=(0,fZ.forwardRef)((e,t)=>{let[n,r]=gt({slot:e.slot},t,xB),{locale:o}=b5(),i=xF({...n,locale:o,createCalendar:_p}),a=(0,fZ.useRef)(null),{fieldProps:s,inputProps:l}=xc({...n,inputRef:a},i,r);return fY().createElement(y9,{values:[[xV,i],[_U,{...l,ref:a}],[_B,{...s,ref:r,isInvalid:i.isInvalid}]]},fY().createElement(xz,e))}),xz=(0,fZ.forwardRef)((e,t)=>{let{className:n,children:r}=e,o=(0,fZ.useContext)(xV),i=(0,fZ.useContext)(xU),a=null!=o?o:i;return fY().createElement(fY().Fragment,null,fY().createElement(_V,{...e,ref:t,slot:e.slot||void 0,className:null!=n?n:"react-aria-DateInput",isInvalid:a.isInvalid},a.segments.map((e,t)=>(0,fZ.cloneElement)(r(e),{key:t}))),fY().createElement(_W,null))});function xH({children:e}){let t=(0,fZ.useMemo)(()=>({register:()=>{}}),[]);return fY().createElement(by.Provider,{value:t},e)}fY().forwardRef(({children:e,...t},n)=>{let r=(0,fZ.useRef)(!1),o=(0,fZ.useContext)(by),i=y5(o||{},{...t,register(){r.current=!0,o&&o.register()}});return i.ref=yV(n||o?.ref),ba(o,i.ref),(0,fZ.useEffect)(()=>{r.current||(r.current=!0)},[]),fY().createElement(by.Provider,{value:i},e)});let xG=(0,fZ.createContext)({}),xq=fY().createContext(null);function xZ(e){let t=y0(),{portalContainer:n=t?null:document.body,isExiting:r}=e,[o,i]=(0,fZ.useState)(!1),a=(0,fZ.useMemo)(()=>({contain:o,setContain:i}),[o,i]),{getContainer:s}=(0,fZ.useContext)(xG)??{};if(!e.portalContainer&&s&&(n=s()),!n)return null;let l=e.children;return e.disableFocusManagement||(l=fY().createElement(_q,{restoreFocus:!0,contain:(e.shouldContainFocus||o)&&!r},l)),l=fY().createElement(xq.Provider,{value:a},fY().createElement(xH,null,l)),bw.createPortal(l,n)}let xY=(0,fZ.createContext)(null),xJ=(0,fZ.createContext)(null),xQ=(0,fZ.forwardRef)(function(e,t){let n=e["aria-labelledby"];[e,t]=gt(e,t,xY);let{dialogProps:r,titleProps:o}=function(e,t){let n,r,{role:o="dialog"}=e,i=y3();i=e["aria-label"]?void 0:i;let a=(0,fZ.useRef)(!1);return(0,fZ.useEffect)(()=>{if(t.current&&!g_(t.current)){br(t.current);let e=setTimeout(()=>{(((e=document)=>e.activeElement)()===t.current||((e=document)=>e.activeElement)()===document.body)&&(a.current=!0,t.current&&(t.current.blur(),br(t.current)),a.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),n=(0,fZ.useContext)(xq),yz(()=>{r?.(!0)},[r=n?.setContain]),(0,fZ.useRef)(!1),(0,fZ.useEffect)(()=>{}),{dialogProps:{...gh(e,{labelable:!0}),role:o,tabIndex:-1,"aria-labelledby":e["aria-labelledby"]||i,onBlur:e=>{a.current&&e.stopPropagation()}},titleProps:{id:i}}}({...e,"aria-labelledby":n},t),i=(0,fZ.useContext)(xJ);r["aria-label"]||r["aria-labelledby"]||(e["aria-labelledby"]?r["aria-labelledby"]=e["aria-labelledby"]:console.warn('If a Dialog does not contain a <Heading slot="title">, it must have an aria-label or aria-labelledby attribute for accessibility.'));let a=y8({defaultClassName:"react-aria-Dialog",className:e.className,style:e.style,children:e.children,values:{close:(null==i?void 0:i.close)||(()=>{})}});return fY().createElement("section",{...gh(e),...r,...a,ref:t,slot:e.slot||void 0},fY().createElement(y9,{values:[[bK,{slots:{[y7]:{},title:{...o,level:2}}}],[bU,{slots:{[y7]:{},close:{onPress:()=>null==i?void 0:i.close()}}}]]},a.children))}),xX=(0,fZ.createContext)(null),x0=(0,fZ.forwardRef)(function(e,t){let n=(0,fZ.useContext)(xX);return(null==n?void 0:n.isInvalid)?fY().createElement(x1,{...e,ref:t}):null}),x1=(0,fZ.forwardRef)((e,t)=>{let n=(0,fZ.useContext)(xX),r=gh(e),o=y8({...e,defaultClassName:"react-aria-FieldError",defaultChildren:0===n.validationErrors.length?void 0:n.validationErrors.join(" "),values:n});return null==o.children?null:fY().createElement(bH,{slot:"errorMessage",...r,...o,ref:t})}),x2=(0,fZ.createContext)(null),x4=(0,fZ.createContext)({}),x3=bB(function(e,t){[e,t]=gt(e,t,x4);let{elementType:n="label",...r}=e;return fY().createElement(n,{className:"react-aria-Label",...r,ref:t})}),x6=(0,fZ.createContext)({placement:"bottom"}),x5="u">typeof HTMLElement&&"inert"in HTMLElement.prototype,x7=new WeakMap,x9=[];function x8(e,t=-1/0,n=1/0){return Math.min(Math.max(e,t),n)}function Se(e,t){let n=e,r=0,o=t.toString(),i=o.toLowerCase().indexOf("e-");if(i>0)r=Math.abs(Math.floor(Math.log10(Math.abs(t))))+i;else{let e=o.indexOf(".");e>=0&&(r=o.length-e)}if(r>0){let e=Math.pow(10,r);n=Math.round(n*e)/e}return n}function St(e,t,n,r){t=Number(t),n=Number(n);let o=(e-(isNaN(t)?0:t))%r,i=Se(2*Math.abs(o)>=r?e+Math.sign(o)*(r-Math.abs(o)):e-o,r);return isNaN(t)?!isNaN(n)&&i>n&&(i=Math.floor(Se(n/r,r))*r):i<t?i=t:!isNaN(n)&&i>n&&(i=t+Math.floor(Se((n-t)/r,r))*r),i=Se(i,r)}let Sn={top:"top",bottom:"top",left:"left",right:"left"},Sr={top:"bottom",bottom:"top",left:"right",right:"left"},So={top:"left",left:"top"},Si={top:"height",left:"width"},Sa={width:"totalWidth",height:"totalHeight"},Ss={};function Sl(e,t){let n=0,r=0,o=0,i=0,a=0,s=0,l={},u=(t?.scale??1)>1;if("BODY"===e.tagName||"HTML"===e.tagName){let u=document.documentElement;o=u.clientWidth,i=u.clientHeight,n=t?.width??o,r=t?.height??i,l.top=u.scrollTop||e.scrollTop,l.left=u.scrollLeft||e.scrollLeft,t&&(a=t.offsetTop,s=t.offsetLeft)}else({width:n,height:r,top:a,left:s}=Sh(e,!1)),l.top=e.scrollTop,l.left=e.scrollLeft,o=n,i=r;return gV()&&("BODY"===e.tagName||"HTML"===e.tagName)&&u&&(l.top=0,l.left=0,a=t?.pageTop??0,s=t?.pageLeft??0),{width:n,height:r,totalWidth:o,totalHeight:i,scroll:l,top:a,left:s}}function Su(e,t,n,r,o,i,a){let s=o.scroll[e]??0,l=r[Si[e]],u=a[e]+r.scroll[Sn[e]]+i,c=a[e]+r.scroll[Sn[e]]+l-i,d=t-s+r.scroll[Sn[e]]+a[e]-r[Sn[e]],f=t-s+n+r.scroll[Sn[e]]+a[e]-r[Sn[e]];return d<u?u-d:f>c?Math.max(c-f,u-d):0}function Sc(e){if(Ss[e])return Ss[e];let[t,n]=e.split(" "),r=Sn[t]||"right",o=So[r];Sn[n]||(n="center");let i=Si[r],a=Si[o];return Ss[e]={placement:t,crossPlacement:n,axis:r,crossAxis:o,size:i,crossSize:a},Ss[e]}function Sd(e,t,n,r,o,i,a,s,l,u,c){let{placement:d,crossPlacement:f,axis:p,crossAxis:h,size:m,crossSize:y}=r,g={};g[h]=e[h]??0,"center"===f?g[h]+=((e[y]??0)-(n[y]??0))/2:f!==h&&(g[h]+=(e[y]??0)-(n[y]??0)),g[h]+=i;let b=e[h]-n[y]+l+u,v=e[h]+e[y]-l-u;if(g[h]=x8(g[h],b,v),d===p){let t=s?c[m]:c[Sa[m]];g[Sr[p]]=Math.floor(t-e[p]+o)}else g[p]=Math.floor(e[p]+e[m]+o);return g}function Sf(e,t,n,r,o,i,a,s){let{placement:l,axis:u,size:c}=i;return l===u?Math.max(0,n[u]-(a.scroll[u]??0)-(e[u]+(s?t[u]:0))-(r[u]??0)-r[Sr[u]]-o):Math.max(0,e[c]+e[u]+(s?t[u]:0)-n[u]-n[c]+(a.scroll[u]??0)-(r[u]??0)-r[Sr[u]]-o)}function Sp(e,t){let{top:n,left:r,width:o,height:i}=e.getBoundingClientRect();return t&&e instanceof e.ownerDocument.defaultView.HTMLElement&&(o=e.offsetWidth,i=e.offsetHeight),{top:n,left:r,width:o,height:i}}function Sh(e,t){let{top:n,left:r,width:o,height:i}=Sp(e,t),{scrollTop:a,scrollLeft:s,clientTop:l,clientLeft:u}=document.documentElement;return{top:n+a-l,left:r+s-u,width:o,height:i}}function Sm(e,t,n){let r,o=window.getComputedStyle(e);if("fixed"===o.position)r=Sp(e,n);else{r=Sh(e,n);let o=Sh(t,n),i=window.getComputedStyle(t);o.top+=(parseInt(i.borderTopWidth,10)||0)-t.scrollTop,o.left+=(parseInt(i.borderLeftWidth,10)||0)-t.scrollLeft,r.top-=o.top,r.left-=o.left}return r.top-=parseInt(o.marginTop,10)||0,r.left-=parseInt(o.marginLeft,10)||0,r}function Sy(e){let t=window.getComputedStyle(e);return"none"!==t.transform||/transform|perspective/.test(t.willChange)||"none"!==t.filter||"paint"===t.contain||"backdropFilter"in t&&"none"!==t.backdropFilter||"WebkitBackdropFilter"in t&&"none"!==t.WebkitBackdropFilter}let Sg=new WeakMap;function Sb(e){let{ref:t,box:n,onResize:r}=e,o=bb(r);(0,fZ.useEffect)(()=>{let e=t?.current;if(e)if(void 0===window.ResizeObserver)return window.addEventListener("resize",o,!1),()=>{window.removeEventListener("resize",o,!1)};else{let t=new window.ResizeObserver(e=>{e.length&&o()});return t.observe(e,{box:n}),()=>{e&&t.unobserve(e)}}},[t,n])}let Sv="u">typeof document?window.visualViewport:null;function Sw(e,t){if(e.button>0)return!1;let n=gw(e);if(n){let e=n.ownerDocument;if(!e||!gv(e.documentElement,n)||n.closest("[data-react-aria-top-layer]"))return!1}return!!t.current&&!e.composedPath().includes(t.current)}let S_=[],Sx=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function SS(e){return e instanceof HTMLInputElement&&!Sx.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}let SE="u">typeof document&&window.visualViewport,SD=0;function SO(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function SP(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Sk(e,t){t||!SE?SC(e):SE.addEventListener("resize",()=>SC(e),{once:!0})}function SC(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let e=wC(n);if(e!==document.documentElement&&e!==document.body&&e!==n){let t=e.getBoundingClientRect(),r=n.getBoundingClientRect();if(r.top<t.top||r.bottom>t.top+n.clientHeight){let n=t.bottom;SE&&(n=Math.min(n,SE.offsetTop+SE.height));let o=r.top-t.top-((n-t.top)/2-r.height/2);e.scrollTo({top:Math.max(0,Math.min(e.scrollHeight-e.clientHeight,e.scrollTop+o)),behavior:"smooth"})}}n=e.parentElement}}var Sj={};function ST(e){var t;let{onDismiss:n,...r}=e,o=wx(r,vb((t=Sj)&&t.__esModule?t.default:t,"@react-aria/overlays").format("dismiss"));return fY().createElement(wO,null,fY().createElement("button",{...o,tabIndex:-1,onClick:()=>{n&&n()},style:{width:1,height:1}}))}function SR(e,t,n){yz(()=>{if(t&&e.current){if(!("getAnimations"in e.current))return void n();let t=e.current.getAnimations();if(0===t.length)return void n();let r=!1;return Promise.allSettled(t.map(e=>e.finished)).then(()=>{r||(0,bw.flushSync)(()=>{n()})}),()=>{r=!0}}},[e,t,n])}Sj={"ar-AE":{dismiss:"تجاهل"},"bg-BG":{dismiss:"Отхвърляне"},"cs-CZ":{dismiss:"Odstranit"},"da-DK":{dismiss:"Luk"},"de-DE":{dismiss:"Schlie\xdfen"},"el-GR":{dismiss:"Απόρριψη"},"en-US":{dismiss:"Dismiss"},"es-ES":{dismiss:"Descartar"},"et-EE":{dismiss:"L\xf5peta"},"fi-FI":{dismiss:"Hylk\xe4\xe4"},"fr-FR":{dismiss:"Rejeter"},"he-IL":{dismiss:"התעלם"},"hr-HR":{dismiss:"Odbaci"},"hu-HU":{dismiss:"Elutas\xedt\xe1s"},"it-IT":{dismiss:"Ignora"},"ja-JP":{dismiss:"閉じる"},"ko-KR":{dismiss:"무시"},"lt-LT":{dismiss:"Atmesti"},"lv-LV":{dismiss:"Nerādīt"},"nb-NO":{dismiss:"Lukk"},"nl-NL":{dismiss:"Negeren"},"pl-PL":{dismiss:"Zignoruj"},"pt-BR":{dismiss:"Descartar"},"pt-PT":{dismiss:"Dispensar"},"ro-RO":{dismiss:"Revocare"},"ru-RU":{dismiss:"Пропустить"},"sk-SK":{dismiss:"Zrušiť"},"sl-SI":{dismiss:"Opusti"},"sr-SP":{dismiss:"Odbaci"},"sv-SE":{dismiss:"Avvisa"},"tr-TR":{dismiss:"Kapat"},"uk-UA":{dismiss:"Скасувати"},"zh-CN":{dismiss:"取消"},"zh-TW":{dismiss:"關閉"}};let SA=null,SM=new Set,SN=new Map,SI=!1,S$=!1;function SL(e,t){for(let n of SM)n(e,t)}function SF(e){SI=!0,e.metaKey||!g$()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key||(SA="keyboard",SL("keyboard",e))}function SB(e){SA="pointer",("mousedown"===e.type||"pointerdown"===e.type)&&(SI=!0,SL("pointer",e))}function SV(e){gz(e)&&(SI=!0,SA="virtual")}function SU(e){e.target!==window&&e.target!==document&&e.isTrusted&&(SI||S$||(SA="virtual",SL("virtual",e)),SI=!1,S$=!1)}function SW(){SI=!1,S$=!0}function SK(e){if("u"<typeof window||SN.get(gb(e)))return;let t=gb(e),n=gg(e),r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){SI=!0,r.apply(this,arguments)},n.addEventListener("keydown",SF,!0),n.addEventListener("keyup",SF,!0),n.addEventListener("click",SV,!0),t.addEventListener("focus",SU,!0),t.addEventListener("blur",SW,!1),"u">typeof PointerEvent?(n.addEventListener("pointerdown",SB,!0),n.addEventListener("pointermove",SB,!0),n.addEventListener("pointerup",SB,!0)):(n.addEventListener("mousedown",SB,!0),n.addEventListener("mousemove",SB,!0),n.addEventListener("mouseup",SB,!0)),t.addEventListener("beforeunload",()=>{Sz(e)},{once:!0}),SN.set(t,{focus:r})}let Sz=(e,t)=>{let n=gb(e),r=gg(e);t&&r.removeEventListener("DOMContentLoaded",t),SN.has(n)&&(n.HTMLElement.prototype.focus=SN.get(n).focus,r.removeEventListener("keydown",SF,!0),r.removeEventListener("keyup",SF,!0),r.removeEventListener("click",SV,!0),n.removeEventListener("focus",SU,!0),n.removeEventListener("blur",SW,!1),"u">typeof PointerEvent?(r.removeEventListener("pointerdown",SB,!0),r.removeEventListener("pointermove",SB,!0),r.removeEventListener("pointerup",SB,!0)):(r.removeEventListener("mousedown",SB,!0),r.removeEventListener("mousemove",SB,!0),r.removeEventListener("mouseup",SB,!0)),SN.delete(n))};function SH(e){let[t,n]=_x(e.isOpen,e.defaultOpen||!1,e.onOpenChange),r=(0,fZ.useCallback)(()=>{n(!0)},[n]),o=(0,fZ.useCallback)(()=>{n(!1)},[n]),i=(0,fZ.useCallback)(()=>{n(!t)},[n,t]);return{isOpen:t,setOpen:n,open:r,close:o,toggle:i}}"u">typeof document&&("loading"!==(m=gg(void 0)).readyState?SK(void 0):m.addEventListener("DOMContentLoaded",()=>{SK(void 0)}));let SG=(0,fZ.createContext)(null),Sq=(0,fZ.createContext)(null),SZ=(0,fZ.forwardRef)(function(e,t){[e,t]=gt(e,t,SG);let n=(0,fZ.useContext)(xJ),r=SH(e),o=null==e.isOpen&&null==e.defaultOpen&&n?n:r,i=function(e,t){let[n,r]=(0,fZ.useState)(t?"open":"closed");switch(n){case"open":t||r("exiting");break;case"closed":case"exiting":t&&r("open")}let o="exiting"===n;return SR(e,o,(0,fZ.useCallback)(()=>{r(e=>"exiting"===e?"closed":e)},[])),o}(t,o.isOpen)||e.isExiting||!1,a=(0,fZ.useContext)(bF),{direction:s}=b5();if(a){let t=e.children;return"function"==typeof t&&(t=t({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),fY().createElement(fY().Fragment,null,t)}return!o||o.isOpen||i?fY().createElement(SY,{...e,triggerRef:e.triggerRef,state:o,popoverRef:t,isExiting:i,dir:s}):null});function SY({state:e,isExiting:t,UNSTABLE_portalContainer:n,...r}){var o,i;let a=(0,fZ.useRef)(null),[s,l]=(0,fZ.useState)(0),u=(0,fZ.useRef)(null),c=(0,fZ.useContext)(Sq),f=c&&"SubmenuTrigger"===r.trigger;yz(()=>{a.current&&e.isOpen&&l(a.current.getBoundingClientRect().width)},[e.isOpen,a]);let{popoverProps:p,underlayProps:h,arrowProps:m,placement:y}=function(e,t){let{triggerRef:n,popoverRef:r,groupRef:o,isNonModal:i,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:s,...l}=e,u="SubmenuTrigger"===l.trigger,{overlayProps:c,underlayProps:f}=function(e,t){let{onClose:n,shouldCloseOnBlur:r,isOpen:o,isDismissable:i=!1,isKeyboardDismissDisabled:a=!1,shouldCloseOnInteractOutside:s}=e,l=(0,fZ.useRef)(void 0);(0,fZ.useEffect)(()=>{if(o&&!S_.includes(t))return S_.push(t),()=>{let e=S_.indexOf(t);e>=0&&S_.splice(e,1)}},[o,t]);let u=()=>{S_[S_.length-1]===t&&n&&n()};!function(e){let{ref:t,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:o}=e,i=(0,fZ.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),a=bb(e=>{n&&Sw(e,t)&&(o&&o(e),i.current.isPointerDown=!0)}),s=bb(e=>{n&&n(e)});(0,fZ.useEffect)(()=>{let e=i.current;if(r)return;let n=gg(t.current);if("u">typeof PointerEvent){let r=n=>{e.isPointerDown&&Sw(n,t)&&s(n),e.isPointerDown=!1};return n.addEventListener("pointerdown",a,!0),n.addEventListener("click",r,!0),()=>{n.removeEventListener("pointerdown",a,!0),n.removeEventListener("click",r,!0)}}},[t,r])}({ref:t,onInteractOutside:i&&o?e=>{(!s||s(gw(e)))&&(S_[S_.length-1]===t&&e.stopPropagation(),l.current===t&&u()),l.current=void 0}:void 0,onInteractOutsideStart:e=>{let n=S_[S_.length-1];l.current=n,(!s||s(gw(e)))&&n===t&&e.stopPropagation()}});let{focusWithinProps:c}=bR({isDisabled:!r,onBlurWithin:e=>{!(!e.relatedTarget||_Q(e.relatedTarget,_G))&&(!s||s(e.relatedTarget))&&n?.()}});return{overlayProps:{onKeyDown:e=>{"Escape"!==e.key||a||e.nativeEvent.isComposing||(e.stopPropagation(),e.preventDefault(),u())},...c},underlayProps:{}}}({isOpen:t.isOpen,onClose:t.close,shouldCloseOnBlur:!0,isDismissable:!i||u,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:s},o??r),{overlayProps:p,arrowProps:h,placement:m,triggerAnchorPoint:y}=function(e){var t;let{direction:n}=b5(),{arrowSize:r,targetRef:o,overlayRef:i,arrowRef:a,scrollRef:s=i,placement:l="bottom",containerPadding:u=12,shouldFlip:c=!0,boundaryElement:d="u">typeof document?document.body:null,offset:f=0,crossOffset:p=0,shouldUpdatePosition:h=!0,isOpen:m=!0,onClose:y,maxHeight:g,arrowBoundaryOffset:b=0}=e,[v,w]=(0,fZ.useState)(null),x=[h,l,i.current,o.current,a?.current,s.current,u,c,d,f,p,m,n,g,b,r],S=(0,fZ.useRef)(Sv?.scale);(0,fZ.useEffect)(()=>{m&&(S.current=Sv?.scale)},[m]);let E=(0,fZ.useCallback)(()=>{var e;if(!1===h||!m||!i.current||!o.current||!d||Sv?.scale!==S.current)return;let t=null;if(s.current&&g_(s.current)){let e=((e=document)=>e.activeElement)()?.getBoundingClientRect(),n=s.current.getBoundingClientRect();(t={type:"top",offset:(e?.top??0)-n.top}).offset>n.height/2&&(t.type="bottom",t.offset=(e?.bottom??0)-n.bottom)}let y=i.current;!g&&i.current&&(y.style.top="0px",y.style.bottom="",y.style.maxHeight=(window.visualViewport?.height??window.innerHeight)+"px");let v=function(e){let t,n,{placement:r,targetNode:o,overlayNode:i,scrollNode:a,padding:s,shouldFlip:l,boundaryElement:u,offset:c,crossOffset:d,maxHeight:f,arrowSize:p=0,arrowBoundaryOffset:h=0}=e,m="u">typeof document?window.visualViewport:null,y=i instanceof HTMLElement?function(e){let t=e.offsetParent;if(t&&t===document.body&&"static"===window.getComputedStyle(t).position&&!Sy(t)&&(t=document.documentElement),null==t)for(t=e.parentElement;t&&!Sy(t);)t=t.parentElement;return t||document.documentElement}(i):document.documentElement,g=y===document.documentElement,b=window.getComputedStyle(y).position,v=g?Sh(o,!1):Sm(o,y,!1);if(!g){let{marginTop:e,marginLeft:t}=window.getComputedStyle(o);v.top+=parseInt(e,10)||0,v.left+=parseInt(t,10)||0}let w=Sh(i,!0),x={top:parseInt((t=window.getComputedStyle(i)).marginTop,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0,right:parseInt(t.marginRight,10)||0};w.width+=(x.left??0)+(x.right??0),w.height+=(x.top??0)+(x.bottom??0),a.scrollTop,a.scrollLeft,a.scrollWidth,a.scrollHeight;let S=Sl(u,m),E=Sl(y,m);if("BODY"!==u.tagName&&"HTML"!==u.tagName||g)n=("BODY"===u.tagName||"HTML"===u.tagName)&&g?{top:0,left:0,width:0,height:0}:Sm(u,y,!1);else{let e=Sp(y,!1);n={top:-(e.top-S.top),left:-(e.left-S.left),width:0,height:0}}return function(e,t,n,r,o,i,a,s,l,u,c,d,f,p,h,m,y){var g,b,v;let w,x,S,E=Sc(e),{size:D,crossAxis:O,crossSize:P,placement:k,crossPlacement:C}=E,j=Sd(t,a,n,E,u,c,l,d,p,h,s),T=u,R=Sf(a,l,t,r,o+u,E,s,m);if(i&&n[D]>R){let e=Sc(`${Sr[k]} ${C}`),i=Sd(t,a,n,e,u,c,l,d,p,h,s);Sf(a,l,t,r,o+u,e,s,m)>R&&(E=e,j=i,T=u)}let A="bottom";"top"===E.axis?"top"===E.placement?A="top":"bottom"===E.placement&&(A="bottom"):"top"===E.crossAxis&&("top"===E.crossPlacement?A="bottom":"bottom"===E.crossPlacement&&(A="top"));let M=Su(O,j[O],n[P],a,s,o,l);j[O]+=M;let N=(g=j,b=n.height,v=A,w=(null!=g.top?g.top:s[Sa.height]-(g.bottom??0)-b)-(s.scroll.top??0),x=m?l.top:0,S={top:Math.max(a.top+x,(y?.offsetTop??a.top)+x),bottom:Math.min(a.top+a.height+x,(y?.offsetTop??0)+(y?.height??0))},"top"!==v?Math.max(0,S.bottom-w-((r.top??0)+(r.bottom??0)+o)):Math.max(0,w+b-S.top-((r.top??0)+(r.bottom??0)+o)));f&&f<N&&(N=f),n.height=Math.min(n.height,N),M=Su(O,(j=Sd(t,a,n,E,T,c,l,d,p,h,s))[O],n[P],a,s,o,l),j[O]+=M;let I={},$=t[O]-j[O]-r[Sn[O]],L=$+.5*t[P],F=p/2+h,B="left"===Sn[O]?(r.left??0)+(r.right??0):(r.top??0)+(r.bottom??0),V=n[P]-B-p/2-h,U=x8(L,t[O]+p/2-(j[O]+r[Sn[O]]),t[O]+t[P]-p/2-(j[O]+r[Sn[O]]));I[O]=x8(U,F,V),({placement:k,crossPlacement:C}=E),p?$=I[O]:"right"===C?$+=t[P]:"center"===C&&($+=t[P]/2);let W="left"===k||"top"===k?n[D]:0,K={x:"top"===k||"bottom"===k?$:W,y:"left"===k||"right"===k?$:W};return{position:j,maxHeight:N,arrowOffsetLeft:I.left,arrowOffsetTop:I.top,placement:k,triggerAnchorPoint:K}}(r,v,w,x,s,l,S,E,n,c,d,!!b&&"static"!==b,f,p,h,gv(u,y),m)}({placement:(e=l,"rtl"===n?e.replace("start","right").replace("end","left"):e.replace("start","left").replace("end","right")),overlayNode:i.current,targetNode:o.current,scrollNode:s.current||i.current,padding:u,shouldFlip:c,boundaryElement:d,offset:f,crossOffset:p,maxHeight:g,arrowSize:r??(a?.current?Sp(a.current,!0).width:0),arrowBoundaryOffset:b});if(!v.position)return;y.style.top="",y.style.bottom="",y.style.left="",y.style.right="",Object.keys(v.position).forEach(e=>y.style[e]=v.position[e]+"px"),y.style.maxHeight=null!=v.maxHeight?v.maxHeight+"px":"";let x=((e=document)=>e.activeElement)();if(t&&x&&s.current){let e=x.getBoundingClientRect(),n=s.current.getBoundingClientRect(),r=e[t.type]-n[t.type];s.current.scrollTop+=r-t.offset}w(v)},x);yz(E,x),yz(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t=E]),Sb({ref:i,onResize:E}),Sb({ref:o,onResize:E});let D=(0,fZ.useRef)(!1);yz(()=>{let e,t=()=>{D.current=!0,clearTimeout(e),e=setTimeout(()=>{D.current=!1},500),E()},n=()=>{D.current&&t()};return Sv?.addEventListener("resize",t),Sv?.addEventListener("scroll",n),()=>{Sv?.removeEventListener("resize",t),Sv?.removeEventListener("scroll",n)}},[E]);let O=(0,fZ.useCallback)(()=>{D.current||y?.()},[y,D]);return!function(e){let{triggerRef:t,isOpen:n,onClose:r}=e;(0,fZ.useEffect)(()=>{if(!n||null===r)return;let e=e=>{let n=gw(e);if(!t.current||n instanceof Node&&!gv(n,t.current)||n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)return;let o=r||Sg.get(t.current);o&&o()};return window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}},[n,r,t])}({triggerRef:o,isOpen:m,onClose:y&&O}),{overlayProps:{style:{position:v?"absolute":"fixed",top:v?void 0:0,left:v?void 0:0,zIndex:1e5,...v?.position,maxHeight:v?.maxHeight??"100vh"}},placement:v?.placement??null,triggerAnchorPoint:v?.triggerAnchorPoint??null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:v?.arrowOffsetLeft,top:v?.arrowOffsetTop}},updatePosition:E}}({...l,targetRef:n,overlayRef:r,isOpen:t.isOpen,onClose:i&&!u?t.close:null});return!function(e={}){let{isDisabled:t}=e;yz(()=>{if(!t){let e,t,n,r,o,i,a,s;return 1==++SD&&(d=gB()?(t=SO(document.documentElement,"overflow","hidden"),n=!1,r=document.createElement("style"),(o=bm())&&(r.nonce=o),r.textContent=`
39
39
  @layer {
40
40
  * {
41
41
  overscroll-behavior: contain;
42
42
  }
43
- }`.trim(),document.head.prepend(r),i=HTMLElement.prototype.focus,HTMLElement.prototype.focus=function(e){let t=((e=document)=>e.activeElement)(),n=null!=t&&SS(t);i.call(this,{...e,preventScroll:!0}),e&&e.preventScroll||SP(this,n)},a=yK(Sk(document,"touchstart",t=>{let r=gw(t);e=wP(r)?r:wC(r,!0),n=!1;let o=r.ownerDocument.defaultView.getSelection();o&&!o.isCollapsed&&o.containsNode(r,!0)&&(n=!0),t.composedPath().some(e=>e instanceof HTMLInputElement&&"range"===e.type)&&(n=!0),"selectionStart"in r&&"selectionEnd"in r&&r.selectionStart<r.selectionEnd&&r.ownerDocument.activeElement===r&&(n=!0)},{passive:!1,capture:!0}),Sk(document,"touchmove",t=>{if(2!==t.touches.length&&!n){if(!e||e===document.documentElement||e===document.body)return void t.preventDefault();e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&t.preventDefault()}},{passive:!1,capture:!0}),Sk(document,"blur",e=>{let t=gw(e),n=e.relatedTarget;if(n&&SS(n))n.focus({preventScroll:!0}),SP(n,SS(t));else if(!n){let e=t.parentElement?.closest("[tabindex]");e?.focus({preventScroll:!0})}},!0)),()=>{t(),a(),r.remove(),HTMLElement.prototype.focus=i}):yK((s=window.innerWidth-document.documentElement.clientWidth)>0&&("scrollbarGutter"in document.documentElement.style?SO(document.documentElement,"scrollbarGutter","stable"):SO(document.documentElement,"paddingRight",`${s}px`)),SO(document.documentElement,"overflow","hidden"))),()=>{0==--SD&&d()}}},[t])}({isDisabled:i||!t.isOpen}),(0,fZ.useEffect)(()=>{if(t.isOpen&&r.current)if(i){var e,n,a=o?.current??r.current;let t=x9[x9.length-1];return t&&!t.visibleNodes.has(a)?(t.visibleNodes.add(a),()=>{t.visibleNodes.delete(a)}):void 0}else{let t,i,a,s,l,u,c,d,f,p,h;return e=[o?.current??r.current],i=(n={shouldUseInert:!0})instanceof(t=gb(e?.[0])).Element?{root:n}:n,a=i?.root??document.body,s=i?.shouldUseInert&&x5,l=new Set(e),u=new Set,c=(e,n)=>{s&&e instanceof t.HTMLElement?e.inert=n:n?e.setAttribute("aria-hidden","true"):(e.removeAttribute("aria-hidden"),e instanceof t.HTMLElement&&(e.inert=!1))},d=e=>{for(let t of e.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))l.add(t);let t=e=>{if(u.has(e)||l.has(e)||e.parentElement&&u.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(let t of l)if(gv(e,t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},n=_K(gg(e),e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),r=t(e);if(r===NodeFilter.FILTER_ACCEPT&&f(e),r!==NodeFilter.FILTER_REJECT){let e=n.nextNode();for(;null!=e;)f(e),e=n.nextNode()}},f=e=>{let n=x7.get(e)??0;(s&&e instanceof t.HTMLElement?e.inert:"true"===e.getAttribute("aria-hidden"))&&0===n||(0===n&&c(e,!0),u.add(e),x7.set(e,n+1))},x9.length&&x9[x9.length-1].disconnect(),d(a),(p=new MutationObserver(e=>{for(let n of e)if("childList"===n.type&&n.target.isConnected&&![...l,...u].some(e=>gv(e,n.target)))for(let e of n.addedNodes){var t;(e instanceof HTMLElement||e instanceof SVGElement)&&("true"===(t=e).dataset.liveAnnouncer||void 0!==t.dataset.reactAriaTopLayer)?l.add(e):e instanceof Element&&d(e)}})).observe(a,{childList:!0,subtree:!0}),h={visibleNodes:l,hiddenNodes:u,observe(){p.observe(a,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}},x9.push(h),()=>{for(let e of(p.disconnect(),u)){let t=x7.get(e);null!=t&&(1===t?(c(e,!1),x7.delete(e)):x7.set(e,t-1))}h===x9[x9.length-1]?(x9.pop(),x9.length&&x9[x9.length-1].observe()):x9.splice(x9.indexOf(h),1)}}},[i,t.isOpen,r,o]),{popoverProps:y5(c,p),arrowProps:h,underlayProps:f,placement:m,triggerAnchorPoint:y}}({...r,offset:null!=(o=r.offset)?o:8,arrowSize:s,groupRef:f?c:u},e),g=r.popoverRef,b=function(e,t=!0){let[n,r]=(0,fZ.useState)(!0),o=n&&t;return yz(()=>{if(o&&e.current&&"getAnimations"in e.current)for(let t of e.current.getAnimations())t instanceof CSSTransition&&t.cancel()},[e,o]),SR(e,o,(0,fZ.useCallback)(()=>r(!1),[])),o}(g,!!y)||r.isEntering||!1,v=y8({...r,defaultClassName:"react-aria-Popover",values:{trigger:r.trigger||null,placement:y,isEntering:b,isExiting:t}}),w=!r.isNonModal||"SubmenuTrigger"===r.trigger,[x,S]=(0,fZ.useState)(!1);yz(()=>{g.current&&S(w&&!g.current.querySelector("[role=dialog]"))},[g,w]),(0,fZ.useEffect)(()=>{var e;let t,n;x&&g.current&&!g.current.contains(document.activeElement)&&(n=((e=document)=>e.activeElement)(t=gg(e=g.current)),"virtual"===SA?bn(()=>{((e=document)=>e.activeElement)(t)===n&&e.isConnected&&gm(e)}):gm(e))},[x,g]);let E={...p.style,...v.style},D=fY().createElement("div",{...y5(gh(r),p),...v,role:x?"dialog":void 0,tabIndex:x?-1:void 0,"aria-label":r["aria-label"],"aria-labelledby":r["aria-labelledby"],ref:g,slot:r.slot||void 0,style:E,dir:r.dir,"data-trigger":r.trigger,"data-placement":y,"data-entering":b||void 0,"data-exiting":t||void 0},!r.isNonModal&&fY().createElement(ST,{onDismiss:e.close}),fY().createElement(x6.Provider,{value:{...m,placement:y,ref:a}},v.children),fY().createElement(ST,{onDismiss:e.close}));return f?fY().createElement(xZ,{...r,shouldContainFocus:x,isExiting:t,portalContainer:null!=(i=null!=n?n:null==c?void 0:c.current)?i:void 0},D):fY().createElement(xZ,{...r,shouldContainFocus:x,isExiting:t,portalContainer:n},!r.isNonModal&&e.isOpen&&fY().createElement("div",{"data-testid":"underlay",...h,style:{position:"fixed",inset:0}}),fY().createElement("div",{ref:u,style:{display:"contents"}},fY().createElement(Sq.Provider,{value:u},D)))}function SJ(e){return e?.start!=null&&null!=e.end}let SQ=(0,fZ.createContext)(null),SX=(0,fZ.createContext)(null),S0=(0,fZ.createContext)(null),S1=(0,fZ.createContext)(null),S2=(0,fZ.forwardRef)(function(e,t){var n,r;[e,t]=gt(e,t,SQ);let{validationBehavior:o}=ge(x2)||{},i=null!=(r=null!=(n=e.validationBehavior)?n:o)?r:"native",a=function(e){let t=SH(e),[n,r]=_x(e.value,e.defaultValue||null,e.onChange),[o]=(0,fZ.useState)(n),i=n||e.placeholderValue||null,[a,s]=xj(i,e.granularity),l=null!=n?n.toDate(s??"UTC"):null,u="hour"===a||"minute"===a||"second"===a,c=e.shouldCloseOnSelect??!0,[d,f]=(0,fZ.useState)(null),[p,h]=(0,fZ.useState)(null);if(n&&(d=n,"hour"in n&&(p=n)),i&&!(a in i))throw Error("Invalid granularity "+a+" for value "+i.toString());let m=n?.calendar.identifier==="gregory"&&"BC"===n.era,y=(0,fZ.useMemo)(()=>({granularity:a,timeZone:s,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:m}),[a,e.hourCycle,e.shouldForceLeadingZeros,s,e.hideTimeZone,m]),{minValue:g,maxValue:b,isDateUnavailable:v}=e,w=(0,fZ.useMemo)(()=>xE(n,g,b,v,y),[n,g,b,v,y]),x=xg({...e,value:n,builtinValidation:w}),S=x.displayValidation.isInvalid,E=e.validationState||(S?"invalid":null),D=(e,t)=>{r("timeZone"in t?t.set(v3(e)):v6(e,t)),f(null),h(null),x.commitValidation()};return{...x,value:n,defaultValue:e.defaultValue??o,setValue:r,dateValue:d,timeValue:p,setDateValue:n=>{let o="function"==typeof c?c():c;u?p||o?D(n,p||xP(e.defaultValue||e.placeholderValue)):f(n):(r(n),x.commitValidation()),o&&t.setOpen(!1)},setTimeValue:e=>{d&&e?D(d,e):h(e)},granularity:a,hasTime:u,...t,setOpen(r){!r&&!n&&d&&u&&D(d,p||xP(e.defaultValue||e.placeholderValue)),t.setOpen(r)},validationState:E,isInvalid:S,formatValue:(e,t)=>l?new vr(e,xk(t,y)).format(l):"",getDateFormatter:(e,t)=>new vr(e,xk({},{...y,...t}))}}({...e,validationBehavior:i}),s=(0,fZ.useRef)(null),[l,u]=gn(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,fieldProps:f,buttonProps:p,dialogProps:h,calendarProps:m,descriptionProps:y,errorMessageProps:g,...b}=function(e,t,n){var r;let o=y4(),i=y4(),a=y4(),s=vb((r=xt)&&r.__esModule?r.default:r,"@react-aria/datepicker"),{isInvalid:l,validationErrors:u,validationDetails:c}=t.displayValidation,{labelProps:d,fieldProps:f,descriptionProps:p,errorMessageProps:h}=xo({...e,labelElementType:"span",isInvalid:l,errorMessage:e.errorMessage||u}),m=xn(t,n),y=f["aria-labelledby"]||f.id,{locale:g}=b5(),b=t.formatValue(g,{month:"long"}),v=wM(b?s.format("selectedDateDescription",{date:b}):""),w=[v["aria-describedby"],f["aria-describedby"]].filter(Boolean).join(" ")||void 0,x=gh(e),S=(0,fZ.useMemo)(()=>_5(n),[n]),E=(0,fZ.useRef)(!1),{focusWithinProps:D}=bR({...e,isDisabled:t.isOpen,onBlurWithin:t=>{gv(document.getElementById(i),t.relatedTarget)||(E.current=!1,e.onBlur?.(t),e.onFocusChange?.(!1))},onFocusWithin:t=>{E.current||(E.current=!0,e.onFocus?.(t),e.onFocusChange?.(!0))}});return{groupProps:y5(x,m,f,v,D,{role:"group","aria-disabled":e.isDisabled||null,"aria-labelledby":y,"aria-describedby":w,onKeyDown(n){!t.isOpen&&e.onKeyDown&&e.onKeyDown(n)},onKeyUp(n){!t.isOpen&&e.onKeyUp&&e.onKeyUp(n)}}),labelProps:{...d,onClick:()=>{S.focusFirst()}},fieldProps:{...f,id:a,[xl]:"presentation","aria-describedby":w,value:t.value,defaultValue:t.defaultValue,onChange:t.setValue,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,granularity:e.granularity,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior,[xy]:t,autoFocus:e.autoFocus,name:e.name,form:e.form},descriptionProps:p,errorMessageProps:h,buttonProps:{...v,id:o,"aria-haspopup":"dialog","aria-label":s.format("calendar"),"aria-labelledby":`${o} ${y}`,"aria-describedby":w,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:i,"aria-labelledby":`${o} ${y}`},calendarProps:{autoFocus:!0,value:t.dateValue,onChange:t.setDateValue,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,defaultFocusedValue:t.dateValue?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:l,validationErrors:u,validationDetails:c}}({...gr(e),label:u,validationBehavior:i},a,s),[v,w]=(0,fZ.useState)(null),x=(0,fZ.useCallback)(()=>{s.current&&w(s.current.offsetWidth+"px")},[]);Sb({ref:s,onResize:x});let{focusProps:S,isFocused:E,isFocusVisible:D}=bA({within:!0}),O=y8({...e,values:{state:a,isFocusWithin:E,isFocusVisible:D,isDisabled:e.isDisabled||!1,isInvalid:a.isInvalid,isOpen:a.isOpen},defaultClassName:"react-aria-DatePicker"}),k=gh(e);return delete k.id,fY().createElement(y9,{values:[[S0,a],[_B,{...c,ref:s,isInvalid:a.isInvalid}],[xB,f],[bU,{...p,isPressed:a.isOpen}],[x4,{...d,ref:l,elementType:"span"}],[_P,m],[xJ,a],[SG,{trigger:"DatePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":v}}],[xY,h],[bz,{slots:{description:y,errorMessage:g}}],[xX,b]]},fY().createElement("div",{...S,...k,...O,ref:t,slot:e.slot||void 0,"data-focus-within":E||void 0,"data-invalid":a.isInvalid||void 0,"data-focus-visible":D||void 0,"data-disabled":e.isDisabled||void 0,"data-open":a.isOpen||void 0}))}),S4=(0,fZ.forwardRef)(function(e,t){var n,r;[e,t]=gt(e,t,SX);let{validationBehavior:o}=ge(x2)||{},i=null!=(r=null!=(n=e.validationBehavior)?n:o)?r:"native",a=function(e){let t=SH(e),[n,r]=_x(e.value,e.defaultValue||null,e.onChange),[o]=(0,fZ.useState)(n),[i,a]=(0,fZ.useState)(()=>n||{start:null,end:null});null==n&&i.start&&i.end&&a(i={start:null,end:null});let s=n||i,l=e=>{a(s=e||{start:null,end:null}),SJ(s)?r(s):r(null)},[u,c]=xj(s?.start||s?.end||e.placeholderValue||null,e.granularity),d="hour"===u||"minute"===u||"second"===u,f=e.shouldCloseOnSelect??!0,[p,h]=(0,fZ.useState)(null),[m,y]=(0,fZ.useState)(null);s&&SJ(s)&&(p=s,"hour"in s.start&&(m=s));let g=(e,t)=>{l({start:"timeZone"in t.start?t.start.set(v3(e.start)):v6(e.start,t.start),end:"timeZone"in t.end?t.end.set(v3(e.end)):v6(e.end,t.end)}),h(null),y(null),k.commitValidation()},b=n=>{let r="function"==typeof f?f():f;d?SJ(n)&&(r||m?.start&&m?.end)?g(n,{start:m?.start||xP(e.placeholderValue),end:m?.end||xP(e.placeholderValue)}):h(n):SJ(n)?(l(n),k.commitValidation()):h(n),r&&t.setOpen(!1)},v=e=>{SJ(p)&&SJ(e)?g(p,e):y(e)},w=s?.start?.calendar.identifier==="gregory"&&"BC"===s.start.era||s?.end?.calendar.identifier==="gregory"&&"BC"===s.end.era,x=(0,fZ.useMemo)(()=>({granularity:u,timeZone:c,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:w}),[u,e.hourCycle,e.shouldForceLeadingZeros,c,e.hideTimeZone,w]),{minValue:S,maxValue:E,isDateUnavailable:D}=e,O=(0,fZ.useMemo)(()=>{var e;let t;return e=s,t=x_(xE(e?.start??null,S,E,D,x),xE(e?.end??null,S,E,D,x)),e?.end!=null&&null!=e.start&&0>e.end.compare(e.start)&&(t=x_(t,{isInvalid:!0,validationErrors:[(vf.getGlobalDictionaryForPackage("@react-stately/datepicker")||xx).getStringForLocale("rangeReversed",xS())],validationDetails:{...xf,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})),t},[s,S,E,D,x]),k=xg({...e,value:n,name:(0,fZ.useMemo)(()=>[e.startName,e.endName].filter(e=>null!=e),[e.startName,e.endName]),builtinValidation:O}),P=k.displayValidation.isInvalid,C=e.validationState||(P?"invalid":null);return{...k,value:s,defaultValue:e.defaultValue??o,setValue:l,dateRange:p,timeRange:m,granularity:u,hasTime:d,setDate(e,t){"start"===e?b({start:t,end:p?.end??null}):b({start:p?.start??null,end:t})},setTime(e,t){"start"===e?v({start:t,end:m?.end??null}):v({start:m?.start??null,end:t})},setDateTime(e,t){"start"===e?l({start:t,end:s?.end??null}):l({start:s?.start??null,end:t})},setDateRange:b,setTimeRange:v,...t,setOpen(n){!n&&!(s?.start&&s?.end)&&SJ(p)&&d&&g(p,{start:m?.start||xP(e.placeholderValue),end:m?.end||xP(e.placeholderValue)}),t.setOpen(n)},validationState:C,isInvalid:P,formatValue(t,n){let r;if(!s||!s.start||!s.end)return null;let o="timeZone"in s.start?s.start.timeZone:void 0,i=e.granularity||(s.start&&"minute"in s.start?"minute":"day"),a="timeZone"in s.end?s.end.timeZone:void 0,l=e.granularity||(s.end&&"minute"in s.end?"minute":"day"),u=xk(n,{granularity:i,timeZone:o,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,showEra:"gregory"===s.start.calendar.identifier&&"BC"===s.start.era||"gregory"===s.end.calendar.identifier&&"BC"===s.end.era}),c=s.start.toDate(o||"UTC"),d=s.end.toDate(a||"UTC"),f=new vr(t,u);if(o===a&&i===l&&0!==s.start.compare(s.end)){try{let e=f.formatRangeToParts(c,d),t=-1;for(let n=0;n<e.length;n++){let r=e[n];if("shared"===r.source&&"literal"===r.type)t=n;else if("endRange"===r.source)break}let n="",r="";for(let o=0;o<e.length;o++)o<t?n+=e[o].value:o>t&&(r+=e[o].value);return{start:n,end:r}}catch{}r=f}else r=new vr(t,xk(n,{granularity:l,timeZone:a,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle}));return{start:f.format(c),end:r.format(d)}},getDateFormatter:(e,t)=>new vr(e,xk({},{...x,...t}))}}({...e,validationBehavior:i}),s=(0,fZ.useRef)(null),[l,u]=gn(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,startFieldProps:f,endFieldProps:p,buttonProps:h,dialogProps:m,calendarProps:y,descriptionProps:g,errorMessageProps:b,...v}=function(e,t,n){var r;let o=vb((r=xt)&&r.__esModule?r.default:r,"@react-aria/datepicker"),{isInvalid:i,validationErrors:a,validationDetails:s}=t.displayValidation,{labelProps:l,fieldProps:u,descriptionProps:c,errorMessageProps:d}=xo({...e,labelElementType:"span",isInvalid:i,errorMessage:e.errorMessage||a}),f=u["aria-labelledby"]||u.id,{locale:p}=b5(),h=t.formatValue(p,{month:"long"}),m=wM(h?o.format("selectedRangeDescription",{startDate:h.start,endDate:h.end}):""),y={"aria-label":o.format("startDate"),"aria-labelledby":f},g={"aria-label":o.format("endDate"),"aria-labelledby":f},b=y4(),v=y4(),w=xn(t,n),x=[m["aria-describedby"],u["aria-describedby"]].filter(Boolean).join(" ")||void 0,S=(0,fZ.useMemo)(()=>_5(n,{accept:e=>e.id!==b}),[n,b]),E={[xu]:S,[xl]:"presentation","aria-describedby":x,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,granularity:e.granularity,shouldForceLeadingZeros:e.shouldForceLeadingZeros,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior},D=gh(e),O=(0,fZ.useRef)(!1),{focusWithinProps:k}=bR({...e,isDisabled:t.isOpen,onBlurWithin:t=>{gv(document.getElementById(v),t.relatedTarget)||(O.current=!1,e.onBlur?.(t),e.onFocusChange?.(!1))},onFocusWithin:t=>{O.current||(O.current=!0,e.onFocus?.(t),e.onFocusChange?.(!0))}}),P=(0,fZ.useRef)(xh),C=(0,fZ.useRef)(xh);return{groupProps:y5(D,w,u,m,k,{role:"group","aria-disabled":e.isDisabled||null,"aria-describedby":x,onKeyDown(n){!t.isOpen&&e.onKeyDown&&e.onKeyDown(n)},onKeyUp(n){!t.isOpen&&e.onKeyUp&&e.onKeyUp(n)}}),labelProps:{...l,onClick:()=>{S.focusFirst()}},buttonProps:{...m,id:b,"aria-haspopup":"dialog","aria-label":o.format("calendar"),"aria-labelledby":`${b} ${f}`,"aria-describedby":x,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:v,"aria-labelledby":`${b} ${f}`},startFieldProps:{...y,...E,value:t.value?.start??null,defaultValue:t.defaultValue?.start,onChange:e=>t.setDateTime("start",e),autoFocus:e.autoFocus,name:e.startName,form:e.form,[xy]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){P.current=e,t.updateValidation(x_(e,C.current))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},endFieldProps:{...g,...E,value:t.value?.end??null,defaultValue:t.defaultValue?.end,onChange:e=>t.setDateTime("end",e),name:e.endName,form:e.form,[xy]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){C.current=e,t.updateValidation(x_(P.current,e))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},descriptionProps:c,errorMessageProps:d,calendarProps:{autoFocus:!0,value:t.dateRange?.start&&t.dateRange.end?t.dateRange:null,onChange:t.setDateRange,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,allowsNonContiguousRanges:e.allowsNonContiguousRanges,defaultFocusedValue:t.dateRange?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:i,validationErrors:a,validationDetails:s}}({...gr(e),label:u,validationBehavior:i},a,s),[w,x]=(0,fZ.useState)(null),S=(0,fZ.useCallback)(()=>{s.current&&x(s.current.offsetWidth+"px")},[]);Sb({ref:s,onResize:S});let{focusProps:E,isFocused:D,isFocusVisible:O}=bA({within:!0}),k=y8({...e,values:{state:a,isFocusWithin:D,isFocusVisible:O,isDisabled:e.isDisabled||!1,isInvalid:a.isInvalid,isOpen:a.isOpen},defaultClassName:"react-aria-DateRangePicker"}),P=gh(e);return delete P.id,fY().createElement(y9,{values:[[S1,a],[_B,{...c,ref:s,isInvalid:a.isInvalid}],[bU,{...h,isPressed:a.isOpen}],[x4,{...d,ref:l,elementType:"span"}],[_C,y],[xJ,a],[SG,{trigger:"DateRangePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":w}}],[xY,m],[xB,{slots:{start:f,end:p}}],[bz,{slots:{description:g,errorMessage:b}}],[xX,v]]},fY().createElement("div",{...E,...P,...k,ref:t,slot:e.slot||void 0,"data-focus-within":D||void 0,"data-invalid":a.isInvalid||void 0,"data-focus-visible":O||void 0,"data-disabled":e.isDisabled||void 0,"data-open":a.isOpen||void 0}))});function S3(e){return fY().createElement(b6,e)}function S6(e,t,n=!1){if(null==e)return n?e:void 0;if("string"==typeof e&&!e)return n?null:void 0;if(e instanceof vH||e instanceof vq||e instanceof vZ)return t?v5(e,t):e;{let n=hP()(e).toDate(),r=new vH(n.getFullYear(),n.getMonth()+1,n.getDate());return t?v5(r,t):r}}function S5(e){if(e)return e.toDate(wl())}function S7(e){if("string"==typeof e&&0!==e.trim().length)try{return new Intl.Locale(e.replace(/[_@]/g,"-")).toString()}catch{return}}function S9(e){let t=e??"",n=S7(t);if(!n)return t;try{return new Intl.DisplayNames([n],{type:"language"}).of(n)??t}catch{return t}}function S8(){let e=window.i18next.language,t=S7(e)??e;return"ht"===t&&(t="fr-HT"),t}if("u">typeof navigator){let e=navigator;ec=Array.isArray(e.languages)?e.languages[0]:e.language}else if("u">typeof process){let e=process.env;ec=e.LC_ALL||e.LC_MESSAGES||e.LANG||e.LANGUAGE}var Ee=function(e){e=(e=e.replace(/_/g,"-")).replace(/[.:][\w-]*$/,"");try{return new Intl.Locale(e).baseName}catch{return"en-US"}}(ec||"en-US"),Et=class extends Date{invalid=null;isValid(){return!Number.isNaN(this.valueOf())}},En={};for(let e=1;e<100;e++)En[(e<=9?"0":"")+e]=e+(e>51?1900:2e3);var Er={arab:1632,arabext:1776,bali:6992,beng:2534,deva:2406,fullwide:65296,gujr:2790,khmr:6112,knda:3302,laoo:3792,limb:6470,mlym:3430,mong:6160,mymr:4160,orya:2918,tamldec:3046,telu:3174,thai:3664,tibt:3872},Eo="[1234567890一二三四五六七八九〇\\d]",Ei={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,〇:0,一:1,二:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9},Ea={},Es={"Eastern Daylight Time":-240,"Eastern Standard Time":-300,"Central Daylight Time":-300,"Central Standard Time":-360,"Mountain Daylight Time":-360,"Mountain Standard Time":-420,"Pacific Daylight Time":-420,"Pacific Standard Time":-480,"Coordinated Universal Time":0,ACDT:630,ACST:570,ACT:480,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,AMST:-180,AMT:-240,ART:-180,AST:180,AWDT:540,AWST:480,AZOST:-60,AZT:240,BDT:360,BIOT:360,BIT:-720,BOT:-240,BRST:-120,BRT:-180,BTT:360,CAT:120,CCT:390,CDT:-300,CEDT:120,CEST:120,CET:60,CHADT:825,CHAST:765,CHOT:480,ChST:600,CHUT:600,CIST:-480,CIT:480,CKT:-600,CLST:-180,CLT:-240,COST:-240,COT:-300,CST:-360,CT:480,CVT:-60,CXT:420,DAVT:420,DDUT:600,DFT:60,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEDT:180,EEST:180,EET:120,EGST:0,EGT:-60,EIT:540,EST:-300,FET:180,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GIT:-540,GMT:0,GST:-120,GYT:-240,HADT:-540,HAEC:120,HAST:-600,HKT:480,HMT:300,HOVT:420,HST:-600,IBST:0,ICT:420,IDT:180,IOT:180,IRDT:270,IRKT:480,IRST:210,IST:120,JST:540,KGT:360,KOST:660,KRAT:420,KST:540,LHST:630,LINT:840,MAGT:720,MART:-510,MAWT:300,MDT:-360,MET:60,MEST:120,MHT:720,MIST:660,MIT:-510,MMT:390,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:660,NPT:345,NST:-150,NT:-150,NUT:-660,NZDT:780,NZST:720,OMST:360,ORAT:300,PDT:-420,PET:-300,PETT:720,PGT:600,PHOT:780,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PYST:-180,PYT:-240,RET:240,ROTT:-180,SAKT:660,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SLST:330,SRET:660,SRT:-180,SST:480,SYOT:180,TAHT:-600,THA:420,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TOT:780,TVT:720,UCT:0,ULAT:480,USZ1:120,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-240,VLAT:600,VOLT:240,VOST:360,VUT:660,WAKT:720,WAST:120,WAT:60,WEDT:60,WEST:60,WET:0,WIT:420,WST:480,YAKT:540,YEKT:300},El={zone:Es,year:En,meridiem:{am:0,pm:12,"a.m.":0,"p.m.":12},month:{january:1,jan:1,february:2,feb:2,march:3,mar:3,april:4,apr:4,may:5,june:6,jun:6,july:7,jul:7,august:8,aug:8,september:9,sep:9,october:10,oct:10,november:11,nov:11,december:12,dec:12},dayname:{sunday:0,sun:0,monday:1,mon:1,tuesday:2,tue:2,wednesday:3,wed:3,thursday:4,thu:4,friday:5,fri:5,saturday:6,sat:6},digit:{}},Eu={MONTHNAME:"january|february|march|april|may|june|july|august|september|october|november|december|jan\\.?|feb\\.?|mar\\.?|apr\\.?|may\\.?|jun\\.?|jul\\.?|aug\\.?|sep\\.?|oct\\.?|nov\\.?|dec\\.?",DAYNAME:"sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun\\.?|mon\\.?|tue\\.?|wed\\.?|thu\\.?|fri\\.?|sat\\.?",ZONE:"\\(?(?:"+Object.keys(Es).join("|")+")\\)?",MERIDIEM:"am|pm|a.m.|p.m.",ORDINAL:"st|nd|rd|th|\\.",YEAR:"\\d{4}|\\d{2}",YEAR2:"\\d{2}",YEAR4:"\\d{4}",YEAR6:"-\\d{6}|\\+?\\d{5,6}",MONTH:"1[0-2]|0?[1-9]",MONTH2:"1[0-2]|0[1-9]",DAY:"3[01]|[12]\\d|0?[1-9]",DAY2:"3[01]|[12]\\d|0[1-9]",OFFSET:"(?:GMT)?[\xb1−+-](?:[01]\\d[0-5]\\d|[01]\\d:[0-5]\\d|[01]?\\d)",H24:"[01]\\d|2[0-3]",H12:"0?[1-9]|1[012]",MIN:"[0-5]\\d",SEC:"[0-5]\\d|60",MS:"\\d{9}|\\d{6}|\\d{1,3}",GAP:"[\\s/.,-]{1,}"},Ec={...Eu,YEAR:"*{4}|*{2}",YEAR4:"*{4}",YEAR6:"-*{6}|\\+?*{5,6}",MONTH:"*{1,2}",MONTH2:"*{2}",DAY:"*{1,2}",DAY2:"*{2}",OFFSET:"(?:GMT)?[\xb1−+-](?:*{4}|*{2}:*{2}|*{1,2})",H24:"*{2}",H12:"*{1,2}",MIN:"*{2}",SEC:"*{2}",MS:"*{9}|*{6}|*{3}"},Ed={},Ef=class e{locale;lookups;vars;numberingSystem;baseName;dateOptions;static factory(t=Ee){return Ed[t.toLowerCase()]||(Ed[t.toLowerCase()]=new e(t)),Ed[t.toLowerCase()]}constructor(e=Ee){this.locale=e,this.lookups={...El},this.vars={...Eu};let t=new Intl.NumberFormat(this.locale);this.numberingSystem=t.resolvedOptions().numberingSystem,this.dateOptions=new Intl.DateTimeFormat(this.locale).resolvedOptions(),this.baseName=new Intl.Locale(this.locale).baseName,this.build()}toInt(e){if("number"==typeof e)return e;if("string"!=typeof e)return;if("latn"===this.numberingSystem&&!this.baseName.startsWith("zh")){let t=parseInt(e,10);if(!isNaN(t))return t}let t="";for(let n=0;n<e.length;n++)t+=String(this.lookups.digit[e[n]]);return parseInt(t,10)}millisecondToInt(e){if("number"==typeof e)return e;if("string"!=typeof e)return;let t=e.slice(0,3);return 1===t.length?100*this.toInt(t):2===t.length?10*this.toInt(t):this.toInt(t)}monthNameToInt(e){if("string"!=typeof e)return;let t=e.toLocaleLowerCase(this.locale).replace(/\.$/,"");return this.lookups.month[t]||12}h12ToInt(e,t){if("string"!=typeof e)return;let n=this.lookups.meridiem[t?.toLowerCase()]||0,r=this.toInt(e);return r<12&&12===n&&(r+=12),12===r&&0===n&&(r=0),r}zoneToOffset(e){if("string"==typeof e)return e=e.replace(/[^a-z\s]/gi,""),this.lookups.zone[e]}offsetToMinutes(e){if("string"!=typeof e)return;let t=e.match(/^(?:GMT)?([±−+-])(..?):?(..)?$/);if(t){let[,e,n,r]=t;return("-"===e||"−"===e?-1:1)*(60*this.toInt(n)+this.toInt(r||0))}return 0}build(){"latn"===this.dateOptions.numberingSystem?this.lookups.digit=Ei:this.buildNumbers(),/^en/i.test(this.locale)||(this.buildMonthNames(),this.buildDaynames(),/zh/i.test(this.locale)||this.buildMeridiems())}buildNumbers(){let{group:e,lookup:t}=function(e){if(Ea[e])return Ea[e];if("fullwide"===e||"hanidec"===e)return{group:Eo,lookup:{...Ei}};let t=Er[e];if(!t)return{group:"\\d",lookup:{...Ei}};let n=String.fromCharCode(t),r=String.fromCharCode(t+9),o={};for(let e=0;e<10;e++)o[String.fromCharCode(t+e)]=e;return Ea[e]={group:`[${n}-${r}]`,lookup:o},Ea[e]}(this.numberingSystem);for(let n in this.lookups.digit=t,Ec)Ec.hasOwnProperty(n)&&(this.vars[n]=Ec[n].replace(/\*/g,e))}buildMonthNames(){let e={},t={};if(/^fi/i.test(this.locale))"tammi|helmi|maalis|huhti|touko|kes\xe4|hein\xe4|elo|syys|loka|marras|joulu".split("|").forEach((n,r)=>{["","k","kuu","kuuta"].forEach((o,i)=>{e[n+o+(i<2?"\\.?":"")]=!0,t[n+o]=r+1})});else{let n=[],r=e=>"month"===e.type;for(let e=0;e<12;e++)n.push(new Date(2017,e,1));for(let o of["full","long","medium"]){let i=Intl.DateTimeFormat(this.locale,{dateStyle:o});for(let a=0;a<12;a++){let s=i.formatToParts(n[a]).find(r).value.toLocaleLowerCase(this.locale);/^\d+$/.test(s)||(/^ko/i.test(this.locale)&&(s+="월"),"medium"===o?(s=s.replace(/\.$/,""),e[`${s}\\.?`]=!0):e[s]=!0,t[s]=a+1)}}let o=Intl.DateTimeFormat(this.locale,{month:"short"});for(let i=0;i<12;i++){let a=o.formatToParts(n[i]).find(r).value.toLocaleLowerCase(this.locale);a=a.replace(/\.$/,""),e[`${a}\\.?`]=!0,t[a]=i+1}}this.vars.MONTHNAME=Object.keys(e).join("|"),this.lookups.month=t}buildDaynames(){let e=[],t=e=>"weekday"===e.type;for(let t=0;t<7;t++)e.push(new Date(2017,0,t+1));let n=[],r={};for(let o of["long","short"]){let i=Intl.DateTimeFormat(this.locale,{weekday:o});for(let a=0;a<7;a++){let s=i.formatToParts(e[a]).find(t).value.toLocaleLowerCase(this.locale);"short"===o?(s=s.replace(/\.$/,""),n.push(`${s}\\.?`)):n.push(s),r[s]=a}}this.vars.DAYNAME=n.join("|"),this.lookups.dayname=r}buildMeridiems(){let e=[new Date(2017,0,1),new Date(2017,0,1,23,0,0)],t=e=>"dayPeriod"===e.type,n=[],r={},o=Intl.DateTimeFormat(this.locale,{timeStyle:"long"});for(let i=0;i<2;i++){let a=o.formatToParts(e[i]).find(t);if(!a)return;let s=a.value.toLocaleLowerCase(this.locale);n.push(s),r[s]=12*i}this.vars.MERIDIEM=n.join("|"),this.lookups.meridiem=r}compile(e){return RegExp(e.replace(/_([A-Z0-9]+)_/g,(e,t)=>{if(!this.vars[t])throw Error(`Template string contains invalid variable _${t}_`);return this.vars[t]}),"i")}},Ep=["ee-TG","en-AS","en-CA","en-FM","en-GH","en-GU","en-KE","en-KY","en-MH","en-MP","en-US","en-VI","en-WS","jp-JP","sm-AS","sm-SM"],Eh={y:"year",M:"month",d:"day",w:"week",h:"hour",m:"minute",s:"second",ms:"millisecond"},Em=()=>new Date;function Ey(e){return function(t){let n={};for(let r=0,o=e.length;r<o;r++){let o=e[r];o&&(n[o]=t[r])}return n}}var Eg=class{doneChecker;fallback;patterns;formatter;constructor({doneChecker:e,fallback:t,patterns:n,formatter:r}){this.doneChecker=e,this.fallback=t,this.patterns=n,this.formatter=r}attempt(e){if("string"!=typeof e)return this.fallback(e);let t=e.trim(),n={},r=!1;for(let e of this.patterns){let o=t.match(e.regex);if(!o)continue;r=!0;let i=e.handler(o);if(i){for(let[e,t]of Object.entries(i))e in n||void 0===t||(n[e]=t);if(t=(t=t.slice(0,o.index)+t.slice(o.index+o[0].length+1)).trim(),this.doneChecker(n,t))break}}return r?this.formatter(n):this.fallback(e)}},Eb=["year","month","day","hour","minute","second","millisecond","offset"],Ev={};function Ew(e,t){return""===t||/^\s+$/.test(t)||"year"in e&&("month"in e||"monthname"in e)&&"day"in e&&"hour"in e&&"minute"in e&&"second"in e&&"millisecond"in e&&("zone"in e||"offset"in e)}var E_=[[/([^\d.]+)(\d{1,2})\.(\d{2})\.(\d{2})(\D|$)/,"$1$2:$3:$4$5"],[/([^\d.]+)(\d{1,2})\.(\d{2})(\D|$)/,"$1$2:$3$4"]],Ex={ar:[[/ /g," "]],bn:[[/,/g,""]],zh:[[/早上\s*([\d:]+)/,"$1am"],[/凌晨\s*([\d:]+)/,"$1am"],[/上午\s*([\d:]+)/,"$1am"],[/下午\s*([\d:]+)/,"$1pm"],[/晚上\s*([\d:]+)/,"$1pm"]],he:[[/ב/gi,""]],de:[[/ um /g," "]],pt:[[/\sde /gi," "]],es:[[/\sde /gi," "]],da:[[/\sden /gi," "],...E_],ru:[[/ г\./g,""]],th:[[/\s*นาฬิกา\s*/i,":"],[/\s*นาที\s*/i,":"],[/\s*วินาที\s*/i," "]],ko:[[/\s*시\s*/,":"],[/\s*분\s*/,":"],[/\s*초\s*/,""],[/(오전|오후)\s*([\d:]+)/,"$2$1"],[/(\d{4})\. (\d{1,2})\. (\d{1,2})\./,"$1-$2-$3"]],fi:E_,id:E_,fr:[[/(\d{2}) h /,"$1:"],[/(\d{2}) min /,"$1:"],[/(\d{2}) s /,"$1"]]};function ES(e,t=Ee){let n=function(e){if(!Ev[e]){var t,n;let r,o,i=Ef.factory(e);Ev[e]=new Eg({doneChecker:Ew,fallback:(t=e,function(e){let n=String(e).slice(0,50);return""===n&&(n="(empty string)"),{invalid:`Unable to parse "${n}" with locale "${t}"`}}),patterns:(r=[{name:"timestampWithOffset",regex:i.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? ?(_OFFSET_|Z)?$"),handler:Ey(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"timestampWithZone",regex:i.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))?\\s*(_ZONE_)$"),handler:Ey(["","year","month","day","hour","minute","second","millisecond","zone"])},{name:"timestampWithOffsetAndZone",regex:i.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? (_OFFSET_|Z)\\s*(_ZONE_)$"),handler:Ey(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"chinese",regex:i.compile(`^(${Eo}{2,4})\\s*\u5E74\\s*(${Eo}{1,2})\\s*\u6708\\s*(${Eo}{1,2})\\s*\u65E5$`),handler:Ey(["","year","month","day"])},{name:"korean",regex:i.compile("^(_YEAR_)년\\s*(_MONTH_)월\\s*(_DAY_)일$"),handler:Ey(["","year","month","day"])},{name:"twitter",regex:/^(?:sun|mon|tue|wed|thu|fri|sat) (jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec) (\d{2}) (\d{2}):(\d{2}):(\d{2}) ([+-]\d{4}) (\d{4})$/i,handler:Ey(["","monthname","day","hour","minute","second","offset","year"])},{name:"today",regex:/^(now|today|tomorrow|yesterday)$/i,handler:function(e){let t=Em(),n=e[1].toLowerCase();switch(n){case"tomorrow":t.setUTCDate(t.getUTCDate()+1);break;case"yesterday":t.setUTCDate(t.getUTCDate()-1)}let r={year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate()};return"now"===n&&(r.hour=t.getUTCHours(),r.minute=t.getUTCMinutes(),r.second=t.getUTCSeconds(),r.millisecond=t.getUTCMilliseconds()),console.log("today=>",n,r),r}},{name:"ago",regex:/^(\+|-|in|) ?([\d.]+) ?(years?|months?|weeks?|days?|hours?|minutes?|seconds?|milliseconds?|ms|s|m|h|w|d|M|y)( ago)?$/i,handler:function([,e,t,n,r]){t=parseFloat(t),"week"===(n=n.length<=2?Eh[n]:(n=n.replace(/s$/,"")).toLowerCase())&&(n="day",t*=7),("-"===e||r)&&(t*=-1);let o=Em();return"millisecond"===n?o.setUTCMilliseconds(o.getUTCMilliseconds()+t):"second"===n?o.setUTCSeconds(o.getUTCSeconds()+t):"minute"===n?o.setUTCMinutes(o.getUTCMinutes()+t):"hour"===n?o.setUTCHours(o.getUTCHours()+t):"day"===n?o.setUTCDate(o.getUTCDate()+t):"month"===n?o.setUTCMonth(o.getUTCMonth()+t):"year"===n&&o.setUTCFullYear(o.getUTCFullYear()+t),{year:o.getUTCFullYear(),month:o.getUTCMonth()+1,day:o.getUTCDate(),hour:o.getUTCHours(),minute:o.getUTCMinutes(),second:o.getUTCSeconds(),millisecond:o.getUTCMilliseconds()}}},{name:"atSeconds",regex:/^@(\d+)$/,handler:function(e){let t=new Date(1e3*parseInt(e[1],10));return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds()}}},{name:"microsoftJson",regex:/^\/Date\((\d+)([+-]\d{4})?\)\/$/,handler:function(e){let t=new Date(parseInt(e[1],10));return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds(),offset:e[2]}}},{name:"full24",regex:i.compile("(?:^|[\\sT])(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?(Z)?$"),handler:Ey(["","hour","minute","second","millisecond","zone"])},{name:"zone24",regex:i.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?[\\s\\[(]*(_ZONE_)?[\\s\\])]*$"),handler:Ey(["","hour","minute","second","millisecond","zone"])},{name:"hms12",regex:i.compile("(_H12_):(_MIN_):(_SEC_)\\s*(_MERIDIEM_)"),handler:Ey(["","hour","minute","second","meridiem"])},{name:"hms24",regex:i.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?"),handler:Ey(["","hour","minute","second","millisecond"])},{name:"hm12",regex:i.compile("(_H12_):(_MIN_)\\s*(_MERIDIEM_)"),handler:Ey(["","hour","minute","meridiem"])},{name:"hm24",regex:i.compile("(_H24_):(_MIN_)"),handler:Ey(["","hour","minute"])},{name:"h12",regex:i.compile("(_H12_)\\s*(_MERIDIEM_)"),handler:Ey(["","hour","meridiem"])},{name:"8digit",regex:/^((?:19|20)\d{2})(\d{2})(\d{2})$/,handler:Ey(["","year","month","day"])},{name:"yearMonthnameDay",regex:i.compile("(_YEAR4_)[\\s.-]+(_MONTHNAME_)[\\s,.-]+(_DAY_)(_ORDINAL_)?"),handler:Ey(["","year","monthname","day"])},{name:"dayMonthnameYear",regex:i.compile("(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)[\\s,.-]+(_YEAR_)"),handler:Ey(["","day","","monthname","year"])},{name:"monthnameDayYear",regex:i.compile("(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?[\\s,.-]+(_YEAR_)"),handler:Ey(["","monthname","day","","year"])},{name:"dayMonthname",regex:i.compile("\\b(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)\\b"),handler:Ey(["","day","","monthname"])},{name:"monthnameDay",regex:i.compile("\\b(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?\\b"),handler:Ey(["","monthname","day"])},{name:"hmsNoMeridiem",regex:i.compile("\\b(_H12_|_H24_):(_MIN_):(_SEC_)\\b"),handler:Ey(["","hour","minute","second"])},{name:"hmNoMeridiem",regex:i.compile("\\b(_H12_|_H24_):(_MIN_)\\b"),handler:Ey(["","hour","minute"])},{name:"ymd",regex:i.compile("(_YEAR4_)([.-])(_MONTH_)\\2+(_DAY_)"),handler:Ey(["","year","","month","day"])},{name:"mdy",regex:i.compile("(_MONTH_)([/-])(_DAY_)\\2(_YEAR_)"),handler:Ey(["","month","","day","year"])},{name:"dmy",regex:i.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)[./\\s-]+(_YEAR_)"),handler:Ey(["","day","month","year"])},{name:"yearLoose",regex:i.compile("_YEAR4_"),handler:Ey(["year"])},{name:"dayMonthnameLoose",regex:i.compile("(_DAY_)[\\s.]*(_MONTHNAME_)"),handler:Ey(["","day","monthname"])},{name:"monthnameDayLoose",regex:i.compile("(_MONTHNAME_)[\\s.]*(_DAY_)"),handler:Ey(["","monthname","day"])},{name:"monthname",regex:i.compile("_MONTHNAME_"),handler:Ey(["monthname"])},{name:"year4",regex:i.compile("_YEAR4_"),handler:Ey(["year"])},{name:"md",regex:i.compile("(_MONTH_)[/-](_DAY_)"),handler:Ey(["","month","day"])},{name:"dm",regex:i.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)"),handler:Ey(["","day","month"])},{name:"day",regex:i.compile("_DAY_"),handler:Ey(["day"])},{name:"year2",regex:i.compile("_YEAR2_"),handler:Ey(["year"])},{name:"onlyZone",regex:i.compile("_ZONE_"),handler:Ey(["zone"])}],o=i.baseName.slice(0,5),Ep.includes(o)?r:r.filter(e=>!["mdy","md"].includes(e.name))),formatter:(n=i,function(e){let t={};for(let[r,o]of Object.entries(e))if("monthname"===r){if(o){let e=n.monthNameToInt(o);void 0!==e&&(t.month=e)}}else if("hour"===r&&e.meridiem){let r=n.h12ToInt(o,e.meridiem);void 0!==r&&(t.hour=r)}else if("zone"===r){if(o){let e=n.zoneToOffset(o);void 0!==e&&(t.offset=e)}}else if("offset"===r){let e=n.offsetToMinutes(o);void 0!==e&&(t.offset=e)}else if("millisecond"===r){let e=n.millisecondToInt(o);"number"==typeof e&&(t.millisecond=e)}else if(Eb.includes(r)){let e=n.toInt(o);"number"==typeof e&&(t[r]=e)}return t.year<100&&(t.year=En[t.year]),t.year&&"buddhist"===n.dateOptions.calendar&&(t.year-=543),t})})}return Ev[e]}(t),r=function(e,t){let n=Ex[t.slice(0,2).toLowerCase()];if(!n)return e;for(let[t,r]of n)e=e.replace(t,r);return e}(e,t);return n.attempt(r)}function EE(e){e.month&&e.day&&void 0===e.year&&(e.year=new Date().getFullYear()),60===e.second&&(e.second=59);let t=new Et(e.year,e.month-1,e.day,e.hour||0,e.minute||0,e.second||0,e.millisecond||0);return"number"==typeof e.offset?new Et(t.valueOf()-60*e.offset*1e3):t}function ED(e,t=Ee){let n=ES(e,t),r=n.invalid?new Et(NaN):EE(n);return r.isValid()||(r.invalid=`Unable to parse date "${e}"`),r}function EO(e,t=Ee){return e instanceof Date?new Et(e.valueOf()):"number"==typeof e?new Et(e):ED(e,t)}Date.fromString=Et.fromString=ED,Date.fromAny=Et.fromAny=EO,"u">typeof window&&(window.anyDateParser={fromString:ED,fromAny:EO,fromObject:EE,attempt:ES});var Ek=n(44397),EP=n(57657);let EC=function(e){return null==e};function Ej(e,t){var n=function(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}(e,t);return n.get?n.get.call(e):n.value}hP().extend(hC),hP().extend(EP),hP().extend(Ek);let ET="YYYY-MM-DDTHH:mm:ss.SSSZZ";function ER(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&("+"===e[23]||"-"===e[23])&&hP()(e,ET).isValid()}function EA(e){return hP()(e).isToday()}function EN(e){return ER(e)?hP()(e,ET).toDate():null}function EM(e,t=!1){let n=hP()(e);return t&&(n=n.utc()),n.format(ET)}function EI(e){return hP()(e).toDate()}var E$=new WeakMap;let EL=new class{register(e,t){Ej(this,E$).set(e,t)}getCalendar(e){if(!e)return;if(e.calendar)return e.calendar;if(e.region){let t=`${e.language}-${e.region}`;if(Ej(this,E$).has(t))return Ej(this,E$).get(t)}if(e.language&&Ej(this,E$).has(e.language))return Ej(this,E$).get(e.language);let t=new Intl.DateTimeFormat(e.toString()).resolvedOptions().calendar;return Ej(this,E$).set(`${e.language}${e.region?`-${e.region}`:""}`,t),t}constructor(){!function(e,t,n){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}(this,E$,{writable:!0,value:new Map})}};function EF(e,t){EL.register(e,t)}function EB(e){let t=e??S8();return EL.getCalendar(t instanceof Intl.Locale?t:new Intl.Locale(t))}let EV={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1};function EU(e,t={}){let n=ES(e,S8());if(n.invalid)return console.warn(`Could not parse invalid date '${e}'`),null;!EC(n.day)&&EC(n.month)&&(n=Object.assign({},tz(n,"day"),{month:n.day})),n.month&&(n.month-=1),n.day&&(n=Object.assign({},tz(n,"day"),{date:n.day}));let r=hP()().set(n).toDate();return EC(n.year)&&(t.year=!1),EC(n.month)&&(t.month=!1),EC(n.date)&&(t.day=!1),EW(r,t)}function EW(e,t){let n,r=t?.locale??S8(),o=new Intl.Locale(r),{calendar:i,mode:a,time:s,day:l,month:u,year:c,noToday:d,numberingSystem:f}={...EV,...{noToday:"am"===o.language},...t},p={calendar:i??EB(o),year:c?"numeric":void 0,month:u?"short":void 0,day:l?"2-digit":void 0,numberingSystem:f},h=hP()(e).isToday();if(h&&!d)n=(n=new Intl.RelativeTimeFormat(r,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(r)+n.slice(1);else{"en"===o.language&&(r="en-GB");let t=new Intl.DateTimeFormat(r,p).formatToParts(e);("en"===o.language||"am"===o.language)&&"standard"==a&&c&&l&&(t=t.map(EK("-"))),"wide"==a&&(t=t.map(EK(" — "))),"ethiopic"===p.calendar&&(t=t.filter((e,t,n)=>"era"!==e.type&&("literal"!==e.type||!(t<n.length-1)||"era"!==n[t+1].type))),n=t.map(e=>e.value).join("")}return(!0===s||h&&"for today"===s)&&(n+=`, ${Ez(e)}`),n}let EK=e=>(t,n,r)=>"literal"!==t.type||" "!==t.value||n<r.length-1&&"era"===r[n+1].type?t:{type:"literal",value:e};function Ez(e){return e.toLocaleTimeString(S8(),{hour:"2-digit",minute:"2-digit"})}function EH(e,t){return EW(e,{...t,time:!0})}function EG(e,t){let n=EB("string"==typeof t?new Intl.Locale(t):t);return n?v5(e,_p(n)):e}function Eq(e,t){return new Intl.DurationFormat(S8(),t).format(e)}function EZ(e,t){if(null==e)return null;if("string"==typeof e){let n=ES(e,S8());return n.invalid?(console.warn(`Could not interpret '${e}' as a date`),null):(n.day&&!n.month&&(n={...tz(n,"day"),...{month:n.day}}),n.month&&(n.month-=1),n.day&&(n={...tz(n,"day"),...{date:n.day}}),hP()(t).set(n))}return hP()(e)}let EY=["years","months","days","hours","minutes","seconds"],EJ={second:"seconds",minute:"minutes",hour:"hours",day:"days",month:"months",year:"years"},EQ={seconds:45,minutes:45,hours:22,days:26,months:11,years:1/0};function EX(e,t=hP()(),n){let r,o=hP()(t),i=EZ(e,o);if(null==i)return null;if("string"==typeof n){let e=EJ[n]??n;return{[e]:o.diff(i,e)}}let{thresholds:a,largestUnit:s,smallestUnit:l}=n??{};if(void 0!==s||void 0!==l){let e,t=l?EJ[l]??l:void 0;return e="auto"===s||void 0===s?function(e,t,n){let r=EY.indexOf(n);for(let o=0;o<EY.length;o++){let i=EY[o];if(t.diff(e,i)>0)return o<=r?i:n}return n}(i,o,t??"seconds"):EJ[s]??s,function(e,t,n,r){let o=EY.indexOf(n),i=EY.indexOf(r),a=EY.slice(o,i+1),s={},l=e;for(let e of a){let n=t.diff(l,e);s[e]=n,l=l.add(n,e)}return s}(i,o,e,t??e)}let u=(r=function(e){let t={...EQ};if(e)for(let[n,r]of Object.entries(e))void 0!==r&&(t[EJ[n]??n]=r);return t}(a),o.diff(i,"seconds")<r.seconds?"seconds":o.diff(i,"minutes")<r.minutes?"minutes":o.diff(i,"hours")<r.hours?"hours":o.diff(i,"days")<r.days?"days":o.diff(i,"months")<r.months?"months":"years");return{[u]:o.diff(i,u)}}let E0={style:"short",localeMatcher:"lookup"};function E1(e,t=hP()(),n){let r=EX(e,t,n);return null==r?null:Eq(r,"object"==typeof n&&n.formatOptions?{...E0,...n.formatOptions}:E0)}let E2=(0,fZ.createContext)(null);function E4(){let e=pq({externalModuleName:"@openmrs/esm-styleguide"}).preferredDateLocale,t=(0,fZ.useMemo)(()=>{let t=S8();return e[t]&&(t=e[t]),t},[window.i18next.language]),n=(0,fZ.useMemo)(()=>{let e=EB(t);return void 0!==e?_p(e):void 0},[t]),r=(0,fZ.useMemo)(()=>new Intl.Locale(t,{calendar:n?.identifier}),[t,n]),o=(0,fZ.useMemo)(()=>n?v5(wo(wl()),n):wo(wl()),[n]);return{calendar:n,intlLocale:r,today_:o}}let E3=new vH(1793,1,1);var E6={};function E5(){return"u">typeof window&&window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges}function E7(e={}){let{locale:t}=b5();return(0,fZ.useMemo)(()=>new(0,xM.K)(t,e),[t,e])}E6={"ar-AE":{decrease:e=>`\u{62E}\u{641}\u{636} ${e.fieldLabel}`,increase:e=>`\u{632}\u{64A}\u{627}\u{62F}\u{629} ${e.fieldLabel}`,numberField:"حقل رقمي"},"bg-BG":{decrease:e=>`\u{41D}\u{430}\u{43C}\u{430}\u{43B}\u{44F}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{441}\u{438}\u{43B}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,numberField:"Номер на полето"},"cs-CZ":{decrease:e=>`Sn\xed\u{17E}it ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}it ${e.fieldLabel}`,numberField:"Č\xedseln\xe9 pole"},"da-DK":{decrease:e=>`Reducer ${e.fieldLabel}`,increase:e=>`\xd8g ${e.fieldLabel}`,numberField:"Talfelt"},"de-DE":{decrease:e=>`${e.fieldLabel} verringern`,increase:e=>`${e.fieldLabel} erh\xf6hen`,numberField:"Nummernfeld"},"el-GR":{decrease:e=>`\u{39C}\u{3B5}\u{3AF}\u{3C9}\u{3C3}\u{3B7} ${e.fieldLabel}`,increase:e=>`\u{391}\u{3CD}\u{3BE}\u{3B7}\u{3C3}\u{3B7} ${e.fieldLabel}`,numberField:"Πεδίο αριθμού"},"en-US":{decrease:e=>`Decrease ${e.fieldLabel}`,increase:e=>`Increase ${e.fieldLabel}`,numberField:"Number field"},"es-ES":{decrease:e=>`Reducir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de n\xfamero"},"et-EE":{decrease:e=>`V\xe4henda ${e.fieldLabel}`,increase:e=>`Suurenda ${e.fieldLabel}`,numberField:"Numbri v\xe4li"},"fi-FI":{decrease:e=>`V\xe4henn\xe4 ${e.fieldLabel}`,increase:e=>`Lis\xe4\xe4 ${e.fieldLabel}`,numberField:"Numerokentt\xe4"},"fr-FR":{decrease:e=>`Diminuer ${e.fieldLabel}`,increase:e=>`Augmenter ${e.fieldLabel}`,numberField:"Champ de nombre"},"he-IL":{decrease:e=>`\u{5D4}\u{5E7}\u{5D8}\u{5DF} ${e.fieldLabel}`,increase:e=>`\u{5D4}\u{5D2}\u{5D3}\u{5DC} ${e.fieldLabel}`,numberField:"שדה מספר"},"hr-HR":{decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"hu-HU":{decrease:e=>`${e.fieldLabel} cs\xf6kkent\xe9se`,increase:e=>`${e.fieldLabel} n\xf6vel\xe9se`,numberField:"Sz\xe1mmező"},"it-IT":{decrease:e=>`Riduci ${e.fieldLabel}`,increase:e=>`Aumenta ${e.fieldLabel}`,numberField:"Campo numero"},"ja-JP":{decrease:e=>`${e.fieldLabel}\u{3092}\u{7E2E}\u{5C0F}`,increase:e=>`${e.fieldLabel}\u{3092}\u{62E1}\u{5927}`,numberField:"数値フィールド"},"ko-KR":{decrease:e=>`${e.fieldLabel} \u{AC10}\u{C18C}`,increase:e=>`${e.fieldLabel} \u{C99D}\u{AC00}`,numberField:"번호 필드"},"lt-LT":{decrease:e=>`Suma\u{17E}inti ${e.fieldLabel}`,increase:e=>`Padidinti ${e.fieldLabel}`,numberField:"Numerio laukas"},"lv-LV":{decrease:e=>`Samazin\u{101}\u{161}ana ${e.fieldLabel}`,increase:e=>`Palielin\u{101}\u{161}ana ${e.fieldLabel}`,numberField:"Skaitļu lauks"},"nb-NO":{decrease:e=>`Reduser ${e.fieldLabel}`,increase:e=>`\xd8k ${e.fieldLabel}`,numberField:"Tallfelt"},"nl-NL":{decrease:e=>`${e.fieldLabel} verlagen`,increase:e=>`${e.fieldLabel} verhogen`,numberField:"Getalveld"},"pl-PL":{decrease:e=>`Zmniejsz ${e.fieldLabel}`,increase:e=>`Zwi\u{119}ksz ${e.fieldLabel}`,numberField:"Pole numeru"},"pt-BR":{decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de n\xfamero"},"pt-PT":{decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo num\xe9rico"},"ro-RO":{decrease:e=>`Sc\u{103}dere ${e.fieldLabel}`,increase:e=>`Cre\u{219}tere ${e.fieldLabel}`,numberField:"C\xe2mp numeric"},"ru-RU":{decrease:e=>`\u{423}\u{43C}\u{435}\u{43D}\u{44C}\u{448}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{432}\u{435}\u{43B}\u{438}\u{447}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,numberField:"Числовое поле"},"sk-SK":{decrease:e=>`Zn\xed\u{17E}i\u{165} ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}i\u{165} ${e.fieldLabel}`,numberField:"Č\xedseln\xe9 pole"},"sl-SI":{decrease:e=>`Upadati ${e.fieldLabel}`,increase:e=>`Pove\u{10D}ajte ${e.fieldLabel}`,numberField:"Številčno polje"},"sr-SP":{decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"sv-SE":{decrease:e=>`Minska ${e.fieldLabel}`,increase:e=>`\xd6ka ${e.fieldLabel}`,numberField:"Nummerf\xe4lt"},"tr-TR":{decrease:e=>`${e.fieldLabel} azalt`,increase:e=>`${e.fieldLabel} artt\u{131}r`,numberField:"Sayı alanı"},"uk-UA":{decrease:e=>`\u{417}\u{43C}\u{435}\u{43D}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,increase:e=>`\u{417}\u{431}\u{456}\u{43B}\u{44C}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,numberField:"Поле номера"},"zh-CN":{decrease:e=>`\u{964D}\u{4F4E} ${e.fieldLabel}`,increase:e=>`\u{63D0}\u{9AD8} ${e.fieldLabel}`,numberField:"数字字段"},"zh-TW":{decrease:e=>`\u{7E2E}\u{5C0F} ${e.fieldLabel}`,increase:e=>`\u{653E}\u{5927} ${e.fieldLabel}`,numberField:"數字欄位"}};var E9={};E9={"ar-AE":{Empty:"فارغ"},"bg-BG":{Empty:"Изпразни"},"cs-CZ":{Empty:"Pr\xe1zdn\xe9"},"da-DK":{Empty:"Tom"},"de-DE":{Empty:"Leer"},"el-GR":{Empty:"Άδειο"},"en-US":{Empty:"Empty"},"es-ES":{Empty:"Vac\xedo"},"et-EE":{Empty:"T\xfchjenda"},"fi-FI":{Empty:"Tyhj\xe4"},"fr-FR":{Empty:"Vide"},"he-IL":{Empty:"ריק"},"hr-HR":{Empty:"Prazno"},"hu-HU":{Empty:"\xdcres"},"it-IT":{Empty:"Vuoto"},"ja-JP":{Empty:"空"},"ko-KR":{Empty:"비어 있음"},"lt-LT":{Empty:"Tuščias"},"lv-LV":{Empty:"Tukšs"},"nb-NO":{Empty:"Tom"},"nl-NL":{Empty:"Leeg"},"pl-PL":{Empty:"Pusty"},"pt-BR":{Empty:"Vazio"},"pt-PT":{Empty:"Vazio"},"ro-RO":{Empty:"Gol"},"ru-RU":{Empty:"Не заполнено"},"sk-SK":{Empty:"Pr\xe1zdne"},"sl-SI":{Empty:"Prazen"},"sr-SP":{Empty:"Prazno"},"sv-SE":{Empty:"Tomt"},"tr-TR":{Empty:"Boş"},"uk-UA":{Empty:"Пусто"},"zh-CN":{Empty:"空"},"zh-TW":{Empty:"空白"}};let E8=()=>{};function De(e){var t;let n=(0,fZ.useRef)(void 0),{value:r,textValue:o,minValue:i,maxValue:a,isDisabled:s,isReadOnly:l,isRequired:u,onIncrement:c,onIncrementPage:d,onDecrement:f,onDecrementPage:p,onDecrementToMin:h,onIncrementToMax:m}=e,y=vb((t=E9)&&t.__esModule?t.default:t,"@react-aria/spinbutton"),g=(0,fZ.useRef)(!1),b=(0,fZ.useCallback)(()=>{clearTimeout(n.current),g.current=!1},[]),v=bb(()=>{b()});(0,fZ.useEffect)(()=>()=>v(),[]);let w=(0,fZ.useRef)(!1),x=()=>{w.current=!0},S=()=>{w.current=!1},E=""===o?y.format("Empty"):(o||`${r}`).replace("-","−");(0,fZ.useEffect)(()=>{w.current&&(b7&&b7.clear("assertive"),b9(E,"assertive"))},[E]);let D=(0,fZ.useCallback)(()=>{b()},[b]),O=bb(c??E8),k=bb(f??E8),P=bb(()=>{(void 0===a||isNaN(a)||void 0===r||isNaN(r)||r<a)&&(O(),C(60))}),C=bb(e=>{v(),g.current=!0,n.current=window.setTimeout(P,e)}),j=bb(()=>{(void 0===i||isNaN(i)||void 0===r||isNaN(r)||r>i)&&(k(),T(60))}),T=bb(e=>{v(),g.current=!0,n.current=window.setTimeout(j,e)}),R=e=>{e.preventDefault()},{addGlobalListener:A,removeAllGlobalListeners:N}=bv(),M=(0,fZ.useRef)(!1),[I,$]=(0,fZ.useState)(null);(0,fZ.useEffect)(()=>{"touch"===I?C(600):I&&C(400)},[I]);let[L,F]=(0,fZ.useState)(null);return(0,fZ.useEffect)(()=>{"touch"===L?T(600):L&&T(400)},[L]),{spinButtonProps:{role:"spinbutton","aria-valuenow":void 0===r||isNaN(r)?void 0:r,"aria-valuetext":E,"aria-valuemin":i,"aria-valuemax":a,"aria-disabled":s||void 0,"aria-readonly":l||void 0,"aria-required":u||void 0,onKeyDown:e=>{if(!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&!l&&!e.nativeEvent.isComposing)switch(e.key){case"PageUp":if(d){e.preventDefault(),d?.();break}case"ArrowUp":case"Up":c&&(e.preventDefault(),c?.());break;case"PageDown":if(p){e.preventDefault(),p?.();break}case"ArrowDown":case"Down":f&&(e.preventDefault(),f?.());break;case"Home":h&&(e.preventDefault(),h?.());break;case"End":m&&(e.preventDefault(),m?.())}},onFocus:x,onBlur:S},incrementButtonProps:{onPressStart:e=>{b(),"touch"!==e.pointerType?(c?.(),$("mouse")):(A(window,"pointercancel",D,{capture:!0}),M.current=!1,$("touch")),A(window,"contextmenu",R)},onPressUp:e=>{b(),"touch"===e.pointerType&&(M.current=!0),N(),$(null)},onPressEnd:e=>{b(),"touch"===e.pointerType&&!g.current&&M.current&&c?.(),M.current=!1,$(null)},onFocus:x,onBlur:S},decrementButtonProps:{onPressStart:e=>{b(),"touch"!==e.pointerType?(f?.(),F("mouse")):(A(window,"pointercancel",D,{capture:!0}),M.current=!1,F("touch"))},onPressUp:e=>{b(),"touch"===e.pointerType&&(M.current=!0),N(),F(null)},onPressEnd:e=>{b(),"touch"===e.pointerType&&!g.current&&M.current&&f?.(),M.current=!1,F(null)},onFocus:x,onBlur:S}}}let Dt=null;var Dn=n(72103);function Dr(e,t,n){let r="+"===e?t+n:t-n;if(t%1!=0||n%1!=0){let o=t.toString().split("."),i=n.toString().split("."),a=Math.pow(10,Math.max(o[1]&&o[1].length||0,i[1]&&i[1].length||0));t=Math.round(t*a),n=Math.round(n*a),r=("+"===e?t+n:t-n)/a}return r}let Do=(0,fZ.createContext)(null),Di=(0,fZ.createContext)(null),Da=(0,fZ.forwardRef)(function(e,t){var n,r;[e,t]=gt(e,t,Do);let{validationBehavior:o}=ge(x2)||{},i=null!=(r=null!=(n=e.validationBehavior)?n:o)?r:"native",{locale:a}=b5(),s=function(e){let{minValue:t,maxValue:n,step:r,formatOptions:o,value:i,defaultValue:a=NaN,onChange:s,locale:l,isDisabled:u,isReadOnly:c,commitBehavior:d="snap"}=e;null===i&&(i=NaN);let f=(0,fZ.useCallback)(e=>void 0===r||isNaN(r)?x8(e,t,n):St(e,t,n,r),[r,t,n]);void 0===i||isNaN(i)||"snap"!==d||(i=f(i)),isNaN(a)||"snap"!==d||(a=f(a));let[p,h]=_x(i,isNaN(a)?NaN:a,s),[m]=(0,fZ.useState)(p),[y,g]=(0,fZ.useState)(()=>isNaN(p)?"":new(0,xM.K)(l,o).format(p)),b=(0,fZ.useMemo)(()=>new(0,Dn.d)(l,o),[l,o]),v=(0,fZ.useMemo)(()=>b.getNumberingSystem(y),[b,y]),w=(0,fZ.useMemo)(()=>new(0,xM.K)(l,{...o,numberingSystem:v}),[l,o,v]),x=(0,fZ.useMemo)(()=>w.resolvedOptions(),[w]),S=(0,fZ.useCallback)(e=>isNaN(e)||null===e?"":w.format(e),[w]),E=xg({...e,value:p}),D=void 0===r||isNaN(r)?1:r;"percent"===x.style&&(void 0===r||isNaN(r))&&(D=.01);let[O,k]=(0,fZ.useState)(p),[P,C]=(0,fZ.useState)(l),[j,T]=(0,fZ.useState)(o);Object.is(p,O)&&l===P&&o===j||(g(S(p)),k(p),C(l),T(o));let R=(0,fZ.useMemo)(()=>b.parse(y),[b,y]),A=(e,r=0)=>{if(isNaN(R))return St(isNaN(r)?0:r,t,n,D);{let r=St(R,t,n,D);return"+"===e&&r>R||"-"===e&&r<R?r:St(Dr(e,R,D),t,n,D)}},N=(0,fZ.useMemo)(()=>!u&&!c&&(isNaN(R)||void 0===n||isNaN(n)||St(R,t,n,D)>R||Dr("+",R,D)<=n),[u,c,t,n,D,R]),M=(0,fZ.useMemo)(()=>!u&&!c&&(isNaN(R)||void 0===t||isNaN(t)||St(R,t,n,D)<R||Dr("-",R,D)>=t),[u,c,t,n,D,R]);return{...E,validate:e=>b.isValidPartialNumber(e,t,n),increment:()=>{let e=A("+",t);e===p&&g(S(e)),h(e),E.commitValidation()},incrementToMax:()=>{null!=n&&(h(St(n,t,n,D)),E.commitValidation())},decrement:()=>{let e=A("-",n);e===p&&g(S(e)),h(e),E.commitValidation()},decrementToMin:()=>{null!=t&&(h(t),E.commitValidation())},canIncrement:N,canDecrement:M,minValue:t,maxValue:n,numberValue:R,defaultNumberValue:isNaN(a)?m:a,setNumberValue:h,setInputValue:g,inputValue:y,commit:e=>{let t=void 0===e?y:e,n=R;if(void 0!==e&&(n=b.parse(t)),!t.length){h(NaN),g(void 0===i?"":S(p));return}if(isNaN(n))return void g(S(p));let r="snap"===d?f(n):n,o=(r=b.parse(S(r)))!==p;h(r),g(S(void 0===i?r:p)),o&&E.commitValidation()}}}({...e,locale:a,validationBehavior:i}),l=(0,fZ.useRef)(null),[u,c]=gn(!e["aria-label"]&&!e["aria-labelledby"]),{labelProps:d,groupProps:f,inputProps:p,incrementButtonProps:h,decrementButtonProps:m,descriptionProps:y,errorMessageProps:g,...b}=function(e,t,n){var r,o,i,a,s,l,u,c,d;let f,{id:p,decrementAriaLabel:h,incrementAriaLabel:m,isDisabled:y,isReadOnly:g,isRequired:b,minValue:v,maxValue:w,autoFocus:x,label:S,formatOptions:E,onBlur:D=()=>{},onFocus:O,onFocusChange:k,onKeyDown:P,onKeyUp:C,description:j,errorMessage:T,isWheelDisabled:R,...A}=e,{increment:N,incrementToMax:M,decrement:I,decrementToMin:$,numberValue:L,inputValue:F,commit:B,commitValidation:V}=t,U=vb((r=E6)&&r.__esModule?r.default:r,"@react-aria/numberfield"),W=(0,fZ.useCallback)(()=>{let e=n.current?.value??"";(0,bw.flushSync)(()=>{B()}),n.current?.value!==e&&b9(n.current?.value??"","assertive")},[B,n]),K=y4(p),{focusProps:z}=bo({onBlur(){W()}}),H=E7(E),G=(0,fZ.useMemo)(()=>H.resolvedOptions(),[H]),q=E7({...E,currencySign:void 0}),Z=(0,fZ.useMemo)(()=>isNaN(L)?"":q.format(L),[q,L]),{spinButtonProps:Y,incrementButtonProps:J,decrementButtonProps:Q}=De({isDisabled:y,isReadOnly:g,isRequired:b,maxValue:w,minValue:v,onIncrement:N,onIncrementToMax:M,onDecrement:I,onDecrementToMin:$,value:L,textValue:Z}),[X,ee]=(0,fZ.useState)(!1),{focusWithinProps:et}=bR({isDisabled:y,onFocusWithinChange:ee});!function(e,t){let{onScroll:n,isDisabled:r}=e,o=(0,fZ.useCallback)(e=>{!e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),n&&n({deltaX:e.deltaX,deltaY:e.deltaY}))},[n]);wk(t,"wheel",r?void 0:o)}({onScroll:(0,fZ.useCallback)(e=>{!(Math.abs(e.deltaY)<=Math.abs(e.deltaX))&&(e.deltaY>0?N():e.deltaY<0&&I())},[I,N]),isDisabled:R||y||g||!X},n);let en=(G.maximumFractionDigits??0)>0,er=void 0===t.minValue||isNaN(t.minValue)||t.minValue<0,eo="numeric";gL()?er?eo="text":en&&(eo="decimal"):gW()&&(er?eo="numeric":en&&(eo="decimal"));let ei=gh(e),ea=(0,fZ.useCallback)(e=>{e.nativeEvent.isComposing||("Enter"===e.key?((0,bw.flushSync)(()=>{B()}),V()):e.continuePropagation())},[B,V]),{isInvalid:es,validationErrors:el,validationDetails:eu}=t.displayValidation,{labelProps:ec,inputProps:ed,descriptionProps:ef,errorMessageProps:ep}=function(e,t,n){let r=bb(e=>{let r=n.current;if(!r)return;let o=null;switch(e.inputType){case"historyUndo":case"historyRedo":case"insertLineBreak":return;case"deleteContent":case"deleteByCut":case"deleteByDrag":o=r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteContentForward":o=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd+1):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteContentBackward":o=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart-1)+r.value.slice(r.selectionStart):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":o=r.value.slice(r.selectionStart);break;default:null!=e.data&&(o=r.value.slice(0,r.selectionStart)+e.data+r.value.slice(r.selectionEnd))}null!=o&&t.validate(o)||e.preventDefault()});(0,fZ.useEffect)(()=>{if(!E5()||!n.current)return;let e=n.current;return e.addEventListener("beforeinput",r,!1),()=>{e.removeEventListener("beforeinput",r,!1)}},[n]);let o=E5()?null:e=>{let n=gw(e).value.slice(0,gw(e).selectionStart)+e.data+gw(e).value.slice(gw(e).selectionEnd);t.validate(n)||e.preventDefault()},{labelProps:i,inputProps:a,descriptionProps:s,errorMessageProps:l,...u}=function(e,t){let{inputElementType:n="input",isDisabled:r=!1,isRequired:o=!1,isReadOnly:i=!1,type:a="text",validationBehavior:s="aria"}=e,[l,u]=_x(e.value,e.defaultValue||"",e.onChange),{focusableProps:c}=bl(e,t),d=xg({...e,value:l}),{isInvalid:f,validationErrors:p,validationDetails:h}=d.displayValidation,{labelProps:m,fieldProps:y,descriptionProps:g,errorMessageProps:b}=xo({...e,isInvalid:f,errorMessage:e.errorMessage||p}),v=gh(e,{labelable:!0}),w={type:a,pattern:e.pattern},[x]=(0,fZ.useState)(l);return xi(t,e.defaultValue??x,u),xa(e,d,t),{labelProps:m,inputProps:y5(v,"input"===n?w:void 0,{disabled:r,readOnly:i,required:o&&"native"===s,"aria-required":o&&"aria"===s||void 0,"aria-invalid":f||void 0,"aria-errormessage":e["aria-errormessage"],"aria-activedescendant":e["aria-activedescendant"],"aria-autocomplete":e["aria-autocomplete"],"aria-haspopup":e["aria-haspopup"],"aria-controls":e["aria-controls"],value:l,onChange:e=>u(gw(e).value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,form:e.form,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(fY().version,10)>=17?"enterKeyHint":"enterkeyhint"]:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...c,...y}),descriptionProps:g,errorMessageProps:b,isInvalid:f,validationErrors:p,validationDetails:h}}(e,n),c=(0,fZ.useRef)(null);return{inputProps:y5(a,{onBeforeInput:o,onCompositionStart(){let{value:e,selectionStart:t,selectionEnd:r}=n.current;c.current={value:e,selectionStart:t,selectionEnd:r}},onCompositionEnd(){if(n.current&&!t.validate(n.current.value)){let{value:e,selectionStart:r,selectionEnd:o}=c.current;n.current.value=e,n.current.setSelectionRange(r,o),t.setInputValue(e)}}}),labelProps:i,descriptionProps:s,errorMessageProps:l,...u}}({...A,...ei,name:void 0,form:void 0,label:S,autoFocus:x,isDisabled:y,isReadOnly:g,isRequired:b,validate:void 0,[xy]:t,value:F,defaultValue:"!",autoComplete:"off","aria-label":e["aria-label"]||void 0,"aria-labelledby":e["aria-labelledby"]||void 0,id:K,type:"text",inputMode:eo,onChange:e=>{t.validate(e)&&t.setInputValue(e)},onBlur:D,onFocus:O,onFocusChange:k,onKeyDown:(0,fZ.useMemo)(()=>yK(ea,P),[ea,P]),onKeyUp:C,onPaste:t=>{e.onPaste?.(t);let n=gw(t);n&&(n.selectionEnd??-1)-(n.selectionStart??0)===n.value.length&&(t.preventDefault(),B(t.clipboardData?.getData?.("text/plain")?.trim()??""))},description:j,errorMessage:T},t,n);xi(n,t.defaultNumberValue,t.setNumberValue),o=t,i=e.validationBehavior,a=e.commitBehavior,s=n,l=t.minValue,u=t.maxValue,c=e.step,d=t.numberValue,yz(()=>{let e=s.current;if("validate"!==a||o.realtimeValidation.isInvalid||!e||e.disabled||(!Dt&&"u">typeof document&&((Dt=document.createElement("input")).type="number"),!Dt))return;Dt.min=null==l||isNaN(l)?"":String(l),Dt.max=null==u||isNaN(u)?"":String(u),Dt.step=null==c||isNaN(c)?"":String(c),Dt.value=null==d||isNaN(d)?"":String(d);let t=e.validity.valid&&Dt.validity.valid,n=e.validationMessage||Dt.validationMessage,r={isInvalid:!t,validationErrors:n?[n]:[],validationDetails:{badInput:e.validity.badInput,customError:e.validity.customError,patternMismatch:e.validity.patternMismatch,rangeOverflow:Dt.validity.rangeOverflow,rangeUnderflow:Dt.validity.rangeUnderflow,stepMismatch:Dt.validity.stepMismatch,tooLong:e.validity.tooLong,tooShort:e.validity.tooShort,typeMismatch:e.validity.typeMismatch,valueMissing:e.validity.valueMissing,valid:t}};o.updateValidation(r),"native"!==i||Dt.validity.valid||e.setCustomValidity(Dt.validationMessage)});let eh=y5(Y,z,ed,{role:null,"aria-roledescription":gB()?null:U.format("numberField"),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false"});"native"===e.validationBehavior&&(eh["aria-required"]=void 0);let em=e=>{((e=document)=>e.activeElement)()!==n.current&&("mouse"===e.pointerType?n.current?.focus():e.target.focus())},ey=e["aria-label"]||("string"==typeof e.label?e.label:"");ey||(f=null!=e.label?ec.id:e["aria-labelledby"]);let eg=y4(),eb=y4(),ev=y5(J,{"aria-label":m||U.format("increase",{fieldLabel:ey}).trim(),id:f&&!m?eg:null,"aria-labelledby":f&&!m?`${eg} ${f}`:null,"aria-controls":K,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canIncrement,onPressStart:em}),ew=y5(Q,{"aria-label":h||U.format("decrease",{fieldLabel:ey}).trim(),id:f&&!h?eb:null,"aria-labelledby":f&&!h?`${eb} ${f}`:null,"aria-controls":K,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canDecrement,onPressStart:em});return{groupProps:{...et,role:"group","aria-disabled":y,"aria-invalid":es?"true":void 0},labelProps:ec,inputProps:eh,incrementButtonProps:ev,decrementButtonProps:ew,errorMessageProps:ep,descriptionProps:ef,isInvalid:es,validationErrors:el,validationDetails:eu}}({...gr(e),label:c,validationBehavior:i},s,l),v=y8({...e,values:{state:s,isDisabled:e.isDisabled||!1,isInvalid:b.isInvalid||!1,isRequired:e.isRequired||!1},defaultClassName:"react-aria-NumberField"}),w=gh(e);return delete w.id,fY().createElement(y9,{values:[[Di,s],[_B,f],[_U,{...p,ref:l}],[x4,{...d,ref:u}],[bU,{slots:{increment:h,decrement:m}}],[bz,{slots:{description:y,errorMessage:g}}],[xX,b]]},fY().createElement("div",{...w,...v,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-required":e.isRequired||void 0,"data-invalid":b.isInvalid||void 0}),e.name&&fY().createElement("input",{type:"hidden",name:e.name,value:isNaN(s.numberValue)?"":s.numberValue}))});function Ds(e,t){return Number.parseInt(EW(e,{calendar:t.calendar,locale:t.baseName,day:!1,month:!1,noToday:!0,numberingSystem:"latn"}))}let Dl=(0,fZ.forwardRef)(function(e,t){let{className:n}=e,r=(0,fZ.useContext)(_j),o=(0,fZ.useContext)(_T),i=r??o,a=(0,fZ.useContext)(E2),s=wl(),l=EW(i.visibleRange.start.toDate(s),{calendar:a.calendar,locale:a.baseName,day:!1,year:!1,noToday:!0}),u=Ds(i.visibleRange.start.toDate(s),a),c=i.maxValue?Ds(i.maxValue.toDate(s),a):void 0,d=i.minValue?Ds(i.minValue.toDate(s),a):void 0,f=(0,fZ.useCallback)(e=>{i.setFocusedDate(i.focusedDate.cycle("year",e-i.focusedDate.year))},[]);return i&&(0,hq.jsxs)("span",{ref:t,className:n,children:[(0,hq.jsx)("span",{children:l}),(0,hq.jsxs)(Da,{formatOptions:{useGrouping:!1},maxValue:c,minValue:d,onChange:f,value:u,children:[(0,hq.jsx)(_W,{}),(0,hq.jsxs)(_V,{children:[(0,hq.jsx)(bW,{slot:"increment",children:(0,hq.jsx)(my,{size:8})}),(0,hq.jsx)(bW,{slot:"decrement",children:(0,hq.jsx)(mp,{size:8})})]})]})]})}),Du="-esm-form-engine__datepicker-module__inputGroup___gBam-",Dc="-esm-form-engine__datepicker-module__inputSegment___wIJDZ",Dd="-esm-form-engine__datepicker-module__dateInputWrapper___LiY68",Df="-esm-form-engine__datepicker-module__invalidText___A4cv4",Dp="-esm-form-engine__datepicker-module__flatButton___HcpME",Dh="-esm-form-engine__datepicker-module__flatButtonMd___eFpyF",Dm="-esm-form-engine__datepicker-module__flatButtonSm___tsawR",Dy="-esm-form-engine__datepicker-module__flatButtonLg___4HG5y";function Dg({children:e}){let t=(0,fZ.useContext)(S0),n=(0,fZ.useContext)(S1),r=t??n,o=hy(()=>r?.close());return(0,hq.jsx)(xQ,{className:"-esm-form-engine__datepicker-module__dialog___DaqYi",ref:o,children:e})}let Db=(0,fZ.forwardRef)(function({variant:e,today_:t,minDate:n,maxDate:r},o){let i="range"===e;return(0,hq.jsx)(SZ,{ref:o,className:"-esm-form-engine__datepicker-module__popover___nAPzC",placement:"bottom start",offset:1,isNonModal:!0,children:(0,hq.jsx)(Dg,{children:(0,hq.jsxs)(i?_A:_R,{...i?{minValue:n,maxValue:r,className:"cds--date-picker__calendar"}:{},children:[(0,hq.jsxs)("header",{className:"-esm-form-engine__datepicker-module__header___rPv3L",children:[(0,hq.jsx)(bW,{className:hY()(Dp,Dh),slot:"previous",children:(0,hq.jsx)(mS,{size:16})}),(0,hq.jsx)(Dl,{className:"-esm-form-engine__datepicker-module__monthYear___Rw4qE"}),(0,hq.jsx)(bW,{className:hY()(Dp,Dh),slot:"next",children:(0,hq.jsx)(mE,{size:16})})]}),(0,hq.jsx)(_M,{className:"-esm-form-engine__datepicker-module__calendarGrid___yKV-n",children:e=>(0,hq.jsx)(_F,{className:hY()("cds--date-picker__day",{"-esm-form-engine__datepicker-module__today___KzMTn":0===t.compare(e)}),date:e},e.toString())})]})})})}),Dv=(0,fZ.forwardRef)(function(e,t){let n=(0,fZ.useContext)(S0),[r,o]=gt({slot:e.slot},t,xB),{locale:i}=b5(),a=xF({...r,locale:i,createCalendar:_p}),s=(0,fZ.useRef)(null),{fieldProps:l,inputProps:u}=xc({...r,inputRef:s},a,o),c=(0,fZ.useCallback)(()=>{a.isDisabled||n.toggle()},[]);return(0,hq.jsxs)(y9,{values:[[xV,a],[_U,{...u,ref:s}],[_B,{...l,ref:o,isInvalid:a.isInvalid}]],children:[(0,hq.jsx)(_V,{...e,id:e.id,ref:t,slot:e.slot||void 0,className:e.className,isDisabled:a.isDisabled,isInvalid:a.isInvalid,onClick:c,children:a.segments.map((t,n)=>(0,fZ.cloneElement)(e.children(t),{key:n}))}),(0,hq.jsx)(_W,{})]})}),Dw=(0,fZ.forwardRef)(function(e,t){let n=(0,fZ.useContext)(S0),r=(0,fZ.useContext)(S1);return(n??r).isInvalid?(0,hq.jsx)(yT,{ref:t,size:16,...e}):(0,hq.jsx)(mf,{ref:t,size:16,...e})});class D_{constructor(e,t){this.locale=e,this.dictionary=t}of(e){return this.dictionary.getStringForLocale(e,this.locale)}}let Dx=new Map,DS=(0,fZ.forwardRef)(function({segment:e,...t},n){let r=(0,fZ.useContext)(xV),o=yV(n),{segmentProps:i}=function(e,t,n){let r,o,i,a,s=(0,fZ.useRef)(""),{locale:l,direction:u}=b5(),c=function(){var e;let{locale:t}=b5(),n=vg((e=xt)&&e.__esModule?e.default:e,"@react-aria/datepicker");return(0,fZ.useMemo)(()=>{try{return new Intl.DisplayNames(t,{type:"dateTimeField"})}catch{return new D_(t,n)}},[t,n])}(),{ariaLabel:d,ariaLabelledBy:f,ariaDescribedBy:p,focusManager:h}=xs.get(t),m=e.isPlaceholder?"":e.text,y=(0,fZ.useMemo)(()=>t.dateFormatter.resolvedOptions(),[t.dateFormatter]),g=vl({month:"long",timeZone:y.timeZone}),b=vl({hour:"numeric",hour12:y.hour12,timeZone:y.timeZone});if("month"!==e.type||e.isPlaceholder)"hour"!==e.type||e.isPlaceholder||(m=b.format(t.dateValue));else{let e=g.format(t.dateValue);m=e!==m?`${m} \u{2013} ${e}`:e}let{spinButtonProps:v}=De({value:e.value??void 0,textValue:m,minValue:e.minValue,maxValue:e.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly||!e.isEditable,isRequired:t.isRequired,onIncrement:()=>{s.current="",t.increment(e.type)},onDecrement:()=>{s.current="",t.decrement(e.type)},onIncrementPage:()=>{s.current="",t.incrementPage(e.type)},onDecrementPage:()=>{s.current="",t.decrementPage(e.type)},onIncrementToMax:()=>{s.current="",t.incrementToMax(e.type)},onDecrementToMin:()=>{s.current="",t.decrementToMin(e.type)}}),w=(0,fZ.useMemo)(()=>new(0,Dn.d)(l,{maximumFractionDigits:0}),[l]),x=()=>{if(e.text===e.placeholder&&h.focusPrevious(),!w.isValidPartialNumber(e.text)||t.isReadOnly||e.isPlaceholder)("dayPeriod"===e.type||"era"===e.type)&&t.clearSegment(e.type);else{let n=e.text.slice(0,-1),r=w.parse(n);0===(n=0===r?"":n).length||0===r?t.clearSegment(e.type):t.setSegment(e.type,r),s.current=n}},{startsWith:S}=(r=function(e){let{locale:t}=b5(),n=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(Dx.has(n))return Dx.get(n);let r=new Intl.Collator(t,e);return Dx.set(n,r),r}({usage:"search",sensitivity:"base"}),o=(0,fZ.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===r.compare(e.slice(0,t.length),t)),[r]),i=(0,fZ.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===r.compare(e.slice(-t.length),t)),[r]),a=(0,fZ.useCallback)((e,t)=>{if(0===t.length)return!0;e=e.normalize("NFC");let n=0,o=(t=t.normalize("NFC")).length;for(;n+o<=e.length;n++){let i=e.slice(n,n+o);if(0===r.compare(t,i))return!0}return!1},[r]),(0,fZ.useMemo)(()=>({startsWith:o,endsWith:i,contains:a}),[o,i,a])),E=vl({hour:"numeric",hour12:!0}),D=(0,fZ.useMemo)(()=>{let e=new Date;return e.setHours(0),E.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[E]),O=(0,fZ.useMemo)(()=>{let e=new Date;return e.setHours(12),E.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[E]),k=vl({year:"numeric",era:"narrow",timeZone:"UTC"}),P=(0,fZ.useMemo)(()=>{if("era"!==e.type)return[];let n=v5(new vH(1,1,1),t.calendar),r=t.calendar.getEras().map(e=>{let t=n.set({year:1,month:1,day:1,era:e}).toDate("UTC");return{era:e,formatted:k.formatToParts(t).find(e=>"era"===e.type).value}}),o=function(e){e.sort();let t=e[0],n=e[e.length-1];for(let e=0;e<t.length;e++)if(t[e]!==n[e])return e;return 0}(r.map(e=>e.formatted));if(o)for(let e of r)e.formatted=e.formatted.slice(o);return r},[k,t.calendar,e.type]),C=n=>{if(t.isDisabled||t.isReadOnly)return;let r=s.current+n;switch(e.type){case"dayPeriod":if(S(D,n))t.setSegment("dayPeriod",0);else if(S(O,n))t.setSegment("dayPeriod",1);else break;h.focusNext();break;case"era":{let e=P.find(e=>S(e.formatted,n));e&&(t.setSegment("era",e.era),h.focusNext());break}case"day":case"hour":case"minute":case"second":case"month":case"year":{if(!w.isValidPartialNumber(r))return;let o=w.parse(r),i=o;if(void 0!==e.maxValue&&o>e.maxValue&&(i=w.parse(n)),isNaN(o))return;t.setSegment(e.type,i),void 0!==e.maxValue&&(Number(o+"0")>e.maxValue||r.length>=String(e.maxValue).length)?(s.current="",h.focusNext()):s.current=r}}};wk((0,fZ.useRef)("u">typeof document?document:null),"selectionchange",()=>{let e=window.getSelection();e?.anchorNode&&gv(n.current,e?.anchorNode)&&e.collapse(n.current)});let j=(0,fZ.useRef)("");wk(n,"beforeinput",r=>{if(n.current)switch(r.preventDefault(),r.inputType){case"deleteContentBackward":case"deleteContentForward":w.isValidPartialNumber(e.text)&&!t.isReadOnly&&x();break;case"insertCompositionText":j.current=n.current.textContent,n.current.textContent=n.current.textContent;break;default:null!=r.data&&C(r.data)}}),wk(n,"input",e=>{let{inputType:t,data:r}=e;"insertCompositionText"===t&&(n.current&&(n.current.textContent=j.current),null!=r&&(S(D,r)||S(O,r))&&C(r))}),yz(()=>{let e=n.current;return()=>{((e=document)=>e.activeElement)()===e&&(h.focusPrevious()||h.focusNext())}},[n,h]);let T=gB()||"timeZoneName"===e.type?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{};e===(0,fZ.useMemo)(()=>t.segments.find(e=>e.isEditable),[t.segments])||t.isInvalid||(p=void 0);let R=y4(),A=!t.isDisabled&&!t.isReadOnly&&e.isEditable,N="literal"===e.type?"":c.of(e.type),M=wx({"aria-label":`${N}${d?`, ${d}`:""}${f?", ":""}`,"aria-labelledby":f});if("literal"===e.type)return{segmentProps:{"aria-hidden":!0}};let I={caretColor:"transparent"};if("rtl"===u){I.unicodeBidi="embed";let t=y[e.type];("numeric"===t||"2-digit"===t)&&(I.direction="ltr")}return{segmentProps:y5(v,M,{id:R,...T,"aria-invalid":t.isInvalid?"true":void 0,"aria-describedby":p,"aria-readonly":t.isReadOnly||!e.isEditable?"true":void 0,"data-placeholder":e.isPlaceholder||void 0,contentEditable:A,suppressContentEditableWarning:A,spellCheck:A?"false":void 0,autoCorrect:A?"off":void 0,[parseInt(fY().version,10)>=17?"enterKeyHint":"enterkeyhint"]:A?"next":void 0,inputMode:t.isDisabled||"dayPeriod"===e.type||"era"===e.type||!A?void 0:"numeric",tabIndex:t.isDisabled?void 0:0,onKeyDown:e=>{if("a"===e.key&&(g$()?e.metaKey:e.ctrlKey)&&e.preventDefault(),!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey)switch(e.key){case"Backspace":case"Delete":e.preventDefault(),e.stopPropagation(),x()}},onFocus:()=>{s.current="",n.current&&wR(n.current,{containingElement:wC(n.current)});let e=window.getSelection();e?.collapse(n.current)},style:I,onPointerDown(e){e.stopPropagation()},onMouseDown(e){e.stopPropagation()}})}}(e,r,o),{focusProps:a,isFocused:s,isFocusVisible:l}=bA(),{hoverProps:u,isHovered:c}=bL({...t,isDisabled:r.isDisabled||"literal"===e.type}),d=function(e){let{className:t,style:n,children:r,defaultClassName:o,defaultChildren:i,defaultStyle:a,values:s}=e;return(0,fZ.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:o}):t,l="function"==typeof n?n({...s,defaultStyle:a||{}}):n,u="function"==typeof r?r({...s,defaultChildren:i}):null==r?i:r,{className:e??o,style:l||a?{...a,...l}:void 0,children:u??i,"data-rac":""}},[t,n,r,o,i,a,s])}({...t,values:{...e,isReadOnly:!e.isEditable,isInvalid:r.isInvalid,isDisabled:r.isDisabled,isHovered:c,isFocused:s,isFocusVisible:l},defaultChildren:e.text}),f=(0,fZ.useCallback)(e=>{e.stopPropagation()},[]);return(0,hq.jsx)("span",{...y5(gh(t),i,a,u),...d,ref:o,style:i.style,"data-placeholder":e.isPlaceholder||void 0,"data-invalid":r.isInvalid||void 0,"data-readonly":!e.isEditable||void 0,"data-disabled":r.isDisabled||void 0,"data-type":e.type,"data-hovered":c||void 0,"data-focused":s||void 0,"data-focus-visible":l||void 0,onClick:f})}),DE={short:!1,size:"md"},DD=(0,fZ.forwardRef)(function(e,t){let{className:n,defaultValue:r,isDisabled:o,invalid:i,invalidText:a,isInvalid:s,label:l,labelText:u,light:c,maxDate:d,minDate:f,onChange:p,onChangeRaw:h,short:m,size:y,value:g,...b}={...DE,...e},{calendar:v,intlLocale:w,today_:x}=E4(),S=(0,fZ.useId)(),E=!!(u??l),D=(0,fZ.useMemo)(()=>S6(r,v),[r,v]),O=(0,fZ.useMemo)(()=>S6(g,v,!0),[g,v]),k=(0,fZ.useMemo)(()=>S6(d,v),[d,v]),P=(0,fZ.useMemo)(()=>S6(f??E3,v),[f,v]),C=(0,fZ.useMemo)(()=>i||s,[i,s]),j=(0,fZ.useMemo)(()=>(h&&p&&console.error("An OpenmrsDatePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),h??(e=>p?.(S5(e)))),[h,p]);return(0,hq.jsx)(S3,{locale:w.toString(),children:(0,hq.jsx)("div",{className:hY()("cds--form-item",n),children:(0,hq.jsx)(y9,{values:[[E2,w]],children:(0,hq.jsxs)(S2,{className:hY()("cds--date-picker","cds--date-picker--single",{"cds--date-picker--short":m,"cds--date-picker--light":c}),defaultValue:D,isDisabled:o,isInvalid:C,maxValue:k,minValue:P,value:O,shouldForceLeadingZeros:"en"===w.language||void 0,...b,onChange:j,children:[(0,hq.jsxs)("div",{className:"cds--date-picker-container",children:[E&&(0,hq.jsx)(x3,{className:hY()("cds--label",{"cds--label--disabled":o}),htmlFor:S,children:u??l}),(0,hq.jsxs)(_V,{className:Du,children:[(0,hq.jsx)(Dv,{id:E?S:void 0,ref:t,className:hY()("cds--date-picker-input__wrapper","-esm-form-engine__datepicker-module__inputWrapper___uKdT1",{"-esm-form-engine__datepicker-module__inputWrapperSm___0RXJc":"sm"===y,"-esm-form-engine__datepicker-module__inputWrapperMd___4Vff1":"md"===y||!y||0===y.length,"-esm-form-engine__datepicker-module__inputWrapperLg___VCRm5":"lg"===y}),children:e=>"era"!==e.type?(0,hq.jsx)(DS,{className:Dc,segment:e}):(0,hq.jsx)(fY().Fragment,{})}),(0,hq.jsx)(bW,{className:hY()(Dp,{[Dm]:"sm"===y,[Dh]:"md"===y||!y||0===y.length,[Dy]:"lg"===y}),children:(0,hq.jsx)(Dw,{})})]}),(0,hq.jsx)(x0,{className:Df,children:a})]}),(0,hq.jsx)(Db,{variant:"single",today_:x})]})})})})}),DO=(0,fZ.forwardRef)(function({className:e,defaultValue:t,invalid:n,invalidText:r,isDisabled:o,isInvalid:i,label:a,labelText:s,light:l,maxDate:u,minDate:c,onChange:d,onChangeRaw:f,size:p="md",value:h,...m},y){let{calendar:g,intlLocale:b,today_:v}=E4(),w=(0,fZ.useId)(),x=!!(s??a),S=(0,fZ.useMemo)(()=>{if(h)return{start:S6(h[0],g,!1),end:S6(h[1],g,!1)}},[h,g]),E=(0,fZ.useMemo)(()=>{if(t)return{start:S6(t[0],g,!1),end:S6(t[1],g,!1)}},[t,g]),D=(0,fZ.useMemo)(()=>S6(c??E3,g,!0),[c,g]),O=(0,fZ.useMemo)(()=>S6(u,g,!0),[u,g]),k=(0,fZ.useMemo)(()=>n||i,[n,i]),P=(0,fZ.useMemo)(()=>(f&&d&&console.error("An OpenmrsDateRangePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),f??(e=>d?.([S5(e.start),S5(e.end)]))),[f,d]);return(0,hq.jsx)(S3,{locale:b.toString(),children:(0,hq.jsx)("div",{className:hY()("cds--form-item",e),children:(0,hq.jsx)(y9,{values:[[E2,b]],children:(0,hq.jsx)(S4,{id:x?w:void 0,className:hY()("cds--date-picker",{"cds--date-picker--light":l,"cds--date-picker--disabled":o}),isInvalid:k,shouldForceLeadingZeros:"en"===b.language||void 0,maxValue:O,minValue:D,value:S,defaultValue:E,ref:y,isDisabled:o,...m,onChange:P,children:(0,hq.jsxs)("div",{className:"cds--date-picker-container",children:[x&&(0,hq.jsx)(x3,{className:hY()("cds--label",{"cds--label--disabled":o}),htmlFor:w,children:s??a}),(0,hq.jsxs)(_V,{className:Du,children:[(0,hq.jsxs)("div",{className:hY()("-esm-form-engine__datepicker-module__inputsWrapper___xXRQI",{"-esm-form-engine__datepicker-module__inputsWrapperSm___nL+b6":"sm"===p,"-esm-form-engine__datepicker-module__inputsWrapperMd___Kgcps":"md"===p||!p||0===p.length,"-esm-form-engine__datepicker-module__inputsWrapperLg___raaSN":"lg"===p}),children:[(0,hq.jsx)(xW,{className:hY()("cds--date-picker-input__wrapper","-esm-form-engine__datepicker-module__startInput___cWw-5",Dd),slot:"start",children:e=>(0,hq.jsx)(DS,{className:Dc,segment:e})}),(0,hq.jsx)("div",{className:"-esm-form-engine__datepicker-module__separator___Ddb4g",children:(0,hq.jsx)("span",{"aria-hidden":"true","data-readonly":!0,children:"–"})}),(0,hq.jsx)(xW,{className:hY()("cds--date-picker-input__wrapper","-esm-form-engine__datepicker-module__endInput___xdYOl",Dd),slot:"end",children:e=>(0,hq.jsx)(DS,{className:Dc,segment:e})})]}),(0,hq.jsx)(bW,{className:hY()(Dp,{[Dm]:"sm"===p,[Dh]:"md"===p||!p||0===p.length,[Dy]:"lg"===p}),children:(0,hq.jsx)(Dw,{})})]}),(0,hq.jsx)(x0,{className:Df,children:r}),(0,hq.jsx)(Db,{variant:"range",today_:v,minDate:D,maxDate:O})]})})})})})}),Dk=({diagnoses:e})=>{let{diagnosisTags:t}=pq({externalModuleName:"@openmrs/esm-styleguide"});return(0,hq.jsx)("div",{className:"-esm-form-engine__diagnosis-tags-module__container___1iigI",children:e.map(e=>{let{rank:n,uuid:r,display:o}=e,i=t[1===n?"primaryColor":"secondaryColor"];return(0,hq.jsx)(h1.vwO,{type:i,children:o},r)})})},DP={action:"-esm-form-engine__empty-card-module__action___oG778",content:"-esm-form-engine__empty-card-module__content___YUXvR",desktopHeading:"-esm-form-engine__empty-card-module__desktopHeading___EljiH",tabletHeading:"-esm-form-engine__empty-card-module__tabletHeading___8mc7w",tile:"-esm-form-engine__empty-card-module__tile___3-rRO"},DC=({width:e="64",height:t="64"})=>(0,hq.jsx)("svg",{width:e,height:t,viewBox:"0 0 64 64",children:(0,hq.jsx)("use",{href:"#omrs-empty-data-illustration"})}),Dj=e=>{let t="tablet"===hd(),n=e.launchForm;return(0,hq.jsx)(h1.Wdr,{className:DP.layer,children:(0,hq.jsxs)(h1.FAs,{className:DP.tile,children:[(0,hq.jsx)("div",{className:t?DP.tabletHeading:DP.desktopHeading,children:(0,hq.jsx)("h4",{children:e.headerTitle})}),(0,hq.jsx)(DC,{}),(0,hq.jsx)("p",{className:DP.content,children:iV("emptyStateText","There are no {{displayText}} to display",{displayText:e.displayText})}),(0,hq.jsx)("p",{className:DP.action,children:n&&(0,hq.jsx)(h1.$nd,{onClick:()=>n(),kind:"ghost",size:t?"lg":"sm",children:iV("recordNewEntry","Record {{ displayText }}",{displayText:e.displayText})})})]})})},DT=({error:e,headerTitle:t})=>{let n="tablet"===hd();return(0,hq.jsx)(h1.Wdr,{children:(0,hq.jsxs)(h1.FAs,{className:"-esm-form-engine__error-state-module__tile___mzWLn",children:[(0,hq.jsx)("div",{className:n?"-esm-form-engine__error-state-module__tabletHeading___l7Cpn":"-esm-form-engine__error-state-module__desktopHeading___p57fl",children:(0,hq.jsx)("h4",{children:t})}),(0,hq.jsxs)("p",{className:"-esm-form-engine__error-state-module__errorMessage___0fU6v",children:[iV("error","Error")," ",`${e?.response?.status}: `,e?.response?.statusText]}),(0,hq.jsx)("p",{className:"-esm-form-engine__error-state-module__errorCopy___xkVog",children:iV("errorCopy")})]})})},DR=DT,DA=fY().forwardRef((e,t)=>{let{slotName:n,basePath:r,componentContext:o,state:i}=hh(),a=window.location??{pathname:""},s=pe(n??"");return e.isChildOfHeader&&n&&s.length>0?(0,hq.jsxs)(h1.f8J,{"aria-label":iV("leftNavigation","Left navigation"),className:"-esm-form-engine__left-nav-module__leftNav___czP9T",expanded:!0,isFixedNav:!0,ref:t,...e,children:[(0,hq.jsx)(pr,{name:"global-nav-menu-slot"}),n?(0,hq.jsx)(pL,{value:o,fallback:(0,hq.jsx)(pr,{name:n,state:{basePath:r,currentPath:a,...i}}),children:(0,hq.jsx)(fJ.Provider,{value:o,children:(0,hq.jsx)(pr,{name:n,state:{basePath:r,currentPath:a,...i}})})}):null]}):null}),DN=({selectedLocationUuid:e,defaultLocationUuid:t,locationTag:n,locationsPerRequest:r=50,onChange:o})=>{let[i,a]=(0,fZ.useState)(""),s=(0,fZ.useId)(),{location:l}=function(e){let t=e?`/ws/fhir2/R4/Location?_id=${e}`:null,{data:n,error:r,isLoading:o}=pX()(t,oF,{shouldRetryOnError:e=>!!e?.response?.status&&e.response.status>=500});return(0,fZ.useMemo)(()=>({location:n?.data?.entry?n.data.entry[0]:null,error:t?r:null,isLoading:!!t&&o}),[n,o,r,t])}(t),{locations:u,isLoading:c,hasMore:d,loadingNewData:f,error:p,setPage:h}=function(e,t=0,n=""){let r=pJ(n),{data:o,isLoading:i,isValidating:a,setSize:s,error:l}=hr()(function(n,o){if(o){let e=o.data?.link?.find(e=>"next"===e.relation);if(!e)return null;let t=new URL(e.url);return t.origin===window.location.origin?e.url:new URL(`${t.pathname}${t.search?`?${t.search}`:""}`,window.location.origin).toString()}let i=`${oI}/Location?`,a=new URLSearchParams;return a.append("_summary","data"),t&&a.append("_count",""+t),n&&a.append("_getpagesoffset",""+n*t),e&&a.append("_tag",e),"string"==typeof r&&""!==r&&a.append("name:contains",r),i+a.toString()},oF);return(0,fZ.useMemo)(()=>({locations:o?.length?o?.flatMap(e=>e?.data?.entry??[]):[],isLoading:i,totalResults:o?.[0]?.data?.total,hasMore:!!o?.length&&o?.[o.length-1]?.data?.link?.some(e=>"next"===e.relation),loadingNewData:a,error:l||null,setPage:s}),[i,o,a,s,l])}(n,r,i),m=(0,fZ.useMemo)(()=>l&&!i&&t?[l,...u.filter(({resource:e})=>e.id!==t)]:u??[],[l,u,t,i]),y=(0,fZ.useCallback)(e=>{o(),a(e.trim())},[o]),g=hg((0,fZ.useCallback)(()=>{!f&&d&&h(e=>e+1)},[f,d,h])),b=d?Math.max(0,Math.floor(m.length-r/2)):-1;return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)(h1.vji,{"aria-describedby":p?`${s}-error`:void 0,labelText:iV("searchForLocation"),id:s,placeholder:iV("searchForLocation"),onChange:e=>y(e.target.value),size:"lg"}),p&&(0,hq.jsx)("div",{className:"-esm-form-engine__location-picker-module__errorNotification___NfvTe",id:`${s}-error`,children:(0,hq.jsx)(h1.jeF,{kind:"error",subtitle:iV("errorLoadingLoginLocations","Unable to load login locations. Please try again or contact support if the problem persists."),title:iV("error","Error")})}),(0,hq.jsx)("div",{className:"-esm-form-engine__location-picker-module__searchResults___agplm",children:c?(0,hq.jsx)("div",{className:"-esm-form-engine__location-picker-module__loadingContainer___EHghS",children:Array.from({length:5}).map((e,t)=>(0,hq.jsx)(h1.Psq,{className:"-esm-form-engine__location-picker-module__radioButtonSkeleton___up5rH",role:"progressbar"},t))}):(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("div",{className:"-esm-form-engine__location-picker-module__locationResultsContainer___06YOS",children:m.length>0?(0,hq.jsx)(h1.zWQ,{name:"loginLocations",onChange:e=>{o(e?.toString())},orientation:"vertical",valueSelected:e,children:m.map((e,t)=>(0,hq.jsx)(h1.aaP,{className:"-esm-form-engine__location-picker-module__locationRadioButton___yKif7",id:e.resource.id,labelText:(0,hq.jsx)("span",{ref:t===b?g:null,children:e.resource.name}),name:e.resource.name,value:e.resource.id},e.resource.id))}):(0,hq.jsx)("div",{className:"-esm-form-engine__location-picker-module__emptyState___cPWp8",children:(0,hq.jsx)("p",{className:"-esm-form-engine__location-picker-module__locationNotFound___b14++",children:iV("noResultsToDisplay")})})}),f&&(0,hq.jsx)("div",{className:"-esm-form-engine__location-picker-module__loadingIcon___GVlrq",children:(0,hq.jsx)(h1.OuH,{description:iV("loading")})})]})})]})},DM=Z("modalState",{modalContainer:null,modalStack:[]}),DI=0;async function D$(e,t,n={}){let r=fO(t),o=null;if(e){if(!r)throw Error(`No modal named '${t}' has been registered.`);let{load:i}=r,a=await i(),s=DI++;o=await fz({...a,name:`${t}-${s}`},{...n,domElement:e})}else I(`Failed to launch modal. Please notify your administrator. Modal name: ${t}`);return o}function DL(e){return"TO_BE_DELETED"===e.state||"DELETED"===e.state}function DF(e,t){t?.unmount&&(t.unmountPromise?.catch(()=>{}),t.unmount().catch(t=>{console.error(`The modal '${e}' failed to unmount`,t)}))}function DB(e){return e.find(e=>!DL(e))}function DV(e,t){e.container&&(e.container.style.visibility=t?"unset":"hidden")}let DU=window.getComputedStyle(document.body).overflow;function DW({modalStack:e,modalContainer:t}){if(t)if(e.length){t.style.visibility||(addEventListener("keydown",Dz),document.body.style.overflow="hidden",t.style.visibility="unset");let n=DB(e);e.forEach(e=>{switch(e.state){case"NEW":{let n=function({size:e}){let t=document.createElement("div");return t.className=`cds--modal-container cds--modal-container--${e}`,t.setAttribute("role","dialog"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-modal","true"),t}({size:e.props?.size??"md"});e.container=n,e.state="MOUNTING",D$(n,e.modalName,e.props).then(r=>{DL(e)?DF(e.modalName,r):r?(e.parcel=r,t.prepend(n),DV(e,DB(DM.getState().modalStack)===e),r.mountPromise.then(()=>{DL(e)||(e.state="MOUNTED")},t=>{I(t),e.parcel=null,DK(e)})):DK(e)},t=>{I(t),DK(e)});break}case"MOUNTING":case"MOUNTED":DV(e,e===n);break;case"TO_BE_DELETED":e.state="DELETED",e.onClose(),DF(e.modalName,e.parcel),e.container?.remove(),setTimeout(()=>{let t=DM.getState();DM.setState({...t,modalStack:t.modalStack.filter(t=>t!==e)})},0)}})}else t.style.removeProperty("visibility"),document.body.style.overflow=DU,removeEventListener("keydown",Dz)}function DK(e){if(DL(e))return;e.state="TO_BE_DELETED";let t=DM.getState();DM.setState({...t,modalStack:[...t.modalStack]})}function Dz(e){"Escape"===e.key&&function(){let[e]=DM.getState().modalStack;e&&DK(e)}()}function DH(e){DM.subscribe(DW),DM.setState({...DM.getState(),modalContainer:e})}function DG(e,t={},n=()=>{}){let r=()=>{let e=DM.getState().modalStack.find(e=>e.onClose===n);e&&DK(e)};if(fO(e)){var o;let i,a;o={state:"NEW",onClose:n,modalName:e,props:{close:r,...t}},a=[o,...(i=DM.getState()).modalStack],DM.setState({...i,modalStack:a})}else I(`Failed to launch modal. Please notify your administrator. Modal name: "${e}"`);return r}var Dq=n(33696);let DZ=({notification:e})=>{let{description:t,action:n,kind:r,critical:o,title:i,onAction:a}=e;return(0,hq.jsx)(h1.kZS,{actionButtonLabel:n,kind:r||"info",lowContrast:o,subtitle:t,title:i||"",inline:!0,onActionButtonClick:a})},DY=({subject:e})=>{let[t,n]=(0,fZ.useState)([]);return(0,fZ.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.description!==e.description||t.action!==e.action||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(DZ,{notification:e},e.id))})},DJ=({notification:e})=>{let{actionButtonLabel:t,onActionButtonClick:n=()=>{},subtitle:r,kind:o,title:i,critical:a,progressActionLabel:s,id:l,...u}=e,[c,d]=(0,fZ.useState)(t);return(0,hq.jsx)(h1.kZS,{kind:o||"info",actionButtonLabel:c,ariaLabel:iV("closesActionableNotification","Closes actionable notification"),onActionButtonClick:()=>{n(),s&&d(s)},statusIconDescription:iV("actionableNotification","Actionable notification"),subtitle:r,title:i,lowContrast:a,inline:!0,...u})},DQ=({subject:e})=>{let[t,n]=(0,fZ.useState)([]);return(0,fZ.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(DJ,{notification:e},e.id))})};var DX=n(75992);let D0=new Dq.B7,D1=0,D2=new Dq.B7,D4=0;function D3(e){e&&(0,po.createRoot)(e).render((0,hq.jsx)(DY,{subject:D0}))}function D6(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&(t instanceof Error||!(0,DX.A)(t)))?(e.description instanceof Error&&(e.description=e.description.toLocaleString()),setTimeout(()=>{D0.next({...e,id:D1++})},0)):console.error("showNotification must be called with an object having a 'description' property that is a non-empty string or object")}function D5(e){e&&(0,po.createRoot)(e).render((0,hq.jsx)(DQ,{subject:D2}))}function D7(e){var t;e&&("string"==typeof(t=e.actionButtonLabel)?t.trim().length>0:"object"==typeof t&&!(0,DX.A)(t))?setTimeout(()=>{D2.next({...e,id:D4++})},0):console.error("showActionableNotification must be called with an actionButtonLabel that is a non-empty string")}let D9=["NORMAL","HIGH","CRITICALLY_HIGH","OFF_SCALE_HIGH","LOW","CRITICALLY_LOW","OFF_SCALE_LOW"],D8=["critically_low","critically_high","high","low","normal","off_scale_low","off_scale_high"],Oe={container:"-esm-form-engine__numeric-observation-module__container___gS0Wg",card:"-esm-form-engine__numeric-observation-module__card___w0fF5","abnormal-value":"-esm-form-engine__numeric-observation-module__abnormal-value___xuX3W","critical-value":"-esm-form-engine__numeric-observation-module__critical-value___Jynsn",cell:"-esm-form-engine__numeric-observation-module__cell___tMhBJ","critically-high":"-esm-form-engine__numeric-observation-module__critically-high___3L2wx","critically-low":"-esm-form-engine__numeric-observation-module__critically-low___XP+HX",high:"-esm-form-engine__numeric-observation-module__high___JV9do",low:"-esm-form-engine__numeric-observation-module__low___-uDKD","label-container":"-esm-form-engine__numeric-observation-module__label-container___vTf2y","value-container":"-esm-form-engine__numeric-observation-module__value-container___xTUIC",label:"-esm-form-engine__numeric-observation-module__label___-pfmb",value:"-esm-form-engine__numeric-observation-module__value___1A4zt",units:"-esm-form-engine__numeric-observation-module__units___SzvX+","pad-right":"-esm-form-engine__numeric-observation-module__pad-right___ND9XL","off-scale-low":"-esm-form-engine__numeric-observation-module__off-scale-low___gFAv9","off-scale-high":"-esm-form-engine__numeric-observation-module__off-scale-high___aSEmX",arrow:"-esm-form-engine__numeric-observation-module__arrow___9bvsX"},Ot=({value:e,unit:t,label:n,interpretation:r,referenceRange:o,conceptUuid:i,variant:a="card",patientUuid:s})=>{let l=(0,fZ.useId)(),{referenceRange:u,isLoading:c}=function(e,t){let n=null;e&&(n=t?`${oM}/conceptreferencerange/?patient=${t}&concept=${e}&v=full`:`${oM}/conceptreferencerange/?concept=${e}&v=full`);let{data:r,error:o,isLoading:i}=pX()(n,oF),a=r?.data?.results?.[0];return{referenceRange:a?{hiNormal:a.hiNormal??null,hiAbsolute:a.hiAbsolute??null,hiCritical:a.hiCritical??null,lowNormal:a.lowNormal??null,lowAbsolute:a.lowAbsolute??null,lowCritical:a.lowCritical??null}:void 0,error:o,isLoading:i}}(o||r?void 0:i,s),d=o??u,f=(0,fZ.useMemo)(()=>{if(r)return r?"--"===r?"normal":D9.includes(r)?r.toLowerCase():D8.includes(r)?r:"normal":void 0;if(d&&!c){if(!d||null==e||""===e)return"normal";let t="string"==typeof e?Number.parseFloat(e):e;return Number.isNaN(t)?"normal":null!==d.hiAbsolute&&void 0!==d.hiAbsolute&&t>d.hiAbsolute?"off_scale_high":null!==d.hiCritical&&void 0!==d.hiCritical&&t>=d.hiCritical?"critically_high":null!==d.hiNormal&&void 0!==d.hiNormal&&t>d.hiNormal?"high":null!==d.lowAbsolute&&void 0!==d.lowAbsolute&&t<d.lowAbsolute?"off_scale_low":null!==d.lowCritical&&void 0!==d.lowCritical&&t<=d.lowCritical?"critically_low":null!==d.lowNormal&&void 0!==d.lowNormal&&t<d.lowNormal?"low":"normal"}return"normal"},[r,d,e,c])??"normal",p="critically_low"===f||"critically_high"===f||"off_scale_low"===f||"off_scale_high"===f,h="normal"!==f,m=n?`omrs-numeric-obs-label-${n.replaceAll(/\s+/g,"-").toLowerCase()}-${l}`:void 0,y=`omrs-numeric-obs-value-${l}`,g=`omrs-numeric-obs-unit-${l}`,b=null!=e&&""!==e,v=b?e:iV("notAvailable","Not available"),w=hY()({[Oe["critically-low"]]:"critically_low"===f||"off_scale_low"===f,[Oe["critically-high"]]:"critically_high"===f||"off_scale_high"===f,[Oe.low]:"low"===f,[Oe.high]:"high"===f,[Oe["off-scale-low"]]:"off_scale_low"===f,[Oe["off-scale-high"]]:"off_scale_high"===f}),x=hY()({[Oe.container]:!0,[Oe.card]:!0,[Oe["critical-value"]]:p,[Oe["abnormal-value"]]:h&&!p}),S=hY()({[Oe.cell]:!0,[w]:!0});return"cell"===a?(0,hq.jsxs)("div",{className:S,children:[v,b&&t?` ${t}`:""]}):(0,hq.jsxs)("section",{className:x,"data-testid":"numeric-observation-card",children:[n&&(0,hq.jsxs)("div",{className:Oe["label-container"],children:[(0,hq.jsx)("span",{id:m,className:Oe.label,children:n}),h&&(0,hq.jsx)("span",{className:Oe[f.replace("_","-")],title:iV("abnormalValue","Abnormal value")})]}),(0,hq.jsxs)("div",{className:Oe["value-container"],children:[(0,hq.jsx)("span",{id:y,"aria-labelledby":m&&g?`${m} ${g}`:m||g||void 0,className:Oe.value,children:v}),b&&t&&(0,hq.jsx)("span",{id:g,className:Oe.units,children:t})]})]})},On="-esm-form-engine__page-header-module__pageHeader___6TOjO",Or=e=>{if("children"in e){let{children:t,className:n,...r}=e;return(0,hq.jsx)("div",{className:hY()(On,n),...r,children:t})}{let{title:t,illustration:n,className:r,...o}=e;return(0,hq.jsx)("div",{className:hY()(On,r),...o,children:(0,hq.jsx)(Oo,{title:t,illustration:n})})}},Oo=({title:e,illustration:t,className:n})=>{let[r,o]=(0,fZ.useState)(null);return(0,fZ.useEffect)(()=>{nO("@openmrs/esm-styleguide").then(e=>{o(e)})},[]),(0,hq.jsxs)("div",{className:hY()("-esm-form-engine__page-header-module__pageHeaderContent___mCImT",n),children:[t,(0,hq.jsxs)("div",{className:"-esm-form-engine__page-header-module__pageLabels___kqDS+",children:[r?.implementationName&&(0,hq.jsx)("p",{children:iV(r.implementationName)}),(0,hq.jsx)("p",{className:"-esm-form-engine__page-header-module__pageName___SbZBC",children:e})]})]})},Oi=({totalItems:e,pageSize:t,onPageNumberChange:n,pageNumber:r,dashboardLinkUrl:o,currentItems:i,dashboardLinkLabel:a})=>{let{pageSizes:s,pageItemsCount:l}=hw(t,e,r,i),u="tablet"===hd(),c=iV("paginationItemsCount","{{pageItemsCount}} / {{totalItems}} items",{totalItems:e,pageItemsCount:l});return(0,hq.jsx)(hq.Fragment,{children:e>0&&(0,hq.jsxs)("div",{className:hY()({"-esm-form-engine__pagination-module__tablet___82gj1":u,"-esm-form-engine__pagination-module__desktop___6yI8e":!u}),children:[(0,hq.jsxs)("div",{children:[c,o&&(0,hq.jsx)(fQ,{to:o,className:"-esm-form-engine__pagination-module__configurableLink___oIqma",children:a??iV("seeAll","See all")})]}),(0,hq.jsx)(h1.dKS,{className:"-esm-form-engine__pagination-module__pagination___A-Lcg",page:r,pageSize:t,pageSizes:s,totalItems:e,onChange:n,pageRangeText:(e,t)=>iV("paginationOfPages","of {{count}} pages",{count:t}),size:u?"lg":"sm"})]})})};function Oa(e){return Ol(Oc(e,"usual","official"))}function Os(e){return Oa(e)}function Ol(e){var t;let n;return e?e.text??(n=(t=e).given??[],(t.family?n.concat(t.family):n).join(" ")):""}function Ou(e){return Ol(e)}function Oc(e,...t){for(let n of(0==t.length&&(t=["usual"]),t)){let t=e.name?.find(e=>{var t,r;return t=e,r=n,t.use?t.use===r:"usual"===r});if(t)return t}}function Od(e,t=hP()()){let n=hP()(t),r=EZ(e,n);if(null==r)return null;let o=n.diff(r,"hours"),i=n.diff(r,"days"),a=n.diff(r,"weeks"),s=n.diff(r,"months"),l=n.diff(r,"years"),u={};if(o<2)u.minutes=n.diff(r,"minutes");else if(i<2)u.hours=o;else if(a<4)u.days=i;else if(l<1){let e=n.subtract(a,"weeks").diff(r,"days");u.weeks=a,u.days=e}else if(l<2){let e=n.subtract(s,"months").diff(r,"days");u.months=s,u.days=e}else if(l<18){let e=n.subtract(l,"year").diff(r,"months");u.years=l,u.months=e}else u.years=l;return u}function Of(e,t=hP()()){let n=Od(e,t);if(null==n)return null;let r={style:"short",localeMatcher:"lookup"};return"minutes"in n&&0===n.minutes&&(r.minutesDisplay="always"),Eq(n,r)}let Op={container:"-esm-form-engine__patient-banner-patient-info-module__container___iC32K",activePatientContainer:"-esm-form-engine__patient-banner-patient-info-module__activePatientContainer___OoDPd",patientBanner:"-esm-form-engine__patient-banner-patient-info-module__patientBanner___swajU",patientName:"-esm-form-engine__patient-banner-patient-info-module__patientName___+2+Xi",patientAvatar:"-esm-form-engine__patient-banner-patient-info-module__patientAvatar___Rdf75",patientAvatarButton:"-esm-form-engine__patient-banner-patient-info-module__patientAvatarButton___A1q8c",patientInfo:"-esm-form-engine__patient-banner-patient-info-module__patientInfo___L-cOQ",demographics:"-esm-form-engine__patient-banner-patient-info-module__demographics___IDhb0",row:"-esm-form-engine__patient-banner-patient-info-module__row___TP7gU",flexRow:"-esm-form-engine__patient-banner-patient-info-module__flexRow___vNMt2",tagsSlot:"-esm-form-engine__patient-banner-patient-info-module__tagsSlot___0Dvjn",identifiers:"-esm-form-engine__patient-banner-patient-info-module__identifiers___d3GTJ",identifier:"-esm-form-engine__patient-banner-patient-info-module__identifier___kc6eq",primaryIdentifier:"-esm-form-engine__patient-banner-patient-info-module__primaryIdentifier___ZxRUU",secondaryIdentifier:"-esm-form-engine__patient-banner-patient-info-module__secondaryIdentifier___eQh8x",value:"-esm-form-engine__patient-banner-patient-info-module__value___CoAOR",tag:"-esm-form-engine__patient-banner-patient-info-module__tag___InccN",gender:"-esm-form-engine__patient-banner-patient-info-module__gender___vfinx",separator:"-esm-form-engine__patient-banner-patient-info-module__separator___3OIBl",tooltipPadding:"-esm-form-engine__patient-banner-patient-info-module__tooltipPadding___hBqWG",tooltipSmallText:"-esm-form-engine__patient-banner-patient-info-module__tooltipSmallText___bPnkq",actionsButtonText:"-esm-form-engine__patient-banner-patient-info-module__actionsButtonText___VNvm7"};function Oh({showIdentifierLabel:e,type:t,value:n}){return(0,hq.jsx)("span",{className:Op.primaryIdentifier,children:(0,hq.jsxs)(h1.vwO,{className:Op.tag,type:"gray",children:[e&&t?.text&&(0,hq.jsxs)("span",{className:Op.label,children:[t.text,": "]}),(0,hq.jsx)("span",{className:Op.value,children:n})]})})}function Om({showIdentifierLabel:e,type:t,value:n}){return(0,hq.jsxs)(h1.lRv,{className:Op.secondaryIdentifier,id:`patient-banner-identifier-${n}`,children:[e&&(0,hq.jsxs)("span",{className:Op.label,children:[t?.text,": "]}),(0,hq.jsx)("span",{className:Op.value,children:n})]})}function Oy({identifiers:e,showIdentifierLabel:t}){let{excludePatientIdentifierCodeTypes:n}=pq(),{primaryIdentifierCode:r}=hS(),o=e?.filter(e=>{let t=e.type?.coding?.[0]?.code;return t&&!n?.uuids.includes(t)})??[];return(0,hq.jsx)(hq.Fragment,{children:o?.length?o.map(({value:e,type:n},i)=>(0,hq.jsxs)(fY().Fragment,{children:[(0,hq.jsx)("span",{className:Op.identifier,children:n?.coding?.[0]?.code===r?(0,hq.jsx)(Oh,{showIdentifierLabel:t,type:n,value:e}):(0,hq.jsx)(Om,{showIdentifierLabel:t,type:n,value:e})}),i<o.length-1&&(0,hq.jsx)("span",{className:Op.separator,children:"\xb7"})]},e)):""})}let Og={Female:mI,Male:m$,Other:mL,Unknown:mF},Ob=({gender:e})=>{let t=Og[e];return t?(0,hq.jsx)(t,{fill:"#525252"}):null},Ov={male:"Male",female:"Female",other:"Other",unknown:"Unknown"};function Ow({patient:e,renderedFrom:t}){var n;let r,o,i=Oa(e),a=e?.gender&&(o=Ov[r=(n=e.gender).toLowerCase()]??"Unknown",{displayText:iV(r,n),iconKey:o}),s=(0,fZ.useMemo)(()=>({patientUuid:e.id,patient:e,renderedFrom:t}),[e.id,e,t]);return(0,hq.jsxs)("div",{className:Op.patientInfo,children:[(0,hq.jsx)("div",{className:hY()(Op.row,Op.patientNameRow),children:(0,hq.jsxs)("div",{className:Op.flexRow,children:[(0,hq.jsx)("span",{className:Op.patientName,children:i}),a&&(0,hq.jsxs)("div",{className:Op.gender,children:[(0,hq.jsx)(Ob,{gender:a.iconKey}),(0,hq.jsx)("span",{children:a.displayText})]}),(0,hq.jsx)(pr,{className:Op.tagsSlot,name:"patient-banner-tags-slot",state:s})]})}),(0,hq.jsxs)("div",{className:Op.demographics,children:[e.birthDate&&(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("span",{children:Of(e.birthDate)}),(0,hq.jsx)("span",{className:Op.separator,children:"\xb7"}),(0,hq.jsx)("span",{children:EU(e.birthDate,{time:!1})}),(0,hq.jsx)("span",{className:Op.separator,children:"\xb7"})]}),(0,hq.jsx)(Oy,{identifiers:e.identifier,showIdentifierLabel:!0}),(0,hq.jsx)(pr,{className:Op.extensionSlot,name:"patient-banner-bottom-slot",state:s})]})]})}var O_=n(58742);let Ox=fY().forwardRef(function({children:e,size:t=16,...n},r){return fY().createElement(O_.A,{width:t,height:t,ref:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},ed||(ed=fY().createElement("circle",{cx:"16",cy:"8",r:"2"})),ef||(ef=fY().createElement("circle",{cx:"16",cy:"16",r:"2"})),ep||(ep=fY().createElement("circle",{cx:"16",cy:"24",r:"2"})),e)});function OS({patient:e,patientUuid:t,actionsSlotName:n,additionalActionsSlotState:r}){let[o,i]=(0,fZ.useState)(!1),{extensions:a}=pt(n),s="tablet"===hd(),l=hy(()=>i(!1),o),u=(0,fZ.useRef)(null),c=(0,fZ.useRef)(null),d=(0,fZ.useId)(),f=`patient-actions-menu-trigger-${d}`,p=`patient-actions-menu-${d}`,h=(0,fZ.useCallback)(()=>i(e=>!e),[]),m=(0,fZ.useCallback)(()=>{i(!1),u.current?.focus()},[]),y=(0,fZ.useCallback)(e=>{if("Escape"===e.key&&o){e.stopPropagation(),m();return}if(("ArrowDown"===e.key||"ArrowUp"===e.key)&&o){e.preventDefault();let t=c.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!t?.length)return;let n=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,r=Array.from(t).indexOf(n);if(-1===r)return void t["ArrowDown"===e.key?0:t.length-1]?.focus();let o=r+("ArrowDown"===e.key?1:-1),i=o<0?t.length-1:o>=t.length?0:o;t[i]?.focus()}},[m,o]);(0,fZ.useEffect)(()=>{if(o&&c.current){let e=c.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[o]);let g=(0,fZ.useMemo)(()=>({patientUuid:t,patient:e,closeMenu:m,...r}),[t,e,m,r]);return 0===a.length?null:(0,hq.jsx)("div",{className:"-esm-form-engine__patient-banner-actions-menu-module__overflowMenuContainer___FbFcO",children:(0,hq.jsxs)("div",{"data-overflow-menu":!0,className:hY()("cds--overflow-menu",h3),ref:l,children:[(0,hq.jsxs)("button",{className:hY()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":o},h7),"aria-controls":p,"aria-expanded":o,"aria-haspopup":"true",id:f,onClick:h,onKeyDown:y,ref:u,children:[(0,hq.jsx)("span",{className:"-esm-form-engine__patient-banner-actions-menu-module__actionsButtonText___hk4xW",children:iV("actions","Actions")})," ",(0,hq.jsx)(Ox,{size:16,style:{marginLeft:"0.5rem",fill:"#78A9FF"}})]}),(0,hq.jsxs)("div",{className:hY()("cds--overflow-menu-options","cds--overflow-menu--flip",h6,{[h5]:o}),"aria-labelledby":f,"data-floating-menu-direction":"bottom",id:p,onKeyDown:y,ref:c,role:"menu",tabIndex:-1,children:[(0,hq.jsx)("ul",{className:hY()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":s}),children:(0,hq.jsx)(pr,{name:n,state:g},n)}),(0,hq.jsx)("span",{})]})]})})}var OE=n(35570),OD=n.n(OE);function OO(e){let{patientPhotoConceptUuid:t}=pq({externalModuleName:"@openmrs/esm-styleguide"}),n=t?`${oM}/obs?patient=${e}&concept=${t}&v=full`:null,{data:r,error:o,isLoading:i}=pw()(e?n:null,oF),a=r?.data?.results[0];return{data:a?{dateTime:a?.obsDatetime,imageSrc:a?.value?.links?.uri}:null,error:o,isLoading:i}}let Ok=({width:e=56,height:t=56,"aria-label":n})=>{let{t:r}=(0,pb.useTranslation)();return(0,hq.jsxs)("svg",{"aria-label":n??r("patientPhotoPlaceholder","Patient photo placeholder"),width:e,height:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,hq.jsx)("path",{fill:"#ffffff",d:"M0 0h56v56H0z"}),(0,hq.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m36.75 20.134-.884-.884L19.25 35.866l.884.884 1.25-1.25H34.25a1.252 1.252 0 0 0 1.25-1.25V21.384l1.25-1.25Zm-2.5 14.116H22.634l4.87-4.87 1.487 1.486a1.25 1.25 0 0 0 1.768 0l.991-.991 2.5 2.498v1.877Zm0-3.645-1.616-1.616a1.25 1.25 0 0 0-1.768 0l-.991.991-1.486-1.486 5.861-5.86v7.971Zm-12.5 1.145v-1.875l3.125-3.123.858.859.885-.885-.86-.86a1.25 1.25 0 0 0-1.767 0l-2.241 2.242V21.75h10V20.5h-10c-.69 0-1.25.56-1.25 1.25v10h1.25Z",fill:"#8D8D8D"})]})},OP="-esm-form-engine__patient-photo-module__avatar___thboZ";function OC({patientUuid:e,patientName:t,alt:n}){let{data:r,isLoading:o}=OO(e),[i,a]=(0,fZ.useState)(null),[s,l]=(0,fZ.useState)(!1),u=(0,fZ.useMemo)(()=>OD().generate(e),[e]);(0,fZ.useEffect)(()=>{if(r?.imageSrc){let e=new URL(r.imageSrc,window.location.origin).pathname;l(!0);let t=!1,n=new Image;return n.onload=()=>{t||(a(e),l(!1))},n.onerror=()=>{t||(a(null),l(!1))},n.src=e,()=>{t=!0}}a(null),l(!1)},[r?.imageSrc]);let c=(0,fZ.useMemo)(()=>n||(i?iV("patientPhotoAlt","Profile photo of {{patientName}}",{patientName:t}):iV("patientAvatarAlt","Avatar for {{patientName}}",{patientName:t})),[n,i,t]);return o||s?(0,hq.jsx)(h1.ryE,{className:"-esm-form-engine__patient-photo-module__skeleton___WWtyX","data-testid":"skeleton-icon"}):r?.imageSrc&&!i?(0,hq.jsx)(Ok,{"aria-label":iV("patientPhotoPlaceholder","Photo placeholder for {{patientName}}",{patientName:t})}):i?(0,hq.jsx)("div",{"aria-label":c,children:(0,hq.jsx)("img",{className:OP,src:i,alt:c,title:t})}):(0,hq.jsx)("div",{"aria-label":c,children:(0,hq.jsx)("div",{className:OP,title:t,style:{backgroundImage:u.toDataUrl(),backgroundRepeat:"no-repeat",backgroundSize:"cover"},children:(0,hq.jsx)("span",{className:"-esm-form-engine__patient-photo-module__initials___xLeEF",children:function(e,t=3){return e.split(/\s+/).filter(Boolean).slice(0,t).map(e=>e[0]).join("")}(t)})})})}let Oj=["omrs-pict-appointments","omrs-pict-assessment-1","omrs-pict-assessment-2","omrs-pict-blood-bank","omrs-pict-cardiology","omrs-pict-ct-scan","omrs-pict-dentistry","omrs-pict-digital-trust","omrs-pict-emergency-department","omrs-pict-facility","omrs-pict-geriatrics","omrs-pict-gynaecology","omrs-pict-in-patient","omrs-pict-laboratory","omrs-pict-labs-2","omrs-pict-obstetrics","omrs-pict-patient-search","omrs-pict-patients","omrs-pict-payments-desk","omrs-pict-pharmacy","omrs-pict-pharmacy-2","omrs-pict-registration","omrs-pict-service-queues","omrs-pict-stock-management","omrs-pict-transfer","omrs-pict-triage","omrs-pict-x-ray"],OT=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-appointments",pictogramProps:e})})),OR=OT,OA=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-assessment-1",pictogramProps:e})})),ON=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-assessment-2",pictogramProps:e})})),OM=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-blood-bank",pictogramProps:e})})),OI=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-cardiology",pictogramProps:e})})),O$=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-ct-scan",pictogramProps:e})})),OL=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-dentistry",pictogramProps:e})})),OF=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-digital-trust",pictogramProps:e})})),OB=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-emergency-department",pictogramProps:e})})),OV=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-facility",pictogramProps:e})})),OU=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-geriatrics",pictogramProps:e})})),OW=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-gynaecology",pictogramProps:e})})),OK=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-in-patient",pictogramProps:e})})),Oz=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-laboratory",pictogramProps:e})})),OH=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-labs-2",pictogramProps:e})})),OG=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-obstetrics",pictogramProps:e})})),Oq=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-patient-search",pictogramProps:e})})),OZ=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-patients",pictogramProps:e})})),OY=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-payments-desk",pictogramProps:e})})),OJ=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-pharmacy",pictogramProps:e})})),OQ=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-pharmacy-2",pictogramProps:e})})),OX=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-registration",pictogramProps:e})})),O0=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-service-queues",pictogramProps:e})})),O1=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-stock-management",pictogramProps:e})})),O2=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-transfer",pictogramProps:e})})),O4=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-triage",pictogramProps:e})})),O3=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O9,{ref:t,pictogram:"omrs-pict-x-ray",pictogramProps:e})})),O6=OV,O5=OZ,O7=(0,fZ.memo)((0,fZ.forwardRef)(function({pictogram:e,fallback:t,...n},r){let o=(0,fZ.useRef)(document.getElementById(e));return(0,fZ.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),n=new MutationObserver(t=>{for(let n of t)"childList"===n.type&&(o.current=document.getElementById(e))});return t&&n.observe(t,{childList:!0}),()=>n.disconnect()},[e]),(0,hq.jsx)(pL,{value:o.current,fallback:t,children:(0,hq.jsx)(O9,{ref:r,pictogram:e,pictogramProps:n})})})),O9=(0,fZ.memo)((0,fZ.forwardRef)(function({pictogram:e,pictogramProps:t},n){let{className:r,size:o}=Object.assign({},{size:92},t);return(o<=26||o>144)&&(console.error(`Invalid size '${o}' specified for ${e}. Defaulting to 92.`),o=92),(0,hq.jsx)("svg",{ref:n,className:hY()("-esm-form-engine__pictograms-module__pictogram___ooPKM",r),height:o,width:o,children:(0,hq.jsx)("use",{href:`#${e}`})})})),O8=({children:e})=>"tablet"===hd()?(0,hq.jsx)(h1.Wdr,{children:e}):(0,hq.jsx)(hq.Fragment,{children:e}),ke=({snackbar:e,closeSnackbar:t})=>{let{actionButtonLabel:n="",kind:r="success",onActionButtonClick:o=()=>{},isLowContrast:i="error"!==r,progressActionLabel:a,subtitle:s="",timeoutInMs:l=5e3,autoClose:u="error"!==r,title:c,id:d,...f}=e,[p,h]=(0,fZ.useState)(n),[m,y]=(0,fZ.useState)(!0),[g,b]=(0,fZ.useState)(!1),v=(0,fZ.useCallback)(()=>{setTimeout(t,250)},[t]),w=(0,fZ.useCallback)(()=>{b(!0),v()},[v]);return(0,fZ.useEffect)(()=>{if(u){let e=setTimeout(w,l);return()=>clearTimeout(e)}},[l,u,w]),(0,fZ.useEffect)(()=>{y(!1),window.setTimeout(()=>{y(!0)},0)},[]),(0,hq.jsx)(h1.kZS,{actionButtonLabel:p,"aria-label":iV("closeSnackbar","Close snackbar"),className:hY()("-esm-form-engine__snackbar-module__slideIn___senVE",{"-esm-form-engine__snackbar-module__animated___8eltL":m,"-esm-form-engine__snackbar-module__slideOut___BIIXm":g}),kind:r,lowContrast:i,onActionButtonClick:()=>{o(),w(),a&&h(a)},onClose:v,statusIconDescription:iV("snackbarNotification","Snackbar notification"),subtitle:s,title:c,...f})},kt=({subject:e})=>{let[t,n]=(0,fZ.useState)([]),r=(0,fZ.useCallback)(e=>{n(t=>t.filter(t=>t!==e))},[]);return(0,fZ.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(ke,{snackbar:e,closeSnackbar:()=>r(e)},e.id))})},kn=new Dq.B7,kr=0;function ko(e){e&&(0,po.createRoot)(e).render((0,hq.jsx)(kt,{subject:kn}))}function ki(e){var t;e&&"string"==typeof(t=e.title)&&t.trim().length>0?setTimeout(()=>{kn.next({...e,id:kr++})},0):console.error("showSnackbar must be called with an object having a 'title' property that is a non-empty string")}let ka=({toast:e,closeToast:t})=>{let{description:n,kind:r,critical:o,title:i,actionButtonLabel:a,onActionButtonClick:s=()=>{}}=e,l=(0,fZ.useCallback)(()=>{s(),t()},[t,s]);return(0,hq.jsx)("div",{children:(0,hq.jsx)(h1.kZS,{actionButtonLabel:a,kind:r||"info",lowContrast:o,subtitle:n,title:i||"",onActionButtonClick:l,onClose:t})})},ks=({subject:e})=>{let[t,n]=(0,fZ.useState)([]),r=(0,fZ.useCallback)(e=>{n(t=>t.filter(t=>t!==e))},[]);return(0,fZ.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.description!==e.description||t.kind!==e.kind||t.title!==e.title||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(ka,{toast:e,closeToast:()=>r(e)},e.id))})},kl=new Dq.B7,ku=0;function kc(e){e&&(0,po.createRoot)(e).render((0,hq.jsx)(ks,{subject:kl}))}function kd(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&!(0,DX.A)(t))?setTimeout(()=>{kl.next({...e,id:ku++})},0):console.error("showToast must be called with an object having a 'description' property that is a non-empty string or object")}function kf(e,t=!1){if(t)return!0;let n=kg[e];return!n||!n()}function kp(e,t){let n=kD.getState()?.workspaceGroup,r=n?.name;r&&e===r&&kC(()=>{let r=kN(e);r&&(r.setState({},!0),r.subscribe(()=>{})()),"function"==typeof n?.cleanup&&n.cleanup(),kD.setState(e=>({...e,workspaceGroup:void 0})),"function"==typeof t&&t()},r?e=>e.currentWorkspaceGroup===r:()=>!0)}function kh(e,t){let{name:n,additionalProps:r}=t;fR(n);let o=()=>{kx(e.name,{ignoreChanges:!0,onWorkspaceClose:()=>km(n,r),closeWorkspaceGroup:!1})};kf(e.name)?o():kT("closing-workspace-launching-new-workspace",o,e.title??e.name)}function km(e,t){let n=fR(e),r=kD.getState().workspaceGroup;if(r&&!r.members?.includes(e))return void kp(r.name,()=>{km(e,t)});let o=kD.getState().workspaceGroup?.name,i={...n,title:kR(n,t),closeWorkspace:(t={})=>kx(e,t),closeWorkspaceWithSavedChanges:t=>kx(e,{ignoreChanges:!0,...t}),promptBeforeClosing:t=>{var n,r;return n=e,r=t,void(kg[n]=r)},setTitle:(t,n)=>{i.title=t,i.titleNode=n,kD.setState(t=>{let n=t.openWorkspaces.map(t=>t.name===e?i:t);return{...t,openWorkspaces:n}})},currentWorkspaceGroup:o,additionalProps:t??{}};function a(e,t){kD.setState(n=>{let r=[e,...t??n.openWorkspaces],o=kP(e);return{...n,openWorkspaces:r,workspaceWindowState:o}})}o&&kN(o,t);let s=kD.getState().openWorkspaces,l=s.findIndex(t=>t.name===e),u=s.find(e=>e.type==i.type);if(0===s.length)a(i);else if(s[0].canHide||0===l)if(l>=0){let t=s[l];a({...t,additionalProps:i.additionalProps,...t.title===kR(t,t.additionalProps)&&{title:kR(i,i.additionalProps)}},s.filter(t=>t.name!=e))}else u?(a(u,kD.getState().openWorkspaces.filter(e=>e.type!=i.type)),kh(u,{name:e,additionalProps:t})):a(i);else kh(s[0],{name:e,additionalProps:t})}function ky({targetUrl:e,contextKey:t,workspaceName:n,additionalProps:r}){kS(t),km(n,r),oD({to:e})}let kg={};function kb(e,t){kg[e]=t}function kv(e){return kg[e]}function kw(){let e=kD.getState();kD.setState({...e,prompt:null})}let k_={ignoreChanges:!1,onWorkspaceClose:()=>{},closeWorkspaceGroup:!0};function kx(e,t={}){t={...k_,...t};let n=()=>{let n=kD.getState();n.openWorkspaces.find(t=>t.name===e);let r=n.openWorkspaces.filter(t=>t.name!=e),o=kD.getState().workspaceGroup?.name;o&&t.closeWorkspaceGroup&&kp(o),kg[e]=()=>!1,kD.setState(e=>({...e,prompt:null,openWorkspaces:r,workspaceWindowState:kP(r?.[0])})),t?.onWorkspaceClose?.()};return kf(e,t?.ignoreChanges)?(n(),!0):(kT("closing-workspace",n,fR(e).title??e),!1)}function kS(e){kD.getState().context!=e&&kD.setState({context:e,openWorkspaces:[],prompt:null})}let kE={context:"",openWorkspaces:[],prompt:null,workspaceWindowState:"normal",workspaceGroup:void 0},kD=Z("workspace",kE);function kO(){return kD}function kk(e){let t=kD.getState();kD.setState({...t,workspaceWindowState:e})}function kP(e){return e?.preferredWindowSize??"normal"}function kC(e=()=>{},t=()=>!0){let n=kD.getState().openWorkspaces.filter(t).every(({name:e})=>kf(e)),r=()=>{kA(),e?.()};n?r():kT("closing-all-workspaces",r)}function kj(){let{workspaceWindowState:e,openWorkspaces:t,prompt:n,workspaceGroup:r}=f4(kD);return(0,fZ.useMemo)(()=>({active:t.length>0,prompt:n,workspaceWindowState:e,workspaces:t,workspaceGroup:r}),[t,e,n,r])}function kT(e,t=()=>{},n=""){let r;switch(e){case"closing-workspace":r={title:iV("unsavedChangesTitleText","Unsaved changes"),body:iV("unsavedChangesInOpenedWorkspace","You may have unsaved changes in the opened workspace. Do you want to discard these changes?"),onConfirm:()=>{t?.()},confirmText:iV("discard","Discard")};break;case"closing-all-workspaces":{let e=kD.getState().openWorkspaces.filter(({name:e})=>!kf(e)).map(({title:e},t)=>`${t+1}. ${e}`);r={title:iV("closingAllWorkspacesPromptTitle","You have unsaved changes"),body:iV("closingAllWorkspacesPromptBody","There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",{workspaceNames:e.join(",")}),onConfirm:()=>{t?.()},confirmText:iV("closeAllOpenedWorkspaces","Discard changes in {{count}} workspaces",{count:e.length})};break}case"closing-workspace-launching-new-workspace":r={title:iV("unsavedChangesTitleText","Unsaved changes"),body:iV("unsavedChangesInWorkspace",'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',{workspaceName:n}),onConfirm:()=>{kD.setState(e=>({...e,prompt:null})),t?.()},confirmText:iV("openAnyway","Open anyway")};break;default:console.error(`Workspace system trying to open unknown prompt type "${e}" in function "showWorkspacePrompts"`),t?.();return}kD.setState(e=>({...e,prompt:r}))}function kR(e,t){return t?.workspaceTitle??e.title}function kA(){kD.setState(kE)}function kN(e,t={}){if(!e||"default"===e)return;let n=J(e,{});return t&&n.setState(e=>({...e,...t})),n}let kM="-esm-form-engine__action-menu-button-module__container___F68g0",kI="-esm-form-engine__action-menu-button-module__elementContainer___D1ACn",k$="-esm-form-engine__action-menu-button-module__active___HAE75";function kL({getIcon:e,formOpenInTheBackground:t,tagContent:n}){return(0,hq.jsxs)(hq.Fragment,{children:[e({size:16}),t?(0,hq.jsx)("span",{className:"-esm-form-engine__action-menu-button-module__interruptedTag___CQ2Xs",children:"!"}):(0,hq.jsx)("span",{className:"-esm-form-engine__action-menu-button-module__countTag___3mn9k",children:n})]})}let kF=({getIcon:e,label:t,iconDescription:n,handler:r,type:o,tagContent:i})=>{let a=hd(),{workspaces:s,workspaceWindowState:l}=kj(),u=s?.findIndex(({type:e})=>e===o)??-1,c="hidden"!==l&&0===u,d=u>0||0===u&&"hidden"===l;return"tablet"===a||"phone"===a?(0,hq.jsxs)(h1.$nd,{className:hY()(kM,{[k$]:c}),iconDescription:n,kind:"ghost",onClick:r,role:"button",tabIndex:0,size:"md",children:[(0,hq.jsx)("span",{className:kI,children:(0,hq.jsx)(kL,{formOpenInTheBackground:d,getIcon:e,tagContent:i})}),(0,hq.jsx)("span",{children:t})]}):(0,hq.jsx)(h1.K0,{align:"left","aria-label":n,className:hY()(kM,{[k$]:c}),enterDelayMs:300,kind:"ghost",label:t,onClick:r,size:"md",children:(0,hq.jsx)("div",{className:kI,children:(0,hq.jsx)(kL,{formOpenInTheBackground:d,getIcon:e,tagContent:i})})})},kB=fY().forwardRef(function({children:e,size:t=16,...n},r){return 16===t||"16"===t||"16px"===t?fY().createElement(O_.A,{width:t,height:t,ref:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",...n},eh||(eh=fY().createElement("path",{d:"M2 9L2 10 5.3 10 1 14.3 1.7 15 6 10.7 6 14 7 14 7 9zM14 7L14 6 10.7 6 15 1.7 14.3 1 10 5.3 10 2 9 2 9 7z"})),e):fY().createElement(O_.A,{width:t,height:t,ref:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},em||(em=fY().createElement("path",{d:"M4 18L4 20 10.586 20 2 28.582 3.414 30 12 21.414 12 28 14 28 14 18 4 18zM30 3.416L28.592 2 20 10.586 20 4 18 4 18 14 28 14 28 12 21.414 12 30 3.416z"})),e)});var kV=n(54240),kU=n(68622),kW=/[\\^$.*+?()[\]{}|]/g,kK=RegExp(kW.source);let kz=function(e){return(e=tj(e))&&kK.test(e)?e.replace(kW,"\\$&"):e};function kH({contextKey:e}){let{prompt:t}=kj();return(0,fZ.useEffect)(()=>{RegExp(`/${kz(e)}(/|$)`).test(window.location.pathname)||console.warn(`WorkspaceContainer has provided an invalid context key: "${e}". The context key must be part of the URL path, with no initial or trailing slash.`)},[]),(0,fZ.useEffect)(()=>(kS(e),()=>{kS(null)}),[e]),(0,fZ.useEffect)(()=>{let t=t=>{let{detail:{cancelNavigation:n,newUrl:r}}=t,o=RegExp(`/${kz(e)}(/|$)`),i=new URL(r),a=o.test(i.pathname),s=kD.getState().openWorkspaces.every(({name:e})=>kf(e));a||(s?kA():(n?.(),kC(()=>{oD({to:r})})))};return window.addEventListener("single-spa:before-routing-event",t),()=>{window.removeEventListener("single-spa:before-routing-event",t)}},[]),null!=t?(0,hq.jsxs)(h1.KXP,{open:!0,onClose:kw,children:[(0,hq.jsx)(h1.rQ0,{title:t.title}),(0,hq.jsx)(h1.cwr,{children:(0,hq.jsx)("p",{className:"-esm-form-engine__workspace-notification-module__messageBody___dkytJ",children:t.body})}),(0,hq.jsxs)(h1.jlY,{children:[(0,hq.jsx)(h1.$nd,{kind:"secondary",onClick:kw,children:t.cancelText??iV("cancel")}),(0,hq.jsx)(h1.$nd,{kind:"danger",onClick:t.onConfirm,children:t.confirmText??iV("confirm")})]})]}):null}function kG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kq(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kG(Object(n),!0).forEach(function(t){kY(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kG(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kZ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function kY(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kJ(e){return(kJ=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function kQ(e,t){return(kQ=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function kX(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var k0=function(e){var t=fZ.Component;if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");a.prototype=Object.create(t&&t.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),t&&kQ(a,t);var n,r,o,i=(n=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=kJ(a);e=n?Reflect.construct(t,arguments,kJ(this).constructor):t.apply(this,arguments);if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return kX(this)});function a(e){var t;if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),kY(kX(t=i.call(this,e)),"handleRef",function(e){t.el=e}),kY(kX(t),"addThingToDo",function(e,n){t.state.hasError&&"unmount"!==e||(t.nextThingToDo=(t.nextThingToDo||Promise.resolve()).then(function(){if(!t.unmounted||"unmount"===e)return n.apply(void 0,arguments)}).catch(function(n){throw t.nextThingToDo=Promise.resolve(),t.setState({hasError:!0}),n&&n.message&&(n.message="During '".concat(e,"', parcel threw an error: ").concat(n.message)),t.props.handleError?t.props.handleError(n):setTimeout(function(){throw n}),n}))}),kY(kX(t),"getParcelProps",function(){var e=kq(kq({},t.props),{},{domElement:t.el});return delete e.mountParcel,delete e.config,delete e.wrapWith,delete e.wrapStyle,delete e.appendTo,delete e.handleError,delete e.parcelDidMount,e}),t.state={hasError:!1},!e.config)throw Error("single-spa-react's Parcel component requires the 'config' prop to either be a parcel config or a loading function that returns a promise. See https://github.com/single-spa/single-spa-react");return t}return r=[{key:"componentDidMount",value:function(){var e=this;this.unmounted=!1,this.addThingToDo("mount",function(){var t,n=e.props.mountParcel||e.mountParcel;if(!n)throw Error("\n <Parcel /> was not passed a mountParcel prop, nor is it rendered where mountParcel is within the React context.\n If you are using <Parcel /> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <Parcel /> as a mountParcel prop \n ");return e.el?t=e.el:(e.createdDomElement=t=document.createElement(e.props.wrapWith),Object.keys(e.props.wrapStyle).forEach(function(n){t.style[n]=e.props.wrapStyle[n]}),e.props.appendTo.appendChild(t)),e.parcel=n(e.props.config,kq({domElement:t},e.getParcelProps())),e.parcel.mountPromise.then(e.props.parcelDidMount),e.parcel.mountPromise})}},{key:"componentDidUpdate",value:function(){var e=this;this.addThingToDo("update",function(){if(e.parcel&&e.parcel.update)return e.parcel.update(e.getParcelProps())})}},{key:"componentWillUnmount",value:function(){var e=this;this.addThingToDo("unmount",function(){if(e.parcel&&"MOUNTED"===e.parcel.getStatus())return e.parcel.unmount()}),this.createdDomElement&&this.createdDomElement.parentNode.removeChild(this.createdDomElement),this.unmounted=!0}},{key:"render",value:function(){var e=this;if(this.props.appendTo)return pc&&pc.Consumer?fZ.createElement(pc.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):null;var t=pc&&pc.Consumer?fZ.createElement(pc.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):void 0;return fZ.createElement(this.props.wrapWith,{ref:this.handleRef,style:this.props.wrapStyle,className:this.props.wrapClassName},t)}}],kZ(a.prototype,r),o&&kZ(a,o),a}();kY(k0,"defaultProps",{wrapWith:"div",wrapStyle:{},parcelDidMount:function(){}});function k1({workspace:e,additionalPropsFromPage:t}){let[n,r]=(0,fZ.useState)(),o=function(e){let[t,n]=(0,fZ.useState)({}),[r,o]=(0,fZ.useState)(e);return(0,fZ.useEffect)(()=>{r!==e&&o(e)},[e]),(0,fZ.useEffect)(()=>{let e,t=kN(r);return t&&(n(t.getState()),e=t.subscribe(n)),()=>{t&&e?.()}},[r]),t}(e.currentWorkspaceGroup);(0,fZ.useEffect)(()=>{let t=!0;return e.load().then(e=>{t&&r(e)}),()=>{t=!1}},[e]);let i=(0,fZ.useMemo)(()=>e&&{closeWorkspace:e.closeWorkspace,closeWorkspaceWithSavedChanges:e.closeWorkspaceWithSavedChanges,promptBeforeClosing:e.promptBeforeClosing,setTitle:e.setTitle,...t,...o,...e.additionalProps},[e,t,o]);return n?(0,hq.jsx)(k0,{config:n,mountParcel:fG,...i},e.name):(0,hq.jsx)(h1.OuH,{className:"-esm-form-engine__workspace-module__loader___jEP+q",description:`${iV("loading","Loading")} ...`})}function k2({isWithinWorkspace:e,name:t,actionMenuProps:n={}}){let[r,o]=(0,fZ.useState)(!1),i=(0,fZ.useRef)(window.innerHeight),{featureName:a}=(0,fZ.useContext)(fJ),s=hd();(0,fZ.useEffect)(()=>{let e=()=>{o(!hf(s)&&i.current>window.innerHeight),i.current!=window.innerHeight&&(i.current=window.innerHeight)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[i]);let l=`action-menu-${t&&"default"!=t?t:a}-items-slot`;return(0,hq.jsx)("aside",{className:hY()("-esm-form-engine__action-menu-module__sideRail___iVmKs",{"-esm-form-engine__action-menu-module__withinWorkspace___YZfet":e,"-esm-form-engine__action-menu-module__sideRailHidden___bCdyQ":r,"-esm-form-engine__action-menu-module__sideRailVisible___+oJCY":!r}),children:(0,hq.jsx)("div",{className:"-esm-form-engine__action-menu-module__container___sf6Et",children:(0,hq.jsx)(pr,{className:"-esm-form-engine__action-menu-module__chartExtensions___l+r+Y",name:l,state:n})})})}function k4({contextKey:e,overlay:t,showSiderailAndBottomNav:n,additionalWorkspaceProps:r,actionMenuProps:o}){let i=hd(),{workspaces:a,workspaceWindowState:s,workspaceGroup:l}=kj(),u=l?.name,c=a[0],d="hidden"===s||null==c,f=c?.width??(t?"wider":"narrow"),p=(0,fZ.useMemo)(()=>n||u&&!d,[u,d,n]);return pz(!d&&!hf(i)),(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsxs)("div",{className:n?"-esm-form-engine__workspace-module__workspaceContainerWithActionMenu___kZRyN":"-esm-form-engine__workspace-module__workspaceContainerWithoutActionMenu___1OJIb",children:[(0,hq.jsx)("aside",{className:hY()(t?"-esm-form-engine__workspace-module__workspaceOverlayOuterContainer___8RiIj":"-esm-form-engine__workspace-module__workspaceWindowSpacer___F1W-O",{"-esm-form-engine__workspace-module__hiddenRelative___7oRNR":d,"-esm-form-engine__workspace-module__narrowWorkspace___R3CN9":"narrow"===f,"-esm-form-engine__workspace-module__widerWorkspace___L-pDK":"wider"===f,"-esm-form-engine__workspace-module__extraWideWorkspace___D50Zj":"extra-wide"===f}),children:(0,hq.jsx)("div",{className:hY()("-esm-form-engine__workspace-module__workspaceFixedContainer___9E2Or",{"-esm-form-engine__workspace-module__maximizedWindow___d+PZ5":"maximized"===s,"-esm-form-engine__workspace-module__hiddenFixed___kBFgl":d}),children:a.map((e,t)=>(0,hq.jsx)("div",{className:hY()("-esm-form-engine__workspace-module__workspaceInnerContainer___VEPNB",{"-esm-form-engine__workspace-module__hiddenExtraWorkspace___E7d4h":0!==t}),children:(0,hq.jsx)(fZ.Suspense,{fallback:null,children:(0,hq.jsx)(pb.I18nextProvider,{i18n:window.i18next,defaultNS:e.moduleName,children:(0,hq.jsx)(k3,{workspaceInstance:e,additionalWorkspaceProps:r})})})},`workspace-container-${e?e.name:`empty-${t}`}`))})}),(0,hq.jsx)(kH,{contextKey:e})]}),p&&(0,hq.jsx)(k2,{name:u,isWithinWorkspace:!n,actionMenuProps:o})]})}function k3({workspaceInstance:e,additionalWorkspaceProps:t}){let{t:n}=(0,pb.useTranslation)(),r=hd(),{workspaceWindowState:o,workspaceGroup:i}=kj(),a=i?.name,s="maximized"===o;(0,fZ.useEffect)(()=>{let t=n(e.title);t!==e.title&&e.setTitle(t)},[e.title,n,e.setTitle]);let{featureName:l}=(0,fZ.useContext)(fJ),u=(0,fZ.useCallback)(()=>{kk(s?"normal":"maximized")},[s]),{canHide:c=!1,canMaximize:d=!1,currentWorkspaceGroup:f="",closeWorkspace:p}=(0,fZ.useMemo)(()=>e??{},[e]),h=(0,fZ.useMemo)(()=>({...t,...e?.additionalProps}),[t,e]);return e&&(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsxs)(h1.Y9Y,{"aria-label":iV("workspaceHeader","Workspace Header"),className:"-esm-form-engine__workspace-module__header___nMH1R",children:[!hf(r)&&!c&&(0,hq.jsx)(h1.dJ2,{"aria-label":iV("close","Close"),renderMenuIcon:(0,hq.jsx)(ms,{}),onClick:()=>p()}),(0,hq.jsx)(h1.bCw,{prefix:"",children:e.titleNode??n(e.title)}),(0,hq.jsx)("div",{className:"-esm-form-engine__workspace-module__overlayHeaderSpacer___vxoMd"}),(0,hq.jsxs)(h1.wdv,{className:"-esm-form-engine__workspace-module__headerButtons___lek95",children:[(0,hq.jsx)(pr,{name:`workspace-header-group-${e.currentWorkspaceGroup}-slot`,state:h}),(0,hq.jsx)(pr,{name:`workspace-header-type-${e.type}-slot`,state:h}),(0,hq.jsx)(pr,{name:`workspace-header-${l}-slot`,state:h}),hf(r)&&(0,hq.jsxs)(hq.Fragment,{children:[(d||s)&&(0,hq.jsx)(h1.V8d,{"aria-label":s?iV("minimize","Minimize"):iV("maximize","Maximize"),onClick:u,children:s?(0,hq.jsx)(kB,{}):(0,hq.jsx)(kV.hz,{})}),c&&!a?(0,hq.jsx)(h1.V8d,{"aria-label":iV("hide","Hide"),onClick:()=>kk("hidden"),children:(0,hq.jsx)(ml,{})}):(0,hq.jsx)(h1.V8d,{"aria-label":iV("close","Close"),onClick:()=>p?.(),children:(0,hq.jsx)(mO,{})})]}),"tablet"===r&&c&&(0,hq.jsx)(h1.V8d,{"aria-label":iV("close","Close"),onClick:()=>p?.(),children:(0,hq.jsx)(kU.d3,{})})]})]}),(0,hq.jsx)("div",{className:hY()("-esm-form-engine__workspace-module__workspaceContent___FFe+u",{"-esm-form-engine__workspace-module__marginWorkspaceContent___SEV31":!!f}),children:(0,hq.jsx)(k1,{workspace:e,additionalPropsFromPage:t},e.name)})]})}var k6=new Uint8Array(16);let k5=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var k7=[],k9=0;k9<256;++k9)k7.push((k9+256).toString(16).substr(1));let k8=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(k7[e[t+0]]+k7[e[t+1]]+k7[e[t+2]]+k7[e[t+3]]+"-"+k7[e[t+4]]+k7[e[t+5]]+"-"+k7[e[t+6]]+k7[e[t+7]]+"-"+k7[e[t+8]]+k7[e[t+9]]+"-"+k7[e[t+10]]+k7[e[t+11]]+k7[e[t+12]]+k7[e[t+13]]+k7[e[t+14]]+k7[e[t+15]]).toLowerCase();if(!("string"==typeof n&&k5.test(n)))throw TypeError("Stringified UUID is invalid");return n},Pe=function(e,t,n){var r=(e=e||{}).random||(e.rng||function(){if(!ey&&!(ey="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"u">typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ey(k6)})();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return k8(r)};async function Pt(e,t){let{openedGroup:n}=fN.getState();if(n){if(n.groupName===e&&Po(n.props,t))return!0;else if(!await Pi({reason:"CLOSE_WORKSPACE_GROUP",explicit:!1}))return!1}return fN.setState(n=>({...n,openedGroup:{groupName:e,props:t},openedWindows:[]})),!0}async function Pn(e){let{openedGroup:t,openedWindows:n}=fN.getState();if(t){if(n.length>0&&!(e||await Pi({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})))return!1;fN.setState(e=>({...e,openedGroup:null,openedWindows:[]}))}return!0}async function Pr(e,t=null,n=null,r=null){let o=fN.getState();if(!o.registeredWorkspacesByName[e])throw Error(`Unable to launch workspace ${e}. Workspace is not registered`);let i=fM(e);if(!i)throw Error(`Unable to launch workspace ${e}. Workspace is not registered to a workspace window`);let{openedGroup:a}=o,{name:s}=i,l=fI(s);if(!l)throw Error(`Unable to launch workspace ${e}. Workspace window ${i.name} is not registered to a workspace group`);let u=f$(e);if(a&&(a.groupName!==l.name||!Po(a.props,r)))return!!await Pi({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})&&(fN.setState({...o,openedGroup:{groupName:l.name,props:r},openedWindows:[{windowName:s,openedWorkspaces:[Pc(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0);if(u>=0){let r=o.openedWindows[u],i=o.openedGroup?.props??{},a=o.isMostRecentlyOpenedWindowHidden,{openedWorkspaces:c}=r;if(Po(r.props,n)){let d=c.find(t=>t.workspaceName===e);return d&&Po(d.props,t)?((a||u!==o.openedWindows.length-1)&&fN.setState(Pa.restoreWindow(o,s)),!0):!!await Pi({reason:"CLOSE_WORKSPACE",explicit:!1,windowName:s,workspaceName:e})&&(fN.setState({...o,openedGroup:{groupName:l.name,props:o?.openedGroup?.props??i},openedWindows:[...o.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[Pc(e,t)],props:r?.props??n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return!!await Pi({reason:"CLOSE_WINDOW",explicit:!1,windowName:s})&&(fN.setState({...o,openedGroup:{groupName:l.name,props:i??o?.openedGroup?.props},openedWindows:[...o.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[Pc(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return"closable"!=l.persistence?(fN.setState({...o,openedGroup:{groupName:l.name,props:r??o?.openedGroup?.props??null},openedWindows:[...o.openedWindows,{windowName:s,openedWorkspaces:[Pc(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0):!!await Pi({reason:"CLOSE_OTHER_WINDOWS",explicit:!1,windowNameToSpare:i.name})&&(fN.setState({...o,openedGroup:{groupName:l.name,props:r??o?.openedGroup?.props??null},openedWindows:[{windowName:s,openedWorkspaces:[Pc(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}function Po(e,t){return null==e||null==t||F(e,t)}function Pi(e){function t(e,t){let n=[];for(let r=e.openedWorkspaces.length-1;r>=0;r--){let o=e.openedWorkspaces[r];if(o.hasUnsavedChanges&&n.push(o),t&&o.workspaceName===t)break}return n}let{openedWindows:n,workspaceTitleByWorkspaceName:r}=fN.getState(),o=[];switch(e.reason){case"CLOSE_WORKSPACE_GROUP":o=n.flatMap(e=>t(e));break;case"CLOSE_WINDOW":{let r=n.find(t=>t.windowName===e.windowName);if(!r)throw Error(`Window ${e.windowName} not found in opened windows.`);o=t(r);break}case"CLOSE_WORKSPACE":{let r=n.find(t=>t.windowName===e.windowName);if(!r)throw Error(`Window ${e.windowName} not found in opened windows.`);o=t(r,e.workspaceName);break}case"CLOSE_OTHER_WINDOWS":o=n.filter(t=>t.windowName!==e.windowNameToSpare).flatMap(e=>t(e))}return 0===o.length?Promise.resolve(!0):new Promise(e=>{let t=DG("workspace2-close-prompt",{size:"sm",onConfirm:()=>{t(),e(!0)},onCancel:()=>{t(),e(!1)},affectedWorkspaceTitles:o.map(e=>r[e.workspaceName])})})}let Pa={setWindowMaximized(e,t,n){let r=e.openedWindows.findIndex(e=>e.windowName===t),o=[...e.openedWindows],i={...o[r],maximized:n};return o[r]=i,{...e,openedWindows:o}},hideWindow:e=>({...e,isMostRecentlyOpenedWindowHidden:!0}),restoreWindow(e,t){let n=e.openedWindows.findIndex(e=>e.windowName===t),r=e.openedWindows[n],o=[...e.openedWindows.filter((e,t)=>t!==n),r];return{...e,openedWindows:o,isMostRecentlyOpenedWindowHidden:!1}},closeWorkspace(e,t){let n=f$(t);if(n<0)return e;let r={...e.openedWindows[n]},o=r.openedWorkspaces.findIndex(e=>e.workspaceName===t),i=[...e.openedWindows];r.openedWorkspaces=r.openedWorkspaces.slice(0,o);let a=e.isMostRecentlyOpenedWindowHidden;if(0===r.openedWorkspaces.length){let t=n===e.openedWindows.length-1;i.splice(n,1),t&&i.length>0&&(a=!1)}else i[n]=r;return{...e,openedWindows:i,isMostRecentlyOpenedWindowHidden:a}},openChildWorkspace(e,t,n,r){let o=e.registeredWorkspacesByName[n];if(!o)throw Error(`No workspace named "${n}" registered`);let i=e.registeredWorkspacesByName[t];if(!i)throw Error(`No workspace named "${t}" registered`);if(i.window!==o.window)throw Error(`Child workspace ${n} does not belong to the same workspace window as parent workspace ${t}`);let a=e.openedWindows.findIndex(e=>e.windowName===o.window);if(-1==a)throw Error(`Cannot open child workspace ${n} as window ${o.window} is not opened`);let{openedWorkspaces:s}=e.openedWindows[a],l=s.findIndex(e=>e.workspaceName===t);if(-1===l)throw Error(`Cannot open child workspace ${n} from parent workspace ${t} as the parent is not opened within the workspace window`);let u=s.slice(0,l+1);return{openedWindows:e.openedWindows.map((e,t)=>t==a?{...e,openedWorkspaces:[...u,Pc(n,r)]}:e)}},setHasUnsavedChanges(e,t,n){let r=f$(t);if(r<0)return e;let o={...e.openedWindows[r]},i=o.openedWorkspaces.findIndex(e=>e.workspaceName===t);if(i<0)return e;o.openedWorkspaces[i]={...o.openedWorkspaces[i],hasUnsavedChanges:n};let a=[...e.openedWindows];return a[r]=o,{...e,openedWindows:a}},setWorkspaceTitle(e,t,n){let r={...e.workspaceTitleByWorkspaceName};return null===n?delete r[t]:r[t]=n,{...e,workspaceTitleByWorkspaceName:r}}};function Ps(){return f3(fN,Pa)}let Pl=()=>(0,fZ.useContext)(pc),Pu=()=>Object.keys(fN.getState().registeredWorkspacesByName);function Pc(e,t){return{workspaceName:e,props:t??{},hasUnsavedChanges:!1,uuid:Pe()}}let Pd={workspaceOuterContainer:"-esm-form-engine__workspace2-module__workspaceOuterContainer___jaqGm",narrowWorkspace:"-esm-form-engine__workspace2-module__narrowWorkspace___o1wsL",widerWorkspace:"-esm-form-engine__workspace2-module__widerWorkspace___gdEOi",extraWideWorkspace:"-esm-form-engine__workspace2-module__extraWideWorkspace___U9xlJ",workspaceMiddleContainer:"-esm-form-engine__workspace2-module__workspaceMiddleContainer___0AdtX",maximized:"-esm-form-engine__workspace2-module__maximized___aKCbE",hidden:"-esm-form-engine__workspace2-module__hidden___n1US5",workspaceInnerContainer:"-esm-form-engine__workspace2-module__workspaceInnerContainer___1g+qk",workspaceSpacer:"-esm-form-engine__workspace2-module__workspaceSpacer___P2T9y",loader:"-esm-form-engine__workspace2-module__loader___fCfzZ",hiddenExtraWorkspace:"-esm-form-engine__workspace2-module__hiddenExtraWorkspace___hvPSi",header:"-esm-form-engine__workspace2-module__header___MXXx9",headerButtons:"-esm-form-engine__workspace2-module__headerButtons___sJdnC",workspaceContent:"-esm-form-engine__workspace2-module__workspaceContent___6NuXT",overlayHeaderSpacer:"-esm-form-engine__workspace2-module__overlayHeaderSpacer___PLO6T",isActionMenuOpened:"-esm-form-engine__workspace2-module__isActionMenuOpened___X3Vj6",showActionMenu:"-esm-form-engine__workspace2-module__showActionMenu___HSun1",marginWorkspaceContent:"-esm-form-engine__workspace2-module__marginWorkspaceContent___DCfWz",workspaceContainerWithActionMenu:"-esm-form-engine__workspace2-module__workspaceContainerWithActionMenu___G9MdI",workspaceFixedContainer:"-esm-form-engine__workspace2-module__workspaceFixedContainer___uIldI",workspaceContainerWithoutActionMenu:"-esm-form-engine__workspace2-module__workspaceContainerWithoutActionMenu___lBudZ"},Pf=({title:e,children:t,hasUnsavedChanges:n=!1})=>{let r=hd(),{setWindowMaximized:o,hideWindow:i,setHasUnsavedChanges:a,openedWindows:s,openedGroup:l,registeredGroupsByName:u,registeredWindowsByName:c,registeredWorkspacesByName:d,workspaceTitleByWorkspaceName:f,setWorkspaceTitle:p,isMostRecentlyOpenedWindowHidden:h}=Ps(),{workspaceName:m,isRootWorkspace:y,closeWorkspace:g,showActionMenu:b}=Pl(),v=f$(m),w=s[v],x=w?.openedWorkspaces.find(e=>e.workspaceName===m);if((0,fZ.useEffect)(()=>{x?.hasUnsavedChanges!=n&&a(m,n??!1)},[x?.hasUnsavedChanges,n,m,a]),(0,fZ.useEffect)(()=>{f[m]!==e&&p(m,e)},[f,m,e,p]),v<0||null==l||null==x)return null;let S=u[l.groupName];if(!S)throw Error(`Cannot find registered workspace group ${l.groupName}`);let E=d[m].window,D=c[E];if(!D)throw Error(`Cannot find registered workspace window ${E}`);let{icon:O,canMaximize:k}=D,P="closable"===S.persistence,C=!!O&&!P,{maximized:j}=w,T=D?.width??"narrow",R=Object.values(c).some(e=>e.group===l.groupName&&void 0!==e.icon),A=v<s.length-1||h;return(0,hq.jsxs)("div",{className:hY()(Pd.workspaceOuterContainer,{[Pd.narrowWorkspace]:"narrow"===T,[Pd.widerWorkspace]:"wider"===T,[Pd.extraWideWorkspace]:"extra-wide"===T,[Pd.isActionMenuOpened]:R}),children:[(0,hq.jsx)("div",{className:hY()(Pd.workspaceSpacer,{[Pd.hidden]:A})}),(0,hq.jsx)("div",{className:hY()(Pd.workspaceMiddleContainer,{[Pd.maximized]:j,[Pd.hidden]:A,[Pd.isRootWorkspace]:y,[Pd.showActionMenu]:b}),children:(0,hq.jsxs)("div",{className:hY()(Pd.workspaceInnerContainer,{[Pd.maximized]:j,[Pd.hidden]:A,[Pd.isRootWorkspace]:y}),children:[(0,hq.jsxs)(h1.Y9Y,{"aria-label":iV("workspaceHeader"),className:Pd.header,children:[(0,hq.jsx)(h1.bCw,{prefix:"",children:e}),(0,hq.jsx)("div",{className:Pd.overlayHeaderSpacer}),(0,hq.jsx)(h1.wdv,{className:Pd.headerButtons,children:hf(r)?(0,hq.jsxs)(hq.Fragment,{children:[(k||j)&&(0,hq.jsx)(h1.V8d,{"aria-label":j?iV("minimize"):iV("maximize"),onClick:()=>o(E,!j),children:j?(0,hq.jsx)(kB,{}):(0,hq.jsx)(kV.hz,{})}),C&&(0,hq.jsx)(h1.V8d,{"aria-label":iV("hide"),onClick:()=>i(),children:(0,hq.jsx)(ml,{})}),!P&&(0,hq.jsx)(h1.V8d,{"aria-label":iV("close"),onClick:()=>g({closeWindow:!0}),children:(0,hq.jsx)(mO,{})})]}):(0,hq.jsxs)(hq.Fragment,{children:[C&&(0,hq.jsx)(h1.V8d,{"aria-label":iV("hide"),onClick:()=>i(),children:(0,hq.jsx)(kU.d3,{})}),(0,hq.jsx)(h1.V8d,{"aria-label":iV("close"),onClick:()=>{P?Pn():g({closeWindow:!0})},children:(0,hq.jsx)(mO,{})})]})})]}),(0,hq.jsx)("div",{className:hY()(Pd.workspaceContent),children:t})]})})]})},Pp="-esm-form-engine__action-menu-button2-module__container___pahg-",Ph="-esm-form-engine__action-menu-button2-module__elementContainer___PzOdc",Pm="-esm-form-engine__action-menu-button2-module__active___4O4Bs",Py="-esm-form-engine__action-menu-button2-module__focused___+k5kD";function Pg({getIcon:e,hasUnsavedChanges:t,tagContent:n}){return(0,hq.jsxs)(hq.Fragment,{children:[e({size:16}),t?(0,hq.jsx)("span",{className:"-esm-form-engine__action-menu-button2-module__interruptedTag___mS2yr",children:"!"}):(0,hq.jsx)("span",{className:"-esm-form-engine__action-menu-button2-module__countTag___rb5CW",children:n})]})}let Pb=({icon:e,label:t,tagContent:n,workspaceToLaunch:r,onBeforeWorkspaceLaunch:o})=>{let i=hd(),{openedWindows:a,restoreWindow:s,hideWindow:l,isMostRecentlyOpenedWindowHidden:u}=Ps(),{extension:c}=(0,fZ.useContext)(fJ),d=a.findIndex(e=>e.windowName===c?.extensionId),f=a[d],p=null!=f,h=p&&(d<a.length-1||u),m=p&&!h,y=f?.openedWorkspaces.some(e=>e.hasUnsavedChanges)??!1,g=async()=>{if(p)h?s(f.windowName):l();else if(await (o?.()??!0)){let{workspaceName:e,workspaceProps:t,windowProps:n}=r;Pr(e,t,n)}};return"tablet"===i||"phone"===i?(0,hq.jsxs)(h1.$nd,{className:hY()(Pp,{[Pm]:p&&!m,[Py]:m}),iconDescription:t,kind:"ghost",onClick:g,role:"button",tabIndex:0,size:"md",children:[(0,hq.jsx)("span",{className:Ph,children:(0,hq.jsx)(Pg,{hasUnsavedChanges:y,getIcon:e,tagContent:n})}),(0,hq.jsx)("span",{children:t})]}):(0,hq.jsx)(h1.K0,{align:"left","aria-label":t,className:hY()(Pp,{[Pm]:p&&!m,[Py]:m}),enterDelayMs:300,kind:"ghost",label:t,onClick:g,size:"md",children:(0,hq.jsx)("div",{className:Ph,children:(0,hq.jsx)(Pg,{hasUnsavedChanges:y,getIcon:e,tagContent:n})})})};function Pv({showContactDetails:e,toggleContactDetails:t,className:n}){return(0,hq.jsx)(h1.$nd,{className:n,iconDescription:"Toggle contact details",kind:"ghost",onClick:t,renderIcon:e?mD:mx,children:e?iV("showLess","Show less"):iV("showMore","Show more")})}let Pw={contactDetails:"-esm-form-engine__patient-banner-contact-details-module__contactDetails___rhdjA",deceased:"-esm-form-engine__patient-banner-contact-details-module__deceased___K4NPg",heading:"-esm-form-engine__patient-banner-contact-details-module__heading___zj6Zt",row:"-esm-form-engine__patient-banner-contact-details-module__row___+Bx+P",col:"-esm-form-engine__patient-banner-contact-details-module__col___0H31P",relationship:"-esm-form-engine__patient-banner-contact-details-module__relationship___CZmay"},P_=({patientUuid:e})=>{let{cohorts:t=[],isLoading:n}=function(e){let t=e?`${oM}/cohortm/cohortmember?patient=${e}&v=custom:(uuid,patient:ref,cohort:(uuid,name,startDate,endDate))`:null,{data:n,isLoading:r}=pw()(t,oF),o=n?.data?.results.map(e=>({uuid:e.cohort.uuid,name:e.cohort.name,startDate:e.cohort.startDate,endDate:e.cohort.endDate}));return(0,fZ.useMemo)(()=>({cohorts:o,isLoading:r}),[r,o])}(e);return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsxs)("p",{className:Pw.heading,children:[iV("patientLists","Patient Lists")," (",t?.length??0,")"]}),n?(0,hq.jsx)(h1.OuH,{description:`${iV("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsxs)("ul",{children:[(()=>{if(t?.length>0){let e=t.sort((e,t)=>EI(e?.startDate).getTime()-EI(t?.startDate).getTime()).slice(0,3);return e?.map(e=>(0,hq.jsx)("li",{children:(0,hq.jsx)(fQ,{to:`${window.spaBase}/home/patient-lists/${e.uuid}`,children:e.name},e.uuid)},e.uuid))}return(0,hq.jsx)("li",{children:"--"})})(),t.length>3&&(0,hq.jsx)("li",{className:Pw.link,children:(0,hq.jsx)(fQ,{to:`${window.spaBase}/home/patient-lists`,children:iV("seeMoreLists","See {{count}} more lists",{count:t?.length-3})})})]})]})},Px=({patientId:e})=>{let{patient:t,isLoading:n}=hx(e),r=t?.address?.find(e=>"home"===e.use),o=e=>e.split("#")[1];return n?(0,hq.jsx)(h1.OuH,{description:`${iV("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("p",{className:Pw.heading,children:iV("address","Address")}),(0,hq.jsx)("ul",{children:r?Object.entries(r).filter(([e])=>"id"!==e&&"use"!==e).map(([e,t])=>"extension"===e?r.extension?.[0]?.extension?.map((t,n)=>(0,hq.jsxs)("li",{children:[iV(o(t.url),o(t.url)),": ",t.valueString]},`address-${e}-${n}`)):(0,hq.jsxs)("li",{children:[iV(e,e),": ",t]},`address-${e}`)):(0,hq.jsx)("li",{children:"--"})})]})},PS=({patientUuid:e})=>{let{isLoading:t,contactAttributes:n}=(e=>{let{contactAttributeTypes:t=[]}=pq({externalModuleName:"@openmrs/esm-patient-banner-app"}),{attributes:n,error:r,isLoading:o}=(e=>{let{data:t,error:n,isLoading:r}=pX()(`${oM}/patient/${e}?v=custom:(uuid,display,identifiers:(identifier,uuid,preferred,location:(uuid,name),identifierType:(uuid,name,format,formatDescription,validator)),person:(uuid,display,gender,birthdate,dead,age,deathDate,birthdateEstimated,causeOfDeath,preferredName:(uuid,preferred,givenName,middleName,familyName),attributes,preferredAddress:(uuid,preferred,address1,address2,cityVillage,longitude,stateProvince,latitude,country,postalCode,countyDistrict,address3,address4,address5,address6,address7)))`,oF);return{isLoading:r,attributes:t?.data.person.attributes??[],error:n}})(e);return{contactAttributes:(0,fZ.useMemo)(()=>n.filter(({attributeType:e})=>t?.some(t=>e.uuid===t)),[n,t]),isLoading:o,error:r}})(e),r=(0,fZ.useMemo)(()=>n?[...n?.map(e=>[e.attributeType.display?iV(e.attributeType.display,e.attributeType.display):"",e.value])]:[],[n]);return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("p",{className:Pw.heading,children:iV("contactDetails","Contact Details")}),t?(0,hq.jsx)(h1.OuH,{description:`${iV("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsx)("ul",{children:r.length?r.map(([e,t],n)=>(0,hq.jsxs)("li",{children:[e,": ",t]},`${e}-${t}-${n}`)):(0,hq.jsx)("li",{children:"--"})})]})},PE=({patientId:e})=>{let{data:t,isLoading:n}=function(e){let t=`${oM}/relationship?v=custom:(display,uuid,personA:(age,display,birthdate,uuid),personB:(age,display,birthdate,uuid),relationshipType:(uuid,display,description,aIsToB,bIsToA))&person=${e}`,{data:n,error:r,isLoading:o,isValidating:i}=pw()(e?t:null,oF),a=n?.data?.results?.length?function(e,t){let n=[];for(let r of t)e===r.personA.uuid?n.push({uuid:`${r.uuid}`,display:r.personB.display,relativeAge:r.personB.age,relativeUuid:r.personB.uuid,relationshipType:r.relationshipType.bIsToA}):n.push({uuid:`${r.uuid}`,display:r.personA.display,relativeAge:r.personA.age,relativeUuid:r.personA.uuid,relationshipType:r.relationshipType.aIsToB});return n}(e,n.data.results):null;return{data:n?a:null,error:r,isLoading:o,isValidating:i}}(e);return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("p",{className:Pw.heading,children:iV("relationships","Relationships")}),n?(0,hq.jsx)(h1.OuH,{description:`${iV("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsx)("ul",{children:t&&t.length>0?(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsxs)("li",{className:Pw.relationship,children:[(0,hq.jsx)("div",{children:(0,hq.jsx)(fQ,{to:`${window.spaBase}/patient/${e.relativeUuid}/chart`,children:e.display})}),(0,hq.jsx)("div",{children:e.relationshipType}),(0,hq.jsx)("div",{children:`${e.relativeAge?e.relativeAge:"--"} ${e.relativeAge?1===e.relativeAge?iV("yearAbbreviation","yr"):iV("yearsAbbreviation","yrs"):""}`})]},e.uuid))}):(0,hq.jsx)("li",{children:"--"})})]})};function PD({patientId:e,deceased:t}){return(0,hq.jsxs)("div",{className:hY()(Pw.contactDetails,{[Pw.deceased]:t}),children:[(0,hq.jsxs)("div",{className:Pw.row,children:[(0,hq.jsx)("div",{className:Pw.col,children:(0,hq.jsx)(Px,{patientId:e})}),(0,hq.jsx)("div",{className:Pw.col,children:(0,hq.jsx)(PS,{patientUuid:e})})]}),(0,hq.jsxs)("div",{className:Pw.row,children:[(0,hq.jsx)("div",{className:Pw.col,children:(0,hq.jsx)(PE,{patientId:e})}),(0,hq.jsx)("div",{className:Pw.col,children:(0,hq.jsx)(P_,{patientUuid:e})})]})]})}function PO(e){let t=document.querySelector("template#loading-spinner");if(t){let n=t.content.cloneNode(!0),r=Array.prototype.map.call(n.childNodes,e=>e);return e.appendChild(n),()=>r.forEach(e=>e.remove())}return()=>{}}let Pk="-esm-form-engine__action-menu2-module__container___5s3CM";function PP({workspaceGroup:e,groupProps:t}){let n=hd(),{persistence:r}=e;return(0,hq.jsx)("aside",{className:"-esm-form-engine__action-menu2-module__sideRail___qwAz4",children:(0,hq.jsxs)("div",{className:Pk,children:["closable"==r&&hf(n)&&(0,hq.jsx)(h1.K0,{align:"left",onClick:()=>Pn(),label:iV("close"),kind:"ghost",children:(0,hq.jsx)(mO,{})}),(0,hq.jsx)(fJ.Provider,{value:{moduleName:e.moduleName,featureName:e.name},children:(0,hq.jsx)(pr,{className:Pk,name:e.name,state:{groupProps:t}})})]})})}function PC(e){let t=new URL(e,window.location.origin).pathname,n=new URL(window.getOpenmrsSpaBase?.()??"/",window.location.origin).pathname,r=n.endsWith("/")?n.slice(0,-1):n,o=null;return r?r===t?o="/":t.startsWith(`${r}/`)&&(o=t.slice(r.length)):o=t,{full:t,spaRelative:o}}let Pj=({lifeCycle:e,openedWorkspace:t,openedWindow:n,isRootWorkspace:r,isLeafWorkspace:o,showActionMenu:i})=>{let{openedGroup:a,closeWorkspace:s,openChildWorkspace:l}=Ps(),u=(0,fZ.useMemo)(()=>t&&{closeWorkspace:async(e={})=>{let{closeWindow:r=!1,discardUnsavedChanges:o=!1}=e;return r?!!(o||await Pi({reason:"CLOSE_WINDOW",explicit:!0,windowName:n.windowName}))&&(s(n.openedWorkspaces[0].workspaceName),!0):!!(o||await Pi({reason:"CLOSE_WORKSPACE",explicit:!0,windowName:n.windowName,workspaceName:t.workspaceName}))&&(s(t.workspaceName),!0)},launchChildWorkspace:async(e,r)=>{let o=t.workspaceName,{openedWorkspaces:i}=n,a=i.findIndex(e=>e.workspaceName===o);-1===a||a!==i.length-1&&i.slice(a+1).some(e=>e.hasUnsavedChanges)&&!await Pi({reason:"CLOSE_WORKSPACE",explicit:!0,windowName:n.windowName,workspaceName:i[a+1].workspaceName})||l(o,e,r||{})},workspaceName:t.workspaceName,workspaceProps:t.props,windowProps:n.props,groupProps:a&&a.props?a.props:null,isRootWorkspace:r,isLeafWorkspace:o,windowName:n.windowName,showActionMenu:i},[t,s,a,n]);if(!e){let{registeredWorkspacesByName:e}=fN.getState(),n=e[t.workspaceName],o=n&&n.window?n.window:void 0,{registeredWindowsByName:s}=fN.getState(),l=o?s[o]:void 0,u=l&&l.width?l.width:"narrow",c=Object.values(s).some(e=>e.group===a?.groupName&&void 0!==e.icon);return(0,hq.jsxs)("div",{className:hY()(Pd.workspaceOuterContainer,{[Pd.narrowWorkspace]:"narrow"===u,[Pd.widerWorkspace]:"wider"===u,[Pd.extraWideWorkspace]:"extra-wide"===u,[Pd.isActionMenuOpened]:c}),children:[(0,hq.jsx)("div",{className:Pd.workspaceSpacer}),(0,hq.jsx)("div",{className:hY()(Pd.workspaceMiddleContainer,{[Pd.isRootWorkspace]:r,[Pd.showActionMenu]:i}),children:(0,hq.jsx)("div",{className:hY()(Pd.workspaceInnerContainer,{[Pd.isRootWorkspace]:r}),children:(0,hq.jsx)(h1.OuH,{className:Pd.loader,description:`${iV("loading")} ...`})})})]})}return(0,hq.jsx)(k0,{config:e,mountParcel:fG,...u},t.workspaceName)},PT=({openedWindow:e,showActionMenu:t})=>{let{openedWorkspaces:n}=e,[r,o]=(0,fZ.useState)({}),{registeredWorkspacesByName:i}=fN.getState();return(0,fZ.useEffect)(()=>{let e=!1;return Promise.all(n.map(async e=>{let{moduleName:t,component:n}=i[e.workspaceName];return[e.uuid,await h$(t,n)]})).then(t=>{e||o(Object.fromEntries(t))}),()=>{e=!0}},[n]),(0,hq.jsx)(hq.Fragment,{children:n.map((o,i)=>(0,hq.jsx)(Pj,{openedWorkspace:o,openedWindow:e,lifeCycle:r[o.uuid],isRootWorkspace:0===i,isLeafWorkspace:i===n.length-1,showActionMenu:t},o.uuid))})};function PR(e){e&&(0,po.createRoot)(e).render((0,hq.jsx)(PA,{}))}function PA(){let{openedGroup:e,openedWindows:t,registeredGroupsByName:n,registeredWindowsByName:r}=Ps();if((0,fZ.useEffect)(()=>cV("before-page-changed",t=>{let{newPage:r,cancelNavigation:o,oldUrl:i,newUrl:a}=t;if(!e)return;if(r)return void o(Pn().then(e=>!e));let s=n[e.groupName],l=s?.scopePattern;l&&function(e,t,n){try{let r=new RegExp(e),o=PC(t),i=PC(n);if(null===o.spaRelative||null===i.spaRelative)return!0;let a=r.exec(o.spaRelative),s=r.exec(i.spaRelative);if(a&&s||(a=r.exec(o.full),s=r.exec(i.full)),!a||!s)return!0;if(a.length>1)return!a.slice(1).every((e,t)=>e===s[t+1]);return!1}catch{return!0}}(l,i,a)&&o(Pn().then(e=>!e))}),[e,n]),!e)return null;let o=n[e.groupName],i=t.some(e=>e.maximized),{name:a}=o,s=Object.values(r).filter(e=>e.group===a&&void 0!==e.icon).sort((e,t)=>(e.order??Number.MAX_VALUE)-(t.order??Number.MAX_VALUE)).length>0;return(0,hq.jsxs)("div",{className:hY()("-esm-form-engine__workspace-windows-and-menu-module__workspaceWindowsAndMenuContainer___gN2f4",{"-esm-form-engine__workspace-windows-and-menu-module__overlay___fqI+X":o.overlay,"-esm-form-engine__workspace-windows-and-menu-module__hasMaximizedWindow___J7wBw":i}),children:[(0,hq.jsx)("div",{className:"-esm-form-engine__workspace-windows-and-menu-module__workspaceWindowsContainer___zpk7G",children:t.map(e=>(0,hq.jsx)(PT,{openedWindow:e,showActionMenu:s},e.windowName))}),s&&(0,hq.jsx)(PP,{workspaceGroup:o,groupProps:e.props})]})}function PN(e,t,n){if(null==e)return n;let r=S7(e);if(!r)return console.warn(`matchLocale: invalid requested locale tag: ${JSON.stringify(e)}`),n;let o=[];for(let e of t){let t=S7(e);if(!t){console.warn(`matchLocale: skipping invalid available locale tag: ${JSON.stringify(e)}`);continue}o.push({canonical:t,original:e})}let i=r;for(;i;){let e=o.find(e=>e.canonical===i);if(e)return e.original;let t=i+"-",n=o.find(e=>e.canonical.startsWith(t));if(n)return n.original;if("ht"===i){i="fr-HT";continue}let r=i.lastIndexOf("-");if(-1===r)break;let a=(i=i.slice(0,r)).lastIndexOf("-");-1!==a&&i.length-a==2&&(i=i.slice(0,a))}return n}function PM(e=window.localStorage){try{return e.getItem("test"),!0}catch{return!1}}function PI(e){return!!e&&e.constructor===Object}var P$=n(2722);function PL(e){let[t,n,r]=e.split(".");return`${t}.${n}.${r}`}function PF(e,t){let n=function(e){let t=e.indexOf("-");if(t>=0){let n=PL(e.slice(0,t)),r=e.slice(t+1);return`${n}-${r}`}return PL(e)}(t);return P$.satisfies(n,e,{includePrerelease:!0})}async function PB(e,t={}){let n,{shouldRetry:r,getDelay:o,onError:i}=t;r=r??(e=>e<=5),o=o??(e=>(function(e,t=!1){return 1e3*Math.pow(2,t?e+1:e)})(e));let a=0;do try{return await PV(o(a)),await e()}catch(e){i?.(e,a),n=e}while(r(a++));throw n}async function PV(e){if(!(e<=0))return new Promise(t=>setTimeout(t,e))}}}]);
43
+ }`.trim(),document.head.prepend(r),i=HTMLElement.prototype.focus,HTMLElement.prototype.focus=function(e){let t=((e=document)=>e.activeElement)(),n=null!=t&&SS(t);i.call(this,{...e,preventScroll:!0}),e&&e.preventScroll||Sk(this,n)},a=yK(SP(document,"touchstart",t=>{let r=gw(t);e=wk(r)?r:wC(r,!0),n=!1;let o=r.ownerDocument.defaultView.getSelection();o&&!o.isCollapsed&&o.containsNode(r,!0)&&(n=!0),t.composedPath().some(e=>e instanceof HTMLInputElement&&"range"===e.type)&&(n=!0),"selectionStart"in r&&"selectionEnd"in r&&r.selectionStart<r.selectionEnd&&r.ownerDocument.activeElement===r&&(n=!0)},{passive:!1,capture:!0}),SP(document,"touchmove",t=>{if(2!==t.touches.length&&!n){if(!e||e===document.documentElement||e===document.body)return void t.preventDefault();e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&t.preventDefault()}},{passive:!1,capture:!0}),SP(document,"blur",e=>{let t=gw(e),n=e.relatedTarget;if(n&&SS(n))n.focus({preventScroll:!0}),Sk(n,SS(t));else if(!n){let e=t.parentElement?.closest("[tabindex]");e?.focus({preventScroll:!0})}},!0)),()=>{t(),a(),r.remove(),HTMLElement.prototype.focus=i}):yK((s=window.innerWidth-document.documentElement.clientWidth)>0&&("scrollbarGutter"in document.documentElement.style?SO(document.documentElement,"scrollbarGutter","stable"):SO(document.documentElement,"paddingRight",`${s}px`)),SO(document.documentElement,"overflow","hidden"))),()=>{0==--SD&&d()}}},[t])}({isDisabled:i||!t.isOpen}),(0,fZ.useEffect)(()=>{if(t.isOpen&&r.current)if(i){var e,n,a=o?.current??r.current;let t=x9[x9.length-1];return t&&!t.visibleNodes.has(a)?(t.visibleNodes.add(a),()=>{t.visibleNodes.delete(a)}):void 0}else{let t,i,a,s,l,u,c,d,f,p,h;return e=[o?.current??r.current],i=(n={shouldUseInert:!0})instanceof(t=gb(e?.[0])).Element?{root:n}:n,a=i?.root??document.body,s=i?.shouldUseInert&&x5,l=new Set(e),u=new Set,c=(e,n)=>{s&&e instanceof t.HTMLElement?e.inert=n:n?e.setAttribute("aria-hidden","true"):(e.removeAttribute("aria-hidden"),e instanceof t.HTMLElement&&(e.inert=!1))},d=e=>{for(let t of e.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))l.add(t);let t=e=>{if(u.has(e)||l.has(e)||e.parentElement&&u.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(let t of l)if(gv(e,t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},n=_K(gg(e),e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),r=t(e);if(r===NodeFilter.FILTER_ACCEPT&&f(e),r!==NodeFilter.FILTER_REJECT){let e=n.nextNode();for(;null!=e;)f(e),e=n.nextNode()}},f=e=>{let n=x7.get(e)??0;(s&&e instanceof t.HTMLElement?e.inert:"true"===e.getAttribute("aria-hidden"))&&0===n||(0===n&&c(e,!0),u.add(e),x7.set(e,n+1))},x9.length&&x9[x9.length-1].disconnect(),d(a),(p=new MutationObserver(e=>{for(let n of e)if("childList"===n.type&&n.target.isConnected&&![...l,...u].some(e=>gv(e,n.target)))for(let e of n.addedNodes){var t;(e instanceof HTMLElement||e instanceof SVGElement)&&("true"===(t=e).dataset.liveAnnouncer||void 0!==t.dataset.reactAriaTopLayer)?l.add(e):e instanceof Element&&d(e)}})).observe(a,{childList:!0,subtree:!0}),h={visibleNodes:l,hiddenNodes:u,observe(){p.observe(a,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}},x9.push(h),()=>{for(let e of(p.disconnect(),u)){let t=x7.get(e);null!=t&&(1===t?(c(e,!1),x7.delete(e)):x7.set(e,t-1))}h===x9[x9.length-1]?(x9.pop(),x9.length&&x9[x9.length-1].observe()):x9.splice(x9.indexOf(h),1)}}},[i,t.isOpen,r,o]),{popoverProps:y5(c,p),arrowProps:h,underlayProps:f,placement:m,triggerAnchorPoint:y}}({...r,offset:null!=(o=r.offset)?o:8,arrowSize:s,groupRef:f?c:u},e),g=r.popoverRef,b=function(e,t=!0){let[n,r]=(0,fZ.useState)(!0),o=n&&t;return yz(()=>{if(o&&e.current&&"getAnimations"in e.current)for(let t of e.current.getAnimations())t instanceof CSSTransition&&t.cancel()},[e,o]),SR(e,o,(0,fZ.useCallback)(()=>r(!1),[])),o}(g,!!y)||r.isEntering||!1,v=y8({...r,defaultClassName:"react-aria-Popover",values:{trigger:r.trigger||null,placement:y,isEntering:b,isExiting:t}}),w=!r.isNonModal||"SubmenuTrigger"===r.trigger,[x,S]=(0,fZ.useState)(!1);yz(()=>{g.current&&S(w&&!g.current.querySelector("[role=dialog]"))},[g,w]),(0,fZ.useEffect)(()=>{var e;let t,n;x&&g.current&&!g.current.contains(document.activeElement)&&(n=((e=document)=>e.activeElement)(t=gg(e=g.current)),"virtual"===SA?bn(()=>{((e=document)=>e.activeElement)(t)===n&&e.isConnected&&gm(e)}):gm(e))},[x,g]);let E={...p.style,...v.style},D=fY().createElement("div",{...y5(gh(r),p),...v,role:x?"dialog":void 0,tabIndex:x?-1:void 0,"aria-label":r["aria-label"],"aria-labelledby":r["aria-labelledby"],ref:g,slot:r.slot||void 0,style:E,dir:r.dir,"data-trigger":r.trigger,"data-placement":y,"data-entering":b||void 0,"data-exiting":t||void 0},!r.isNonModal&&fY().createElement(ST,{onDismiss:e.close}),fY().createElement(x6.Provider,{value:{...m,placement:y,ref:a}},v.children),fY().createElement(ST,{onDismiss:e.close}));return f?fY().createElement(xZ,{...r,shouldContainFocus:x,isExiting:t,portalContainer:null!=(i=null!=n?n:null==c?void 0:c.current)?i:void 0},D):fY().createElement(xZ,{...r,shouldContainFocus:x,isExiting:t,portalContainer:n},!r.isNonModal&&e.isOpen&&fY().createElement("div",{"data-testid":"underlay",...h,style:{position:"fixed",inset:0}}),fY().createElement("div",{ref:u,style:{display:"contents"}},fY().createElement(Sq.Provider,{value:u},D)))}function SJ(e){return e?.start!=null&&null!=e.end}let SQ=(0,fZ.createContext)(null),SX=(0,fZ.createContext)(null),S0=(0,fZ.createContext)(null),S1=(0,fZ.createContext)(null),S2=(0,fZ.forwardRef)(function(e,t){var n,r;[e,t]=gt(e,t,SQ);let{validationBehavior:o}=ge(x2)||{},i=null!=(r=null!=(n=e.validationBehavior)?n:o)?r:"native",a=function(e){let t=SH(e),[n,r]=_x(e.value,e.defaultValue||null,e.onChange),[o]=(0,fZ.useState)(n),i=n||e.placeholderValue||null,[a,s]=xj(i,e.granularity),l=null!=n?n.toDate(s??"UTC"):null,u="hour"===a||"minute"===a||"second"===a,c=e.shouldCloseOnSelect??!0,[d,f]=(0,fZ.useState)(null),[p,h]=(0,fZ.useState)(null);if(n&&(d=n,"hour"in n&&(p=n)),i&&!(a in i))throw Error("Invalid granularity "+a+" for value "+i.toString());let m=n?.calendar.identifier==="gregory"&&"BC"===n.era,y=(0,fZ.useMemo)(()=>({granularity:a,timeZone:s,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:m}),[a,e.hourCycle,e.shouldForceLeadingZeros,s,e.hideTimeZone,m]),{minValue:g,maxValue:b,isDateUnavailable:v}=e,w=(0,fZ.useMemo)(()=>xE(n,g,b,v,y),[n,g,b,v,y]),x=xg({...e,value:n,builtinValidation:w}),S=x.displayValidation.isInvalid,E=e.validationState||(S?"invalid":null),D=(e,t)=>{r("timeZone"in t?t.set(v3(e)):v6(e,t)),f(null),h(null),x.commitValidation()};return{...x,value:n,defaultValue:e.defaultValue??o,setValue:r,dateValue:d,timeValue:p,setDateValue:n=>{let o="function"==typeof c?c():c;u?p||o?D(n,p||xk(e.defaultValue||e.placeholderValue)):f(n):(r(n),x.commitValidation()),o&&t.setOpen(!1)},setTimeValue:e=>{d&&e?D(d,e):h(e)},granularity:a,hasTime:u,...t,setOpen(r){!r&&!n&&d&&u&&D(d,p||xk(e.defaultValue||e.placeholderValue)),t.setOpen(r)},validationState:E,isInvalid:S,formatValue:(e,t)=>l?new vr(e,xP(t,y)).format(l):"",getDateFormatter:(e,t)=>new vr(e,xP({},{...y,...t}))}}({...e,validationBehavior:i}),s=(0,fZ.useRef)(null),[l,u]=gn(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,fieldProps:f,buttonProps:p,dialogProps:h,calendarProps:m,descriptionProps:y,errorMessageProps:g,...b}=function(e,t,n){var r;let o=y4(),i=y4(),a=y4(),s=vb((r=xt)&&r.__esModule?r.default:r,"@react-aria/datepicker"),{isInvalid:l,validationErrors:u,validationDetails:c}=t.displayValidation,{labelProps:d,fieldProps:f,descriptionProps:p,errorMessageProps:h}=xo({...e,labelElementType:"span",isInvalid:l,errorMessage:e.errorMessage||u}),m=xn(t,n),y=f["aria-labelledby"]||f.id,{locale:g}=b5(),b=t.formatValue(g,{month:"long"}),v=wN(b?s.format("selectedDateDescription",{date:b}):""),w=[v["aria-describedby"],f["aria-describedby"]].filter(Boolean).join(" ")||void 0,x=gh(e),S=(0,fZ.useMemo)(()=>_5(n),[n]),E=(0,fZ.useRef)(!1),{focusWithinProps:D}=bR({...e,isDisabled:t.isOpen,onBlurWithin:t=>{gv(document.getElementById(i),t.relatedTarget)||(E.current=!1,e.onBlur?.(t),e.onFocusChange?.(!1))},onFocusWithin:t=>{E.current||(E.current=!0,e.onFocus?.(t),e.onFocusChange?.(!0))}});return{groupProps:y5(x,m,f,v,D,{role:"group","aria-disabled":e.isDisabled||null,"aria-labelledby":y,"aria-describedby":w,onKeyDown(n){!t.isOpen&&e.onKeyDown&&e.onKeyDown(n)},onKeyUp(n){!t.isOpen&&e.onKeyUp&&e.onKeyUp(n)}}),labelProps:{...d,onClick:()=>{S.focusFirst()}},fieldProps:{...f,id:a,[xl]:"presentation","aria-describedby":w,value:t.value,defaultValue:t.defaultValue,onChange:t.setValue,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,granularity:e.granularity,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior,[xy]:t,autoFocus:e.autoFocus,name:e.name,form:e.form},descriptionProps:p,errorMessageProps:h,buttonProps:{...v,id:o,"aria-haspopup":"dialog","aria-label":s.format("calendar"),"aria-labelledby":`${o} ${y}`,"aria-describedby":w,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:i,"aria-labelledby":`${o} ${y}`},calendarProps:{autoFocus:!0,value:t.dateValue,onChange:t.setDateValue,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,defaultFocusedValue:t.dateValue?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:l,validationErrors:u,validationDetails:c}}({...gr(e),label:u,validationBehavior:i},a,s),[v,w]=(0,fZ.useState)(null),x=(0,fZ.useCallback)(()=>{s.current&&w(s.current.offsetWidth+"px")},[]);Sb({ref:s,onResize:x});let{focusProps:S,isFocused:E,isFocusVisible:D}=bA({within:!0}),O=y8({...e,values:{state:a,isFocusWithin:E,isFocusVisible:D,isDisabled:e.isDisabled||!1,isInvalid:a.isInvalid,isOpen:a.isOpen},defaultClassName:"react-aria-DatePicker"}),P=gh(e);return delete P.id,fY().createElement(y9,{values:[[S0,a],[_B,{...c,ref:s,isInvalid:a.isInvalid}],[xB,f],[bU,{...p,isPressed:a.isOpen}],[x4,{...d,ref:l,elementType:"span"}],[_k,m],[xJ,a],[SG,{trigger:"DatePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":v}}],[xY,h],[bz,{slots:{description:y,errorMessage:g}}],[xX,b]]},fY().createElement("div",{...S,...P,...O,ref:t,slot:e.slot||void 0,"data-focus-within":E||void 0,"data-invalid":a.isInvalid||void 0,"data-focus-visible":D||void 0,"data-disabled":e.isDisabled||void 0,"data-open":a.isOpen||void 0}))}),S4=(0,fZ.forwardRef)(function(e,t){var n,r;[e,t]=gt(e,t,SX);let{validationBehavior:o}=ge(x2)||{},i=null!=(r=null!=(n=e.validationBehavior)?n:o)?r:"native",a=function(e){let t=SH(e),[n,r]=_x(e.value,e.defaultValue||null,e.onChange),[o]=(0,fZ.useState)(n),[i,a]=(0,fZ.useState)(()=>n||{start:null,end:null});null==n&&i.start&&i.end&&a(i={start:null,end:null});let s=n||i,l=e=>{a(s=e||{start:null,end:null}),SJ(s)?r(s):r(null)},[u,c]=xj(s?.start||s?.end||e.placeholderValue||null,e.granularity),d="hour"===u||"minute"===u||"second"===u,f=e.shouldCloseOnSelect??!0,[p,h]=(0,fZ.useState)(null),[m,y]=(0,fZ.useState)(null);s&&SJ(s)&&(p=s,"hour"in s.start&&(m=s));let g=(e,t)=>{l({start:"timeZone"in t.start?t.start.set(v3(e.start)):v6(e.start,t.start),end:"timeZone"in t.end?t.end.set(v3(e.end)):v6(e.end,t.end)}),h(null),y(null),P.commitValidation()},b=n=>{let r="function"==typeof f?f():f;d?SJ(n)&&(r||m?.start&&m?.end)?g(n,{start:m?.start||xk(e.placeholderValue),end:m?.end||xk(e.placeholderValue)}):h(n):SJ(n)?(l(n),P.commitValidation()):h(n),r&&t.setOpen(!1)},v=e=>{SJ(p)&&SJ(e)?g(p,e):y(e)},w=s?.start?.calendar.identifier==="gregory"&&"BC"===s.start.era||s?.end?.calendar.identifier==="gregory"&&"BC"===s.end.era,x=(0,fZ.useMemo)(()=>({granularity:u,timeZone:c,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:w}),[u,e.hourCycle,e.shouldForceLeadingZeros,c,e.hideTimeZone,w]),{minValue:S,maxValue:E,isDateUnavailable:D}=e,O=(0,fZ.useMemo)(()=>{var e;let t;return e=s,t=x_(xE(e?.start??null,S,E,D,x),xE(e?.end??null,S,E,D,x)),e?.end!=null&&null!=e.start&&0>e.end.compare(e.start)&&(t=x_(t,{isInvalid:!0,validationErrors:[(vf.getGlobalDictionaryForPackage("@react-stately/datepicker")||xx).getStringForLocale("rangeReversed",xS())],validationDetails:{...xf,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})),t},[s,S,E,D,x]),P=xg({...e,value:n,name:(0,fZ.useMemo)(()=>[e.startName,e.endName].filter(e=>null!=e),[e.startName,e.endName]),builtinValidation:O}),k=P.displayValidation.isInvalid,C=e.validationState||(k?"invalid":null);return{...P,value:s,defaultValue:e.defaultValue??o,setValue:l,dateRange:p,timeRange:m,granularity:u,hasTime:d,setDate(e,t){"start"===e?b({start:t,end:p?.end??null}):b({start:p?.start??null,end:t})},setTime(e,t){"start"===e?v({start:t,end:m?.end??null}):v({start:m?.start??null,end:t})},setDateTime(e,t){"start"===e?l({start:t,end:s?.end??null}):l({start:s?.start??null,end:t})},setDateRange:b,setTimeRange:v,...t,setOpen(n){!n&&!(s?.start&&s?.end)&&SJ(p)&&d&&g(p,{start:m?.start||xk(e.placeholderValue),end:m?.end||xk(e.placeholderValue)}),t.setOpen(n)},validationState:C,isInvalid:k,formatValue(t,n){let r;if(!s||!s.start||!s.end)return null;let o="timeZone"in s.start?s.start.timeZone:void 0,i=e.granularity||(s.start&&"minute"in s.start?"minute":"day"),a="timeZone"in s.end?s.end.timeZone:void 0,l=e.granularity||(s.end&&"minute"in s.end?"minute":"day"),u=xP(n,{granularity:i,timeZone:o,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,showEra:"gregory"===s.start.calendar.identifier&&"BC"===s.start.era||"gregory"===s.end.calendar.identifier&&"BC"===s.end.era}),c=s.start.toDate(o||"UTC"),d=s.end.toDate(a||"UTC"),f=new vr(t,u);if(o===a&&i===l&&0!==s.start.compare(s.end)){try{let e=f.formatRangeToParts(c,d),t=-1;for(let n=0;n<e.length;n++){let r=e[n];if("shared"===r.source&&"literal"===r.type)t=n;else if("endRange"===r.source)break}let n="",r="";for(let o=0;o<e.length;o++)o<t?n+=e[o].value:o>t&&(r+=e[o].value);return{start:n,end:r}}catch{}r=f}else r=new vr(t,xP(n,{granularity:l,timeZone:a,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle}));return{start:f.format(c),end:r.format(d)}},getDateFormatter:(e,t)=>new vr(e,xP({},{...x,...t}))}}({...e,validationBehavior:i}),s=(0,fZ.useRef)(null),[l,u]=gn(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,startFieldProps:f,endFieldProps:p,buttonProps:h,dialogProps:m,calendarProps:y,descriptionProps:g,errorMessageProps:b,...v}=function(e,t,n){var r;let o=vb((r=xt)&&r.__esModule?r.default:r,"@react-aria/datepicker"),{isInvalid:i,validationErrors:a,validationDetails:s}=t.displayValidation,{labelProps:l,fieldProps:u,descriptionProps:c,errorMessageProps:d}=xo({...e,labelElementType:"span",isInvalid:i,errorMessage:e.errorMessage||a}),f=u["aria-labelledby"]||u.id,{locale:p}=b5(),h=t.formatValue(p,{month:"long"}),m=wN(h?o.format("selectedRangeDescription",{startDate:h.start,endDate:h.end}):""),y={"aria-label":o.format("startDate"),"aria-labelledby":f},g={"aria-label":o.format("endDate"),"aria-labelledby":f},b=y4(),v=y4(),w=xn(t,n),x=[m["aria-describedby"],u["aria-describedby"]].filter(Boolean).join(" ")||void 0,S=(0,fZ.useMemo)(()=>_5(n,{accept:e=>e.id!==b}),[n,b]),E={[xu]:S,[xl]:"presentation","aria-describedby":x,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,granularity:e.granularity,shouldForceLeadingZeros:e.shouldForceLeadingZeros,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior},D=gh(e),O=(0,fZ.useRef)(!1),{focusWithinProps:P}=bR({...e,isDisabled:t.isOpen,onBlurWithin:t=>{gv(document.getElementById(v),t.relatedTarget)||(O.current=!1,e.onBlur?.(t),e.onFocusChange?.(!1))},onFocusWithin:t=>{O.current||(O.current=!0,e.onFocus?.(t),e.onFocusChange?.(!0))}}),k=(0,fZ.useRef)(xh),C=(0,fZ.useRef)(xh);return{groupProps:y5(D,w,u,m,P,{role:"group","aria-disabled":e.isDisabled||null,"aria-describedby":x,onKeyDown(n){!t.isOpen&&e.onKeyDown&&e.onKeyDown(n)},onKeyUp(n){!t.isOpen&&e.onKeyUp&&e.onKeyUp(n)}}),labelProps:{...l,onClick:()=>{S.focusFirst()}},buttonProps:{...m,id:b,"aria-haspopup":"dialog","aria-label":o.format("calendar"),"aria-labelledby":`${b} ${f}`,"aria-describedby":x,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:v,"aria-labelledby":`${b} ${f}`},startFieldProps:{...y,...E,value:t.value?.start??null,defaultValue:t.defaultValue?.start,onChange:e=>t.setDateTime("start",e),autoFocus:e.autoFocus,name:e.startName,form:e.form,[xy]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){k.current=e,t.updateValidation(x_(e,C.current))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},endFieldProps:{...g,...E,value:t.value?.end??null,defaultValue:t.defaultValue?.end,onChange:e=>t.setDateTime("end",e),name:e.endName,form:e.form,[xy]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){C.current=e,t.updateValidation(x_(k.current,e))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},descriptionProps:c,errorMessageProps:d,calendarProps:{autoFocus:!0,value:t.dateRange?.start&&t.dateRange.end?t.dateRange:null,onChange:t.setDateRange,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,allowsNonContiguousRanges:e.allowsNonContiguousRanges,defaultFocusedValue:t.dateRange?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:i,validationErrors:a,validationDetails:s}}({...gr(e),label:u,validationBehavior:i},a,s),[w,x]=(0,fZ.useState)(null),S=(0,fZ.useCallback)(()=>{s.current&&x(s.current.offsetWidth+"px")},[]);Sb({ref:s,onResize:S});let{focusProps:E,isFocused:D,isFocusVisible:O}=bA({within:!0}),P=y8({...e,values:{state:a,isFocusWithin:D,isFocusVisible:O,isDisabled:e.isDisabled||!1,isInvalid:a.isInvalid,isOpen:a.isOpen},defaultClassName:"react-aria-DateRangePicker"}),k=gh(e);return delete k.id,fY().createElement(y9,{values:[[S1,a],[_B,{...c,ref:s,isInvalid:a.isInvalid}],[bU,{...h,isPressed:a.isOpen}],[x4,{...d,ref:l,elementType:"span"}],[_C,y],[xJ,a],[SG,{trigger:"DateRangePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":w}}],[xY,m],[xB,{slots:{start:f,end:p}}],[bz,{slots:{description:g,errorMessage:b}}],[xX,v]]},fY().createElement("div",{...E,...k,...P,ref:t,slot:e.slot||void 0,"data-focus-within":D||void 0,"data-invalid":a.isInvalid||void 0,"data-focus-visible":O||void 0,"data-disabled":e.isDisabled||void 0,"data-open":a.isOpen||void 0}))});function S3(e){return fY().createElement(b6,e)}function S6(e,t,n=!1){if(null==e)return n?e:void 0;if("string"==typeof e&&!e)return n?null:void 0;if(e instanceof vH||e instanceof vq||e instanceof vZ)return t?v5(e,t):e;{let n=hk()(e).toDate(),r=new vH(n.getFullYear(),n.getMonth()+1,n.getDate());return t?v5(r,t):r}}function S5(e){if(e)return e.toDate(wl())}function S7(e){if("string"==typeof e&&0!==e.trim().length)try{return new Intl.Locale(e.replace(/[_@]/g,"-")).toString()}catch{return}}function S9(e){let t=e??"",n=S7(t);if(!n)return t;try{return new Intl.DisplayNames([n],{type:"language"}).of(n)??t}catch{return t}}function S8(){let e=window.i18next.language,t=S7(e)??e;return"ht"===t&&(t="fr-HT"),t}if("u">typeof navigator){let e=navigator;ec=Array.isArray(e.languages)?e.languages[0]:e.language}else if("u">typeof process){let e=process.env;ec=e.LC_ALL||e.LC_MESSAGES||e.LANG||e.LANGUAGE}var Ee=function(e){e=(e=e.replace(/_/g,"-")).replace(/[.:][\w-]*$/,"");try{return new Intl.Locale(e).baseName}catch{return"en-US"}}(ec||"en-US"),Et=class extends Date{invalid=null;isValid(){return!Number.isNaN(this.valueOf())}},En={};for(let e=1;e<100;e++)En[(e<=9?"0":"")+e]=e+(e>51?1900:2e3);var Er={arab:1632,arabext:1776,bali:6992,beng:2534,deva:2406,fullwide:65296,gujr:2790,khmr:6112,knda:3302,laoo:3792,limb:6470,mlym:3430,mong:6160,mymr:4160,orya:2918,tamldec:3046,telu:3174,thai:3664,tibt:3872},Eo="[1234567890一二三四五六七八九〇\\d]",Ei={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,〇:0,一:1,二:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9},Ea={},Es={"Eastern Daylight Time":-240,"Eastern Standard Time":-300,"Central Daylight Time":-300,"Central Standard Time":-360,"Mountain Daylight Time":-360,"Mountain Standard Time":-420,"Pacific Daylight Time":-420,"Pacific Standard Time":-480,"Coordinated Universal Time":0,ACDT:630,ACST:570,ACT:480,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,AMST:-180,AMT:-240,ART:-180,AST:180,AWDT:540,AWST:480,AZOST:-60,AZT:240,BDT:360,BIOT:360,BIT:-720,BOT:-240,BRST:-120,BRT:-180,BTT:360,CAT:120,CCT:390,CDT:-300,CEDT:120,CEST:120,CET:60,CHADT:825,CHAST:765,CHOT:480,ChST:600,CHUT:600,CIST:-480,CIT:480,CKT:-600,CLST:-180,CLT:-240,COST:-240,COT:-300,CST:-360,CT:480,CVT:-60,CXT:420,DAVT:420,DDUT:600,DFT:60,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEDT:180,EEST:180,EET:120,EGST:0,EGT:-60,EIT:540,EST:-300,FET:180,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GIT:-540,GMT:0,GST:-120,GYT:-240,HADT:-540,HAEC:120,HAST:-600,HKT:480,HMT:300,HOVT:420,HST:-600,IBST:0,ICT:420,IDT:180,IOT:180,IRDT:270,IRKT:480,IRST:210,IST:120,JST:540,KGT:360,KOST:660,KRAT:420,KST:540,LHST:630,LINT:840,MAGT:720,MART:-510,MAWT:300,MDT:-360,MET:60,MEST:120,MHT:720,MIST:660,MIT:-510,MMT:390,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:660,NPT:345,NST:-150,NT:-150,NUT:-660,NZDT:780,NZST:720,OMST:360,ORAT:300,PDT:-420,PET:-300,PETT:720,PGT:600,PHOT:780,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PYST:-180,PYT:-240,RET:240,ROTT:-180,SAKT:660,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SLST:330,SRET:660,SRT:-180,SST:480,SYOT:180,TAHT:-600,THA:420,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TOT:780,TVT:720,UCT:0,ULAT:480,USZ1:120,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-240,VLAT:600,VOLT:240,VOST:360,VUT:660,WAKT:720,WAST:120,WAT:60,WEDT:60,WEST:60,WET:0,WIT:420,WST:480,YAKT:540,YEKT:300},El={zone:Es,year:En,meridiem:{am:0,pm:12,"a.m.":0,"p.m.":12},month:{january:1,jan:1,february:2,feb:2,march:3,mar:3,april:4,apr:4,may:5,june:6,jun:6,july:7,jul:7,august:8,aug:8,september:9,sep:9,october:10,oct:10,november:11,nov:11,december:12,dec:12},dayname:{sunday:0,sun:0,monday:1,mon:1,tuesday:2,tue:2,wednesday:3,wed:3,thursday:4,thu:4,friday:5,fri:5,saturday:6,sat:6},digit:{}},Eu={MONTHNAME:"january|february|march|april|may|june|july|august|september|october|november|december|jan\\.?|feb\\.?|mar\\.?|apr\\.?|may\\.?|jun\\.?|jul\\.?|aug\\.?|sep\\.?|oct\\.?|nov\\.?|dec\\.?",DAYNAME:"sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun\\.?|mon\\.?|tue\\.?|wed\\.?|thu\\.?|fri\\.?|sat\\.?",ZONE:"\\(?(?:"+Object.keys(Es).join("|")+")\\)?",MERIDIEM:"am|pm|a.m.|p.m.",ORDINAL:"st|nd|rd|th|\\.",YEAR:"\\d{4}|\\d{2}",YEAR2:"\\d{2}",YEAR4:"\\d{4}",YEAR6:"-\\d{6}|\\+?\\d{5,6}",MONTH:"1[0-2]|0?[1-9]",MONTH2:"1[0-2]|0[1-9]",DAY:"3[01]|[12]\\d|0?[1-9]",DAY2:"3[01]|[12]\\d|0[1-9]",OFFSET:"(?:GMT)?[\xb1−+-](?:[01]\\d[0-5]\\d|[01]\\d:[0-5]\\d|[01]?\\d)",H24:"[01]\\d|2[0-3]",H12:"0?[1-9]|1[012]",MIN:"[0-5]\\d",SEC:"[0-5]\\d|60",MS:"\\d{9}|\\d{6}|\\d{1,3}",GAP:"[\\s/.,-]{1,}"},Ec={...Eu,YEAR:"*{4}|*{2}",YEAR4:"*{4}",YEAR6:"-*{6}|\\+?*{5,6}",MONTH:"*{1,2}",MONTH2:"*{2}",DAY:"*{1,2}",DAY2:"*{2}",OFFSET:"(?:GMT)?[\xb1−+-](?:*{4}|*{2}:*{2}|*{1,2})",H24:"*{2}",H12:"*{1,2}",MIN:"*{2}",SEC:"*{2}",MS:"*{9}|*{6}|*{3}"},Ed={},Ef=class e{locale;lookups;vars;numberingSystem;baseName;dateOptions;static factory(t=Ee){return Ed[t.toLowerCase()]||(Ed[t.toLowerCase()]=new e(t)),Ed[t.toLowerCase()]}constructor(e=Ee){this.locale=e,this.lookups={...El},this.vars={...Eu};let t=new Intl.NumberFormat(this.locale);this.numberingSystem=t.resolvedOptions().numberingSystem,this.dateOptions=new Intl.DateTimeFormat(this.locale).resolvedOptions(),this.baseName=new Intl.Locale(this.locale).baseName,this.build()}toInt(e){if("number"==typeof e)return e;if("string"!=typeof e)return;if("latn"===this.numberingSystem&&!this.baseName.startsWith("zh")){let t=parseInt(e,10);if(!isNaN(t))return t}let t="";for(let n=0;n<e.length;n++)t+=String(this.lookups.digit[e[n]]);return parseInt(t,10)}millisecondToInt(e){if("number"==typeof e)return e;if("string"!=typeof e)return;let t=e.slice(0,3);return 1===t.length?100*this.toInt(t):2===t.length?10*this.toInt(t):this.toInt(t)}monthNameToInt(e){if("string"!=typeof e)return;let t=e.toLocaleLowerCase(this.locale).replace(/\.$/,"");return this.lookups.month[t]||12}h12ToInt(e,t){if("string"!=typeof e)return;let n=this.lookups.meridiem[t?.toLowerCase()]||0,r=this.toInt(e);return r<12&&12===n&&(r+=12),12===r&&0===n&&(r=0),r}zoneToOffset(e){if("string"==typeof e)return e=e.replace(/[^a-z\s]/gi,""),this.lookups.zone[e]}offsetToMinutes(e){if("string"!=typeof e)return;let t=e.match(/^(?:GMT)?([±−+-])(..?):?(..)?$/);if(t){let[,e,n,r]=t;return("-"===e||"−"===e?-1:1)*(60*this.toInt(n)+this.toInt(r||0))}return 0}build(){"latn"===this.dateOptions.numberingSystem?this.lookups.digit=Ei:this.buildNumbers(),/^en/i.test(this.locale)||(this.buildMonthNames(),this.buildDaynames(),/zh/i.test(this.locale)||this.buildMeridiems())}buildNumbers(){let{group:e,lookup:t}=function(e){if(Ea[e])return Ea[e];if("fullwide"===e||"hanidec"===e)return{group:Eo,lookup:{...Ei}};let t=Er[e];if(!t)return{group:"\\d",lookup:{...Ei}};let n=String.fromCharCode(t),r=String.fromCharCode(t+9),o={};for(let e=0;e<10;e++)o[String.fromCharCode(t+e)]=e;return Ea[e]={group:`[${n}-${r}]`,lookup:o},Ea[e]}(this.numberingSystem);for(let n in this.lookups.digit=t,Ec)Ec.hasOwnProperty(n)&&(this.vars[n]=Ec[n].replace(/\*/g,e))}buildMonthNames(){let e={},t={};if(/^fi/i.test(this.locale))"tammi|helmi|maalis|huhti|touko|kes\xe4|hein\xe4|elo|syys|loka|marras|joulu".split("|").forEach((n,r)=>{["","k","kuu","kuuta"].forEach((o,i)=>{e[n+o+(i<2?"\\.?":"")]=!0,t[n+o]=r+1})});else{let n=[],r=e=>"month"===e.type;for(let e=0;e<12;e++)n.push(new Date(2017,e,1));for(let o of["full","long","medium"]){let i=Intl.DateTimeFormat(this.locale,{dateStyle:o});for(let a=0;a<12;a++){let s=i.formatToParts(n[a]).find(r).value.toLocaleLowerCase(this.locale);/^\d+$/.test(s)||(/^ko/i.test(this.locale)&&(s+="월"),"medium"===o?(s=s.replace(/\.$/,""),e[`${s}\\.?`]=!0):e[s]=!0,t[s]=a+1)}}let o=Intl.DateTimeFormat(this.locale,{month:"short"});for(let i=0;i<12;i++){let a=o.formatToParts(n[i]).find(r).value.toLocaleLowerCase(this.locale);a=a.replace(/\.$/,""),e[`${a}\\.?`]=!0,t[a]=i+1}}this.vars.MONTHNAME=Object.keys(e).join("|"),this.lookups.month=t}buildDaynames(){let e=[],t=e=>"weekday"===e.type;for(let t=0;t<7;t++)e.push(new Date(2017,0,t+1));let n=[],r={};for(let o of["long","short"]){let i=Intl.DateTimeFormat(this.locale,{weekday:o});for(let a=0;a<7;a++){let s=i.formatToParts(e[a]).find(t).value.toLocaleLowerCase(this.locale);"short"===o?(s=s.replace(/\.$/,""),n.push(`${s}\\.?`)):n.push(s),r[s]=a}}this.vars.DAYNAME=n.join("|"),this.lookups.dayname=r}buildMeridiems(){let e=[new Date(2017,0,1),new Date(2017,0,1,23,0,0)],t=e=>"dayPeriod"===e.type,n=[],r={},o=Intl.DateTimeFormat(this.locale,{timeStyle:"long"});for(let i=0;i<2;i++){let a=o.formatToParts(e[i]).find(t);if(!a)return;let s=a.value.toLocaleLowerCase(this.locale);n.push(s),r[s]=12*i}this.vars.MERIDIEM=n.join("|"),this.lookups.meridiem=r}compile(e){return RegExp(e.replace(/_([A-Z0-9]+)_/g,(e,t)=>{if(!this.vars[t])throw Error(`Template string contains invalid variable _${t}_`);return this.vars[t]}),"i")}},Ep=["ee-TG","en-AS","en-CA","en-FM","en-GH","en-GU","en-KE","en-KY","en-MH","en-MP","en-US","en-VI","en-WS","jp-JP","sm-AS","sm-SM"],Eh={y:"year",M:"month",d:"day",w:"week",h:"hour",m:"minute",s:"second",ms:"millisecond"},Em=()=>new Date;function Ey(e){return function(t){let n={};for(let r=0,o=e.length;r<o;r++){let o=e[r];o&&(n[o]=t[r])}return n}}var Eg=class{doneChecker;fallback;patterns;formatter;constructor({doneChecker:e,fallback:t,patterns:n,formatter:r}){this.doneChecker=e,this.fallback=t,this.patterns=n,this.formatter=r}attempt(e){if("string"!=typeof e)return this.fallback(e);let t=e.trim(),n={},r=!1;for(let e of this.patterns){let o=t.match(e.regex);if(!o)continue;r=!0;let i=e.handler(o);if(i){for(let[e,t]of Object.entries(i))e in n||void 0===t||(n[e]=t);if(t=(t=t.slice(0,o.index)+t.slice(o.index+o[0].length+1)).trim(),this.doneChecker(n,t))break}}return r?this.formatter(n):this.fallback(e)}},Eb=["year","month","day","hour","minute","second","millisecond","offset"],Ev={};function Ew(e,t){return""===t||/^\s+$/.test(t)||"year"in e&&("month"in e||"monthname"in e)&&"day"in e&&"hour"in e&&"minute"in e&&"second"in e&&"millisecond"in e&&("zone"in e||"offset"in e)}var E_=[[/([^\d.]+)(\d{1,2})\.(\d{2})\.(\d{2})(\D|$)/,"$1$2:$3:$4$5"],[/([^\d.]+)(\d{1,2})\.(\d{2})(\D|$)/,"$1$2:$3$4"]],Ex={ar:[[/ /g," "]],bn:[[/,/g,""]],zh:[[/早上\s*([\d:]+)/,"$1am"],[/凌晨\s*([\d:]+)/,"$1am"],[/上午\s*([\d:]+)/,"$1am"],[/下午\s*([\d:]+)/,"$1pm"],[/晚上\s*([\d:]+)/,"$1pm"]],he:[[/ב/gi,""]],de:[[/ um /g," "]],pt:[[/\sde /gi," "]],es:[[/\sde /gi," "]],da:[[/\sden /gi," "],...E_],ru:[[/ г\./g,""]],th:[[/\s*นาฬิกา\s*/i,":"],[/\s*นาที\s*/i,":"],[/\s*วินาที\s*/i," "]],ko:[[/\s*시\s*/,":"],[/\s*분\s*/,":"],[/\s*초\s*/,""],[/(오전|오후)\s*([\d:]+)/,"$2$1"],[/(\d{4})\. (\d{1,2})\. (\d{1,2})\./,"$1-$2-$3"]],fi:E_,id:E_,fr:[[/(\d{2}) h /,"$1:"],[/(\d{2}) min /,"$1:"],[/(\d{2}) s /,"$1"]]};function ES(e,t=Ee){let n=function(e){if(!Ev[e]){var t,n;let r,o,i=Ef.factory(e);Ev[e]=new Eg({doneChecker:Ew,fallback:(t=e,function(e){let n=String(e).slice(0,50);return""===n&&(n="(empty string)"),{invalid:`Unable to parse "${n}" with locale "${t}"`}}),patterns:(r=[{name:"timestampWithOffset",regex:i.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? ?(_OFFSET_|Z)?$"),handler:Ey(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"timestampWithZone",regex:i.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))?\\s*(_ZONE_)$"),handler:Ey(["","year","month","day","hour","minute","second","millisecond","zone"])},{name:"timestampWithOffsetAndZone",regex:i.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? (_OFFSET_|Z)\\s*(_ZONE_)$"),handler:Ey(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"chinese",regex:i.compile(`^(${Eo}{2,4})\\s*\u5E74\\s*(${Eo}{1,2})\\s*\u6708\\s*(${Eo}{1,2})\\s*\u65E5$`),handler:Ey(["","year","month","day"])},{name:"korean",regex:i.compile("^(_YEAR_)년\\s*(_MONTH_)월\\s*(_DAY_)일$"),handler:Ey(["","year","month","day"])},{name:"twitter",regex:/^(?:sun|mon|tue|wed|thu|fri|sat) (jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec) (\d{2}) (\d{2}):(\d{2}):(\d{2}) ([+-]\d{4}) (\d{4})$/i,handler:Ey(["","monthname","day","hour","minute","second","offset","year"])},{name:"today",regex:/^(now|today|tomorrow|yesterday)$/i,handler:function(e){let t=Em(),n=e[1].toLowerCase();switch(n){case"tomorrow":t.setUTCDate(t.getUTCDate()+1);break;case"yesterday":t.setUTCDate(t.getUTCDate()-1)}let r={year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate()};return"now"===n&&(r.hour=t.getUTCHours(),r.minute=t.getUTCMinutes(),r.second=t.getUTCSeconds(),r.millisecond=t.getUTCMilliseconds()),console.log("today=>",n,r),r}},{name:"ago",regex:/^(\+|-|in|) ?([\d.]+) ?(years?|months?|weeks?|days?|hours?|minutes?|seconds?|milliseconds?|ms|s|m|h|w|d|M|y)( ago)?$/i,handler:function([,e,t,n,r]){t=parseFloat(t),"week"===(n=n.length<=2?Eh[n]:(n=n.replace(/s$/,"")).toLowerCase())&&(n="day",t*=7),("-"===e||r)&&(t*=-1);let o=Em();return"millisecond"===n?o.setUTCMilliseconds(o.getUTCMilliseconds()+t):"second"===n?o.setUTCSeconds(o.getUTCSeconds()+t):"minute"===n?o.setUTCMinutes(o.getUTCMinutes()+t):"hour"===n?o.setUTCHours(o.getUTCHours()+t):"day"===n?o.setUTCDate(o.getUTCDate()+t):"month"===n?o.setUTCMonth(o.getUTCMonth()+t):"year"===n&&o.setUTCFullYear(o.getUTCFullYear()+t),{year:o.getUTCFullYear(),month:o.getUTCMonth()+1,day:o.getUTCDate(),hour:o.getUTCHours(),minute:o.getUTCMinutes(),second:o.getUTCSeconds(),millisecond:o.getUTCMilliseconds()}}},{name:"atSeconds",regex:/^@(\d+)$/,handler:function(e){let t=new Date(1e3*parseInt(e[1],10));return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds()}}},{name:"microsoftJson",regex:/^\/Date\((\d+)([+-]\d{4})?\)\/$/,handler:function(e){let t=new Date(parseInt(e[1],10));return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds(),offset:e[2]}}},{name:"full24",regex:i.compile("(?:^|[\\sT])(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?(Z)?$"),handler:Ey(["","hour","minute","second","millisecond","zone"])},{name:"zone24",regex:i.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?[\\s\\[(]*(_ZONE_)?[\\s\\])]*$"),handler:Ey(["","hour","minute","second","millisecond","zone"])},{name:"hms12",regex:i.compile("(_H12_):(_MIN_):(_SEC_)\\s*(_MERIDIEM_)"),handler:Ey(["","hour","minute","second","meridiem"])},{name:"hms24",regex:i.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?"),handler:Ey(["","hour","minute","second","millisecond"])},{name:"hm12",regex:i.compile("(_H12_):(_MIN_)\\s*(_MERIDIEM_)"),handler:Ey(["","hour","minute","meridiem"])},{name:"hm24",regex:i.compile("(_H24_):(_MIN_)"),handler:Ey(["","hour","minute"])},{name:"h12",regex:i.compile("(_H12_)\\s*(_MERIDIEM_)"),handler:Ey(["","hour","meridiem"])},{name:"8digit",regex:/^((?:19|20)\d{2})(\d{2})(\d{2})$/,handler:Ey(["","year","month","day"])},{name:"yearMonthnameDay",regex:i.compile("(_YEAR4_)[\\s.-]+(_MONTHNAME_)[\\s,.-]+(_DAY_)(_ORDINAL_)?"),handler:Ey(["","year","monthname","day"])},{name:"dayMonthnameYear",regex:i.compile("(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)[\\s,.-]+(_YEAR_)"),handler:Ey(["","day","","monthname","year"])},{name:"monthnameDayYear",regex:i.compile("(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?[\\s,.-]+(_YEAR_)"),handler:Ey(["","monthname","day","","year"])},{name:"dayMonthname",regex:i.compile("\\b(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)\\b"),handler:Ey(["","day","","monthname"])},{name:"monthnameDay",regex:i.compile("\\b(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?\\b"),handler:Ey(["","monthname","day"])},{name:"hmsNoMeridiem",regex:i.compile("\\b(_H12_|_H24_):(_MIN_):(_SEC_)\\b"),handler:Ey(["","hour","minute","second"])},{name:"hmNoMeridiem",regex:i.compile("\\b(_H12_|_H24_):(_MIN_)\\b"),handler:Ey(["","hour","minute"])},{name:"ymd",regex:i.compile("(_YEAR4_)([.-])(_MONTH_)\\2+(_DAY_)"),handler:Ey(["","year","","month","day"])},{name:"mdy",regex:i.compile("(_MONTH_)([/-])(_DAY_)\\2(_YEAR_)"),handler:Ey(["","month","","day","year"])},{name:"dmy",regex:i.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)[./\\s-]+(_YEAR_)"),handler:Ey(["","day","month","year"])},{name:"yearLoose",regex:i.compile("_YEAR4_"),handler:Ey(["year"])},{name:"dayMonthnameLoose",regex:i.compile("(_DAY_)[\\s.]*(_MONTHNAME_)"),handler:Ey(["","day","monthname"])},{name:"monthnameDayLoose",regex:i.compile("(_MONTHNAME_)[\\s.]*(_DAY_)"),handler:Ey(["","monthname","day"])},{name:"monthname",regex:i.compile("_MONTHNAME_"),handler:Ey(["monthname"])},{name:"year4",regex:i.compile("_YEAR4_"),handler:Ey(["year"])},{name:"md",regex:i.compile("(_MONTH_)[/-](_DAY_)"),handler:Ey(["","month","day"])},{name:"dm",regex:i.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)"),handler:Ey(["","day","month"])},{name:"day",regex:i.compile("_DAY_"),handler:Ey(["day"])},{name:"year2",regex:i.compile("_YEAR2_"),handler:Ey(["year"])},{name:"onlyZone",regex:i.compile("_ZONE_"),handler:Ey(["zone"])}],o=i.baseName.slice(0,5),Ep.includes(o)?r:r.filter(e=>!["mdy","md"].includes(e.name))),formatter:(n=i,function(e){let t={};for(let[r,o]of Object.entries(e))if("monthname"===r){if(o){let e=n.monthNameToInt(o);void 0!==e&&(t.month=e)}}else if("hour"===r&&e.meridiem){let r=n.h12ToInt(o,e.meridiem);void 0!==r&&(t.hour=r)}else if("zone"===r){if(o){let e=n.zoneToOffset(o);void 0!==e&&(t.offset=e)}}else if("offset"===r){let e=n.offsetToMinutes(o);void 0!==e&&(t.offset=e)}else if("millisecond"===r){let e=n.millisecondToInt(o);"number"==typeof e&&(t.millisecond=e)}else if(Eb.includes(r)){let e=n.toInt(o);"number"==typeof e&&(t[r]=e)}return t.year<100&&(t.year=En[t.year]),t.year&&"buddhist"===n.dateOptions.calendar&&(t.year-=543),t})})}return Ev[e]}(t),r=function(e,t){let n=Ex[t.slice(0,2).toLowerCase()];if(!n)return e;for(let[t,r]of n)e=e.replace(t,r);return e}(e,t);return n.attempt(r)}function EE(e){e.month&&e.day&&void 0===e.year&&(e.year=new Date().getFullYear()),60===e.second&&(e.second=59);let t=new Et(e.year,e.month-1,e.day,e.hour||0,e.minute||0,e.second||0,e.millisecond||0);return"number"==typeof e.offset?new Et(t.valueOf()-60*e.offset*1e3):t}function ED(e,t=Ee){let n=ES(e,t),r=n.invalid?new Et(NaN):EE(n);return r.isValid()||(r.invalid=`Unable to parse date "${e}"`),r}function EO(e,t=Ee){return e instanceof Date?new Et(e.valueOf()):"number"==typeof e?new Et(e):ED(e,t)}Date.fromString=Et.fromString=ED,Date.fromAny=Et.fromAny=EO,"u">typeof window&&(window.anyDateParser={fromString:ED,fromAny:EO,fromObject:EE,attempt:ES});var EP=n(44397),Ek=n(57657);let EC=function(e){return null==e};function Ej(e,t){var n=function(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}(e,t);return n.get?n.get.call(e):n.value}hk().extend(hC),hk().extend(Ek),hk().extend(EP);let ET="YYYY-MM-DDTHH:mm:ss.SSSZZ";function ER(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&("+"===e[23]||"-"===e[23])&&hk()(e,ET).isValid()}function EA(e){return hk()(e).isToday()}function EM(e){return ER(e)?hk()(e,ET).toDate():null}function EN(e,t=!1){let n=hk()(e);return t&&(n=n.utc()),n.format(ET)}function EI(e){return hk()(e).toDate()}var E$=new WeakMap;let EL=new class{register(e,t){Ej(this,E$).set(e,t)}getCalendar(e){if(!e)return;if(e.calendar)return e.calendar;if(e.region){let t=`${e.language}-${e.region}`;if(Ej(this,E$).has(t))return Ej(this,E$).get(t)}if(e.language&&Ej(this,E$).has(e.language))return Ej(this,E$).get(e.language);let t=new Intl.DateTimeFormat(e.toString()).resolvedOptions().calendar;return Ej(this,E$).set(`${e.language}${e.region?`-${e.region}`:""}`,t),t}constructor(){!function(e,t,n){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}(this,E$,{writable:!0,value:new Map})}};function EF(e,t){EL.register(e,t)}function EB(e){let t=e??S8();return EL.getCalendar(t instanceof Intl.Locale?t:new Intl.Locale(t))}let EV={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1};function EU(e,t={}){let n=ES(e,S8());if(n.invalid)return console.warn(`Could not parse invalid date '${e}'`),null;!EC(n.day)&&EC(n.month)&&(n=Object.assign({},tz(n,"day"),{month:n.day})),n.month&&(n.month-=1),n.day&&(n=Object.assign({},tz(n,"day"),{date:n.day}));let r=hk()().set(n).toDate();return EC(n.year)&&(t.year=!1),EC(n.month)&&(t.month=!1),EC(n.date)&&(t.day=!1),EW(r,t)}function EW(e,t){let n,r=t?.locale??S8(),o=new Intl.Locale(r),{calendar:i,mode:a,time:s,day:l,month:u,year:c,noToday:d,numberingSystem:f}={...EV,...{noToday:"am"===o.language},...t},p={calendar:i??EB(o),year:c?"numeric":void 0,month:u?"short":void 0,day:l?"2-digit":void 0,numberingSystem:f},h=hk()(e).isToday();if(h&&!d)n=(n=new Intl.RelativeTimeFormat(r,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(r)+n.slice(1);else{"en"===o.language&&(r="en-GB");let t=new Intl.DateTimeFormat(r,p).formatToParts(e);("en"===o.language||"am"===o.language)&&"standard"==a&&c&&l&&(t=t.map(EK("-"))),"wide"==a&&(t=t.map(EK(" — "))),"ethiopic"===p.calendar&&(t=t.filter((e,t,n)=>"era"!==e.type&&("literal"!==e.type||!(t<n.length-1)||"era"!==n[t+1].type))),n=t.map(e=>e.value).join("")}return(!0===s||h&&"for today"===s)&&(n+=`, ${Ez(e)}`),n}let EK=e=>(t,n,r)=>"literal"!==t.type||" "!==t.value||n<r.length-1&&"era"===r[n+1].type?t:{type:"literal",value:e};function Ez(e){return e.toLocaleTimeString(S8(),{hour:"2-digit",minute:"2-digit"})}function EH(e,t){return EW(e,{...t,time:!0})}function EG(e,t){let n=EB("string"==typeof t?new Intl.Locale(t):t);return n?v5(e,_p(n)):e}function Eq(e,t){return new Intl.DurationFormat(S8(),t).format(e)}function EZ(e,t){if(null==e)return null;if("string"==typeof e){let n=ES(e,S8());return n.invalid?(console.warn(`Could not interpret '${e}' as a date`),null):(n.day&&!n.month&&(n={...tz(n,"day"),...{month:n.day}}),n.month&&(n.month-=1),n.day&&(n={...tz(n,"day"),...{date:n.day}}),hk()(t).set(n))}return hk()(e)}let EY=["years","months","days","hours","minutes","seconds"],EJ={second:"seconds",minute:"minutes",hour:"hours",day:"days",month:"months",year:"years"},EQ={seconds:45,minutes:45,hours:22,days:26,months:11,years:1/0};function EX(e,t=hk()(),n){let r,o=hk()(t),i=EZ(e,o);if(null==i)return null;if("string"==typeof n){let e=EJ[n]??n;return{[e]:o.diff(i,e)}}let{thresholds:a,largestUnit:s,smallestUnit:l}=n??{};if(void 0!==s||void 0!==l){let e,t=l?EJ[l]??l:void 0;return e="auto"===s||void 0===s?function(e,t,n){let r=EY.indexOf(n);for(let o=0;o<EY.length;o++){let i=EY[o];if(t.diff(e,i)>0)return o<=r?i:n}return n}(i,o,t??"seconds"):EJ[s]??s,function(e,t,n,r){let o=EY.indexOf(n),i=EY.indexOf(r),a=EY.slice(o,i+1),s={},l=e;for(let e of a){let n=t.diff(l,e);s[e]=n,l=l.add(n,e)}return s}(i,o,e,t??e)}let u=(r=function(e){let t={...EQ};if(e)for(let[n,r]of Object.entries(e))void 0!==r&&(t[EJ[n]??n]=r);return t}(a),o.diff(i,"seconds")<r.seconds?"seconds":o.diff(i,"minutes")<r.minutes?"minutes":o.diff(i,"hours")<r.hours?"hours":o.diff(i,"days")<r.days?"days":o.diff(i,"months")<r.months?"months":"years");return{[u]:o.diff(i,u)}}let E0={style:"short",localeMatcher:"lookup"};function E1(e,t=hk()(),n){let r=EX(e,t,n);return null==r?null:Eq(r,"object"==typeof n&&n.formatOptions?{...E0,...n.formatOptions}:E0)}let E2=(0,fZ.createContext)(null);function E4(){let e=pq({externalModuleName:"@openmrs/esm-styleguide"}).preferredDateLocale,t=(0,fZ.useMemo)(()=>{let t=S8();return e[t]&&(t=e[t]),t},[window.i18next.language]),n=(0,fZ.useMemo)(()=>{let e=EB(t);return void 0!==e?_p(e):void 0},[t]),r=(0,fZ.useMemo)(()=>new Intl.Locale(t,{calendar:n?.identifier}),[t,n]),o=(0,fZ.useMemo)(()=>n?v5(wo(wl()),n):wo(wl()),[n]);return{calendar:n,intlLocale:r,today_:o}}let E3=new vH(1793,1,1);var E6={};function E5(){return"u">typeof window&&window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges}function E7(e={}){let{locale:t}=b5();return(0,fZ.useMemo)(()=>new(0,xN.K)(t,e),[t,e])}E6={"ar-AE":{decrease:e=>`\u{62E}\u{641}\u{636} ${e.fieldLabel}`,increase:e=>`\u{632}\u{64A}\u{627}\u{62F}\u{629} ${e.fieldLabel}`,numberField:"حقل رقمي"},"bg-BG":{decrease:e=>`\u{41D}\u{430}\u{43C}\u{430}\u{43B}\u{44F}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{441}\u{438}\u{43B}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,numberField:"Номер на полето"},"cs-CZ":{decrease:e=>`Sn\xed\u{17E}it ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}it ${e.fieldLabel}`,numberField:"Č\xedseln\xe9 pole"},"da-DK":{decrease:e=>`Reducer ${e.fieldLabel}`,increase:e=>`\xd8g ${e.fieldLabel}`,numberField:"Talfelt"},"de-DE":{decrease:e=>`${e.fieldLabel} verringern`,increase:e=>`${e.fieldLabel} erh\xf6hen`,numberField:"Nummernfeld"},"el-GR":{decrease:e=>`\u{39C}\u{3B5}\u{3AF}\u{3C9}\u{3C3}\u{3B7} ${e.fieldLabel}`,increase:e=>`\u{391}\u{3CD}\u{3BE}\u{3B7}\u{3C3}\u{3B7} ${e.fieldLabel}`,numberField:"Πεδίο αριθμού"},"en-US":{decrease:e=>`Decrease ${e.fieldLabel}`,increase:e=>`Increase ${e.fieldLabel}`,numberField:"Number field"},"es-ES":{decrease:e=>`Reducir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de n\xfamero"},"et-EE":{decrease:e=>`V\xe4henda ${e.fieldLabel}`,increase:e=>`Suurenda ${e.fieldLabel}`,numberField:"Numbri v\xe4li"},"fi-FI":{decrease:e=>`V\xe4henn\xe4 ${e.fieldLabel}`,increase:e=>`Lis\xe4\xe4 ${e.fieldLabel}`,numberField:"Numerokentt\xe4"},"fr-FR":{decrease:e=>`Diminuer ${e.fieldLabel}`,increase:e=>`Augmenter ${e.fieldLabel}`,numberField:"Champ de nombre"},"he-IL":{decrease:e=>`\u{5D4}\u{5E7}\u{5D8}\u{5DF} ${e.fieldLabel}`,increase:e=>`\u{5D4}\u{5D2}\u{5D3}\u{5DC} ${e.fieldLabel}`,numberField:"שדה מספר"},"hr-HR":{decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"hu-HU":{decrease:e=>`${e.fieldLabel} cs\xf6kkent\xe9se`,increase:e=>`${e.fieldLabel} n\xf6vel\xe9se`,numberField:"Sz\xe1mmező"},"it-IT":{decrease:e=>`Riduci ${e.fieldLabel}`,increase:e=>`Aumenta ${e.fieldLabel}`,numberField:"Campo numero"},"ja-JP":{decrease:e=>`${e.fieldLabel}\u{3092}\u{7E2E}\u{5C0F}`,increase:e=>`${e.fieldLabel}\u{3092}\u{62E1}\u{5927}`,numberField:"数値フィールド"},"ko-KR":{decrease:e=>`${e.fieldLabel} \u{AC10}\u{C18C}`,increase:e=>`${e.fieldLabel} \u{C99D}\u{AC00}`,numberField:"번호 필드"},"lt-LT":{decrease:e=>`Suma\u{17E}inti ${e.fieldLabel}`,increase:e=>`Padidinti ${e.fieldLabel}`,numberField:"Numerio laukas"},"lv-LV":{decrease:e=>`Samazin\u{101}\u{161}ana ${e.fieldLabel}`,increase:e=>`Palielin\u{101}\u{161}ana ${e.fieldLabel}`,numberField:"Skaitļu lauks"},"nb-NO":{decrease:e=>`Reduser ${e.fieldLabel}`,increase:e=>`\xd8k ${e.fieldLabel}`,numberField:"Tallfelt"},"nl-NL":{decrease:e=>`${e.fieldLabel} verlagen`,increase:e=>`${e.fieldLabel} verhogen`,numberField:"Getalveld"},"pl-PL":{decrease:e=>`Zmniejsz ${e.fieldLabel}`,increase:e=>`Zwi\u{119}ksz ${e.fieldLabel}`,numberField:"Pole numeru"},"pt-BR":{decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de n\xfamero"},"pt-PT":{decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo num\xe9rico"},"ro-RO":{decrease:e=>`Sc\u{103}dere ${e.fieldLabel}`,increase:e=>`Cre\u{219}tere ${e.fieldLabel}`,numberField:"C\xe2mp numeric"},"ru-RU":{decrease:e=>`\u{423}\u{43C}\u{435}\u{43D}\u{44C}\u{448}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{432}\u{435}\u{43B}\u{438}\u{447}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,numberField:"Числовое поле"},"sk-SK":{decrease:e=>`Zn\xed\u{17E}i\u{165} ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}i\u{165} ${e.fieldLabel}`,numberField:"Č\xedseln\xe9 pole"},"sl-SI":{decrease:e=>`Upadati ${e.fieldLabel}`,increase:e=>`Pove\u{10D}ajte ${e.fieldLabel}`,numberField:"Številčno polje"},"sr-SP":{decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"sv-SE":{decrease:e=>`Minska ${e.fieldLabel}`,increase:e=>`\xd6ka ${e.fieldLabel}`,numberField:"Nummerf\xe4lt"},"tr-TR":{decrease:e=>`${e.fieldLabel} azalt`,increase:e=>`${e.fieldLabel} artt\u{131}r`,numberField:"Sayı alanı"},"uk-UA":{decrease:e=>`\u{417}\u{43C}\u{435}\u{43D}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,increase:e=>`\u{417}\u{431}\u{456}\u{43B}\u{44C}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,numberField:"Поле номера"},"zh-CN":{decrease:e=>`\u{964D}\u{4F4E} ${e.fieldLabel}`,increase:e=>`\u{63D0}\u{9AD8} ${e.fieldLabel}`,numberField:"数字字段"},"zh-TW":{decrease:e=>`\u{7E2E}\u{5C0F} ${e.fieldLabel}`,increase:e=>`\u{653E}\u{5927} ${e.fieldLabel}`,numberField:"數字欄位"}};var E9={};E9={"ar-AE":{Empty:"فارغ"},"bg-BG":{Empty:"Изпразни"},"cs-CZ":{Empty:"Pr\xe1zdn\xe9"},"da-DK":{Empty:"Tom"},"de-DE":{Empty:"Leer"},"el-GR":{Empty:"Άδειο"},"en-US":{Empty:"Empty"},"es-ES":{Empty:"Vac\xedo"},"et-EE":{Empty:"T\xfchjenda"},"fi-FI":{Empty:"Tyhj\xe4"},"fr-FR":{Empty:"Vide"},"he-IL":{Empty:"ריק"},"hr-HR":{Empty:"Prazno"},"hu-HU":{Empty:"\xdcres"},"it-IT":{Empty:"Vuoto"},"ja-JP":{Empty:"空"},"ko-KR":{Empty:"비어 있음"},"lt-LT":{Empty:"Tuščias"},"lv-LV":{Empty:"Tukšs"},"nb-NO":{Empty:"Tom"},"nl-NL":{Empty:"Leeg"},"pl-PL":{Empty:"Pusty"},"pt-BR":{Empty:"Vazio"},"pt-PT":{Empty:"Vazio"},"ro-RO":{Empty:"Gol"},"ru-RU":{Empty:"Не заполнено"},"sk-SK":{Empty:"Pr\xe1zdne"},"sl-SI":{Empty:"Prazen"},"sr-SP":{Empty:"Prazno"},"sv-SE":{Empty:"Tomt"},"tr-TR":{Empty:"Boş"},"uk-UA":{Empty:"Пусто"},"zh-CN":{Empty:"空"},"zh-TW":{Empty:"空白"}};let E8=()=>{};function De(e){var t;let n=(0,fZ.useRef)(void 0),{value:r,textValue:o,minValue:i,maxValue:a,isDisabled:s,isReadOnly:l,isRequired:u,onIncrement:c,onIncrementPage:d,onDecrement:f,onDecrementPage:p,onDecrementToMin:h,onIncrementToMax:m}=e,y=vb((t=E9)&&t.__esModule?t.default:t,"@react-aria/spinbutton"),g=(0,fZ.useRef)(!1),b=(0,fZ.useCallback)(()=>{clearTimeout(n.current),g.current=!1},[]),v=bb(()=>{b()});(0,fZ.useEffect)(()=>()=>v(),[]);let w=(0,fZ.useRef)(!1),x=()=>{w.current=!0},S=()=>{w.current=!1},E=""===o?y.format("Empty"):(o||`${r}`).replace("-","−");(0,fZ.useEffect)(()=>{w.current&&(b7&&b7.clear("assertive"),b9(E,"assertive"))},[E]);let D=(0,fZ.useCallback)(()=>{b()},[b]),O=bb(c??E8),P=bb(f??E8),k=bb(()=>{(void 0===a||isNaN(a)||void 0===r||isNaN(r)||r<a)&&(O(),C(60))}),C=bb(e=>{v(),g.current=!0,n.current=window.setTimeout(k,e)}),j=bb(()=>{(void 0===i||isNaN(i)||void 0===r||isNaN(r)||r>i)&&(P(),T(60))}),T=bb(e=>{v(),g.current=!0,n.current=window.setTimeout(j,e)}),R=e=>{e.preventDefault()},{addGlobalListener:A,removeAllGlobalListeners:M}=bv(),N=(0,fZ.useRef)(!1),[I,$]=(0,fZ.useState)(null);(0,fZ.useEffect)(()=>{"touch"===I?C(600):I&&C(400)},[I]);let[L,F]=(0,fZ.useState)(null);return(0,fZ.useEffect)(()=>{"touch"===L?T(600):L&&T(400)},[L]),{spinButtonProps:{role:"spinbutton","aria-valuenow":void 0===r||isNaN(r)?void 0:r,"aria-valuetext":E,"aria-valuemin":i,"aria-valuemax":a,"aria-disabled":s||void 0,"aria-readonly":l||void 0,"aria-required":u||void 0,onKeyDown:e=>{if(!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&!l&&!e.nativeEvent.isComposing)switch(e.key){case"PageUp":if(d){e.preventDefault(),d?.();break}case"ArrowUp":case"Up":c&&(e.preventDefault(),c?.());break;case"PageDown":if(p){e.preventDefault(),p?.();break}case"ArrowDown":case"Down":f&&(e.preventDefault(),f?.());break;case"Home":h&&(e.preventDefault(),h?.());break;case"End":m&&(e.preventDefault(),m?.())}},onFocus:x,onBlur:S},incrementButtonProps:{onPressStart:e=>{b(),"touch"!==e.pointerType?(c?.(),$("mouse")):(A(window,"pointercancel",D,{capture:!0}),N.current=!1,$("touch")),A(window,"contextmenu",R)},onPressUp:e=>{b(),"touch"===e.pointerType&&(N.current=!0),M(),$(null)},onPressEnd:e=>{b(),"touch"===e.pointerType&&!g.current&&N.current&&c?.(),N.current=!1,$(null)},onFocus:x,onBlur:S},decrementButtonProps:{onPressStart:e=>{b(),"touch"!==e.pointerType?(f?.(),F("mouse")):(A(window,"pointercancel",D,{capture:!0}),N.current=!1,F("touch"))},onPressUp:e=>{b(),"touch"===e.pointerType&&(N.current=!0),M(),F(null)},onPressEnd:e=>{b(),"touch"===e.pointerType&&!g.current&&N.current&&f?.(),N.current=!1,F(null)},onFocus:x,onBlur:S}}}let Dt=null;var Dn=n(72103);function Dr(e,t,n){let r="+"===e?t+n:t-n;if(t%1!=0||n%1!=0){let o=t.toString().split("."),i=n.toString().split("."),a=Math.pow(10,Math.max(o[1]&&o[1].length||0,i[1]&&i[1].length||0));t=Math.round(t*a),n=Math.round(n*a),r=("+"===e?t+n:t-n)/a}return r}let Do=(0,fZ.createContext)(null),Di=(0,fZ.createContext)(null),Da=(0,fZ.forwardRef)(function(e,t){var n,r;[e,t]=gt(e,t,Do);let{validationBehavior:o}=ge(x2)||{},i=null!=(r=null!=(n=e.validationBehavior)?n:o)?r:"native",{locale:a}=b5(),s=function(e){let{minValue:t,maxValue:n,step:r,formatOptions:o,value:i,defaultValue:a=NaN,onChange:s,locale:l,isDisabled:u,isReadOnly:c,commitBehavior:d="snap"}=e;null===i&&(i=NaN);let f=(0,fZ.useCallback)(e=>void 0===r||isNaN(r)?x8(e,t,n):St(e,t,n,r),[r,t,n]);void 0===i||isNaN(i)||"snap"!==d||(i=f(i)),isNaN(a)||"snap"!==d||(a=f(a));let[p,h]=_x(i,isNaN(a)?NaN:a,s),[m]=(0,fZ.useState)(p),[y,g]=(0,fZ.useState)(()=>isNaN(p)?"":new(0,xN.K)(l,o).format(p)),b=(0,fZ.useMemo)(()=>new(0,Dn.d)(l,o),[l,o]),v=(0,fZ.useMemo)(()=>b.getNumberingSystem(y),[b,y]),w=(0,fZ.useMemo)(()=>new(0,xN.K)(l,{...o,numberingSystem:v}),[l,o,v]),x=(0,fZ.useMemo)(()=>w.resolvedOptions(),[w]),S=(0,fZ.useCallback)(e=>isNaN(e)||null===e?"":w.format(e),[w]),E=xg({...e,value:p}),D=void 0===r||isNaN(r)?1:r;"percent"===x.style&&(void 0===r||isNaN(r))&&(D=.01);let[O,P]=(0,fZ.useState)(p),[k,C]=(0,fZ.useState)(l),[j,T]=(0,fZ.useState)(o);Object.is(p,O)&&l===k&&o===j||(g(S(p)),P(p),C(l),T(o));let R=(0,fZ.useMemo)(()=>b.parse(y),[b,y]),A=(e,r=0)=>{if(isNaN(R))return St(isNaN(r)?0:r,t,n,D);{let r=St(R,t,n,D);return"+"===e&&r>R||"-"===e&&r<R?r:St(Dr(e,R,D),t,n,D)}},M=(0,fZ.useMemo)(()=>!u&&!c&&(isNaN(R)||void 0===n||isNaN(n)||St(R,t,n,D)>R||Dr("+",R,D)<=n),[u,c,t,n,D,R]),N=(0,fZ.useMemo)(()=>!u&&!c&&(isNaN(R)||void 0===t||isNaN(t)||St(R,t,n,D)<R||Dr("-",R,D)>=t),[u,c,t,n,D,R]);return{...E,validate:e=>b.isValidPartialNumber(e,t,n),increment:()=>{let e=A("+",t);e===p&&g(S(e)),h(e),E.commitValidation()},incrementToMax:()=>{null!=n&&(h(St(n,t,n,D)),E.commitValidation())},decrement:()=>{let e=A("-",n);e===p&&g(S(e)),h(e),E.commitValidation()},decrementToMin:()=>{null!=t&&(h(t),E.commitValidation())},canIncrement:M,canDecrement:N,minValue:t,maxValue:n,numberValue:R,defaultNumberValue:isNaN(a)?m:a,setNumberValue:h,setInputValue:g,inputValue:y,commit:e=>{let t=void 0===e?y:e,n=R;if(void 0!==e&&(n=b.parse(t)),!t.length){h(NaN),g(void 0===i?"":S(p));return}if(isNaN(n))return void g(S(p));let r="snap"===d?f(n):n,o=(r=b.parse(S(r)))!==p;h(r),g(S(void 0===i?r:p)),o&&E.commitValidation()}}}({...e,locale:a,validationBehavior:i}),l=(0,fZ.useRef)(null),[u,c]=gn(!e["aria-label"]&&!e["aria-labelledby"]),{labelProps:d,groupProps:f,inputProps:p,incrementButtonProps:h,decrementButtonProps:m,descriptionProps:y,errorMessageProps:g,...b}=function(e,t,n){var r,o,i,a,s,l,u,c,d;let f,{id:p,decrementAriaLabel:h,incrementAriaLabel:m,isDisabled:y,isReadOnly:g,isRequired:b,minValue:v,maxValue:w,autoFocus:x,label:S,formatOptions:E,onBlur:D=()=>{},onFocus:O,onFocusChange:P,onKeyDown:k,onKeyUp:C,description:j,errorMessage:T,isWheelDisabled:R,...A}=e,{increment:M,incrementToMax:N,decrement:I,decrementToMin:$,numberValue:L,inputValue:F,commit:B,commitValidation:V}=t,U=vb((r=E6)&&r.__esModule?r.default:r,"@react-aria/numberfield"),W=(0,fZ.useCallback)(()=>{let e=n.current?.value??"";(0,bw.flushSync)(()=>{B()}),n.current?.value!==e&&b9(n.current?.value??"","assertive")},[B,n]),K=y4(p),{focusProps:z}=bo({onBlur(){W()}}),H=E7(E),G=(0,fZ.useMemo)(()=>H.resolvedOptions(),[H]),q=E7({...E,currencySign:void 0}),Z=(0,fZ.useMemo)(()=>isNaN(L)?"":q.format(L),[q,L]),{spinButtonProps:Y,incrementButtonProps:J,decrementButtonProps:Q}=De({isDisabled:y,isReadOnly:g,isRequired:b,maxValue:w,minValue:v,onIncrement:M,onIncrementToMax:N,onDecrement:I,onDecrementToMin:$,value:L,textValue:Z}),[X,ee]=(0,fZ.useState)(!1),{focusWithinProps:et}=bR({isDisabled:y,onFocusWithinChange:ee});!function(e,t){let{onScroll:n,isDisabled:r}=e,o=(0,fZ.useCallback)(e=>{!e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),n&&n({deltaX:e.deltaX,deltaY:e.deltaY}))},[n]);wP(t,"wheel",r?void 0:o)}({onScroll:(0,fZ.useCallback)(e=>{!(Math.abs(e.deltaY)<=Math.abs(e.deltaX))&&(e.deltaY>0?M():e.deltaY<0&&I())},[I,M]),isDisabled:R||y||g||!X},n);let en=(G.maximumFractionDigits??0)>0,er=void 0===t.minValue||isNaN(t.minValue)||t.minValue<0,eo="numeric";gL()?er?eo="text":en&&(eo="decimal"):gW()&&(er?eo="numeric":en&&(eo="decimal"));let ei=gh(e),ea=(0,fZ.useCallback)(e=>{e.nativeEvent.isComposing||("Enter"===e.key?((0,bw.flushSync)(()=>{B()}),V()):e.continuePropagation())},[B,V]),{isInvalid:es,validationErrors:el,validationDetails:eu}=t.displayValidation,{labelProps:ec,inputProps:ed,descriptionProps:ef,errorMessageProps:ep}=function(e,t,n){let r=bb(e=>{let r=n.current;if(!r)return;let o=null;switch(e.inputType){case"historyUndo":case"historyRedo":case"insertLineBreak":return;case"deleteContent":case"deleteByCut":case"deleteByDrag":o=r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteContentForward":o=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd+1):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteContentBackward":o=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart-1)+r.value.slice(r.selectionStart):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":o=r.value.slice(r.selectionStart);break;default:null!=e.data&&(o=r.value.slice(0,r.selectionStart)+e.data+r.value.slice(r.selectionEnd))}null!=o&&t.validate(o)||e.preventDefault()});(0,fZ.useEffect)(()=>{if(!E5()||!n.current)return;let e=n.current;return e.addEventListener("beforeinput",r,!1),()=>{e.removeEventListener("beforeinput",r,!1)}},[n]);let o=E5()?null:e=>{let n=gw(e).value.slice(0,gw(e).selectionStart)+e.data+gw(e).value.slice(gw(e).selectionEnd);t.validate(n)||e.preventDefault()},{labelProps:i,inputProps:a,descriptionProps:s,errorMessageProps:l,...u}=function(e,t){let{inputElementType:n="input",isDisabled:r=!1,isRequired:o=!1,isReadOnly:i=!1,type:a="text",validationBehavior:s="aria"}=e,[l,u]=_x(e.value,e.defaultValue||"",e.onChange),{focusableProps:c}=bl(e,t),d=xg({...e,value:l}),{isInvalid:f,validationErrors:p,validationDetails:h}=d.displayValidation,{labelProps:m,fieldProps:y,descriptionProps:g,errorMessageProps:b}=xo({...e,isInvalid:f,errorMessage:e.errorMessage||p}),v=gh(e,{labelable:!0}),w={type:a,pattern:e.pattern},[x]=(0,fZ.useState)(l);return xi(t,e.defaultValue??x,u),xa(e,d,t),{labelProps:m,inputProps:y5(v,"input"===n?w:void 0,{disabled:r,readOnly:i,required:o&&"native"===s,"aria-required":o&&"aria"===s||void 0,"aria-invalid":f||void 0,"aria-errormessage":e["aria-errormessage"],"aria-activedescendant":e["aria-activedescendant"],"aria-autocomplete":e["aria-autocomplete"],"aria-haspopup":e["aria-haspopup"],"aria-controls":e["aria-controls"],value:l,onChange:e=>u(gw(e).value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,form:e.form,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(fY().version,10)>=17?"enterKeyHint":"enterkeyhint"]:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...c,...y}),descriptionProps:g,errorMessageProps:b,isInvalid:f,validationErrors:p,validationDetails:h}}(e,n),c=(0,fZ.useRef)(null);return{inputProps:y5(a,{onBeforeInput:o,onCompositionStart(){let{value:e,selectionStart:t,selectionEnd:r}=n.current;c.current={value:e,selectionStart:t,selectionEnd:r}},onCompositionEnd(){if(n.current&&!t.validate(n.current.value)){let{value:e,selectionStart:r,selectionEnd:o}=c.current;n.current.value=e,n.current.setSelectionRange(r,o),t.setInputValue(e)}}}),labelProps:i,descriptionProps:s,errorMessageProps:l,...u}}({...A,...ei,name:void 0,form:void 0,label:S,autoFocus:x,isDisabled:y,isReadOnly:g,isRequired:b,validate:void 0,[xy]:t,value:F,defaultValue:"!",autoComplete:"off","aria-label":e["aria-label"]||void 0,"aria-labelledby":e["aria-labelledby"]||void 0,id:K,type:"text",inputMode:eo,onChange:e=>{t.validate(e)&&t.setInputValue(e)},onBlur:D,onFocus:O,onFocusChange:P,onKeyDown:(0,fZ.useMemo)(()=>yK(ea,k),[ea,k]),onKeyUp:C,onPaste:t=>{e.onPaste?.(t);let n=gw(t);n&&(n.selectionEnd??-1)-(n.selectionStart??0)===n.value.length&&(t.preventDefault(),B(t.clipboardData?.getData?.("text/plain")?.trim()??""))},description:j,errorMessage:T},t,n);xi(n,t.defaultNumberValue,t.setNumberValue),o=t,i=e.validationBehavior,a=e.commitBehavior,s=n,l=t.minValue,u=t.maxValue,c=e.step,d=t.numberValue,yz(()=>{let e=s.current;if("validate"!==a||o.realtimeValidation.isInvalid||!e||e.disabled||(!Dt&&"u">typeof document&&((Dt=document.createElement("input")).type="number"),!Dt))return;Dt.min=null==l||isNaN(l)?"":String(l),Dt.max=null==u||isNaN(u)?"":String(u),Dt.step=null==c||isNaN(c)?"":String(c),Dt.value=null==d||isNaN(d)?"":String(d);let t=e.validity.valid&&Dt.validity.valid,n=e.validationMessage||Dt.validationMessage,r={isInvalid:!t,validationErrors:n?[n]:[],validationDetails:{badInput:e.validity.badInput,customError:e.validity.customError,patternMismatch:e.validity.patternMismatch,rangeOverflow:Dt.validity.rangeOverflow,rangeUnderflow:Dt.validity.rangeUnderflow,stepMismatch:Dt.validity.stepMismatch,tooLong:e.validity.tooLong,tooShort:e.validity.tooShort,typeMismatch:e.validity.typeMismatch,valueMissing:e.validity.valueMissing,valid:t}};o.updateValidation(r),"native"!==i||Dt.validity.valid||e.setCustomValidity(Dt.validationMessage)});let eh=y5(Y,z,ed,{role:null,"aria-roledescription":gB()?null:U.format("numberField"),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false"});"native"===e.validationBehavior&&(eh["aria-required"]=void 0);let em=e=>{((e=document)=>e.activeElement)()!==n.current&&("mouse"===e.pointerType?n.current?.focus():e.target.focus())},ey=e["aria-label"]||("string"==typeof e.label?e.label:"");ey||(f=null!=e.label?ec.id:e["aria-labelledby"]);let eg=y4(),eb=y4(),ev=y5(J,{"aria-label":m||U.format("increase",{fieldLabel:ey}).trim(),id:f&&!m?eg:null,"aria-labelledby":f&&!m?`${eg} ${f}`:null,"aria-controls":K,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canIncrement,onPressStart:em}),ew=y5(Q,{"aria-label":h||U.format("decrease",{fieldLabel:ey}).trim(),id:f&&!h?eb:null,"aria-labelledby":f&&!h?`${eb} ${f}`:null,"aria-controls":K,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canDecrement,onPressStart:em});return{groupProps:{...et,role:"group","aria-disabled":y,"aria-invalid":es?"true":void 0},labelProps:ec,inputProps:eh,incrementButtonProps:ev,decrementButtonProps:ew,errorMessageProps:ep,descriptionProps:ef,isInvalid:es,validationErrors:el,validationDetails:eu}}({...gr(e),label:c,validationBehavior:i},s,l),v=y8({...e,values:{state:s,isDisabled:e.isDisabled||!1,isInvalid:b.isInvalid||!1,isRequired:e.isRequired||!1},defaultClassName:"react-aria-NumberField"}),w=gh(e);return delete w.id,fY().createElement(y9,{values:[[Di,s],[_B,f],[_U,{...p,ref:l}],[x4,{...d,ref:u}],[bU,{slots:{increment:h,decrement:m}}],[bz,{slots:{description:y,errorMessage:g}}],[xX,b]]},fY().createElement("div",{...w,...v,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-required":e.isRequired||void 0,"data-invalid":b.isInvalid||void 0}),e.name&&fY().createElement("input",{type:"hidden",name:e.name,value:isNaN(s.numberValue)?"":s.numberValue}))});function Ds(e,t){return Number.parseInt(EW(e,{calendar:t.calendar,locale:t.baseName,day:!1,month:!1,noToday:!0,numberingSystem:"latn"}))}let Dl=(0,fZ.forwardRef)(function(e,t){let{className:n}=e,r=(0,fZ.useContext)(_j),o=(0,fZ.useContext)(_T),i=r??o,a=(0,fZ.useContext)(E2),s=wl(),l=EW(i.visibleRange.start.toDate(s),{calendar:a.calendar,locale:a.baseName,day:!1,year:!1,noToday:!0}),u=Ds(i.visibleRange.start.toDate(s),a),c=i.maxValue?Ds(i.maxValue.toDate(s),a):void 0,d=i.minValue?Ds(i.minValue.toDate(s),a):void 0,f=(0,fZ.useCallback)(e=>{i.setFocusedDate(i.focusedDate.cycle("year",e-i.focusedDate.year))},[]);return i&&(0,hq.jsxs)("span",{ref:t,className:n,children:[(0,hq.jsx)("span",{children:l}),(0,hq.jsxs)(Da,{formatOptions:{useGrouping:!1},maxValue:c,minValue:d,onChange:f,value:u,children:[(0,hq.jsx)(_W,{}),(0,hq.jsxs)(_V,{children:[(0,hq.jsx)(bW,{slot:"increment",children:(0,hq.jsx)(my,{size:8})}),(0,hq.jsx)(bW,{slot:"decrement",children:(0,hq.jsx)(mp,{size:8})})]})]})]})}),Du="-esm-form-engine__datepicker-module__inputGroup___gBam-",Dc="-esm-form-engine__datepicker-module__inputSegment___wIJDZ",Dd="-esm-form-engine__datepicker-module__dateInputWrapper___LiY68",Df="-esm-form-engine__datepicker-module__invalidText___A4cv4",Dp="-esm-form-engine__datepicker-module__flatButton___HcpME",Dh="-esm-form-engine__datepicker-module__flatButtonMd___eFpyF",Dm="-esm-form-engine__datepicker-module__flatButtonSm___tsawR",Dy="-esm-form-engine__datepicker-module__flatButtonLg___4HG5y";function Dg({children:e}){let t=(0,fZ.useContext)(S0),n=(0,fZ.useContext)(S1),r=t??n,o=hy(()=>r?.close());return(0,hq.jsx)(xQ,{className:"-esm-form-engine__datepicker-module__dialog___DaqYi",ref:o,children:e})}let Db=(0,fZ.forwardRef)(function({variant:e,today_:t,minDate:n,maxDate:r},o){let i="range"===e;return(0,hq.jsx)(SZ,{ref:o,className:"-esm-form-engine__datepicker-module__popover___nAPzC",placement:"bottom start",offset:1,isNonModal:!0,children:(0,hq.jsx)(Dg,{children:(0,hq.jsxs)(i?_A:_R,{...i?{minValue:n,maxValue:r,className:"cds--date-picker__calendar"}:{},children:[(0,hq.jsxs)("header",{className:"-esm-form-engine__datepicker-module__header___rPv3L",children:[(0,hq.jsx)(bW,{className:hY()(Dp,Dh),slot:"previous",children:(0,hq.jsx)(mS,{size:16})}),(0,hq.jsx)(Dl,{className:"-esm-form-engine__datepicker-module__monthYear___Rw4qE"}),(0,hq.jsx)(bW,{className:hY()(Dp,Dh),slot:"next",children:(0,hq.jsx)(mE,{size:16})})]}),(0,hq.jsx)(_N,{className:"-esm-form-engine__datepicker-module__calendarGrid___yKV-n",children:e=>(0,hq.jsx)(_F,{className:hY()("cds--date-picker__day",{"-esm-form-engine__datepicker-module__today___KzMTn":0===t.compare(e)}),date:e},e.toString())})]})})})}),Dv=(0,fZ.forwardRef)(function(e,t){let n=(0,fZ.useContext)(S0),[r,o]=gt({slot:e.slot},t,xB),{locale:i}=b5(),a=xF({...r,locale:i,createCalendar:_p}),s=(0,fZ.useRef)(null),{fieldProps:l,inputProps:u}=xc({...r,inputRef:s},a,o),c=(0,fZ.useCallback)(()=>{a.isDisabled||n.toggle()},[]);return(0,hq.jsxs)(y9,{values:[[xV,a],[_U,{...u,ref:s}],[_B,{...l,ref:o,isInvalid:a.isInvalid}]],children:[(0,hq.jsx)(_V,{...e,id:e.id,ref:t,slot:e.slot||void 0,className:e.className,isDisabled:a.isDisabled,isInvalid:a.isInvalid,onClick:c,children:a.segments.map((t,n)=>(0,fZ.cloneElement)(e.children(t),{key:n}))}),(0,hq.jsx)(_W,{})]})}),Dw=(0,fZ.forwardRef)(function(e,t){let n=(0,fZ.useContext)(S0),r=(0,fZ.useContext)(S1);return(n??r).isInvalid?(0,hq.jsx)(yT,{ref:t,size:16,...e}):(0,hq.jsx)(mf,{ref:t,size:16,...e})});class D_{constructor(e,t){this.locale=e,this.dictionary=t}of(e){return this.dictionary.getStringForLocale(e,this.locale)}}let Dx=new Map,DS=(0,fZ.forwardRef)(function({segment:e,...t},n){let r=(0,fZ.useContext)(xV),o=yV(n),{segmentProps:i}=function(e,t,n){let r,o,i,a,s=(0,fZ.useRef)(""),{locale:l,direction:u}=b5(),c=function(){var e;let{locale:t}=b5(),n=vg((e=xt)&&e.__esModule?e.default:e,"@react-aria/datepicker");return(0,fZ.useMemo)(()=>{try{return new Intl.DisplayNames(t,{type:"dateTimeField"})}catch{return new D_(t,n)}},[t,n])}(),{ariaLabel:d,ariaLabelledBy:f,ariaDescribedBy:p,focusManager:h}=xs.get(t),m=e.isPlaceholder?"":e.text,y=(0,fZ.useMemo)(()=>t.dateFormatter.resolvedOptions(),[t.dateFormatter]),g=vl({month:"long",timeZone:y.timeZone}),b=vl({hour:"numeric",hour12:y.hour12,timeZone:y.timeZone});if("month"!==e.type||e.isPlaceholder)"hour"!==e.type||e.isPlaceholder||(m=b.format(t.dateValue));else{let e=g.format(t.dateValue);m=e!==m?`${m} \u{2013} ${e}`:e}let{spinButtonProps:v}=De({value:e.value??void 0,textValue:m,minValue:e.minValue,maxValue:e.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly||!e.isEditable,isRequired:t.isRequired,onIncrement:()=>{s.current="",t.increment(e.type)},onDecrement:()=>{s.current="",t.decrement(e.type)},onIncrementPage:()=>{s.current="",t.incrementPage(e.type)},onDecrementPage:()=>{s.current="",t.decrementPage(e.type)},onIncrementToMax:()=>{s.current="",t.incrementToMax(e.type)},onDecrementToMin:()=>{s.current="",t.decrementToMin(e.type)}}),w=(0,fZ.useMemo)(()=>new(0,Dn.d)(l,{maximumFractionDigits:0}),[l]),x=()=>{if(e.text===e.placeholder&&h.focusPrevious(),!w.isValidPartialNumber(e.text)||t.isReadOnly||e.isPlaceholder)("dayPeriod"===e.type||"era"===e.type)&&t.clearSegment(e.type);else{let n=e.text.slice(0,-1),r=w.parse(n);0===(n=0===r?"":n).length||0===r?t.clearSegment(e.type):t.setSegment(e.type,r),s.current=n}},{startsWith:S}=(r=function(e){let{locale:t}=b5(),n=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(Dx.has(n))return Dx.get(n);let r=new Intl.Collator(t,e);return Dx.set(n,r),r}({usage:"search",sensitivity:"base"}),o=(0,fZ.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===r.compare(e.slice(0,t.length),t)),[r]),i=(0,fZ.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===r.compare(e.slice(-t.length),t)),[r]),a=(0,fZ.useCallback)((e,t)=>{if(0===t.length)return!0;e=e.normalize("NFC");let n=0,o=(t=t.normalize("NFC")).length;for(;n+o<=e.length;n++){let i=e.slice(n,n+o);if(0===r.compare(t,i))return!0}return!1},[r]),(0,fZ.useMemo)(()=>({startsWith:o,endsWith:i,contains:a}),[o,i,a])),E=vl({hour:"numeric",hour12:!0}),D=(0,fZ.useMemo)(()=>{let e=new Date;return e.setHours(0),E.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[E]),O=(0,fZ.useMemo)(()=>{let e=new Date;return e.setHours(12),E.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[E]),P=vl({year:"numeric",era:"narrow",timeZone:"UTC"}),k=(0,fZ.useMemo)(()=>{if("era"!==e.type)return[];let n=v5(new vH(1,1,1),t.calendar),r=t.calendar.getEras().map(e=>{let t=n.set({year:1,month:1,day:1,era:e}).toDate("UTC");return{era:e,formatted:P.formatToParts(t).find(e=>"era"===e.type).value}}),o=function(e){e.sort();let t=e[0],n=e[e.length-1];for(let e=0;e<t.length;e++)if(t[e]!==n[e])return e;return 0}(r.map(e=>e.formatted));if(o)for(let e of r)e.formatted=e.formatted.slice(o);return r},[P,t.calendar,e.type]),C=n=>{if(t.isDisabled||t.isReadOnly)return;let r=s.current+n;switch(e.type){case"dayPeriod":if(S(D,n))t.setSegment("dayPeriod",0);else if(S(O,n))t.setSegment("dayPeriod",1);else break;h.focusNext();break;case"era":{let e=k.find(e=>S(e.formatted,n));e&&(t.setSegment("era",e.era),h.focusNext());break}case"day":case"hour":case"minute":case"second":case"month":case"year":{if(!w.isValidPartialNumber(r))return;let o=w.parse(r),i=o;if(void 0!==e.maxValue&&o>e.maxValue&&(i=w.parse(n)),isNaN(o))return;t.setSegment(e.type,i),void 0!==e.maxValue&&(Number(o+"0")>e.maxValue||r.length>=String(e.maxValue).length)?(s.current="",h.focusNext()):s.current=r}}};wP((0,fZ.useRef)("u">typeof document?document:null),"selectionchange",()=>{let e=window.getSelection();e?.anchorNode&&gv(n.current,e?.anchorNode)&&e.collapse(n.current)});let j=(0,fZ.useRef)("");wP(n,"beforeinput",r=>{if(n.current)switch(r.preventDefault(),r.inputType){case"deleteContentBackward":case"deleteContentForward":w.isValidPartialNumber(e.text)&&!t.isReadOnly&&x();break;case"insertCompositionText":j.current=n.current.textContent,n.current.textContent=n.current.textContent;break;default:null!=r.data&&C(r.data)}}),wP(n,"input",e=>{let{inputType:t,data:r}=e;"insertCompositionText"===t&&(n.current&&(n.current.textContent=j.current),null!=r&&(S(D,r)||S(O,r))&&C(r))}),yz(()=>{let e=n.current;return()=>{((e=document)=>e.activeElement)()===e&&(h.focusPrevious()||h.focusNext())}},[n,h]);let T=gB()||"timeZoneName"===e.type?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{};e===(0,fZ.useMemo)(()=>t.segments.find(e=>e.isEditable),[t.segments])||t.isInvalid||(p=void 0);let R=y4(),A=!t.isDisabled&&!t.isReadOnly&&e.isEditable,M="literal"===e.type?"":c.of(e.type),N=wx({"aria-label":`${M}${d?`, ${d}`:""}${f?", ":""}`,"aria-labelledby":f});if("literal"===e.type)return{segmentProps:{"aria-hidden":!0}};let I={caretColor:"transparent"};if("rtl"===u){I.unicodeBidi="embed";let t=y[e.type];("numeric"===t||"2-digit"===t)&&(I.direction="ltr")}return{segmentProps:y5(v,N,{id:R,...T,"aria-invalid":t.isInvalid?"true":void 0,"aria-describedby":p,"aria-readonly":t.isReadOnly||!e.isEditable?"true":void 0,"data-placeholder":e.isPlaceholder||void 0,contentEditable:A,suppressContentEditableWarning:A,spellCheck:A?"false":void 0,autoCorrect:A?"off":void 0,[parseInt(fY().version,10)>=17?"enterKeyHint":"enterkeyhint"]:A?"next":void 0,inputMode:t.isDisabled||"dayPeriod"===e.type||"era"===e.type||!A?void 0:"numeric",tabIndex:t.isDisabled?void 0:0,onKeyDown:e=>{if("a"===e.key&&(g$()?e.metaKey:e.ctrlKey)&&e.preventDefault(),!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey)switch(e.key){case"Backspace":case"Delete":e.preventDefault(),e.stopPropagation(),x()}},onFocus:()=>{s.current="",n.current&&wR(n.current,{containingElement:wC(n.current)});let e=window.getSelection();e?.collapse(n.current)},style:I,onPointerDown(e){e.stopPropagation()},onMouseDown(e){e.stopPropagation()}})}}(e,r,o),{focusProps:a,isFocused:s,isFocusVisible:l}=bA(),{hoverProps:u,isHovered:c}=bL({...t,isDisabled:r.isDisabled||"literal"===e.type}),d=function(e){let{className:t,style:n,children:r,defaultClassName:o,defaultChildren:i,defaultStyle:a,values:s}=e;return(0,fZ.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:o}):t,l="function"==typeof n?n({...s,defaultStyle:a||{}}):n,u="function"==typeof r?r({...s,defaultChildren:i}):null==r?i:r,{className:e??o,style:l||a?{...a,...l}:void 0,children:u??i,"data-rac":""}},[t,n,r,o,i,a,s])}({...t,values:{...e,isReadOnly:!e.isEditable,isInvalid:r.isInvalid,isDisabled:r.isDisabled,isHovered:c,isFocused:s,isFocusVisible:l},defaultChildren:e.text}),f=(0,fZ.useCallback)(e=>{e.stopPropagation()},[]);return(0,hq.jsx)("span",{...y5(gh(t),i,a,u),...d,ref:o,style:i.style,"data-placeholder":e.isPlaceholder||void 0,"data-invalid":r.isInvalid||void 0,"data-readonly":!e.isEditable||void 0,"data-disabled":r.isDisabled||void 0,"data-type":e.type,"data-hovered":c||void 0,"data-focused":s||void 0,"data-focus-visible":l||void 0,onClick:f})}),DE={short:!1,size:"md"},DD=(0,fZ.forwardRef)(function(e,t){let{className:n,defaultValue:r,isDisabled:o,invalid:i,invalidText:a,isInvalid:s,label:l,labelText:u,light:c,maxDate:d,minDate:f,onChange:p,onChangeRaw:h,short:m,size:y,value:g,...b}={...DE,...e},{calendar:v,intlLocale:w,today_:x}=E4(),S=(0,fZ.useId)(),E=!!(u??l),D=(0,fZ.useMemo)(()=>S6(r,v),[r,v]),O=(0,fZ.useMemo)(()=>S6(g,v,!0),[g,v]),P=(0,fZ.useMemo)(()=>S6(d,v),[d,v]),k=(0,fZ.useMemo)(()=>S6(f??E3,v),[f,v]),C=(0,fZ.useMemo)(()=>i||s,[i,s]),j=(0,fZ.useMemo)(()=>(h&&p&&console.error("An OpenmrsDatePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),h??(e=>p?.(S5(e)))),[h,p]);return(0,hq.jsx)(S3,{locale:w.toString(),children:(0,hq.jsx)("div",{className:hY()("cds--form-item",n),children:(0,hq.jsx)(y9,{values:[[E2,w]],children:(0,hq.jsxs)(S2,{className:hY()("cds--date-picker","cds--date-picker--single",{"cds--date-picker--short":m,"cds--date-picker--light":c}),defaultValue:D,isDisabled:o,isInvalid:C,maxValue:P,minValue:k,value:O,shouldForceLeadingZeros:"en"===w.language||void 0,...b,onChange:j,children:[(0,hq.jsxs)("div",{className:"cds--date-picker-container",children:[E&&(0,hq.jsx)(x3,{className:hY()("cds--label",{"cds--label--disabled":o}),htmlFor:S,children:u??l}),(0,hq.jsxs)(_V,{className:Du,children:[(0,hq.jsx)(Dv,{id:E?S:void 0,ref:t,className:hY()("cds--date-picker-input__wrapper","-esm-form-engine__datepicker-module__inputWrapper___uKdT1",{"-esm-form-engine__datepicker-module__inputWrapperSm___0RXJc":"sm"===y,"-esm-form-engine__datepicker-module__inputWrapperMd___4Vff1":"md"===y||!y||0===y.length,"-esm-form-engine__datepicker-module__inputWrapperLg___VCRm5":"lg"===y}),children:e=>"era"!==e.type?(0,hq.jsx)(DS,{className:Dc,segment:e}):(0,hq.jsx)(fY().Fragment,{})}),(0,hq.jsx)(bW,{className:hY()(Dp,{[Dm]:"sm"===y,[Dh]:"md"===y||!y||0===y.length,[Dy]:"lg"===y}),children:(0,hq.jsx)(Dw,{})})]}),(0,hq.jsx)(x0,{className:Df,children:a})]}),(0,hq.jsx)(Db,{variant:"single",today_:x})]})})})})}),DO=(0,fZ.forwardRef)(function({className:e,defaultValue:t,invalid:n,invalidText:r,isDisabled:o,isInvalid:i,label:a,labelText:s,light:l,maxDate:u,minDate:c,onChange:d,onChangeRaw:f,size:p="md",value:h,...m},y){let{calendar:g,intlLocale:b,today_:v}=E4(),w=(0,fZ.useId)(),x=!!(s??a),S=(0,fZ.useMemo)(()=>{if(h)return{start:S6(h[0],g,!1),end:S6(h[1],g,!1)}},[h,g]),E=(0,fZ.useMemo)(()=>{if(t)return{start:S6(t[0],g,!1),end:S6(t[1],g,!1)}},[t,g]),D=(0,fZ.useMemo)(()=>S6(c??E3,g,!0),[c,g]),O=(0,fZ.useMemo)(()=>S6(u,g,!0),[u,g]),P=(0,fZ.useMemo)(()=>n||i,[n,i]),k=(0,fZ.useMemo)(()=>(f&&d&&console.error("An OpenmrsDateRangePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),f??(e=>d?.([S5(e.start),S5(e.end)]))),[f,d]);return(0,hq.jsx)(S3,{locale:b.toString(),children:(0,hq.jsx)("div",{className:hY()("cds--form-item",e),children:(0,hq.jsx)(y9,{values:[[E2,b]],children:(0,hq.jsx)(S4,{id:x?w:void 0,className:hY()("cds--date-picker",{"cds--date-picker--light":l,"cds--date-picker--disabled":o}),isInvalid:P,shouldForceLeadingZeros:"en"===b.language||void 0,maxValue:O,minValue:D,value:S,defaultValue:E,ref:y,isDisabled:o,...m,onChange:k,children:(0,hq.jsxs)("div",{className:"cds--date-picker-container",children:[x&&(0,hq.jsx)(x3,{className:hY()("cds--label",{"cds--label--disabled":o}),htmlFor:w,children:s??a}),(0,hq.jsxs)(_V,{className:Du,children:[(0,hq.jsxs)("div",{className:hY()("-esm-form-engine__datepicker-module__inputsWrapper___xXRQI",{"-esm-form-engine__datepicker-module__inputsWrapperSm___nL+b6":"sm"===p,"-esm-form-engine__datepicker-module__inputsWrapperMd___Kgcps":"md"===p||!p||0===p.length,"-esm-form-engine__datepicker-module__inputsWrapperLg___raaSN":"lg"===p}),children:[(0,hq.jsx)(xW,{className:hY()("cds--date-picker-input__wrapper","-esm-form-engine__datepicker-module__startInput___cWw-5",Dd),slot:"start",children:e=>(0,hq.jsx)(DS,{className:Dc,segment:e})}),(0,hq.jsx)("div",{className:"-esm-form-engine__datepicker-module__separator___Ddb4g",children:(0,hq.jsx)("span",{"aria-hidden":"true","data-readonly":!0,children:"–"})}),(0,hq.jsx)(xW,{className:hY()("cds--date-picker-input__wrapper","-esm-form-engine__datepicker-module__endInput___xdYOl",Dd),slot:"end",children:e=>(0,hq.jsx)(DS,{className:Dc,segment:e})})]}),(0,hq.jsx)(bW,{className:hY()(Dp,{[Dm]:"sm"===p,[Dh]:"md"===p||!p||0===p.length,[Dy]:"lg"===p}),children:(0,hq.jsx)(Dw,{})})]}),(0,hq.jsx)(x0,{className:Df,children:r}),(0,hq.jsx)(Db,{variant:"range",today_:v,minDate:D,maxDate:O})]})})})})})}),DP=({diagnoses:e})=>{let{diagnosisTags:t}=pq({externalModuleName:"@openmrs/esm-styleguide"});return(0,hq.jsx)("div",{className:"-esm-form-engine__diagnosis-tags-module__container___1iigI",children:e.map(e=>{let{rank:n,uuid:r,display:o}=e,i=t[1===n?"primaryColor":"secondaryColor"];return(0,hq.jsx)(h1.vwO,{type:i,children:o},r)})})},Dk={action:"-esm-form-engine__empty-card-module__action___oG778",content:"-esm-form-engine__empty-card-module__content___YUXvR",desktopHeading:"-esm-form-engine__empty-card-module__desktopHeading___EljiH",tabletHeading:"-esm-form-engine__empty-card-module__tabletHeading___8mc7w",tile:"-esm-form-engine__empty-card-module__tile___3-rRO"},DC=({width:e="64",height:t="64"})=>(0,hq.jsx)("svg",{width:e,height:t,viewBox:"0 0 64 64",children:(0,hq.jsx)("use",{href:"#omrs-empty-data-illustration"})}),Dj=e=>{let t="tablet"===hd(),n=e.launchForm;return(0,hq.jsx)(h1.Wdr,{className:Dk.layer,children:(0,hq.jsxs)(h1.FAs,{className:Dk.tile,children:[(0,hq.jsx)("div",{className:t?Dk.tabletHeading:Dk.desktopHeading,children:(0,hq.jsx)("h4",{children:e.headerTitle})}),(0,hq.jsx)(DC,{}),(0,hq.jsx)("p",{className:Dk.content,children:iV("emptyStateText","There are no {{displayText}} to display",{displayText:e.displayText})}),(0,hq.jsx)("p",{className:Dk.action,children:n&&(0,hq.jsx)(h1.$nd,{onClick:()=>n(),kind:"ghost",size:t?"lg":"sm",children:iV("recordNewEntry","Record {{ displayText }}",{displayText:e.displayText})})})]})})},DT=({error:e,headerTitle:t})=>{let n="tablet"===hd();return(0,hq.jsx)(h1.Wdr,{children:(0,hq.jsxs)(h1.FAs,{className:"-esm-form-engine__error-state-module__tile___mzWLn",children:[(0,hq.jsx)("div",{className:n?"-esm-form-engine__error-state-module__tabletHeading___l7Cpn":"-esm-form-engine__error-state-module__desktopHeading___p57fl",children:(0,hq.jsx)("h4",{children:t})}),(0,hq.jsxs)("p",{className:"-esm-form-engine__error-state-module__errorMessage___0fU6v",children:[iV("error","Error")," ",`${e?.response?.status}: `,e?.response?.statusText]}),(0,hq.jsx)("p",{className:"-esm-form-engine__error-state-module__errorCopy___xkVog",children:iV("errorCopy")})]})})},DR=DT,DA=fY().forwardRef((e,t)=>{let{slotName:n,basePath:r,componentContext:o,state:i}=hh(),a=window.location??{pathname:""},s=pe(n??"");return e.isChildOfHeader&&n&&s.length>0?(0,hq.jsxs)(h1.f8J,{"aria-label":iV("leftNavigation","Left navigation"),className:"-esm-form-engine__left-nav-module__leftNav___czP9T",expanded:!0,isFixedNav:!0,ref:t,...e,children:[(0,hq.jsx)(pr,{name:"global-nav-menu-slot"}),n?(0,hq.jsx)(pL,{value:o,fallback:(0,hq.jsx)(pr,{name:n,state:{basePath:r,currentPath:a,...i}}),children:(0,hq.jsx)(fJ.Provider,{value:o,children:(0,hq.jsx)(pr,{name:n,state:{basePath:r,currentPath:a,...i}})})}):null]}):null}),DM=({selectedLocationUuid:e,defaultLocationUuid:t,locationTag:n,locationsPerRequest:r=50,onChange:o})=>{let[i,a]=(0,fZ.useState)(""),s=(0,fZ.useId)(),{location:l}=function(e){let t=e?`/ws/fhir2/R4/Location?_id=${e}`:null,{data:n,error:r,isLoading:o}=pX()(t,oF,{shouldRetryOnError:e=>!!e?.response?.status&&e.response.status>=500});return(0,fZ.useMemo)(()=>({location:n?.data?.entry?n.data.entry[0]:null,error:t?r:null,isLoading:!!t&&o}),[n,o,r,t])}(t),{locations:u,isLoading:c,hasMore:d,loadingNewData:f,error:p,setPage:h}=function(e,t=0,n=""){let r=pJ(n),{data:o,isLoading:i,isValidating:a,setSize:s,error:l}=hr()(function(n,o){if(o){let e=o.data?.link?.find(e=>"next"===e.relation);if(!e)return null;let t=new URL(e.url);return t.origin===window.location.origin?e.url:new URL(`${t.pathname}${t.search?`?${t.search}`:""}`,window.location.origin).toString()}let i=`${oI}/Location?`,a=new URLSearchParams;return a.append("_summary","data"),t&&a.append("_count",""+t),n&&a.append("_getpagesoffset",""+n*t),e&&a.append("_tag",e),"string"==typeof r&&""!==r&&a.append("name:contains",r),i+a.toString()},oF);return(0,fZ.useMemo)(()=>({locations:o?.length?o?.flatMap(e=>e?.data?.entry??[]):[],isLoading:i,totalResults:o?.[0]?.data?.total,hasMore:!!o?.length&&o?.[o.length-1]?.data?.link?.some(e=>"next"===e.relation),loadingNewData:a,error:l||null,setPage:s}),[i,o,a,s,l])}(n,r,i),m=(0,fZ.useMemo)(()=>l&&!i&&t?[l,...u.filter(({resource:e})=>e.id!==t)]:u??[],[l,u,t,i]),y=(0,fZ.useCallback)(e=>{o(),a(e.trim())},[o]),g=hg((0,fZ.useCallback)(()=>{!f&&d&&h(e=>e+1)},[f,d,h])),b=d?Math.max(0,Math.floor(m.length-r/2)):-1;return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)(h1.vji,{"aria-describedby":p?`${s}-error`:void 0,labelText:iV("searchForLocation"),id:s,placeholder:iV("searchForLocation"),onChange:e=>y(e.target.value),size:"lg"}),p&&(0,hq.jsx)("div",{className:"-esm-form-engine__location-picker-module__errorNotification___NfvTe",id:`${s}-error`,children:(0,hq.jsx)(h1.jeF,{kind:"error",subtitle:iV("errorLoadingLoginLocations","Unable to load login locations. Please try again or contact support if the problem persists."),title:iV("error","Error")})}),(0,hq.jsx)("div",{className:"-esm-form-engine__location-picker-module__searchResults___agplm",children:c?(0,hq.jsx)("div",{className:"-esm-form-engine__location-picker-module__loadingContainer___EHghS",children:Array.from({length:5}).map((e,t)=>(0,hq.jsx)(h1.Psq,{className:"-esm-form-engine__location-picker-module__radioButtonSkeleton___up5rH",role:"progressbar"},t))}):(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("div",{className:"-esm-form-engine__location-picker-module__locationResultsContainer___06YOS",children:m.length>0?(0,hq.jsx)(h1.zWQ,{name:"loginLocations",onChange:e=>{o(e?.toString())},orientation:"vertical",valueSelected:e,children:m.map((e,t)=>(0,hq.jsx)(h1.aaP,{className:"-esm-form-engine__location-picker-module__locationRadioButton___yKif7",id:e.resource.id,labelText:(0,hq.jsx)("span",{ref:t===b?g:null,children:e.resource.name}),name:e.resource.name,value:e.resource.id},e.resource.id))}):(0,hq.jsx)("div",{className:"-esm-form-engine__location-picker-module__emptyState___cPWp8",children:(0,hq.jsx)("p",{className:"-esm-form-engine__location-picker-module__locationNotFound___b14++",children:iV("noResultsToDisplay")})})}),f&&(0,hq.jsx)("div",{className:"-esm-form-engine__location-picker-module__loadingIcon___GVlrq",children:(0,hq.jsx)(h1.OuH,{description:iV("loading")})})]})})]})},DN=Z("modalState",{modalContainer:null,modalStack:[]}),DI=0;async function D$(e,t,n={}){let r=fO(t),o=null;if(e){if(!r)throw Error(`No modal named '${t}' has been registered.`);let{load:i}=r,a=await i(),s=DI++;o=await fz({...a,name:`${t}-${s}`},{...n,domElement:e})}else I(`Failed to launch modal. Please notify your administrator. Modal name: ${t}`);return o}function DL(e){return"TO_BE_DELETED"===e.state||"DELETED"===e.state}function DF(e,t){t?.unmount&&(t.unmountPromise?.catch(()=>{}),t.unmount().catch(t=>{console.error(`The modal '${e}' failed to unmount`,t)}))}function DB(e){return e.find(e=>!DL(e))}function DV(e,t){e.container&&(e.container.style.visibility=t?"unset":"hidden")}let DU=window.getComputedStyle(document.body).overflow;function DW({modalStack:e,modalContainer:t}){if(t)if(e.length){t.style.visibility||(addEventListener("keydown",Dz),document.body.style.overflow="hidden",t.style.visibility="unset");let n=DB(e);e.forEach(e=>{switch(e.state){case"NEW":{let n=function({size:e}){let t=document.createElement("div");return t.className=`cds--modal-container cds--modal-container--${e}`,t.setAttribute("role","dialog"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-modal","true"),t}({size:e.props?.size??"md"});e.container=n,e.state="MOUNTING",D$(n,e.modalName,e.props).then(r=>{DL(e)?DF(e.modalName,r):r?(e.parcel=r,t.prepend(n),DV(e,DB(DN.getState().modalStack)===e),r.mountPromise.then(()=>{DL(e)||(e.state="MOUNTED")},t=>{I(t),e.parcel=null,DK(e)})):DK(e)},t=>{I(t),DK(e)});break}case"MOUNTING":case"MOUNTED":DV(e,e===n);break;case"TO_BE_DELETED":e.state="DELETED",e.onClose(),DF(e.modalName,e.parcel),e.container?.remove(),setTimeout(()=>{let t=DN.getState();DN.setState({...t,modalStack:t.modalStack.filter(t=>t!==e)})},0)}})}else t.style.removeProperty("visibility"),document.body.style.overflow=DU,removeEventListener("keydown",Dz)}function DK(e){if(DL(e))return;e.state="TO_BE_DELETED";let t=DN.getState();DN.setState({...t,modalStack:[...t.modalStack]})}function Dz(e){"Escape"===e.key&&function(){let[e]=DN.getState().modalStack;e&&DK(e)}()}function DH(e){DN.subscribe(DW),DN.setState({...DN.getState(),modalContainer:e})}function DG(e,t={},n=()=>{}){let r=()=>{let e=DN.getState().modalStack.find(e=>e.onClose===n);e&&DK(e)};if(fO(e)){var o;let i,a;o={state:"NEW",onClose:n,modalName:e,props:{close:r,...t}},a=[o,...(i=DN.getState()).modalStack],DN.setState({...i,modalStack:a})}else I(`Failed to launch modal. Please notify your administrator. Modal name: "${e}"`);return r}var Dq=n(33696);let DZ=({notification:e})=>{let{description:t,action:n,kind:r,critical:o,title:i,onAction:a}=e;return(0,hq.jsx)(h1.kZS,{actionButtonLabel:n,kind:r||"info",lowContrast:o,subtitle:t,title:i||"",inline:!0,onActionButtonClick:a})},DY=({subject:e})=>{let[t,n]=(0,fZ.useState)([]);return(0,fZ.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.description!==e.description||t.action!==e.action||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(DZ,{notification:e},e.id))})},DJ=({notification:e})=>{let{actionButtonLabel:t,onActionButtonClick:n=()=>{},subtitle:r,kind:o,title:i,critical:a,progressActionLabel:s,id:l,...u}=e,[c,d]=(0,fZ.useState)(t);return(0,hq.jsx)(h1.kZS,{kind:o||"info",actionButtonLabel:c,ariaLabel:iV("closesActionableNotification","Closes actionable notification"),onActionButtonClick:()=>{n(),s&&d(s)},statusIconDescription:iV("actionableNotification","Actionable notification"),subtitle:r,title:i,lowContrast:a,inline:!0,...u})},DQ=({subject:e})=>{let[t,n]=(0,fZ.useState)([]);return(0,fZ.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(DJ,{notification:e},e.id))})};var DX=n(75992);let D0=new Dq.B7,D1=0,D2=new Dq.B7,D4=0;function D3(e){e&&(0,po.createRoot)(e).render((0,hq.jsx)(DY,{subject:D0}))}function D6(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&(t instanceof Error||!(0,DX.A)(t)))?(e.description instanceof Error&&(e.description=e.description.toLocaleString()),setTimeout(()=>{D0.next({...e,id:D1++})},0)):console.error("showNotification must be called with an object having a 'description' property that is a non-empty string or object")}function D5(e){e&&(0,po.createRoot)(e).render((0,hq.jsx)(DQ,{subject:D2}))}function D7(e){var t;e&&("string"==typeof(t=e.actionButtonLabel)?t.trim().length>0:"object"==typeof t&&!(0,DX.A)(t))?setTimeout(()=>{D2.next({...e,id:D4++})},0):console.error("showActionableNotification must be called with an actionButtonLabel that is a non-empty string")}let D9=["NORMAL","HIGH","CRITICALLY_HIGH","OFF_SCALE_HIGH","LOW","CRITICALLY_LOW","OFF_SCALE_LOW"],D8=["critically_low","critically_high","high","low","normal","off_scale_low","off_scale_high"],Oe={container:"-esm-form-engine__numeric-observation-module__container___gS0Wg",card:"-esm-form-engine__numeric-observation-module__card___w0fF5","abnormal-value":"-esm-form-engine__numeric-observation-module__abnormal-value___xuX3W","critical-value":"-esm-form-engine__numeric-observation-module__critical-value___Jynsn",cell:"-esm-form-engine__numeric-observation-module__cell___tMhBJ","critically-high":"-esm-form-engine__numeric-observation-module__critically-high___3L2wx","critically-low":"-esm-form-engine__numeric-observation-module__critically-low___XP+HX",high:"-esm-form-engine__numeric-observation-module__high___JV9do",low:"-esm-form-engine__numeric-observation-module__low___-uDKD","label-container":"-esm-form-engine__numeric-observation-module__label-container___vTf2y","value-container":"-esm-form-engine__numeric-observation-module__value-container___xTUIC",label:"-esm-form-engine__numeric-observation-module__label___-pfmb",value:"-esm-form-engine__numeric-observation-module__value___1A4zt",units:"-esm-form-engine__numeric-observation-module__units___SzvX+","pad-right":"-esm-form-engine__numeric-observation-module__pad-right___ND9XL","off-scale-low":"-esm-form-engine__numeric-observation-module__off-scale-low___gFAv9","off-scale-high":"-esm-form-engine__numeric-observation-module__off-scale-high___aSEmX",arrow:"-esm-form-engine__numeric-observation-module__arrow___9bvsX"},Ot=({value:e,unit:t,label:n,interpretation:r,referenceRange:o,conceptUuid:i,variant:a="card",patientUuid:s})=>{let l=(0,fZ.useId)(),{referenceRange:u,isLoading:c}=function(e,t){let n=null;e&&(n=t?`${oN}/conceptreferencerange/?patient=${t}&concept=${e}&v=full`:`${oN}/conceptreferencerange/?concept=${e}&v=full`);let{data:r,error:o,isLoading:i}=pX()(n,oF),a=r?.data?.results?.[0];return{referenceRange:a?{hiNormal:a.hiNormal??null,hiAbsolute:a.hiAbsolute??null,hiCritical:a.hiCritical??null,lowNormal:a.lowNormal??null,lowAbsolute:a.lowAbsolute??null,lowCritical:a.lowCritical??null}:void 0,error:o,isLoading:i}}(o||r?void 0:i,s),d=o??u,f=(0,fZ.useMemo)(()=>{if(r)return r?"--"===r?"normal":D9.includes(r)?r.toLowerCase():D8.includes(r)?r:"normal":void 0;if(d&&!c){if(!d||null==e||""===e)return"normal";let t="string"==typeof e?Number.parseFloat(e):e;return Number.isNaN(t)?"normal":null!==d.hiAbsolute&&void 0!==d.hiAbsolute&&t>d.hiAbsolute?"off_scale_high":null!==d.hiCritical&&void 0!==d.hiCritical&&t>=d.hiCritical?"critically_high":null!==d.hiNormal&&void 0!==d.hiNormal&&t>d.hiNormal?"high":null!==d.lowAbsolute&&void 0!==d.lowAbsolute&&t<d.lowAbsolute?"off_scale_low":null!==d.lowCritical&&void 0!==d.lowCritical&&t<=d.lowCritical?"critically_low":null!==d.lowNormal&&void 0!==d.lowNormal&&t<d.lowNormal?"low":"normal"}return"normal"},[r,d,e,c])??"normal",p="critically_low"===f||"critically_high"===f||"off_scale_low"===f||"off_scale_high"===f,h="normal"!==f,m=n?`omrs-numeric-obs-label-${n.replaceAll(/\s+/g,"-").toLowerCase()}-${l}`:void 0,y=`omrs-numeric-obs-value-${l}`,g=`omrs-numeric-obs-unit-${l}`,b=null!=e&&""!==e,v=b?e:iV("notAvailable","Not available"),w=hY()({[Oe["critically-low"]]:"critically_low"===f||"off_scale_low"===f,[Oe["critically-high"]]:"critically_high"===f||"off_scale_high"===f,[Oe.low]:"low"===f,[Oe.high]:"high"===f,[Oe["off-scale-low"]]:"off_scale_low"===f,[Oe["off-scale-high"]]:"off_scale_high"===f}),x=hY()({[Oe.container]:!0,[Oe.card]:!0,[Oe["critical-value"]]:p,[Oe["abnormal-value"]]:h&&!p}),S=hY()({[Oe.cell]:!0,[w]:!0});return"cell"===a?(0,hq.jsxs)("div",{className:S,children:[v,b&&t?` ${t}`:""]}):(0,hq.jsxs)("section",{className:x,"data-testid":"numeric-observation-card",children:[n&&(0,hq.jsxs)("div",{className:Oe["label-container"],children:[(0,hq.jsx)("span",{id:m,className:Oe.label,children:n}),h&&(0,hq.jsx)("span",{className:Oe[f.replace("_","-")],title:iV("abnormalValue","Abnormal value")})]}),(0,hq.jsxs)("div",{className:Oe["value-container"],children:[(0,hq.jsx)("span",{id:y,"aria-labelledby":m&&g?`${m} ${g}`:m||g||void 0,className:Oe.value,children:v}),b&&t&&(0,hq.jsx)("span",{id:g,className:Oe.units,children:t})]})]})},On="-esm-form-engine__page-header-module__pageHeader___6TOjO",Or=e=>{if("children"in e){let{children:t,className:n,...r}=e;return(0,hq.jsx)("div",{className:hY()(On,n),...r,children:t})}{let{title:t,illustration:n,className:r,...o}=e;return(0,hq.jsx)("div",{className:hY()(On,r),...o,children:(0,hq.jsx)(Oo,{title:t,illustration:n})})}},Oo=({title:e,illustration:t,className:n})=>{let[r,o]=(0,fZ.useState)(null);return(0,fZ.useEffect)(()=>{nO("@openmrs/esm-styleguide").then(e=>{o(e)})},[]),(0,hq.jsxs)("div",{className:hY()("-esm-form-engine__page-header-module__pageHeaderContent___mCImT",n),children:[t,(0,hq.jsxs)("div",{className:"-esm-form-engine__page-header-module__pageLabels___kqDS+",children:[r?.implementationName&&(0,hq.jsx)("p",{children:iV(r.implementationName)}),(0,hq.jsx)("p",{className:"-esm-form-engine__page-header-module__pageName___SbZBC",children:e})]})]})},Oi=({totalItems:e,pageSize:t,onPageNumberChange:n,pageNumber:r,dashboardLinkUrl:o,currentItems:i,dashboardLinkLabel:a})=>{let{pageSizes:s,pageItemsCount:l}=hw(t,e,r,i),u="tablet"===hd(),c=iV("paginationItemsCount","{{pageItemsCount}} / {{totalItems}} items",{totalItems:e,pageItemsCount:l});return(0,hq.jsx)(hq.Fragment,{children:e>0&&(0,hq.jsxs)("div",{className:hY()({"-esm-form-engine__pagination-module__tablet___82gj1":u,"-esm-form-engine__pagination-module__desktop___6yI8e":!u}),children:[(0,hq.jsxs)("div",{children:[c,o&&(0,hq.jsx)(fQ,{to:o,className:"-esm-form-engine__pagination-module__configurableLink___oIqma",children:a??iV("seeAll","See all")})]}),(0,hq.jsx)(h1.dKS,{className:"-esm-form-engine__pagination-module__pagination___A-Lcg",page:r,pageSize:t,pageSizes:s,totalItems:e,onChange:n,pageRangeText:(e,t)=>iV("paginationOfPages","of {{count}} pages",{count:t}),size:u?"lg":"sm"})]})})};function Oa(e){return Ol(Oc(e,"usual","official"))}function Os(e){return Oa(e)}function Ol(e){var t;let n;return e?e.text??(n=(t=e).given??[],(t.family?n.concat(t.family):n).join(" ")):""}function Ou(e){return Ol(e)}function Oc(e,...t){for(let n of(0==t.length&&(t=["usual"]),t)){let t=e.name?.find(e=>{var t,r;return t=e,r=n,t.use?t.use===r:"usual"===r});if(t)return t}}function Od(e,t=hk()()){let n=hk()(t),r=EZ(e,n);if(null==r)return null;let o=n.diff(r,"hours"),i=n.diff(r,"days"),a=n.diff(r,"weeks"),s=n.diff(r,"months"),l=n.diff(r,"years"),u={};if(o<2)u.minutes=n.diff(r,"minutes");else if(i<2)u.hours=o;else if(a<4)u.days=i;else if(l<1){let e=n.subtract(a,"weeks").diff(r,"days");u.weeks=a,u.days=e}else if(l<2){let e=n.subtract(s,"months").diff(r,"days");u.months=s,u.days=e}else if(l<18){let e=n.subtract(l,"year").diff(r,"months");u.years=l,u.months=e}else u.years=l;return u}function Of(e,t=hk()()){let n=Od(e,t);if(null==n)return null;let r={style:"short",localeMatcher:"lookup"};return"minutes"in n&&0===n.minutes&&(r.minutesDisplay="always"),Eq(n,r)}let Op={container:"-esm-form-engine__patient-banner-patient-info-module__container___iC32K",activePatientContainer:"-esm-form-engine__patient-banner-patient-info-module__activePatientContainer___OoDPd",patientBanner:"-esm-form-engine__patient-banner-patient-info-module__patientBanner___swajU",patientName:"-esm-form-engine__patient-banner-patient-info-module__patientName___+2+Xi",patientAvatar:"-esm-form-engine__patient-banner-patient-info-module__patientAvatar___Rdf75",patientAvatarButton:"-esm-form-engine__patient-banner-patient-info-module__patientAvatarButton___A1q8c",patientInfo:"-esm-form-engine__patient-banner-patient-info-module__patientInfo___L-cOQ",demographics:"-esm-form-engine__patient-banner-patient-info-module__demographics___IDhb0",row:"-esm-form-engine__patient-banner-patient-info-module__row___TP7gU",flexRow:"-esm-form-engine__patient-banner-patient-info-module__flexRow___vNMt2",tagsSlot:"-esm-form-engine__patient-banner-patient-info-module__tagsSlot___0Dvjn",identifiers:"-esm-form-engine__patient-banner-patient-info-module__identifiers___d3GTJ",identifier:"-esm-form-engine__patient-banner-patient-info-module__identifier___kc6eq",primaryIdentifier:"-esm-form-engine__patient-banner-patient-info-module__primaryIdentifier___ZxRUU",secondaryIdentifier:"-esm-form-engine__patient-banner-patient-info-module__secondaryIdentifier___eQh8x",value:"-esm-form-engine__patient-banner-patient-info-module__value___CoAOR",tag:"-esm-form-engine__patient-banner-patient-info-module__tag___InccN",gender:"-esm-form-engine__patient-banner-patient-info-module__gender___vfinx",separator:"-esm-form-engine__patient-banner-patient-info-module__separator___3OIBl",tooltipPadding:"-esm-form-engine__patient-banner-patient-info-module__tooltipPadding___hBqWG",tooltipSmallText:"-esm-form-engine__patient-banner-patient-info-module__tooltipSmallText___bPnkq",actionsButtonText:"-esm-form-engine__patient-banner-patient-info-module__actionsButtonText___VNvm7"};function Oh({showIdentifierLabel:e,type:t,value:n}){return(0,hq.jsx)("span",{className:Op.primaryIdentifier,children:(0,hq.jsxs)(h1.vwO,{className:Op.tag,type:"gray",children:[e&&t?.text&&(0,hq.jsxs)("span",{className:Op.label,children:[t.text,": "]}),(0,hq.jsx)("span",{className:Op.value,children:n})]})})}function Om({showIdentifierLabel:e,type:t,value:n}){return(0,hq.jsxs)(h1.lRv,{className:Op.secondaryIdentifier,id:`patient-banner-identifier-${n}`,children:[e&&(0,hq.jsxs)("span",{className:Op.label,children:[t?.text,": "]}),(0,hq.jsx)("span",{className:Op.value,children:n})]})}function Oy({identifiers:e,showIdentifierLabel:t}){let{excludePatientIdentifierCodeTypes:n}=pq(),{primaryIdentifierCode:r}=hS(),o=e?.filter(e=>{let t=e.type?.coding?.[0]?.code;return t&&!n?.uuids.includes(t)})??[];return(0,hq.jsx)(hq.Fragment,{children:o?.length?o.map(({value:e,type:n},i)=>(0,hq.jsxs)(fY().Fragment,{children:[(0,hq.jsx)("span",{className:Op.identifier,children:n?.coding?.[0]?.code===r?(0,hq.jsx)(Oh,{showIdentifierLabel:t,type:n,value:e}):(0,hq.jsx)(Om,{showIdentifierLabel:t,type:n,value:e})}),i<o.length-1&&(0,hq.jsx)("span",{className:Op.separator,children:"\xb7"})]},e)):""})}let Og={Female:mI,Male:m$,Other:mL,Unknown:mF},Ob=({gender:e})=>{let t=Og[e];return t?(0,hq.jsx)(t,{fill:"#525252"}):null},Ov={male:"Male",female:"Female",other:"Other",unknown:"Unknown"};function Ow({patient:e,renderedFrom:t}){var n;let r,o,i=Oa(e),a=e?.gender&&(o=Ov[r=(n=e.gender).toLowerCase()]??"Unknown",{displayText:iV(r,n),iconKey:o}),s=(0,fZ.useMemo)(()=>({patientUuid:e.id,patient:e,renderedFrom:t}),[e.id,e,t]);return(0,hq.jsxs)("div",{className:Op.patientInfo,children:[(0,hq.jsx)("div",{className:hY()(Op.row,Op.patientNameRow),children:(0,hq.jsxs)("div",{className:Op.flexRow,children:[(0,hq.jsx)("span",{className:Op.patientName,children:i}),a&&(0,hq.jsxs)("div",{className:Op.gender,children:[(0,hq.jsx)(Ob,{gender:a.iconKey}),(0,hq.jsx)("span",{children:a.displayText})]}),(0,hq.jsx)(pr,{className:Op.tagsSlot,name:"patient-banner-tags-slot",state:s})]})}),(0,hq.jsxs)("div",{className:Op.demographics,children:[e.birthDate&&(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("span",{children:Of(e.birthDate)}),(0,hq.jsx)("span",{className:Op.separator,children:"\xb7"}),(0,hq.jsx)("span",{children:EU(e.birthDate,{time:!1})}),(0,hq.jsx)("span",{className:Op.separator,children:"\xb7"})]}),(0,hq.jsx)(Oy,{identifiers:e.identifier,showIdentifierLabel:!0}),(0,hq.jsx)(pr,{className:Op.extensionSlot,name:"patient-banner-bottom-slot",state:s})]})]})}var O_=n(58742);let Ox=fY().forwardRef(function({children:e,size:t=16,...n},r){return fY().createElement(O_.A,{width:t,height:t,ref:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},ed||(ed=fY().createElement("circle",{cx:"16",cy:"8",r:"2"})),ef||(ef=fY().createElement("circle",{cx:"16",cy:"16",r:"2"})),ep||(ep=fY().createElement("circle",{cx:"16",cy:"24",r:"2"})),e)});function OS({patient:e,patientUuid:t,actionsSlotName:n,additionalActionsSlotState:r}){let[o,i]=(0,fZ.useState)(!1),{extensions:a}=pt(n),s="tablet"===hd(),l=hy(()=>i(!1),o),u=(0,fZ.useRef)(null),c=(0,fZ.useRef)(null),d=(0,fZ.useId)(),f=`patient-actions-menu-trigger-${d}`,p=`patient-actions-menu-${d}`,h=(0,fZ.useCallback)(()=>i(e=>!e),[]),m=(0,fZ.useCallback)(()=>{i(!1),u.current?.focus()},[]),y=(0,fZ.useCallback)(e=>{if("Escape"===e.key&&o){e.stopPropagation(),m();return}if(("ArrowDown"===e.key||"ArrowUp"===e.key)&&o){e.preventDefault();let t=c.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!t?.length)return;let n=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,r=Array.from(t).indexOf(n);if(-1===r)return void t["ArrowDown"===e.key?0:t.length-1]?.focus();let o=r+("ArrowDown"===e.key?1:-1),i=o<0?t.length-1:o>=t.length?0:o;t[i]?.focus()}},[m,o]);(0,fZ.useEffect)(()=>{if(o&&c.current){let e=c.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[o]);let g=(0,fZ.useMemo)(()=>({patientUuid:t,patient:e,closeMenu:m,...r}),[t,e,m,r]);return 0===a.length?null:(0,hq.jsx)("div",{className:"-esm-form-engine__patient-banner-actions-menu-module__overflowMenuContainer___FbFcO",children:(0,hq.jsxs)("div",{"data-overflow-menu":!0,className:hY()("cds--overflow-menu",h3),ref:l,children:[(0,hq.jsxs)("button",{className:hY()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":o},h7),"aria-controls":p,"aria-expanded":o,"aria-haspopup":"true",id:f,onClick:h,onKeyDown:y,ref:u,children:[(0,hq.jsx)("span",{className:"-esm-form-engine__patient-banner-actions-menu-module__actionsButtonText___hk4xW",children:iV("actions","Actions")})," ",(0,hq.jsx)(Ox,{size:16,style:{marginLeft:"0.5rem",fill:"#78A9FF"}})]}),(0,hq.jsxs)("div",{className:hY()("cds--overflow-menu-options","cds--overflow-menu--flip",h6,{[h5]:o}),"aria-labelledby":f,"data-floating-menu-direction":"bottom",id:p,onKeyDown:y,ref:c,role:"menu",tabIndex:-1,children:[(0,hq.jsx)("ul",{className:hY()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":s}),children:(0,hq.jsx)(pr,{name:n,state:g},n)}),(0,hq.jsx)("span",{})]})]})})}var OE=n(35570),OD=n.n(OE);function OO(e){let{patientPhotoConceptUuid:t}=pq({externalModuleName:"@openmrs/esm-styleguide"}),n=t?`${oN}/obs?patient=${e}&concept=${t}&v=full`:null,{data:r,error:o,isLoading:i}=pw()(e?n:null,oF),a=r?.data?.results[0];return{data:a?{dateTime:a?.obsDatetime,imageSrc:a?.value?.links?.uri}:null,error:o,isLoading:i}}let OP=({width:e=56,height:t=56,"aria-label":n})=>{let{t:r}=(0,pb.useTranslation)();return(0,hq.jsxs)("svg",{"aria-label":n??r("patientPhotoPlaceholder","Patient photo placeholder"),width:e,height:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,hq.jsx)("path",{fill:"#ffffff",d:"M0 0h56v56H0z"}),(0,hq.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m36.75 20.134-.884-.884L19.25 35.866l.884.884 1.25-1.25H34.25a1.252 1.252 0 0 0 1.25-1.25V21.384l1.25-1.25Zm-2.5 14.116H22.634l4.87-4.87 1.487 1.486a1.25 1.25 0 0 0 1.768 0l.991-.991 2.5 2.498v1.877Zm0-3.645-1.616-1.616a1.25 1.25 0 0 0-1.768 0l-.991.991-1.486-1.486 5.861-5.86v7.971Zm-12.5 1.145v-1.875l3.125-3.123.858.859.885-.885-.86-.86a1.25 1.25 0 0 0-1.767 0l-2.241 2.242V21.75h10V20.5h-10c-.69 0-1.25.56-1.25 1.25v10h1.25Z",fill:"#8D8D8D"})]})},Ok="-esm-form-engine__patient-photo-module__avatar___thboZ";function OC({patientUuid:e,patientName:t,alt:n}){let{data:r,isLoading:o}=OO(e),[i,a]=(0,fZ.useState)(null),[s,l]=(0,fZ.useState)(!1),u=(0,fZ.useMemo)(()=>OD().generate(e),[e]);(0,fZ.useEffect)(()=>{if(r?.imageSrc){let e=new URL(r.imageSrc,window.location.origin).pathname;l(!0);let t=!1,n=new Image;return n.onload=()=>{t||(a(e),l(!1))},n.onerror=()=>{t||(a(null),l(!1))},n.src=e,()=>{t=!0}}a(null),l(!1)},[r?.imageSrc]);let c=(0,fZ.useMemo)(()=>n||(i?iV("patientPhotoAlt","Profile photo of {{patientName}}",{patientName:t}):iV("patientAvatarAlt","Avatar for {{patientName}}",{patientName:t})),[n,i,t]);return o||s?(0,hq.jsx)(h1.ryE,{className:"-esm-form-engine__patient-photo-module__skeleton___WWtyX","data-testid":"skeleton-icon"}):r?.imageSrc&&!i?(0,hq.jsx)(OP,{"aria-label":iV("patientPhotoPlaceholder","Photo placeholder for {{patientName}}",{patientName:t})}):i?(0,hq.jsx)("div",{"aria-label":c,children:(0,hq.jsx)("img",{className:Ok,src:i,alt:c,title:t})}):(0,hq.jsx)("div",{"aria-label":c,children:(0,hq.jsx)("div",{className:Ok,title:t,style:{backgroundImage:u.toDataUrl(),backgroundRepeat:"no-repeat",backgroundSize:"cover"},children:(0,hq.jsx)("span",{className:"-esm-form-engine__patient-photo-module__initials___xLeEF",children:function(e,t=3){return e.split(/\s+/).filter(Boolean).slice(0,t).map(e=>e[0]).join("")}(t)})})})}let Oj=["omrs-pict-appointments","omrs-pict-assessment-1","omrs-pict-assessment-2","omrs-pict-blood-bank","omrs-pict-cardiology","omrs-pict-ct-scan","omrs-pict-dentistry","omrs-pict-digital-trust","omrs-pict-emergency-department","omrs-pict-facility","omrs-pict-geriatrics","omrs-pict-gynaecology","omrs-pict-in-patient","omrs-pict-laboratory","omrs-pict-labs-2","omrs-pict-metadata-export","omrs-pict-obstetrics","omrs-pict-patient-search","omrs-pict-patients","omrs-pict-payments-desk","omrs-pict-pharmacy","omrs-pict-pharmacy-2","omrs-pict-registration","omrs-pict-service-queues","omrs-pict-stock-management","omrs-pict-transfer","omrs-pict-triage","omrs-pict-x-ray"],OT=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-appointments",pictogramProps:e})})),OR=OT,OA=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-assessment-1",pictogramProps:e})})),OM=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-assessment-2",pictogramProps:e})})),ON=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-blood-bank",pictogramProps:e})})),OI=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-cardiology",pictogramProps:e})})),O$=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-ct-scan",pictogramProps:e})})),OL=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-dentistry",pictogramProps:e})})),OF=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-digital-trust",pictogramProps:e})})),OB=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-emergency-department",pictogramProps:e})})),OV=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-facility",pictogramProps:e})})),OU=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-geriatrics",pictogramProps:e})})),OW=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-gynaecology",pictogramProps:e})})),OK=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-in-patient",pictogramProps:e})})),Oz=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-laboratory",pictogramProps:e})})),OH=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-labs-2",pictogramProps:e})})),OG=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-metadata-export",pictogramProps:e})})),Oq=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-obstetrics",pictogramProps:e})})),OZ=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-patient-search",pictogramProps:e})})),OY=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-patients",pictogramProps:e})})),OJ=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-payments-desk",pictogramProps:e})})),OQ=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-pharmacy",pictogramProps:e})})),OX=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-pharmacy-2",pictogramProps:e})})),O0=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-registration",pictogramProps:e})})),O1=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-service-queues",pictogramProps:e})})),O2=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-stock-management",pictogramProps:e})})),O4=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-transfer",pictogramProps:e})})),O3=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-triage",pictogramProps:e})})),O6=(0,fZ.memo)((0,fZ.forwardRef)(function(e,t){return(0,hq.jsx)(O8,{ref:t,pictogram:"omrs-pict-x-ray",pictogramProps:e})})),O5=OV,O7=OY,O9=(0,fZ.memo)((0,fZ.forwardRef)(function({pictogram:e,fallback:t,...n},r){let o=(0,fZ.useRef)(document.getElementById(e));return(0,fZ.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),n=new MutationObserver(t=>{for(let n of t)"childList"===n.type&&(o.current=document.getElementById(e))});return t&&n.observe(t,{childList:!0}),()=>n.disconnect()},[e]),(0,hq.jsx)(pL,{value:o.current,fallback:t,children:(0,hq.jsx)(O8,{ref:r,pictogram:e,pictogramProps:n})})})),O8=(0,fZ.memo)((0,fZ.forwardRef)(function({pictogram:e,pictogramProps:t},n){let{className:r,size:o}=Object.assign({},{size:92},t);return(o<=26||o>144)&&(console.error(`Invalid size '${o}' specified for ${e}. Defaulting to 92.`),o=92),(0,hq.jsx)("svg",{ref:n,className:hY()("-esm-form-engine__pictograms-module__pictogram___ooPKM",r),height:o,width:o,children:(0,hq.jsx)("use",{href:`#${e}`})})})),Pe=({children:e})=>"tablet"===hd()?(0,hq.jsx)(h1.Wdr,{children:e}):(0,hq.jsx)(hq.Fragment,{children:e}),Pt=({snackbar:e,closeSnackbar:t})=>{let{actionButtonLabel:n="",kind:r="success",onActionButtonClick:o=()=>{},isLowContrast:i="error"!==r,progressActionLabel:a,subtitle:s="",timeoutInMs:l=5e3,autoClose:u="error"!==r,title:c,id:d,...f}=e,[p,h]=(0,fZ.useState)(n),[m,y]=(0,fZ.useState)(!0),[g,b]=(0,fZ.useState)(!1),v=(0,fZ.useCallback)(()=>{setTimeout(t,250)},[t]),w=(0,fZ.useCallback)(()=>{b(!0),v()},[v]);return(0,fZ.useEffect)(()=>{if(u){let e=setTimeout(w,l);return()=>clearTimeout(e)}},[l,u,w]),(0,fZ.useEffect)(()=>{y(!1),window.setTimeout(()=>{y(!0)},0)},[]),(0,hq.jsx)(h1.kZS,{actionButtonLabel:p,"aria-label":iV("closeSnackbar","Close snackbar"),className:hY()("-esm-form-engine__snackbar-module__slideIn___senVE",{"-esm-form-engine__snackbar-module__animated___8eltL":m,"-esm-form-engine__snackbar-module__slideOut___BIIXm":g}),kind:r,lowContrast:i,onActionButtonClick:()=>{o(),w(),a&&h(a)},onClose:v,statusIconDescription:iV("snackbarNotification","Snackbar notification"),subtitle:s,title:c,...f})},Pn=({subject:e})=>{let[t,n]=(0,fZ.useState)([]),r=(0,fZ.useCallback)(e=>{n(t=>t.filter(t=>t!==e))},[]);return(0,fZ.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(Pt,{snackbar:e,closeSnackbar:()=>r(e)},e.id))})},Pr=new Dq.B7,Po=0;function Pi(e){e&&(0,po.createRoot)(e).render((0,hq.jsx)(Pn,{subject:Pr}))}function Pa(e){var t;e&&"string"==typeof(t=e.title)&&t.trim().length>0?setTimeout(()=>{Pr.next({...e,id:Po++})},0):console.error("showSnackbar must be called with an object having a 'title' property that is a non-empty string")}let Ps=({toast:e,closeToast:t})=>{let{description:n,kind:r,critical:o,title:i,actionButtonLabel:a,onActionButtonClick:s=()=>{}}=e,l=(0,fZ.useCallback)(()=>{s(),t()},[t,s]);return(0,hq.jsx)("div",{children:(0,hq.jsx)(h1.kZS,{actionButtonLabel:a,kind:r||"info",lowContrast:o,subtitle:n,title:i||"",onActionButtonClick:l,onClose:t})})},Pl=({subject:e})=>{let[t,n]=(0,fZ.useState)([]),r=(0,fZ.useCallback)(e=>{n(t=>t.filter(t=>t!==e))},[]);return(0,fZ.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.description!==e.description||t.kind!==e.kind||t.title!==e.title||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(Ps,{toast:e,closeToast:()=>r(e)},e.id))})},Pu=new Dq.B7,Pc=0;function Pd(e){e&&(0,po.createRoot)(e).render((0,hq.jsx)(Pl,{subject:Pu}))}function Pf(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&!(0,DX.A)(t))?setTimeout(()=>{Pu.next({...e,id:Pc++})},0):console.error("showToast must be called with an object having a 'description' property that is a non-empty string or object")}function Pp(e,t=!1){if(t)return!0;let n=Pb[e];return!n||!n()}function Ph(e,t){let n=PO.getState()?.workspaceGroup,r=n?.name;r&&e===r&&Pj(()=>{let r=PN(e);r&&(r.setState({},!0),r.subscribe(()=>{})()),"function"==typeof n?.cleanup&&n.cleanup(),PO.setState(e=>({...e,workspaceGroup:void 0})),"function"==typeof t&&t()},r?e=>e.currentWorkspaceGroup===r:()=>!0)}function Pm(e,t){let{name:n,additionalProps:r}=t;fR(n);let o=()=>{PS(e.name,{ignoreChanges:!0,onWorkspaceClose:()=>Py(n,r),closeWorkspaceGroup:!1})};Pp(e.name)?o():PR("closing-workspace-launching-new-workspace",o,e.title??e.name)}function Py(e,t){let n=fR(e),r=PO.getState().workspaceGroup;if(r&&!r.members?.includes(e))return void Ph(r.name,()=>{Py(e,t)});let o=PO.getState().workspaceGroup?.name,i={...n,title:PA(n,t),closeWorkspace:(t={})=>PS(e,t),closeWorkspaceWithSavedChanges:t=>PS(e,{ignoreChanges:!0,...t}),promptBeforeClosing:t=>{var n,r;return n=e,r=t,void(Pb[n]=r)},setTitle:(t,n)=>{i.title=t,i.titleNode=n,PO.setState(t=>{let n=t.openWorkspaces.map(t=>t.name===e?i:t);return{...t,openWorkspaces:n}})},currentWorkspaceGroup:o,additionalProps:t??{}};function a(e,t){PO.setState(n=>{let r=[e,...t??n.openWorkspaces],o=PC(e);return{...n,openWorkspaces:r,workspaceWindowState:o}})}o&&PN(o,t);let s=PO.getState().openWorkspaces,l=s.findIndex(t=>t.name===e),u=s.find(e=>e.type==i.type);if(0===s.length)a(i);else if(s[0].canHide||0===l)if(l>=0){let t=s[l];a({...t,additionalProps:i.additionalProps,...t.title===PA(t,t.additionalProps)&&{title:PA(i,i.additionalProps)}},s.filter(t=>t.name!=e))}else u?(a(u,PO.getState().openWorkspaces.filter(e=>e.type!=i.type)),Pm(u,{name:e,additionalProps:t})):a(i);else Pm(s[0],{name:e,additionalProps:t})}function Pg({targetUrl:e,contextKey:t,workspaceName:n,additionalProps:r}){PE(t),Py(n,r),oD({to:e})}let Pb={};function Pv(e,t){Pb[e]=t}function Pw(e){return Pb[e]}function P_(){let e=PO.getState();PO.setState({...e,prompt:null})}let Px={ignoreChanges:!1,onWorkspaceClose:()=>{},closeWorkspaceGroup:!0};function PS(e,t={}){t={...Px,...t};let n=()=>{let n=PO.getState();n.openWorkspaces.find(t=>t.name===e);let r=n.openWorkspaces.filter(t=>t.name!=e),o=PO.getState().workspaceGroup?.name;o&&t.closeWorkspaceGroup&&Ph(o),Pb[e]=()=>!1,PO.setState(e=>({...e,prompt:null,openWorkspaces:r,workspaceWindowState:PC(r?.[0])})),t?.onWorkspaceClose?.()};return Pp(e,t?.ignoreChanges)?(n(),!0):(PR("closing-workspace",n,fR(e).title??e),!1)}function PE(e){PO.getState().context!=e&&PO.setState({context:e,openWorkspaces:[],prompt:null})}let PD={context:"",openWorkspaces:[],prompt:null,workspaceWindowState:"normal",workspaceGroup:void 0},PO=Z("workspace",PD);function PP(){return PO}function Pk(e){let t=PO.getState();PO.setState({...t,workspaceWindowState:e})}function PC(e){return e?.preferredWindowSize??"normal"}function Pj(e=()=>{},t=()=>!0){let n=PO.getState().openWorkspaces.filter(t).every(({name:e})=>Pp(e)),r=()=>{PM(),e?.()};n?r():PR("closing-all-workspaces",r)}function PT(){let{workspaceWindowState:e,openWorkspaces:t,prompt:n,workspaceGroup:r}=f4(PO);return(0,fZ.useMemo)(()=>({active:t.length>0,prompt:n,workspaceWindowState:e,workspaces:t,workspaceGroup:r}),[t,e,n,r])}function PR(e,t=()=>{},n=""){let r;switch(e){case"closing-workspace":r={title:iV("unsavedChangesTitleText","Unsaved changes"),body:iV("unsavedChangesInOpenedWorkspace","You may have unsaved changes in the opened workspace. Do you want to discard these changes?"),onConfirm:()=>{t?.()},confirmText:iV("discard","Discard")};break;case"closing-all-workspaces":{let e=PO.getState().openWorkspaces.filter(({name:e})=>!Pp(e)).map(({title:e},t)=>`${t+1}. ${e}`);r={title:iV("closingAllWorkspacesPromptTitle","You have unsaved changes"),body:iV("closingAllWorkspacesPromptBody","There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",{workspaceNames:e.join(",")}),onConfirm:()=>{t?.()},confirmText:iV("closeAllOpenedWorkspaces","Discard changes in {{count}} workspaces",{count:e.length})};break}case"closing-workspace-launching-new-workspace":r={title:iV("unsavedChangesTitleText","Unsaved changes"),body:iV("unsavedChangesInWorkspace",'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',{workspaceName:n}),onConfirm:()=>{PO.setState(e=>({...e,prompt:null})),t?.()},confirmText:iV("openAnyway","Open anyway")};break;default:console.error(`Workspace system trying to open unknown prompt type "${e}" in function "showWorkspacePrompts"`),t?.();return}PO.setState(e=>({...e,prompt:r}))}function PA(e,t){return t?.workspaceTitle??e.title}function PM(){PO.setState(PD)}function PN(e,t={}){if(!e||"default"===e)return;let n=J(e,{});return t&&n.setState(e=>({...e,...t})),n}let PI="-esm-form-engine__action-menu-button-module__container___F68g0",P$="-esm-form-engine__action-menu-button-module__elementContainer___D1ACn",PL="-esm-form-engine__action-menu-button-module__active___HAE75";function PF({getIcon:e,formOpenInTheBackground:t,tagContent:n}){return(0,hq.jsxs)(hq.Fragment,{children:[e({size:16}),t?(0,hq.jsx)("span",{className:"-esm-form-engine__action-menu-button-module__interruptedTag___CQ2Xs",children:"!"}):(0,hq.jsx)("span",{className:"-esm-form-engine__action-menu-button-module__countTag___3mn9k",children:n})]})}let PB=({getIcon:e,label:t,iconDescription:n,handler:r,type:o,tagContent:i})=>{let a=hd(),{workspaces:s,workspaceWindowState:l}=PT(),u=s?.findIndex(({type:e})=>e===o)??-1,c="hidden"!==l&&0===u,d=u>0||0===u&&"hidden"===l;return"tablet"===a||"phone"===a?(0,hq.jsxs)(h1.$nd,{className:hY()(PI,{[PL]:c}),iconDescription:n,kind:"ghost",onClick:r,role:"button",tabIndex:0,size:"md",children:[(0,hq.jsx)("span",{className:P$,children:(0,hq.jsx)(PF,{formOpenInTheBackground:d,getIcon:e,tagContent:i})}),(0,hq.jsx)("span",{children:t})]}):(0,hq.jsx)(h1.K0,{align:"left","aria-label":n,className:hY()(PI,{[PL]:c}),enterDelayMs:300,kind:"ghost",label:t,onClick:r,size:"md",children:(0,hq.jsx)("div",{className:P$,children:(0,hq.jsx)(PF,{formOpenInTheBackground:d,getIcon:e,tagContent:i})})})},PV=fY().forwardRef(function({children:e,size:t=16,...n},r){return 16===t||"16"===t||"16px"===t?fY().createElement(O_.A,{width:t,height:t,ref:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",...n},eh||(eh=fY().createElement("path",{d:"M2 9L2 10 5.3 10 1 14.3 1.7 15 6 10.7 6 14 7 14 7 9zM14 7L14 6 10.7 6 15 1.7 14.3 1 10 5.3 10 2 9 2 9 7z"})),e):fY().createElement(O_.A,{width:t,height:t,ref:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},em||(em=fY().createElement("path",{d:"M4 18L4 20 10.586 20 2 28.582 3.414 30 12 21.414 12 28 14 28 14 18 4 18zM30 3.416L28.592 2 20 10.586 20 4 18 4 18 14 28 14 28 12 21.414 12 30 3.416z"})),e)});var PU=n(54240),PW=n(68622),PK=/[\\^$.*+?()[\]{}|]/g,Pz=RegExp(PK.source);let PH=function(e){return(e=tj(e))&&Pz.test(e)?e.replace(PK,"\\$&"):e};function PG({contextKey:e}){let{prompt:t}=PT();return(0,fZ.useEffect)(()=>{RegExp(`/${PH(e)}(/|$)`).test(window.location.pathname)||console.warn(`WorkspaceContainer has provided an invalid context key: "${e}". The context key must be part of the URL path, with no initial or trailing slash.`)},[]),(0,fZ.useEffect)(()=>(PE(e),()=>{PE(null)}),[e]),(0,fZ.useEffect)(()=>{let t=t=>{let{detail:{cancelNavigation:n,newUrl:r}}=t,o=RegExp(`/${PH(e)}(/|$)`),i=new URL(r),a=o.test(i.pathname),s=PO.getState().openWorkspaces.every(({name:e})=>Pp(e));a||(s?PM():(n?.(),Pj(()=>{oD({to:r})})))};return window.addEventListener("single-spa:before-routing-event",t),()=>{window.removeEventListener("single-spa:before-routing-event",t)}},[]),null!=t?(0,hq.jsxs)(h1.KXP,{open:!0,onClose:P_,children:[(0,hq.jsx)(h1.rQ0,{title:t.title}),(0,hq.jsx)(h1.cwr,{children:(0,hq.jsx)("p",{className:"-esm-form-engine__workspace-notification-module__messageBody___dkytJ",children:t.body})}),(0,hq.jsxs)(h1.jlY,{children:[(0,hq.jsx)(h1.$nd,{kind:"secondary",onClick:P_,children:t.cancelText??iV("cancel")}),(0,hq.jsx)(h1.$nd,{kind:"danger",onClick:t.onConfirm,children:t.confirmText??iV("confirm")})]})]}):null}function Pq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function PZ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pq(Object(n),!0).forEach(function(t){PJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function PY(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function PJ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PQ(e){return(PQ=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function PX(e,t){return(PX=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function P0(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var P1=function(e){var t=fZ.Component;if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");a.prototype=Object.create(t&&t.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),t&&PX(a,t);var n,r,o,i=(n=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=PQ(a);e=n?Reflect.construct(t,arguments,PQ(this).constructor):t.apply(this,arguments);if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return P0(this)});function a(e){var t;if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),PJ(P0(t=i.call(this,e)),"handleRef",function(e){t.el=e}),PJ(P0(t),"addThingToDo",function(e,n){t.state.hasError&&"unmount"!==e||(t.nextThingToDo=(t.nextThingToDo||Promise.resolve()).then(function(){if(!t.unmounted||"unmount"===e)return n.apply(void 0,arguments)}).catch(function(n){throw t.nextThingToDo=Promise.resolve(),t.setState({hasError:!0}),n&&n.message&&(n.message="During '".concat(e,"', parcel threw an error: ").concat(n.message)),t.props.handleError?t.props.handleError(n):setTimeout(function(){throw n}),n}))}),PJ(P0(t),"getParcelProps",function(){var e=PZ(PZ({},t.props),{},{domElement:t.el});return delete e.mountParcel,delete e.config,delete e.wrapWith,delete e.wrapStyle,delete e.appendTo,delete e.handleError,delete e.parcelDidMount,e}),t.state={hasError:!1},!e.config)throw Error("single-spa-react's Parcel component requires the 'config' prop to either be a parcel config or a loading function that returns a promise. See https://github.com/single-spa/single-spa-react");return t}return r=[{key:"componentDidMount",value:function(){var e=this;this.unmounted=!1,this.addThingToDo("mount",function(){var t,n=e.props.mountParcel||e.mountParcel;if(!n)throw Error("\n <Parcel /> was not passed a mountParcel prop, nor is it rendered where mountParcel is within the React context.\n If you are using <Parcel /> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <Parcel /> as a mountParcel prop \n ");return e.el?t=e.el:(e.createdDomElement=t=document.createElement(e.props.wrapWith),Object.keys(e.props.wrapStyle).forEach(function(n){t.style[n]=e.props.wrapStyle[n]}),e.props.appendTo.appendChild(t)),e.parcel=n(e.props.config,PZ({domElement:t},e.getParcelProps())),e.parcel.mountPromise.then(e.props.parcelDidMount),e.parcel.mountPromise})}},{key:"componentDidUpdate",value:function(){var e=this;this.addThingToDo("update",function(){if(e.parcel&&e.parcel.update)return e.parcel.update(e.getParcelProps())})}},{key:"componentWillUnmount",value:function(){var e=this;this.addThingToDo("unmount",function(){if(e.parcel&&"MOUNTED"===e.parcel.getStatus())return e.parcel.unmount()}),this.createdDomElement&&this.createdDomElement.parentNode.removeChild(this.createdDomElement),this.unmounted=!0}},{key:"render",value:function(){var e=this;if(this.props.appendTo)return pc&&pc.Consumer?fZ.createElement(pc.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):null;var t=pc&&pc.Consumer?fZ.createElement(pc.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):void 0;return fZ.createElement(this.props.wrapWith,{ref:this.handleRef,style:this.props.wrapStyle,className:this.props.wrapClassName},t)}}],PY(a.prototype,r),o&&PY(a,o),a}();PJ(P1,"defaultProps",{wrapWith:"div",wrapStyle:{},parcelDidMount:function(){}});function P2({workspace:e,additionalPropsFromPage:t}){let[n,r]=(0,fZ.useState)(),o=function(e){let[t,n]=(0,fZ.useState)({}),[r,o]=(0,fZ.useState)(e);return(0,fZ.useEffect)(()=>{r!==e&&o(e)},[e]),(0,fZ.useEffect)(()=>{let e,t=PN(r);return t&&(n(t.getState()),e=t.subscribe(n)),()=>{t&&e?.()}},[r]),t}(e.currentWorkspaceGroup);(0,fZ.useEffect)(()=>{let t=!0;return e.load().then(e=>{t&&r(e)}),()=>{t=!1}},[e]);let i=(0,fZ.useMemo)(()=>e&&{closeWorkspace:e.closeWorkspace,closeWorkspaceWithSavedChanges:e.closeWorkspaceWithSavedChanges,promptBeforeClosing:e.promptBeforeClosing,setTitle:e.setTitle,...t,...o,...e.additionalProps},[e,t,o]);return n?(0,hq.jsx)(P1,{config:n,mountParcel:fG,...i},e.name):(0,hq.jsx)(h1.OuH,{className:"-esm-form-engine__workspace-module__loader___jEP+q",description:`${iV("loading","Loading")} ...`})}function P4({isWithinWorkspace:e,name:t,actionMenuProps:n={}}){let[r,o]=(0,fZ.useState)(!1),i=(0,fZ.useRef)(window.innerHeight),{featureName:a}=(0,fZ.useContext)(fJ),s=hd();(0,fZ.useEffect)(()=>{let e=()=>{o(!hf(s)&&i.current>window.innerHeight),i.current!=window.innerHeight&&(i.current=window.innerHeight)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[i]);let l=`action-menu-${t&&"default"!=t?t:a}-items-slot`;return(0,hq.jsx)("aside",{className:hY()("-esm-form-engine__action-menu-module__sideRail___iVmKs",{"-esm-form-engine__action-menu-module__withinWorkspace___YZfet":e,"-esm-form-engine__action-menu-module__sideRailHidden___bCdyQ":r,"-esm-form-engine__action-menu-module__sideRailVisible___+oJCY":!r}),children:(0,hq.jsx)("div",{className:"-esm-form-engine__action-menu-module__container___sf6Et",children:(0,hq.jsx)(pr,{className:"-esm-form-engine__action-menu-module__chartExtensions___l+r+Y",name:l,state:n})})})}function P3({contextKey:e,overlay:t,showSiderailAndBottomNav:n,additionalWorkspaceProps:r,actionMenuProps:o}){let i=hd(),{workspaces:a,workspaceWindowState:s,workspaceGroup:l}=PT(),u=l?.name,c=a[0],d="hidden"===s||null==c,f=c?.width??(t?"wider":"narrow"),p=(0,fZ.useMemo)(()=>n||u&&!d,[u,d,n]);return pz(!d&&!hf(i)),(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsxs)("div",{className:n?"-esm-form-engine__workspace-module__workspaceContainerWithActionMenu___kZRyN":"-esm-form-engine__workspace-module__workspaceContainerWithoutActionMenu___1OJIb",children:[(0,hq.jsx)("aside",{className:hY()(t?"-esm-form-engine__workspace-module__workspaceOverlayOuterContainer___8RiIj":"-esm-form-engine__workspace-module__workspaceWindowSpacer___F1W-O",{"-esm-form-engine__workspace-module__hiddenRelative___7oRNR":d,"-esm-form-engine__workspace-module__narrowWorkspace___R3CN9":"narrow"===f,"-esm-form-engine__workspace-module__widerWorkspace___L-pDK":"wider"===f,"-esm-form-engine__workspace-module__extraWideWorkspace___D50Zj":"extra-wide"===f}),children:(0,hq.jsx)("div",{className:hY()("-esm-form-engine__workspace-module__workspaceFixedContainer___9E2Or",{"-esm-form-engine__workspace-module__maximizedWindow___d+PZ5":"maximized"===s,"-esm-form-engine__workspace-module__hiddenFixed___kBFgl":d}),children:a.map((e,t)=>(0,hq.jsx)("div",{className:hY()("-esm-form-engine__workspace-module__workspaceInnerContainer___VEPNB",{"-esm-form-engine__workspace-module__hiddenExtraWorkspace___E7d4h":0!==t}),children:(0,hq.jsx)(fZ.Suspense,{fallback:null,children:(0,hq.jsx)(pb.I18nextProvider,{i18n:window.i18next,defaultNS:e.moduleName,children:(0,hq.jsx)(P6,{workspaceInstance:e,additionalWorkspaceProps:r})})})},`workspace-container-${e?e.name:`empty-${t}`}`))})}),(0,hq.jsx)(PG,{contextKey:e})]}),p&&(0,hq.jsx)(P4,{name:u,isWithinWorkspace:!n,actionMenuProps:o})]})}function P6({workspaceInstance:e,additionalWorkspaceProps:t}){let{t:n}=(0,pb.useTranslation)(),r=hd(),{workspaceWindowState:o,workspaceGroup:i}=PT(),a=i?.name,s="maximized"===o;(0,fZ.useEffect)(()=>{let t=n(e.title);t!==e.title&&e.setTitle(t)},[e.title,n,e.setTitle]);let{featureName:l}=(0,fZ.useContext)(fJ),u=(0,fZ.useCallback)(()=>{Pk(s?"normal":"maximized")},[s]),{canHide:c=!1,canMaximize:d=!1,currentWorkspaceGroup:f="",closeWorkspace:p}=(0,fZ.useMemo)(()=>e??{},[e]),h=(0,fZ.useMemo)(()=>({...t,...e?.additionalProps}),[t,e]);return e&&(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsxs)(h1.Y9Y,{"aria-label":iV("workspaceHeader","Workspace Header"),className:"-esm-form-engine__workspace-module__header___nMH1R",children:[!hf(r)&&!c&&(0,hq.jsx)(h1.dJ2,{"aria-label":iV("close","Close"),renderMenuIcon:(0,hq.jsx)(ms,{}),onClick:()=>p()}),(0,hq.jsx)(h1.bCw,{prefix:"",children:e.titleNode??n(e.title)}),(0,hq.jsx)("div",{className:"-esm-form-engine__workspace-module__overlayHeaderSpacer___vxoMd"}),(0,hq.jsxs)(h1.wdv,{className:"-esm-form-engine__workspace-module__headerButtons___lek95",children:[(0,hq.jsx)(pr,{name:`workspace-header-group-${e.currentWorkspaceGroup}-slot`,state:h}),(0,hq.jsx)(pr,{name:`workspace-header-type-${e.type}-slot`,state:h}),(0,hq.jsx)(pr,{name:`workspace-header-${l}-slot`,state:h}),hf(r)&&(0,hq.jsxs)(hq.Fragment,{children:[(d||s)&&(0,hq.jsx)(h1.V8d,{"aria-label":s?iV("minimize","Minimize"):iV("maximize","Maximize"),onClick:u,children:s?(0,hq.jsx)(PV,{}):(0,hq.jsx)(PU.hz,{})}),c&&!a?(0,hq.jsx)(h1.V8d,{"aria-label":iV("hide","Hide"),onClick:()=>Pk("hidden"),children:(0,hq.jsx)(ml,{})}):(0,hq.jsx)(h1.V8d,{"aria-label":iV("close","Close"),onClick:()=>p?.(),children:(0,hq.jsx)(mO,{})})]}),"tablet"===r&&c&&(0,hq.jsx)(h1.V8d,{"aria-label":iV("close","Close"),onClick:()=>p?.(),children:(0,hq.jsx)(PW.d3,{})})]})]}),(0,hq.jsx)("div",{className:hY()("-esm-form-engine__workspace-module__workspaceContent___FFe+u",{"-esm-form-engine__workspace-module__marginWorkspaceContent___SEV31":!!f}),children:(0,hq.jsx)(P2,{workspace:e,additionalPropsFromPage:t},e.name)})]})}var P5=new Uint8Array(16);let P7=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var P9=[],P8=0;P8<256;++P8)P9.push((P8+256).toString(16).substr(1));let ke=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(P9[e[t+0]]+P9[e[t+1]]+P9[e[t+2]]+P9[e[t+3]]+"-"+P9[e[t+4]]+P9[e[t+5]]+"-"+P9[e[t+6]]+P9[e[t+7]]+"-"+P9[e[t+8]]+P9[e[t+9]]+"-"+P9[e[t+10]]+P9[e[t+11]]+P9[e[t+12]]+P9[e[t+13]]+P9[e[t+14]]+P9[e[t+15]]).toLowerCase();if(!("string"==typeof n&&P7.test(n)))throw TypeError("Stringified UUID is invalid");return n},kt=function(e,t,n){var r=(e=e||{}).random||(e.rng||function(){if(!ey&&!(ey="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"u">typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ey(P5)})();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return ke(r)};async function kn(e,t){let{openedGroup:n}=fM.getState();if(n){if(n.groupName===e&&ki(n.props,t))return!0;else if(!await ka({reason:"CLOSE_WORKSPACE_GROUP",explicit:!1}))return!1}return fM.setState(n=>({...n,openedGroup:{groupName:e,props:t},openedWindows:[]})),!0}async function kr(e){let{openedGroup:t,openedWindows:n}=fM.getState();if(t){if(n.length>0&&!(e||await ka({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})))return!1;fM.setState(e=>({...e,openedGroup:null,openedWindows:[]}))}return!0}async function ko(e,t=null,n=null,r=null){let o=fM.getState();if(!o.registeredWorkspacesByName[e])throw Error(`Unable to launch workspace ${e}. Workspace is not registered`);let i=fN(e);if(!i)throw Error(`Unable to launch workspace ${e}. Workspace is not registered to a workspace window`);let{openedGroup:a}=o,{name:s}=i,l=fI(s);if(!l)throw Error(`Unable to launch workspace ${e}. Workspace window ${i.name} is not registered to a workspace group`);let u=f$(e);if(a&&(a.groupName!==l.name||!ki(a.props,r)))return!!await ka({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})&&(fM.setState({...o,openedGroup:{groupName:l.name,props:r},openedWindows:[{windowName:s,openedWorkspaces:[kd(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0);if(u>=0){let r=o.openedWindows[u],i=o.openedGroup?.props??{},a=o.isMostRecentlyOpenedWindowHidden,{openedWorkspaces:c}=r;if(ki(r.props,n)){let d=c.find(t=>t.workspaceName===e);return d&&ki(d.props,t)?((a||u!==o.openedWindows.length-1)&&fM.setState(ks.restoreWindow(o,s)),!0):!!await ka({reason:"CLOSE_WORKSPACE",explicit:!1,windowName:s,workspaceName:e})&&(fM.setState({...o,openedGroup:{groupName:l.name,props:o?.openedGroup?.props??i},openedWindows:[...o.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[kd(e,t)],props:r?.props??n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return!!await ka({reason:"CLOSE_WINDOW",explicit:!1,windowName:s})&&(fM.setState({...o,openedGroup:{groupName:l.name,props:i??o?.openedGroup?.props},openedWindows:[...o.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[kd(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return"closable"!=l.persistence?(fM.setState({...o,openedGroup:{groupName:l.name,props:r??o?.openedGroup?.props??null},openedWindows:[...o.openedWindows,{windowName:s,openedWorkspaces:[kd(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0):!!await ka({reason:"CLOSE_OTHER_WINDOWS",explicit:!1,windowNameToSpare:i.name})&&(fM.setState({...o,openedGroup:{groupName:l.name,props:r??o?.openedGroup?.props??null},openedWindows:[{windowName:s,openedWorkspaces:[kd(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}function ki(e,t){return null==e||null==t||F(e,t)}function ka(e){function t(e,t){let n=[];for(let r=e.openedWorkspaces.length-1;r>=0;r--){let o=e.openedWorkspaces[r];if(o.hasUnsavedChanges&&n.push(o),t&&o.workspaceName===t)break}return n}let{openedWindows:n,workspaceTitleByWorkspaceName:r}=fM.getState(),o=[];switch(e.reason){case"CLOSE_WORKSPACE_GROUP":o=n.flatMap(e=>t(e));break;case"CLOSE_WINDOW":{let r=n.find(t=>t.windowName===e.windowName);if(!r)throw Error(`Window ${e.windowName} not found in opened windows.`);o=t(r);break}case"CLOSE_WORKSPACE":{let r=n.find(t=>t.windowName===e.windowName);if(!r)throw Error(`Window ${e.windowName} not found in opened windows.`);o=t(r,e.workspaceName);break}case"CLOSE_OTHER_WINDOWS":o=n.filter(t=>t.windowName!==e.windowNameToSpare).flatMap(e=>t(e))}return 0===o.length?Promise.resolve(!0):new Promise(e=>{let t=DG("workspace2-close-prompt",{size:"sm",onConfirm:()=>{t(),e(!0)},onCancel:()=>{t(),e(!1)},affectedWorkspaceTitles:o.map(e=>r[e.workspaceName])})})}let ks={setWindowMaximized(e,t,n){let r=e.openedWindows.findIndex(e=>e.windowName===t),o=[...e.openedWindows],i={...o[r],maximized:n};return o[r]=i,{...e,openedWindows:o}},hideWindow:e=>({...e,isMostRecentlyOpenedWindowHidden:!0}),restoreWindow(e,t){let n=e.openedWindows.findIndex(e=>e.windowName===t),r=e.openedWindows[n],o=[...e.openedWindows.filter((e,t)=>t!==n),r];return{...e,openedWindows:o,isMostRecentlyOpenedWindowHidden:!1}},closeWorkspace(e,t){let n=f$(t);if(n<0)return e;let r={...e.openedWindows[n]},o=r.openedWorkspaces.findIndex(e=>e.workspaceName===t),i=[...e.openedWindows];r.openedWorkspaces=r.openedWorkspaces.slice(0,o);let a=e.isMostRecentlyOpenedWindowHidden;if(0===r.openedWorkspaces.length){let t=n===e.openedWindows.length-1;i.splice(n,1),t&&i.length>0&&(a=!1)}else i[n]=r;return{...e,openedWindows:i,isMostRecentlyOpenedWindowHidden:a}},openChildWorkspace(e,t,n,r){let o=e.registeredWorkspacesByName[n];if(!o)throw Error(`No workspace named "${n}" registered`);let i=e.registeredWorkspacesByName[t];if(!i)throw Error(`No workspace named "${t}" registered`);if(i.window!==o.window)throw Error(`Child workspace ${n} does not belong to the same workspace window as parent workspace ${t}`);let a=e.openedWindows.findIndex(e=>e.windowName===o.window);if(-1==a)throw Error(`Cannot open child workspace ${n} as window ${o.window} is not opened`);let{openedWorkspaces:s}=e.openedWindows[a],l=s.findIndex(e=>e.workspaceName===t);if(-1===l)throw Error(`Cannot open child workspace ${n} from parent workspace ${t} as the parent is not opened within the workspace window`);let u=s.slice(0,l+1);return{openedWindows:e.openedWindows.map((e,t)=>t==a?{...e,openedWorkspaces:[...u,kd(n,r)]}:e)}},setHasUnsavedChanges(e,t,n){let r=f$(t);if(r<0)return e;let o={...e.openedWindows[r]},i=o.openedWorkspaces.findIndex(e=>e.workspaceName===t);if(i<0)return e;o.openedWorkspaces[i]={...o.openedWorkspaces[i],hasUnsavedChanges:n};let a=[...e.openedWindows];return a[r]=o,{...e,openedWindows:a}},setWorkspaceTitle(e,t,n){let r={...e.workspaceTitleByWorkspaceName};return null===n?delete r[t]:r[t]=n,{...e,workspaceTitleByWorkspaceName:r}}};function kl(){return f3(fM,ks)}let ku=()=>(0,fZ.useContext)(pc),kc=()=>Object.keys(fM.getState().registeredWorkspacesByName);function kd(e,t){return{workspaceName:e,props:t??{},hasUnsavedChanges:!1,uuid:kt()}}let kf={workspaceOuterContainer:"-esm-form-engine__workspace2-module__workspaceOuterContainer___jaqGm",narrowWorkspace:"-esm-form-engine__workspace2-module__narrowWorkspace___o1wsL",widerWorkspace:"-esm-form-engine__workspace2-module__widerWorkspace___gdEOi",extraWideWorkspace:"-esm-form-engine__workspace2-module__extraWideWorkspace___U9xlJ",workspaceMiddleContainer:"-esm-form-engine__workspace2-module__workspaceMiddleContainer___0AdtX",maximized:"-esm-form-engine__workspace2-module__maximized___aKCbE",hidden:"-esm-form-engine__workspace2-module__hidden___n1US5",workspaceInnerContainer:"-esm-form-engine__workspace2-module__workspaceInnerContainer___1g+qk",workspaceSpacer:"-esm-form-engine__workspace2-module__workspaceSpacer___P2T9y",loader:"-esm-form-engine__workspace2-module__loader___fCfzZ",hiddenExtraWorkspace:"-esm-form-engine__workspace2-module__hiddenExtraWorkspace___hvPSi",header:"-esm-form-engine__workspace2-module__header___MXXx9",headerButtons:"-esm-form-engine__workspace2-module__headerButtons___sJdnC",workspaceContent:"-esm-form-engine__workspace2-module__workspaceContent___6NuXT",overlayHeaderSpacer:"-esm-form-engine__workspace2-module__overlayHeaderSpacer___PLO6T",isActionMenuOpened:"-esm-form-engine__workspace2-module__isActionMenuOpened___X3Vj6",showActionMenu:"-esm-form-engine__workspace2-module__showActionMenu___HSun1",marginWorkspaceContent:"-esm-form-engine__workspace2-module__marginWorkspaceContent___DCfWz",workspaceContainerWithActionMenu:"-esm-form-engine__workspace2-module__workspaceContainerWithActionMenu___G9MdI",workspaceFixedContainer:"-esm-form-engine__workspace2-module__workspaceFixedContainer___uIldI",workspaceContainerWithoutActionMenu:"-esm-form-engine__workspace2-module__workspaceContainerWithoutActionMenu___lBudZ"},kp=({title:e,children:t,hasUnsavedChanges:n=!1})=>{let r=hd(),{setWindowMaximized:o,hideWindow:i,setHasUnsavedChanges:a,openedWindows:s,openedGroup:l,registeredGroupsByName:u,registeredWindowsByName:c,registeredWorkspacesByName:d,workspaceTitleByWorkspaceName:f,setWorkspaceTitle:p,isMostRecentlyOpenedWindowHidden:h}=kl(),{workspaceName:m,isRootWorkspace:y,closeWorkspace:g,showActionMenu:b}=ku(),v=f$(m),w=s[v],x=w?.openedWorkspaces.find(e=>e.workspaceName===m);if((0,fZ.useEffect)(()=>{x?.hasUnsavedChanges!=n&&a(m,n??!1)},[x?.hasUnsavedChanges,n,m,a]),(0,fZ.useEffect)(()=>{f[m]!==e&&p(m,e)},[f,m,e,p]),v<0||null==l||null==x)return null;let S=u[l.groupName];if(!S)throw Error(`Cannot find registered workspace group ${l.groupName}`);let E=d[m].window,D=c[E];if(!D)throw Error(`Cannot find registered workspace window ${E}`);let{icon:O,canMaximize:P}=D,k="closable"===S.persistence,C=!!O&&!k,{maximized:j}=w,T=D?.width??"narrow",R=Object.values(c).some(e=>e.group===l.groupName&&void 0!==e.icon),A=v<s.length-1||h;return(0,hq.jsxs)("div",{className:hY()(kf.workspaceOuterContainer,{[kf.narrowWorkspace]:"narrow"===T,[kf.widerWorkspace]:"wider"===T,[kf.extraWideWorkspace]:"extra-wide"===T,[kf.isActionMenuOpened]:R}),children:[(0,hq.jsx)("div",{className:hY()(kf.workspaceSpacer,{[kf.hidden]:A})}),(0,hq.jsx)("div",{className:hY()(kf.workspaceMiddleContainer,{[kf.maximized]:j,[kf.hidden]:A,[kf.isRootWorkspace]:y,[kf.showActionMenu]:b}),children:(0,hq.jsxs)("div",{className:hY()(kf.workspaceInnerContainer,{[kf.maximized]:j,[kf.hidden]:A,[kf.isRootWorkspace]:y}),children:[(0,hq.jsxs)(h1.Y9Y,{"aria-label":iV("workspaceHeader"),className:kf.header,children:[(0,hq.jsx)(h1.bCw,{prefix:"",children:e}),(0,hq.jsx)("div",{className:kf.overlayHeaderSpacer}),(0,hq.jsx)(h1.wdv,{className:kf.headerButtons,children:hf(r)?(0,hq.jsxs)(hq.Fragment,{children:[(P||j)&&(0,hq.jsx)(h1.V8d,{"aria-label":j?iV("minimize"):iV("maximize"),onClick:()=>o(E,!j),children:j?(0,hq.jsx)(PV,{}):(0,hq.jsx)(PU.hz,{})}),C&&(0,hq.jsx)(h1.V8d,{"aria-label":iV("hide"),onClick:()=>i(),children:(0,hq.jsx)(ml,{})}),!k&&(0,hq.jsx)(h1.V8d,{"aria-label":iV("close"),onClick:()=>g({closeWindow:!0}),children:(0,hq.jsx)(mO,{})})]}):(0,hq.jsxs)(hq.Fragment,{children:[C&&(0,hq.jsx)(h1.V8d,{"aria-label":iV("hide"),onClick:()=>i(),children:(0,hq.jsx)(PW.d3,{})}),(0,hq.jsx)(h1.V8d,{"aria-label":iV("close"),onClick:()=>{k?kr():g({closeWindow:!0})},children:(0,hq.jsx)(mO,{})})]})})]}),(0,hq.jsx)("div",{className:hY()(kf.workspaceContent),children:t})]})})]})},kh="-esm-form-engine__action-menu-button2-module__container___pahg-",km="-esm-form-engine__action-menu-button2-module__elementContainer___PzOdc",ky="-esm-form-engine__action-menu-button2-module__active___4O4Bs",kg="-esm-form-engine__action-menu-button2-module__focused___+k5kD";function kb({getIcon:e,hasUnsavedChanges:t,tagContent:n}){return(0,hq.jsxs)(hq.Fragment,{children:[e({size:16}),t?(0,hq.jsx)("span",{className:"-esm-form-engine__action-menu-button2-module__interruptedTag___mS2yr",children:"!"}):(0,hq.jsx)("span",{className:"-esm-form-engine__action-menu-button2-module__countTag___rb5CW",children:n})]})}let kv=({icon:e,label:t,tagContent:n,workspaceToLaunch:r,onBeforeWorkspaceLaunch:o})=>{let i=hd(),{openedWindows:a,restoreWindow:s,hideWindow:l,isMostRecentlyOpenedWindowHidden:u}=kl(),{extension:c}=(0,fZ.useContext)(fJ),d=a.findIndex(e=>e.windowName===c?.extensionId),f=a[d],p=null!=f,h=p&&(d<a.length-1||u),m=p&&!h,y=f?.openedWorkspaces.some(e=>e.hasUnsavedChanges)??!1,g=async()=>{if(p)h?s(f.windowName):l();else if(await (o?.()??!0)){let{workspaceName:e,workspaceProps:t,windowProps:n}=r;ko(e,t,n)}};return"tablet"===i||"phone"===i?(0,hq.jsxs)(h1.$nd,{className:hY()(kh,{[ky]:p&&!m,[kg]:m}),iconDescription:t,kind:"ghost",onClick:g,role:"button",tabIndex:0,size:"md",children:[(0,hq.jsx)("span",{className:km,children:(0,hq.jsx)(kb,{hasUnsavedChanges:y,getIcon:e,tagContent:n})}),(0,hq.jsx)("span",{children:t})]}):(0,hq.jsx)(h1.K0,{align:"left","aria-label":t,className:hY()(kh,{[ky]:p&&!m,[kg]:m}),enterDelayMs:300,kind:"ghost",label:t,onClick:g,size:"md",children:(0,hq.jsx)("div",{className:km,children:(0,hq.jsx)(kb,{hasUnsavedChanges:y,getIcon:e,tagContent:n})})})};function kw({showContactDetails:e,toggleContactDetails:t,className:n}){return(0,hq.jsx)(h1.$nd,{className:n,iconDescription:"Toggle contact details",kind:"ghost",onClick:t,renderIcon:e?mD:mx,children:e?iV("showLess","Show less"):iV("showMore","Show more")})}let k_={contactDetails:"-esm-form-engine__patient-banner-contact-details-module__contactDetails___rhdjA",deceased:"-esm-form-engine__patient-banner-contact-details-module__deceased___K4NPg",heading:"-esm-form-engine__patient-banner-contact-details-module__heading___zj6Zt",row:"-esm-form-engine__patient-banner-contact-details-module__row___+Bx+P",col:"-esm-form-engine__patient-banner-contact-details-module__col___0H31P",relationship:"-esm-form-engine__patient-banner-contact-details-module__relationship___CZmay"},kx=({patientUuid:e})=>{let{cohorts:t=[],isLoading:n}=function(e){let t=e?`${oN}/cohortm/cohortmember?patient=${e}&v=custom:(uuid,patient:ref,cohort:(uuid,name,startDate,endDate))`:null,{data:n,isLoading:r}=pw()(t,oF),o=n?.data?.results.map(e=>({uuid:e.cohort.uuid,name:e.cohort.name,startDate:e.cohort.startDate,endDate:e.cohort.endDate}));return(0,fZ.useMemo)(()=>({cohorts:o,isLoading:r}),[r,o])}(e);return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsxs)("p",{className:k_.heading,children:[iV("patientLists","Patient Lists")," (",t?.length??0,")"]}),n?(0,hq.jsx)(h1.OuH,{description:`${iV("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsxs)("ul",{children:[(()=>{if(t?.length>0){let e=t.sort((e,t)=>EI(e?.startDate).getTime()-EI(t?.startDate).getTime()).slice(0,3);return e?.map(e=>(0,hq.jsx)("li",{children:(0,hq.jsx)(fQ,{to:`${window.spaBase}/home/patient-lists/${e.uuid}`,children:e.name},e.uuid)},e.uuid))}return(0,hq.jsx)("li",{children:"--"})})(),t.length>3&&(0,hq.jsx)("li",{className:k_.link,children:(0,hq.jsx)(fQ,{to:`${window.spaBase}/home/patient-lists`,children:iV("seeMoreLists","See {{count}} more lists",{count:t?.length-3})})})]})]})},kS=({patientId:e})=>{let{patient:t,isLoading:n}=hx(e),r=t?.address?.find(e=>"home"===e.use),o=e=>e.split("#")[1];return n?(0,hq.jsx)(h1.OuH,{description:`${iV("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("p",{className:k_.heading,children:iV("address","Address")}),(0,hq.jsx)("ul",{children:r?Object.entries(r).filter(([e])=>"id"!==e&&"use"!==e).map(([e,t])=>"extension"===e?r.extension?.[0]?.extension?.map((t,n)=>(0,hq.jsxs)("li",{children:[iV(o(t.url),o(t.url)),": ",t.valueString]},`address-${e}-${n}`)):(0,hq.jsxs)("li",{children:[iV(e,e),": ",t]},`address-${e}`)):(0,hq.jsx)("li",{children:"--"})})]})},kE=({patientUuid:e})=>{let{isLoading:t,contactAttributes:n}=(e=>{let{contactAttributeTypes:t=[]}=pq({externalModuleName:"@openmrs/esm-patient-banner-app"}),{attributes:n,error:r,isLoading:o}=(e=>{let{data:t,error:n,isLoading:r}=pX()(`${oN}/patient/${e}?v=custom:(uuid,display,identifiers:(identifier,uuid,preferred,location:(uuid,name),identifierType:(uuid,name,format,formatDescription,validator)),person:(uuid,display,gender,birthdate,dead,age,deathDate,birthdateEstimated,causeOfDeath,preferredName:(uuid,preferred,givenName,middleName,familyName),attributes,preferredAddress:(uuid,preferred,address1,address2,cityVillage,longitude,stateProvince,latitude,country,postalCode,countyDistrict,address3,address4,address5,address6,address7)))`,oF);return{isLoading:r,attributes:t?.data.person.attributes??[],error:n}})(e);return{contactAttributes:(0,fZ.useMemo)(()=>n.filter(({attributeType:e})=>t?.some(t=>e.uuid===t)),[n,t]),isLoading:o,error:r}})(e),r=(0,fZ.useMemo)(()=>n?[...n?.map(e=>[e.attributeType.display?iV(e.attributeType.display,e.attributeType.display):"",e.value])]:[],[n]);return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("p",{className:k_.heading,children:iV("contactDetails","Contact Details")}),t?(0,hq.jsx)(h1.OuH,{description:`${iV("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsx)("ul",{children:r.length?r.map(([e,t],n)=>(0,hq.jsxs)("li",{children:[e,": ",t]},`${e}-${t}-${n}`)):(0,hq.jsx)("li",{children:"--"})})]})},kD=({patientId:e})=>{let{data:t,isLoading:n}=function(e){let t=`${oN}/relationship?v=custom:(display,uuid,personA:(age,display,birthdate,uuid),personB:(age,display,birthdate,uuid),relationshipType:(uuid,display,description,aIsToB,bIsToA))&person=${e}`,{data:n,error:r,isLoading:o,isValidating:i}=pw()(e?t:null,oF),a=n?.data?.results?.length?function(e,t){let n=[];for(let r of t)e===r.personA.uuid?n.push({uuid:`${r.uuid}`,display:r.personB.display,relativeAge:r.personB.age,relativeUuid:r.personB.uuid,relationshipType:r.relationshipType.bIsToA}):n.push({uuid:`${r.uuid}`,display:r.personA.display,relativeAge:r.personA.age,relativeUuid:r.personA.uuid,relationshipType:r.relationshipType.aIsToB});return n}(e,n.data.results):null;return{data:n?a:null,error:r,isLoading:o,isValidating:i}}(e);return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("p",{className:k_.heading,children:iV("relationships","Relationships")}),n?(0,hq.jsx)(h1.OuH,{description:`${iV("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsx)("ul",{children:t&&t.length>0?(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsxs)("li",{className:k_.relationship,children:[(0,hq.jsx)("div",{children:(0,hq.jsx)(fQ,{to:`${window.spaBase}/patient/${e.relativeUuid}/chart`,children:e.display})}),(0,hq.jsx)("div",{children:e.relationshipType}),(0,hq.jsx)("div",{children:`${e.relativeAge?e.relativeAge:"--"} ${e.relativeAge?1===e.relativeAge?iV("yearAbbreviation","yr"):iV("yearsAbbreviation","yrs"):""}`})]},e.uuid))}):(0,hq.jsx)("li",{children:"--"})})]})};function kO({patientId:e,deceased:t}){return(0,hq.jsxs)("div",{className:hY()(k_.contactDetails,{[k_.deceased]:t}),children:[(0,hq.jsxs)("div",{className:k_.row,children:[(0,hq.jsx)("div",{className:k_.col,children:(0,hq.jsx)(kS,{patientId:e})}),(0,hq.jsx)("div",{className:k_.col,children:(0,hq.jsx)(kE,{patientUuid:e})})]}),(0,hq.jsxs)("div",{className:k_.row,children:[(0,hq.jsx)("div",{className:k_.col,children:(0,hq.jsx)(kD,{patientId:e})}),(0,hq.jsx)("div",{className:k_.col,children:(0,hq.jsx)(kx,{patientUuid:e})})]})]})}function kP(e){let t=document.querySelector("template#loading-spinner");if(t){let n=t.content.cloneNode(!0),r=Array.prototype.map.call(n.childNodes,e=>e);return e.appendChild(n),()=>r.forEach(e=>e.remove())}return()=>{}}let kk="-esm-form-engine__action-menu2-module__container___5s3CM";function kC({workspaceGroup:e,groupProps:t}){let n=hd(),{persistence:r}=e;return(0,hq.jsx)("aside",{className:"-esm-form-engine__action-menu2-module__sideRail___qwAz4",children:(0,hq.jsxs)("div",{className:kk,children:["closable"==r&&hf(n)&&(0,hq.jsx)(h1.K0,{align:"left",onClick:()=>kr(),label:iV("close"),kind:"ghost",children:(0,hq.jsx)(mO,{})}),(0,hq.jsx)(fJ.Provider,{value:{moduleName:e.moduleName,featureName:e.name},children:(0,hq.jsx)(pr,{className:kk,name:e.name,state:{groupProps:t}})})]})})}function kj(e){let t=new URL(e,window.location.origin).pathname,n=new URL(window.getOpenmrsSpaBase?.()??"/",window.location.origin).pathname,r=n.endsWith("/")?n.slice(0,-1):n,o=null;return r?r===t?o="/":t.startsWith(`${r}/`)&&(o=t.slice(r.length)):o=t,{full:t,spaRelative:o}}let kT=({lifeCycle:e,openedWorkspace:t,openedWindow:n,isRootWorkspace:r,isLeafWorkspace:o,showActionMenu:i})=>{let{openedGroup:a,closeWorkspace:s,openChildWorkspace:l}=kl(),u=(0,fZ.useMemo)(()=>t&&{closeWorkspace:async(e={})=>{let{closeWindow:r=!1,discardUnsavedChanges:o=!1}=e;return r?!!(o||await ka({reason:"CLOSE_WINDOW",explicit:!0,windowName:n.windowName}))&&(s(n.openedWorkspaces[0].workspaceName),!0):!!(o||await ka({reason:"CLOSE_WORKSPACE",explicit:!0,windowName:n.windowName,workspaceName:t.workspaceName}))&&(s(t.workspaceName),!0)},launchChildWorkspace:async(e,r)=>{let o=t.workspaceName,{openedWorkspaces:i}=n,a=i.findIndex(e=>e.workspaceName===o);-1===a||a!==i.length-1&&i.slice(a+1).some(e=>e.hasUnsavedChanges)&&!await ka({reason:"CLOSE_WORKSPACE",explicit:!0,windowName:n.windowName,workspaceName:i[a+1].workspaceName})||l(o,e,r||{})},workspaceName:t.workspaceName,workspaceProps:t.props,windowProps:n.props,groupProps:a&&a.props?a.props:null,isRootWorkspace:r,isLeafWorkspace:o,windowName:n.windowName,showActionMenu:i},[t,s,a,n]);if(!e){let{registeredWorkspacesByName:e}=fM.getState(),n=e[t.workspaceName],o=n&&n.window?n.window:void 0,{registeredWindowsByName:s}=fM.getState(),l=o?s[o]:void 0,u=l&&l.width?l.width:"narrow",c=Object.values(s).some(e=>e.group===a?.groupName&&void 0!==e.icon);return(0,hq.jsxs)("div",{className:hY()(kf.workspaceOuterContainer,{[kf.narrowWorkspace]:"narrow"===u,[kf.widerWorkspace]:"wider"===u,[kf.extraWideWorkspace]:"extra-wide"===u,[kf.isActionMenuOpened]:c}),children:[(0,hq.jsx)("div",{className:kf.workspaceSpacer}),(0,hq.jsx)("div",{className:hY()(kf.workspaceMiddleContainer,{[kf.isRootWorkspace]:r,[kf.showActionMenu]:i}),children:(0,hq.jsx)("div",{className:hY()(kf.workspaceInnerContainer,{[kf.isRootWorkspace]:r}),children:(0,hq.jsx)(h1.OuH,{className:kf.loader,description:`${iV("loading")} ...`})})})]})}return(0,hq.jsx)(P1,{config:e,mountParcel:fG,...u},t.workspaceName)},kR=({openedWindow:e,showActionMenu:t})=>{let{openedWorkspaces:n}=e,[r,o]=(0,fZ.useState)({}),{registeredWorkspacesByName:i}=fM.getState();return(0,fZ.useEffect)(()=>{let e=!1;return Promise.all(n.map(async e=>{let{moduleName:t,component:n}=i[e.workspaceName];return[e.uuid,await h$(t,n)]})).then(t=>{e||o(Object.fromEntries(t))}),()=>{e=!0}},[n]),(0,hq.jsx)(hq.Fragment,{children:n.map((o,i)=>(0,hq.jsx)(kT,{openedWorkspace:o,openedWindow:e,lifeCycle:r[o.uuid],isRootWorkspace:0===i,isLeafWorkspace:i===n.length-1,showActionMenu:t},o.uuid))})};function kA(e){e&&(0,po.createRoot)(e).render((0,hq.jsx)(kM,{}))}function kM(){let{openedGroup:e,openedWindows:t,registeredGroupsByName:n,registeredWindowsByName:r}=kl();if((0,fZ.useEffect)(()=>cV("before-page-changed",t=>{let{newPage:r,cancelNavigation:o,oldUrl:i,newUrl:a}=t;if(!e)return;if(r)return void o(kr().then(e=>!e));let s=n[e.groupName],l=s?.scopePattern;l&&function(e,t,n){try{let r=new RegExp(e),o=kj(t),i=kj(n);if(null===o.spaRelative||null===i.spaRelative)return!0;let a=r.exec(o.spaRelative),s=r.exec(i.spaRelative);if(a&&s||(a=r.exec(o.full),s=r.exec(i.full)),!a||!s)return!0;if(a.length>1)return!a.slice(1).every((e,t)=>e===s[t+1]);return!1}catch{return!0}}(l,i,a)&&o(kr().then(e=>!e))}),[e,n]),!e)return null;let o=n[e.groupName],i=t.some(e=>e.maximized),{name:a}=o,s=Object.values(r).filter(e=>e.group===a&&void 0!==e.icon).sort((e,t)=>(e.order??Number.MAX_VALUE)-(t.order??Number.MAX_VALUE)).length>0;return(0,hq.jsxs)("div",{className:hY()("-esm-form-engine__workspace-windows-and-menu-module__workspaceWindowsAndMenuContainer___gN2f4",{"-esm-form-engine__workspace-windows-and-menu-module__overlay___fqI+X":o.overlay,"-esm-form-engine__workspace-windows-and-menu-module__hasMaximizedWindow___J7wBw":i}),children:[(0,hq.jsx)("div",{className:"-esm-form-engine__workspace-windows-and-menu-module__workspaceWindowsContainer___zpk7G",children:t.map(e=>(0,hq.jsx)(kR,{openedWindow:e,showActionMenu:s},e.windowName))}),s&&(0,hq.jsx)(kC,{workspaceGroup:o,groupProps:e.props})]})}function kN(e,t,n){if(null==e)return n;let r=S7(e);if(!r)return console.warn(`matchLocale: invalid requested locale tag: ${JSON.stringify(e)}`),n;let o=[];for(let e of t){let t=S7(e);if(!t){console.warn(`matchLocale: skipping invalid available locale tag: ${JSON.stringify(e)}`);continue}o.push({canonical:t,original:e})}let i=r;for(;i;){let e=o.find(e=>e.canonical===i);if(e)return e.original;let t=i+"-",n=o.find(e=>e.canonical.startsWith(t));if(n)return n.original;if("ht"===i){i="fr-HT";continue}let r=i.lastIndexOf("-");if(-1===r)break;let a=(i=i.slice(0,r)).lastIndexOf("-");-1!==a&&i.length-a==2&&(i=i.slice(0,a))}return n}function kI(e=window.localStorage){try{return e.getItem("test"),!0}catch{return!1}}function k$(e){return!!e&&e.constructor===Object}var kL=n(2722);function kF(e){let[t,n,r]=e.split(".");return`${t}.${n}.${r}`}function kB(e,t){let n=function(e){let t=e.indexOf("-");if(t>=0){let n=kF(e.slice(0,t)),r=e.slice(t+1);return`${n}-${r}`}return kF(e)}(t);return kL.satisfies(n,e,{includePrerelease:!0})}async function kV(e,t={}){let n,{shouldRetry:r,getDelay:o,onError:i}=t;r=r??(e=>e<=5),o=o??(e=>(function(e,t=!1){return 1e3*Math.pow(2,t?e+1:e)})(e));let a=0;do try{return await kU(o(a)),await e()}catch(e){i?.(e,a),n=e}while(r(a++));throw n}async function kU(e){if(!(e<=0))return new Promise(t=>setTimeout(t,e))}}}]);