@flickfyi/flkr 0.0.140 → 0.0.146

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 (494) hide show
  1. package/node_modules/@flickfyi/attestation/.turbo/turbo-build.log +7 -7
  2. package/node_modules/@flickfyi/biscuit/.turbo/turbo-build.log +7 -7
  3. package/node_modules/@flickfyi/core/.oxlintrc.json +2 -1
  4. package/node_modules/@flickfyi/core/.turbo/turbo-build.log +502 -95
  5. package/node_modules/@flickfyi/core/README.md +58 -4
  6. package/node_modules/@flickfyi/core/dist/index.cjs +1 -1
  7. package/node_modules/@flickfyi/core/dist/index.js +35 -24
  8. package/node_modules/@flickfyi/core/dist/kowalski/calculations.d.ts +17 -0
  9. package/node_modules/@flickfyi/core/dist/kowalski/calculator.d.ts +13 -0
  10. package/node_modules/@flickfyi/core/dist/kowalski/catalog.cjs +1 -0
  11. package/node_modules/@flickfyi/core/dist/kowalski/catalog.d.cts +962 -0
  12. package/node_modules/@flickfyi/core/dist/kowalski/catalog.d.ts +962 -0
  13. package/node_modules/@flickfyi/core/dist/kowalski/catalog.js +639 -0
  14. package/node_modules/@flickfyi/core/dist/kowalski/clocks.d.ts +4 -0
  15. package/node_modules/@flickfyi/core/dist/kowalski/date-time.d.ts +22 -0
  16. package/node_modules/@flickfyi/core/dist/kowalski/details.d.ts +7 -0
  17. package/node_modules/@flickfyi/core/dist/kowalski/everyday.d.ts +8 -0
  18. package/node_modules/@flickfyi/core/dist/kowalski/format.d.ts +4 -0
  19. package/node_modules/@flickfyi/core/dist/kowalski/frame.d.ts +161 -0
  20. package/node_modules/@flickfyi/core/dist/kowalski/index.cjs +21 -0
  21. package/node_modules/@flickfyi/core/dist/kowalski/index.d.cts +8 -0
  22. package/node_modules/@flickfyi/core/dist/kowalski/index.d.ts +8 -0
  23. package/node_modules/@flickfyi/core/dist/kowalski/index.js +7496 -0
  24. package/node_modules/@flickfyi/core/dist/kowalski/productivity.d.ts +5 -0
  25. package/node_modules/@flickfyi/core/dist/kowalski/recipe.d.ts +8 -0
  26. package/node_modules/@flickfyi/core/dist/kowalski/tools.d.ts +7 -0
  27. package/node_modules/@flickfyi/core/dist/kowalski/use-clock.d.ts +6 -0
  28. package/node_modules/@flickfyi/core/dist/kowalski/use-configured-feature.d.ts +19 -0
  29. package/node_modules/@flickfyi/core/dist/kowalski/use-feature-store.d.ts +15 -0
  30. package/node_modules/@flickfyi/core/dist/kowalski.css +506 -0
  31. package/node_modules/@flickfyi/core/dist/molecules/field/field.d.ts +8 -0
  32. package/node_modules/@flickfyi/core/dist/molecules/index.cjs +1 -1
  33. package/node_modules/@flickfyi/core/dist/molecules/index.d.cts +3 -0
  34. package/node_modules/@flickfyi/core/dist/molecules/index.d.ts +3 -0
  35. package/node_modules/@flickfyi/core/dist/molecules/index.js +88 -27
  36. package/node_modules/@flickfyi/core/dist/molecules/segmented/segmented.d.ts +10 -0
  37. package/node_modules/@flickfyi/core/dist/molecules/stepper/stepper.d.ts +10 -0
  38. package/node_modules/@flickfyi/core/dist/quantum/use-store.d.ts +7 -1
  39. package/node_modules/@flickfyi/core/dist/themes.css +2 -0
  40. package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.stories.tsx +15 -0
  41. package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.tsx +17 -0
  42. package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.stories.tsx +15 -0
  43. package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.tsx +23 -0
  44. package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.stories.tsx +15 -0
  45. package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.tsx +26 -0
  46. package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.stories.tsx +15 -0
  47. package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.tsx +24 -0
  48. package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.stories.tsx +15 -0
  49. package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.tsx +26 -0
  50. package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.stories.tsx +15 -0
  51. package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.tsx +22 -0
  52. package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.stories.tsx +15 -0
  53. package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.tsx +23 -0
  54. package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.stories.tsx +15 -0
  55. package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.tsx +23 -0
  56. package/node_modules/@flickfyi/core/examples/kowalski/event/event.stories.tsx +15 -0
  57. package/node_modules/@flickfyi/core/examples/kowalski/event/event.tsx +24 -0
  58. package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.stories.tsx +15 -0
  59. package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.tsx +23 -0
  60. package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.stories.tsx +15 -0
  61. package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.tsx +24 -0
  62. package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.stories.tsx +15 -0
  63. package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.tsx +23 -0
  64. package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.stories.tsx +15 -0
  65. package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.tsx +25 -0
  66. package/node_modules/@flickfyi/core/examples/kowalski/note/note.stories.tsx +15 -0
  67. package/node_modules/@flickfyi/core/examples/kowalski/note/note.tsx +22 -0
  68. package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.stories.tsx +15 -0
  69. package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.tsx +26 -0
  70. package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.stories.tsx +15 -0
  71. package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.tsx +23 -0
  72. package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.stories.tsx +15 -0
  73. package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.tsx +19 -0
  74. package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.stories.tsx +15 -0
  75. package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.tsx +120 -0
  76. package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.stories.tsx +15 -0
  77. package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.tsx +23 -0
  78. package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.stories.tsx +15 -0
  79. package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.tsx +27 -0
  80. package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.stories.tsx +15 -0
  81. package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.tsx +26 -0
  82. package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.stories.tsx +15 -0
  83. package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.tsx +27 -0
  84. package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.stories.tsx +15 -0
  85. package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.tsx +27 -0
  86. package/node_modules/@flickfyi/core/examples/kowalski/theme.ts +3 -0
  87. package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.stories.tsx +15 -0
  88. package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.tsx +22 -0
  89. package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.stories.tsx +15 -0
  90. package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.tsx +23 -0
  91. package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.stories.tsx +15 -0
  92. package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.tsx +26 -0
  93. package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.stories.tsx +15 -0
  94. package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.tsx +24 -0
  95. package/node_modules/@flickfyi/core/examples/parrott/calculator/calculator.stories.tsx +3 -1
  96. package/node_modules/@flickfyi/core/examples/parrott/checklist/checklist.stories.tsx +3 -1
  97. package/node_modules/@flickfyi/core/examples/parrott/countdown/countdown.stories.tsx +3 -1
  98. package/node_modules/@flickfyi/core/examples/parrott/counter/counter.stories.tsx +1 -0
  99. package/node_modules/@flickfyi/core/examples/parrott/fortune/fortune.stories.tsx +3 -1
  100. package/node_modules/@flickfyi/core/examples/parrott/grid/grid.stories.tsx +3 -1
  101. package/node_modules/@flickfyi/core/examples/parrott/kale-smoothie/kale-smoothie.stories.tsx +1 -0
  102. package/node_modules/@flickfyi/core/examples/parrott/list/list.stories.tsx +3 -1
  103. package/node_modules/@flickfyi/core/examples/parrott/log/log.stories.tsx +3 -1
  104. package/node_modules/@flickfyi/core/examples/parrott/timed-task/timed-task.stories.tsx +3 -1
  105. package/node_modules/@flickfyi/core/examples/parrott/timer/timer.stories.tsx +3 -1
  106. package/node_modules/@flickfyi/core/fixtures/native/host/project.yml +3 -0
  107. package/node_modules/@flickfyi/core/fixtures/native/src/catalog-features.tsx +88 -0
  108. package/node_modules/@flickfyi/core/package.json +35 -5
  109. package/node_modules/@flickfyi/core/package.tsgo.json +19 -1
  110. package/node_modules/@flickfyi/core/scripts/vite-globals.d.ts +2 -0
  111. package/node_modules/@flickfyi/core/src/generated-types.d.ts +1 -0
  112. package/node_modules/@flickfyi/core/src/kowalski/README.md +9 -0
  113. package/node_modules/@flickfyi/core/src/kowalski/calculations.ts +106 -0
  114. package/node_modules/@flickfyi/core/src/kowalski/calculator.ts +243 -0
  115. package/node_modules/@flickfyi/core/src/kowalski/catalog.ts +787 -0
  116. package/node_modules/@flickfyi/core/src/kowalski/clocks.tsx +464 -0
  117. package/node_modules/@flickfyi/core/src/kowalski/date-time.tsx +469 -0
  118. package/node_modules/@flickfyi/core/src/kowalski/details.tsx +1387 -0
  119. package/node_modules/@flickfyi/core/src/kowalski/everyday.tsx +652 -0
  120. package/node_modules/@flickfyi/core/src/kowalski/format.ts +48 -0
  121. package/node_modules/@flickfyi/core/src/kowalski/frame.tsx +351 -0
  122. package/node_modules/@flickfyi/core/src/kowalski/index.ts +23 -0
  123. package/node_modules/@flickfyi/core/src/kowalski/productivity.tsx +575 -0
  124. package/node_modules/@flickfyi/core/src/kowalski/recipe.tsx +555 -0
  125. package/node_modules/@flickfyi/core/src/kowalski/stories/composition.stories.tsx +47 -0
  126. package/node_modules/@flickfyi/core/src/kowalski/stories/composition.tsx +100 -0
  127. package/node_modules/@flickfyi/core/src/kowalski/tools.tsx +1213 -0
  128. package/node_modules/@flickfyi/core/src/kowalski/use-clock.ts +19 -0
  129. package/node_modules/@flickfyi/core/src/kowalski/use-configured-feature.ts +85 -0
  130. package/node_modules/@flickfyi/core/src/kowalski/use-feature-store.ts +119 -0
  131. package/node_modules/@flickfyi/core/src/molecules/field/field.tsx +34 -0
  132. package/node_modules/@flickfyi/core/src/molecules/index.ts +3 -0
  133. package/node_modules/@flickfyi/core/src/molecules/segmented/segmented.tsx +48 -0
  134. package/node_modules/@flickfyi/core/src/molecules/stepper/stepper.tsx +54 -0
  135. package/node_modules/@flickfyi/core/src/quantum/use-store.ts +41 -16
  136. package/node_modules/@flickfyi/core/tests/fly.test.ts +34 -7
  137. package/node_modules/@flickfyi/core/tests/kowalski-calculations.test.ts +60 -0
  138. package/node_modules/@flickfyi/core/tests/kowalski-calculator.test.ts +142 -0
  139. package/node_modules/@flickfyi/core/tests/kowalski-contracts.test.ts +223 -0
  140. package/node_modules/@flickfyi/core/tests/kowalski-date-time.test.tsx +462 -0
  141. package/node_modules/@flickfyi/core/tests/kowalski-features.test.tsx +2158 -0
  142. package/node_modules/@flickfyi/core/tests/kowalski-store.test.tsx +514 -0
  143. package/node_modules/@flickfyi/core/tests/preview-build.test.ts +1 -1
  144. package/node_modules/@flickfyi/core/tests/quantum-use-store.test.ts +53 -1
  145. package/node_modules/@flickfyi/core/tests/verify-tsgo-assets.test.ts +1 -1
  146. package/node_modules/@flickfyi/core/tsconfig.vite-dts.json +2 -1
  147. package/node_modules/@flickfyi/core/tsgo.bun.lock +111 -9
  148. package/node_modules/@flickfyi/core/tsgo.package.json +21 -3
  149. package/node_modules/@flickfyi/core/vite.config.ts +9 -5
  150. package/node_modules/@flickfyi/core/vitest.config.ts +1 -1
  151. package/node_modules/@flickfyi/http-message-sig/.turbo/turbo-build.log +7 -7
  152. package/node_modules/@flickfyi/identity/.turbo/turbo-build.log +8 -9
  153. package/node_modules/@flickfyi/lens/.turbo/turbo-build.log +7 -7
  154. package/node_modules/@flickfyi/photon/.turbo/turbo-build.log +9 -9
  155. package/node_modules/@flickfyi/photon/Sources/Photon/Components/Button.swift +29 -2
  156. package/node_modules/@flickfyi/photon/Sources/PhotonVersion/Resources/photon-version.json +1 -1
  157. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Components/ButtonHostTests.swift +26 -0
  158. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-features.styles.json +1 -0
  159. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-native.styles.json +1 -1
  160. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-scale.styles.json +1 -1
  161. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-theme.styles.json +1 -1
  162. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-typography.styles.json +1 -1
  163. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/stylex-calculator.styles.json +1 -1
  164. package/node_modules/@flickfyi/photon/dist/globals.d.ts +5 -0
  165. package/node_modules/@flickfyi/photon/dist/version.cjs +1 -1
  166. package/node_modules/@flickfyi/photon/dist/version.js +1 -1
  167. package/node_modules/@flickfyi/photon/generated/react-swiftui.d.ts +1 -0
  168. package/node_modules/@flickfyi/photon/package.json +1 -1
  169. package/node_modules/@flickfyi/photon/src/globals.d.ts +5 -0
  170. package/node_modules/@flickfyi/rwsdk-extensions/.turbo/turbo-build.log +7 -7
  171. package/node_modules/@formatjs/fast-memoize/LICENSE.md +9 -0
  172. package/node_modules/@formatjs/fast-memoize/README.md +3 -0
  173. package/node_modules/@formatjs/fast-memoize/index.d.ts +35 -0
  174. package/node_modules/@formatjs/fast-memoize/index.js +69 -0
  175. package/node_modules/@formatjs/fast-memoize/index.js.map +1 -0
  176. package/node_modules/@formatjs/fast-memoize/package.json +25 -0
  177. package/node_modules/@formatjs/icu-messageformat-parser/LICENSE.md +9 -0
  178. package/node_modules/@formatjs/icu-messageformat-parser/README.md +38 -0
  179. package/node_modules/@formatjs/icu-messageformat-parser/index.d.ts +393 -0
  180. package/node_modules/@formatjs/icu-messageformat-parser/index.js +2187 -0
  181. package/node_modules/@formatjs/icu-messageformat-parser/index.js.map +1 -0
  182. package/node_modules/@formatjs/icu-messageformat-parser/manipulator.d.ts +175 -0
  183. package/node_modules/@formatjs/icu-messageformat-parser/manipulator.js +209 -0
  184. package/node_modules/@formatjs/icu-messageformat-parser/manipulator.js.map +1 -0
  185. package/node_modules/@formatjs/icu-messageformat-parser/no-parser.d.ts +183 -0
  186. package/node_modules/@formatjs/icu-messageformat-parser/no-parser.js +162 -0
  187. package/node_modules/@formatjs/icu-messageformat-parser/no-parser.js.map +1 -0
  188. package/node_modules/@formatjs/icu-messageformat-parser/package.json +21 -0
  189. package/node_modules/@formatjs/icu-messageformat-parser/printer.d.ts +154 -0
  190. package/node_modules/@formatjs/icu-messageformat-parser/printer.js +224 -0
  191. package/node_modules/@formatjs/icu-messageformat-parser/printer.js.map +1 -0
  192. package/node_modules/@formatjs/icu-skeleton-parser/LICENSE.md +9 -0
  193. package/node_modules/@formatjs/icu-skeleton-parser/README.md +1 -0
  194. package/node_modules/@formatjs/icu-skeleton-parser/index.d.ts +67 -0
  195. package/node_modules/@formatjs/icu-skeleton-parser/index.js +380 -0
  196. package/node_modules/@formatjs/icu-skeleton-parser/index.js.map +1 -0
  197. package/node_modules/@formatjs/icu-skeleton-parser/package.json +15 -0
  198. package/node_modules/@formatjs/intl/LICENSE.md +9 -0
  199. package/node_modules/@formatjs/intl/README.md +3 -0
  200. package/node_modules/@formatjs/intl/index.d.ts +499 -0
  201. package/node_modules/@formatjs/intl/index.js +595 -0
  202. package/node_modules/@formatjs/intl/index.js.map +1 -0
  203. package/node_modules/@formatjs/intl/package.json +37 -0
  204. package/node_modules/decimal.js/LICENCE.md +23 -0
  205. package/node_modules/decimal.js/README.md +246 -0
  206. package/node_modules/decimal.js/decimal.d.ts +301 -0
  207. package/node_modules/decimal.js/decimal.js +4951 -0
  208. package/node_modules/decimal.js/decimal.mjs +4914 -0
  209. package/node_modules/decimal.js/package.json +55 -0
  210. package/node_modules/format-quantity/LICENSE +21 -0
  211. package/node_modules/format-quantity/README.md +181 -0
  212. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.d.ts +131 -0
  213. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.js +214 -0
  214. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.js.map +1 -0
  215. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.d.ts +131 -0
  216. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.js +2 -0
  217. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.js.map +1 -0
  218. package/node_modules/format-quantity/dist/cjs/index.d.ts +1 -0
  219. package/node_modules/format-quantity/dist/cjs/index.js +6 -0
  220. package/node_modules/format-quantity/dist/format-quantity.d.mts +131 -0
  221. package/node_modules/format-quantity/dist/format-quantity.legacy-esm.d.ts +131 -0
  222. package/node_modules/format-quantity/dist/format-quantity.legacy-esm.js +268 -0
  223. package/node_modules/format-quantity/dist/format-quantity.legacy-esm.js.map +1 -0
  224. package/node_modules/format-quantity/dist/format-quantity.mjs +208 -0
  225. package/node_modules/format-quantity/dist/format-quantity.mjs.map +1 -0
  226. package/node_modules/format-quantity/dist/format-quantity.production.d.mts +131 -0
  227. package/node_modules/format-quantity/dist/format-quantity.production.mjs +2 -0
  228. package/node_modules/format-quantity/dist/format-quantity.production.mjs.map +1 -0
  229. package/node_modules/format-quantity/dist/format-quantity.umd.min.js +3 -0
  230. package/node_modules/format-quantity/dist/format-quantity.umd.min.js.map +1 -0
  231. package/node_modules/format-quantity/package.json +81 -0
  232. package/node_modules/intl-messageformat/LICENSE.md +33 -0
  233. package/node_modules/intl-messageformat/README.md +3 -0
  234. package/node_modules/intl-messageformat/index.d.ts +177 -0
  235. package/node_modules/intl-messageformat/index.js +327 -0
  236. package/node_modules/intl-messageformat/index.js.map +1 -0
  237. package/node_modules/intl-messageformat/intl-messageformat.iife.js +2819 -0
  238. package/node_modules/intl-messageformat/package.json +40 -0
  239. package/node_modules/numeric-quantity/LICENSE +21 -0
  240. package/node_modules/numeric-quantity/README.md +306 -0
  241. package/node_modules/numeric-quantity/dist/cjs/index.d.ts +1 -0
  242. package/node_modules/numeric-quantity/dist/cjs/index.js +6 -0
  243. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.d.ts +293 -0
  244. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.js +579 -0
  245. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.js.map +1 -0
  246. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.d.ts +293 -0
  247. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.js +2 -0
  248. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.js.map +1 -0
  249. package/node_modules/numeric-quantity/dist/numeric-quantity.d.mts +293 -0
  250. package/node_modules/numeric-quantity/dist/numeric-quantity.iife.umd.min.js +2 -0
  251. package/node_modules/numeric-quantity/dist/numeric-quantity.iife.umd.min.js.map +1 -0
  252. package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.d.ts +293 -0
  253. package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.js +622 -0
  254. package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.js.map +1 -0
  255. package/node_modules/numeric-quantity/dist/numeric-quantity.mjs +564 -0
  256. package/node_modules/numeric-quantity/dist/numeric-quantity.mjs.map +1 -0
  257. package/node_modules/numeric-quantity/dist/numeric-quantity.production.d.mts +293 -0
  258. package/node_modules/numeric-quantity/dist/numeric-quantity.production.mjs +2 -0
  259. package/node_modules/numeric-quantity/dist/numeric-quantity.production.mjs.map +1 -0
  260. package/node_modules/numeric-quantity/package.json +72 -0
  261. package/node_modules/validator/LICENSE +20 -0
  262. package/node_modules/validator/README.md +269 -0
  263. package/node_modules/validator/es/index.js +218 -0
  264. package/node_modules/validator/es/lib/alpha.js +151 -0
  265. package/node_modules/validator/es/lib/blacklist.js +5 -0
  266. package/node_modules/validator/es/lib/contains.js +15 -0
  267. package/node_modules/validator/es/lib/equals.js +5 -0
  268. package/node_modules/validator/es/lib/escape.js +5 -0
  269. package/node_modules/validator/es/lib/isAbaRouting.js +15 -0
  270. package/node_modules/validator/es/lib/isAfter.js +10 -0
  271. package/node_modules/validator/es/lib/isAlpha.js +23 -0
  272. package/node_modules/validator/es/lib/isAlphanumeric.js +23 -0
  273. package/node_modules/validator/es/lib/isAscii.js +10 -0
  274. package/node_modules/validator/es/lib/isBIC.js +16 -0
  275. package/node_modules/validator/es/lib/isBase32.js +15 -0
  276. package/node_modules/validator/es/lib/isBase58.js +8 -0
  277. package/node_modules/validator/es/lib/isBase64.js +23 -0
  278. package/node_modules/validator/es/lib/isBefore.js +10 -0
  279. package/node_modules/validator/es/lib/isBoolean.js +15 -0
  280. package/node_modules/validator/es/lib/isBtcAddress.js +7 -0
  281. package/node_modules/validator/es/lib/isByteLength.js +19 -0
  282. package/node_modules/validator/es/lib/isCreditCard.js +43 -0
  283. package/node_modules/validator/es/lib/isCurrency.js +74 -0
  284. package/node_modules/validator/es/lib/isDataURI.js +31 -0
  285. package/node_modules/validator/es/lib/isDate.js +93 -0
  286. package/node_modules/validator/es/lib/isDecimal.js +22 -0
  287. package/node_modules/validator/es/lib/isDivisibleBy.js +6 -0
  288. package/node_modules/validator/es/lib/isEAN.js +70 -0
  289. package/node_modules/validator/es/lib/isEmail.js +165 -0
  290. package/node_modules/validator/es/lib/isEmpty.js +10 -0
  291. package/node_modules/validator/es/lib/isEthereumAddress.js +6 -0
  292. package/node_modules/validator/es/lib/isFQDN.js +67 -0
  293. package/node_modules/validator/es/lib/isFloat.js +14 -0
  294. package/node_modules/validator/es/lib/isFullWidth.js +6 -0
  295. package/node_modules/validator/es/lib/isHSL.js +13 -0
  296. package/node_modules/validator/es/lib/isHalfWidth.js +6 -0
  297. package/node_modules/validator/es/lib/isHash.js +21 -0
  298. package/node_modules/validator/es/lib/isHexColor.js +13 -0
  299. package/node_modules/validator/es/lib/isHexadecimal.js +6 -0
  300. package/node_modules/validator/es/lib/isIBAN.js +171 -0
  301. package/node_modules/validator/es/lib/isIMEI.js +40 -0
  302. package/node_modules/validator/es/lib/isIP.js +58 -0
  303. package/node_modules/validator/es/lib/isIPRange.js +41 -0
  304. package/node_modules/validator/es/lib/isISBN.js +47 -0
  305. package/node_modules/validator/es/lib/isISIN.js +55 -0
  306. package/node_modules/validator/es/lib/isISO15924.js +9 -0
  307. package/node_modules/validator/es/lib/isISO31661Alpha2.js +21 -0
  308. package/node_modules/validator/es/lib/isISO31661Alpha3.js +20 -0
  309. package/node_modules/validator/es/lib/isISO31661Numeric.js +8 -0
  310. package/node_modules/validator/es/lib/isISO4217.js +9 -0
  311. package/node_modules/validator/es/lib/isISO6346.js +28 -0
  312. package/node_modules/validator/es/lib/isISO6391.js +6 -0
  313. package/node_modules/validator/es/lib/isISO8601.js +42 -0
  314. package/node_modules/validator/es/lib/isISRC.js +8 -0
  315. package/node_modules/validator/es/lib/isISSN.js +19 -0
  316. package/node_modules/validator/es/lib/isIdentityCard.js +407 -0
  317. package/node_modules/validator/es/lib/isIn.js +23 -0
  318. package/node_modules/validator/es/lib/isInt.js +19 -0
  319. package/node_modules/validator/es/lib/isJSON.js +26 -0
  320. package/node_modules/validator/es/lib/isJWT.js +15 -0
  321. package/node_modules/validator/es/lib/isLatLong.js +21 -0
  322. package/node_modules/validator/es/lib/isLength.js +27 -0
  323. package/node_modules/validator/es/lib/isLicensePlate.js +58 -0
  324. package/node_modules/validator/es/lib/isLocale.js +107 -0
  325. package/node_modules/validator/es/lib/isLowercase.js +5 -0
  326. package/node_modules/validator/es/lib/isLuhnNumber.js +25 -0
  327. package/node_modules/validator/es/lib/isMACAddress.js +36 -0
  328. package/node_modules/validator/es/lib/isMD5.js +6 -0
  329. package/node_modules/validator/es/lib/isMagnetURI.js +9 -0
  330. package/node_modules/validator/es/lib/isMailtoURI.js +75 -0
  331. package/node_modules/validator/es/lib/isMimeType.js +40 -0
  332. package/node_modules/validator/es/lib/isMobilePhone.js +212 -0
  333. package/node_modules/validator/es/lib/isMongoId.js +6 -0
  334. package/node_modules/validator/es/lib/isMultibyte.js +10 -0
  335. package/node_modules/validator/es/lib/isNumeric.js +10 -0
  336. package/node_modules/validator/es/lib/isOctal.js +6 -0
  337. package/node_modules/validator/es/lib/isPassportNumber.js +145 -0
  338. package/node_modules/validator/es/lib/isPort.js +8 -0
  339. package/node_modules/validator/es/lib/isPostalCode.js +100 -0
  340. package/node_modules/validator/es/lib/isRFC3339.js +21 -0
  341. package/node_modules/validator/es/lib/isRgbColor.js +34 -0
  342. package/node_modules/validator/es/lib/isSemVer.js +14 -0
  343. package/node_modules/validator/es/lib/isSlug.js +6 -0
  344. package/node_modules/validator/es/lib/isStrongPassword.js +90 -0
  345. package/node_modules/validator/es/lib/isSurrogatePair.js +6 -0
  346. package/node_modules/validator/es/lib/isTaxID.js +1407 -0
  347. package/node_modules/validator/es/lib/isTime.js +22 -0
  348. package/node_modules/validator/es/lib/isULID.js +5 -0
  349. package/node_modules/validator/es/lib/isURL.js +241 -0
  350. package/node_modules/validator/es/lib/isUUID.js +23 -0
  351. package/node_modules/validator/es/lib/isUppercase.js +5 -0
  352. package/node_modules/validator/es/lib/isVAT.js +264 -0
  353. package/node_modules/validator/es/lib/isVariableWidth.js +7 -0
  354. package/node_modules/validator/es/lib/isWhitelisted.js +10 -0
  355. package/node_modules/validator/es/lib/ltrim.js +7 -0
  356. package/node_modules/validator/es/lib/matches.js +8 -0
  357. package/node_modules/validator/es/lib/normalizeEmail.js +131 -0
  358. package/node_modules/validator/es/lib/rtrim.js +15 -0
  359. package/node_modules/validator/es/lib/stripLow.js +7 -0
  360. package/node_modules/validator/es/lib/toBoolean.js +8 -0
  361. package/node_modules/validator/es/lib/toDate.js +6 -0
  362. package/node_modules/validator/es/lib/toFloat.js +5 -0
  363. package/node_modules/validator/es/lib/toInt.js +5 -0
  364. package/node_modules/validator/es/lib/trim.js +5 -0
  365. package/node_modules/validator/es/lib/unescape.js +8 -0
  366. package/node_modules/validator/es/lib/util/algorithms.js +79 -0
  367. package/node_modules/validator/es/lib/util/assertString.js +4 -0
  368. package/node_modules/validator/es/lib/util/checkHost.js +12 -0
  369. package/node_modules/validator/es/lib/util/includesArray.js +6 -0
  370. package/node_modules/validator/es/lib/util/includesString.js +4 -0
  371. package/node_modules/validator/es/lib/util/merge.js +14 -0
  372. package/node_modules/validator/es/lib/util/multilineRegex.js +12 -0
  373. package/node_modules/validator/es/lib/util/nullUndefinedCheck.js +3 -0
  374. package/node_modules/validator/es/lib/util/toString.js +13 -0
  375. package/node_modules/validator/es/lib/util/typeOf.js +10 -0
  376. package/node_modules/validator/es/lib/whitelist.js +5 -0
  377. package/node_modules/validator/index.js +229 -0
  378. package/node_modules/validator/lib/alpha.js +157 -0
  379. package/node_modules/validator/lib/blacklist.js +14 -0
  380. package/node_modules/validator/lib/contains.js +24 -0
  381. package/node_modules/validator/lib/equals.js +14 -0
  382. package/node_modules/validator/lib/escape.js +14 -0
  383. package/node_modules/validator/lib/isAbaRouting.js +23 -0
  384. package/node_modules/validator/lib/isAfter.js +19 -0
  385. package/node_modules/validator/lib/isAlpha.js +31 -0
  386. package/node_modules/validator/lib/isAlphanumeric.js +31 -0
  387. package/node_modules/validator/lib/isAscii.js +18 -0
  388. package/node_modules/validator/lib/isBIC.js +24 -0
  389. package/node_modules/validator/lib/isBase32.js +24 -0
  390. package/node_modules/validator/lib/isBase58.js +16 -0
  391. package/node_modules/validator/lib/isBase64.js +32 -0
  392. package/node_modules/validator/lib/isBefore.js +19 -0
  393. package/node_modules/validator/lib/isBoolean.js +24 -0
  394. package/node_modules/validator/lib/isBtcAddress.js +16 -0
  395. package/node_modules/validator/lib/isByteLength.js +27 -0
  396. package/node_modules/validator/lib/isCreditCard.js +52 -0
  397. package/node_modules/validator/lib/isCurrency.js +83 -0
  398. package/node_modules/validator/lib/isDataURI.js +40 -0
  399. package/node_modules/validator/lib/isDate.js +102 -0
  400. package/node_modules/validator/lib/isDecimal.js +31 -0
  401. package/node_modules/validator/lib/isDivisibleBy.js +15 -0
  402. package/node_modules/validator/lib/isEAN.js +78 -0
  403. package/node_modules/validator/lib/isEmail.js +174 -0
  404. package/node_modules/validator/lib/isEmpty.js +19 -0
  405. package/node_modules/validator/lib/isEthereumAddress.js +15 -0
  406. package/node_modules/validator/lib/isFQDN.js +76 -0
  407. package/node_modules/validator/lib/isFloat.js +22 -0
  408. package/node_modules/validator/lib/isFullWidth.js +14 -0
  409. package/node_modules/validator/lib/isHSL.js +22 -0
  410. package/node_modules/validator/lib/isHalfWidth.js +14 -0
  411. package/node_modules/validator/lib/isHash.js +30 -0
  412. package/node_modules/validator/lib/isHexColor.js +22 -0
  413. package/node_modules/validator/lib/isHexadecimal.js +15 -0
  414. package/node_modules/validator/lib/isIBAN.js +178 -0
  415. package/node_modules/validator/lib/isIMEI.js +49 -0
  416. package/node_modules/validator/lib/isIP.js +67 -0
  417. package/node_modules/validator/lib/isIPRange.js +50 -0
  418. package/node_modules/validator/lib/isISBN.js +56 -0
  419. package/node_modules/validator/lib/isISIN.js +64 -0
  420. package/node_modules/validator/lib/isISO15924.js +16 -0
  421. package/node_modules/validator/lib/isISO31661Alpha2.js +28 -0
  422. package/node_modules/validator/lib/isISO31661Alpha3.js +28 -0
  423. package/node_modules/validator/lib/isISO31661Numeric.js +16 -0
  424. package/node_modules/validator/lib/isISO4217.js +16 -0
  425. package/node_modules/validator/lib/isISO6346.js +35 -0
  426. package/node_modules/validator/lib/isISO6391.js +15 -0
  427. package/node_modules/validator/lib/isISO8601.js +50 -0
  428. package/node_modules/validator/lib/isISRC.js +16 -0
  429. package/node_modules/validator/lib/isISSN.js +28 -0
  430. package/node_modules/validator/lib/isIdentityCard.js +416 -0
  431. package/node_modules/validator/lib/isIn.js +32 -0
  432. package/node_modules/validator/lib/isInt.js +28 -0
  433. package/node_modules/validator/lib/isJSON.js +35 -0
  434. package/node_modules/validator/lib/isJWT.js +24 -0
  435. package/node_modules/validator/lib/isLatLong.js +30 -0
  436. package/node_modules/validator/lib/isLength.js +35 -0
  437. package/node_modules/validator/lib/isLicensePlate.js +67 -0
  438. package/node_modules/validator/lib/isLocale.js +115 -0
  439. package/node_modules/validator/lib/isLowercase.js +14 -0
  440. package/node_modules/validator/lib/isLuhnNumber.js +34 -0
  441. package/node_modules/validator/lib/isMACAddress.js +45 -0
  442. package/node_modules/validator/lib/isMD5.js +15 -0
  443. package/node_modules/validator/lib/isMagnetURI.js +18 -0
  444. package/node_modules/validator/lib/isMailtoURI.js +84 -0
  445. package/node_modules/validator/lib/isMimeType.js +48 -0
  446. package/node_modules/validator/lib/isMobilePhone.js +219 -0
  447. package/node_modules/validator/lib/isMongoId.js +15 -0
  448. package/node_modules/validator/lib/isMultibyte.js +18 -0
  449. package/node_modules/validator/lib/isNumeric.js +19 -0
  450. package/node_modules/validator/lib/isOctal.js +15 -0
  451. package/node_modules/validator/lib/isPassportNumber.js +152 -0
  452. package/node_modules/validator/lib/isPort.js +17 -0
  453. package/node_modules/validator/lib/isPostalCode.js +107 -0
  454. package/node_modules/validator/lib/isRFC3339.js +29 -0
  455. package/node_modules/validator/lib/isRgbColor.js +42 -0
  456. package/node_modules/validator/lib/isSemVer.js +22 -0
  457. package/node_modules/validator/lib/isSlug.js +15 -0
  458. package/node_modules/validator/lib/isStrongPassword.js +99 -0
  459. package/node_modules/validator/lib/isSurrogatePair.js +15 -0
  460. package/node_modules/validator/lib/isTaxID.js +1417 -0
  461. package/node_modules/validator/lib/isTime.js +31 -0
  462. package/node_modules/validator/lib/isULID.js +14 -0
  463. package/node_modules/validator/lib/isURL.js +249 -0
  464. package/node_modules/validator/lib/isUUID.js +32 -0
  465. package/node_modules/validator/lib/isUppercase.js +14 -0
  466. package/node_modules/validator/lib/isVAT.js +274 -0
  467. package/node_modules/validator/lib/isVariableWidth.js +16 -0
  468. package/node_modules/validator/lib/isWhitelisted.js +19 -0
  469. package/node_modules/validator/lib/ltrim.js +16 -0
  470. package/node_modules/validator/lib/matches.js +17 -0
  471. package/node_modules/validator/lib/normalizeEmail.js +140 -0
  472. package/node_modules/validator/lib/rtrim.js +24 -0
  473. package/node_modules/validator/lib/stripLow.js +16 -0
  474. package/node_modules/validator/lib/toBoolean.js +17 -0
  475. package/node_modules/validator/lib/toDate.js +15 -0
  476. package/node_modules/validator/lib/toFloat.js +14 -0
  477. package/node_modules/validator/lib/toInt.js +14 -0
  478. package/node_modules/validator/lib/trim.js +14 -0
  479. package/node_modules/validator/lib/unescape.js +17 -0
  480. package/node_modules/validator/lib/util/algorithms.js +88 -0
  481. package/node_modules/validator/lib/util/assertString.js +12 -0
  482. package/node_modules/validator/lib/util/checkHost.js +20 -0
  483. package/node_modules/validator/lib/util/includesArray.js +14 -0
  484. package/node_modules/validator/lib/util/includesString.js +12 -0
  485. package/node_modules/validator/lib/util/merge.js +22 -0
  486. package/node_modules/validator/lib/util/multilineRegex.js +20 -0
  487. package/node_modules/validator/lib/util/nullUndefinedCheck.js +11 -0
  488. package/node_modules/validator/lib/util/toString.js +21 -0
  489. package/node_modules/validator/lib/util/typeOf.js +18 -0
  490. package/node_modules/validator/lib/whitelist.js +14 -0
  491. package/node_modules/validator/package.json +76 -0
  492. package/node_modules/validator/validator.js +5808 -0
  493. package/node_modules/validator/validator.min.js +23 -0
  494. package/package.json +3 -3
