import{d as N,w as me}from"./index-9ff358fd.js";import{g as rt}from"./_commonjsHelpers-725317a4.js";var nt=function(t){return it(t)&&!at(t)};function it(e){return!!e&&typeof e=="object"}function at(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||ht(e)}var ot=typeof Symbol=="function"&&Symbol.for,st=ot?Symbol.for("react.element"):60103;function ht(e){return e.$$typeof===st}function ut(e){return Array.isArray(e)?[]:{}}function j(e,t){return t.clone!==!1&&t.isMergeableObject(e)?A(ut(e),e,t):e}function lt(e,t,r){return e.concat(t).map(function(n){return j(n,r)})}function ft(e,t){if(!t.customMerge)return A;var r=t.customMerge(e);return typeof r=="function"?r:A}function ct(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function de(e){return Object.keys(e).concat(ct(e))}function Ce(e,t){try{return t in e}catch{return!1}}function mt(e,t){return Ce(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function pt(e,t,r){var n={};return r.isMergeableObject(e)&&de(e).forEach(function(i){n[i]=j(e[i],r)}),de(t).forEach(function(i){mt(e,i)||(Ce(e,i)&&r.isMergeableObject(t[i])?n[i]=ft(i,r)(e[i],t[i],r):n[i]=j(t[i],r))}),n}function A(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||lt,r.isMergeableObject=r.isMergeableObject||nt,r.cloneUnlessOtherwiseSpecified=j;var n=Array.isArray(t),i=Array.isArray(e),a=n===i;return a?n?r.arrayMerge(e,t,r):pt(e,t,r):j(t,r)}A.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,i){return A(n,i,r)},{})};var bt=A,gt=bt;const Et=rt(gt);var ae=function(e,t){return ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},ae(e,t)};function J(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ae(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var b=function(){return b=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0}),r=[],n=0,i=t;n1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(St,function(f,u,o,c,l,E){if(u)t.minimumIntegerDigits=o.length;else{if(c&&l)throw new Error("We currently do not support maximum integer digits");if(E)throw new Error("We currently do not support exact integer digits")}return""});continue}if(ke.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(_e.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(_e,function(f,u,o,c,l,E){return o==="*"?t.minimumFractionDigits=u.length:c&&c[0]==="#"?t.maximumFractionDigits=c.length:l&&E?(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length+E.length):(t.minimumFractionDigits=u.length,t.maximumFractionDigits=u.length),""});var a=i.options[0];a==="w"?t=b(b({},t),{trailingZeroDisplay:"stripIfInteger"}):a&&(t=b(b({},t),He(a)));continue}if(Xe.test(i.stem)){t=b(b({},t),He(i.stem));continue}var s=$e(i.stem);s&&(t=b(b({},t),s));var h=At(i.stem);h&&(t=b(b({},t),h))}return t}var $={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function Ot(e,t){for(var r="",n=0;n>1),f="a",u=It(t);for((u=="H"||u=="k")&&(h=0);h-- >0;)r+=f;for(;s-- >0;)r=u+r}else i==="J"?r+="H":r+=i}return r}function It(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r=e.language,n;r!=="root"&&(n=e.maximize().region);var i=$[n||""]||$[r||""]||$["".concat(r,"-001")]||$["001"];return i[0]}var ee,Nt=new RegExp("^".concat(Ve.source,"*")),Lt=new RegExp("".concat(Ve.source,"*$"));function p(e,t){return{start:e,end:t}}var Mt=!!String.prototype.startsWith&&"_a".startsWith("a",1),Ct=!!String.fromCodePoint,wt=!!Object.fromEntries,Rt=!!String.prototype.codePointAt,Ut=!!String.prototype.trimStart,Gt=!!String.prototype.trimEnd,Dt=!!Number.isSafeInteger,Ft=Dt?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},se=!0;try{var jt=Ze("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");se=((ee=jt.exec("a"))===null||ee===void 0?void 0:ee[0])==="a"}catch{se=!1}var Be=Mt?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},he=Ct?String.fromCodePoint:function(){for(var t=[],r=0;ra;){if(s=t[a++],s>1114111)throw RangeError(s+" is not a valid code point");n+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return n},Se=wt?Object.fromEntries:function(t){for(var r={},n=0,i=t;n=n)){var i=t.charCodeAt(r),a;return i<55296||i>56319||r+1===n||(a=t.charCodeAt(r+1))<56320||a>57343?i:(i-55296<<10)+(a-56320)+65536}},Vt=Ut?function(t){return t.trimStart()}:function(t){return t.replace(Nt,"")},Xt=Gt?function(t){return t.trimEnd()}:function(t){return t.replace(Lt,"")};function Ze(e,t){return new RegExp(e,t)}var ue;if(se){var Ae=Ze("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");ue=function(t,r){var n;Ae.lastIndex=r;var i=Ae.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}}else ue=function(t,r){for(var n=[];;){var i=We(t,r);if(i===void 0||ze(i)||Zt(i))break;n.push(i),r+=i>=65536?2:1}return he.apply(void 0,n)};var kt=function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.locale=r.locale,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,r,n){for(var i=[];!this.isEOF();){var a=this.char();if(a===123){var s=this.parseArgument(t,n);if(s.err)return s;i.push(s.val)}else{if(a===125&&t>0)break;if(a===35&&(r==="plural"||r==="selectordinal")){var h=this.clonePosition();this.bump(),i.push({type:g.pound,location:p(h,this.clonePosition())})}else if(a===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(m.UNMATCHED_CLOSING_TAG,p(this.clonePosition(),this.clonePosition()))}else if(a===60&&!this.ignoreTag&&le(this.peek()||0)){var s=this.parseTag(t,r);if(s.err)return s;i.push(s.val)}else{var s=this.parseLiteral(t,r);if(s.err)return s;i.push(s.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:g.literal,value:"<".concat(i,"/>"),location:p(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var a=this.parseMessage(t+1,r,!0);if(a.err)return a;var s=a.val,h=this.clonePosition();if(this.bumpIf("")?{val:{type:g.tag,value:i,children:s,location:p(n,this.clonePosition())},err:null}:this.error(m.INVALID_TAG,p(h,this.clonePosition())))}else return this.error(m.UNCLOSED_TAG,p(n,this.clonePosition()))}else return this.error(m.INVALID_TAG,p(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Wt(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),i="";;){var a=this.tryParseQuote(r);if(a){i+=a;continue}var s=this.tryParseUnquoted(t,r);if(s){i+=s;continue}var h=this.tryParseLeftAngleBracket();if(h){i+=h;continue}break}var f=p(n,this.clonePosition());return{val:{type:g.literal,value:i,location:f},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!$t(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return he.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),he(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(m.EXPECT_ARGUMENT_CLOSING_BRACE,p(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(m.EMPTY_ARGUMENT,p(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(m.MALFORMED_ARGUMENT,p(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(m.EXPECT_ARGUMENT_CLOSING_BRACE,p(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:g.argument,value:i,location:p(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(m.EXPECT_ARGUMENT_CLOSING_BRACE,p(n,this.clonePosition())):this.parseArgumentOptions(t,r,i,n);default:return this.error(m.MALFORMED_ARGUMENT,p(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=ue(this.message,r),i=r+n.length;this.bumpTo(i);var a=this.clonePosition(),s=p(t,a);return{value:n,location:s}},e.prototype.parseArgumentOptions=function(t,r,n,i){var a,s=this.clonePosition(),h=this.parseIdentifierIfPossible().value,f=this.clonePosition();switch(h){case"":return this.error(m.EXPECT_ARGUMENT_TYPE,p(s,f));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var o=this.clonePosition(),c=this.parseSimpleArgStyleIfPossible();if(c.err)return c;var l=Xt(c.val);if(l.length===0)return this.error(m.EXPECT_ARGUMENT_STYLE,p(this.clonePosition(),this.clonePosition()));var E=p(o,this.clonePosition());u={style:l,styleLocation:E}}var v=this.tryParseArgumentClose(i);if(v.err)return v;var d=p(i,this.clonePosition());if(u&&Be(u==null?void 0:u.style,"::",0)){var T=Vt(u.style.slice(2));if(h==="number"){var c=this.parseNumberSkeletonFromString(T,u.styleLocation);return c.err?c:{val:{type:g.number,value:n,location:d,style:c.val},err:null}}else{if(T.length===0)return this.error(m.EXPECT_DATE_TIME_SKELETON,d);var w=T;this.locale&&(w=Ot(T,this.locale));var l={type:P.dateTime,pattern:w,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?_t(w):{}},S=h==="date"?g.date:g.time;return{val:{type:S,value:n,location:d,style:l},err:null}}}return{val:{type:h==="number"?g.number:h==="date"?g.date:g.time,value:n,location:d,style:(a=u==null?void 0:u.style)!==null&&a!==void 0?a:null},err:null}}case"plural":case"selectordinal":case"select":{var y=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(m.EXPECT_SELECT_ARGUMENT_OPTIONS,p(y,b({},y)));this.bumpSpace();var R=this.parseIdentifierIfPossible(),B=0;if(h!=="select"&&R.value==="offset"){if(!this.bumpIf(":"))return this.error(m.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,p(this.clonePosition(),this.clonePosition()));this.bumpSpace();var c=this.tryParseDecimalInteger(m.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,m.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(c.err)return c;this.bumpSpace(),R=this.parseIdentifierIfPossible(),B=c.val}var k=this.tryParsePluralOrSelectOptions(t,h,r,R);if(k.err)return k;var v=this.tryParseArgumentClose(i);if(v.err)return v;var ve=p(i,this.clonePosition());return h==="select"?{val:{type:g.select,value:n,options:Se(k.val),location:ve},err:null}:{val:{type:g.plural,value:n,options:Se(k.val),offset:B,pluralType:h==="plural"?"cardinal":"ordinal",location:ve},err:null}}default:return this.error(m.INVALID_ARGUMENT_TYPE,p(s,f))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(m.EXPECT_ARGUMENT_CLOSING_BRACE,p(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(m.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,p(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var n=[];try{n=Tt(t)}catch{return this.error(m.INVALID_NUMBER_SKELETON,r)}return{val:{type:P.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?Pt(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,i){for(var a,s=!1,h=[],f=new Set,u=i.value,o=i.location;;){if(u.length===0){var c=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var l=this.tryParseDecimalInteger(m.EXPECT_PLURAL_ARGUMENT_SELECTOR,m.INVALID_PLURAL_ARGUMENT_SELECTOR);if(l.err)return l;o=p(c,this.clonePosition()),u=this.message.slice(c.offset,this.offset())}else break}if(f.has(u))return this.error(r==="select"?m.DUPLICATE_SELECT_ARGUMENT_SELECTOR:m.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,o);u==="other"&&(s=!0),this.bumpSpace();var E=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?m.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:m.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,p(this.clonePosition(),this.clonePosition()));var v=this.parseMessage(t+1,r,n);if(v.err)return v;var d=this.tryParseArgumentClose(E);if(d.err)return d;h.push([u,{value:v.val,location:p(E,this.clonePosition())}]),f.add(u),this.bumpSpace(),a=this.parseIdentifierIfPossible(),u=a.value,o=a.location}return h.length===0?this.error(r==="select"?m.EXPECT_SELECT_ARGUMENT_SELECTOR:m.EXPECT_PLURAL_ARGUMENT_SELECTOR,p(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(m.MISSING_OTHER_CLAUSE,p(this.clonePosition(),this.clonePosition())):{val:h,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var a=!1,s=0;!this.isEOF();){var h=this.char();if(h>=48&&h<=57)a=!0,s=s*10+(h-48),this.bump();else break}var f=p(i,this.clonePosition());return a?(s*=n,Ft(s)?{val:s,err:null}:this.error(r,f)):this.error(t,f)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var r=We(this.message,t);if(r===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(Be(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&ze(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e}();function le(e){return e>=97&&e<=122||e>=65&&e<=90}function $t(e){return le(e)||e===47}function Wt(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function ze(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Zt(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function fe(e){e.forEach(function(t){if(delete t.location,Ge(t)||De(t))for(var r in t.options)delete t.options[r].location,fe(t.options[r].value);else we(t)&&je(t.style)||(Re(t)||Ue(t))&&oe(t.style)?delete t.style.location:Fe(t)&&fe(t.children)})}function zt(e,t){t===void 0&&(t={}),t=b({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new kt(e,t).parse();if(r.err){var n=SyntaxError(m[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t!=null&&t.captureLocation||fe(r.val),r.val}function te(e,t){var r=t&&t.cache?t.cache:er,n=t&&t.serializer?t.serializer:Kt,i=t&&t.strategy?t.strategy:Jt;return i(e,{cache:r,serializer:n})}function Qt(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Qe(e,t,r,n){var i=Qt(n)?n:r(n),a=t.get(i);return typeof a>"u"&&(a=e.call(this,n),t.set(i,a)),a}function Je(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),a=t.get(i);return typeof a>"u"&&(a=e.apply(this,n),t.set(i,a)),a}function pe(e,t,r,n,i){return r.bind(t,e,n,i)}function Jt(e,t){var r=e.length===1?Qe:Je;return pe(e,this,r,t.cache.create(),t.serializer)}function qt(e,t){return pe(e,this,Je,t.cache.create(),t.serializer)}function Yt(e,t){return pe(e,this,Qe,t.cache.create(),t.serializer)}var Kt=function(){return JSON.stringify(arguments)};function be(){this.cache=Object.create(null)}be.prototype.get=function(e){return this.cache[e]};be.prototype.set=function(e,t){this.cache[e]=t};var er={create:function(){return new be}},re={variadic:qt,monadic:Yt},O;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(O||(O={}));var q=function(e){J(t,e);function t(r,n,i){var a=e.call(this,r)||this;return a.code=n,a.originalMessage=i,a}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),Pe=function(e){J(t,e);function t(r,n,i,a){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(n,'". Options are "').concat(Object.keys(i).join('", "'),'"'),O.INVALID_VALUE,a)||this}return t}(q),tr=function(e){J(t,e);function t(r,n,i){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(n),O.INVALID_VALUE,i)||this}return t}(q),rr=function(e){J(t,e);function t(r,n){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(n,'"'),O.MISSING_VALUE,n)||this}return t}(q),x;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(x||(x={}));function nr(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==x.literal||r.type!==x.literal?t.push(r):n.value+=r.value,t},[])}function ir(e){return typeof e=="function"}function W(e,t,r,n,i,a,s){if(e.length===1&&ye(e[0]))return[{type:x.literal,value:e[0].value}];for(var h=[],f=0,u=e;f"u")){var r=Intl.NumberFormat.supportedLocalesOf(t);return r.length>0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=zt,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();function hr(e,t){if(t==null)return;if(t in e)return e[t];const r=t.split(".");let n=e;for(let i=0;i0){const a=r.slice(i,r.length).join(".");if(a in n){n=n[a];break}}n=n[r[i]]}else n=void 0;return n}const _={},ur=(e,t,r)=>r&&(t in _||(_[t]={}),e in _[t]||(_[t][e]=r),r),Ye=(e,t)=>{if(t==null)return;if(t in _&&e in _[t])return _[t][e];const r=X(t);for(let n=0;n(r[e]=Et.all([r[e]||{},...t]),r))}N([L],([e])=>Object.keys(e));L.subscribe(e=>ge=e);const D={};function pr(e){D[e]=new Set}function br(e,t){D[e].delete(t),D[e].size===0&&delete D[e]}function F(e){return D[e]}function gr(e){return X(e).map(t=>{const r=F(t);return[t,r?[...r]:[]]}).filter(([,t])=>t.length>0)}function Z(e){return e==null?!1:X(e).some(t=>{var r;return(r=F(t))==null?void 0:r.size})}function Er(e,t){return Promise.all(t.map(n=>(br(e,n),n().then(i=>i.default||i)))).then(n=>mr(e,...n))}const U={};function Ke(e){if(!Z(e))return e in U?U[e]:Promise.resolve();const t=gr(e);return U[e]=Promise.all(t.map(([r,n])=>Er(r,n))).then(()=>{if(Z(e))return Ke(e);delete U[e]}),U[e]}function Zr(e,t){F(e)||pr(e);const r=F(e);F(e).has(t)||(Ee(e)||L.update(n=>(n[e]={},n)),r.add(t))}var Oe=Object.getOwnPropertySymbols,xr=Object.prototype.hasOwnProperty,vr=Object.prototype.propertyIsEnumerable,dr=(e,t)=>{var r={};for(var n in e)xr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Oe)for(var n of Oe(e))t.indexOf(n)<0&&vr.call(e,n)&&(r[n]=e[n]);return r};const yr={number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}};function _r({locale:e,id:t}){console.warn(`[svelte-i18n] The message "${t}" was not found in "${X(e).join('", "')}".${Z(H())?` Note: there are at least one loader still registered to this locale that wasn't executed.`:""}`)}const Hr={fallbackLocale:null,loadingDelay:200,formats:yr,warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0},G=Hr;function I(){return G}function zr(e){const t=e,{formats:r}=t,n=dr(t,["formats"]);let i=e.fallbackLocale;if(e.initialLocale)try{qe.resolveLocale(e.initialLocale)&&(i=e.initialLocale)}catch{console.warn(`[svelte-i18n] The initial locale "${e.initialLocale}" is not a valid locale.`)}return n.warnOnMissingMessages&&(delete n.warnOnMissingMessages,n.handleMissingMessage==null?n.handleMissingMessage=_r:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(G,n,{initialLocale:i}),r&&("number"in r&&Object.assign(G.formats.number,r.number),"date"in r&&Object.assign(G.formats.date,r.date),"time"in r&&Object.assign(G.formats.time,r.time)),M.set(i)}const ie=me(!1);var Tr=Object.defineProperty,Br=Object.defineProperties,Sr=Object.getOwnPropertyDescriptors,Ie=Object.getOwnPropertySymbols,Ar=Object.prototype.hasOwnProperty,Pr=Object.prototype.propertyIsEnumerable,Ne=(e,t,r)=>t in e?Tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Or=(e,t)=>{for(var r in t||(t={}))Ar.call(t,r)&&Ne(e,r,t[r]);if(Ie)for(var r of Ie(t))Pr.call(t,r)&&Ne(e,r,t[r]);return e},Ir=(e,t)=>Br(e,Sr(t));let ce;const z=me(null);function Le(e){return e.split("-").map((t,r,n)=>n.slice(0,r+1).join("-")).reverse()}function X(e,t=I().fallbackLocale){const r=Le(e);return t?[...new Set([...r,...Le(t)])]:r}function H(){return ce??void 0}z.subscribe(e=>{ce=e??void 0,typeof window<"u"&&e!=null&&document.documentElement.setAttribute("lang",e)});const Nr=e=>{if(e&&cr(e)&&Z(e)){const{loadingDelay:t}=I();let r;return typeof window<"u"&&H()!=null&&t?r=window.setTimeout(()=>ie.set(!0),t):ie.set(!0),Ke(e).then(()=>{z.set(e)}).finally(()=>{clearTimeout(r),ie.set(!1)})}return z.set(e)},M=Ir(Or({},z),{set:Nr}),Y=e=>{const t=Object.create(null);return n=>{const i=JSON.stringify(n);return i in t?t[i]:t[i]=e(n)}};var Lr=Object.defineProperty,Q=Object.getOwnPropertySymbols,et=Object.prototype.hasOwnProperty,tt=Object.prototype.propertyIsEnumerable,Me=(e,t,r)=>t in e?Lr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xe=(e,t)=>{for(var r in t||(t={}))et.call(t,r)&&Me(e,r,t[r]);if(Q)for(var r of Q(t))tt.call(t,r)&&Me(e,r,t[r]);return e},C=(e,t)=>{var r={};for(var n in e)et.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Q)for(var n of Q(e))t.indexOf(n)<0&&tt.call(e,n)&&(r[n]=e[n]);return r};const V=(e,t)=>{const{formats:r}=I();if(e in r&&t in r[e])return r[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},Mr=Y(e=>{var t=e,{locale:r,format:n}=t,i=C(t,["locale","format"]);if(r==null)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(i=V("number",n)),new Intl.NumberFormat(r,i)}),Cr=Y(e=>{var t=e,{locale:r,format:n}=t,i=C(t,["locale","format"]);if(r==null)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?i=V("date",n):Object.keys(i).length===0&&(i=V("date","short")),new Intl.DateTimeFormat(r,i)}),wr=Y(e=>{var t=e,{locale:r,format:n}=t,i=C(t,["locale","format"]);if(r==null)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?i=V("time",n):Object.keys(i).length===0&&(i=V("time","short")),new Intl.DateTimeFormat(r,i)}),Rr=(e={})=>{var t=e,{locale:r=H()}=t,n=C(t,["locale"]);return Mr(xe({locale:r},n))},Ur=(e={})=>{var t=e,{locale:r=H()}=t,n=C(t,["locale"]);return Cr(xe({locale:r},n))},Gr=(e={})=>{var t=e,{locale:r=H()}=t,n=C(t,["locale"]);return wr(xe({locale:r},n))},Dr=Y((e,t=H())=>new qe(e,t,I().formats,{ignoreTag:I().ignoreTag})),Fr=(e,t={})=>{var r,n,i,a;let s=t;typeof e=="object"&&(s=e,e=s.id);const{values:h,locale:f=H(),default:u}=s;if(f==null)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let o=Ye(e,f);if(!o)o=(a=(i=(n=(r=I()).handleMissingMessage)==null?void 0:n.call(r,{locale:f,id:e,defaultValue:u}))!=null?i:u)!=null?a:e;else if(typeof o!="string")return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof o}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),o;if(!h)return o;let c=o;try{c=Dr(o,f).format(h)}catch(l){l instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,l.message)}return c},jr=(e,t)=>Gr(t).format(e),Vr=(e,t)=>Ur(t).format(e),Xr=(e,t)=>Rr(t).format(e),kr=(e,t=H())=>Ye(e,t),Qr=N([M,L],()=>Fr);N([M],()=>jr);const Jr=N([M],()=>Vr);N([M],()=>Xr);N([M,L],()=>kr);export{Qr as $,Jr as a,M as b,zr as i,Zr as r};