7 lines
40 KiB
JavaScript
7 lines
40 KiB
JavaScript
;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="14df3d45-4ecf-241a-335b-80fb16bbbe6b")}catch(e){}}();
|
||
module.exports=[268200,a=>{"use strict";var b,c,d,e,f,g,h=a.i(150765),i=a.i(784446);class j extends Error{constructor(a,b){let c=a;b&&(c+=": "+b),super(c),this.code=a,b&&(this.originalMessage=b)}}var k=((b=k||{}).MISSING_MESSAGE="MISSING_MESSAGE",b.MISSING_FORMAT="MISSING_FORMAT",b.ENVIRONMENT_FALLBACK="ENVIRONMENT_FALLBACK",b.INSUFFICIENT_PATH="INSUFFICIENT_PATH",b.INVALID_MESSAGE="INVALID_MESSAGE",b.INVALID_KEY="INVALID_KEY",b.FORMATTING_ERROR="FORMATTING_ERROR",b);function l(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function m(a,b){return(0,i.memoize)(a,{cache:{create:()=>({get:a=>b[a],set(a,c){b[a]=c}})},strategy:i.strategies.variadic})}function n(a,b){return m((...b)=>new a(...b),b)}function o(a){return{getDateTimeFormat:n(Intl.DateTimeFormat,a.dateTime),getNumberFormat:n(Intl.NumberFormat,a.number),getPluralRules:n(Intl.PluralRules,a.pluralRules),getRelativeTimeFormat:n(Intl.RelativeTimeFormat,a.relativeTime),getListFormat:n(Intl.ListFormat,a.list),getDisplayNames:n(Intl.DisplayNames,a.displayNames)}}let p=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g,q=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i,r=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,s=/^(@+)?(\+|#+)?[rs]?$/g,t=/(\*)(0+)|(#+)(0+)|(0+)/g,u=/^(0+)$/;function v(a){let b={};return"r"===a[a.length-1]?b.roundingPriority="morePrecision":"s"===a[a.length-1]&&(b.roundingPriority="lessPrecision"),a.replace(s,function(a,c,d){return"string"!=typeof d?(b.minimumSignificantDigits=c.length,b.maximumSignificantDigits=c.length):"+"===d?b.minimumSignificantDigits=c.length:"#"===c[0]?b.maximumSignificantDigits=c.length:(b.minimumSignificantDigits=c.length,b.maximumSignificantDigits=c.length+("string"==typeof d?d.length:0)),""}),b}function w(a){switch(a){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function x(a){let b=w(a);return b||{}}let y=((c={})[c.literal=0]="literal",c[c.argument=1]="argument",c[c.number=2]="number",c[c.date=3]="date",c[c.time=4]="time",c[c.select=5]="select",c[c.plural=6]="plural",c[c.pound=7]="pound",c[c.tag=8]="tag",c),z=((d={})[d.number=0]="number",d[d.dateTime=1]="dateTime",d);function A(a){return a.type===y.literal}function B(a){return a.type===y.number}function C(a){return a.type===y.date}function D(a){return a.type===y.time}function E(a){return a.type===y.select}function F(a){return a.type===y.plural}function G(a){return a.type===y.tag}function H(a){return!!(a&&"object"==typeof a&&a.type===z.number)}function I(a){return!!(a&&"object"==typeof a&&a.type===z.dateTime)}let J=((e={})[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG",e),K=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,L={"001":["H","h"],419:["h","H","hB","hb"],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","H","hB","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","H","hB","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"],GS:["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","H","hB","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"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["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"],"ku-SY":["H","hB"],"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"]},M=RegExp(`^${K.source}*`),N=RegExp(`${K.source}*$`);function O(a,b){return{start:a,end:b}}let P=!!Object.fromEntries,Q=!!String.prototype.trimStart,R=!!String.prototype.trimEnd,S=P?Object.fromEntries:function(a){let b={};for(let[c,d]of a)b[c]=d;return b},T=Q?function(a){return a.trimStart()}:function(a){return a.replace(M,"")},U=R?function(a){return a.trimEnd()}:function(a){return a.replace(N,"")},V=RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");class W{message;position;locale;ignoreTag;requiresOtherClause;shouldParseSkeletons;constructor(a,b={}){this.message=a,this.position={offset:0,line:1,column:1},this.ignoreTag=!!b.ignoreTag,this.locale=b.locale,this.requiresOtherClause=!!b.requiresOtherClause,this.shouldParseSkeletons=!!b.shouldParseSkeletons}parse(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)}parseMessage(a,b,c){let d=[];for(;!this.isEOF();){let e=this.char();if(123===e){let b=this.parseArgument(a,c);if(b.err)return b;d.push(b.val)}else if(125===e&&a>0)break;else if(35===e&&("plural"===b||"selectordinal"===b)){let a=this.clonePosition();this.bump(),d.push({type:y.pound,location:O(a,this.clonePosition())})}else if(60!==e||this.ignoreTag||47!==this.peek())if(60===e&&!this.ignoreTag&&X(this.peek()||0)){let c=this.parseTag(a,b);if(c.err)return c;d.push(c.val)}else{let c=this.parseLiteral(a,b);if(c.err)return c;d.push(c.val)}else if(!c)return this.error(J.UNMATCHED_CLOSING_TAG,O(this.clonePosition(),this.clonePosition()));else break}return{val:d,err:null}}parseTag(a,b){let c=this.clonePosition();this.bump();let d=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:y.literal,value:`<${d}/>`,location:O(c,this.clonePosition())},err:null};if(!this.bumpIf(">"))return this.error(J.INVALID_TAG,O(c,this.clonePosition()));{let e=this.parseMessage(a+1,b,!0);if(e.err)return e;let f=e.val,g=this.clonePosition();if(!this.bumpIf("</"))return this.error(J.UNCLOSED_TAG,O(c,this.clonePosition()));{if(this.isEOF()||!X(this.char()))return this.error(J.INVALID_TAG,O(g,this.clonePosition()));let a=this.clonePosition();return d!==this.parseTagName()?this.error(J.UNMATCHED_CLOSING_TAG,O(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">"))?{val:{type:y.tag,value:d,children:f,location:O(c,this.clonePosition())},err:null}:this.error(J.INVALID_TAG,O(g,this.clonePosition()))}}}parseTagName(){var a;let b=this.offset();for(this.bump();!this.isEOF()&&(45===(a=this.char())||46===a||a>=48&&a<=57||95===a||a>=97&&a<=122||a>=65&&a<=90||183==a||a>=192&&a<=214||a>=216&&a<=246||a>=248&&a<=893||a>=895&&a<=8191||a>=8204&&a<=8205||a>=8255&&a<=8256||a>=8304&&a<=8591||a>=11264&&a<=12271||a>=12289&&a<=55295||a>=63744&&a<=64975||a>=65008&&a<=65533||a>=65536&&a<=983039);)this.bump();return this.message.slice(b,this.offset())}parseLiteral(a,b){let c=this.clonePosition(),d="";for(;;){let c=this.tryParseQuote(b);if(c){d+=c;continue}let e=this.tryParseUnquoted(a,b);if(e){d+=e;continue}let f=this.tryParseLeftAngleBracket();if(f){d+=f;continue}break}let e=O(c,this.clonePosition());return{val:{type:y.literal,value:d,location:e},err:null}}tryParseLeftAngleBracket(){var a;return this.isEOF()||60!==this.char()||!this.ignoreTag&&(X(a=this.peek()||0)||47===a)?null:(this.bump(),"<")}tryParseQuote(a){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===a||"selectordinal"===a)break;return null;default:return null}this.bump();let b=[this.char()];for(this.bump();!this.isEOF();){let a=this.char();if(39===a)if(39===this.peek())b.push(39),this.bump();else{this.bump();break}else b.push(a);this.bump()}return String.fromCodePoint(...b)}tryParseUnquoted(a,b){if(this.isEOF())return null;let c=this.char();return 60===c||123===c||35===c&&("plural"===b||"selectordinal"===b)||125===c&&a>0?null:(this.bump(),String.fromCodePoint(c))}parseArgument(a,b){let c=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(J.EXPECT_ARGUMENT_CLOSING_BRACE,O(c,this.clonePosition()));if(125===this.char())return this.bump(),this.error(J.EMPTY_ARGUMENT,O(c,this.clonePosition()));let d=this.parseIdentifierIfPossible().value;if(!d)return this.error(J.MALFORMED_ARGUMENT,O(c,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(J.EXPECT_ARGUMENT_CLOSING_BRACE,O(c,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:y.argument,value:d,location:O(c,this.clonePosition())},err:null};case 44:if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(J.EXPECT_ARGUMENT_CLOSING_BRACE,O(c,this.clonePosition()));return this.parseArgumentOptions(a,b,d,c);default:return this.error(J.MALFORMED_ARGUMENT,O(c,this.clonePosition()))}}parseIdentifierIfPossible(){var a;let b=this.clonePosition(),c=this.offset(),d=(a=this.message,V.lastIndex=c,V.exec(a)[1]??""),e=c+d.length;return this.bumpTo(e),{value:d,location:O(b,this.clonePosition())}}parseArgumentOptions(a,b,c,d){let e=this.clonePosition(),f=this.parseIdentifierIfPossible().value,g=this.clonePosition();switch(f){case"":return this.error(J.EXPECT_ARGUMENT_TYPE,O(e,g));case"number":case"date":case"time":{this.bumpSpace();let a=null;if(this.bumpIf(",")){this.bumpSpace();let b=this.clonePosition(),c=this.parseSimpleArgStyleIfPossible();if(c.err)return c;let d=U(c.val);if(0===d.length)return this.error(J.EXPECT_ARGUMENT_STYLE,O(this.clonePosition(),this.clonePosition()));a={style:d,styleLocation:O(b,this.clonePosition())}}let b=this.tryParseArgumentClose(d);if(b.err)return b;let e=O(d,this.clonePosition());if(a&&a.style.startsWith("::")){let b=T(a.style.slice(2));if("number"===f){let d=this.parseNumberSkeletonFromString(b,a.styleLocation);if(d.err)return d;return{val:{type:y.number,value:c,location:e,style:d.val},err:null}}{let d;if(0===b.length)return this.error(J.EXPECT_DATE_TIME_SKELETON,e);let g=b;this.locale&&(g=function(a,b){let c="";for(let d=0;d<a.length;d++){let e=a.charAt(d);if("j"===e){let f=0;for(;d+1<a.length&&a.charAt(d+1)===e;)f++,d++;let g=1+(1&f),h=f<2?1:3+(f>>1),i=function(a){let b,c=a.hourCycle;if(void 0===c&&a.hourCycles&&a.hourCycles.length&&(c=a.hourCycles[0]),c)switch(c){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw Error("Invalid hourCycle")}let d=a.language;return"root"!==d&&(b=a.maximize().region),(L[b||""]||L[d||""]||L[`${d}-001`]||L["001"])[0]}(b);for(("H"==i||"k"==i)&&(h=0);h-- >0;)c+="a";for(;g-- >0;)c=i+c}else"J"===e?c+="H":c+=e}return c}(b,this.locale));let h={type:z.dateTime,pattern:g,location:a.styleLocation,parsedOptions:this.shouldParseSkeletons?(d={},g.replace(p,a=>{let b=a.length;switch(a[0]){case"G":d.era=4===b?"long":5===b?"narrow":"short";break;case"y":d.year=2===b?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":d.month=["numeric","2-digit","short","long","narrow"][b-1];break;case"w":case"W":throw RangeError("`w/W` (week) patterns are not supported");case"d":d.day=["numeric","2-digit"][b-1];break;case"D":case"F":case"g":throw RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":d.weekday=4===b?"long":5===b?"narrow":"short";break;case"e":if(b<4)throw RangeError("`e..eee` (weekday) patterns are not supported");d.weekday=["short","long","narrow","short"][b-4];break;case"c":if(b<4)throw RangeError("`c..ccc` (weekday) patterns are not supported");d.weekday=["short","long","narrow","short"][b-4];break;case"a":d.hour12=!0;break;case"b":case"B":throw RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":d.hourCycle="h12",d.hour=["numeric","2-digit"][b-1];break;case"H":d.hourCycle="h23",d.hour=["numeric","2-digit"][b-1];break;case"K":d.hourCycle="h11",d.hour=["numeric","2-digit"][b-1];break;case"k":d.hourCycle="h24",d.hour=["numeric","2-digit"][b-1];break;case"j":case"J":case"C":throw RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":d.minute=["numeric","2-digit"][b-1];break;case"s":d.second=["numeric","2-digit"][b-1];break;case"S":case"A":throw RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":d.timeZoneName=b<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),d):{}};return{val:{type:"date"===f?y.date:y.time,value:c,location:e,style:h},err:null}}}return{val:{type:"number"===f?y.number:"date"===f?y.date:y.time,value:c,location:e,style:a?.style??null},err:null}}case"plural":case"selectordinal":case"select":{let e=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(J.EXPECT_SELECT_ARGUMENT_OPTIONS,O(e,{...e}));this.bumpSpace();let g=this.parseIdentifierIfPossible(),h=0;if("select"!==f&&"offset"===g.value){if(!this.bumpIf(":"))return this.error(J.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,O(this.clonePosition(),this.clonePosition()));this.bumpSpace();let a=this.tryParseDecimalInteger(J.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,J.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(a.err)return a;this.bumpSpace(),g=this.parseIdentifierIfPossible(),h=a.val}let i=this.tryParsePluralOrSelectOptions(a,f,b,g);if(i.err)return i;let j=this.tryParseArgumentClose(d);if(j.err)return j;let k=O(d,this.clonePosition());if("select"===f)return{val:{type:y.select,value:c,options:S(i.val),location:k},err:null};return{val:{type:y.plural,value:c,options:S(i.val),offset:h,pluralType:"plural"===f?"cardinal":"ordinal",location:k},err:null}}default:return this.error(J.INVALID_ARGUMENT_TYPE,O(e,g))}}tryParseArgumentClose(a){return this.isEOF()||125!==this.char()?this.error(J.EXPECT_ARGUMENT_CLOSING_BRACE,O(a,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let a=0,b=this.clonePosition();for(;!this.isEOF();)switch(this.char()){case 39:{this.bump();let a=this.clonePosition();if(!this.bumpUntil("'"))return this.error(J.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,O(a,this.clonePosition()));this.bump();break}case 123:a+=1,this.bump();break;case 125:if(!(a>0))return{val:this.message.slice(b.offset,this.offset()),err:null};a-=1;break;default:this.bump()}return{val:this.message.slice(b.offset,this.offset()),err:null}}parseNumberSkeletonFromString(a,b){let c=[];try{c=function(a){if(0===a.length)throw Error("Number skeleton cannot be empty");let b=a.split(q).filter(a=>a.length>0),c=[];for(let a of b){let b=a.split("/");if(0===b.length)throw Error("Invalid number skeleton");let[d,...e]=b;for(let a of e)if(0===a.length)throw Error("Invalid number skeleton");c.push({stem:d,options:e})}return c}(a)}catch{return this.error(J.INVALID_NUMBER_SKELETON,b)}return{val:{type:z.number,tokens:c,location:b,parsedOptions:this.shouldParseSkeletons?function(a){let b={};for(let c of a){switch(c.stem){case"percent":case"%":b.style="percent";continue;case"%x100":b.style="percent",b.scale=100;continue;case"currency":b.style="currency",b.currency=c.options[0];continue;case"group-off":case",_":b.useGrouping=!1;continue;case"precision-integer":case".":b.maximumFractionDigits=0;continue;case"measure-unit":case"unit":b.style="unit",b.unit=c.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":b.notation="compact",b.compactDisplay="short";continue;case"compact-long":case"KK":b.notation="compact",b.compactDisplay="long";continue;case"scientific":b={...b,notation:"scientific",...c.options.reduce((a,b)=>({...a,...x(b)}),{})};continue;case"engineering":b={...b,notation:"engineering",...c.options.reduce((a,b)=>({...a,...x(b)}),{})};continue;case"notation-simple":b.notation="standard";continue;case"unit-width-narrow":b.currencyDisplay="narrowSymbol",b.unitDisplay="narrow";continue;case"unit-width-short":b.currencyDisplay="code",b.unitDisplay="short";continue;case"unit-width-full-name":b.currencyDisplay="name",b.unitDisplay="long";continue;case"unit-width-iso-code":b.currencyDisplay="symbol";continue;case"scale":b.scale=parseFloat(c.options[0]);continue;case"rounding-mode-floor":b.roundingMode="floor";continue;case"rounding-mode-ceiling":b.roundingMode="ceil";continue;case"rounding-mode-down":b.roundingMode="trunc";continue;case"rounding-mode-up":b.roundingMode="expand";continue;case"rounding-mode-half-even":b.roundingMode="halfEven";continue;case"rounding-mode-half-down":b.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":b.roundingMode="halfExpand";continue;case"integer-width":if(c.options.length>1)throw RangeError("integer-width stems only accept a single optional option");c.options[0].replace(t,function(a,c,d,e,f,g){if(c)b.minimumIntegerDigits=d.length;else if(e&&f)throw Error("We currently do not support maximum integer digits");else if(g)throw Error("We currently do not support exact integer digits");return""});continue}if(u.test(c.stem)){b.minimumIntegerDigits=c.stem.length;continue}if(r.test(c.stem)){if(c.options.length>1)throw RangeError("Fraction-precision stems only accept a single optional option");c.stem.replace(r,function(a,c,d,e,f,g){return"*"===d?b.minimumFractionDigits=c.length:e&&"#"===e[0]?b.maximumFractionDigits=e.length:f&&g?(b.minimumFractionDigits=f.length,b.maximumFractionDigits=f.length+g.length):(b.minimumFractionDigits=c.length,b.maximumFractionDigits=c.length),""});let a=c.options[0];"w"===a?b={...b,trailingZeroDisplay:"stripIfInteger"}:a&&(b={...b,...v(a)});continue}if(s.test(c.stem)){b={...b,...v(c.stem)};continue}let a=w(c.stem);a&&(b={...b,...a});let d=function(a){let b;if("E"===a[0]&&"E"===a[1]?(b={notation:"engineering"},a=a.slice(2)):"E"===a[0]&&(b={notation:"scientific"},a=a.slice(1)),b){let c=a.slice(0,2);if("+!"===c?(b.signDisplay="always",a=a.slice(2)):"+?"===c&&(b.signDisplay="exceptZero",a=a.slice(2)),!u.test(a))throw Error("Malformed concise eng/scientific notation");b.minimumIntegerDigits=a.length}return b}(c.stem);d&&(b={...b,...d})}return b}(c):{}},err:null}}tryParsePluralOrSelectOptions(a,b,c,d){let e=!1,f=[],g=new Set,{value:h,location:i}=d;for(;;){if(0===h.length){let a=this.clonePosition();if("select"!==b&&this.bumpIf("=")){let b=this.tryParseDecimalInteger(J.EXPECT_PLURAL_ARGUMENT_SELECTOR,J.INVALID_PLURAL_ARGUMENT_SELECTOR);if(b.err)return b;i=O(a,this.clonePosition()),h=this.message.slice(a.offset,this.offset())}else break}if(g.has(h))return this.error("select"===b?J.DUPLICATE_SELECT_ARGUMENT_SELECTOR:J.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,i);"other"===h&&(e=!0),this.bumpSpace();let d=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===b?J.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:J.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,O(this.clonePosition(),this.clonePosition()));let j=this.parseMessage(a+1,b,c);if(j.err)return j;let k=this.tryParseArgumentClose(d);if(k.err)return k;f.push([h,{value:j.val,location:O(d,this.clonePosition())}]),g.add(h),this.bumpSpace(),{value:h,location:i}=this.parseIdentifierIfPossible()}return 0===f.length?this.error("select"===b?J.EXPECT_SELECT_ARGUMENT_SELECTOR:J.EXPECT_PLURAL_ARGUMENT_SELECTOR,O(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!e?this.error(J.MISSING_OTHER_CLAUSE,O(this.clonePosition(),this.clonePosition())):{val:f,err:null}}tryParseDecimalInteger(a,b){let c=1,d=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(c=-1);let e=!1,f=0;for(;!this.isEOF();){let a=this.char();if(a>=48&&a<=57)e=!0,f=10*f+(a-48),this.bump();else break}let g=O(d,this.clonePosition());return e?Number.isSafeInteger(f*=c)?{val:f,err:null}:this.error(b,g):this.error(a,g)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){let a=this.position.offset;if(a>=this.message.length)throw Error("out of bound");let b=this.message.codePointAt(a);if(void 0===b)throw Error(`Offset ${a} is at invalid UTF-16 code unit boundary`);return b}error(a,b){return{val:null,err:{kind:a,message:this.message,location:b}}}bump(){if(this.isEOF())return;let a=this.char();10===a?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=a<65536?1:2)}bumpIf(a){if(this.message.startsWith(a,this.offset())){for(let b=0;b<a.length;b++)this.bump();return!0}return!1}bumpUntil(a){let b=this.offset(),c=this.message.indexOf(a,b);return c>=0?(this.bumpTo(c),!0):(this.bumpTo(this.message.length),!1)}bumpTo(a){if(this.offset()>a)throw Error(`targetOffset ${a} must be greater than or equal to the current offset ${this.offset()}`);for(a=Math.min(a,this.message.length);;){let b=this.offset();if(b===a)break;if(b>a)throw Error(`targetOffset ${a} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(var a;!this.isEOF()&&((a=this.char())>=9&&a<=13||32===a||133===a||a>=8206&&a<=8207||8232===a||8233===a);)this.bump()}peek(){if(this.isEOF())return null;let a=this.char(),b=this.offset();return this.message.charCodeAt(b+(a>=65536?2:1))??null}}function X(a){return a>=97&&a<=122||a>=65&&a<=90}function Y(a,b={}){let c=new W(a,b={shouldParseSkeletons:!0,requiresOtherClause:!0,...b}).parse();if(c.err){let a=SyntaxError(J[c.err.kind]);throw a.location=c.err.location,a.originalMessage=c.err.message,a}return b?.captureLocation||function a(b){b.forEach(b=>{if(delete b.location,E(b)||F(b))for(let c in b.options)delete b.options[c].location,a(b.options[c].value);else B(b)&&H(b.style)||(C(b)||D(b))&&I(b.style)?delete b.style.location:G(b)&&a(b.children)})}(c.val),c.val}let Z=((f={}).MISSING_VALUE="MISSING_VALUE",f.INVALID_VALUE="INVALID_VALUE",f.MISSING_INTL_API="MISSING_INTL_API",f);class $ extends Error{code;originalMessage;constructor(a,b,c){super(a),this.code=b,this.originalMessage=c}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}}class _ extends ${constructor(a,b,c,d){super(`Invalid values for "${a}": "${b}". Options are "${Object.keys(c).join('", "')}"`,Z.INVALID_VALUE,d)}}class aa extends ${constructor(a,b,c){super(`Value for "${a}" must be of type ${b}`,Z.INVALID_VALUE,c)}}class ab extends ${constructor(a,b){super(`The intl string context variable "${a}" was not provided to the string "${b}"`,Z.MISSING_VALUE,b)}}let ac=((g={})[g.literal=0]="literal",g[g.object=1]="object",g);function ad(a){return{create:()=>({get:b=>a[b],set(b,c){a[b]=c}})}}class ae{ast;locales;resolvedLocale;formatters;formats;message;formatterCache={number:{},dateTime:{},pluralRules:{}};constructor(a,b=ae.defaultLocale,c,d){if(this.locales=b,this.resolvedLocale=ae.resolveLocale(b),"string"==typeof a){if(this.message=a,!ae.__parse)throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...b}=d||{};this.ast=ae.__parse(a,{...b,locale:this.resolvedLocale})}else this.ast=a;if(!Array.isArray(this.ast))throw TypeError("A message must be provided as a String or AST.");this.formats=function(a,b){return b?Object.keys(a).reduce((c,d)=>{var e,f;return c[d]=(e=a[d],(f=b[d])?{...e,...f,...Object.keys(e).reduce((a,b)=>(a[b]={...e[b],...f[b]},a),{})}:e),c},{...a}):a}(ae.formats,c),this.formatters=d&&d.formatters||function(a={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:(0,i.memoize)((...a)=>new Intl.NumberFormat(...a),{cache:ad(a.number),strategy:i.strategies.variadic}),getDateTimeFormat:(0,i.memoize)((...a)=>new Intl.DateTimeFormat(...a),{cache:ad(a.dateTime),strategy:i.strategies.variadic}),getPluralRules:(0,i.memoize)((...a)=>new Intl.PluralRules(...a),{cache:ad(a.pluralRules),strategy:i.strategies.variadic})}}(this.formatterCache)}format=a=>{let b=this.formatToParts(a);if(1===b.length)return b[0].value;let c=b.reduce((a,b)=>(a.length&&b.type===ac.literal&&"string"==typeof a[a.length-1]?a[a.length-1]+=b.value:a.push(b.value),a),[]);return c.length<=1?c[0]||"":c};formatToParts=a=>(function a(b,c,d,e,f,g,h){if(1===b.length&&A(b[0]))return[{type:ac.literal,value:b[0].value}];let i=[];for(let j of b){if(A(j)){i.push({type:ac.literal,value:j.value});continue}if(j.type===y.pound){"number"==typeof g&&i.push({type:ac.literal,value:d.getNumberFormat(c).format(g)});continue}let{value:b}=j;if(!(f&&b in f))throw new ab(b,h);let k=f[b];if(j.type===y.argument){k&&"string"!=typeof k&&"number"!=typeof k&&"bigint"!=typeof k||(k="string"==typeof k||"number"==typeof k||"bigint"==typeof k?String(k):""),i.push({type:"string"==typeof k?ac.literal:ac.object,value:k});continue}if(C(j)){let a="string"==typeof j.style?e.date[j.style]:I(j.style)?j.style.parsedOptions:void 0;i.push({type:ac.literal,value:d.getDateTimeFormat(c,a).format(k)});continue}if(D(j)){let a="string"==typeof j.style?e.time[j.style]:I(j.style)?j.style.parsedOptions:e.time.medium;i.push({type:ac.literal,value:d.getDateTimeFormat(c,a).format(k)});continue}if(B(j)){let a="string"==typeof j.style?e.number[j.style]:H(j.style)?j.style.parsedOptions:void 0;if(a&&a.scale){let b=a.scale||1;if("bigint"==typeof k){if(!Number.isInteger(b))throw TypeError(`Cannot apply fractional scale ${b} to bigint value. Scale must be an integer when formatting bigint.`);k*=BigInt(b)}else k*=b}i.push({type:ac.literal,value:d.getNumberFormat(c,a).format(k)});continue}if(G(j)){let{children:b,value:k}=j,l=f[k];if("function"!=typeof l)throw new aa(k,"function",h);let m=l(a(b,c,d,e,f,g).map(a=>a.value));Array.isArray(m)||(m=[m]),i.push(...m.map(a=>({type:"string"==typeof a?ac.literal:ac.object,value:a})))}if(E(j)){let b=k,g=(Object.prototype.hasOwnProperty.call(j.options,b)?j.options[b]:void 0)||j.options.other;if(!g)throw new _(j.value,k,Object.keys(j.options),h);i.push(...a(g.value,c,d,e,f));continue}if(F(j)){let b=`=${k}`,g=Object.prototype.hasOwnProperty.call(j.options,b)?j.options[b]:void 0;if(!g){if(!Intl.PluralRules)throw new $(`Intl.PluralRules is not available in this environment.
|
||
Try polyfilling it using "@formatjs/intl-pluralrules"
|
||
`,Z.MISSING_INTL_API,h);let a="bigint"==typeof k?Number(k):k,b=d.getPluralRules(c,{type:j.pluralType}).select(a-(j.offset||0));g=(Object.prototype.hasOwnProperty.call(j.options,b)?j.options[b]:void 0)||j.options.other}if(!g)throw new _(j.value,k,Object.keys(j.options),h);let l="bigint"==typeof k?Number(k):k;i.push(...a(g.value,c,d,e,f,l-(j.offset||0)));continue}}return i.length<2?i:i.reduce((a,b)=>{let c=a[a.length-1];return c&&c.type===ac.literal&&b.type===ac.literal?c.value+=b.value:a.push(b),a},[])})(this.ast,this.locales,this.formatters,this.formats,a,void 0,this.message);resolvedOptions=()=>({locale:this.resolvedLocale?.toString()||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]});getAst=()=>this.ast;static memoizedDefaultLocale=null;static get defaultLocale(){return ae.memoizedDefaultLocale||(ae.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),ae.memoizedDefaultLocale}static resolveLocale=a=>{if(void 0===Intl.Locale)return;let b=Intl.NumberFormat.supportedLocalesOf(a);return new Intl.Locale(b.length>0?b[0]:"string"==typeof a?a:a[0])};static __parse=Y;static 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"}}}}function af(...[a,b,c,d]){let e;if(Array.isArray(b))throw new j(k.INVALID_MESSAGE,void 0);if("object"==typeof b)throw new j(k.INSUFFICIENT_PATH,void 0);if("string"==typeof b){let a=c||/'[{}]/.test(b)?void 0:b;if(a)return a}let{cache:f,formats:g,formatters:i,globalFormats:l,locale:n,timeZone:o}=d;i.getMessageFormat||(i.getMessageFormat=m((...a)=>new ae(a[0],a[1],a[2],{formatters:i,...a[3]}),f.message));try{let a,c,d,f;e=i.getMessageFormat(b,n,(a=ae.formats.date,c=ae.formats.time,d={...l?.dateTime,...g?.dateTime},f={date:{...a,...d},time:{...c,...d},number:{...l?.number,...g?.number}},o&&["date","time"].forEach(a=>{let b=f[a];for(let[a,c]of Object.entries(b))b[a]={timeZone:o,...c}}),f),{formatters:{...i,getDateTimeFormat:(a,b)=>i.getDateTimeFormat(a,{...b,timeZone:b?.timeZone??o})}})}catch(a){throw new j(k.INVALID_MESSAGE,void 0)}let p=e.format(c);return(0,h.isValidElement)(p)||Array.isArray(p)||"string"==typeof p?p:String(p)}function ag(...a){return a.filter(Boolean).join(".")}function ah(a){return ag(a.namespace,a.key)}function ai(a){console.error(a)}function aj(a,b,c,d){let e=ag(d,c);if(!b)throw Error(e);let f=b;return c.split(".").forEach(b=>{let c=f[b];if(null==b||null==c)throw Error(e+` (${a})`);f=c}),f}af.raw=!0;let ak={second:1,seconds:1,minute:60,minutes:60,hour:3600,hours:3600,day:86400,days:86400,week:604800,weeks:604800,month:2628e3,months:2628e3,quarter:7884e3,quarters:7884e3,year:31536e3,years:31536e3};var al=a.i(526156);let am=(0,h.createContext)(void 0);function an({children:a,formats:b,getMessageFallback:c,locale:d,messages:e,now:f,onError:g,timeZone:i}){let j=(0,h.useContext)(am),k=(0,h.useMemo)(()=>j?.cache||l(),[d,j?.cache]),m=(0,h.useMemo)(()=>j?.formatters||o(k),[k,j?.formatters]),n=(0,h.useMemo)(()=>({...function({formats:a,getMessageFallback:b,messages:c,onError:d,...e}){return{...e,formats:a||void 0,messages:c||void 0,onError:d||ai,getMessageFallback:b||ah}}({locale:d,formats:void 0===b?j?.formats:b,getMessageFallback:c||j?.getMessageFallback,messages:void 0===e?j?.messages:e,now:f||j?.now,onError:g||j?.onError,timeZone:i||j?.timeZone}),formatters:m,cache:k}),[k,b,m,c,d,e,f,g,j,i]);return(0,al.jsx)(am.Provider,{value:n,children:a})}function ao(){let a=(0,h.useContext)(am);if(!a)throw Error(void 0);return a}let ap=!1;function aq(a){return function(a,b,c){let{cache:d,formats:e,formatters:f,getMessageFallback:g,locale:i,onError:l,timeZone:m}=ao(),n=a["!"],o="!"===b?void 0:b.slice(2);return m||ap||(ap=!0,l(new j(k.ENVIRONMENT_FALLBACK,void 0))),(0,h.useMemo)(()=>{var a;let b;return b=function(a,b,c){try{if(!b)throw Error(void 0);let d=c?aj(a,b,c):b;if(!d)throw Error(c);return d}catch(a){return new j(k.MISSING_MESSAGE,a.message)}}((a={cache:d,formatters:f,getMessageFallback:g,messages:n,namespace:o,onError:l,formats:e,locale:i,timeZone:m}).locale,a.messages,a.namespace),function({cache:a,formats:b,formatters:c,getMessageFallback:d=ah,locale:e,messagesOrError:f,namespace:g,onError:i,timeZone:l}){let m=f instanceof j;function n(a,b,c,e){let f=new j(b,c);return i(f),e??d({error:f,key:a,namespace:g})}function o(o,p,q,r){let s;if(m){if(!r)return i(f),d({error:f,key:o,namespace:g});s=r}else try{s=aj(e,f,o,g)}catch(a){if(!r)return n(o,k.MISSING_MESSAGE,a.message,r);s=r}try{let d,f=ag(g,o);return af(f,s,p?(d={},Object.keys(p).forEach(a=>{let b,c=0,e=p[a];b="function"==typeof e?b=>{let d=e(b);return(0,h.isValidElement)(d)?(0,h.cloneElement)(d,{key:a+c++}):d}:e,d[a]=b}),d):p,{cache:a,formatters:c,globalFormats:b,formats:q,locale:e,timeZone:l})}catch(c){let a,b;return c instanceof j?(a=c.code,b=c.originalMessage):(a=k.FORMATTING_ERROR,b=c.message),n(o,a,b,r)}}function p(a,b,c,d){let e=o(a,b,c,d);return"string"!=typeof e?n(a,k.INVALID_MESSAGE,void 0):e}return p.rich=o,p.markup=(a,b,c,d)=>o(a,b,c,d),p.raw=a=>{if(m)return i(f),d({error:f,key:a,namespace:g});try{return aj(e,f,a,g)}catch(b){return n(a,k.MISSING_MESSAGE,b.message)}},p.has=a=>{if(m)return!1;try{return aj(e,f,a,g),!0}catch{return!1}},p}({...a,messagesOrError:b})},[d,f,g,n,o,l,e,i,m])}({"!":ao().messages},a?`!.${a}`:"!",0)}function ar(){let{formats:a,formatters:b,locale:c,now:d,onError:e,timeZone:f}=ao();return(0,h.useMemo)(()=>(function(a){let{_cache:b=l(),_formatters:c=o(b),formats:d,locale:e,onError:f=ai,timeZone:g}=a;function h(a){return a?.timeZone||(g?a={...a,timeZone:g}:f(new j(k.ENVIRONMENT_FALLBACK,void 0))),a}function i(a,b,c,d,e){let g;try{g=function(a,b,c){let d;if("string"==typeof b){if(!(d=a?.[b])){let a=new j(k.MISSING_FORMAT,void 0);throw f(a),a}}else d=b;return c&&(d={...d,...c}),d}(c,a,b)}catch{return e()}try{return d(g)}catch(a){return f(new j(k.FORMATTING_ERROR,a.message)),e()}}function m(a,b,f){return i(b,f,d?.dateTime,b=>(b=h(b),c.getDateTimeFormat(e,b).format(a)),()=>String(a))}function n(){return a.now?a.now:(f(new j(k.ENVIRONMENT_FALLBACK,void 0)),new Date)}return{dateTime:m,number:function(a,b,f){return i(b,f,d?.number,b=>c.getNumberFormat(e,b).format(a),()=>String(a))},relativeTime:function(a,b){try{var d;let f,g,h,i={};b instanceof Date||"number"==typeof b?f=new Date(b):b&&(f=null!=b.now?new Date(b.now):n(),g=b.unit,i.style=b.style,i.numberingSystem=b.numberingSystem),f||(f=n());let j=(new Date(a).getTime()-f.getTime())/1e3;g||(g=(h=Math.abs(j))<60?"second":h<3600?"minute":h<86400?"hour":h<604800?"day":h<2628e3?"week":h<31536e3?"month":"year"),i.numeric="second"===g?"auto":"always";let k=(d=g,Math.round(j/ak[d]));return c.getRelativeTimeFormat(e,i).format(k,g)}catch(b){return f(new j(k.FORMATTING_ERROR,b.message)),String(a)}},list:function(a,b,f){let g=[],h=new Map,j=0;for(let b of a){let a;"object"==typeof b?(a=String(j),h.set(a,b)):a=String(b),g.push(a),j++}return i(b,f,d?.list,a=>{let b=c.getListFormat(e,a).formatToParts(g).map(a=>"literal"===a.type?a.value:h.get(a.value)||a.value);return h.size>0?b:b.join("")},()=>String(a))},dateTimeRange:function(a,b,f,g){return i(f,g,d?.dateTime,d=>(d=h(d),c.getDateTimeFormat(e,d).formatRange(a,b)),()=>[m(a),m(b)].join(" – "))}}})({formats:a,locale:c,now:d,onError:e,timeZone:f,_formatters:b}),[a,b,d,c,e,f])}a.s(["IntlProvider",()=>an,"useFormatter",()=>ar,"useTranslations",()=>aq],268200)},603836,a=>{"use strict";var b=a.i(268200);function c(a,b){return(...a)=>{try{return b(...a)}catch{throw Error(void 0)}}}let d=c(0,b.useTranslations);c(0,b.useFormatter),a.s(["useTranslations",()=>d])}];
|
||
|
||
//# debugId=14df3d45-4ecf-241a-335b-80fb16bbbe6b
|
||
//# sourceMappingURL=node_modules__pnpm_d28cabd9._.js.map
|