@@ -0,0 +1,2819 @@
1
+ //#region node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/index.js
2
+ function memoize(fn, options) {
3
+ const cache = options && options.cache ? options.cache : cacheDefault;
4
+ const serializer = options && options.serializer ? options.serializer : serializerDefault;
5
+ return (options && options.strategy ? options.strategy : strategyDefault)(fn, {
6
+ cache,
7
+ serializer
8
+ });
9
+ }
10
+ function isPrimitive(value) {
11
+ return value == null || typeof value === "number" || typeof value === "boolean";
12
+ }
13
+ function monadic(fn, cache, serializer, arg) {
14
+ const cacheKey = isPrimitive(arg) ? arg : serializer(arg);
15
+ let computedValue = cache.get(cacheKey);
16
+ if (typeof computedValue === "undefined") {
17
+ computedValue = fn.call(this, arg);
18
+ cache.set(cacheKey, computedValue);
19
+ }
20
+ return computedValue;
21
+ }
22
+ function variadic(fn, cache, serializer) {
23
+ const args = Array.prototype.slice.call(arguments, 3);
24
+ const cacheKey = serializer(args);
25
+ let computedValue = cache.get(cacheKey);
26
+ if (typeof computedValue === "undefined") {
27
+ computedValue = fn.apply(this, args);
28
+ cache.set(cacheKey, computedValue);
29
+ }
30
+ return computedValue;
31
+ }
32
+ function assemble(fn, context, strategy, cache, serialize) {
33
+ return strategy.bind(context, fn, cache, serialize);
34
+ }
35
+ function strategyDefault(fn, options) {
36
+ const strategy = fn.length === 1 ? monadic : variadic;
37
+ return assemble(fn, this, strategy, options.cache.create(), options.serializer);
38
+ }
39
+ function strategyVariadic(fn, options) {
40
+ return assemble(fn, this, variadic, options.cache.create(), options.serializer);
41
+ }
42
+ function strategyMonadic(fn, options) {
43
+ return assemble(fn, this, monadic, options.cache.create(), options.serializer);
44
+ }
45
+ const serializerDefault = function() {
46
+ return JSON.stringify(arguments);
47
+ };
48
+ var ObjectWithoutPrototypeCache = class {
49
+ constructor() {
50
+ this.cache = Object.create(null);
51
+ }
52
+ get(key) {
53
+ return this.cache[key];
54
+ }
55
+ set(key, value) {
56
+ this.cache[key] = value;
57
+ }
58
+ };
59
+ const cacheDefault = { create: function create() {
60
+ return new ObjectWithoutPrototypeCache();
61
+ } };
62
+ const strategies = {
63
+ variadic: strategyVariadic,
64
+ monadic: strategyMonadic
65
+ };
66
+ //#endregion
67
+ //#region node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/index.js
68
+ /**
69
+ * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
70
+ * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js
71
+ * with some tweaks
72
+ */
73
+ const DATE_TIME_REGEX = /(?:[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;
74
+ /**
75
+ * Parse Date time skeleton into Intl.DateTimeFormatOptions
76
+ * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
77
+ * @public
78
+ * @param skeleton skeleton string
79
+ */
80
+ function parseDateTimeSkeleton(skeleton) {
81
+ const result = {};
82
+ skeleton.replace(DATE_TIME_REGEX, (match) => {
83
+ const len = match.length;
84
+ switch (match[0]) {
85
+ case "G":
86
+ result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short";
87
+ break;
88
+ case "y":
89
+ result.year = len === 2 ? "2-digit" : "numeric";
90
+ break;
91
+ case "Y":
92
+ case "u":
93
+ case "U":
94
+ case "r": throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
95
+ case "q":
96
+ case "Q": throw new RangeError("`q/Q` (quarter) patterns are not supported");
97
+ case "M":
98
+ case "L":
99
+ result.month = [
100
+ "numeric",
101
+ "2-digit",
102
+ "short",
103
+ "long",
104
+ "narrow"
105
+ ][len - 1];
106
+ break;
107
+ case "w":
108
+ case "W": throw new RangeError("`w/W` (week) patterns are not supported");
109
+ case "d":
110
+ result.day = ["numeric", "2-digit"][len - 1];
111
+ break;
112
+ case "D":
113
+ case "F":
114
+ case "g": throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
115
+ case "E":
116
+ result.weekday = len === 4 ? "long" : len === 5 ? "narrow" : "short";
117
+ break;
118
+ case "e":
119
+ if (len < 4) throw new RangeError("`e..eee` (weekday) patterns are not supported");
120
+ result.weekday = [
121
+ "short",
122
+ "long",
123
+ "narrow",
124
+ "short"
125
+ ][len - 3];
126
+ break;
127
+ case "c":
128
+ if (len < 4) throw new RangeError("`c..ccc` (weekday) patterns are not supported");
129
+ result.weekday = [
130
+ "short",
131
+ "long",
132
+ "narrow",
133
+ "short"
134
+ ][len - 3];
135
+ break;
136
+ case "a":
137
+ result.hour12 = true;
138
+ break;
139
+ case "b":
140
+ case "B": throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
141
+ case "h":
142
+ result.hourCycle = "h12";
143
+ result.hour = ["numeric", "2-digit"][len - 1];
144
+ break;
145
+ case "H":
146
+ result.hourCycle = "h23";
147
+ result.hour = ["numeric", "2-digit"][len - 1];
148
+ break;
149
+ case "K":
150
+ result.hourCycle = "h11";
151
+ result.hour = ["numeric", "2-digit"][len - 1];
152
+ break;
153
+ case "k":
154
+ result.hourCycle = "h24";
155
+ result.hour = ["numeric", "2-digit"][len - 1];
156
+ break;
157
+ case "j":
158
+ case "J":
159
+ case "C": throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
160
+ case "m":
161
+ result.minute = ["numeric", "2-digit"][len - 1];
162
+ break;
163
+ case "s":
164
+ result.second = ["numeric", "2-digit"][len - 1];
165
+ break;
166
+ case "S":
167
+ case "A": throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
168
+ case "z":
169
+ result.timeZoneName = len < 4 ? "short" : "long";
170
+ break;
171
+ case "Z":
172
+ case "O":
173
+ case "v":
174
+ case "V":
175
+ case "X":
176
+ case "x": throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
177
+ }
178
+ return "";
179
+ });
180
+ return result;
181
+ }
182
+ const WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
183
+ function parseNumberSkeletonFromString(skeleton) {
184
+ if (skeleton.length === 0) throw new Error("Number skeleton cannot be empty");
185
+ const stringTokens = skeleton.split(WHITE_SPACE_REGEX).filter((x) => x.length > 0);
186
+ const tokens = [];
187
+ for (const stringToken of stringTokens) {
188
+ let stemAndOptions = stringToken.split("/");
189
+ if (stemAndOptions.length === 0) throw new Error("Invalid number skeleton");
190
+ const [stem, ...options] = stemAndOptions;
191
+ for (const option of options) if (option.length === 0) throw new Error("Invalid number skeleton");
192
+ tokens.push({
193
+ stem,
194
+ options
195
+ });
196
+ }
197
+ return tokens;
198
+ }
199
+ function icuUnitToEcma(unit) {
200
+ return unit.replace(/^(.*?)-/, "");
201
+ }
202
+ const FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
203
+ const SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g;
204
+ const INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;
205
+ const CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;
206
+ function parseSignificantPrecision(str) {
207
+ const result = {};
208
+ if (str[str.length - 1] === "r") result.roundingPriority = "morePrecision";
209
+ else if (str[str.length - 1] === "s") result.roundingPriority = "lessPrecision";
210
+ str.replace(SIGNIFICANT_PRECISION_REGEX, function(_, g1, g2) {
211
+ if (typeof g2 !== "string") {
212
+ result.minimumSignificantDigits = g1.length;
213
+ result.maximumSignificantDigits = g1.length;
214
+ } else if (g2 === "+") result.minimumSignificantDigits = g1.length;
215
+ else if (g1[0] === "#") result.maximumSignificantDigits = g1.length;
216
+ else {
217
+ result.minimumSignificantDigits = g1.length;
218
+ result.maximumSignificantDigits = g1.length + (typeof g2 === "string" ? g2.length : 0);
219
+ }
220
+ return "";
221
+ });
222
+ return result;
223
+ }
224
+ function parseSign(str) {
225
+ switch (str) {
226
+ case "sign-auto": return { signDisplay: "auto" };
227
+ case "sign-accounting":
228
+ case "()": return { currencySign: "accounting" };
229
+ case "sign-always":
230
+ case "+!": return { signDisplay: "always" };
231
+ case "sign-accounting-always":
232
+ case "()!": return {
233
+ signDisplay: "always",
234
+ currencySign: "accounting"
235
+ };
236
+ case "sign-except-zero":
237
+ case "+?": return { signDisplay: "exceptZero" };
238
+ case "sign-accounting-except-zero":
239
+ case "()?": return {
240
+ signDisplay: "exceptZero",
241
+ currencySign: "accounting"
242
+ };
243
+ case "sign-never":
244
+ case "+_": return { signDisplay: "never" };
245
+ }
246
+ }
247
+ function parseConciseScientificAndEngineeringStem(stem) {
248
+ let result;
249
+ if (stem[0] === "E" && stem[1] === "E") {
250
+ result = { notation: "engineering" };
251
+ stem = stem.slice(2);
252
+ } else if (stem[0] === "E") {
253
+ result = { notation: "scientific" };
254
+ stem = stem.slice(1);
255
+ }
256
+ if (result) {
257
+ const signDisplay = stem.slice(0, 2);
258
+ if (signDisplay === "+!") {
259
+ result.signDisplay = "always";
260
+ stem = stem.slice(2);
261
+ } else if (signDisplay === "+?") {
262
+ result.signDisplay = "exceptZero";
263
+ stem = stem.slice(2);
264
+ }
265
+ if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) throw new Error("Malformed concise eng/scientific notation");
266
+ result.minimumIntegerDigits = stem.length;
267
+ }
268
+ return result;
269
+ }
270
+ function parseNotationOptions(opt) {
271
+ const result = {};
272
+ const signOpts = parseSign(opt);
273
+ if (signOpts) return signOpts;
274
+ return result;
275
+ }
276
+ /**
277
+ * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options
278
+ */
279
+ function parseNumberSkeleton(tokens) {
280
+ let result = {};
281
+ for (const token of tokens) {
282
+ switch (token.stem) {
283
+ case "percent":
284
+ case "%":
285
+ result.style = "percent";
286
+ continue;
287
+ case "%x100":
288
+ result.style = "percent";
289
+ result.scale = 100;
290
+ continue;
291
+ case "currency":
292
+ result.style = "currency";
293
+ result.currency = token.options[0];
294
+ continue;
295
+ case "group-off":
296
+ case ",_":
297
+ result.useGrouping = false;
298
+ continue;
299
+ case "precision-integer":
300
+ case ".":
301
+ result.maximumFractionDigits = 0;
302
+ continue;
303
+ case "measure-unit":
304
+ case "unit":
305
+ result.style = "unit";
306
+ result.unit = icuUnitToEcma(token.options[0]);
307
+ continue;
308
+ case "compact-short":
309
+ case "K":
310
+ result.notation = "compact";
311
+ result.compactDisplay = "short";
312
+ continue;
313
+ case "compact-long":
314
+ case "KK":
315
+ result.notation = "compact";
316
+ result.compactDisplay = "long";
317
+ continue;
318
+ case "scientific":
319
+ result = {
320
+ ...result,
321
+ notation: "scientific",
322
+ ...token.options.reduce((all, opt) => ({
323
+ ...all,
324
+ ...parseNotationOptions(opt)
325
+ }), {})
326
+ };
327
+ continue;
328
+ case "engineering":
329
+ result = {
330
+ ...result,
331
+ notation: "engineering",
332
+ ...token.options.reduce((all, opt) => ({
333
+ ...all,
334
+ ...parseNotationOptions(opt)
335
+ }), {})
336
+ };
337
+ continue;
338
+ case "notation-simple":
339
+ result.notation = "standard";
340
+ continue;
341
+ case "unit-width-narrow":
342
+ result.currencyDisplay = "narrowSymbol";
343
+ result.unitDisplay = "narrow";
344
+ continue;
345
+ case "unit-width-short":
346
+ result.currencyDisplay = "code";
347
+ result.unitDisplay = "short";
348
+ continue;
349
+ case "unit-width-full-name":
350
+ result.currencyDisplay = "name";
351
+ result.unitDisplay = "long";
352
+ continue;
353
+ case "unit-width-iso-code":
354
+ result.currencyDisplay = "symbol";
355
+ continue;
356
+ case "scale":
357
+ result.scale = parseFloat(token.options[0]);
358
+ continue;
359
+ case "rounding-mode-floor":
360
+ result.roundingMode = "floor";
361
+ continue;
362
+ case "rounding-mode-ceiling":
363
+ result.roundingMode = "ceil";
364
+ continue;
365
+ case "rounding-mode-down":
366
+ result.roundingMode = "trunc";
367
+ continue;
368
+ case "rounding-mode-up":
369
+ result.roundingMode = "expand";
370
+ continue;
371
+ case "rounding-mode-half-even":
372
+ result.roundingMode = "halfEven";
373
+ continue;
374
+ case "rounding-mode-half-down":
375
+ result.roundingMode = "halfTrunc";
376
+ continue;
377
+ case "rounding-mode-half-up":
378
+ result.roundingMode = "halfExpand";
379
+ continue;
380
+ case "integer-width":
381
+ if (token.options.length > 1) throw new RangeError("integer-width stems only accept a single optional option");
382
+ token.options[0].replace(INTEGER_WIDTH_REGEX, function(_, g1, g2, g3, g4, g5) {
383
+ if (g1) result.minimumIntegerDigits = g2.length;
384
+ else if (g3 && g4) throw new Error("We currently do not support maximum integer digits");
385
+ else if (g5) throw new Error("We currently do not support exact integer digits");
386
+ return "";
387
+ });
388
+ continue;
389
+ }
390
+ if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {
391
+ result.minimumIntegerDigits = token.stem.length;
392
+ continue;
393
+ }
394
+ if (FRACTION_PRECISION_REGEX.test(token.stem)) {
395
+ if (token.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option");
396
+ token.stem.replace(FRACTION_PRECISION_REGEX, function(_, g1, g2, g3, g4, g5) {
397
+ if (g2 === "*") result.minimumFractionDigits = g1.length;
398
+ else if (g3 && g3[0] === "#") result.maximumFractionDigits = g3.length;
399
+ else if (g4 && g5) {
400
+ result.minimumFractionDigits = g4.length;
401
+ result.maximumFractionDigits = g4.length + g5.length;
402
+ } else {
403
+ result.minimumFractionDigits = g1.length;
404
+ result.maximumFractionDigits = g1.length;
405
+ }
406
+ return "";
407
+ });
408
+ const opt = token.options[0];
409
+ if (opt === "w") result = {
410
+ ...result,
411
+ trailingZeroDisplay: "stripIfInteger"
412
+ };
413
+ else if (opt) result = {
414
+ ...result,
415
+ ...parseSignificantPrecision(opt)
416
+ };
417
+ continue;
418
+ }
419
+ if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {
420
+ result = {
421
+ ...result,
422
+ ...parseSignificantPrecision(token.stem)
423
+ };
424
+ continue;
425
+ }
426
+ const signOpts = parseSign(token.stem);
427
+ if (signOpts) result = {
428
+ ...result,
429
+ ...signOpts
430
+ };
431
+ const conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);
432
+ if (conciseScientificAndEngineeringOpts) result = {
433
+ ...result,
434
+ ...conciseScientificAndEngineeringOpts
435
+ };
436
+ }
437
+ return result;
438
+ }
439
+ //#endregion
440
+ //#region node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/index.js
441
+ let ErrorKind = /* @__PURE__ */ function(ErrorKind) {
442
+ /** Argument is unclosed (e.g. `{0`) */
443
+ ErrorKind[ErrorKind["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE";
444
+ /** Argument is empty (e.g. `{}`). */
445
+ ErrorKind[ErrorKind["EMPTY_ARGUMENT"] = 2] = "EMPTY_ARGUMENT";
446
+ /** Argument is malformed (e.g. `{foo!}``) */
447
+ ErrorKind[ErrorKind["MALFORMED_ARGUMENT"] = 3] = "MALFORMED_ARGUMENT";
448
+ /** Expect an argument type (e.g. `{foo,}`) */
449
+ ErrorKind[ErrorKind["EXPECT_ARGUMENT_TYPE"] = 4] = "EXPECT_ARGUMENT_TYPE";
450
+ /** Unsupported argument type (e.g. `{foo,foo}`) */
451
+ ErrorKind[ErrorKind["INVALID_ARGUMENT_TYPE"] = 5] = "INVALID_ARGUMENT_TYPE";
452
+ /** Expect an argument style (e.g. `{foo, number, }`) */
453
+ ErrorKind[ErrorKind["EXPECT_ARGUMENT_STYLE"] = 6] = "EXPECT_ARGUMENT_STYLE";
454
+ /** The number skeleton is invalid. */
455
+ ErrorKind[ErrorKind["INVALID_NUMBER_SKELETON"] = 7] = "INVALID_NUMBER_SKELETON";
456
+ /** The date time skeleton is invalid. */
457
+ ErrorKind[ErrorKind["INVALID_DATE_TIME_SKELETON"] = 8] = "INVALID_DATE_TIME_SKELETON";
458
+ /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */
459
+ ErrorKind[ErrorKind["EXPECT_NUMBER_SKELETON"] = 9] = "EXPECT_NUMBER_SKELETON";
460
+ /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */
461
+ ErrorKind[ErrorKind["EXPECT_DATE_TIME_SKELETON"] = 10] = "EXPECT_DATE_TIME_SKELETON";
462
+ /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */
463
+ ErrorKind[ErrorKind["UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"] = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE";
464
+ /** Missing select argument options (e.g. `{foo, select}`) */
465
+ ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_OPTIONS"] = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS";
466
+ /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */
467
+ ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"] = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE";
468
+ /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */
469
+ ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"] = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE";
470
+ /** Expecting a selector in `select` argument (e.g `{foo, select}`) */
471
+ ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR"] = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR";
472
+ /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */
473
+ ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR"] = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR";
474
+ /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */
475
+ ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"] = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT";
476
+ /**
477
+ * Expecting a message fragment after the `plural` or `selectordinal` selector
478
+ * (e.g. `{foo, plural, one}`)
479
+ */
480
+ ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"] = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT";
481
+ /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */
482
+ ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_SELECTOR"] = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR";
483
+ /**
484
+ * Duplicate selectors in `plural` or `selectordinal` argument.
485
+ * (e.g. {foo, plural, one {#} one {#}})
486
+ */
487
+ ErrorKind[ErrorKind["DUPLICATE_PLURAL_ARGUMENT_SELECTOR"] = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR";
488
+ /** Duplicate selectors in `select` argument.
489
+ * (e.g. {foo, select, apple {apple} apple {apple}})
490
+ */
491
+ ErrorKind[ErrorKind["DUPLICATE_SELECT_ARGUMENT_SELECTOR"] = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR";
492
+ /** Plural or select argument option must have `other` clause. */
493
+ ErrorKind[ErrorKind["MISSING_OTHER_CLAUSE"] = 22] = "MISSING_OTHER_CLAUSE";
494
+ /** The tag is malformed. (e.g. `<bold!>foo</bold!>) */
495
+ ErrorKind[ErrorKind["INVALID_TAG"] = 23] = "INVALID_TAG";
496
+ /** The tag name is invalid. (e.g. `<123>foo</123>`) */
497
+ ErrorKind[ErrorKind["INVALID_TAG_NAME"] = 25] = "INVALID_TAG_NAME";
498
+ /** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */
499
+ ErrorKind[ErrorKind["UNMATCHED_CLOSING_TAG"] = 26] = "UNMATCHED_CLOSING_TAG";
500
+ /** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */
501
+ ErrorKind[ErrorKind["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG";
502
+ return ErrorKind;
503
+ }({});
504
+ /**
505
+ * Type Guards
506
+ */
507
+ function isLiteralElement(el) {
508
+ return el.type === 0;
509
+ }
510
+ function isArgumentElement(el) {
511
+ return el.type === 1;
512
+ }
513
+ function isNumberElement(el) {
514
+ return el.type === 2;
515
+ }
516
+ function isDateElement(el) {
517
+ return el.type === 3;
518
+ }
519
+ function isTimeElement(el) {
520
+ return el.type === 4;
521
+ }
522
+ function isSelectElement(el) {
523
+ return el.type === 5;
524
+ }
525
+ function isPluralElement(el) {
526
+ return el.type === 6;
527
+ }
528
+ function isPoundElement(el) {
529
+ return el.type === 7;
530
+ }
531
+ function isTagElement(el) {
532
+ return el.type === 8;
533
+ }
534
+ function isNumberSkeleton(el) {
535
+ return !!(el && typeof el === "object" && el.type === 0);
536
+ }
537
+ function isDateTimeSkeleton(el) {
538
+ return !!(el && typeof el === "object" && el.type === 1);
539
+ }
540
+ const SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
541
+ const IDENTIFIER_PREFIX_REGEX = /([^\t-\r -\/:-@\[-\^`\{-~\x85\xA0-\xA7\xA9\xAB\xAC\xAE\xB0\xB1\xB6\xBB\xBF\xD7\xF7\u1680\u2000-\u200A\u2010-\u2029\u202F-\u203E\u2041-\u2053\u2055-\u205F\u2190-\u245F\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3000-\u3003\u3008-\u3020\u3030\uFD3E\uFD3F\uFE45\uFE46]*)/g;
542
+ const timeData = {
543
+ "001": ["H", "h"],
544
+ "419": [
545
+ "h",
546
+ "H",
547
+ "hB",
548
+ "hb"
549
+ ],
550
+ "AC": [
551
+ "H",
552
+ "h",
553
+ "hb",
554
+ "hB"
555
+ ],
556
+ "AD": ["H", "hB"],
557
+ "AE": [
558
+ "h",
559
+ "hB",
560
+ "hb",
561
+ "H"
562
+ ],
563
+ "AF": [
564
+ "H",
565
+ "hb",
566
+ "hB",
567
+ "h"
568
+ ],
569
+ "AG": [
570
+ "h",
571
+ "hb",
572
+ "H",
573
+ "hB"
574
+ ],
575
+ "AI": [
576
+ "H",
577
+ "h",
578
+ "hb",
579
+ "hB"
580
+ ],
581
+ "AL": [
582
+ "h",
583
+ "H",
584
+ "hB"
585
+ ],
586
+ "AM": ["H", "hB"],
587
+ "AO": ["H", "hB"],
588
+ "AR": [
589
+ "h",
590
+ "H",
591
+ "hB",
592
+ "hb"
593
+ ],
594
+ "AS": ["h", "H"],
595
+ "AT": ["H", "hB"],
596
+ "AU": [
597
+ "h",
598
+ "hb",
599
+ "H",
600
+ "hB"
601
+ ],
602
+ "AW": ["H", "hB"],
603
+ "AX": ["H"],
604
+ "AZ": [
605
+ "H",
606
+ "hB",
607
+ "h"
608
+ ],
609
+ "BA": [
610
+ "H",
611
+ "hB",
612
+ "h"
613
+ ],
614
+ "BB": [
615
+ "h",
616
+ "hb",
617
+ "H",
618
+ "hB"
619
+ ],
620
+ "BD": [
621
+ "h",
622
+ "hB",
623
+ "H"
624
+ ],
625
+ "BE": ["H", "hB"],
626
+ "BF": ["H", "hB"],
627
+ "BG": [
628
+ "H",
629
+ "hB",
630
+ "h"
631
+ ],
632
+ "BH": [
633
+ "h",
634
+ "hB",
635
+ "hb",
636
+ "H"
637
+ ],
638
+ "BI": ["H", "h"],
639
+ "BJ": ["H", "hB"],
640
+ "BL": ["H", "hB"],
641
+ "BM": [
642
+ "h",
643
+ "hb",
644
+ "H",
645
+ "hB"
646
+ ],
647
+ "BN": [
648
+ "hb",
649
+ "hB",
650
+ "h",
651
+ "H"
652
+ ],
653
+ "BO": [
654
+ "h",
655
+ "H",
656
+ "hB",
657
+ "hb"
658
+ ],
659
+ "BQ": ["H"],
660
+ "BR": ["H", "hB"],
661
+ "BS": [
662
+ "h",
663
+ "hb",
664
+ "H",
665
+ "hB"
666
+ ],
667
+ "BT": ["h", "H"],
668
+ "BW": [
669
+ "H",
670
+ "h",
671
+ "hb",
672
+ "hB"
673
+ ],
674
+ "BY": ["H", "h"],
675
+ "BZ": [
676
+ "H",
677
+ "h",
678
+ "hb",
679
+ "hB"
680
+ ],
681
+ "CA": [
682
+ "h",
683
+ "hb",
684
+ "H",
685
+ "hB"
686
+ ],
687
+ "CC": [
688
+ "H",
689
+ "h",
690
+ "hb",
691
+ "hB"
692
+ ],
693
+ "CD": ["hB", "H"],
694
+ "CF": [
695
+ "H",
696
+ "h",
697
+ "hB"
698
+ ],
699
+ "CG": ["H", "hB"],
700
+ "CH": [
701
+ "H",
702
+ "hB",
703
+ "h"
704
+ ],
705
+ "CI": ["H", "hB"],
706
+ "CK": [
707
+ "H",
708
+ "h",
709
+ "hb",
710
+ "hB"
711
+ ],
712
+ "CL": [
713
+ "h",
714
+ "H",
715
+ "hB",
716
+ "hb"
717
+ ],
718
+ "CM": [
719
+ "H",
720
+ "h",
721
+ "hB"
722
+ ],
723
+ "CN": [
724
+ "H",
725
+ "hB",
726
+ "hb",
727
+ "h"
728
+ ],
729
+ "CO": [
730
+ "h",
731
+ "H",
732
+ "hB",
733
+ "hb"
734
+ ],
735
+ "CP": ["H"],
736
+ "CR": [
737
+ "h",
738
+ "H",
739
+ "hB",
740
+ "hb"
741
+ ],
742
+ "CU": [
743
+ "h",
744
+ "H",
745
+ "hB",
746
+ "hb"
747
+ ],
748
+ "CV": ["H", "hB"],
749
+ "CW": ["H", "hB"],
750
+ "CX": [
751
+ "H",
752
+ "h",
753
+ "hb",
754
+ "hB"
755
+ ],
756
+ "CY": [
757
+ "h",
758
+ "H",
759
+ "hb",
760
+ "hB"
761
+ ],
762
+ "CZ": ["H"],
763
+ "DE": ["H", "hB"],
764
+ "DG": [
765
+ "H",
766
+ "h",
767
+ "hb",
768
+ "hB"
769
+ ],
770
+ "DJ": ["h", "H"],
771
+ "DK": ["H"],
772
+ "DM": [
773
+ "h",
774
+ "hb",
775
+ "H",
776
+ "hB"
777
+ ],
778
+ "DO": [
779
+ "h",
780
+ "H",
781
+ "hB",
782
+ "hb"
783
+ ],
784
+ "DZ": [
785
+ "h",
786
+ "hB",
787
+ "hb",
788
+ "H"
789
+ ],
790
+ "EA": [
791
+ "H",
792
+ "h",
793
+ "hB",
794
+ "hb"
795
+ ],
796
+ "EC": [
797
+ "h",
798
+ "H",
799
+ "hB",
800
+ "hb"
801
+ ],
802
+ "EE": ["H", "hB"],
803
+ "EG": [
804
+ "h",
805
+ "hB",
806
+ "hb",
807
+ "H"
808
+ ],
809
+ "EH": [
810
+ "h",
811
+ "hB",
812
+ "hb",
813
+ "H"
814
+ ],
815
+ "ER": ["h", "H"],
816
+ "ES": [
817
+ "H",
818
+ "hB",
819
+ "h",
820
+ "hb"
821
+ ],
822
+ "ET": [
823
+ "hB",
824
+ "hb",
825
+ "h",
826
+ "H"
827
+ ],
828
+ "FI": ["H"],
829
+ "FJ": [
830
+ "h",
831
+ "hb",
832
+ "H",
833
+ "hB"
834
+ ],
835
+ "FK": [
836
+ "H",
837
+ "h",
838
+ "hb",
839
+ "hB"
840
+ ],
841
+ "FM": [
842
+ "h",
843
+ "hb",
844
+ "H",
845
+ "hB"
846
+ ],
847
+ "FO": ["H", "h"],
848
+ "FR": ["H", "hB"],
849
+ "GA": ["H", "hB"],
850
+ "GB": [
851
+ "H",
852
+ "h",
853
+ "hb",
854
+ "hB"
855
+ ],
856
+ "GD": [
857
+ "h",
858
+ "hb",
859
+ "H",
860
+ "hB"
861
+ ],
862
+ "GE": [
863
+ "H",
864
+ "hB",
865
+ "h"
866
+ ],
867
+ "GF": ["H", "hB"],
868
+ "GG": [
869
+ "H",
870
+ "h",
871
+ "hb",
872
+ "hB"
873
+ ],
874
+ "GH": ["h", "H"],
875
+ "GI": [
876
+ "H",
877
+ "h",
878
+ "hb",
879
+ "hB"
880
+ ],
881
+ "GL": ["H", "h"],
882
+ "GM": [
883
+ "h",
884
+ "hb",
885
+ "H",
886
+ "hB"
887
+ ],
888
+ "GN": ["H", "hB"],
889
+ "GP": ["H", "hB"],
890
+ "GQ": [
891
+ "H",
892
+ "hB",
893
+ "h",
894
+ "hb"
895
+ ],
896
+ "GR": [
897
+ "h",
898
+ "H",
899
+ "hb",
900
+ "hB"
901
+ ],
902
+ "GS": [
903
+ "H",
904
+ "h",
905
+ "hb",
906
+ "hB"
907
+ ],
908
+ "GT": [
909
+ "h",
910
+ "H",
911
+ "hB",
912
+ "hb"
913
+ ],
914
+ "GU": [
915
+ "h",
916
+ "hb",
917
+ "H",
918
+ "hB"
919
+ ],
920
+ "GW": ["H", "hB"],
921
+ "GY": [
922
+ "h",
923
+ "hb",
924
+ "H",
925
+ "hB"
926
+ ],
927
+ "HK": [
928
+ "h",
929
+ "hB",
930
+ "hb",
931
+ "H"
932
+ ],
933
+ "HN": [
934
+ "h",
935
+ "H",
936
+ "hB",
937
+ "hb"
938
+ ],
939
+ "HR": ["H", "hB"],
940
+ "HU": ["H", "h"],
941
+ "IC": [
942
+ "H",
943
+ "h",
944
+ "hB",
945
+ "hb"
946
+ ],
947
+ "ID": ["H"],
948
+ "IE": [
949
+ "H",
950
+ "h",
951
+ "hb",
952
+ "hB"
953
+ ],
954
+ "IL": ["H", "hB"],
955
+ "IM": [
956
+ "H",
957
+ "h",
958
+ "hb",
959
+ "hB"
960
+ ],
961
+ "IN": ["h", "H"],
962
+ "IO": [
963
+ "H",
964
+ "h",
965
+ "hb",
966
+ "hB"
967
+ ],
968
+ "IQ": [
969
+ "h",
970
+ "hB",
971
+ "hb",
972
+ "H"
973
+ ],
974
+ "IR": ["hB", "H"],
975
+ "IS": ["H"],
976
+ "IT": ["H", "hB"],
977
+ "JE": [
978
+ "H",
979
+ "h",
980
+ "hb",
981
+ "hB"
982
+ ],
983
+ "JM": [
984
+ "h",
985
+ "hb",
986
+ "H",
987
+ "hB"
988
+ ],
989
+ "JO": [
990
+ "h",
991
+ "hB",
992
+ "hb",
993
+ "H"
994
+ ],
995
+ "JP": [
996
+ "H",
997
+ "K",
998
+ "h"
999
+ ],
1000
+ "KE": [
1001
+ "hB",
1002
+ "hb",
1003
+ "H",
1004
+ "h"
1005
+ ],
1006
+ "KG": [
1007
+ "H",
1008
+ "h",
1009
+ "hB",
1010
+ "hb"
1011
+ ],
1012
+ "KH": [
1013
+ "hB",
1014
+ "h",
1015
+ "H",
1016
+ "hb"
1017
+ ],
1018
+ "KI": [
1019
+ "h",
1020
+ "hb",
1021
+ "H",
1022
+ "hB"
1023
+ ],
1024
+ "KM": [
1025
+ "H",
1026
+ "h",
1027
+ "hB",
1028
+ "hb"
1029
+ ],
1030
+ "KN": [
1031
+ "h",
1032
+ "hb",
1033
+ "H",
1034
+ "hB"
1035
+ ],
1036
+ "KP": [
1037
+ "h",
1038
+ "H",
1039
+ "hB",
1040
+ "hb"
1041
+ ],
1042
+ "KR": [
1043
+ "h",
1044
+ "H",
1045
+ "hB",
1046
+ "hb"
1047
+ ],
1048
+ "KW": [
1049
+ "h",
1050
+ "hB",
1051
+ "hb",
1052
+ "H"
1053
+ ],
1054
+ "KY": [
1055
+ "h",
1056
+ "hb",
1057
+ "H",
1058
+ "hB"
1059
+ ],
1060
+ "KZ": ["H", "hB"],
1061
+ "LA": [
1062
+ "H",
1063
+ "hb",
1064
+ "hB",
1065
+ "h"
1066
+ ],
1067
+ "LB": [
1068
+ "h",
1069
+ "hB",
1070
+ "hb",
1071
+ "H"
1072
+ ],
1073
+ "LC": [
1074
+ "h",
1075
+ "hb",
1076
+ "H",
1077
+ "hB"
1078
+ ],
1079
+ "LI": [
1080
+ "H",
1081
+ "hB",
1082
+ "h"
1083
+ ],
1084
+ "LK": [
1085
+ "H",
1086
+ "h",
1087
+ "hB",
1088
+ "hb"
1089
+ ],
1090
+ "LR": [
1091
+ "h",
1092
+ "hb",
1093
+ "H",
1094
+ "hB"
1095
+ ],
1096
+ "LS": ["h", "H"],
1097
+ "LT": [
1098
+ "H",
1099
+ "h",
1100
+ "hb",
1101
+ "hB"
1102
+ ],
1103
+ "LU": [
1104
+ "H",
1105
+ "h",
1106
+ "hB"
1107
+ ],
1108
+ "LV": [
1109
+ "H",
1110
+ "hB",
1111
+ "hb",
1112
+ "h"
1113
+ ],
1114
+ "LY": [
1115
+ "h",
1116
+ "hB",
1117
+ "hb",
1118
+ "H"
1119
+ ],
1120
+ "MA": [
1121
+ "H",
1122
+ "h",
1123
+ "hB",
1124
+ "hb"
1125
+ ],
1126
+ "MC": ["H", "hB"],
1127
+ "MD": ["H", "hB"],
1128
+ "ME": [
1129
+ "H",
1130
+ "hB",
1131
+ "h"
1132
+ ],
1133
+ "MF": ["H", "hB"],
1134
+ "MG": ["H", "h"],
1135
+ "MH": [
1136
+ "h",
1137
+ "hb",
1138
+ "H",
1139
+ "hB"
1140
+ ],
1141
+ "MK": [
1142
+ "H",
1143
+ "h",
1144
+ "hb",
1145
+ "hB"
1146
+ ],
1147
+ "ML": ["H"],
1148
+ "MM": [
1149
+ "hB",
1150
+ "hb",
1151
+ "H",
1152
+ "h"
1153
+ ],
1154
+ "MN": [
1155
+ "H",
1156
+ "h",
1157
+ "hb",
1158
+ "hB"
1159
+ ],
1160
+ "MO": [
1161
+ "h",
1162
+ "hB",
1163
+ "hb",
1164
+ "H"
1165
+ ],
1166
+ "MP": [
1167
+ "h",
1168
+ "hb",
1169
+ "H",
1170
+ "hB"
1171
+ ],
1172
+ "MQ": ["H", "hB"],
1173
+ "MR": [
1174
+ "h",
1175
+ "hB",
1176
+ "hb",
1177
+ "H"
1178
+ ],
1179
+ "MS": [
1180
+ "H",
1181
+ "h",
1182
+ "hb",
1183
+ "hB"
1184
+ ],
1185
+ "MT": ["H", "h"],
1186
+ "MU": ["H", "h"],
1187
+ "MV": ["H", "h"],
1188
+ "MW": [
1189
+ "h",
1190
+ "hb",
1191
+ "H",
1192
+ "hB"
1193
+ ],
1194
+ "MX": [
1195
+ "h",
1196
+ "H",
1197
+ "hB",
1198
+ "hb"
1199
+ ],
1200
+ "MY": [
1201
+ "hb",
1202
+ "hB",
1203
+ "h",
1204
+ "H"
1205
+ ],
1206
+ "MZ": ["H", "hB"],
1207
+ "NA": [
1208
+ "h",
1209
+ "H",
1210
+ "hB",
1211
+ "hb"
1212
+ ],
1213
+ "NC": ["H", "hB"],
1214
+ "NE": ["H"],
1215
+ "NF": [
1216
+ "H",
1217
+ "h",
1218
+ "hb",
1219
+ "hB"
1220
+ ],
1221
+ "NG": [
1222
+ "H",
1223
+ "h",
1224
+ "hb",
1225
+ "hB"
1226
+ ],
1227
+ "NI": [
1228
+ "h",
1229
+ "H",
1230
+ "hB",
1231
+ "hb"
1232
+ ],
1233
+ "NL": ["H", "hB"],
1234
+ "NO": ["H", "h"],
1235
+ "NP": [
1236
+ "H",
1237
+ "h",
1238
+ "hB"
1239
+ ],
1240
+ "NR": [
1241
+ "H",
1242
+ "h",
1243
+ "hb",
1244
+ "hB"
1245
+ ],
1246
+ "NU": [
1247
+ "H",
1248
+ "h",
1249
+ "hb",
1250
+ "hB"
1251
+ ],
1252
+ "NZ": [
1253
+ "h",
1254
+ "hb",
1255
+ "H",
1256
+ "hB"
1257
+ ],
1258
+ "OM": [
1259
+ "h",
1260
+ "hB",
1261
+ "hb",
1262
+ "H"
1263
+ ],
1264
+ "PA": [
1265
+ "h",
1266
+ "H",
1267
+ "hB",
1268
+ "hb"
1269
+ ],
1270
+ "PE": [
1271
+ "h",
1272
+ "H",
1273
+ "hB",
1274
+ "hb"
1275
+ ],
1276
+ "PF": [
1277
+ "H",
1278
+ "h",
1279
+ "hB"
1280
+ ],
1281
+ "PG": ["h", "H"],
1282
+ "PH": [
1283
+ "h",
1284
+ "hB",
1285
+ "hb",
1286
+ "H"
1287
+ ],
1288
+ "PK": [
1289
+ "h",
1290
+ "hB",
1291
+ "H"
1292
+ ],
1293
+ "PL": ["H", "h"],
1294
+ "PM": ["H", "hB"],
1295
+ "PN": [
1296
+ "H",
1297
+ "h",
1298
+ "hb",
1299
+ "hB"
1300
+ ],
1301
+ "PR": [
1302
+ "h",
1303
+ "H",
1304
+ "hB",
1305
+ "hb"
1306
+ ],
1307
+ "PS": [
1308
+ "h",
1309
+ "hB",
1310
+ "hb",
1311
+ "H"
1312
+ ],
1313
+ "PT": ["H", "hB"],
1314
+ "PW": ["h", "H"],
1315
+ "PY": [
1316
+ "h",
1317
+ "H",
1318
+ "hB",
1319
+ "hb"
1320
+ ],
1321
+ "QA": [
1322
+ "h",
1323
+ "hB",
1324
+ "hb",
1325
+ "H"
1326
+ ],
1327
+ "RE": ["H", "hB"],
1328
+ "RO": ["H", "hB"],
1329
+ "RS": [
1330
+ "H",
1331
+ "hB",
1332
+ "h"
1333
+ ],
1334
+ "RU": ["H"],
1335
+ "RW": ["H", "h"],
1336
+ "SA": [
1337
+ "h",
1338
+ "hB",
1339
+ "hb",
1340
+ "H"
1341
+ ],
1342
+ "SB": [
1343
+ "h",
1344
+ "hb",
1345
+ "H",
1346
+ "hB"
1347
+ ],
1348
+ "SC": [
1349
+ "H",
1350
+ "h",
1351
+ "hB"
1352
+ ],
1353
+ "SD": [
1354
+ "h",
1355
+ "hB",
1356
+ "hb",
1357
+ "H"
1358
+ ],
1359
+ "SE": ["H"],
1360
+ "SG": [
1361
+ "h",
1362
+ "hb",
1363
+ "H",
1364
+ "hB"
1365
+ ],
1366
+ "SH": [
1367
+ "H",
1368
+ "h",
1369
+ "hb",
1370
+ "hB"
1371
+ ],
1372
+ "SI": ["H", "hB"],
1373
+ "SJ": ["H"],
1374
+ "SK": ["H"],
1375
+ "SL": [
1376
+ "h",
1377
+ "hb",
1378
+ "H",
1379
+ "hB"
1380
+ ],
1381
+ "SM": [
1382
+ "H",
1383
+ "h",
1384
+ "hB"
1385
+ ],
1386
+ "SN": [
1387
+ "H",
1388
+ "h",
1389
+ "hB"
1390
+ ],
1391
+ "SO": ["h", "H"],
1392
+ "SR": ["H", "hB"],
1393
+ "SS": [
1394
+ "h",
1395
+ "hb",
1396
+ "H",
1397
+ "hB"
1398
+ ],
1399
+ "ST": ["H", "hB"],
1400
+ "SV": [
1401
+ "h",
1402
+ "H",
1403
+ "hB",
1404
+ "hb"
1405
+ ],
1406
+ "SX": [
1407
+ "H",
1408
+ "h",
1409
+ "hb",
1410
+ "hB"
1411
+ ],
1412
+ "SY": [
1413
+ "h",
1414
+ "hB",
1415
+ "hb",
1416
+ "H"
1417
+ ],
1418
+ "SZ": [
1419
+ "h",
1420
+ "hb",
1421
+ "H",
1422
+ "hB"
1423
+ ],
1424
+ "TA": [
1425
+ "H",
1426
+ "h",
1427
+ "hb",
1428
+ "hB"
1429
+ ],
1430
+ "TC": [
1431
+ "h",
1432
+ "hb",
1433
+ "H",
1434
+ "hB"
1435
+ ],
1436
+ "TD": [
1437
+ "h",
1438
+ "H",
1439
+ "hB"
1440
+ ],
1441
+ "TF": [
1442
+ "H",
1443
+ "h",
1444
+ "hB"
1445
+ ],
1446
+ "TG": ["H", "hB"],
1447
+ "TH": ["H", "h"],
1448
+ "TJ": ["H", "h"],
1449
+ "TL": [
1450
+ "H",
1451
+ "hB",
1452
+ "hb",
1453
+ "h"
1454
+ ],
1455
+ "TM": ["H", "h"],
1456
+ "TN": [
1457
+ "h",
1458
+ "hB",
1459
+ "hb",
1460
+ "H"
1461
+ ],
1462
+ "TO": ["h", "H"],
1463
+ "TR": ["H", "hB"],
1464
+ "TT": [
1465
+ "h",
1466
+ "hb",
1467
+ "H",
1468
+ "hB"
1469
+ ],
1470
+ "TW": [
1471
+ "hB",
1472
+ "hb",
1473
+ "h",
1474
+ "H"
1475
+ ],
1476
+ "TZ": [
1477
+ "hB",
1478
+ "hb",
1479
+ "H",
1480
+ "h"
1481
+ ],
1482
+ "UA": [
1483
+ "H",
1484
+ "hB",
1485
+ "h"
1486
+ ],
1487
+ "UG": [
1488
+ "hB",
1489
+ "hb",
1490
+ "H",
1491
+ "h"
1492
+ ],
1493
+ "UM": [
1494
+ "h",
1495
+ "hb",
1496
+ "H",
1497
+ "hB"
1498
+ ],
1499
+ "US": [
1500
+ "h",
1501
+ "hb",
1502
+ "H",
1503
+ "hB"
1504
+ ],
1505
+ "UY": [
1506
+ "h",
1507
+ "H",
1508
+ "hB",
1509
+ "hb"
1510
+ ],
1511
+ "UZ": [
1512
+ "H",
1513
+ "hB",
1514
+ "h"
1515
+ ],
1516
+ "VA": [
1517
+ "H",
1518
+ "h",
1519
+ "hB"
1520
+ ],
1521
+ "VC": [
1522
+ "h",
1523
+ "hb",
1524
+ "H",
1525
+ "hB"
1526
+ ],
1527
+ "VE": [
1528
+ "h",
1529
+ "H",
1530
+ "hB",
1531
+ "hb"
1532
+ ],
1533
+ "VG": [
1534
+ "h",
1535
+ "hb",
1536
+ "H",
1537
+ "hB"
1538
+ ],
1539
+ "VI": [
1540
+ "h",
1541
+ "hb",
1542
+ "H",
1543
+ "hB"
1544
+ ],
1545
+ "VN": ["H", "h"],
1546
+ "VU": ["h", "H"],
1547
+ "WF": ["H", "hB"],
1548
+ "WS": ["h", "H"],
1549
+ "XK": [
1550
+ "H",
1551
+ "hB",
1552
+ "h"
1553
+ ],
1554
+ "YE": [
1555
+ "h",
1556
+ "hB",
1557
+ "hb",
1558
+ "H"
1559
+ ],
1560
+ "YT": ["H", "hB"],
1561
+ "ZA": [
1562
+ "H",
1563
+ "h",
1564
+ "hb",
1565
+ "hB"
1566
+ ],
1567
+ "ZM": [
1568
+ "h",
1569
+ "hb",
1570
+ "H",
1571
+ "hB"
1572
+ ],
1573
+ "ZW": ["H", "h"],
1574
+ "af-ZA": [
1575
+ "H",
1576
+ "h",
1577
+ "hB",
1578
+ "hb"
1579
+ ],
1580
+ "ar-001": [
1581
+ "h",
1582
+ "hB",
1583
+ "hb",
1584
+ "H"
1585
+ ],
1586
+ "ca-ES": [
1587
+ "H",
1588
+ "h",
1589
+ "hB"
1590
+ ],
1591
+ "en-001": [
1592
+ "h",
1593
+ "hb",
1594
+ "H",
1595
+ "hB"
1596
+ ],
1597
+ "en-HK": [
1598
+ "h",
1599
+ "hb",
1600
+ "H",
1601
+ "hB"
1602
+ ],
1603
+ "en-IL": [
1604
+ "H",
1605
+ "h",
1606
+ "hb",
1607
+ "hB"
1608
+ ],
1609
+ "en-MY": [
1610
+ "h",
1611
+ "hb",
1612
+ "H",
1613
+ "hB"
1614
+ ],
1615
+ "es-BR": [
1616
+ "H",
1617
+ "h",
1618
+ "hB",
1619
+ "hb"
1620
+ ],
1621
+ "es-ES": [
1622
+ "H",
1623
+ "h",
1624
+ "hB",
1625
+ "hb"
1626
+ ],
1627
+ "es-GQ": [
1628
+ "H",
1629
+ "h",
1630
+ "hB",
1631
+ "hb"
1632
+ ],
1633
+ "fr-CA": [
1634
+ "H",
1635
+ "h",
1636
+ "hB"
1637
+ ],
1638
+ "gl-ES": [
1639
+ "H",
1640
+ "h",
1641
+ "hB"
1642
+ ],
1643
+ "gu-IN": [
1644
+ "hB",
1645
+ "hb",
1646
+ "h",
1647
+ "H"
1648
+ ],
1649
+ "hi-IN": [
1650
+ "hB",
1651
+ "h",
1652
+ "H"
1653
+ ],
1654
+ "it-CH": [
1655
+ "H",
1656
+ "h",
1657
+ "hB"
1658
+ ],
1659
+ "it-IT": [
1660
+ "H",
1661
+ "h",
1662
+ "hB"
1663
+ ],
1664
+ "kn-IN": [
1665
+ "hB",
1666
+ "h",
1667
+ "H"
1668
+ ],
1669
+ "ku-SY": ["H", "hB"],
1670
+ "ml-IN": [
1671
+ "hB",
1672
+ "h",
1673
+ "H"
1674
+ ],
1675
+ "mr-IN": [
1676
+ "hB",
1677
+ "hb",
1678
+ "h",
1679
+ "H"
1680
+ ],
1681
+ "pa-IN": [
1682
+ "hB",
1683
+ "hb",
1684
+ "h",
1685
+ "H"
1686
+ ],
1687
+ "ta-IN": [
1688
+ "hB",
1689
+ "h",
1690
+ "hb",
1691
+ "H"
1692
+ ],
1693
+ "te-IN": [
1694
+ "hB",
1695
+ "h",
1696
+ "H"
1697
+ ],
1698
+ "zu-ZA": [
1699
+ "H",
1700
+ "hB",
1701
+ "hb",
1702
+ "h"
1703
+ ]
1704
+ };
1705
+ /**
1706
+ * Returns the best matching date time pattern if a date time skeleton
1707
+ * pattern is provided with a locale. Follows the Unicode specification:
1708
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns
1709
+ * @param skeleton date time skeleton pattern that possibly includes j, J or C
1710
+ * @param locale
1711
+ */
1712
+ function getBestPattern(skeleton, locale) {
1713
+ let skeletonCopy = "";
1714
+ for (let patternPos = 0; patternPos < skeleton.length; patternPos++) {
1715
+ const patternChar = skeleton.charAt(patternPos);
1716
+ if (patternChar === "j") {
1717
+ let extraLength = 0;
1718
+ while (patternPos + 1 < skeleton.length && skeleton.charAt(patternPos + 1) === patternChar) {
1719
+ extraLength++;
1720
+ patternPos++;
1721
+ }
1722
+ let hourLen = 1 + (extraLength & 1);
1723
+ let dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);
1724
+ let dayPeriodChar = "a";
1725
+ let hourChar = getDefaultHourSymbolFromLocale(locale);
1726
+ if (hourChar == "H" || hourChar == "k") dayPeriodLen = 0;
1727
+ while (dayPeriodLen-- > 0) skeletonCopy += dayPeriodChar;
1728
+ while (hourLen-- > 0) skeletonCopy = hourChar + skeletonCopy;
1729
+ } else if (patternChar === "J") skeletonCopy += "H";
1730
+ else skeletonCopy += patternChar;
1731
+ }
1732
+ return skeletonCopy;
1733
+ }
1734
+ /**
1735
+ * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)
1736
+ * of the given `locale` to the corresponding time pattern.
1737
+ * @param locale
1738
+ */
1739
+ function getDefaultHourSymbolFromLocale(locale) {
1740
+ let hourCycle = locale.hourCycle;
1741
+ if (hourCycle === void 0) {
1742
+ const localeWithHourCycles = locale;
1743
+ hourCycle = localeWithHourCycles.getHourCycles?.()[0] ?? localeWithHourCycles.hourCycles?.[0];
1744
+ }
1745
+ if (hourCycle) switch (hourCycle) {
1746
+ case "h24": return "k";
1747
+ case "h23": return "H";
1748
+ case "h12": return "h";
1749
+ case "h11": return "K";
1750
+ default: throw new Error("Invalid hourCycle");
1751
+ }
1752
+ const languageTag = locale.language;
1753
+ let regionTag;
1754
+ if (languageTag !== "root") regionTag = locale.maximize().region;
1755
+ return (timeData[`${languageTag}-${regionTag}`] || timeData[regionTag || ""] || timeData[languageTag || ""] || timeData[`${languageTag}-001`] || timeData["001"])[0].charAt(0);
1756
+ }
1757
+ const SPACE_SEPARATOR_START_REGEX = new RegExp(`^${SPACE_SEPARATOR_REGEX.source}*`);
1758
+ const SPACE_SEPARATOR_END_REGEX = new RegExp(`${SPACE_SEPARATOR_REGEX.source}*$`);
1759
+ function createLocation(start, end) {
1760
+ return {
1761
+ start,
1762
+ end
1763
+ };
1764
+ }
1765
+ const hasNativeFromEntries = !!Object.fromEntries;
1766
+ const hasTrimStart = !!String.prototype.trimStart;
1767
+ const hasTrimEnd = !!String.prototype.trimEnd;
1768
+ const fromEntries = hasNativeFromEntries ? Object.fromEntries : function fromEntries(entries) {
1769
+ const obj = {};
1770
+ for (const [k, v] of entries) obj[k] = v;
1771
+ return obj;
1772
+ };
1773
+ const trimStart = hasTrimStart ? function trimStart(s) {
1774
+ return s.trimStart();
1775
+ } : function trimStart(s) {
1776
+ return s.replace(SPACE_SEPARATOR_START_REGEX, "");
1777
+ };
1778
+ const trimEnd = hasTrimEnd ? function trimEnd(s) {
1779
+ return s.trimEnd();
1780
+ } : function trimEnd(s) {
1781
+ return s.replace(SPACE_SEPARATOR_END_REGEX, "");
1782
+ };
1783
+ let IDENTIFIER_PREFIX_RE = createIdentifierPrefixRegex();
1784
+ function createIdentifierPrefixRegex() {
1785
+ try {
1786
+ const regex = new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
1787
+ if (regex.exec("a ")?.[1] === "a") return regex;
1788
+ } catch {}
1789
+ return IDENTIFIER_PREFIX_REGEX;
1790
+ }
1791
+ function matchIdentifierAtIndex(s, index) {
1792
+ IDENTIFIER_PREFIX_RE.lastIndex = index;
1793
+ return IDENTIFIER_PREFIX_RE.exec(s)[1] ?? "";
1794
+ }
1795
+ function plainTopLevelEndPosition(message) {
1796
+ if (message.length === 0) return null;
1797
+ let line = 1;
1798
+ let column = 1;
1799
+ for (let offset = 0; offset < message.length;) {
1800
+ const code = message.charCodeAt(offset);
1801
+ switch (code) {
1802
+ case 35:
1803
+ case 39:
1804
+ case 60:
1805
+ case 123:
1806
+ case 125: return null;
1807
+ }
1808
+ if (code === 10) {
1809
+ line++;
1810
+ column = 1;
1811
+ offset++;
1812
+ } else {
1813
+ column++;
1814
+ if (code >= 55296 && code <= 56319 && offset + 1 < message.length) {
1815
+ const next = message.charCodeAt(offset + 1);
1816
+ offset += next >= 56320 && next <= 57343 ? 2 : 1;
1817
+ } else offset++;
1818
+ }
1819
+ }
1820
+ return {
1821
+ offset: message.length,
1822
+ line,
1823
+ column
1824
+ };
1825
+ }
1826
+ var Parser = class {
1827
+ constructor(message, options = {}) {
1828
+ this.message = message;
1829
+ this.position = {
1830
+ offset: 0,
1831
+ line: 1,
1832
+ column: 1
1833
+ };
1834
+ this.ignoreTag = !!options.ignoreTag;
1835
+ this.locale = options.locale;
1836
+ this.requiresOtherClause = !!options.requiresOtherClause;
1837
+ this.shouldParseSkeletons = !!options.shouldParseSkeletons;
1838
+ }
1839
+ parse() {
1840
+ if (this.offset() !== 0) throw Error("parser can only be used once");
1841
+ if (this.message.length > 0) {
1842
+ const firstCode = this.message.charCodeAt(0);
1843
+ if (firstCode !== 35 && firstCode !== 39 && firstCode !== 60 && firstCode !== 123 && firstCode !== 125) {
1844
+ const plainEndPosition = plainTopLevelEndPosition(this.message);
1845
+ if (plainEndPosition) {
1846
+ const start = this.clonePosition();
1847
+ this.position = plainEndPosition;
1848
+ return {
1849
+ val: [{
1850
+ type: 0,
1851
+ value: this.message,
1852
+ location: createLocation(start, this.clonePosition())
1853
+ }],
1854
+ err: null
1855
+ };
1856
+ }
1857
+ }
1858
+ }
1859
+ return this.parseMessage(0, "", false);
1860
+ }
1861
+ parseMessage(nestingLevel, parentArgType, expectingCloseTag) {
1862
+ let elements = [];
1863
+ while (!this.isEOF()) {
1864
+ const char = this.char();
1865
+ if (char === 123) {
1866
+ const result = this.parseArgument(nestingLevel, expectingCloseTag);
1867
+ if (result.err) return result;
1868
+ elements.push(result.val);
1869
+ } else if (char === 125 && nestingLevel > 0) break;
1870
+ else if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) {
1871
+ const position = this.clonePosition();
1872
+ this.bump();
1873
+ elements.push({
1874
+ type: 7,
1875
+ location: createLocation(position, this.clonePosition())
1876
+ });
1877
+ } else if (char === 60 && !this.ignoreTag && this.peek() === 47) {
1878
+ if (expectingCloseTag) break;
1879
+ else return this.error(26, createLocation(this.clonePosition(), this.clonePosition()));
1880
+ } else if (char === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) {
1881
+ const result = this.parseTag(nestingLevel, parentArgType);
1882
+ if (result.err) return result;
1883
+ elements.push(result.val);
1884
+ } else {
1885
+ const result = this.parseLiteral(nestingLevel, parentArgType);
1886
+ if (result.err) return result;
1887
+ elements.push(result.val);
1888
+ }
1889
+ }
1890
+ return {
1891
+ val: elements,
1892
+ err: null
1893
+ };
1894
+ }
1895
+ /**
1896
+ * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the
1897
+ * [custom element name][] except that a dash is NOT always mandatory and uppercase letters
1898
+ * are accepted:
1899
+ *
1900
+ * ```
1901
+ * tag ::= "<" tagName (whitespace)* "/>" | "<" tagName (whitespace)* ">" message "</" tagName (whitespace)* ">"
1902
+ * tagName ::= [a-z] (PENChar)*
1903
+ * PENChar ::=
1904
+ * "-" | "." | [0-9] | "_" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |
1905
+ * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |
1906
+ * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
1907
+ * ```
1908
+ *
1909
+ * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name
1910
+ * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do
1911
+ * since other tag-based engines like React allow it
1912
+ */
1913
+ parseTag(nestingLevel, parentArgType) {
1914
+ const startPosition = this.clonePosition();
1915
+ this.bump();
1916
+ const tagName = this.parseTagName();
1917
+ this.bumpSpace();
1918
+ if (this.bumpIf("/>")) return {
1919
+ val: {
1920
+ type: 0,
1921
+ value: `<${tagName}/>`,
1922
+ location: createLocation(startPosition, this.clonePosition())
1923
+ },
1924
+ err: null
1925
+ };
1926
+ else if (this.bumpIf(">")) {
1927
+ const childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);
1928
+ if (childrenResult.err) return childrenResult;
1929
+ const children = childrenResult.val;
1930
+ const endTagStartPosition = this.clonePosition();
1931
+ if (this.bumpIf("</")) {
1932
+ if (this.isEOF() || !_isAlpha(this.char())) return this.error(23, createLocation(endTagStartPosition, this.clonePosition()));
1933
+ const closingTagNameStartPosition = this.clonePosition();
1934
+ if (tagName !== this.parseTagName()) return this.error(26, createLocation(closingTagNameStartPosition, this.clonePosition()));
1935
+ this.bumpSpace();
1936
+ if (!this.bumpIf(">")) return this.error(23, createLocation(endTagStartPosition, this.clonePosition()));
1937
+ return {
1938
+ val: {
1939
+ type: 8,
1940
+ value: tagName,
1941
+ children,
1942
+ location: createLocation(startPosition, this.clonePosition())
1943
+ },
1944
+ err: null
1945
+ };
1946
+ } else return this.error(27, createLocation(startPosition, this.clonePosition()));
1947
+ } else return this.error(23, createLocation(startPosition, this.clonePosition()));
1948
+ }
1949
+ /**
1950
+ * This method assumes that the caller has peeked ahead for the first tag character.
1951
+ */
1952
+ parseTagName() {
1953
+ const startOffset = this.offset();
1954
+ this.bump();
1955
+ while (!this.isEOF() && _isPotentialElementNameChar(this.char())) this.bump();
1956
+ return this.message.slice(startOffset, this.offset());
1957
+ }
1958
+ parseLiteral(nestingLevel, parentArgType) {
1959
+ const start = this.clonePosition();
1960
+ let value = "";
1961
+ while (true) {
1962
+ const parseQuoteResult = this.tryParseQuote(parentArgType);
1963
+ if (parseQuoteResult) {
1964
+ value += parseQuoteResult;
1965
+ continue;
1966
+ }
1967
+ const parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);
1968
+ if (parseUnquotedResult) {
1969
+ value += parseUnquotedResult;
1970
+ continue;
1971
+ }
1972
+ const parseLeftAngleResult = this.tryParseLeftAngleBracket();
1973
+ if (parseLeftAngleResult) {
1974
+ value += parseLeftAngleResult;
1975
+ continue;
1976
+ }
1977
+ break;
1978
+ }
1979
+ const location = createLocation(start, this.clonePosition());
1980
+ return {
1981
+ val: {
1982
+ type: 0,
1983
+ value,
1984
+ location
1985
+ },
1986
+ err: null
1987
+ };
1988
+ }
1989
+ tryParseLeftAngleBracket() {
1990
+ if (!this.isEOF() && this.char() === 60 && (this.ignoreTag || !_isAlphaOrSlash(this.peek() || 0))) {
1991
+ this.bump();
1992
+ return "<";
1993
+ }
1994
+ return null;
1995
+ }
1996
+ /**
1997
+ * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes
1998
+ * a character that requires quoting (that is, "only where needed"), and works the same in
1999
+ * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.
2000
+ */
2001
+ tryParseQuote(parentArgType) {
2002
+ if (this.isEOF() || this.char() !== 39) return null;
2003
+ switch (this.peek()) {
2004
+ case 39:
2005
+ this.bump();
2006
+ this.bump();
2007
+ return "'";
2008
+ case 123:
2009
+ case 60:
2010
+ case 62:
2011
+ case 125: break;
2012
+ case 35:
2013
+ if (parentArgType === "plural" || parentArgType === "selectordinal") break;
2014
+ return null;
2015
+ default: return null;
2016
+ }
2017
+ this.bump();
2018
+ const codePoints = [this.char()];
2019
+ this.bump();
2020
+ while (!this.isEOF()) {
2021
+ const ch = this.char();
2022
+ if (ch === 39) {
2023
+ if (this.peek() === 39) {
2024
+ codePoints.push(39);
2025
+ this.bump();
2026
+ } else {
2027
+ this.bump();
2028
+ break;
2029
+ }
2030
+ } else codePoints.push(ch);
2031
+ this.bump();
2032
+ }
2033
+ return String.fromCodePoint(...codePoints);
2034
+ }
2035
+ tryParseUnquoted(nestingLevel, parentArgType) {
2036
+ if (this.isEOF()) return null;
2037
+ const ch = this.char();
2038
+ if (ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0) return null;
2039
+ else {
2040
+ this.bump();
2041
+ return String.fromCodePoint(ch);
2042
+ }
2043
+ }
2044
+ parseArgument(nestingLevel, expectingCloseTag) {
2045
+ const openingBracePosition = this.clonePosition();
2046
+ this.bump();
2047
+ this.bumpSpace();
2048
+ if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
2049
+ if (this.char() === 125) {
2050
+ this.bump();
2051
+ return this.error(2, createLocation(openingBracePosition, this.clonePosition()));
2052
+ }
2053
+ let value = this.parseIdentifierIfPossible().value;
2054
+ if (!value) return this.error(3, createLocation(openingBracePosition, this.clonePosition()));
2055
+ this.bumpSpace();
2056
+ if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
2057
+ switch (this.char()) {
2058
+ case 125:
2059
+ this.bump();
2060
+ return {
2061
+ val: {
2062
+ type: 1,
2063
+ value,
2064
+ location: createLocation(openingBracePosition, this.clonePosition())
2065
+ },
2066
+ err: null
2067
+ };
2068
+ case 44:
2069
+ this.bump();
2070
+ this.bumpSpace();
2071
+ if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
2072
+ return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);
2073
+ default: return this.error(3, createLocation(openingBracePosition, this.clonePosition()));
2074
+ }
2075
+ }
2076
+ /**
2077
+ * Advance the parser until the end of the identifier, if it is currently on
2078
+ * an identifier character. Return an empty string otherwise.
2079
+ */
2080
+ parseIdentifierIfPossible() {
2081
+ const startingPosition = this.clonePosition();
2082
+ const startOffset = this.offset();
2083
+ const value = matchIdentifierAtIndex(this.message, startOffset);
2084
+ const endOffset = startOffset + value.length;
2085
+ this.bumpTo(endOffset);
2086
+ return {
2087
+ value,
2088
+ location: createLocation(startingPosition, this.clonePosition())
2089
+ };
2090
+ }
2091
+ parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition) {
2092
+ let typeStartPosition = this.clonePosition();
2093
+ let argType = this.parseIdentifierIfPossible().value;
2094
+ let typeEndPosition = this.clonePosition();
2095
+ switch (argType) {
2096
+ case "": return this.error(4, createLocation(typeStartPosition, typeEndPosition));
2097
+ case "number":
2098
+ case "date":
2099
+ case "time": {
2100
+ this.bumpSpace();
2101
+ let styleAndLocation = null;
2102
+ if (this.bumpIf(",")) {
2103
+ this.bumpSpace();
2104
+ const styleStartPosition = this.clonePosition();
2105
+ const result = this.parseSimpleArgStyleIfPossible();
2106
+ if (result.err) return result;
2107
+ const style = trimEnd(result.val);
2108
+ if (style.length === 0) return this.error(6, createLocation(this.clonePosition(), this.clonePosition()));
2109
+ styleAndLocation = {
2110
+ style,
2111
+ styleLocation: createLocation(styleStartPosition, this.clonePosition())
2112
+ };
2113
+ }
2114
+ const argCloseResult = this.tryParseArgumentClose(openingBracePosition);
2115
+ if (argCloseResult.err) return argCloseResult;
2116
+ const location = createLocation(openingBracePosition, this.clonePosition());
2117
+ if (styleAndLocation && styleAndLocation.style.startsWith("::")) {
2118
+ let skeleton = trimStart(styleAndLocation.style.slice(2));
2119
+ if (argType === "number") {
2120
+ const result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);
2121
+ if (result.err) return result;
2122
+ return {
2123
+ val: {
2124
+ type: 2,
2125
+ value,
2126
+ location,
2127
+ style: result.val
2128
+ },
2129
+ err: null
2130
+ };
2131
+ } else {
2132
+ if (skeleton.length === 0) return this.error(10, location);
2133
+ let dateTimePattern = skeleton;
2134
+ if (this.locale) dateTimePattern = getBestPattern(skeleton, this.locale);
2135
+ const style = {
2136
+ type: 1,
2137
+ pattern: dateTimePattern,
2138
+ location: styleAndLocation.styleLocation,
2139
+ parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(dateTimePattern) : {}
2140
+ };
2141
+ return {
2142
+ val: {
2143
+ type: argType === "date" ? 3 : 4,
2144
+ value,
2145
+ location,
2146
+ style
2147
+ },
2148
+ err: null
2149
+ };
2150
+ }
2151
+ }
2152
+ return {
2153
+ val: {
2154
+ type: argType === "number" ? 2 : argType === "date" ? 3 : 4,
2155
+ value,
2156
+ location,
2157
+ style: styleAndLocation?.style ?? null
2158
+ },
2159
+ err: null
2160
+ };
2161
+ }
2162
+ case "plural":
2163
+ case "selectordinal":
2164
+ case "select": {
2165
+ const typeEndPosition = this.clonePosition();
2166
+ this.bumpSpace();
2167
+ if (!this.bumpIf(",")) return this.error(12, createLocation(typeEndPosition, { ...typeEndPosition }));
2168
+ this.bumpSpace();
2169
+ let identifierAndLocation = this.parseIdentifierIfPossible();
2170
+ let pluralOffset = 0;
2171
+ if (argType !== "select" && identifierAndLocation.value === "offset") {
2172
+ if (!this.bumpIf(":")) return this.error(13, createLocation(this.clonePosition(), this.clonePosition()));
2173
+ this.bumpSpace();
2174
+ const result = this.tryParseDecimalInteger(13, 14);
2175
+ if (result.err) return result;
2176
+ this.bumpSpace();
2177
+ identifierAndLocation = this.parseIdentifierIfPossible();
2178
+ pluralOffset = result.val;
2179
+ }
2180
+ const optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);
2181
+ if (optionsResult.err) return optionsResult;
2182
+ const argCloseResult = this.tryParseArgumentClose(openingBracePosition);
2183
+ if (argCloseResult.err) return argCloseResult;
2184
+ const location = createLocation(openingBracePosition, this.clonePosition());
2185
+ if (argType === "select") return {
2186
+ val: {
2187
+ type: 5,
2188
+ value,
2189
+ options: fromEntries(optionsResult.val),
2190
+ location
2191
+ },
2192
+ err: null
2193
+ };
2194
+ else return {
2195
+ val: {
2196
+ type: 6,
2197
+ value,
2198
+ options: fromEntries(optionsResult.val),
2199
+ offset: pluralOffset,
2200
+ pluralType: argType === "plural" ? "cardinal" : "ordinal",
2201
+ location
2202
+ },
2203
+ err: null
2204
+ };
2205
+ }
2206
+ default: return this.error(5, createLocation(typeStartPosition, typeEndPosition));
2207
+ }
2208
+ }
2209
+ tryParseArgumentClose(openingBracePosition) {
2210
+ if (this.isEOF() || this.char() !== 125) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
2211
+ this.bump();
2212
+ return {
2213
+ val: true,
2214
+ err: null
2215
+ };
2216
+ }
2217
+ /**
2218
+ * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659
2219
+ */
2220
+ parseSimpleArgStyleIfPossible() {
2221
+ let nestedBraces = 0;
2222
+ const startPosition = this.clonePosition();
2223
+ while (!this.isEOF()) switch (this.char()) {
2224
+ case 39: {
2225
+ this.bump();
2226
+ let apostrophePosition = this.clonePosition();
2227
+ if (!this.bumpUntil("'")) return this.error(11, createLocation(apostrophePosition, this.clonePosition()));
2228
+ this.bump();
2229
+ break;
2230
+ }
2231
+ case 123:
2232
+ nestedBraces += 1;
2233
+ this.bump();
2234
+ break;
2235
+ case 125:
2236
+ if (nestedBraces > 0) nestedBraces -= 1;
2237
+ else return {
2238
+ val: this.message.slice(startPosition.offset, this.offset()),
2239
+ err: null
2240
+ };
2241
+ break;
2242
+ default: this.bump();
2243
+ }
2244
+ return {
2245
+ val: this.message.slice(startPosition.offset, this.offset()),
2246
+ err: null
2247
+ };
2248
+ }
2249
+ parseNumberSkeletonFromString(skeleton, location) {
2250
+ let tokens = [];
2251
+ try {
2252
+ tokens = parseNumberSkeletonFromString(skeleton);
2253
+ } catch {
2254
+ return this.error(7, location);
2255
+ }
2256
+ return {
2257
+ val: {
2258
+ type: 0,
2259
+ tokens,
2260
+ location,
2261
+ parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(tokens) : {}
2262
+ },
2263
+ err: null
2264
+ };
2265
+ }
2266
+ /**
2267
+ * @param nesting_level The current nesting level of messages.
2268
+ * This can be positive when parsing message fragment in select or plural argument options.
2269
+ * @param parent_arg_type The parent argument's type.
2270
+ * @param parsed_first_identifier If provided, this is the first identifier-like selector of
2271
+ * the argument. It is a by-product of a previous parsing attempt.
2272
+ * @param expecting_close_tag If true, this message is directly or indirectly nested inside
2273
+ * between a pair of opening and closing tags. The nested message will not parse beyond
2274
+ * the closing tag boundary.
2275
+ */
2276
+ tryParsePluralOrSelectOptions(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {
2277
+ let hasOtherClause = false;
2278
+ const options = [];
2279
+ const parsedSelectors = /* @__PURE__ */ new Set();
2280
+ let { value: selector, location: selectorLocation } = parsedFirstIdentifier;
2281
+ while (true) {
2282
+ if (selector.length === 0) {
2283
+ const startPosition = this.clonePosition();
2284
+ if (parentArgType !== "select" && this.bumpIf("=")) {
2285
+ const result = this.tryParseDecimalInteger(16, 19);
2286
+ if (result.err) return result;
2287
+ selectorLocation = createLocation(startPosition, this.clonePosition());
2288
+ selector = this.message.slice(startPosition.offset, this.offset());
2289
+ } else break;
2290
+ }
2291
+ if (parsedSelectors.has(selector)) return this.error(parentArgType === "select" ? 21 : 20, selectorLocation);
2292
+ if (selector === "other") hasOtherClause = true;
2293
+ this.bumpSpace();
2294
+ const openingBracePosition = this.clonePosition();
2295
+ if (!this.bumpIf("{")) return this.error(parentArgType === "select" ? 17 : 18, createLocation(this.clonePosition(), this.clonePosition()));
2296
+ const fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);
2297
+ if (fragmentResult.err) return fragmentResult;
2298
+ const argCloseResult = this.tryParseArgumentClose(openingBracePosition);
2299
+ if (argCloseResult.err) return argCloseResult;
2300
+ options.push([selector, {
2301
+ value: fragmentResult.val,
2302
+ location: createLocation(openingBracePosition, this.clonePosition())
2303
+ }]);
2304
+ parsedSelectors.add(selector);
2305
+ this.bumpSpace();
2306
+ ({value: selector, location: selectorLocation} = this.parseIdentifierIfPossible());
2307
+ }
2308
+ if (options.length === 0) return this.error(parentArgType === "select" ? 15 : 16, createLocation(this.clonePosition(), this.clonePosition()));
2309
+ if (this.requiresOtherClause && !hasOtherClause) return this.error(22, createLocation(this.clonePosition(), this.clonePosition()));
2310
+ return {
2311
+ val: options,
2312
+ err: null
2313
+ };
2314
+ }
2315
+ tryParseDecimalInteger(expectNumberError, invalidNumberError) {
2316
+ let sign = 1;
2317
+ const startingPosition = this.clonePosition();
2318
+ if (this.bumpIf("+")) {} else if (this.bumpIf("-")) sign = -1;
2319
+ let hasDigits = false;
2320
+ let decimal = 0;
2321
+ while (!this.isEOF()) {
2322
+ const ch = this.char();
2323
+ if (ch >= 48 && ch <= 57) {
2324
+ hasDigits = true;
2325
+ decimal = decimal * 10 + (ch - 48);
2326
+ this.bump();
2327
+ } else break;
2328
+ }
2329
+ const location = createLocation(startingPosition, this.clonePosition());
2330
+ if (!hasDigits) return this.error(expectNumberError, location);
2331
+ decimal *= sign;
2332
+ if (!Number.isSafeInteger(decimal)) return this.error(invalidNumberError, location);
2333
+ return {
2334
+ val: decimal,
2335
+ err: null
2336
+ };
2337
+ }
2338
+ offset() {
2339
+ return this.position.offset;
2340
+ }
2341
+ isEOF() {
2342
+ return this.offset() === this.message.length;
2343
+ }
2344
+ clonePosition() {
2345
+ return {
2346
+ offset: this.position.offset,
2347
+ line: this.position.line,
2348
+ column: this.position.column
2349
+ };
2350
+ }
2351
+ /**
2352
+ * Return the code point at the current position of the parser.
2353
+ * Throws if the index is out of bound.
2354
+ */
2355
+ char() {
2356
+ const offset = this.position.offset;
2357
+ if (offset >= this.message.length) throw Error("out of bound");
2358
+ const code = this.message.codePointAt(offset);
2359
+ if (code === void 0) throw Error(`Offset ${offset} is at invalid UTF-16 code unit boundary`);
2360
+ return code;
2361
+ }
2362
+ error(kind, location) {
2363
+ return {
2364
+ val: null,
2365
+ err: {
2366
+ kind,
2367
+ message: this.message,
2368
+ location
2369
+ }
2370
+ };
2371
+ }
2372
+ /** Bump the parser to the next UTF-16 code unit. */
2373
+ bump() {
2374
+ if (this.isEOF()) return;
2375
+ const code = this.char();
2376
+ if (code === 10) {
2377
+ this.position.line += 1;
2378
+ this.position.column = 1;
2379
+ this.position.offset += 1;
2380
+ } else {
2381
+ this.position.column += 1;
2382
+ this.position.offset += code < 65536 ? 1 : 2;
2383
+ }
2384
+ }
2385
+ /**
2386
+ * If the substring starting at the current position of the parser has
2387
+ * the given prefix, then bump the parser to the character immediately
2388
+ * following the prefix and return true. Otherwise, don't bump the parser
2389
+ * and return false.
2390
+ */
2391
+ bumpIf(prefix) {
2392
+ const offset = this.offset();
2393
+ if (this.message.slice(offset, offset + prefix.length) === prefix) {
2394
+ for (let i = 0; i < prefix.length; i++) this.bump();
2395
+ return true;
2396
+ }
2397
+ return false;
2398
+ }
2399
+ /**
2400
+ * Bump the parser until the pattern character is found and return `true`.
2401
+ * Otherwise bump to the end of the file and return `false`.
2402
+ */
2403
+ bumpUntil(pattern) {
2404
+ const currentOffset = this.offset();
2405
+ const index = this.message.indexOf(pattern, currentOffset);
2406
+ if (index >= 0) {
2407
+ this.bumpTo(index);
2408
+ return true;
2409
+ } else {
2410
+ this.bumpTo(this.message.length);
2411
+ return false;
2412
+ }
2413
+ }
2414
+ /**
2415
+ * Bump the parser to the target offset.
2416
+ * If target offset is beyond the end of the input, bump the parser to the end of the input.
2417
+ */
2418
+ bumpTo(targetOffset) {
2419
+ if (this.offset() > targetOffset) throw Error(`targetOffset ${targetOffset} must be greater than or equal to the current offset ${this.offset()}`);
2420
+ targetOffset = Math.min(targetOffset, this.message.length);
2421
+ while (true) {
2422
+ const offset = this.offset();
2423
+ if (offset === targetOffset) break;
2424
+ if (offset > targetOffset) throw Error(`targetOffset ${targetOffset} is at invalid UTF-16 code unit boundary`);
2425
+ this.bump();
2426
+ if (this.isEOF()) break;
2427
+ }
2428
+ }
2429
+ /** advance the parser through all whitespace to the next non-whitespace code unit. */
2430
+ bumpSpace() {
2431
+ while (!this.isEOF() && _isWhiteSpace(this.char())) this.bump();
2432
+ }
2433
+ /**
2434
+ * Peek at the *next* Unicode codepoint in the input without advancing the parser.
2435
+ * If the input has been exhausted, then this returns null.
2436
+ */
2437
+ peek() {
2438
+ if (this.isEOF()) return null;
2439
+ const code = this.char();
2440
+ const offset = this.offset();
2441
+ return this.message.charCodeAt(offset + (code >= 65536 ? 2 : 1)) ?? null;
2442
+ }
2443
+ };
2444
+ /**
2445
+ * This check if codepoint is alphabet (lower & uppercase)
2446
+ * @param codepoint
2447
+ * @returns
2448
+ */
2449
+ function _isAlpha(codepoint) {
2450
+ return codepoint >= 97 && codepoint <= 122 || codepoint >= 65 && codepoint <= 90;
2451
+ }
2452
+ function _isAlphaOrSlash(codepoint) {
2453
+ return _isAlpha(codepoint) || codepoint === 47;
2454
+ }
2455
+ /** See `parseTag` function docs. */
2456
+ function _isPotentialElementNameChar(c) {
2457
+ return c === 45 || c === 46 || c >= 48 && c <= 57 || c === 95 || c >= 97 && c <= 122 || c >= 65 && c <= 90 || c == 183 || c >= 192 && c <= 214 || c >= 216 && c <= 246 || c >= 248 && c <= 893 || c >= 895 && c <= 8191 || c >= 8204 && c <= 8205 || c >= 8255 && c <= 8256 || c >= 8304 && c <= 8591 || c >= 11264 && c <= 12271 || c >= 12289 && c <= 55295 || c >= 63744 && c <= 64975 || c >= 65008 && c <= 65533 || c >= 65536 && c <= 983039;
2458
+ }
2459
+ /**
2460
+ * Code point equivalent of regex `\p{White_Space}`.
2461
+ * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
2462
+ */
2463
+ function _isWhiteSpace(c) {
2464
+ return c >= 9 && c <= 13 || c === 32 || c === 133 || c >= 8206 && c <= 8207 || c === 8232 || c === 8233;
2465
+ }
2466
+ function pruneLocation(els) {
2467
+ els.forEach((el) => {
2468
+ delete el.location;
2469
+ if (isSelectElement(el) || isPluralElement(el)) for (const k in el.options) {
2470
+ delete el.options[k].location;
2471
+ pruneLocation(el.options[k].value);
2472
+ }
2473
+ else if (isNumberElement(el) && isNumberSkeleton(el.style)) delete el.style.location;
2474
+ else if ((isDateElement(el) || isTimeElement(el)) && isDateTimeSkeleton(el.style)) delete el.style.location;
2475
+ else if (isTagElement(el)) pruneLocation(el.children);
2476
+ });
2477
+ }
2478
+ function parse(message, opts = {}) {
2479
+ opts = {
2480
+ shouldParseSkeletons: true,
2481
+ requiresOtherClause: true,
2482
+ ...opts
2483
+ };
2484
+ const result = new Parser(message, opts).parse();
2485
+ if (result.err) {
2486
+ const error = SyntaxError(ErrorKind[result.err.kind]);
2487
+ error.location = result.err.location;
2488
+ error.originalMessage = result.err.message;
2489
+ throw error;
2490
+ }
2491
+ if (!opts?.captureLocation) pruneLocation(result.val);
2492
+ return result.val;
2493
+ }
2494
+ //#endregion
2495
+ //#region packages/intl-messageformat/error.ts
2496
+ let ErrorCode = /* @__PURE__ */ function(ErrorCode) {
2497
+ ErrorCode["MISSING_VALUE"] = "MISSING_VALUE";
2498
+ ErrorCode["INVALID_VALUE"] = "INVALID_VALUE";
2499
+ ErrorCode["MISSING_INTL_API"] = "MISSING_INTL_API";
2500
+ return ErrorCode;
2501
+ }({});
2502
+ var FormatError = class extends Error {
2503
+ constructor(msg, code, originalMessage) {
2504
+ super(msg);
2505
+ this.code = code;
2506
+ this.originalMessage = originalMessage;
2507
+ }
2508
+ toString() {
2509
+ return `[formatjs Error: ${this.code}] ${this.message}`;
2510
+ }
2511
+ };
2512
+ var InvalidValueError = class extends FormatError {
2513
+ constructor(variableId, value, options, originalMessage) {
2514
+ super(`Invalid values for "${variableId}": "${value}". Options are "${Object.keys(options).join("\", \"")}"`, "INVALID_VALUE", originalMessage);
2515
+ }
2516
+ };
2517
+ var InvalidValueTypeError = class extends FormatError {
2518
+ constructor(value, type, originalMessage) {
2519
+ super(`Value for "${value}" must be of type ${type}`, "INVALID_VALUE", originalMessage);
2520
+ }
2521
+ };
2522
+ var MissingValueError = class extends FormatError {
2523
+ constructor(variableId, originalMessage) {
2524
+ super(`The intl string context variable "${variableId}" was not provided to the string "${originalMessage}"`, "MISSING_VALUE", originalMessage);
2525
+ }
2526
+ };
2527
+ //#endregion
2528
+ //#region packages/intl-messageformat/formatters.ts
2529
+ let PART_TYPE = /* @__PURE__ */ function(PART_TYPE) {
2530
+ PART_TYPE[PART_TYPE["literal"] = 0] = "literal";
2531
+ PART_TYPE[PART_TYPE["object"] = 1] = "object";
2532
+ return PART_TYPE;
2533
+ }({});
2534
+ function mergeLiteral(parts) {
2535
+ if (parts.length < 2) return parts;
2536
+ return parts.reduce((all, part) => {
2537
+ const lastPart = all[all.length - 1];
2538
+ if (!lastPart || lastPart.type !== 0 || part.type !== 0) all.push(part);
2539
+ else lastPart.value += part.value;
2540
+ return all;
2541
+ }, []);
2542
+ }
2543
+ function isFormatXMLElementFn(el) {
2544
+ return typeof el === "function";
2545
+ }
2546
+ function formatToParts(els, locales, formatters, formats, values, currentPluralValue, originalMessage) {
2547
+ if (els.length === 1 && isLiteralElement(els[0])) return [{
2548
+ type: 0,
2549
+ value: els[0].value
2550
+ }];
2551
+ const result = [];
2552
+ for (const el of els) {
2553
+ if (isLiteralElement(el)) {
2554
+ result.push({
2555
+ type: 0,
2556
+ value: el.value
2557
+ });
2558
+ continue;
2559
+ }
2560
+ if (isPoundElement(el)) {
2561
+ if (typeof currentPluralValue === "number") result.push({
2562
+ type: 0,
2563
+ value: formatters.getNumberFormat(locales).format(currentPluralValue)
2564
+ });
2565
+ continue;
2566
+ }
2567
+ const { value: varName } = el;
2568
+ if (!(values && varName in values)) throw new MissingValueError(varName, originalMessage);
2569
+ let value = values[varName];
2570
+ if (isArgumentElement(el)) {
2571
+ if (!value || typeof value === "string" || typeof value === "number" || typeof value === "bigint") value = typeof value === "string" || typeof value === "number" || typeof value === "bigint" ? String(value) : "";
2572
+ result.push({
2573
+ type: typeof value === "string" ? 0 : 1,
2574
+ value
2575
+ });
2576
+ continue;
2577
+ }
2578
+ if (isDateElement(el)) {
2579
+ const style = typeof el.style === "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0;
2580
+ result.push({
2581
+ type: 0,
2582
+ value: formatters.getDateTimeFormat(locales, style).format(value)
2583
+ });
2584
+ continue;
2585
+ }
2586
+ if (isTimeElement(el)) {
2587
+ const style = typeof el.style === "string" ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : formats.time.medium;
2588
+ result.push({
2589
+ type: 0,
2590
+ value: formatters.getDateTimeFormat(locales, style).format(value)
2591
+ });
2592
+ continue;
2593
+ }
2594
+ if (isNumberElement(el)) {
2595
+ const style = typeof el.style === "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : void 0;
2596
+ if (style && style.scale) {
2597
+ const scale = style.scale || 1;
2598
+ if (typeof value === "bigint") {
2599
+ if (!Number.isInteger(scale)) throw new TypeError(`Cannot apply fractional scale ${scale} to bigint value. Scale must be an integer when formatting bigint.`);
2600
+ value = value * BigInt(scale);
2601
+ } else value = value * scale;
2602
+ }
2603
+ result.push({
2604
+ type: 0,
2605
+ value: formatters.getNumberFormat(locales, style).format(value)
2606
+ });
2607
+ continue;
2608
+ }
2609
+ if (isTagElement(el)) {
2610
+ const { children, value } = el;
2611
+ const formatFn = values[value];
2612
+ if (!isFormatXMLElementFn(formatFn)) throw new InvalidValueTypeError(value, "function", originalMessage);
2613
+ let chunks = formatFn(formatToParts(children, locales, formatters, formats, values, currentPluralValue).map((p) => p.value));
2614
+ if (!Array.isArray(chunks)) chunks = [chunks];
2615
+ result.push(...chunks.map((c) => {
2616
+ return {
2617
+ type: typeof c === "string" ? 0 : 1,
2618
+ value: c
2619
+ };
2620
+ }));
2621
+ }
2622
+ if (isSelectElement(el)) {
2623
+ const key = value;
2624
+ const opt = (Object.prototype.hasOwnProperty.call(el.options, key) ? el.options[key] : void 0) || el.options.other;
2625
+ if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
2626
+ result.push(...formatToParts(opt.value, locales, formatters, formats, values));
2627
+ continue;
2628
+ }
2629
+ if (isPluralElement(el)) {
2630
+ const exactKey = `=${value}`;
2631
+ let opt = Object.prototype.hasOwnProperty.call(el.options, exactKey) ? el.options[exactKey] : void 0;
2632
+ if (!opt) {
2633
+ if (!Intl.PluralRules) throw new FormatError(`Intl.PluralRules is not available in this environment.
2634
+ Try polyfilling it using "@formatjs/intl-pluralrules"
2635
+ `, "MISSING_INTL_API", originalMessage);
2636
+ const numericValue = typeof value === "bigint" ? Number(value) : value;
2637
+ const rule = formatters.getPluralRules(locales, { type: el.pluralType }).select(numericValue - (el.offset || 0));
2638
+ opt = (Object.prototype.hasOwnProperty.call(el.options, rule) ? el.options[rule] : void 0) || el.options.other;
2639
+ }
2640
+ if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
2641
+ const numericValue = typeof value === "bigint" ? Number(value) : value;
2642
+ result.push(...formatToParts(opt.value, locales, formatters, formats, values, numericValue - (el.offset || 0)));
2643
+ continue;
2644
+ }
2645
+ }
2646
+ return mergeLiteral(result);
2647
+ }
2648
+ //#endregion
2649
+ //#region packages/intl-messageformat/core.ts
2650
+ function mergeConfig(c1, c2) {
2651
+ if (!c2) return c1;
2652
+ return {
2653
+ ...c1,
2654
+ ...c2,
2655
+ ...Object.keys(c1).reduce((all, k) => {
2656
+ all[k] = {
2657
+ ...c1[k],
2658
+ ...c2[k]
2659
+ };
2660
+ return all;
2661
+ }, {})
2662
+ };
2663
+ }
2664
+ function mergeConfigs(defaultConfig, configs) {
2665
+ if (!configs) return defaultConfig;
2666
+ return Object.keys(defaultConfig).reduce((all, k) => {
2667
+ all[k] = mergeConfig(defaultConfig[k], configs[k]);
2668
+ return all;
2669
+ }, { ...defaultConfig });
2670
+ }
2671
+ function createFastMemoizeCache(store) {
2672
+ return { create() {
2673
+ return {
2674
+ get(key) {
2675
+ return store[key];
2676
+ },
2677
+ set(key, value) {
2678
+ store[key] = value;
2679
+ }
2680
+ };
2681
+ } };
2682
+ }
2683
+ function createDefaultFormatters(cache = {
2684
+ number: {},
2685
+ dateTime: {},
2686
+ pluralRules: {}
2687
+ }) {
2688
+ return {
2689
+ getNumberFormat: memoize((...args) => new Intl.NumberFormat(...args), {
2690
+ cache: createFastMemoizeCache(cache.number),
2691
+ strategy: strategies.variadic
2692
+ }),
2693
+ getDateTimeFormat: memoize((...args) => new Intl.DateTimeFormat(...args), {
2694
+ cache: createFastMemoizeCache(cache.dateTime),
2695
+ strategy: strategies.variadic
2696
+ }),
2697
+ getPluralRules: memoize((...args) => new Intl.PluralRules(...args), {
2698
+ cache: createFastMemoizeCache(cache.pluralRules),
2699
+ strategy: strategies.variadic
2700
+ })
2701
+ };
2702
+ }
2703
+ var IntlMessageFormat = class IntlMessageFormat {
2704
+ constructor(message, locales = IntlMessageFormat.defaultLocale, overrideFormats, opts) {
2705
+ this.formatterCache = {
2706
+ number: {},
2707
+ dateTime: {},
2708
+ pluralRules: {}
2709
+ };
2710
+ this.format = ((values) => {
2711
+ const parts = this.formatToParts(values);
2712
+ if (parts.length === 1) return parts[0].value;
2713
+ const result = parts.reduce((all, part) => {
2714
+ if (!all.length || part.type !== 0 || typeof all[all.length - 1] !== "string") all.push(part.value);
2715
+ else all[all.length - 1] += part.value;
2716
+ return all;
2717
+ }, []);
2718
+ if (result.length <= 1) return result[0] || "";
2719
+ return result;
2720
+ });
2721
+ this.formatToParts = ((values) => formatToParts(this.ast, this.locales, this.formatters, this.formats, values, void 0, this.message));
2722
+ this.resolvedOptions = () => ({ locale: this.resolvedLocale?.toString() || Intl.NumberFormat.supportedLocalesOf(this.locales)[0] });
2723
+ this.getAst = () => this.ast;
2724
+ this.locales = locales;
2725
+ this.resolvedLocale = IntlMessageFormat.resolveLocale(locales);
2726
+ if (typeof message === "string") {
2727
+ this.message = message;
2728
+ if (!IntlMessageFormat.__parse) throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
2729
+ const { ...parseOpts } = opts || {};
2730
+ this.ast = IntlMessageFormat.__parse(message, {
2731
+ ...parseOpts,
2732
+ locale: this.resolvedLocale
2733
+ });
2734
+ } else this.ast = message;
2735
+ if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST.");
2736
+ this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats);
2737
+ this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache);
2738
+ }
2739
+ static {
2740
+ this.memoizedDefaultLocale = null;
2741
+ }
2742
+ static get defaultLocale() {
2743
+ if (!IntlMessageFormat.memoizedDefaultLocale) IntlMessageFormat.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
2744
+ return IntlMessageFormat.memoizedDefaultLocale;
2745
+ }
2746
+ static {
2747
+ this.resolveLocale = (locales) => {
2748
+ if (typeof Intl.Locale === "undefined") return;
2749
+ const supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);
2750
+ if (supportedLocales.length > 0) return new Intl.Locale(supportedLocales[0]);
2751
+ return new Intl.Locale(typeof locales === "string" ? locales : locales[0]);
2752
+ };
2753
+ }
2754
+ static {
2755
+ this.__parse = parse;
2756
+ }
2757
+ static {
2758
+ this.formats = {
2759
+ number: {
2760
+ integer: { maximumFractionDigits: 0 },
2761
+ currency: { style: "currency" },
2762
+ percent: { style: "percent" }
2763
+ },
2764
+ date: {
2765
+ short: {
2766
+ month: "numeric",
2767
+ day: "numeric",
2768
+ year: "2-digit"
2769
+ },
2770
+ medium: {
2771
+ month: "short",
2772
+ day: "numeric",
2773
+ year: "numeric"
2774
+ },
2775
+ long: {
2776
+ month: "long",
2777
+ day: "numeric",
2778
+ year: "numeric"
2779
+ },
2780
+ full: {
2781
+ weekday: "long",
2782
+ month: "long",
2783
+ day: "numeric",
2784
+ year: "numeric"
2785
+ }
2786
+ },
2787
+ time: {
2788
+ short: {
2789
+ hour: "numeric",
2790
+ minute: "numeric"
2791
+ },
2792
+ medium: {
2793
+ hour: "numeric",
2794
+ minute: "numeric",
2795
+ second: "numeric"
2796
+ },
2797
+ long: {
2798
+ hour: "numeric",
2799
+ minute: "numeric",
2800
+ second: "numeric",
2801
+ timeZoneName: "short"
2802
+ },
2803
+ full: {
2804
+ hour: "numeric",
2805
+ minute: "numeric",
2806
+ second: "numeric",
2807
+ timeZoneName: "short"
2808
+ }
2809
+ }
2810
+ };
2811
+ }
2812
+ };
2813
+ //#endregion
2814
+ //#region packages/intl-messageformat/index.ts
2815
+ var intl_messageformat_default = IntlMessageFormat;
2816
+ //#endregion
2817
+ export { ErrorCode, FormatError, IntlMessageFormat, InvalidValueError, InvalidValueTypeError, MissingValueError, PART_TYPE, intl_messageformat_default as default, formatToParts, isFormatXMLElementFn };
2818
+
2819
+ //# sourceMappingURL=intl-messageformat.iife.js.map