@stihl-design-system/components 1.0.0-RC.47 → 1.0.0-RC.48

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.
Files changed (261) hide show
  1. package/{accordion.BQ7vavIt.js → accordion.D4XR2R7e.js} +2 -2
  2. package/{actionbutton.C7lqEmBx.js → actionbutton.C8hePX-D.js} +3 -3
  3. package/{actioncard.dgVHW0BC.js → actioncard.kDxu01xm.js} +1 -1
  4. package/{actionlink.CL6v1mQA.js → actionlink.dccc5JQV.js} +3 -3
  5. package/{arialiveregions.DC1Gq9Lo.js → arialiveregions.BniSDuPM.js} +9 -10
  6. package/assets/Accordion.RlqWqpGo.css +1 -0
  7. package/assets/ActionButton.Dw2FeIaW.css +1 -0
  8. package/assets/ActionCard.viEoC26n.css +1 -0
  9. package/assets/ActionLink.B1Jjaf7k.css +1 -0
  10. package/assets/Button.Bi1KUKMv.css +1 -0
  11. package/assets/Checkbox.C6RWhy0V.css +1 -0
  12. package/assets/Chip.DfamkUPw.css +1 -0
  13. package/assets/CustomReactSelect.CvWMmrAU.css +1 -0
  14. package/assets/Dialog.6AkQo8ew.css +1 -0
  15. package/assets/Drawer.CDOlX809.css +1 -0
  16. package/assets/Fieldset.BbLGXCWa.css +1 -0
  17. package/assets/InputFile.CDtghZtl.css +1 -0
  18. package/assets/InputNumber.BNpO9p7n.css +1 -0
  19. package/assets/InputPassword.BgZo-RUc.css +1 -0
  20. package/assets/InputSearch.BROFFTK9.css +1 -0
  21. package/assets/LinkButton.IKIlFnpH.css +1 -0
  22. package/assets/Notification.2B81JHOp.css +1 -0
  23. package/assets/Pagination.DH71DZ0j.css +1 -0
  24. package/assets/Popover.58Tb0dOt.css +1 -0
  25. package/assets/Select.CfTN3CJo.css +1 -0
  26. package/assets/Slider.B4kzL60S.css +1 -0
  27. package/assets/{SystemFeedback.DYi9QetY.css → SystemFeedback.DVMml_h9.css} +1 -1
  28. package/assets/TextUtility.BThulfyl.css +1 -0
  29. package/assets/Textarea.BO4AcRJD.css +1 -0
  30. package/assets/buttonround.syTU1QSI.css +1 -0
  31. package/assets/chipgroup.DtCnsmS7.css +1 -0
  32. package/assets/filelist.B-Ru0GP_.css +1 -0
  33. package/assets/input.Dy8VS73e.css +1 -0
  34. package/assets/numberindicator.CtbitPQ8.css +1 -0
  35. package/assets/progressindicator.tyY_RVQ9.css +1 -0
  36. package/assets/radio.9hUUyg8R.css +1 -0
  37. package/assets/switch.8v7Wp1Fj.css +1 -0
  38. package/assets/tabpane.DDaeSDQb.css +1 -0
  39. package/assets/text.BwGsYzGM.css +1 -0
  40. package/assets/tooltip.C_BL2kou.css +1 -0
  41. package/{banner.BlB_7xue.js → banner.DO7GsDL_.js} +1 -1
  42. package/{breadcrumb.DajORKq7.js → breadcrumb.DYov6vtt.js} +3 -3
  43. package/{button.EooIlFBI.js → button.qxcuzbnv.js} +2 -2
  44. package/buttonround.BO7_ewzA.js +101 -0
  45. package/{checkbox.NJj9qMnx.js → checkbox.C9kyIY9P.js} +4 -5
  46. package/{checkboxgroup.DELdyn0X.js → checkboxgroup.kEUxnKLf.js} +2 -2
  47. package/{chip.C4h8Hm9g.js → chip.5ktNLRYf.js} +3 -3
  48. package/chipgroup.kRU3Z98U.js +226 -0
  49. package/chunks/Accordion.gih2ni1d.js +179 -0
  50. package/chunks/ActionButton.B-wm5sUy.js +194 -0
  51. package/chunks/{ActionCard.Dbq2VqyZ.js → ActionCard.Bm-2ewfS.js} +44 -44
  52. package/chunks/ActionLink.D0KzqbH4.js +166 -0
  53. package/chunks/{AriaLiveRegions.utils.BPvIKT6B.js → AriaLiveRegions.utils.xoETe2Ps.js} +14 -16
  54. package/chunks/{Breadcrumb.Ccm79ver.js → Breadcrumb.I2G-T0zc.js} +2 -2
  55. package/chunks/Button.CCol--xy.js +165 -0
  56. package/chunks/Checkbox.BxOGR1bR.js +96 -0
  57. package/chunks/CheckboxGroup.TneO0tuE.js +85 -0
  58. package/chunks/Chip.DffaXMkV.js +148 -0
  59. package/chunks/{CustomReactSelect.oEQpO9iN.js → CustomReactSelect.DTAavYaz.js} +282 -277
  60. package/chunks/Dialog.guuxflWL.js +101 -0
  61. package/chunks/{Drawer.CDe_g99S.js → Drawer.CjUZu6GW.js} +27 -28
  62. package/chunks/Fieldset.BBMuLKps.js +94 -0
  63. package/chunks/{Flag.X9tB3Mfv.js → Flag.CbQYBzVC.js} +12 -13
  64. package/chunks/{Header.bLSdAY9-.js → Header.CvcGSuhX.js} +1 -1
  65. package/chunks/{Input.utils.CkmzxIrU.js → Input.utils.Wycy2SzG.js} +23 -25
  66. package/chunks/InputFile.y71Cd5J9.js +260 -0
  67. package/chunks/InputNumber.Fn2YbF_s.js +250 -0
  68. package/chunks/InputPassword.DtT9yrlx.js +129 -0
  69. package/chunks/InputSearch.BoAfGqoH.js +157 -0
  70. package/chunks/LinkButton.BxG7fx1O.js +150 -0
  71. package/chunks/LinkCard.DM-5WrSt.js +200 -0
  72. package/chunks/{MegaMenu.DbunD_yW.js → MegaMenu.udXR1H3W.js} +1 -1
  73. package/chunks/{NavigationTabList.CyrKNAer.js → NavigationTabList.thzA1pU8.js} +1 -1
  74. package/chunks/{NavigationTabs.DVBe-Wt3.js → NavigationTabs.BWewgBch.js} +1 -1
  75. package/chunks/Notification.C_o7Ge6Q.js +91 -0
  76. package/chunks/Pagination.BrOMUJMi.js +272 -0
  77. package/chunks/Popover.CxZZ_y1Z.js +230 -0
  78. package/chunks/RadioGroup.CO91_5hA.js +136 -0
  79. package/chunks/Select.EzoMdk1u.js +157 -0
  80. package/chunks/Slider.CX38t4Sk.js +330 -0
  81. package/chunks/{Stepper.KBRikedB.js → Stepper.Ds_aIEF8.js} +68 -69
  82. package/chunks/SystemFeedback.DhWcYjnu.js +43 -0
  83. package/chunks/{Tabs.xXn4zpGp.js → Tabs.BHVlgp7L.js} +2 -2
  84. package/chunks/Text.utils.DzlY9pJS.js +9 -0
  85. package/chunks/TextUtility.BZLwqyic.js +82 -0
  86. package/chunks/Textarea.vuJgvW6_.js +192 -0
  87. package/chunks/{Toast.NZfb7z3q.js → Toast.V_ZUAsf2.js} +1 -1
  88. package/chunks/translate.DSb-TdWR.js +2460 -0
  89. package/{combobox.CPsl2TC0.js → combobox.C6cPz4AJ.js} +1 -1
  90. package/components/Accordion/Accordion.d.ts +5 -0
  91. package/components/ActionButton/ActionButton.d.ts +5 -1
  92. package/components/ActionLink/ActionLink.d.ts +1 -1
  93. package/components/Button/Button.utils.d.ts +1 -1
  94. package/components/Checkbox/Checkbox.d.ts +8 -1
  95. package/components/CheckboxGroup/CheckboxGroup.d.ts +9 -1
  96. package/components/ChipGroup/Chip.d.ts +2 -0
  97. package/components/ChipGroup/ChipGroup.d.ts +12 -2
  98. package/components/ChipGroup/ChipGroup.utils.d.ts +39 -15
  99. package/components/Combobox/Combobox.utils.d.ts +66 -9
  100. package/components/Combobox/CustomReactSelect/CustomReactSelect.d.ts +5 -1
  101. package/components/Combobox/CustomReactSelect/CustomReactSelect.utils.d.ts +1 -1
  102. package/components/Fieldset/Fieldset.d.ts +9 -2
  103. package/components/Input/Input.d.ts +8 -1
  104. package/components/InputFile/FileList/FileList.d.ts +4 -2
  105. package/components/InputFile/FileList/FilePreview/FilePreview.d.ts +8 -2
  106. package/components/InputFile/FileList/ProgressIndicator/ProgressIndicator.d.ts +8 -2
  107. package/components/InputFile/InputFile.d.ts +12 -2
  108. package/components/InputFile/InputFile.utils.d.ts +41 -23
  109. package/components/InputNumber/InputNumber.d.ts +8 -1
  110. package/components/InputPassword/InputPassword.d.ts +8 -1
  111. package/components/InputSearch/InputSearch.d.ts +8 -1
  112. package/components/LinkCard/LinkCard.d.ts +10 -4
  113. package/components/LinkCard/LinkCard.utils.d.ts +2 -2
  114. package/components/NumberIndicator/NumberIndicator.d.ts +6 -1
  115. package/components/Pagination/Pagination.d.ts +10 -3
  116. package/components/Pagination/Pagination.utils.d.ts +22 -9
  117. package/components/Popover/Popover.d.ts +9 -1
  118. package/components/Popover/Popover.utils.d.ts +3 -2
  119. package/components/Radio/Radio.d.ts +5 -0
  120. package/components/RadioGroup/RadioGroup.d.ts +8 -0
  121. package/components/Select/Select.d.ts +8 -1
  122. package/components/Slider/Slider.d.ts +8 -1
  123. package/components/Stepper/Step.d.ts +1 -1
  124. package/components/Stepper/Step.utils.d.ts +1 -1
  125. package/components/Stepper/Stepper.d.ts +4 -1
  126. package/components/Stepper/Stepper.utils.d.ts +9 -4
  127. package/components/SystemFeedback/SystemFeedback.d.ts +9 -1
  128. package/components/Textarea/Textarea.d.ts +8 -1
  129. package/{customreactselect.D7BJg-2s.js → customreactselect.L0zSh3Tg.js} +4 -4
  130. package/{dialog.BlprGigG.js → dialog.Ddq8o8Od.js} +2 -2
  131. package/{drawer.BoyrTFi1.js → drawer.rbbjQvqL.js} +2 -2
  132. package/{fieldset.D_e2-vo_.js → fieldset.BHf3XK2q.js} +3 -3
  133. package/filelist.GrEwoM1u.js +143 -0
  134. package/filepreview.B2Ot9SZ7.js +97 -0
  135. package/{flag.0vpitrQ-.js → flag.fX6LAgty.js} +3 -4
  136. package/{floatingactionbutton.BrdE1vi2.js → floatingactionbutton.BwCiybnc.js} +1 -1
  137. package/{header.C3AqYBtz.js → header.BCeCjYfG.js} +1 -1
  138. package/index.es.js +203 -204
  139. package/input.Dh0ws-9j.js +187 -0
  140. package/inputfile.DiZh3GcT.js +17 -0
  141. package/{inputnumber.Box5R2An.js → inputnumber.D2cmptaH.js} +8 -9
  142. package/{inputpassword.CBc8GNwI.js → inputpassword.C53Kg4EA.js} +4 -4
  143. package/inputsearch.BrsIDUSW.js +14 -0
  144. package/link.DEZDbUgq.js +81 -0
  145. package/{linkbutton.DxEPueLb.js → linkbutton._X50W2Md.js} +3 -3
  146. package/{linkcard.CCY-VFWN.js → linkcard.BtM3KnjT.js} +3 -3
  147. package/{logo.D7LnRA1E.js → logo.D6BTxbxv.js} +0 -1
  148. package/{megamenu.C8OynEzk.js → megamenu.odVCUm4c.js} +2 -2
  149. package/{navigationtablist.iSQd5PX4.js → navigationtablist.n9DrtYe5.js} +2 -2
  150. package/{navigationtabs.FtkVv_qV.js → navigationtabs.D0mSyAtK.js} +2 -2
  151. package/{notification.Cqg8HpJ8.js → notification._X8-8vOa.js} +2 -2
  152. package/numberindicator.DsK65Bj3.js +39 -0
  153. package/package.json +6 -1
  154. package/pagination.B7Hrx_sk.js +14 -0
  155. package/partials/index.js +68 -68
  156. package/{popover.DYiEGSnj.js → popover.BBaqL7y9.js} +3 -3
  157. package/progressindicator.D9CfVD95.js +74 -0
  158. package/radio.DjToa2aV.js +148 -0
  159. package/{radiogroup.wqgExwrG.js → radiogroup.mc-8lw65.js} +3 -3
  160. package/{scroller.Dqnsxq2M.js → scroller.CgWp2WXG.js} +10 -11
  161. package/{select.DkKuGI6O.js → select.DTZ6a6Ag.js} +5 -6
  162. package/{skeleton.DUkBgXxO.js → skeleton.CNJdNVav.js} +10 -10
  163. package/{skiptocontent.CRQywi6J.js → skiptocontent.BsRpWvyu.js} +4 -4
  164. package/{slider.BOjqQp9n.js → slider.BMGAihY0.js} +3 -3
  165. package/{step.C6zDRCBu.js → step.DCQ6CawJ.js} +1 -1
  166. package/stepper.D7-7BdSv.js +15 -0
  167. package/styles/scss/ds/index.scss +2 -0
  168. package/styles/scss/ds/lib/border-width.scss +3 -0
  169. package/styles/scss/ds/lib/ds-internal/_input.scss +65 -21
  170. package/styles/scss/ds/lib/ds-internal/_link-button.scss +4 -2
  171. package/styles/scss/ds/lib/ds-internal/_link.scss +23 -3
  172. package/styles/scss/ds/lib/input.scss +12 -7
  173. package/styles/scss/ds/lib/link.scss +2 -2
  174. package/styles/scss/ds/lib/radius.scss +5 -0
  175. package/{switch.CuNNdrkD.js → switch.tM2XBag8.js} +2 -2
  176. package/{systemfeedback.Da0wX0Eb.js → systemfeedback.BPPOht_9.js} +1 -1
  177. package/{tablist.BjKwrLz9.js → tablist.BAm0_UIG.js} +22 -23
  178. package/{tabpane.7vMXUKFX.js → tabpane.B9rZghU6.js} +1 -1
  179. package/{tabs.-U2k6Oll.js → tabs.BgTdWbTe.js} +3 -3
  180. package/text.BEO_ZfJq.js +72 -0
  181. package/{textarea.BWznY6Gg.js → textarea.Cki-uMkZ.js} +5 -6
  182. package/{textutility.CBLuAdaa.js → textutility.BypzssPt.js} +2 -2
  183. package/{toast.D9XLSgJg.js → toast.s0Hfuh5i.js} +2 -2
  184. package/{toastmanager.V5E05qgI.js → toastmanager.CPIPn4Io.js} +19 -20
  185. package/{tooltip.a1aWHK00.js → tooltip.BFQG-7VR.js} +1 -1
  186. package/{topbar.BdGK62KJ.js → topbar.Bbct-XkB.js} +3 -3
  187. package/utils/translate.d.ts +22 -6
  188. package/assets/Accordion.DPu2l_Kg.css +0 -1
  189. package/assets/ActionButton.DcQYatF1.css +0 -1
  190. package/assets/ActionCard.gRQVVFWz.css +0 -1
  191. package/assets/ActionLink.B62Aa8y9.css +0 -1
  192. package/assets/Button.BI6zz6Fw.css +0 -1
  193. package/assets/Checkbox.DknHnS9a.css +0 -1
  194. package/assets/Chip.CYhVB1Jh.css +0 -1
  195. package/assets/CustomReactSelect.lKMLwL7n.css +0 -1
  196. package/assets/Dialog.BKwWy1g2.css +0 -1
  197. package/assets/Drawer.IRb7Vc1n.css +0 -1
  198. package/assets/Fieldset.C4Fx4-UV.css +0 -1
  199. package/assets/InputFile.ne7gwc_5.css +0 -1
  200. package/assets/InputNumber.BIdsQuFc.css +0 -1
  201. package/assets/InputPassword.YSKTDTA1.css +0 -1
  202. package/assets/InputSearch.C3qtDQcj.css +0 -1
  203. package/assets/LinkButton.CmEE7Od_.css +0 -1
  204. package/assets/Notification.BO0Mu9No.css +0 -1
  205. package/assets/Pagination.OLmfdASf.css +0 -1
  206. package/assets/Popover.mL5g23EK.css +0 -1
  207. package/assets/Select.CDP-1_K9.css +0 -1
  208. package/assets/Slider.Cu7MgNph.css +0 -1
  209. package/assets/TextUtility.bwkCWEiV.css +0 -1
  210. package/assets/Textarea.Hsq68tg1.css +0 -1
  211. package/assets/buttonround.rmUb58WF.css +0 -1
  212. package/assets/chipgroup.BGxjdSDX.css +0 -1
  213. package/assets/filelist.cP3O1JeJ.css +0 -1
  214. package/assets/input.BEBgyvkK.css +0 -1
  215. package/assets/numberindicator.DSpNPJcs.css +0 -1
  216. package/assets/progressindicator.Dxrigyne.css +0 -1
  217. package/assets/radio.DsHt-9om.css +0 -1
  218. package/assets/switch.fwcMI6o7.css +0 -1
  219. package/assets/tabpane.o34hshTz.css +0 -1
  220. package/assets/text.Doa-APfR.css +0 -1
  221. package/assets/tooltip.DrSplliO.css +0 -1
  222. package/buttonround.BeQakrPs.js +0 -101
  223. package/chipgroup.BKjeuuM0.js +0 -213
  224. package/chunks/Accordion.8kTbiPxs.js +0 -173
  225. package/chunks/ActionButton.CBV1-_HP.js +0 -188
  226. package/chunks/ActionLink.BXxDS1Gg.js +0 -161
  227. package/chunks/Button.COycNYUI.js +0 -160
  228. package/chunks/Checkbox.CMshaWIU.js +0 -88
  229. package/chunks/CheckboxGroup.D3D1spfJ.js +0 -79
  230. package/chunks/Chip.DCJYE513.js +0 -157
  231. package/chunks/Dialog.lJXxzgu2.js +0 -102
  232. package/chunks/Fieldset.DOjI3DlI.js +0 -91
  233. package/chunks/InputFile.DYXvF6vT.js +0 -260
  234. package/chunks/InputNumber.CkWpchPo.js +0 -240
  235. package/chunks/InputPassword.21E6XMr5.js +0 -121
  236. package/chunks/InputSearch.Dy3EKa9f.js +0 -149
  237. package/chunks/LinkButton.BCHTLFMJ.js +0 -150
  238. package/chunks/LinkCard.BYmTwsS5.js +0 -197
  239. package/chunks/Notification.BjyLiO2h.js +0 -91
  240. package/chunks/Pagination.CJikF9Cw.js +0 -247
  241. package/chunks/Popover.ByaoNwGK.js +0 -221
  242. package/chunks/RadioGroup.Bh2X6pT9.js +0 -130
  243. package/chunks/Select.KWb09VmF.js +0 -147
  244. package/chunks/Slider.CxnIy51F.js +0 -309
  245. package/chunks/SystemFeedback.4osheYxC.js +0 -38
  246. package/chunks/Text.utils.BZ4nTZVu.js +0 -11
  247. package/chunks/TextUtility.BPrxUX-x.js +0 -82
  248. package/chunks/Textarea.CAOqZMUi.js +0 -181
  249. package/chunks/translate.nuU7uChI.js +0 -8
  250. package/filelist.DfAt2xJa.js +0 -128
  251. package/filepreview.Defs34bv.js +0 -94
  252. package/input.ChMzyHej.js +0 -175
  253. package/inputfile.DZIUs1EC.js +0 -18
  254. package/inputsearch.DzzYb-C0.js +0 -15
  255. package/link.aU1f2Xzu.js +0 -81
  256. package/numberindicator.Q7g4J3Ry.js +0 -36
  257. package/pagination.DA4PMLOq.js +0 -14
  258. package/progressindicator.DpmERE8T.js +0 -53
  259. package/radio.KQ8CUM3_.js +0 -137
  260. package/stepper.DHl3_XU9.js +0 -16
  261. package/text.CnP3baHy.js +0 -72
@@ -0,0 +1,2460 @@
1
+ "use client";
2
+ function d(e, t) {
3
+ const i = t && t.cache ? t.cache : re, n = t && t.serializer ? t.serializer : ne;
4
+ return (t && t.strategy ? t.strategy : te)(e, {
5
+ cache: i,
6
+ serializer: n
7
+ });
8
+ }
9
+ function K(e) {
10
+ return e == null || typeof e == "number" || typeof e == "boolean";
11
+ }
12
+ function ee(e, t, i, n) {
13
+ const r = K(n) ? n : i(n);
14
+ let s = t.get(r);
15
+ return typeof s > "u" && (s = e.call(this, n), t.set(r, s)), s;
16
+ }
17
+ function k(e, t, i) {
18
+ const n = Array.prototype.slice.call(arguments, 3), r = i(n);
19
+ let s = t.get(r);
20
+ return typeof s > "u" && (s = e.apply(this, n), t.set(r, s)), s;
21
+ }
22
+ function V(e, t, i, n, r) {
23
+ return i.bind(t, e, n, r);
24
+ }
25
+ function te(e, t) {
26
+ const i = e.length === 1 ? ee : k;
27
+ return V(e, this, i, t.cache.create(), t.serializer);
28
+ }
29
+ function ie(e, t) {
30
+ return V(e, this, k, t.cache.create(), t.serializer);
31
+ }
32
+ const ne = function() {
33
+ return JSON.stringify(arguments);
34
+ };
35
+ var se = class {
36
+ constructor() {
37
+ this.cache = /* @__PURE__ */ Object.create(null);
38
+ }
39
+ get(e) {
40
+ return this.cache[e];
41
+ }
42
+ set(e, t) {
43
+ this.cache[e] = t;
44
+ }
45
+ };
46
+ const re = { create: function() {
47
+ return new se();
48
+ } }, N = {
49
+ variadic: ie
50
+ }, he = /(?:[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;
51
+ function oe(e) {
52
+ const t = {};
53
+ return e.replace(he, (i) => {
54
+ const n = i.length;
55
+ switch (i[0]) {
56
+ case "G":
57
+ t.era = n === 4 ? "long" : n === 5 ? "narrow" : "short";
58
+ break;
59
+ case "y":
60
+ t.year = n === 2 ? "2-digit" : "numeric";
61
+ break;
62
+ case "Y":
63
+ case "u":
64
+ case "U":
65
+ case "r":
66
+ throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
67
+ case "q":
68
+ case "Q":
69
+ throw new RangeError("`q/Q` (quarter) patterns are not supported");
70
+ case "M":
71
+ case "L":
72
+ t.month = [
73
+ "numeric",
74
+ "2-digit",
75
+ "short",
76
+ "long",
77
+ "narrow"
78
+ ][n - 1];
79
+ break;
80
+ case "w":
81
+ case "W":
82
+ throw new RangeError("`w/W` (week) patterns are not supported");
83
+ case "d":
84
+ t.day = ["numeric", "2-digit"][n - 1];
85
+ break;
86
+ case "D":
87
+ case "F":
88
+ case "g":
89
+ throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
90
+ case "E":
91
+ t.weekday = n === 4 ? "long" : n === 5 ? "narrow" : "short";
92
+ break;
93
+ case "e":
94
+ if (n < 4) throw new RangeError("`e..eee` (weekday) patterns are not supported");
95
+ t.weekday = [
96
+ "short",
97
+ "long",
98
+ "narrow",
99
+ "short"
100
+ ][n - 4];
101
+ break;
102
+ case "c":
103
+ if (n < 4) throw new RangeError("`c..ccc` (weekday) patterns are not supported");
104
+ t.weekday = [
105
+ "short",
106
+ "long",
107
+ "narrow",
108
+ "short"
109
+ ][n - 4];
110
+ break;
111
+ case "a":
112
+ t.hour12 = !0;
113
+ break;
114
+ case "b":
115
+ case "B":
116
+ throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
117
+ case "h":
118
+ t.hourCycle = "h12", t.hour = ["numeric", "2-digit"][n - 1];
119
+ break;
120
+ case "H":
121
+ t.hourCycle = "h23", t.hour = ["numeric", "2-digit"][n - 1];
122
+ break;
123
+ case "K":
124
+ t.hourCycle = "h11", t.hour = ["numeric", "2-digit"][n - 1];
125
+ break;
126
+ case "k":
127
+ t.hourCycle = "h24", t.hour = ["numeric", "2-digit"][n - 1];
128
+ break;
129
+ case "j":
130
+ case "J":
131
+ case "C":
132
+ throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
133
+ case "m":
134
+ t.minute = ["numeric", "2-digit"][n - 1];
135
+ break;
136
+ case "s":
137
+ t.second = ["numeric", "2-digit"][n - 1];
138
+ break;
139
+ case "S":
140
+ case "A":
141
+ throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
142
+ case "z":
143
+ t.timeZoneName = n < 4 ? "short" : "long";
144
+ break;
145
+ case "Z":
146
+ case "O":
147
+ case "v":
148
+ case "V":
149
+ case "X":
150
+ case "x":
151
+ throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
152
+ }
153
+ return "";
154
+ }), t;
155
+ }
156
+ const ae = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
157
+ function ue(e) {
158
+ if (e.length === 0) throw new Error("Number skeleton cannot be empty");
159
+ const t = e.split(ae).filter((n) => n.length > 0), i = [];
160
+ for (const n of t) {
161
+ let r = n.split("/");
162
+ if (r.length === 0) throw new Error("Invalid number skeleton");
163
+ const [s, ...c] = r;
164
+ for (const o of c) if (o.length === 0) throw new Error("Invalid number skeleton");
165
+ i.push({
166
+ stem: s,
167
+ options: c
168
+ });
169
+ }
170
+ return i;
171
+ }
172
+ function ce(e) {
173
+ return e.replace(/^(.*?)-/, "");
174
+ }
175
+ const M = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, X = /^(@+)?(\+|#+)?[rs]?$/g, le = /(\*)(0+)|(#+)(0+)|(0+)/g, x = /^(0+)$/;
176
+ function O(e) {
177
+ const t = {};
178
+ return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(X, function(i, n, r) {
179
+ return typeof r != "string" ? (t.minimumSignificantDigits = n.length, t.maximumSignificantDigits = n.length) : r === "+" ? t.minimumSignificantDigits = n.length : n[0] === "#" ? t.maximumSignificantDigits = n.length : (t.minimumSignificantDigits = n.length, t.maximumSignificantDigits = n.length + (typeof r == "string" ? r.length : 0)), "";
180
+ }), t;
181
+ }
182
+ function W(e) {
183
+ switch (e) {
184
+ case "sign-auto":
185
+ return { signDisplay: "auto" };
186
+ case "sign-accounting":
187
+ case "()":
188
+ return { currencySign: "accounting" };
189
+ case "sign-always":
190
+ case "+!":
191
+ return { signDisplay: "always" };
192
+ case "sign-accounting-always":
193
+ case "()!":
194
+ return {
195
+ signDisplay: "always",
196
+ currencySign: "accounting"
197
+ };
198
+ case "sign-except-zero":
199
+ case "+?":
200
+ return { signDisplay: "exceptZero" };
201
+ case "sign-accounting-except-zero":
202
+ case "()?":
203
+ return {
204
+ signDisplay: "exceptZero",
205
+ currencySign: "accounting"
206
+ };
207
+ case "sign-never":
208
+ case "+_":
209
+ return { signDisplay: "never" };
210
+ }
211
+ }
212
+ function fe(e) {
213
+ let t;
214
+ if (e[0] === "E" && e[1] === "E" ? (t = { notation: "engineering" }, e = e.slice(2)) : e[0] === "E" && (t = { notation: "scientific" }, e = e.slice(1)), t) {
215
+ const i = e.slice(0, 2);
216
+ if (i === "+!" ? (t.signDisplay = "always", e = e.slice(2)) : i === "+?" && (t.signDisplay = "exceptZero", e = e.slice(2)), !x.test(e)) throw new Error("Malformed concise eng/scientific notation");
217
+ t.minimumIntegerDigits = e.length;
218
+ }
219
+ return t;
220
+ }
221
+ function G(e) {
222
+ const t = {}, i = W(e);
223
+ return i || t;
224
+ }
225
+ function pe(e) {
226
+ let t = {};
227
+ for (const i of e) {
228
+ switch (i.stem) {
229
+ case "percent":
230
+ case "%":
231
+ t.style = "percent";
232
+ continue;
233
+ case "%x100":
234
+ t.style = "percent", t.scale = 100;
235
+ continue;
236
+ case "currency":
237
+ t.style = "currency", t.currency = i.options[0];
238
+ continue;
239
+ case "group-off":
240
+ case ",_":
241
+ t.useGrouping = !1;
242
+ continue;
243
+ case "precision-integer":
244
+ case ".":
245
+ t.maximumFractionDigits = 0;
246
+ continue;
247
+ case "measure-unit":
248
+ case "unit":
249
+ t.style = "unit", t.unit = ce(i.options[0]);
250
+ continue;
251
+ case "compact-short":
252
+ case "K":
253
+ t.notation = "compact", t.compactDisplay = "short";
254
+ continue;
255
+ case "compact-long":
256
+ case "KK":
257
+ t.notation = "compact", t.compactDisplay = "long";
258
+ continue;
259
+ case "scientific":
260
+ t = {
261
+ ...t,
262
+ notation: "scientific",
263
+ ...i.options.reduce((s, c) => ({
264
+ ...s,
265
+ ...G(c)
266
+ }), {})
267
+ };
268
+ continue;
269
+ case "engineering":
270
+ t = {
271
+ ...t,
272
+ notation: "engineering",
273
+ ...i.options.reduce((s, c) => ({
274
+ ...s,
275
+ ...G(c)
276
+ }), {})
277
+ };
278
+ continue;
279
+ case "notation-simple":
280
+ t.notation = "standard";
281
+ continue;
282
+ case "unit-width-narrow":
283
+ t.currencyDisplay = "narrowSymbol", t.unitDisplay = "narrow";
284
+ continue;
285
+ case "unit-width-short":
286
+ t.currencyDisplay = "code", t.unitDisplay = "short";
287
+ continue;
288
+ case "unit-width-full-name":
289
+ t.currencyDisplay = "name", t.unitDisplay = "long";
290
+ continue;
291
+ case "unit-width-iso-code":
292
+ t.currencyDisplay = "symbol";
293
+ continue;
294
+ case "scale":
295
+ t.scale = parseFloat(i.options[0]);
296
+ continue;
297
+ case "rounding-mode-floor":
298
+ t.roundingMode = "floor";
299
+ continue;
300
+ case "rounding-mode-ceiling":
301
+ t.roundingMode = "ceil";
302
+ continue;
303
+ case "rounding-mode-down":
304
+ t.roundingMode = "trunc";
305
+ continue;
306
+ case "rounding-mode-up":
307
+ t.roundingMode = "expand";
308
+ continue;
309
+ case "rounding-mode-half-even":
310
+ t.roundingMode = "halfEven";
311
+ continue;
312
+ case "rounding-mode-half-down":
313
+ t.roundingMode = "halfTrunc";
314
+ continue;
315
+ case "rounding-mode-half-up":
316
+ t.roundingMode = "halfExpand";
317
+ continue;
318
+ case "integer-width":
319
+ if (i.options.length > 1) throw new RangeError("integer-width stems only accept a single optional option");
320
+ i.options[0].replace(le, function(s, c, o, h, p, a) {
321
+ if (c) t.minimumIntegerDigits = o.length;
322
+ else {
323
+ if (h && p) throw new Error("We currently do not support maximum integer digits");
324
+ if (a) throw new Error("We currently do not support exact integer digits");
325
+ }
326
+ return "";
327
+ });
328
+ continue;
329
+ }
330
+ if (x.test(i.stem)) {
331
+ t.minimumIntegerDigits = i.stem.length;
332
+ continue;
333
+ }
334
+ if (M.test(i.stem)) {
335
+ if (i.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option");
336
+ i.stem.replace(M, function(c, o, h, p, a, u) {
337
+ return h === "*" ? t.minimumFractionDigits = o.length : p && p[0] === "#" ? t.maximumFractionDigits = p.length : a && u ? (t.minimumFractionDigits = a.length, t.maximumFractionDigits = a.length + u.length) : (t.minimumFractionDigits = o.length, t.maximumFractionDigits = o.length), "";
338
+ });
339
+ const s = i.options[0];
340
+ s === "w" ? t = {
341
+ ...t,
342
+ trailingZeroDisplay: "stripIfInteger"
343
+ } : s && (t = {
344
+ ...t,
345
+ ...O(s)
346
+ });
347
+ continue;
348
+ }
349
+ if (X.test(i.stem)) {
350
+ t = {
351
+ ...t,
352
+ ...O(i.stem)
353
+ };
354
+ continue;
355
+ }
356
+ const n = W(i.stem);
357
+ n && (t = {
358
+ ...t,
359
+ ...n
360
+ });
361
+ const r = fe(i.stem);
362
+ r && (t = {
363
+ ...t,
364
+ ...r
365
+ });
366
+ }
367
+ return t;
368
+ }
369
+ let f = /* @__PURE__ */ (function(e) {
370
+ return 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;
371
+ })({}), E = /* @__PURE__ */ (function(e) {
372
+ return e[e.literal = 0] = "literal", e[e.argument = 1] = "argument", e[e.number = 2] = "number", e[e.date = 3] = "date", e[e.time = 4] = "time", e[e.select = 5] = "select", e[e.plural = 6] = "plural", e[e.pound = 7] = "pound", e[e.tag = 8] = "tag", e;
373
+ })({}), A = /* @__PURE__ */ (function(e) {
374
+ return e[e.number = 0] = "number", e[e.dateTime = 1] = "dateTime", e;
375
+ })({});
376
+ function U(e) {
377
+ return e.type === E.literal;
378
+ }
379
+ function me(e) {
380
+ return e.type === E.argument;
381
+ }
382
+ function Z(e) {
383
+ return e.type === E.number;
384
+ }
385
+ function $(e) {
386
+ return e.type === E.date;
387
+ }
388
+ function j(e) {
389
+ return e.type === E.time;
390
+ }
391
+ function z(e) {
392
+ return e.type === E.select;
393
+ }
394
+ function Q(e) {
395
+ return e.type === E.plural;
396
+ }
397
+ function Ee(e) {
398
+ return e.type === E.pound;
399
+ }
400
+ function J(e) {
401
+ return e.type === E.tag;
402
+ }
403
+ function q(e) {
404
+ return !!(e && typeof e == "object" && e.type === A.number);
405
+ }
406
+ function I(e) {
407
+ return !!(e && typeof e == "object" && e.type === A.dateTime);
408
+ }
409
+ const Y = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, _ = {
410
+ "001": ["H", "h"],
411
+ 419: [
412
+ "h",
413
+ "H",
414
+ "hB",
415
+ "hb"
416
+ ],
417
+ AC: [
418
+ "H",
419
+ "h",
420
+ "hb",
421
+ "hB"
422
+ ],
423
+ AD: ["H", "hB"],
424
+ AE: [
425
+ "h",
426
+ "hB",
427
+ "hb",
428
+ "H"
429
+ ],
430
+ AF: [
431
+ "H",
432
+ "hb",
433
+ "hB",
434
+ "h"
435
+ ],
436
+ AG: [
437
+ "h",
438
+ "hb",
439
+ "H",
440
+ "hB"
441
+ ],
442
+ AI: [
443
+ "H",
444
+ "h",
445
+ "hb",
446
+ "hB"
447
+ ],
448
+ AL: [
449
+ "h",
450
+ "H",
451
+ "hB"
452
+ ],
453
+ AM: ["H", "hB"],
454
+ AO: ["H", "hB"],
455
+ AR: [
456
+ "h",
457
+ "H",
458
+ "hB",
459
+ "hb"
460
+ ],
461
+ AS: ["h", "H"],
462
+ AT: ["H", "hB"],
463
+ AU: [
464
+ "h",
465
+ "hb",
466
+ "H",
467
+ "hB"
468
+ ],
469
+ AW: ["H", "hB"],
470
+ AX: ["H"],
471
+ AZ: [
472
+ "H",
473
+ "hB",
474
+ "h"
475
+ ],
476
+ BA: [
477
+ "H",
478
+ "hB",
479
+ "h"
480
+ ],
481
+ BB: [
482
+ "h",
483
+ "hb",
484
+ "H",
485
+ "hB"
486
+ ],
487
+ BD: [
488
+ "h",
489
+ "hB",
490
+ "H"
491
+ ],
492
+ BE: ["H", "hB"],
493
+ BF: ["H", "hB"],
494
+ BG: [
495
+ "H",
496
+ "hB",
497
+ "h"
498
+ ],
499
+ BH: [
500
+ "h",
501
+ "hB",
502
+ "hb",
503
+ "H"
504
+ ],
505
+ BI: ["H", "h"],
506
+ BJ: ["H", "hB"],
507
+ BL: ["H", "hB"],
508
+ BM: [
509
+ "h",
510
+ "hb",
511
+ "H",
512
+ "hB"
513
+ ],
514
+ BN: [
515
+ "hb",
516
+ "hB",
517
+ "h",
518
+ "H"
519
+ ],
520
+ BO: [
521
+ "h",
522
+ "H",
523
+ "hB",
524
+ "hb"
525
+ ],
526
+ BQ: ["H"],
527
+ BR: ["H", "hB"],
528
+ BS: [
529
+ "h",
530
+ "hb",
531
+ "H",
532
+ "hB"
533
+ ],
534
+ BT: ["h", "H"],
535
+ BW: [
536
+ "H",
537
+ "h",
538
+ "hb",
539
+ "hB"
540
+ ],
541
+ BY: ["H", "h"],
542
+ BZ: [
543
+ "H",
544
+ "h",
545
+ "hb",
546
+ "hB"
547
+ ],
548
+ CA: [
549
+ "h",
550
+ "hb",
551
+ "H",
552
+ "hB"
553
+ ],
554
+ CC: [
555
+ "H",
556
+ "h",
557
+ "hb",
558
+ "hB"
559
+ ],
560
+ CD: ["hB", "H"],
561
+ CF: [
562
+ "H",
563
+ "h",
564
+ "hB"
565
+ ],
566
+ CG: ["H", "hB"],
567
+ CH: [
568
+ "H",
569
+ "hB",
570
+ "h"
571
+ ],
572
+ CI: ["H", "hB"],
573
+ CK: [
574
+ "H",
575
+ "h",
576
+ "hb",
577
+ "hB"
578
+ ],
579
+ CL: [
580
+ "h",
581
+ "H",
582
+ "hB",
583
+ "hb"
584
+ ],
585
+ CM: [
586
+ "H",
587
+ "h",
588
+ "hB"
589
+ ],
590
+ CN: [
591
+ "H",
592
+ "hB",
593
+ "hb",
594
+ "h"
595
+ ],
596
+ CO: [
597
+ "h",
598
+ "H",
599
+ "hB",
600
+ "hb"
601
+ ],
602
+ CP: ["H"],
603
+ CR: [
604
+ "h",
605
+ "H",
606
+ "hB",
607
+ "hb"
608
+ ],
609
+ CU: [
610
+ "h",
611
+ "H",
612
+ "hB",
613
+ "hb"
614
+ ],
615
+ CV: ["H", "hB"],
616
+ CW: ["H", "hB"],
617
+ CX: [
618
+ "H",
619
+ "h",
620
+ "hb",
621
+ "hB"
622
+ ],
623
+ CY: [
624
+ "h",
625
+ "H",
626
+ "hb",
627
+ "hB"
628
+ ],
629
+ CZ: ["H"],
630
+ DE: ["H", "hB"],
631
+ DG: [
632
+ "H",
633
+ "h",
634
+ "hb",
635
+ "hB"
636
+ ],
637
+ DJ: ["h", "H"],
638
+ DK: ["H"],
639
+ DM: [
640
+ "h",
641
+ "hb",
642
+ "H",
643
+ "hB"
644
+ ],
645
+ DO: [
646
+ "h",
647
+ "H",
648
+ "hB",
649
+ "hb"
650
+ ],
651
+ DZ: [
652
+ "h",
653
+ "hB",
654
+ "hb",
655
+ "H"
656
+ ],
657
+ EA: [
658
+ "H",
659
+ "h",
660
+ "hB",
661
+ "hb"
662
+ ],
663
+ EC: [
664
+ "h",
665
+ "H",
666
+ "hB",
667
+ "hb"
668
+ ],
669
+ EE: ["H", "hB"],
670
+ EG: [
671
+ "h",
672
+ "hB",
673
+ "hb",
674
+ "H"
675
+ ],
676
+ EH: [
677
+ "h",
678
+ "hB",
679
+ "hb",
680
+ "H"
681
+ ],
682
+ ER: ["h", "H"],
683
+ ES: [
684
+ "H",
685
+ "hB",
686
+ "h",
687
+ "hb"
688
+ ],
689
+ ET: [
690
+ "hB",
691
+ "hb",
692
+ "h",
693
+ "H"
694
+ ],
695
+ FI: ["H"],
696
+ FJ: [
697
+ "h",
698
+ "hb",
699
+ "H",
700
+ "hB"
701
+ ],
702
+ FK: [
703
+ "H",
704
+ "h",
705
+ "hb",
706
+ "hB"
707
+ ],
708
+ FM: [
709
+ "h",
710
+ "hb",
711
+ "H",
712
+ "hB"
713
+ ],
714
+ FO: ["H", "h"],
715
+ FR: ["H", "hB"],
716
+ GA: ["H", "hB"],
717
+ GB: [
718
+ "H",
719
+ "h",
720
+ "hb",
721
+ "hB"
722
+ ],
723
+ GD: [
724
+ "h",
725
+ "hb",
726
+ "H",
727
+ "hB"
728
+ ],
729
+ GE: [
730
+ "H",
731
+ "hB",
732
+ "h"
733
+ ],
734
+ GF: ["H", "hB"],
735
+ GG: [
736
+ "H",
737
+ "h",
738
+ "hb",
739
+ "hB"
740
+ ],
741
+ GH: ["h", "H"],
742
+ GI: [
743
+ "H",
744
+ "h",
745
+ "hb",
746
+ "hB"
747
+ ],
748
+ GL: ["H", "h"],
749
+ GM: [
750
+ "h",
751
+ "hb",
752
+ "H",
753
+ "hB"
754
+ ],
755
+ GN: ["H", "hB"],
756
+ GP: ["H", "hB"],
757
+ GQ: [
758
+ "H",
759
+ "hB",
760
+ "h",
761
+ "hb"
762
+ ],
763
+ GR: [
764
+ "h",
765
+ "H",
766
+ "hb",
767
+ "hB"
768
+ ],
769
+ GS: [
770
+ "H",
771
+ "h",
772
+ "hb",
773
+ "hB"
774
+ ],
775
+ GT: [
776
+ "h",
777
+ "H",
778
+ "hB",
779
+ "hb"
780
+ ],
781
+ GU: [
782
+ "h",
783
+ "hb",
784
+ "H",
785
+ "hB"
786
+ ],
787
+ GW: ["H", "hB"],
788
+ GY: [
789
+ "h",
790
+ "hb",
791
+ "H",
792
+ "hB"
793
+ ],
794
+ HK: [
795
+ "h",
796
+ "hB",
797
+ "hb",
798
+ "H"
799
+ ],
800
+ HN: [
801
+ "h",
802
+ "H",
803
+ "hB",
804
+ "hb"
805
+ ],
806
+ HR: ["H", "hB"],
807
+ HU: ["H", "h"],
808
+ IC: [
809
+ "H",
810
+ "h",
811
+ "hB",
812
+ "hb"
813
+ ],
814
+ ID: ["H"],
815
+ IE: [
816
+ "H",
817
+ "h",
818
+ "hb",
819
+ "hB"
820
+ ],
821
+ IL: ["H", "hB"],
822
+ IM: [
823
+ "H",
824
+ "h",
825
+ "hb",
826
+ "hB"
827
+ ],
828
+ IN: ["h", "H"],
829
+ IO: [
830
+ "H",
831
+ "h",
832
+ "hb",
833
+ "hB"
834
+ ],
835
+ IQ: [
836
+ "h",
837
+ "hB",
838
+ "hb",
839
+ "H"
840
+ ],
841
+ IR: ["hB", "H"],
842
+ IS: ["H"],
843
+ IT: ["H", "hB"],
844
+ JE: [
845
+ "H",
846
+ "h",
847
+ "hb",
848
+ "hB"
849
+ ],
850
+ JM: [
851
+ "h",
852
+ "hb",
853
+ "H",
854
+ "hB"
855
+ ],
856
+ JO: [
857
+ "h",
858
+ "hB",
859
+ "hb",
860
+ "H"
861
+ ],
862
+ JP: [
863
+ "H",
864
+ "K",
865
+ "h"
866
+ ],
867
+ KE: [
868
+ "hB",
869
+ "hb",
870
+ "H",
871
+ "h"
872
+ ],
873
+ KG: [
874
+ "H",
875
+ "h",
876
+ "hB",
877
+ "hb"
878
+ ],
879
+ KH: [
880
+ "hB",
881
+ "h",
882
+ "H",
883
+ "hb"
884
+ ],
885
+ KI: [
886
+ "h",
887
+ "hb",
888
+ "H",
889
+ "hB"
890
+ ],
891
+ KM: [
892
+ "H",
893
+ "h",
894
+ "hB",
895
+ "hb"
896
+ ],
897
+ KN: [
898
+ "h",
899
+ "hb",
900
+ "H",
901
+ "hB"
902
+ ],
903
+ KP: [
904
+ "h",
905
+ "H",
906
+ "hB",
907
+ "hb"
908
+ ],
909
+ KR: [
910
+ "h",
911
+ "H",
912
+ "hB",
913
+ "hb"
914
+ ],
915
+ KW: [
916
+ "h",
917
+ "hB",
918
+ "hb",
919
+ "H"
920
+ ],
921
+ KY: [
922
+ "h",
923
+ "hb",
924
+ "H",
925
+ "hB"
926
+ ],
927
+ KZ: ["H", "hB"],
928
+ LA: [
929
+ "H",
930
+ "hb",
931
+ "hB",
932
+ "h"
933
+ ],
934
+ LB: [
935
+ "h",
936
+ "hB",
937
+ "hb",
938
+ "H"
939
+ ],
940
+ LC: [
941
+ "h",
942
+ "hb",
943
+ "H",
944
+ "hB"
945
+ ],
946
+ LI: [
947
+ "H",
948
+ "hB",
949
+ "h"
950
+ ],
951
+ LK: [
952
+ "H",
953
+ "h",
954
+ "hB",
955
+ "hb"
956
+ ],
957
+ LR: [
958
+ "h",
959
+ "hb",
960
+ "H",
961
+ "hB"
962
+ ],
963
+ LS: ["h", "H"],
964
+ LT: [
965
+ "H",
966
+ "h",
967
+ "hb",
968
+ "hB"
969
+ ],
970
+ LU: [
971
+ "H",
972
+ "h",
973
+ "hB"
974
+ ],
975
+ LV: [
976
+ "H",
977
+ "hB",
978
+ "hb",
979
+ "h"
980
+ ],
981
+ LY: [
982
+ "h",
983
+ "hB",
984
+ "hb",
985
+ "H"
986
+ ],
987
+ MA: [
988
+ "H",
989
+ "h",
990
+ "hB",
991
+ "hb"
992
+ ],
993
+ MC: ["H", "hB"],
994
+ MD: ["H", "hB"],
995
+ ME: [
996
+ "H",
997
+ "hB",
998
+ "h"
999
+ ],
1000
+ MF: ["H", "hB"],
1001
+ MG: ["H", "h"],
1002
+ MH: [
1003
+ "h",
1004
+ "hb",
1005
+ "H",
1006
+ "hB"
1007
+ ],
1008
+ MK: [
1009
+ "H",
1010
+ "h",
1011
+ "hb",
1012
+ "hB"
1013
+ ],
1014
+ ML: ["H"],
1015
+ MM: [
1016
+ "hB",
1017
+ "hb",
1018
+ "H",
1019
+ "h"
1020
+ ],
1021
+ MN: [
1022
+ "H",
1023
+ "h",
1024
+ "hb",
1025
+ "hB"
1026
+ ],
1027
+ MO: [
1028
+ "h",
1029
+ "hB",
1030
+ "hb",
1031
+ "H"
1032
+ ],
1033
+ MP: [
1034
+ "h",
1035
+ "hb",
1036
+ "H",
1037
+ "hB"
1038
+ ],
1039
+ MQ: ["H", "hB"],
1040
+ MR: [
1041
+ "h",
1042
+ "hB",
1043
+ "hb",
1044
+ "H"
1045
+ ],
1046
+ MS: [
1047
+ "H",
1048
+ "h",
1049
+ "hb",
1050
+ "hB"
1051
+ ],
1052
+ MT: ["H", "h"],
1053
+ MU: ["H", "h"],
1054
+ MV: ["H", "h"],
1055
+ MW: [
1056
+ "h",
1057
+ "hb",
1058
+ "H",
1059
+ "hB"
1060
+ ],
1061
+ MX: [
1062
+ "h",
1063
+ "H",
1064
+ "hB",
1065
+ "hb"
1066
+ ],
1067
+ MY: [
1068
+ "hb",
1069
+ "hB",
1070
+ "h",
1071
+ "H"
1072
+ ],
1073
+ MZ: ["H", "hB"],
1074
+ NA: [
1075
+ "h",
1076
+ "H",
1077
+ "hB",
1078
+ "hb"
1079
+ ],
1080
+ NC: ["H", "hB"],
1081
+ NE: ["H"],
1082
+ NF: [
1083
+ "H",
1084
+ "h",
1085
+ "hb",
1086
+ "hB"
1087
+ ],
1088
+ NG: [
1089
+ "H",
1090
+ "h",
1091
+ "hb",
1092
+ "hB"
1093
+ ],
1094
+ NI: [
1095
+ "h",
1096
+ "H",
1097
+ "hB",
1098
+ "hb"
1099
+ ],
1100
+ NL: ["H", "hB"],
1101
+ NO: ["H", "h"],
1102
+ NP: [
1103
+ "H",
1104
+ "h",
1105
+ "hB"
1106
+ ],
1107
+ NR: [
1108
+ "H",
1109
+ "h",
1110
+ "hb",
1111
+ "hB"
1112
+ ],
1113
+ NU: [
1114
+ "H",
1115
+ "h",
1116
+ "hb",
1117
+ "hB"
1118
+ ],
1119
+ NZ: [
1120
+ "h",
1121
+ "hb",
1122
+ "H",
1123
+ "hB"
1124
+ ],
1125
+ OM: [
1126
+ "h",
1127
+ "hB",
1128
+ "hb",
1129
+ "H"
1130
+ ],
1131
+ PA: [
1132
+ "h",
1133
+ "H",
1134
+ "hB",
1135
+ "hb"
1136
+ ],
1137
+ PE: [
1138
+ "h",
1139
+ "H",
1140
+ "hB",
1141
+ "hb"
1142
+ ],
1143
+ PF: [
1144
+ "H",
1145
+ "h",
1146
+ "hB"
1147
+ ],
1148
+ PG: ["h", "H"],
1149
+ PH: [
1150
+ "h",
1151
+ "hB",
1152
+ "hb",
1153
+ "H"
1154
+ ],
1155
+ PK: [
1156
+ "h",
1157
+ "hB",
1158
+ "H"
1159
+ ],
1160
+ PL: ["H", "h"],
1161
+ PM: ["H", "hB"],
1162
+ PN: [
1163
+ "H",
1164
+ "h",
1165
+ "hb",
1166
+ "hB"
1167
+ ],
1168
+ PR: [
1169
+ "h",
1170
+ "H",
1171
+ "hB",
1172
+ "hb"
1173
+ ],
1174
+ PS: [
1175
+ "h",
1176
+ "hB",
1177
+ "hb",
1178
+ "H"
1179
+ ],
1180
+ PT: ["H", "hB"],
1181
+ PW: ["h", "H"],
1182
+ PY: [
1183
+ "h",
1184
+ "H",
1185
+ "hB",
1186
+ "hb"
1187
+ ],
1188
+ QA: [
1189
+ "h",
1190
+ "hB",
1191
+ "hb",
1192
+ "H"
1193
+ ],
1194
+ RE: ["H", "hB"],
1195
+ RO: ["H", "hB"],
1196
+ RS: [
1197
+ "H",
1198
+ "hB",
1199
+ "h"
1200
+ ],
1201
+ RU: ["H"],
1202
+ RW: ["H", "h"],
1203
+ SA: [
1204
+ "h",
1205
+ "hB",
1206
+ "hb",
1207
+ "H"
1208
+ ],
1209
+ SB: [
1210
+ "h",
1211
+ "hb",
1212
+ "H",
1213
+ "hB"
1214
+ ],
1215
+ SC: [
1216
+ "H",
1217
+ "h",
1218
+ "hB"
1219
+ ],
1220
+ SD: [
1221
+ "h",
1222
+ "hB",
1223
+ "hb",
1224
+ "H"
1225
+ ],
1226
+ SE: ["H"],
1227
+ SG: [
1228
+ "h",
1229
+ "hb",
1230
+ "H",
1231
+ "hB"
1232
+ ],
1233
+ SH: [
1234
+ "H",
1235
+ "h",
1236
+ "hb",
1237
+ "hB"
1238
+ ],
1239
+ SI: ["H", "hB"],
1240
+ SJ: ["H"],
1241
+ SK: ["H"],
1242
+ SL: [
1243
+ "h",
1244
+ "hb",
1245
+ "H",
1246
+ "hB"
1247
+ ],
1248
+ SM: [
1249
+ "H",
1250
+ "h",
1251
+ "hB"
1252
+ ],
1253
+ SN: [
1254
+ "H",
1255
+ "h",
1256
+ "hB"
1257
+ ],
1258
+ SO: ["h", "H"],
1259
+ SR: ["H", "hB"],
1260
+ SS: [
1261
+ "h",
1262
+ "hb",
1263
+ "H",
1264
+ "hB"
1265
+ ],
1266
+ ST: ["H", "hB"],
1267
+ SV: [
1268
+ "h",
1269
+ "H",
1270
+ "hB",
1271
+ "hb"
1272
+ ],
1273
+ SX: [
1274
+ "H",
1275
+ "h",
1276
+ "hb",
1277
+ "hB"
1278
+ ],
1279
+ SY: [
1280
+ "h",
1281
+ "hB",
1282
+ "hb",
1283
+ "H"
1284
+ ],
1285
+ SZ: [
1286
+ "h",
1287
+ "hb",
1288
+ "H",
1289
+ "hB"
1290
+ ],
1291
+ TA: [
1292
+ "H",
1293
+ "h",
1294
+ "hb",
1295
+ "hB"
1296
+ ],
1297
+ TC: [
1298
+ "h",
1299
+ "hb",
1300
+ "H",
1301
+ "hB"
1302
+ ],
1303
+ TD: [
1304
+ "h",
1305
+ "H",
1306
+ "hB"
1307
+ ],
1308
+ TF: [
1309
+ "H",
1310
+ "h",
1311
+ "hB"
1312
+ ],
1313
+ TG: ["H", "hB"],
1314
+ TH: ["H", "h"],
1315
+ TJ: ["H", "h"],
1316
+ TL: [
1317
+ "H",
1318
+ "hB",
1319
+ "hb",
1320
+ "h"
1321
+ ],
1322
+ TM: ["H", "h"],
1323
+ TN: [
1324
+ "h",
1325
+ "hB",
1326
+ "hb",
1327
+ "H"
1328
+ ],
1329
+ TO: ["h", "H"],
1330
+ TR: ["H", "hB"],
1331
+ TT: [
1332
+ "h",
1333
+ "hb",
1334
+ "H",
1335
+ "hB"
1336
+ ],
1337
+ TW: [
1338
+ "hB",
1339
+ "hb",
1340
+ "h",
1341
+ "H"
1342
+ ],
1343
+ TZ: [
1344
+ "hB",
1345
+ "hb",
1346
+ "H",
1347
+ "h"
1348
+ ],
1349
+ UA: [
1350
+ "H",
1351
+ "hB",
1352
+ "h"
1353
+ ],
1354
+ UG: [
1355
+ "hB",
1356
+ "hb",
1357
+ "H",
1358
+ "h"
1359
+ ],
1360
+ UM: [
1361
+ "h",
1362
+ "hb",
1363
+ "H",
1364
+ "hB"
1365
+ ],
1366
+ US: [
1367
+ "h",
1368
+ "hb",
1369
+ "H",
1370
+ "hB"
1371
+ ],
1372
+ UY: [
1373
+ "h",
1374
+ "H",
1375
+ "hB",
1376
+ "hb"
1377
+ ],
1378
+ UZ: [
1379
+ "H",
1380
+ "hB",
1381
+ "h"
1382
+ ],
1383
+ VA: [
1384
+ "H",
1385
+ "h",
1386
+ "hB"
1387
+ ],
1388
+ VC: [
1389
+ "h",
1390
+ "hb",
1391
+ "H",
1392
+ "hB"
1393
+ ],
1394
+ VE: [
1395
+ "h",
1396
+ "H",
1397
+ "hB",
1398
+ "hb"
1399
+ ],
1400
+ VG: [
1401
+ "h",
1402
+ "hb",
1403
+ "H",
1404
+ "hB"
1405
+ ],
1406
+ VI: [
1407
+ "h",
1408
+ "hb",
1409
+ "H",
1410
+ "hB"
1411
+ ],
1412
+ VN: ["H", "h"],
1413
+ VU: ["h", "H"],
1414
+ WF: ["H", "hB"],
1415
+ WS: ["h", "H"],
1416
+ XK: [
1417
+ "H",
1418
+ "hB",
1419
+ "h"
1420
+ ],
1421
+ YE: [
1422
+ "h",
1423
+ "hB",
1424
+ "hb",
1425
+ "H"
1426
+ ],
1427
+ YT: ["H", "hB"],
1428
+ ZA: [
1429
+ "H",
1430
+ "h",
1431
+ "hb",
1432
+ "hB"
1433
+ ],
1434
+ ZM: [
1435
+ "h",
1436
+ "hb",
1437
+ "H",
1438
+ "hB"
1439
+ ],
1440
+ ZW: ["H", "h"],
1441
+ "af-ZA": [
1442
+ "H",
1443
+ "h",
1444
+ "hB",
1445
+ "hb"
1446
+ ],
1447
+ "ar-001": [
1448
+ "h",
1449
+ "hB",
1450
+ "hb",
1451
+ "H"
1452
+ ],
1453
+ "ca-ES": [
1454
+ "H",
1455
+ "h",
1456
+ "hB"
1457
+ ],
1458
+ "en-001": [
1459
+ "h",
1460
+ "hb",
1461
+ "H",
1462
+ "hB"
1463
+ ],
1464
+ "en-HK": [
1465
+ "h",
1466
+ "hb",
1467
+ "H",
1468
+ "hB"
1469
+ ],
1470
+ "en-IL": [
1471
+ "H",
1472
+ "h",
1473
+ "hb",
1474
+ "hB"
1475
+ ],
1476
+ "en-MY": [
1477
+ "h",
1478
+ "hb",
1479
+ "H",
1480
+ "hB"
1481
+ ],
1482
+ "es-BR": [
1483
+ "H",
1484
+ "h",
1485
+ "hB",
1486
+ "hb"
1487
+ ],
1488
+ "es-ES": [
1489
+ "H",
1490
+ "h",
1491
+ "hB",
1492
+ "hb"
1493
+ ],
1494
+ "es-GQ": [
1495
+ "H",
1496
+ "h",
1497
+ "hB",
1498
+ "hb"
1499
+ ],
1500
+ "fr-CA": [
1501
+ "H",
1502
+ "h",
1503
+ "hB"
1504
+ ],
1505
+ "gl-ES": [
1506
+ "H",
1507
+ "h",
1508
+ "hB"
1509
+ ],
1510
+ "gu-IN": [
1511
+ "hB",
1512
+ "hb",
1513
+ "h",
1514
+ "H"
1515
+ ],
1516
+ "hi-IN": [
1517
+ "hB",
1518
+ "h",
1519
+ "H"
1520
+ ],
1521
+ "it-CH": [
1522
+ "H",
1523
+ "h",
1524
+ "hB"
1525
+ ],
1526
+ "it-IT": [
1527
+ "H",
1528
+ "h",
1529
+ "hB"
1530
+ ],
1531
+ "kn-IN": [
1532
+ "hB",
1533
+ "h",
1534
+ "H"
1535
+ ],
1536
+ "ku-SY": ["H", "hB"],
1537
+ "ml-IN": [
1538
+ "hB",
1539
+ "h",
1540
+ "H"
1541
+ ],
1542
+ "mr-IN": [
1543
+ "hB",
1544
+ "hb",
1545
+ "h",
1546
+ "H"
1547
+ ],
1548
+ "pa-IN": [
1549
+ "hB",
1550
+ "hb",
1551
+ "h",
1552
+ "H"
1553
+ ],
1554
+ "ta-IN": [
1555
+ "hB",
1556
+ "h",
1557
+ "hb",
1558
+ "H"
1559
+ ],
1560
+ "te-IN": [
1561
+ "hB",
1562
+ "h",
1563
+ "H"
1564
+ ],
1565
+ "zu-ZA": [
1566
+ "H",
1567
+ "hB",
1568
+ "hb",
1569
+ "h"
1570
+ ]
1571
+ };
1572
+ function be(e, t) {
1573
+ let i = "";
1574
+ for (let n = 0; n < e.length; n++) {
1575
+ const r = e.charAt(n);
1576
+ if (r === "j") {
1577
+ let s = 0;
1578
+ for (; n + 1 < e.length && e.charAt(n + 1) === r; )
1579
+ s++, n++;
1580
+ let c = 1 + (s & 1), o = s < 2 ? 1 : 3 + (s >> 1), h = "a", p = ge(t);
1581
+ for ((p == "H" || p == "k") && (o = 0); o-- > 0; ) i += h;
1582
+ for (; c-- > 0; ) i = p + i;
1583
+ } else r === "J" ? i += "H" : i += r;
1584
+ }
1585
+ return i;
1586
+ }
1587
+ function ge(e) {
1588
+ let t = e.hourCycle;
1589
+ if (t === void 0 && e.hourCycles && e.hourCycles.length && (t = e.hourCycles[0]), t) switch (t) {
1590
+ case "h24":
1591
+ return "k";
1592
+ case "h23":
1593
+ return "H";
1594
+ case "h12":
1595
+ return "h";
1596
+ case "h11":
1597
+ return "K";
1598
+ default:
1599
+ throw new Error("Invalid hourCycle");
1600
+ }
1601
+ const i = e.language;
1602
+ let n;
1603
+ return i !== "root" && (n = e.maximize().region), (_[n || ""] || _[i || ""] || _[`${i}-001`] || _["001"])[0];
1604
+ }
1605
+ const He = new RegExp(`^${Y.source}*`), Be = new RegExp(`${Y.source}*$`);
1606
+ function l(e, t) {
1607
+ return {
1608
+ start: e,
1609
+ end: t
1610
+ };
1611
+ }
1612
+ const Te = !!Object.fromEntries, _e = !!String.prototype.trimStart, ye = !!String.prototype.trimEnd, w = Te ? Object.fromEntries : function(t) {
1613
+ const i = {};
1614
+ for (const [n, r] of t) i[n] = r;
1615
+ return i;
1616
+ }, Ae = _e ? function(t) {
1617
+ return t.trimStart();
1618
+ } : function(t) {
1619
+ return t.replace(He, "");
1620
+ }, Se = ye ? function(t) {
1621
+ return t.trimEnd();
1622
+ } : function(t) {
1623
+ return t.replace(Be, "");
1624
+ }, D = /* @__PURE__ */ new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
1625
+ function Le(e, t) {
1626
+ return D.lastIndex = t, D.exec(e)[1] ?? "";
1627
+ }
1628
+ var de = class {
1629
+ constructor(e, t = {}) {
1630
+ this.message = e, this.position = {
1631
+ offset: 0,
1632
+ line: 1,
1633
+ column: 1
1634
+ }, this.ignoreTag = !!t.ignoreTag, this.locale = t.locale, this.requiresOtherClause = !!t.requiresOtherClause, this.shouldParseSkeletons = !!t.shouldParseSkeletons;
1635
+ }
1636
+ parse() {
1637
+ if (this.offset() !== 0) throw Error("parser can only be used once");
1638
+ return this.parseMessage(0, "", !1);
1639
+ }
1640
+ parseMessage(e, t, i) {
1641
+ let n = [];
1642
+ for (; !this.isEOF(); ) {
1643
+ const r = this.char();
1644
+ if (r === 123) {
1645
+ const s = this.parseArgument(e, i);
1646
+ if (s.err) return s;
1647
+ n.push(s.val);
1648
+ } else {
1649
+ if (r === 125 && e > 0) break;
1650
+ if (r === 35 && (t === "plural" || t === "selectordinal")) {
1651
+ const s = this.clonePosition();
1652
+ this.bump(), n.push({
1653
+ type: E.pound,
1654
+ location: l(s, this.clonePosition())
1655
+ });
1656
+ } else if (r === 60 && !this.ignoreTag && this.peek() === 47) {
1657
+ if (i) break;
1658
+ return this.error(f.UNMATCHED_CLOSING_TAG, l(this.clonePosition(), this.clonePosition()));
1659
+ } else if (r === 60 && !this.ignoreTag && R(this.peek() || 0)) {
1660
+ const s = this.parseTag(e, t);
1661
+ if (s.err) return s;
1662
+ n.push(s.val);
1663
+ } else {
1664
+ const s = this.parseLiteral(e, t);
1665
+ if (s.err) return s;
1666
+ n.push(s.val);
1667
+ }
1668
+ }
1669
+ }
1670
+ return {
1671
+ val: n,
1672
+ err: null
1673
+ };
1674
+ }
1675
+ /**
1676
+ * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the
1677
+ * [custom element name][] except that a dash is NOT always mandatory and uppercase letters
1678
+ * are accepted:
1679
+ *
1680
+ * ```
1681
+ * tag ::= "<" tagName (whitespace)* "/>" | "<" tagName (whitespace)* ">" message "</" tagName (whitespace)* ">"
1682
+ * tagName ::= [a-z] (PENChar)*
1683
+ * PENChar ::=
1684
+ * "-" | "." | [0-9] | "_" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |
1685
+ * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |
1686
+ * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
1687
+ * ```
1688
+ *
1689
+ * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name
1690
+ * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do
1691
+ * since other tag-based engines like React allow it
1692
+ */
1693
+ parseTag(e, t) {
1694
+ const i = this.clonePosition();
1695
+ this.bump();
1696
+ const n = this.parseTagName();
1697
+ if (this.bumpSpace(), this.bumpIf("/>")) return {
1698
+ val: {
1699
+ type: E.literal,
1700
+ value: `<${n}/>`,
1701
+ location: l(i, this.clonePosition())
1702
+ },
1703
+ err: null
1704
+ };
1705
+ if (this.bumpIf(">")) {
1706
+ const r = this.parseMessage(e + 1, t, !0);
1707
+ if (r.err) return r;
1708
+ const s = r.val, c = this.clonePosition();
1709
+ if (this.bumpIf("</")) {
1710
+ if (this.isEOF() || !R(this.char())) return this.error(f.INVALID_TAG, l(c, this.clonePosition()));
1711
+ const o = this.clonePosition();
1712
+ return n !== this.parseTagName() ? this.error(f.UNMATCHED_CLOSING_TAG, l(o, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(">") ? {
1713
+ val: {
1714
+ type: E.tag,
1715
+ value: n,
1716
+ children: s,
1717
+ location: l(i, this.clonePosition())
1718
+ },
1719
+ err: null
1720
+ } : this.error(f.INVALID_TAG, l(c, this.clonePosition())));
1721
+ } else return this.error(f.UNCLOSED_TAG, l(i, this.clonePosition()));
1722
+ } else return this.error(f.INVALID_TAG, l(i, this.clonePosition()));
1723
+ }
1724
+ /**
1725
+ * This method assumes that the caller has peeked ahead for the first tag character.
1726
+ */
1727
+ parseTagName() {
1728
+ const e = this.offset();
1729
+ for (this.bump(); !this.isEOF() && Pe(this.char()); ) this.bump();
1730
+ return this.message.slice(e, this.offset());
1731
+ }
1732
+ parseLiteral(e, t) {
1733
+ const i = this.clonePosition();
1734
+ let n = "";
1735
+ for (; ; ) {
1736
+ const s = this.tryParseQuote(t);
1737
+ if (s) {
1738
+ n += s;
1739
+ continue;
1740
+ }
1741
+ const c = this.tryParseUnquoted(e, t);
1742
+ if (c) {
1743
+ n += c;
1744
+ continue;
1745
+ }
1746
+ const o = this.tryParseLeftAngleBracket();
1747
+ if (o) {
1748
+ n += o;
1749
+ continue;
1750
+ }
1751
+ break;
1752
+ }
1753
+ const r = l(i, this.clonePosition());
1754
+ return {
1755
+ val: {
1756
+ type: E.literal,
1757
+ value: n,
1758
+ location: r
1759
+ },
1760
+ err: null
1761
+ };
1762
+ }
1763
+ tryParseLeftAngleBracket() {
1764
+ return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !Ne(this.peek() || 0)) ? (this.bump(), "<") : null;
1765
+ }
1766
+ /**
1767
+ * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes
1768
+ * a character that requires quoting (that is, "only where needed"), and works the same in
1769
+ * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.
1770
+ */
1771
+ tryParseQuote(e) {
1772
+ if (this.isEOF() || this.char() !== 39) return null;
1773
+ switch (this.peek()) {
1774
+ case 39:
1775
+ return this.bump(), this.bump(), "'";
1776
+ case 123:
1777
+ case 60:
1778
+ case 62:
1779
+ case 125:
1780
+ break;
1781
+ case 35:
1782
+ if (e === "plural" || e === "selectordinal") break;
1783
+ return null;
1784
+ default:
1785
+ return null;
1786
+ }
1787
+ this.bump();
1788
+ const t = [this.char()];
1789
+ for (this.bump(); !this.isEOF(); ) {
1790
+ const i = this.char();
1791
+ if (i === 39) if (this.peek() === 39)
1792
+ t.push(39), this.bump();
1793
+ else {
1794
+ this.bump();
1795
+ break;
1796
+ }
1797
+ else t.push(i);
1798
+ this.bump();
1799
+ }
1800
+ return String.fromCodePoint(...t);
1801
+ }
1802
+ tryParseUnquoted(e, t) {
1803
+ if (this.isEOF()) return null;
1804
+ const i = this.char();
1805
+ return i === 60 || i === 123 || i === 35 && (t === "plural" || t === "selectordinal") || i === 125 && e > 0 ? null : (this.bump(), String.fromCodePoint(i));
1806
+ }
1807
+ parseArgument(e, t) {
1808
+ const i = this.clonePosition();
1809
+ if (this.bump(), this.bumpSpace(), this.isEOF()) return this.error(f.EXPECT_ARGUMENT_CLOSING_BRACE, l(i, this.clonePosition()));
1810
+ if (this.char() === 125)
1811
+ return this.bump(), this.error(f.EMPTY_ARGUMENT, l(i, this.clonePosition()));
1812
+ let n = this.parseIdentifierIfPossible().value;
1813
+ if (!n) return this.error(f.MALFORMED_ARGUMENT, l(i, this.clonePosition()));
1814
+ if (this.bumpSpace(), this.isEOF()) return this.error(f.EXPECT_ARGUMENT_CLOSING_BRACE, l(i, this.clonePosition()));
1815
+ switch (this.char()) {
1816
+ case 125:
1817
+ return this.bump(), {
1818
+ val: {
1819
+ type: E.argument,
1820
+ value: n,
1821
+ location: l(i, this.clonePosition())
1822
+ },
1823
+ err: null
1824
+ };
1825
+ case 44:
1826
+ return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(f.EXPECT_ARGUMENT_CLOSING_BRACE, l(i, this.clonePosition())) : this.parseArgumentOptions(e, t, n, i);
1827
+ default:
1828
+ return this.error(f.MALFORMED_ARGUMENT, l(i, this.clonePosition()));
1829
+ }
1830
+ }
1831
+ /**
1832
+ * Advance the parser until the end of the identifier, if it is currently on
1833
+ * an identifier character. Return an empty string otherwise.
1834
+ */
1835
+ parseIdentifierIfPossible() {
1836
+ const e = this.clonePosition(), t = this.offset(), i = Le(this.message, t), n = t + i.length;
1837
+ return this.bumpTo(n), {
1838
+ value: i,
1839
+ location: l(e, this.clonePosition())
1840
+ };
1841
+ }
1842
+ parseArgumentOptions(e, t, i, n) {
1843
+ let r = this.clonePosition(), s = this.parseIdentifierIfPossible().value, c = this.clonePosition();
1844
+ switch (s) {
1845
+ case "":
1846
+ return this.error(f.EXPECT_ARGUMENT_TYPE, l(r, c));
1847
+ case "number":
1848
+ case "date":
1849
+ case "time": {
1850
+ this.bumpSpace();
1851
+ let o = null;
1852
+ if (this.bumpIf(",")) {
1853
+ this.bumpSpace();
1854
+ const a = this.clonePosition(), u = this.parseSimpleArgStyleIfPossible();
1855
+ if (u.err) return u;
1856
+ const m = Se(u.val);
1857
+ if (m.length === 0) return this.error(f.EXPECT_ARGUMENT_STYLE, l(this.clonePosition(), this.clonePosition()));
1858
+ o = {
1859
+ style: m,
1860
+ styleLocation: l(a, this.clonePosition())
1861
+ };
1862
+ }
1863
+ const h = this.tryParseArgumentClose(n);
1864
+ if (h.err) return h;
1865
+ const p = l(n, this.clonePosition());
1866
+ if (o && o.style.startsWith("::")) {
1867
+ let a = Ae(o.style.slice(2));
1868
+ if (s === "number") {
1869
+ const u = this.parseNumberSkeletonFromString(a, o.styleLocation);
1870
+ return u.err ? u : {
1871
+ val: {
1872
+ type: E.number,
1873
+ value: i,
1874
+ location: p,
1875
+ style: u.val
1876
+ },
1877
+ err: null
1878
+ };
1879
+ } else {
1880
+ if (a.length === 0) return this.error(f.EXPECT_DATE_TIME_SKELETON, p);
1881
+ let u = a;
1882
+ this.locale && (u = be(a, this.locale));
1883
+ const m = {
1884
+ type: A.dateTime,
1885
+ pattern: u,
1886
+ location: o.styleLocation,
1887
+ parsedOptions: this.shouldParseSkeletons ? oe(u) : {}
1888
+ };
1889
+ return {
1890
+ val: {
1891
+ type: s === "date" ? E.date : E.time,
1892
+ value: i,
1893
+ location: p,
1894
+ style: m
1895
+ },
1896
+ err: null
1897
+ };
1898
+ }
1899
+ }
1900
+ return {
1901
+ val: {
1902
+ type: s === "number" ? E.number : s === "date" ? E.date : E.time,
1903
+ value: i,
1904
+ location: p,
1905
+ style: o?.style ?? null
1906
+ },
1907
+ err: null
1908
+ };
1909
+ }
1910
+ case "plural":
1911
+ case "selectordinal":
1912
+ case "select": {
1913
+ const o = this.clonePosition();
1914
+ if (this.bumpSpace(), !this.bumpIf(",")) return this.error(f.EXPECT_SELECT_ARGUMENT_OPTIONS, l(o, { ...o }));
1915
+ this.bumpSpace();
1916
+ let h = this.parseIdentifierIfPossible(), p = 0;
1917
+ if (s !== "select" && h.value === "offset") {
1918
+ if (!this.bumpIf(":")) return this.error(f.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, l(this.clonePosition(), this.clonePosition()));
1919
+ this.bumpSpace();
1920
+ const H = this.tryParseDecimalInteger(f.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, f.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
1921
+ if (H.err) return H;
1922
+ this.bumpSpace(), h = this.parseIdentifierIfPossible(), p = H.val;
1923
+ }
1924
+ const a = this.tryParsePluralOrSelectOptions(e, s, t, h);
1925
+ if (a.err) return a;
1926
+ const u = this.tryParseArgumentClose(n);
1927
+ if (u.err) return u;
1928
+ const m = l(n, this.clonePosition());
1929
+ return s === "select" ? {
1930
+ val: {
1931
+ type: E.select,
1932
+ value: i,
1933
+ options: w(a.val),
1934
+ location: m
1935
+ },
1936
+ err: null
1937
+ } : {
1938
+ val: {
1939
+ type: E.plural,
1940
+ value: i,
1941
+ options: w(a.val),
1942
+ offset: p,
1943
+ pluralType: s === "plural" ? "cardinal" : "ordinal",
1944
+ location: m
1945
+ },
1946
+ err: null
1947
+ };
1948
+ }
1949
+ default:
1950
+ return this.error(f.INVALID_ARGUMENT_TYPE, l(r, c));
1951
+ }
1952
+ }
1953
+ tryParseArgumentClose(e) {
1954
+ return this.isEOF() || this.char() !== 125 ? this.error(f.EXPECT_ARGUMENT_CLOSING_BRACE, l(e, this.clonePosition())) : (this.bump(), {
1955
+ val: !0,
1956
+ err: null
1957
+ });
1958
+ }
1959
+ /**
1960
+ * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659
1961
+ */
1962
+ parseSimpleArgStyleIfPossible() {
1963
+ let e = 0;
1964
+ const t = this.clonePosition();
1965
+ for (; !this.isEOF(); ) switch (this.char()) {
1966
+ case 39: {
1967
+ this.bump();
1968
+ let i = this.clonePosition();
1969
+ if (!this.bumpUntil("'")) return this.error(f.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, l(i, this.clonePosition()));
1970
+ this.bump();
1971
+ break;
1972
+ }
1973
+ case 123:
1974
+ e += 1, this.bump();
1975
+ break;
1976
+ case 125:
1977
+ if (e > 0) e -= 1;
1978
+ else return {
1979
+ val: this.message.slice(t.offset, this.offset()),
1980
+ err: null
1981
+ };
1982
+ break;
1983
+ default:
1984
+ this.bump();
1985
+ break;
1986
+ }
1987
+ return {
1988
+ val: this.message.slice(t.offset, this.offset()),
1989
+ err: null
1990
+ };
1991
+ }
1992
+ parseNumberSkeletonFromString(e, t) {
1993
+ let i = [];
1994
+ try {
1995
+ i = ue(e);
1996
+ } catch {
1997
+ return this.error(f.INVALID_NUMBER_SKELETON, t);
1998
+ }
1999
+ return {
2000
+ val: {
2001
+ type: A.number,
2002
+ tokens: i,
2003
+ location: t,
2004
+ parsedOptions: this.shouldParseSkeletons ? pe(i) : {}
2005
+ },
2006
+ err: null
2007
+ };
2008
+ }
2009
+ /**
2010
+ * @param nesting_level The current nesting level of messages.
2011
+ * This can be positive when parsing message fragment in select or plural argument options.
2012
+ * @param parent_arg_type The parent argument's type.
2013
+ * @param parsed_first_identifier If provided, this is the first identifier-like selector of
2014
+ * the argument. It is a by-product of a previous parsing attempt.
2015
+ * @param expecting_close_tag If true, this message is directly or indirectly nested inside
2016
+ * between a pair of opening and closing tags. The nested message will not parse beyond
2017
+ * the closing tag boundary.
2018
+ */
2019
+ tryParsePluralOrSelectOptions(e, t, i, n) {
2020
+ let r = !1;
2021
+ const s = [], c = /* @__PURE__ */ new Set();
2022
+ let { value: o, location: h } = n;
2023
+ for (; ; ) {
2024
+ if (o.length === 0) {
2025
+ const m = this.clonePosition();
2026
+ if (t !== "select" && this.bumpIf("=")) {
2027
+ const H = this.tryParseDecimalInteger(f.EXPECT_PLURAL_ARGUMENT_SELECTOR, f.INVALID_PLURAL_ARGUMENT_SELECTOR);
2028
+ if (H.err) return H;
2029
+ h = l(m, this.clonePosition()), o = this.message.slice(m.offset, this.offset());
2030
+ } else break;
2031
+ }
2032
+ if (c.has(o)) return this.error(t === "select" ? f.DUPLICATE_SELECT_ARGUMENT_SELECTOR : f.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, h);
2033
+ o === "other" && (r = !0), this.bumpSpace();
2034
+ const p = this.clonePosition();
2035
+ if (!this.bumpIf("{")) return this.error(t === "select" ? f.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : f.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, l(this.clonePosition(), this.clonePosition()));
2036
+ const a = this.parseMessage(e + 1, t, i);
2037
+ if (a.err) return a;
2038
+ const u = this.tryParseArgumentClose(p);
2039
+ if (u.err) return u;
2040
+ s.push([o, {
2041
+ value: a.val,
2042
+ location: l(p, this.clonePosition())
2043
+ }]), c.add(o), this.bumpSpace(), { value: o, location: h } = this.parseIdentifierIfPossible();
2044
+ }
2045
+ return s.length === 0 ? this.error(t === "select" ? f.EXPECT_SELECT_ARGUMENT_SELECTOR : f.EXPECT_PLURAL_ARGUMENT_SELECTOR, l(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !r ? this.error(f.MISSING_OTHER_CLAUSE, l(this.clonePosition(), this.clonePosition())) : {
2046
+ val: s,
2047
+ err: null
2048
+ };
2049
+ }
2050
+ tryParseDecimalInteger(e, t) {
2051
+ let i = 1;
2052
+ const n = this.clonePosition();
2053
+ this.bumpIf("+") || this.bumpIf("-") && (i = -1);
2054
+ let r = !1, s = 0;
2055
+ for (; !this.isEOF(); ) {
2056
+ const o = this.char();
2057
+ if (o >= 48 && o <= 57)
2058
+ r = !0, s = s * 10 + (o - 48), this.bump();
2059
+ else break;
2060
+ }
2061
+ const c = l(n, this.clonePosition());
2062
+ return r ? (s *= i, Number.isSafeInteger(s) ? {
2063
+ val: s,
2064
+ err: null
2065
+ } : this.error(t, c)) : this.error(e, c);
2066
+ }
2067
+ offset() {
2068
+ return this.position.offset;
2069
+ }
2070
+ isEOF() {
2071
+ return this.offset() === this.message.length;
2072
+ }
2073
+ clonePosition() {
2074
+ return {
2075
+ offset: this.position.offset,
2076
+ line: this.position.line,
2077
+ column: this.position.column
2078
+ };
2079
+ }
2080
+ /**
2081
+ * Return the code point at the current position of the parser.
2082
+ * Throws if the index is out of bound.
2083
+ */
2084
+ char() {
2085
+ const e = this.position.offset;
2086
+ if (e >= this.message.length) throw Error("out of bound");
2087
+ const t = this.message.codePointAt(e);
2088
+ if (t === void 0) throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);
2089
+ return t;
2090
+ }
2091
+ error(e, t) {
2092
+ return {
2093
+ val: null,
2094
+ err: {
2095
+ kind: e,
2096
+ message: this.message,
2097
+ location: t
2098
+ }
2099
+ };
2100
+ }
2101
+ /** Bump the parser to the next UTF-16 code unit. */
2102
+ bump() {
2103
+ if (this.isEOF()) return;
2104
+ const e = this.char();
2105
+ e === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += e < 65536 ? 1 : 2);
2106
+ }
2107
+ /**
2108
+ * If the substring starting at the current position of the parser has
2109
+ * the given prefix, then bump the parser to the character immediately
2110
+ * following the prefix and return true. Otherwise, don't bump the parser
2111
+ * and return false.
2112
+ */
2113
+ bumpIf(e) {
2114
+ if (this.message.startsWith(e, this.offset())) {
2115
+ for (let t = 0; t < e.length; t++) this.bump();
2116
+ return !0;
2117
+ }
2118
+ return !1;
2119
+ }
2120
+ /**
2121
+ * Bump the parser until the pattern character is found and return `true`.
2122
+ * Otherwise bump to the end of the file and return `false`.
2123
+ */
2124
+ bumpUntil(e) {
2125
+ const t = this.offset(), i = this.message.indexOf(e, t);
2126
+ return i >= 0 ? (this.bumpTo(i), !0) : (this.bumpTo(this.message.length), !1);
2127
+ }
2128
+ /**
2129
+ * Bump the parser to the target offset.
2130
+ * If target offset is beyond the end of the input, bump the parser to the end of the input.
2131
+ */
2132
+ bumpTo(e) {
2133
+ if (this.offset() > e) throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);
2134
+ for (e = Math.min(e, this.message.length); ; ) {
2135
+ const t = this.offset();
2136
+ if (t === e) break;
2137
+ if (t > e) throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);
2138
+ if (this.bump(), this.isEOF()) break;
2139
+ }
2140
+ }
2141
+ /** advance the parser through all whitespace to the next non-whitespace code unit. */
2142
+ bumpSpace() {
2143
+ for (; !this.isEOF() && Ie(this.char()); ) this.bump();
2144
+ }
2145
+ /**
2146
+ * Peek at the *next* Unicode codepoint in the input without advancing the parser.
2147
+ * If the input has been exhausted, then this returns null.
2148
+ */
2149
+ peek() {
2150
+ if (this.isEOF()) return null;
2151
+ const e = this.char(), t = this.offset();
2152
+ return this.message.charCodeAt(t + (e >= 65536 ? 2 : 1)) ?? null;
2153
+ }
2154
+ };
2155
+ function R(e) {
2156
+ return e >= 97 && e <= 122 || e >= 65 && e <= 90;
2157
+ }
2158
+ function Ne(e) {
2159
+ return R(e) || e === 47;
2160
+ }
2161
+ function Pe(e) {
2162
+ 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;
2163
+ }
2164
+ function Ie(e) {
2165
+ return e >= 9 && e <= 13 || e === 32 || e === 133 || e >= 8206 && e <= 8207 || e === 8232 || e === 8233;
2166
+ }
2167
+ function C(e) {
2168
+ e.forEach((t) => {
2169
+ if (delete t.location, z(t) || Q(t)) for (const i in t.options)
2170
+ delete t.options[i].location, C(t.options[i].value);
2171
+ else Z(t) && q(t.style) || ($(t) || j(t)) && I(t.style) ? delete t.style.location : J(t) && C(t.children);
2172
+ });
2173
+ }
2174
+ function Re(e, t = {}) {
2175
+ t = {
2176
+ shouldParseSkeletons: !0,
2177
+ requiresOtherClause: !0,
2178
+ ...t
2179
+ };
2180
+ const i = new de(e, t).parse();
2181
+ if (i.err) {
2182
+ const n = SyntaxError(f[i.err.kind]);
2183
+ throw n.location = i.err.location, n.originalMessage = i.err.message, n;
2184
+ }
2185
+ return t?.captureLocation || C(i.val), i.val;
2186
+ }
2187
+ let S = /* @__PURE__ */ (function(e) {
2188
+ return e.MISSING_VALUE = "MISSING_VALUE", e.INVALID_VALUE = "INVALID_VALUE", e.MISSING_INTL_API = "MISSING_INTL_API", e;
2189
+ })({});
2190
+ var L = class extends Error {
2191
+ constructor(e, t, i) {
2192
+ super(e), this.code = t, this.originalMessage = i;
2193
+ }
2194
+ toString() {
2195
+ return `[formatjs Error: ${this.code}] ${this.message}`;
2196
+ }
2197
+ }, v = class extends L {
2198
+ constructor(e, t, i, n) {
2199
+ super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(i).join('", "')}"`, S.INVALID_VALUE, n);
2200
+ }
2201
+ }, Ce = class extends L {
2202
+ constructor(e, t, i) {
2203
+ super(`Value for "${e}" must be of type ${t}`, S.INVALID_VALUE, i);
2204
+ }
2205
+ }, Me = class extends L {
2206
+ constructor(e, t) {
2207
+ super(`The intl string context variable "${e}" was not provided to the string "${t}"`, S.MISSING_VALUE, t);
2208
+ }
2209
+ };
2210
+ let g = /* @__PURE__ */ (function(e) {
2211
+ return e[e.literal = 0] = "literal", e[e.object = 1] = "object", e;
2212
+ })({});
2213
+ function Oe(e) {
2214
+ return e.length < 2 ? e : e.reduce((t, i) => {
2215
+ const n = t[t.length - 1];
2216
+ return !n || n.type !== g.literal || i.type !== g.literal ? t.push(i) : n.value += i.value, t;
2217
+ }, []);
2218
+ }
2219
+ function Ge(e) {
2220
+ return typeof e == "function";
2221
+ }
2222
+ function y(e, t, i, n, r, s, c) {
2223
+ if (e.length === 1 && U(e[0])) return [{
2224
+ type: g.literal,
2225
+ value: e[0].value
2226
+ }];
2227
+ const o = [];
2228
+ for (const h of e) {
2229
+ if (U(h)) {
2230
+ o.push({
2231
+ type: g.literal,
2232
+ value: h.value
2233
+ });
2234
+ continue;
2235
+ }
2236
+ if (Ee(h)) {
2237
+ typeof s == "number" && o.push({
2238
+ type: g.literal,
2239
+ value: i.getNumberFormat(t).format(s)
2240
+ });
2241
+ continue;
2242
+ }
2243
+ const { value: p } = h;
2244
+ if (!(r && p in r)) throw new Me(p, c);
2245
+ let a = r[p];
2246
+ if (me(h)) {
2247
+ (!a || typeof a == "string" || typeof a == "number" || typeof a == "bigint") && (a = typeof a == "string" || typeof a == "number" || typeof a == "bigint" ? String(a) : ""), o.push({
2248
+ type: typeof a == "string" ? g.literal : g.object,
2249
+ value: a
2250
+ });
2251
+ continue;
2252
+ }
2253
+ if ($(h)) {
2254
+ const u = typeof h.style == "string" ? n.date[h.style] : I(h.style) ? h.style.parsedOptions : void 0;
2255
+ o.push({
2256
+ type: g.literal,
2257
+ value: i.getDateTimeFormat(t, u).format(a)
2258
+ });
2259
+ continue;
2260
+ }
2261
+ if (j(h)) {
2262
+ const u = typeof h.style == "string" ? n.time[h.style] : I(h.style) ? h.style.parsedOptions : n.time.medium;
2263
+ o.push({
2264
+ type: g.literal,
2265
+ value: i.getDateTimeFormat(t, u).format(a)
2266
+ });
2267
+ continue;
2268
+ }
2269
+ if (Z(h)) {
2270
+ const u = typeof h.style == "string" ? n.number[h.style] : q(h.style) ? h.style.parsedOptions : void 0;
2271
+ if (u && u.scale) {
2272
+ const m = u.scale || 1;
2273
+ if (typeof a == "bigint") {
2274
+ if (!Number.isInteger(m)) throw new TypeError(`Cannot apply fractional scale ${m} to bigint value. Scale must be an integer when formatting bigint.`);
2275
+ a = a * BigInt(m);
2276
+ } else a = a * m;
2277
+ }
2278
+ o.push({
2279
+ type: g.literal,
2280
+ value: i.getNumberFormat(t, u).format(a)
2281
+ });
2282
+ continue;
2283
+ }
2284
+ if (J(h)) {
2285
+ const { children: u, value: m } = h, H = r[m];
2286
+ if (!Ge(H)) throw new Ce(m, "function", c);
2287
+ let T = H(y(u, t, i, n, r, s).map((B) => B.value));
2288
+ Array.isArray(T) || (T = [T]), o.push(...T.map((B) => ({
2289
+ type: typeof B == "string" ? g.literal : g.object,
2290
+ value: B
2291
+ })));
2292
+ }
2293
+ if (z(h)) {
2294
+ const u = a, m = (Object.prototype.hasOwnProperty.call(h.options, u) ? h.options[u] : void 0) || h.options.other;
2295
+ if (!m) throw new v(h.value, a, Object.keys(h.options), c);
2296
+ o.push(...y(m.value, t, i, n, r));
2297
+ continue;
2298
+ }
2299
+ if (Q(h)) {
2300
+ const u = `=${a}`;
2301
+ let m = Object.prototype.hasOwnProperty.call(h.options, u) ? h.options[u] : void 0;
2302
+ if (!m) {
2303
+ if (!Intl.PluralRules) throw new L(`Intl.PluralRules is not available in this environment.
2304
+ Try polyfilling it using "@formatjs/intl-pluralrules"
2305
+ `, S.MISSING_INTL_API, c);
2306
+ const T = typeof a == "bigint" ? Number(a) : a, B = i.getPluralRules(t, { type: h.pluralType }).select(T - (h.offset || 0));
2307
+ m = (Object.prototype.hasOwnProperty.call(h.options, B) ? h.options[B] : void 0) || h.options.other;
2308
+ }
2309
+ if (!m) throw new v(h.value, a, Object.keys(h.options), c);
2310
+ const H = typeof a == "bigint" ? Number(a) : a;
2311
+ o.push(...y(m.value, t, i, n, r, H - (h.offset || 0)));
2312
+ continue;
2313
+ }
2314
+ }
2315
+ return Oe(o);
2316
+ }
2317
+ function Ue(e, t) {
2318
+ return t ? {
2319
+ ...e,
2320
+ ...t,
2321
+ ...Object.keys(e).reduce((i, n) => (i[n] = {
2322
+ ...e[n],
2323
+ ...t[n]
2324
+ }, i), {})
2325
+ } : e;
2326
+ }
2327
+ function we(e, t) {
2328
+ return t ? Object.keys(e).reduce((i, n) => (i[n] = Ue(e[n], t[n]), i), { ...e }) : e;
2329
+ }
2330
+ function P(e) {
2331
+ return { create() {
2332
+ return {
2333
+ get(t) {
2334
+ return e[t];
2335
+ },
2336
+ set(t, i) {
2337
+ e[t] = i;
2338
+ }
2339
+ };
2340
+ } };
2341
+ }
2342
+ function De(e = {
2343
+ number: {},
2344
+ dateTime: {},
2345
+ pluralRules: {}
2346
+ }) {
2347
+ return {
2348
+ getNumberFormat: d((...t) => new Intl.NumberFormat(...t), {
2349
+ cache: P(e.number),
2350
+ strategy: N.variadic
2351
+ }),
2352
+ getDateTimeFormat: d((...t) => new Intl.DateTimeFormat(...t), {
2353
+ cache: P(e.dateTime),
2354
+ strategy: N.variadic
2355
+ }),
2356
+ getPluralRules: d((...t) => new Intl.PluralRules(...t), {
2357
+ cache: P(e.pluralRules),
2358
+ strategy: N.variadic
2359
+ })
2360
+ };
2361
+ }
2362
+ var b, ve = (b = class {
2363
+ constructor(t, i = b.defaultLocale, n, r) {
2364
+ if (this.formatterCache = {
2365
+ number: {},
2366
+ dateTime: {},
2367
+ pluralRules: {}
2368
+ }, this.format = (s) => {
2369
+ const c = this.formatToParts(s);
2370
+ if (c.length === 1) return c[0].value;
2371
+ const o = c.reduce((h, p) => (!h.length || p.type !== g.literal || typeof h[h.length - 1] != "string" ? h.push(p.value) : h[h.length - 1] += p.value, h), []);
2372
+ return o.length <= 1 ? o[0] || "" : o;
2373
+ }, this.formatToParts = (s) => y(this.ast, this.locales, this.formatters, this.formats, s, void 0, this.message), this.resolvedOptions = () => ({ locale: this.resolvedLocale?.toString() || Intl.NumberFormat.supportedLocalesOf(this.locales)[0] }), this.getAst = () => this.ast, this.locales = i, this.resolvedLocale = b.resolveLocale(i), typeof t == "string") {
2374
+ if (this.message = t, !b.__parse) throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
2375
+ const { ...s } = r || {};
2376
+ this.ast = b.__parse(t, {
2377
+ ...s,
2378
+ locale: this.resolvedLocale
2379
+ });
2380
+ } else this.ast = t;
2381
+ if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST.");
2382
+ this.formats = we(b.formats, n), this.formatters = r && r.formatters || De(this.formatterCache);
2383
+ }
2384
+ static get defaultLocale() {
2385
+ return b.memoizedDefaultLocale || (b.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale), b.memoizedDefaultLocale;
2386
+ }
2387
+ }, b.memoizedDefaultLocale = null, b.resolveLocale = (t) => {
2388
+ if (typeof Intl.Locale > "u") return;
2389
+ const i = Intl.NumberFormat.supportedLocalesOf(t);
2390
+ return i.length > 0 ? new Intl.Locale(i[0]) : new Intl.Locale(typeof t == "string" ? t : t[0]);
2391
+ }, b.__parse = Re, b.formats = {
2392
+ number: {
2393
+ integer: { maximumFractionDigits: 0 },
2394
+ currency: { style: "currency" },
2395
+ percent: { style: "percent" }
2396
+ },
2397
+ date: {
2398
+ short: {
2399
+ month: "numeric",
2400
+ day: "numeric",
2401
+ year: "2-digit"
2402
+ },
2403
+ medium: {
2404
+ month: "short",
2405
+ day: "numeric",
2406
+ year: "numeric"
2407
+ },
2408
+ long: {
2409
+ month: "long",
2410
+ day: "numeric",
2411
+ year: "numeric"
2412
+ },
2413
+ full: {
2414
+ weekday: "long",
2415
+ month: "long",
2416
+ day: "numeric",
2417
+ year: "numeric"
2418
+ }
2419
+ },
2420
+ time: {
2421
+ short: {
2422
+ hour: "numeric",
2423
+ minute: "numeric"
2424
+ },
2425
+ medium: {
2426
+ hour: "numeric",
2427
+ minute: "numeric",
2428
+ second: "numeric"
2429
+ },
2430
+ long: {
2431
+ hour: "numeric",
2432
+ minute: "numeric",
2433
+ second: "numeric",
2434
+ timeZoneName: "short"
2435
+ },
2436
+ full: {
2437
+ hour: "numeric",
2438
+ minute: "numeric",
2439
+ second: "numeric",
2440
+ timeZoneName: "short"
2441
+ }
2442
+ }
2443
+ }, b), Fe = ve;
2444
+ const F = /* @__PURE__ */ new Map(), ke = (e, t) => {
2445
+ const i = `${t}:${e}`, n = F.get(i);
2446
+ if (n)
2447
+ return n;
2448
+ const r = new Fe(e, t);
2449
+ return F.set(i, r), r;
2450
+ }, Ve = (e, t, i, n = {}) => {
2451
+ const r = t[e];
2452
+ try {
2453
+ return ke(r, i).format(n);
2454
+ } catch {
2455
+ return r;
2456
+ }
2457
+ }, Xe = (e, t) => (i, n) => Ve(i, e, t, n);
2458
+ export {
2459
+ Xe as t
2460
+ };