@manafishrov/ui 1.5.8 → 1.5.10

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 (268) hide show
  1. package/dist/Locale.js +1 -1
  2. package/dist/components/Accordion.js +2 -2
  3. package/dist/components/AlertDialog.js +2 -2
  4. package/dist/components/AspectRatio.js +1 -1
  5. package/dist/components/Avatar.js +2 -2
  6. package/dist/components/Badge.js +1 -1
  7. package/dist/components/Breadcrumb.js +1 -1
  8. package/dist/components/Button.js +1 -1
  9. package/dist/components/Card.js +1 -1
  10. package/dist/components/Carousel.js +2 -2
  11. package/dist/components/Checkbox.js +2 -2
  12. package/dist/components/Collapsible.js +2 -2
  13. package/dist/components/Combobox.js +2 -2
  14. package/dist/components/DatePicker.js +2 -2
  15. package/dist/components/Dialog.js +2 -2
  16. package/dist/components/Empty.js +1 -1
  17. package/dist/components/Field.js +3 -3
  18. package/dist/components/HoverCard.js +2 -2
  19. package/dist/components/InputGroup.js +1 -1
  20. package/dist/components/Item.js +1 -1
  21. package/dist/components/Kbd.js +1 -1
  22. package/dist/components/Link.js +1 -1
  23. package/dist/components/Menu.js +2 -2
  24. package/dist/components/MenuCombobox.js +2 -2
  25. package/dist/components/MenuComboboxList.js +3 -3
  26. package/dist/components/MenuComboboxList.js.map +1 -1
  27. package/dist/components/NavigationMenu.js +2 -2
  28. package/dist/components/NumberInput.js +2 -2
  29. package/dist/components/Pagination.js +2 -2
  30. package/dist/components/PasswordInput.js +2 -2
  31. package/dist/components/PinInput.js +2 -2
  32. package/dist/components/Popover.js +2 -2
  33. package/dist/components/Progress.js +2 -2
  34. package/dist/components/RadioGroup.js +2 -2
  35. package/dist/components/ScrollArea.js +2 -2
  36. package/dist/components/Select.js +2 -2
  37. package/dist/components/Separator.js +1 -1
  38. package/dist/components/Sheet.js +2 -2
  39. package/dist/components/Skeleton.js +1 -1
  40. package/dist/components/Slider.js +3 -3
  41. package/dist/components/Spinner.js +1 -1
  42. package/dist/components/Splitter.js +2 -2
  43. package/dist/components/Swap.js +2 -2
  44. package/dist/components/Switch.js +2 -2
  45. package/dist/components/Table.js +1 -1
  46. package/dist/components/Tabs.js +2 -2
  47. package/dist/components/TagsInput.js +2 -2
  48. package/dist/components/TextInput.js +2 -2
  49. package/dist/components/Toggle.js +3 -3
  50. package/dist/components/Tooltip.js +2 -2
  51. package/dist/components/TreeView.js +3 -3
  52. package/dist/components/Typography.js +1 -1
  53. package/dist/components/form/AutoSubmit.js +1 -1
  54. package/dist/components/form/AutoSubmit.js.map +1 -1
  55. package/dist/components/form/Form.js +1 -1
  56. package/dist/components/marquee/Marquee.js +2 -2
  57. package/dist/components/sidebar/SidebarDesktop.js +1 -1
  58. package/dist/components/sidebar/SidebarMenu.js +2 -2
  59. package/dist/components/sidebar/SidebarProvider.js +1 -1
  60. package/dist/components/sidebar/SidebarSubComponents.js +1 -1
  61. package/dist/components/sidebar/utils.js +10 -6
  62. package/dist/components/sidebar/utils.js.map +1 -1
  63. package/dist/components/toaster/Toaster.js +2 -2
  64. package/dist/index.js +11 -11
  65. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/24WXBTEA.js +1 -1
  66. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/24WXBTEA.js.map +1 -1
  67. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/262SJY3P.js +1 -1
  68. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/262SJY3P.js.map +1 -1
  69. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/4YNGVMW2.js +1 -1
  70. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/4YNGVMW2.js.map +1 -1
  71. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/5BSMJBO7.js +2 -2
  72. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/5BSMJBO7.js.map +1 -1
  73. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/6P2AQNUE.js +1 -1
  74. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/6P2AQNUE.js.map +1 -1
  75. package/dist/node_modules/.bun/@ark-ui_solid@5.37.1_ee58d66d663bac7b/node_modules/@ark-ui/solid/dist/chunk/6WEDGJKQ.js +7 -0
  76. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/6WEDGJKQ.js.map +1 -1
  77. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/7CKWCVWS.js +2 -2
  78. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/7CKWCVWS.js.map +1 -1
  79. package/dist/node_modules/.bun/@ark-ui_solid@5.37.1_ee58d66d663bac7b/node_modules/@ark-ui/solid/dist/chunk/7IUG3E2V.js +11 -0
  80. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/7IUG3E2V.js.map +1 -1
  81. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/7TJ23CV6.js +4 -4
  82. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/7TJ23CV6.js.map +1 -1
  83. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/7ZWSMUDG.js +4 -4
  84. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/7ZWSMUDG.js.map +1 -1
  85. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/ABFLCPUB.js +4 -4
  86. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/ABFLCPUB.js.map +1 -1
  87. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/ACLCLMIV.js +4 -4
  88. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/ACLCLMIV.js.map +1 -1
  89. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/B4FK2JQ2.js +4 -4
  90. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/B4FK2JQ2.js.map +1 -1
  91. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/BRHQTJMC.js +1 -1
  92. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/BRHQTJMC.js.map +1 -1
  93. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/BYLUEJKC.js +1 -1
  94. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/BYLUEJKC.js.map +1 -1
  95. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/DK7UDQTF.js +1 -1
  96. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/DK7UDQTF.js.map +1 -1
  97. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/EFII6TXL.js +2 -2
  98. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/EFII6TXL.js.map +1 -1
  99. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/EIL4Q3B2.js +4 -4
  100. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/EIL4Q3B2.js.map +1 -1
  101. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/EQKTJ63X.js +1 -1
  102. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/EQKTJ63X.js.map +1 -1
  103. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/F42QOCL3.js +1 -1
  104. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/F42QOCL3.js.map +1 -1
  105. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/FDUCX4MC.js +4 -4
  106. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/FDUCX4MC.js.map +1 -1
  107. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/GQGTRTK7.js +4 -4
  108. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/GQGTRTK7.js.map +1 -1
  109. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/GSOOONDM.js +4 -4
  110. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/GSOOONDM.js.map +1 -1
  111. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/GYKEGNPI.js +4 -4
  112. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/GYKEGNPI.js.map +1 -1
  113. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/HDGILMRT.js +1 -1
  114. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/HDGILMRT.js.map +1 -1
  115. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/HOPBYFHD.js +1 -1
  116. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/HOPBYFHD.js.map +1 -1
  117. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/HRY5AU2J.js +2 -2
  118. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/HRY5AU2J.js.map +1 -1
  119. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/JCNWK3IN.js +1 -1
  120. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/JCNWK3IN.js.map +1 -1
  121. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/JFFM62IG.js +4 -4
  122. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/JFFM62IG.js.map +1 -1
  123. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/KD4YD745.js +4 -4
  124. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/KD4YD745.js.map +1 -1
  125. package/dist/node_modules/.bun/@ark-ui_solid@5.37.1_ee58d66d663bac7b/node_modules/@ark-ui/solid/dist/chunk/KGOB2IMX.js +6 -0
  126. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/KGOB2IMX.js.map +1 -1
  127. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/KNU3M6A2.js +4 -4
  128. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/KNU3M6A2.js.map +1 -1
  129. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/LESIO3YG.js +4 -4
  130. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/LESIO3YG.js.map +1 -1
  131. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/LXG74MYL.js +1 -1
  132. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/LXG74MYL.js.map +1 -1
  133. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/M2R7NELL.js +4 -4
  134. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/M2R7NELL.js.map +1 -1
  135. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/MGY733CD.js +4 -4
  136. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/MGY733CD.js.map +1 -1
  137. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/MLPK6MO2.js +4 -4
  138. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/MLPK6MO2.js.map +1 -1
  139. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/MPLFL3UT.js +4 -4
  140. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/MPLFL3UT.js.map +1 -1
  141. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/MU5CM6ZP.js +4 -4
  142. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/MU5CM6ZP.js.map +1 -1
  143. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/NCE6DH5U.js +4 -4
  144. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/NCE6DH5U.js.map +1 -1
  145. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/NEU4F4NG.js +2 -2
  146. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/NEU4F4NG.js.map +1 -1
  147. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/OEGORBLT.js +3 -3
  148. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/OEGORBLT.js.map +1 -1
  149. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/OWH3LOUE.js +1 -1
  150. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/OWH3LOUE.js.map +1 -1
  151. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/PT2CJE3O.js +1 -1
  152. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/PT2CJE3O.js.map +1 -1
  153. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/RKHQFO6B.js +4 -4
  154. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/RKHQFO6B.js.map +1 -1
  155. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/T7LMRH7K.js +1 -1
  156. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/T7LMRH7K.js.map +1 -1
  157. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/TD72MSSI.js +4 -4
  158. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/TD72MSSI.js.map +1 -1
  159. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/TG3BV4FJ.js +5 -5
  160. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/TG3BV4FJ.js.map +1 -1
  161. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/TPQNIWB6.js +4 -4
  162. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/TPQNIWB6.js.map +1 -1
  163. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/TPTP4FRI.js +4 -4
  164. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/TPTP4FRI.js.map +1 -1
  165. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/UFYZ7HLU.js +2 -2
  166. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/UFYZ7HLU.js.map +1 -1
  167. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/UZJJWJQM.js +1 -1
  168. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/UZJJWJQM.js.map +1 -1
  169. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/VNMGX67M.js +1 -1
  170. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/VNMGX67M.js.map +1 -1
  171. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/VQPWR4W5.js +1 -1
  172. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/VQPWR4W5.js.map +1 -1
  173. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/WZBYH43M.js +4 -4
  174. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/WZBYH43M.js.map +1 -1
  175. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/X4OUYL6X.js +4 -4
  176. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/X4OUYL6X.js.map +1 -1
  177. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/XRMLYMEN.js +4 -4
  178. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/XRMLYMEN.js.map +1 -1
  179. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/XVU3GCCX.js +1 -1
  180. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/XVU3GCCX.js.map +1 -1
  181. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/YW4KS3S5.js +4 -4
  182. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/YW4KS3S5.js.map +1 -1
  183. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/ZJ6ILZ5N.js +4 -4
  184. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/ZJ6ILZ5N.js.map +1 -1
  185. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/ZOCG4ZHL.js +4 -4
  186. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/chunk/ZOCG4ZHL.js.map +1 -1
  187. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/components/navigation-menu/index.js +4 -4
  188. package/dist/node_modules/.bun/{@ark-ui_solid@5.37.1_da624007e3df32b4 → @ark-ui_solid@5.37.1_ee58d66d663bac7b}/node_modules/@ark-ui/solid/dist/components/navigation-menu/index.js.map +1 -1
  189. package/dist/node_modules/.bun/{@floating-ui_core@1.7.5 → @floating-ui_core@1.8.0}/node_modules/@floating-ui/core/dist/floating-ui.core.js +30 -50
  190. package/dist/node_modules/.bun/@floating-ui_core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -0
  191. package/dist/node_modules/.bun/@floating-ui_dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +324 -0
  192. package/dist/node_modules/.bun/@floating-ui_dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
  193. package/dist/node_modules/.bun/{@floating-ui_utils@0.2.11 → @floating-ui_utils@0.2.12}/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +2 -2
  194. package/dist/node_modules/.bun/{@floating-ui_utils@0.2.11 → @floating-ui_utils@0.2.12}/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -1
  195. package/dist/node_modules/.bun/{@floating-ui_utils@0.2.11 → @floating-ui_utils@0.2.12}/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +5 -6
  196. package/dist/node_modules/.bun/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
  197. package/dist/node_modules/.bun/{@solid-primitives_keyed@1.5.3_da624007e3df32b4 → @solid-primitives_keyed@1.5.3_ee58d66d663bac7b}/node_modules/@solid-primitives/keyed/dist/index.js +1 -1
  198. package/dist/node_modules/.bun/{@solid-primitives_keyed@1.5.3_da624007e3df32b4 → @solid-primitives_keyed@1.5.3_ee58d66d663bac7b}/node_modules/@solid-primitives/keyed/dist/index.js.map +1 -1
  199. package/dist/node_modules/.bun/@zag-js_checkbox@1.41.2/node_modules/@zag-js/checkbox/dist/checkbox.machine.js +1 -1
  200. package/dist/node_modules/.bun/@zag-js_checkbox@1.41.2/node_modules/@zag-js/checkbox/dist/checkbox.machine.js.map +1 -1
  201. package/dist/node_modules/.bun/@zag-js_collection@1.41.2/node_modules/@zag-js/collection/dist/list-collection.js +2 -2
  202. package/dist/node_modules/.bun/@zag-js_collection@1.41.2/node_modules/@zag-js/collection/dist/list-collection.js.map +1 -1
  203. package/dist/node_modules/.bun/@zag-js_combobox@1.41.2/node_modules/@zag-js/combobox/dist/combobox.machine.js +1 -1
  204. package/dist/node_modules/.bun/@zag-js_combobox@1.41.2/node_modules/@zag-js/combobox/dist/combobox.machine.js.map +1 -1
  205. package/dist/node_modules/.bun/@zag-js_date-utils@1.41.2_3f114a46406f1e64/node_modules/@zag-js/date-utils/dist/locale.js +1 -1
  206. package/dist/node_modules/.bun/@zag-js_date-utils@1.41.2_3f114a46406f1e64/node_modules/@zag-js/date-utils/dist/locale.js.map +1 -1
  207. package/dist/node_modules/.bun/@zag-js_dialog@1.41.2/node_modules/@zag-js/dialog/dist/dialog.connect.js +1 -1
  208. package/dist/node_modules/.bun/@zag-js_dialog@1.41.2/node_modules/@zag-js/dialog/dist/dialog.connect.js.map +1 -1
  209. package/dist/node_modules/.bun/@zag-js_dialog@1.41.2/node_modules/@zag-js/dialog/dist/dialog.machine.js +1 -1
  210. package/dist/node_modules/.bun/@zag-js_dialog@1.41.2/node_modules/@zag-js/dialog/dist/dialog.machine.js.map +1 -1
  211. package/dist/node_modules/.bun/@zag-js_focus-trap@1.41.2/node_modules/@zag-js/focus-trap/dist/focus-trap.js +3 -3
  212. package/dist/node_modules/.bun/@zag-js_focus-trap@1.41.2/node_modules/@zag-js/focus-trap/dist/focus-trap.js.map +1 -1
  213. package/dist/node_modules/.bun/@zag-js_hover-card@1.41.2/node_modules/@zag-js/hover-card/dist/hover-card.connect.js +1 -1
  214. package/dist/node_modules/.bun/@zag-js_hover-card@1.41.2/node_modules/@zag-js/hover-card/dist/hover-card.connect.js.map +1 -1
  215. package/dist/node_modules/.bun/@zag-js_menu@1.41.2/node_modules/@zag-js/menu/dist/menu.connect.js +2 -2
  216. package/dist/node_modules/.bun/@zag-js_menu@1.41.2/node_modules/@zag-js/menu/dist/menu.connect.js.map +1 -1
  217. package/dist/node_modules/.bun/@zag-js_pin-input@1.41.2/node_modules/@zag-js/pin-input/dist/pin-input.utils.js +1 -1
  218. package/dist/node_modules/.bun/@zag-js_pin-input@1.41.2/node_modules/@zag-js/pin-input/dist/pin-input.utils.js.map +1 -1
  219. package/dist/node_modules/.bun/@zag-js_popover@1.41.2/node_modules/@zag-js/popover/dist/popover.connect.js +1 -1
  220. package/dist/node_modules/.bun/@zag-js_popover@1.41.2/node_modules/@zag-js/popover/dist/popover.connect.js.map +1 -1
  221. package/dist/node_modules/.bun/@zag-js_popper@1.41.2/node_modules/@zag-js/popper/dist/get-placement.js +1 -1
  222. package/dist/node_modules/.bun/{@zag-js_solid@1.41.2_da624007e3df32b4 → @zag-js_solid@1.41.2_ee58d66d663bac7b}/node_modules/@zag-js/solid/dist/bindable.js +1 -1
  223. package/dist/node_modules/.bun/{@zag-js_solid@1.41.2_da624007e3df32b4 → @zag-js_solid@1.41.2_ee58d66d663bac7b}/node_modules/@zag-js/solid/dist/bindable.js.map +1 -1
  224. package/dist/node_modules/.bun/{@zag-js_solid@1.41.2_da624007e3df32b4 → @zag-js_solid@1.41.2_ee58d66d663bac7b}/node_modules/@zag-js/solid/dist/machine.js +1 -1
  225. package/dist/node_modules/.bun/{@zag-js_solid@1.41.2_da624007e3df32b4 → @zag-js_solid@1.41.2_ee58d66d663bac7b}/node_modules/@zag-js/solid/dist/machine.js.map +1 -1
  226. package/dist/node_modules/.bun/{@zag-js_solid@1.41.2_da624007e3df32b4 → @zag-js_solid@1.41.2_ee58d66d663bac7b}/node_modules/@zag-js/solid/dist/merge-props.js +1 -1
  227. package/dist/node_modules/.bun/{@zag-js_solid@1.41.2_da624007e3df32b4 → @zag-js_solid@1.41.2_ee58d66d663bac7b}/node_modules/@zag-js/solid/dist/merge-props.js.map +1 -1
  228. package/dist/node_modules/.bun/{@zag-js_solid@1.41.2_da624007e3df32b4 → @zag-js_solid@1.41.2_ee58d66d663bac7b}/node_modules/@zag-js/solid/dist/normalize-props.js +1 -1
  229. package/dist/node_modules/.bun/{@zag-js_solid@1.41.2_da624007e3df32b4 → @zag-js_solid@1.41.2_ee58d66d663bac7b}/node_modules/@zag-js/solid/dist/normalize-props.js.map +1 -1
  230. package/dist/node_modules/.bun/{@zag-js_solid@1.41.2_da624007e3df32b4 → @zag-js_solid@1.41.2_ee58d66d663bac7b}/node_modules/@zag-js/solid/dist/refs.js +1 -1
  231. package/dist/node_modules/.bun/{@zag-js_solid@1.41.2_da624007e3df32b4 → @zag-js_solid@1.41.2_ee58d66d663bac7b}/node_modules/@zag-js/solid/dist/refs.js.map +1 -1
  232. package/dist/node_modules/.bun/{@zag-js_solid@1.41.2_da624007e3df32b4 → @zag-js_solid@1.41.2_ee58d66d663bac7b}/node_modules/@zag-js/solid/dist/track.js +1 -1
  233. package/dist/node_modules/.bun/{@zag-js_solid@1.41.2_da624007e3df32b4 → @zag-js_solid@1.41.2_ee58d66d663bac7b}/node_modules/@zag-js/solid/dist/track.js.map +1 -1
  234. package/dist/node_modules/.bun/@zag-js_tooltip@1.41.2/node_modules/@zag-js/tooltip/dist/tooltip.connect.js +1 -1
  235. package/dist/node_modules/.bun/@zag-js_tooltip@1.41.2/node_modules/@zag-js/tooltip/dist/tooltip.connect.js.map +1 -1
  236. package/dist/node_modules/.bun/{tailwind-variants@3.2.2_353585be07126f0c → tailwind-variants@3.2.2_836190697928d5d4}/node_modules/tailwind-variants/dist/chunk-LQJYWU4O.js +1 -1
  237. package/dist/node_modules/.bun/{tailwind-variants@3.2.2_353585be07126f0c → tailwind-variants@3.2.2_836190697928d5d4}/node_modules/tailwind-variants/dist/chunk-LQJYWU4O.js.map +1 -1
  238. package/dist/node_modules/.bun/{tailwind-variants@3.2.2_353585be07126f0c → tailwind-variants@3.2.2_836190697928d5d4}/node_modules/tailwind-variants/dist/chunk-RZF76H2U.js +1 -1
  239. package/dist/node_modules/.bun/{tailwind-variants@3.2.2_353585be07126f0c → tailwind-variants@3.2.2_836190697928d5d4}/node_modules/tailwind-variants/dist/chunk-RZF76H2U.js.map +1 -1
  240. package/dist/node_modules/.bun/{tailwind-variants@3.2.2_353585be07126f0c → tailwind-variants@3.2.2_836190697928d5d4}/node_modules/tailwind-variants/dist/index.js +1 -1
  241. package/dist/node_modules/.bun/{tailwind-variants@3.2.2_353585be07126f0c → tailwind-variants@3.2.2_836190697928d5d4}/node_modules/tailwind-variants/dist/index.js.map +1 -1
  242. package/dist/paraglide/messages/_index.d.ts +2 -1
  243. package/dist/paraglide/messages/ui_breadcrumb_label.d.ts +3 -3
  244. package/dist/paraglide/messages/ui_carousel_next.d.ts +3 -3
  245. package/dist/paraglide/messages/ui_carousel_previous.d.ts +3 -3
  246. package/dist/paraglide/messages/ui_checkbox_checked.d.ts +3 -3
  247. package/dist/paraglide/messages/ui_common_close.d.ts +3 -3
  248. package/dist/paraglide/messages/ui_common_loading.d.ts +3 -3
  249. package/dist/paraglide/messages/ui_common_more.d.ts +3 -3
  250. package/dist/paraglide/messages/ui_pagination_more.d.ts +3 -3
  251. package/dist/paraglide/messages/ui_pagination_next.d.ts +3 -3
  252. package/dist/paraglide/messages/ui_pagination_previous.d.ts +3 -3
  253. package/dist/paraglide/messages/ui_sidebar_description.d.ts +3 -3
  254. package/dist/paraglide/messages/ui_sidebar_title.d.ts +3 -3
  255. package/dist/paraglide/messages/ui_sidebar_toggle.d.ts +3 -3
  256. package/dist/paraglide/messages/ui_skeleton_loading.d.ts +3 -3
  257. package/dist/paraglide/runtime.d.ts +492 -273
  258. package/dist/paraglide/runtime.js.map +1 -1
  259. package/package.json +3 -3
  260. package/src/components/form/AutoSubmit.tsx +2 -2
  261. package/src/components/sidebar/utils.ts +18 -10
  262. package/dist/node_modules/.bun/@ark-ui_solid@5.37.1_da624007e3df32b4/node_modules/@ark-ui/solid/dist/chunk/6WEDGJKQ.js +0 -7
  263. package/dist/node_modules/.bun/@ark-ui_solid@5.37.1_da624007e3df32b4/node_modules/@ark-ui/solid/dist/chunk/7IUG3E2V.js +0 -11
  264. package/dist/node_modules/.bun/@ark-ui_solid@5.37.1_da624007e3df32b4/node_modules/@ark-ui/solid/dist/chunk/KGOB2IMX.js +0 -6
  265. package/dist/node_modules/.bun/@floating-ui_core@1.7.5/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +0 -1
  266. package/dist/node_modules/.bun/@floating-ui_dom@1.7.6/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -330
  267. package/dist/node_modules/.bun/@floating-ui_dom@1.7.6/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +0 -1
  268. package/dist/node_modules/.bun/@floating-ui_utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","names":[],"sources":["../../src/paraglide/runtime.js"],"sourcesContent":["/* eslint-disable */\n\n/** @type {any} */\nconst URLPattern = {}\n\n/**\n * The project's base locale.\n *\n * @example\n * if (locale === baseLocale) {\n * // do something\n * }\n */\nexport const baseLocale = \"en-gb\";\n/**\n * The project's locales that have been specified in the settings.\n *\n * @example\n * if (locales.includes(userSelectedLocale) === false) {\n * throw new Error('Locale is not available');\n * }\n */\nexport const locales = /** @type {const} */ ([\"en-gb\",\"nb\"]);\n/** @type {string} */\nexport const cookieName = \"PARAGLIDE_LOCALE\";\n/** @type {number} */\nexport const cookieMaxAge = 34560000;\n/** @type {string} */\nexport const cookieDomain = \"\";\n/** @type {string} */\nexport const localStorageKey = \"PARAGLIDE_LOCALE\";\n/**\n * @type {Array<\"cookie\" | \"baseLocale\" | \"globalVariable\" | \"url\" | \"preferredLanguage\" | \"localStorage\" | `custom-${string}`>}\n */\nexport const strategy = [\n \"globalVariable\",\n \"baseLocale\"\n];\n/**\n * Route-level strategy overrides.\n *\n * `match` uses URLPattern syntax.\n *\n * @type {Array<{\n * match: string;\n * strategy?: Array<\"cookie\" | \"baseLocale\" | \"globalVariable\" | \"url\" | \"preferredLanguage\" | \"localStorage\" | `custom-${string}`>;\n * exclude?: boolean;\n * }>}\n */\nexport const routeStrategies = [];\n/**\n * The used URL patterns.\n *\n * @type {Array<{ pattern: string, localized: Array<[Locale, string]> }>}\n */\nexport const urlPatterns = [\n {\n \"pattern\": \":protocol://:domain(.*)::port?/:path(.*)?\",\n \"localized\": [\n [\n \"nb\",\n \":protocol://:domain(.*)::port?/nb/:path(.*)?\"\n ],\n [\n \"en-gb\",\n \":protocol://:domain(.*)::port?/:path(.*)?\"\n ]\n ]\n }\n];\n/** @type {string | undefined} */\nlet cachedRouteStrategyUrl;\n/** @type {{ match: string; strategy?: typeof strategy; exclude?: boolean } | undefined} */\nlet cachedRouteStrategy;\n/**\n * @param {string | URL} url\n * @returns {{ match: string; strategy?: typeof strategy; exclude?: boolean } | undefined}\n */\nfunction findMatchingRouteStrategy(url) {\n if (routeStrategies.length === 0) {\n return undefined;\n }\n const urlString = typeof url === \"string\" ? url : url.href;\n if (cachedRouteStrategyUrl === urlString) {\n return cachedRouteStrategy;\n }\n const urlObject = new URL(urlString, \"http://dummy.com\");\n let match;\n for (const routeStrategy of routeStrategies) {\n const pattern = new URLPattern(routeStrategy.match, urlObject.href);\n if (pattern.exec(urlObject.href)) {\n match = routeStrategy;\n break;\n }\n }\n cachedRouteStrategyUrl = urlString;\n cachedRouteStrategy = match;\n return match;\n}\n/**\n * Returns the strategy to use for a specific URL.\n *\n * If no route strategy matches (or the matching rule is `exclude: true`),\n * the global strategy is returned.\n *\n * @param {string | URL} url\n * @returns {typeof strategy}\n */\nexport function getStrategyForUrl(url) {\n const routeStrategy = findMatchingRouteStrategy(url);\n if (routeStrategy &&\n routeStrategy.exclude !== true &&\n Array.isArray(routeStrategy.strategy)) {\n return routeStrategy.strategy;\n }\n return strategy;\n}\n/**\n * Returns whether the given URL is excluded from middleware i18n processing.\n *\n * @param {string | URL} url\n * @returns {boolean}\n */\nexport function isExcludedByRouteStrategy(url) {\n return findMatchingRouteStrategy(url)?.exclude === true;\n}\n/**\n * @typedef {{\n * \t\tgetStore(): {\n * \t\tlocale?: Locale,\n * \t\t\torigin?: string,\n * \t\t\tmessageCalls?: Set<string>\n * \t} | undefined,\n * \t\trun: (store: { locale?: Locale, origin?: string, messageCalls?: Set<string>},\n * cb: any) => any\n * }} ParaglideAsyncLocalStorage\n */\n/**\n * Server side async local storage that is set by `serverMiddleware()`.\n *\n * The variable is used to retrieve the locale and origin in a server-side\n * rendering context without effecting other requests.\n *\n * @type {ParaglideAsyncLocalStorage | undefined}\n */\nexport let serverAsyncLocalStorage = undefined;\nexport const disableAsyncLocalStorage = false;\nexport const experimentalMiddlewareLocaleSplitting = false;\nexport const isServer = import.meta.env?.SSR ?? typeof window === 'undefined';\n/** @type {Locale | undefined} */\nexport const experimentalStaticLocale = undefined;\n/**\n * Sets the server side async local storage.\n *\n * The function is needed because the `runtime.js` file\n * must define the `serverAsyncLocalStorage` variable to\n * avoid a circular import between `runtime.js` and\n * `server.js` files.\n *\n * @param {ParaglideAsyncLocalStorage | undefined} value\n */\nexport function overwriteServerAsyncLocalStorage(value) {\n serverAsyncLocalStorage = value;\n}\nconst TREE_SHAKE_COOKIE_STRATEGY_USED = false;\nconst TREE_SHAKE_URL_STRATEGY_USED = false;\nconst TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED = true;\nconst TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED = false;\nconst TREE_SHAKE_DEFAULT_URL_PATTERN_USED = true;\nconst TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED = false;\n\n/** @type {any} */ (globalThis).__paraglide =\n\t/** @type {any} */ (globalThis).__paraglide ?? {};\n/** @type {any} */ (globalThis).__paraglide.ssr =\n\t/** @type {any} */ (globalThis).__paraglide.ssr ?? {};\n\n/**\n * This is a fallback to get started with a custom\n * strategy and avoid type errors.\n *\n * The implementation is overwritten\n * by `overwriteGetLocale()` and `defineSetLocale()`.\n *\n * @type {Locale | undefined}\n */\nlet _locale;\nlet localeInitiallySet = false;\n/**\n * Get the current locale.\n *\n * The locale is resolved using your configured strategies (URL, cookie, localStorage, etc.)\n * in the order they are defined. In SSR contexts, the locale is retrieved from AsyncLocalStorage\n * which is set by the `paraglideMiddleware()`.\n *\n * @see https://paraglidejs.com/strategy - Configure locale detection strategies\n *\n * @example\n * if (getLocale() === 'de') {\n * console.log('Germany 🇩🇪');\n * } else if (getLocale() === 'nl') {\n * console.log('Netherlands 🇳🇱');\n * }\n *\n * @returns {Locale} The current locale.\n */\nexport let getLocale = () => {\n if (experimentalStaticLocale !== undefined) {\n return experimentalStaticLocale;\n }\n // if running in a server-side rendering context\n // retrieve the locale from the async local storage\n if (serverAsyncLocalStorage) {\n const locale = serverAsyncLocalStorage?.getStore()?.locale;\n if (locale) {\n return locale;\n }\n }\n let strategyToUse = strategy;\n if (!isServer && typeof window !== \"undefined\" && window.location?.href) {\n strategyToUse = getStrategyForUrl(window.location.href);\n }\n const resolved = resolveLocaleWithStrategies(strategyToUse, typeof window !== \"undefined\" ? window.location?.href : undefined);\n if (resolved) {\n if (!localeInitiallySet) {\n _locale = resolved;\n // https://github.com/opral/inlang-paraglide-js/issues/455\n localeInitiallySet = true;\n setLocale(resolved, { reload: false });\n }\n return resolved;\n }\n throw new Error(\"No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found\");\n};\n/**\n * Resolve locale for a given URL using route-aware strategies.\n *\n * @param {string | URL} url\n * @returns {Locale}\n */\nexport function getLocaleForUrl(url) {\n if (experimentalStaticLocale !== undefined) {\n return experimentalStaticLocale;\n }\n const strategyToUse = getStrategyForUrl(url);\n const resolved = resolveLocaleWithStrategies(strategyToUse, typeof url === \"string\" ? url : url.href);\n if (resolved) {\n return resolved;\n }\n throw new Error(\"No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found\");\n}\n/**\n * @param {typeof strategy} strategyToUse\n * @param {string | undefined} urlForUrlStrategy\n * @returns {Locale | undefined}\n */\nfunction resolveLocaleWithStrategies(strategyToUse, urlForUrlStrategy) {\n /** @type {string | undefined} */\n let locale;\n for (const strat of strategyToUse) {\n if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === \"cookie\") {\n locale = extractLocaleFromCookie();\n }\n else if (strat === \"baseLocale\") {\n locale = baseLocale;\n }\n else if (TREE_SHAKE_URL_STRATEGY_USED &&\n strat === \"url\" &&\n !isServer &&\n typeof urlForUrlStrategy === \"string\") {\n locale = extractLocaleFromUrl(urlForUrlStrategy);\n }\n else if (TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED &&\n strat === \"globalVariable\" &&\n _locale !== undefined) {\n locale = _locale;\n }\n else if (TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED &&\n strat === \"preferredLanguage\" &&\n !isServer) {\n locale = extractLocaleFromNavigator();\n }\n else if (TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED &&\n strat === \"localStorage\" &&\n !isServer) {\n locale = localStorage.getItem(localStorageKey) ?? undefined;\n }\n else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {\n const handler = customClientStrategies.get(strat);\n if (handler) {\n const result = handler.getLocale();\n // Handle both sync and async results - skip async in sync getLocale\n if (result instanceof Promise) {\n // Can't await in sync function, skip async strategies\n continue;\n }\n if (result !== undefined) {\n return assertIsLocale(result);\n }\n }\n }\n const matchedLocale = toLocale(locale);\n if (matchedLocale) {\n return matchedLocale;\n }\n }\n return undefined;\n}\n/**\n * Overwrite the `getLocale()` function.\n *\n * Use this function to overwrite how the locale is resolved. This is useful\n * for custom locale resolution or advanced use cases like SSG with concurrent rendering.\n *\n * @see https://paraglidejs.com/strategy\n *\n * @example\n * overwriteGetLocale(() => {\n * return Cookies.get('locale') ?? baseLocale\n * });\n *\n * @param {() => Locale} fn - The new implementation for `getLocale()`.\n */\nexport const overwriteGetLocale = (fn) => {\n getLocale = fn;\n};\n\nconst rtlLanguages = new Set([\n \"ar\",\n \"dv\",\n \"fa\",\n \"he\",\n \"ks\",\n \"ku\",\n \"ps\",\n \"sd\",\n \"ug\",\n \"ur\",\n \"yi\",\n]);\n/**\n * Get writing direction for a locale.\n *\n * Uses `Intl.Locale` text info when available and falls back to a\n * language-based RTL check for runtimes without `getTextInfo()`.\n *\n * @example\n * getTextDirection(); // \"ltr\" or \"rtl\" for current locale\n * getTextDirection(\"ar\"); // \"rtl\"\n * getTextDirection(\"en\"); // \"ltr\"\n *\n * @param {string} [locale] - Target locale. If not provided, uses `getLocale()`\n * @returns {\"ltr\" | \"rtl\"}\n */\nexport function getTextDirection(locale = getLocale()) {\n try {\n const intlLocale = /** @type {Intl.Locale & {\n getTextInfo?: () => { direction?: string };\n textInfo?: { direction?: string };\n }} */ (new Intl.Locale(locale));\n const direction = intlLocale.getTextInfo?.().direction ?? intlLocale.textInfo?.direction;\n if (direction === \"ltr\" || direction === \"rtl\") {\n return direction;\n }\n }\n catch {\n // Ignore Intl.Locale parsing/runtime errors and use fallback below.\n }\n const language = locale.split(\"-\")[0]?.toLowerCase();\n return rtlLanguages.has(language ?? \"\") ? \"rtl\" : \"ltr\";\n}\n\n/**\n * Navigates to the localized URL, or reloads the current page\n *\n * @param {string} [newLocation] The new location\n */\nconst navigateOrReload = (newLocation) => {\n if (newLocation) {\n // reload the page by navigating to the new url\n window.location.href = newLocation;\n }\n else {\n // reload the page to reflect the new locale\n window.location.reload();\n }\n};\n/**\n * @typedef {(newLocale: Locale, options?: { reload?: boolean }) => void | Promise<void>} SetLocaleFn\n */\n/**\n * Set the locale.\n *\n * Updates the locale using your configured strategies (cookie, localStorage, URL, etc.).\n * By default, this reloads the page on the client to reflect the new locale. Reloading\n * can be disabled by passing `reload: false` as an option, but you'll need to ensure\n * the UI updates to reflect the new locale.\n *\n * If any custom strategy's `setLocale` function is async, then this function\n * will become async as well.\n *\n * @see https://paraglidejs.com/strategy\n *\n * @example\n * setLocale('en');\n *\n * @example\n * setLocale('en', { reload: false });\n *\n * @type {SetLocaleFn}\n */\nexport let setLocale = (newLocale, options) => {\n const optionsWithDefaults = {\n reload: true,\n ...options,\n };\n // locale is already set\n // https://github.com/opral/inlang-paraglide-js/issues/430\n /** @type {Locale | undefined} */\n let currentLocale;\n try {\n currentLocale = getLocale();\n }\n catch {\n // do nothing, no locale has been set yet.\n }\n /** @type {Array<Promise<void>>} */\n const customSetLocalePromises = [];\n /** @type {string | undefined} */\n let newLocation = undefined;\n let strategyToUse = strategy;\n if (!isServer && typeof window !== \"undefined\" && window.location?.href) {\n strategyToUse = getStrategyForUrl(window.location.href);\n }\n for (const strat of strategyToUse) {\n if (TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED &&\n strat === \"globalVariable\") {\n // a default for a custom strategy to get started quickly\n // is likely overwritten by `defineSetLocale()`\n _locale = newLocale;\n }\n else if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === \"cookie\") {\n if (isServer ||\n typeof document === \"undefined\" ||\n typeof window === \"undefined\") {\n continue;\n }\n // set the cookie\n const cookieString = `${cookieName}=${newLocale}; path=/; max-age=${cookieMaxAge}`;\n document.cookie = cookieDomain\n ? `${cookieString}; domain=${cookieDomain}`\n : cookieString;\n clearLocaleCookieCache();\n }\n else if (strat === \"baseLocale\") {\n // nothing to be set here. baseLocale is only a fallback\n continue;\n }\n else if (TREE_SHAKE_URL_STRATEGY_USED &&\n strat === \"url\" &&\n typeof window !== \"undefined\") {\n // route to the new url\n //\n // this triggers a page reload but a user rarely\n // switches locales, so this should be fine.\n //\n // if the behavior is not desired, the implementation\n // can be overwritten by `defineSetLocale()` to avoid\n // a full page reload.\n newLocation = localizeUrl(window.location.href, {\n locale: newLocale,\n }).href;\n }\n else if (TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED &&\n strat === \"localStorage\" &&\n typeof window !== \"undefined\") {\n // set the localStorage\n localStorage.setItem(localStorageKey, newLocale);\n }\n else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {\n const handler = customClientStrategies.get(strat);\n if (handler) {\n let result = handler.setLocale(newLocale);\n // Handle async setLocale\n if (result instanceof Promise) {\n result = result.catch((error) => {\n throw new Error(`Custom strategy \"${strat}\" setLocale failed.`, {\n cause: error,\n });\n });\n customSetLocalePromises.push(result);\n }\n }\n }\n }\n const runReload = () => {\n if (!isServer &&\n optionsWithDefaults.reload &&\n window.location &&\n newLocale !== currentLocale) {\n navigateOrReload(newLocation);\n }\n };\n if (customSetLocalePromises.length) {\n return Promise.all(customSetLocalePromises).then(() => {\n runReload();\n });\n }\n runReload();\n return;\n};\n/**\n * Overwrite the `setLocale()` function.\n *\n * Use this function to overwrite how the locale is set. For example,\n * modify a cookie, env variable, or a user's preference.\n *\n * @example\n * overwriteSetLocale((newLocale) => {\n * // set the locale in a cookie\n * return Cookies.set('locale', newLocale)\n * });\n *\n * @param {SetLocaleFn} fn\n */\nexport const overwriteSetLocale = (fn) => {\n setLocale = fn;\n};\n\n/**\n * The origin of the current URL.\n *\n * Defaults to \"http://y.com\" in non-browser environments. If this\n * behavior is not desired, the implementation can be overwritten\n * by `overwriteGetUrlOrigin()`.\n *\n * @type {() => string}\n */\nexport let getUrlOrigin = () => {\n if (serverAsyncLocalStorage) {\n return serverAsyncLocalStorage.getStore()?.origin ?? \"http://fallback.com\";\n }\n else if (typeof window !== \"undefined\") {\n return window.location.origin;\n }\n return \"http://fallback.com\";\n};\n/**\n * Overwrite the getUrlOrigin function.\n *\n * Use this function in server environments to\n * define how the URL origin is resolved.\n *\n * @param {() => string} fn - The new implementation for `getUrlOrigin()`.\n */\nexport let overwriteGetUrlOrigin = (fn) => {\n getUrlOrigin = fn;\n};\n\n/**\n * Coerces a locale-like string to the canonical locale value used by the runtime.\n *\n * @param {unknown} value\n * @returns {Locale | undefined}\n */\nexport function toLocale(value) {\n if (typeof value !== \"string\") {\n return undefined;\n }\n const lowerValue = value.toLowerCase();\n for (const locale of locales) {\n if (locale.toLowerCase() === lowerValue) {\n return locale;\n }\n }\n return undefined;\n}\n/**\n * Check if something is an available locale with the canonical project casing.\n *\n * @example\n * if (isLocale(params.locale)) {\n * setLocale(params.locale);\n * } else {\n * setLocale('en');\n * }\n *\n * Use `toLocale()` when you want case-insensitive matching and canonicalization.\n *\n * @param {unknown} locale\n * @returns {locale is Locale}\n */\nexport function isLocale(locale) {\n return !!locale && locales.some((item) => item === locale);\n}\n/**\n * Asserts that the input can be normalized to a locale.\n *\n * @param {unknown} input - The input to check.\n * @returns {Locale} The input normalized to a Locale.\n * @throws {Error} If the input is not a locale.\n */\nexport function assertIsLocale(input) {\n const locale = toLocale(input);\n if (locale)\n return locale;\n throw new Error(`Invalid locale: ${input}. Expected one of: ${locales.join(\", \")}`);\n}\n\n/**\n * @typedef {object} ExtractLocaleFromRequestOptions\n * @property {string | URL} [effectiveRequestUrl] - Effective request URL to use for route matching and locale detection with the URL strategy.\n */\n/**\n * Extracts a locale from a request.\n *\n * Use the function on the server to extract the locale\n * from a request.\n *\n * The function goes through the strategies in the order\n * they are defined. If a strategy returns an invalid locale,\n * it will fall back to the next strategy.\n *\n * Note: Custom server strategies are not supported in this synchronous version.\n * Use `extractLocaleFromRequestAsync` if you need custom server strategies with async getLocale methods.\n *\n * @example\n * const locale = extractLocaleFromRequest(request);\n *\n * @param {Request} request\n * @param {ExtractLocaleFromRequestOptions} [options]\n * @returns {Locale}\n */\nexport const extractLocaleFromRequest = (request, options = {}) => {\n const effectiveRequestUrl = resolveEffectiveRequestUrl(request, options.effectiveRequestUrl);\n return extractLocaleFromRequestWithStrategies(request, getStrategyForUrl(effectiveRequestUrl), effectiveRequestUrl);\n};\n/**\n * Extracts a locale from a request using the provided strategy order.\n *\n * @param {Request} request\n * @param {typeof strategy} strategies\n * @param {string | URL} [url]\n * @returns {Locale}\n */\nexport const extractLocaleFromRequestWithStrategies = (request, strategies, url = request.url) => {\n const effectiveRequestUrl = resolveEffectiveRequestUrl(request, url);\n /** @type {string|undefined} */\n let locale;\n for (const strat of strategies) {\n if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === \"cookie\") {\n const cookiePrefix = cookieName + \"=\";\n locale = request.headers\n .get(\"cookie\")\n ?.split(\";\")\n .map((c) => c.trim())\n .find((c) => c.startsWith(cookiePrefix))\n ?.slice(cookiePrefix.length);\n }\n else if (TREE_SHAKE_URL_STRATEGY_USED && strat === \"url\") {\n locale = extractLocaleFromUrl(effectiveRequestUrl);\n }\n else if (TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED &&\n strat === \"preferredLanguage\") {\n locale = extractLocaleFromHeader(request);\n }\n else if (strat === \"globalVariable\") {\n locale = _locale;\n }\n else if (strat === \"baseLocale\") {\n return baseLocale;\n }\n else if (strat === \"localStorage\") {\n continue;\n }\n else if (isCustomStrategy(strat)) {\n // Custom strategies are not supported in sync version\n // Use extractLocaleFromRequestAsync for custom server strategies\n continue;\n }\n const matchedLocale = toLocale(locale);\n if (matchedLocale) {\n return matchedLocale;\n }\n }\n throw new Error(\"No locale found. There is an error in your strategy. Try adding 'baseLocale' as the very last strategy. Read more here https://paraglidejs.com/errors#no-locale-found\");\n};\n/**\n * @param {Request} request\n * @param {string | URL | undefined} effectiveRequestUrl\n * @returns {URL}\n */\nfunction resolveEffectiveRequestUrl(request, effectiveRequestUrl = request.url) {\n if (effectiveRequestUrl instanceof URL) {\n return new URL(effectiveRequestUrl.href);\n }\n return new URL(effectiveRequestUrl, request.url);\n}\n\n/**\n * Asynchronously extracts a locale from a request.\n *\n * This function supports async custom server strategies, unlike the synchronous\n * `extractLocaleFromRequest`. Use this function when you have custom server strategies\n * that need to perform asynchronous operations (like database calls) in their getLocale method.\n *\n * The function first processes any custom server strategies asynchronously, then falls back\n * to the synchronous `extractLocaleFromRequest` for all other strategies.\n *\n * @see {@link https://github.com/opral/inlang-paraglide-js/issues/527#issuecomment-2978151022}\n *\n * @example\n * // Basic usage\n * const locale = await extractLocaleFromRequestAsync(request);\n *\n * @example\n * // With custom async server strategy\n * defineCustomServerStrategy(\"custom-database\", {\n * getLocale: async (request) => {\n * const userId = extractUserIdFromRequest(request);\n * return await getUserLocaleFromDatabase(userId);\n * }\n * });\n *\n * const locale = await extractLocaleFromRequestAsync(request);\n *\n * @param {Request} request - The request object to extract the locale from.\n * @param {{ effectiveRequestUrl?: string | URL }} [options] - Effective request URL to use for route matching and locale detection with the URL strategy.\n * @returns {Promise<Locale>} The extracted locale.\n */\nexport const extractLocaleFromRequestAsync = async (request, options = {}) => {\n /** @type {string|undefined} */\n let locale;\n const effectiveRequestUrl = resolveEffectiveRequestUrlFromRequestAsync(request, options.effectiveRequestUrl);\n const strategy = getStrategyForUrl(effectiveRequestUrl);\n // Process custom strategies first, in order\n for (const strat of strategy) {\n if (isCustomStrategy(strat) && customServerStrategies.has(strat)) {\n const handler = customServerStrategies.get(strat);\n if (handler) {\n /** @type {string|undefined} */\n locale = await handler.getLocale(request);\n }\n // If we got a valid locale from this custom strategy, use it\n const matchedLocale = toLocale(locale);\n if (matchedLocale) {\n return matchedLocale;\n }\n }\n }\n // If no custom strategy provided a valid locale, fall back to sync version\n return extractLocaleFromRequestWithStrategies(request, strategy, effectiveRequestUrl);\n};\n/**\n * @param {Request} request\n * @param {string | URL | undefined} effectiveRequestUrl\n * @returns {URL}\n */\nfunction resolveEffectiveRequestUrlFromRequestAsync(request, effectiveRequestUrl = request.url) {\n if (effectiveRequestUrl instanceof URL) {\n return new URL(effectiveRequestUrl.href);\n }\n return new URL(effectiveRequestUrl, request.url);\n}\n\nconst cookieNamePattern = cookieName.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\nconst localeCookiePattern = new RegExp(`(?:^|;\\\\s*)${cookieNamePattern}=([^;]*)`);\nconst noCachedLocale = Symbol();\n/** @type {Locale | undefined | typeof noCachedLocale} */\nlet cachedLocaleFromCookie = noCachedLocale;\n/**\n * Clears the cached locale from `document.cookie`.\n */\nfunction clearLocaleCookieCache() {\n cachedLocaleFromCookie = noCachedLocale;\n}\nfunction scheduleLocaleCookieCacheClear() {\n if (typeof queueMicrotask === \"function\") {\n queueMicrotask(clearLocaleCookieCache);\n }\n else {\n Promise.resolve().then(clearLocaleCookieCache);\n }\n}\n/**\n * Extracts a cookie from the document.\n *\n * Will return undefined if the document is not available or if the cookie is not set.\n * The `document` object is not available in server-side rendering, so this function should not be called in that context.\n *\n * @returns {Locale | undefined}\n */\nexport function extractLocaleFromCookie() {\n if (typeof document === \"undefined\") {\n return;\n }\n if (cachedLocaleFromCookie !== noCachedLocale) {\n return cachedLocaleFromCookie;\n }\n const match = document.cookie.match(localeCookiePattern);\n const locale = match?.[1];\n cachedLocaleFromCookie = toLocale(locale);\n scheduleLocaleCookieCacheClear();\n return cachedLocaleFromCookie;\n}\n\n/**\n * Extracts a locale from the accept-language header.\n *\n * Use the function on the server to extract the locale\n * from the accept-language header that is sent by the client.\n *\n * @example\n * const locale = extractLocaleFromHeader(request);\n *\n * @param {Request} request - The request object to extract the locale from.\n * @returns {Locale | undefined} The negotiated preferred language.\n */\nexport function extractLocaleFromHeader(request) {\n const acceptLanguageHeader = request.headers.get(\"accept-language\");\n if (acceptLanguageHeader) {\n // Parse language preferences with their q-values and base language codes\n const languages = acceptLanguageHeader\n .split(\",\")\n .map((lang) => {\n const [tag, q = \"1\"] = lang.trim().split(\";q=\");\n // Get both the full tag and base language code\n const baseTag = tag?.split(\"-\")[0];\n return {\n fullTag: tag,\n baseTag,\n q: Number(q),\n };\n })\n .sort((a, b) => b.q - a.q);\n for (const lang of languages) {\n const fullLocale = toLocale(lang.fullTag);\n if (fullLocale) {\n return fullLocale;\n }\n const baseLocale = toLocale(lang.baseTag);\n if (baseLocale) {\n return baseLocale;\n }\n }\n return undefined;\n }\n return undefined;\n}\n\n/**\n * Negotiates a preferred language from navigator.languages.\n *\n * Use the function on the client to extract the locale\n * from the navigator.languages array.\n *\n * @example\n * const locale = extractLocaleFromNavigator();\n *\n * @returns {Locale | undefined}\n */\nexport function extractLocaleFromNavigator() {\n if (!navigator?.languages?.length) {\n return undefined;\n }\n const languages = navigator.languages.map((lang) => ({\n fullTag: lang,\n baseTag: lang.split(\"-\")[0],\n }));\n for (const lang of languages) {\n const fullLocale = toLocale(lang.fullTag);\n if (fullLocale) {\n return fullLocale;\n }\n const baseLocale = toLocale(lang.baseTag);\n if (baseLocale) {\n return baseLocale;\n }\n }\n return undefined;\n}\n\n/**\n * If extractLocaleFromUrl is called many times on the same page and the URL\n * hasn't changed, we don't need to recompute it every time which can get expensive.\n * We might use a LRU cache if needed, but for now storing only the last result is enough.\n * https://github.com/opral/monorepo/pull/3575#discussion_r2066731243\n */\n/** @type {string|undefined} */\nlet cachedUrl;\n/** @type {Locale|undefined} */\nlet cachedLocale;\n/**\n * Extracts the locale from a given URL using native URLPattern.\n *\n * The built-in default `/:locale/...` routing is case-insensitive because it\n * canonicalizes the first path segment with `toLocale()`. Custom `urlPatterns`\n * keep URLPattern's normal exact matching semantics for path segments.\n *\n * @param {URL|string} url - The full URL from which to extract the locale.\n * @returns {Locale|undefined} The extracted locale, or undefined if no locale is found.\n */\nexport function extractLocaleFromUrl(url) {\n const urlString = typeof url === \"string\" ? url : url.href;\n if (cachedUrl === urlString) {\n return cachedLocale;\n }\n /** @type {Locale | undefined} */\n let result;\n if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {\n result = defaultUrlPatternExtractLocale(url);\n }\n else {\n const urlObj = typeof url === \"string\" ? new URL(url) : url;\n // Iterate over URL patterns\n for (const element of urlPatterns) {\n for (const [locale, localizedPattern] of element.localized) {\n const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);\n if (match) {\n result = locale;\n break;\n }\n }\n if (result)\n break;\n }\n }\n cachedUrl = urlString;\n cachedLocale = result;\n return result;\n}\n/**\n * https://github.com/opral/inlang-paraglide-js/issues/381\n *\n * @param {URL | string} url - The full URL from which to extract the locale.\n * @returns {Locale | undefined} The extracted locale, or undefined if no locale is found.\n */\nfunction defaultUrlPatternExtractLocale(url) {\n const urlObj = new URL(url, \"http://dummy.com\");\n const pathSegments = urlObj.pathname.split(\"/\").filter(Boolean);\n return toLocale(pathSegments[0]) || baseLocale;\n}\n\n/**\n * Lower-level URL localization function, primarily used in server contexts.\n *\n * This function is designed for server-side usage where you need precise control\n * over URL localization, such as in middleware or request handlers. It works with\n * URL objects and always returns absolute URLs.\n *\n * For client-side UI components, use `localizeHref()` instead, which provides\n * a more convenient API with relative paths and automatic locale detection.\n *\n * @see https://paraglidejs.com/i18n-routing\n *\n * @example\n * ```typescript\n * // Server middleware example\n * app.use((req, res, next) => {\n * const url = new URL(req.url, `${req.protocol}://${req.headers.host}`);\n * const localized = localizeUrl(url, { locale: \"de\" });\n *\n * if (localized.href !== url.href) {\n * return res.redirect(localized.href);\n * }\n * next();\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Using with URL patterns\n * const url = new URL(\"https://example.com/about\");\n * localizeUrl(url, { locale: \"de\" });\n * // => URL(\"https://example.com/de/about\")\n *\n * // Using with domain-based localization\n * const url = new URL(\"https://example.com/store\");\n * localizeUrl(url, { locale: \"de\" });\n * // => URL(\"https://de.example.com/store\")\n * ```\n *\n * @param {string | URL} url - The URL to localize. If string, must be absolute.\n * @param {object} [options] - Options for localization\n * @param {Locale} [options.locale] - Target locale. If not provided, uses getLocale()\n * @returns {URL} The localized URL, always absolute\n */\nexport function localizeUrl(url, options) {\n const targetLocale = options?.locale\n ? assertIsLocale(options?.locale)\n : getLocale();\n if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {\n return localizeUrlDefaultPattern(url, targetLocale);\n }\n const urlObj = typeof url === \"string\" ? new URL(url) : url;\n // Iterate over URL patterns\n for (const element of urlPatterns) {\n // match localized patterns\n for (const [, localizedPattern] of element.localized) {\n const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);\n if (!match) {\n continue;\n }\n const targetPattern = element.localized.find(([locale]) => locale === targetLocale)?.[1];\n if (!targetPattern) {\n continue;\n }\n const localizedUrl = fillPattern(targetPattern, aggregateGroups(match), urlObj.origin);\n return fillMissingUrlParts(localizedUrl, match);\n }\n const unlocalizedMatch = new URLPattern(element.pattern, urlObj.href).exec(urlObj.href);\n if (unlocalizedMatch) {\n const targetPattern = element.localized.find(([locale]) => locale === targetLocale)?.[1];\n if (targetPattern) {\n const localizedUrl = fillPattern(targetPattern, aggregateGroups(unlocalizedMatch), urlObj.origin);\n return fillMissingUrlParts(localizedUrl, unlocalizedMatch);\n }\n }\n }\n // If no match found, return the original URL\n return urlObj;\n}\n/**\n * https://github.com/opral/inlang-paraglide-js/issues/381\n *\n * @param {string | URL} url\n * @param {Locale} locale\n * @returns {URL}\n */\nfunction localizeUrlDefaultPattern(url, locale) {\n const urlObj = typeof url === \"string\" ? new URL(url, getUrlOrigin()) : new URL(url);\n const currentLocale = extractLocaleFromUrl(urlObj);\n // If current locale matches target locale, no change needed\n if (currentLocale === locale) {\n return urlObj;\n }\n const pathSegments = urlObj.pathname.split(\"/\").filter(Boolean);\n // If current path starts with a locale, remove it\n if (pathSegments.length > 0 && toLocale(pathSegments[0])) {\n pathSegments.shift();\n }\n // For base locale, don't add prefix\n if (locale === baseLocale) {\n urlObj.pathname = \"/\" + pathSegments.join(\"/\");\n }\n else {\n // For other locales, add prefix\n urlObj.pathname = \"/\" + locale + \"/\" + pathSegments.join(\"/\");\n }\n return urlObj;\n}\n/**\n * Low-level URL de-localization function, primarily used in server contexts.\n *\n * This function is designed for server-side usage where you need precise control\n * over URL de-localization, such as in middleware or request handlers. It works with\n * URL objects and always returns absolute URLs.\n *\n * For client-side UI components, use `deLocalizeHref()` instead, which provides\n * a more convenient API with relative paths.\n *\n * @see https://paraglidejs.com/i18n-routing\n *\n * @example\n * ```typescript\n * // Server middleware example\n * app.use((req, res, next) => {\n * const url = new URL(req.url, `${req.protocol}://${req.headers.host}`);\n * const baseUrl = deLocalizeUrl(url);\n *\n * // Store the base URL for later use\n * req.baseUrl = baseUrl;\n * next();\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Using with URL patterns\n * const url = new URL(\"https://example.com/de/about\");\n * deLocalizeUrl(url); // => URL(\"https://example.com/about\")\n *\n * // Using with domain-based localization\n * const url = new URL(\"https://de.example.com/store\");\n * deLocalizeUrl(url); // => URL(\"https://example.com/store\")\n * ```\n *\n * @param {string | URL} url - The URL to de-localize. If string, must be absolute.\n * @returns {URL} The de-localized URL, always absolute\n */\nexport function deLocalizeUrl(url) {\n if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {\n return deLocalizeUrlDefaultPattern(url);\n }\n const urlObj = typeof url === \"string\" ? new URL(url) : url;\n // Iterate over URL patterns\n for (const element of urlPatterns) {\n // Iterate over localized versions\n for (const [, localizedPattern] of element.localized) {\n const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);\n if (match) {\n // Convert localized URL back to the base pattern\n const groups = aggregateGroups(match);\n const baseUrl = fillPattern(element.pattern, groups, urlObj.origin);\n return fillMissingUrlParts(baseUrl, match);\n }\n }\n // match unlocalized pattern\n const unlocalizedMatch = new URLPattern(element.pattern, urlObj.href).exec(urlObj.href);\n if (unlocalizedMatch) {\n const baseUrl = fillPattern(element.pattern, aggregateGroups(unlocalizedMatch), urlObj.origin);\n return fillMissingUrlParts(baseUrl, unlocalizedMatch);\n }\n }\n // no match found return the original url\n return urlObj;\n}\n/**\n * De-localizes a URL using the default pattern (/:locale/*)\n * @param {string|URL} url\n * @returns {URL}\n */\nfunction deLocalizeUrlDefaultPattern(url) {\n const urlObj = typeof url === \"string\" ? new URL(url, getUrlOrigin()) : new URL(url);\n const pathSegments = urlObj.pathname.split(\"/\").filter(Boolean);\n // If first segment is a locale, remove it\n if (pathSegments.length > 0 && toLocale(pathSegments[0])) {\n urlObj.pathname = \"/\" + pathSegments.slice(1).join(\"/\");\n }\n return urlObj;\n}\n/**\n * Takes matches of implicit wildcards in the UrlPattern (when a part is missing\n * it is equal to '*') and adds them back to the result of fillPattern.\n *\n * At least protocol and hostname are required to create a valid URL inside fillPattern.\n *\n * @param {URL} url\n * @param {any} match\n * @returns {URL}\n */\nfunction fillMissingUrlParts(url, match) {\n if (match.protocol.groups[\"0\"]) {\n url.protocol = match.protocol.groups[\"0\"] ?? \"\";\n }\n if (match.hostname.groups[\"0\"]) {\n url.hostname = match.hostname.groups[\"0\"] ?? \"\";\n }\n if (match.username.groups[\"0\"]) {\n url.username = match.username.groups[\"0\"] ?? \"\";\n }\n if (match.password.groups[\"0\"]) {\n url.password = match.password.groups[\"0\"] ?? \"\";\n }\n if (match.port.groups[\"0\"]) {\n url.port = match.port.groups[\"0\"] ?? \"\";\n }\n if (match.pathname.groups[\"0\"]) {\n url.pathname = match.pathname.groups[\"0\"] ?? \"\";\n }\n if (match.search.groups[\"0\"]) {\n url.search = match.search.groups[\"0\"] ?? \"\";\n }\n if (match.hash.groups[\"0\"]) {\n url.hash = match.hash.groups[\"0\"] ?? \"\";\n }\n return url;\n}\n/**\n * Fills a URL pattern with values for named groups, supporting all URLPattern-style modifiers.\n *\n * This function will eventually be replaced by https://github.com/whatwg/urlpattern/issues/73\n *\n * Matches:\n * - :name -> Simple\n * - :name? -> Optional\n * - :name+ -> One or more\n * - :name* -> Zero or more\n * - :name(...) -> Regex group\n * - {text} -> Group delimiter\n * - {text}? -> Optional group delimiter\n *\n * If the value is `null`, the segment is removed.\n *\n * @param {string} pattern - The URL pattern containing named groups.\n * @param {Record<string, string | null | undefined>} values - Object of values for named groups.\n * @param {string} origin - Base URL to use for URL construction.\n * @returns {URL} - The constructed URL with named groups filled.\n */\nfunction fillPattern(pattern, values, origin) {\n // Pre-process the pattern to handle explicit port numbers\n // This detects patterns like \"http://localhost:5173\" and protects the port number\n // from being interpreted as a parameter\n let processedPattern = pattern.replace(/(https?:\\/\\/[^:/]+):(\\d+)(\\/|$)/g, (_, protocol, port, slash) => {\n // Replace \":5173\" with \"#PORT-5173#\" to protect it from parameter replacement\n return `${protocol}#PORT-${port}#${slash}`;\n });\n // First, handle group delimiters with curly braces\n let processedGroupDelimiters = processedPattern.replace(/\\{([^{}]*)\\}([?+*]?)/g, (_, content, modifier) => {\n // For optional group delimiters\n if (modifier === \"?\") {\n // For optional groups, we'll include the content\n return content;\n }\n // For non-optional group delimiters, always include the content\n return content;\n });\n // Then handle named groups\n let filled = processedGroupDelimiters.replace(/(\\/?):([a-zA-Z0-9_]+)(\\([^)]*\\))?([?+*]?)/g, (_, slash, name, __, modifier) => {\n const value = values[name];\n if (value === null) {\n // If value is null, remove the entire segment including the preceding slash\n return \"\";\n }\n if (modifier === \"?\") {\n // Optional segment\n return value !== undefined ? `${slash}${value}` : \"\";\n }\n if (modifier === \"+\" || modifier === \"*\") {\n // Repeatable segments\n if (value === undefined && modifier === \"+\") {\n throw new Error(`Missing value for \"${name}\" (one or more required)`);\n }\n return value ? `${slash}${value}` : \"\";\n }\n // Simple named group (no modifier)\n if (value === undefined) {\n throw new Error(`Missing value for \"${name}\"`);\n }\n return `${slash}${value}`;\n });\n // Restore port numbers\n filled = filled.replace(/#PORT-(\\d+)#/g, \":$1\");\n return new URL(filled, origin);\n}\n/**\n * Aggregates named groups from various parts of the URLPattern match result.\n *\n *\n * @param {any} match - The URLPattern match result object.\n * @returns {Record<string, string | null | undefined>} An object containing all named groups from the match.\n */\nexport function aggregateGroups(match) {\n return {\n ...match.hash.groups,\n ...match.hostname.groups,\n ...match.password.groups,\n ...match.pathname.groups,\n ...match.port.groups,\n ...match.protocol.groups,\n ...match.search.groups,\n ...match.username.groups,\n };\n}\n\n/**\n * @typedef {object} ShouldRedirectServerInput\n * @property {Request} request\n * @property {string | URL} [effectiveRequestUrl] - Effective request URL to use for route matching, locale detection with the URL strategy, and redirect targets.\n * @property {Locale} [locale]\n *\n * @typedef {object} ShouldRedirectClientInput\n * @property {undefined} [request]\n * @property {string | URL} [url]\n * @property {Locale} [locale]\n *\n * @typedef {ShouldRedirectServerInput | ShouldRedirectClientInput} ShouldRedirectInput\n *\n * @typedef {object} ShouldRedirectResult\n * @property {boolean} shouldRedirect - Indicates whether the consumer should perform a redirect.\n * @property {Locale} locale - Locale resolved using the configured strategies.\n * @property {URL | undefined} redirectUrl - Destination URL when a redirect is required.\n */\n/**\n * Determines whether a redirect is required to align the current URL with the active locale.\n *\n * This helper mirrors the logic that powers `paraglideMiddleware`, but works in both server\n * and client environments. It evaluates the configured strategies in order, computes the\n * canonical localized URL, and reports when the current URL does not match.\n *\n * When called in the browser without arguments, the current `window.location.href` is used.\n *\n * @see https://paraglidejs.com/i18n-routing#redirects\n *\n * @example\n * // Client side usage (e.g. TanStack Router beforeLoad hook)\n * async function beforeLoad({ location }) {\n * const decision = await shouldRedirect({ url: location.href });\n *\n * if (decision.shouldRedirect) {\n * throw redirect({ to: decision.redirectUrl.href });\n * }\n * }\n *\n * @example\n * // Server side usage with a Request\n * export async function handle(request) {\n * const decision = await shouldRedirect({ request });\n *\n * if (decision.shouldRedirect) {\n * return Response.redirect(decision.redirectUrl, 307);\n * }\n *\n * return render(request, decision.locale);\n * }\n *\n * @example\n * // Server side usage behind a proxy where request.url is not public-facing\n * export async function handle(request) {\n * const effectiveRequestUrl = new URL(request.url);\n * effectiveRequestUrl.protocol = \"https:\";\n * effectiveRequestUrl.host = \"example.com\";\n *\n * const decision = await shouldRedirect({\n * request,\n * effectiveRequestUrl,\n * });\n *\n * if (decision.shouldRedirect) {\n * return Response.redirect(decision.redirectUrl, 307);\n * }\n * }\n *\n * @param {ShouldRedirectInput} [input]\n * @returns {Promise<ShouldRedirectResult>}\n */\nexport async function shouldRedirect(input = {}) {\n const currentUrl = resolveUrl(input);\n const locale = await resolveLocale(input, currentUrl);\n const strategy = getStrategyForUrl(currentUrl.href);\n if (isExcludedByRouteStrategy(currentUrl.href) || !strategy.includes(\"url\")) {\n return { shouldRedirect: false, locale, redirectUrl: undefined };\n }\n const localizedUrl = localizeUrl(currentUrl.href, { locale });\n const shouldRedirectToLocalizedUrl = normalizeUrl(localizedUrl.href) !== normalizeUrl(currentUrl.href);\n return {\n shouldRedirect: shouldRedirectToLocalizedUrl,\n locale,\n redirectUrl: shouldRedirectToLocalizedUrl ? localizedUrl : undefined,\n };\n}\n/**\n * Resolves the locale either from the provided input or by using the configured strategies.\n *\n * @param {ShouldRedirectInput} input\n * @param {URL} currentUrl\n * @returns {Promise<Locale>}\n */\nasync function resolveLocale(input, currentUrl) {\n const locale = toLocale(input.locale);\n if (locale) {\n return locale;\n }\n if (input.request) {\n return extractLocaleFromRequestAsync(input.request, {\n effectiveRequestUrl: currentUrl,\n });\n }\n if (\"url\" in input && typeof input.url !== \"undefined\") {\n return getLocaleForUrl(currentUrl.href);\n }\n return getLocale();\n}\n/**\n * Resolves the current URL from the provided input or runtime context.\n *\n * @param {ShouldRedirectInput} input\n * @returns {URL}\n */\nfunction resolveUrl(input) {\n if (\"effectiveRequestUrl\" in input && input.effectiveRequestUrl instanceof URL) {\n return new URL(input.effectiveRequestUrl.href);\n }\n if (\"effectiveRequestUrl\" in input && typeof input.effectiveRequestUrl === \"string\") {\n return new URL(input.effectiveRequestUrl, input.request ? input.request.url : getUrlOrigin());\n }\n if (input.request) {\n return new URL(input.request.url);\n }\n if (\"url\" in input && input.url instanceof URL) {\n return new URL(input.url.href);\n }\n if (\"url\" in input && typeof input.url === \"string\") {\n return new URL(input.url, getUrlOrigin());\n }\n if (typeof window !== \"undefined\" && window?.location?.href) {\n return new URL(window.location.href);\n }\n throw new Error(\"shouldRedirect() requires either a request, an absolute URL, or must run in a browser environment.\");\n}\n/**\n * Normalize url for comparison by stripping the trailing slash.\n *\n * @param {string} url\n * @returns {string}\n */\nfunction normalizeUrl(url) {\n const urlObj = new URL(url);\n urlObj.pathname = urlObj.pathname.replace(/\\/$/, \"\");\n return urlObj.href;\n}\n\n/**\n * High-level URL localization function optimized for client-side UI usage.\n *\n * This is a convenience wrapper around `localizeUrl()` that provides features\n * needed in UI:\n *\n * - Accepts relative paths (e.g., \"/about\")\n * - Returns relative paths when possible\n * - Automatically detects current locale if not specified\n * - Handles string input/output instead of URL objects\n *\n * @see https://paraglidejs.com/i18n-routing\n *\n * @example\n * ```typescript\n * // In a React/Vue/Svelte component\n * const NavLink = ({ href }) => {\n * // Automatically uses current locale, keeps path relative\n * return <a href={localizeHref(href)}>...</a>;\n * };\n *\n * // Examples:\n * localizeHref(\"/about\")\n * // => \"/de/about\" (if current locale is \"de\")\n * localizeHref(\"/store\", { locale: \"fr\" })\n * // => \"/fr/store\" (explicit locale)\n *\n * // Cross-origin links remain absolute\n * localizeHref(\"https://other-site.com/about\")\n * // => \"https://other-site.com/de/about\"\n * ```\n *\n * For server-side URL localization (e.g., in middleware), use `localizeUrl()`\n * which provides more precise control over URL handling.\n *\n * @param {string} href - The href to localize (can be relative or absolute)\n * @param {object} [options] - Options for localization\n * @param {Locale} [options.locale] - Target locale. If not provided, uses `getLocale()`\n * @returns {string} The localized href, relative if input was relative\n */\nexport function localizeHref(href, options) {\n const currentLocale = getLocale();\n const locale = options?.locale ?? currentLocale;\n const url = new URL(href, getUrlOrigin());\n const localized = localizeUrl(url, { locale });\n // if the origin is identical and the href is relative,\n // return the relative path\n if (href.startsWith(\"/\") && url.origin === localized.origin) {\n // check for cross origin localization in which case an absolute URL must be returned.\n if (locale !== currentLocale) {\n const localizedCurrentLocale = localizeUrl(url, {\n locale: currentLocale,\n });\n if (localizedCurrentLocale.origin !== localized.origin) {\n return localized.href;\n }\n }\n return localized.pathname + localized.search + localized.hash;\n }\n return localized.href;\n}\n/**\n * High-level URL de-localization function optimized for client-side UI usage.\n *\n * This is a convenience wrapper around `deLocalizeUrl()` that provides features\n * needed in the UI:\n *\n * - Accepts relative paths (e.g., \"/de/about\")\n * - Returns relative paths when possible\n * - Handles string input/output instead of URL objects\n *\n * @see https://paraglidejs.com/i18n-routing\n *\n * @example\n * ```typescript\n * // In a React/Vue/Svelte component\n * const LocaleSwitcher = ({ href }) => {\n * // Remove locale prefix before switching\n * const baseHref = deLocalizeHref(href);\n * return locales.map(locale =>\n * <a href={localizeHref(baseHref, { locale })}>\n * Switch to {locale}\n * </a>\n * );\n * };\n *\n * // Examples:\n * deLocalizeHref(\"/de/about\") // => \"/about\"\n * deLocalizeHref(\"/fr/store\") // => \"/store\"\n *\n * // Cross-origin links remain absolute\n * deLocalizeHref(\"https://example.com/de/about\")\n * // => \"https://example.com/about\"\n * ```\n *\n * For server-side URL de-localization (e.g., in middleware), use `deLocalizeUrl()`\n * which provides more precise control over URL handling.\n *\n * @param {string} href - The href to de-localize (can be relative or absolute)\n * @returns {string} The de-localized href, relative if input was relative\n */\nexport function deLocalizeHref(href) {\n const url = new URL(href, getUrlOrigin());\n const deLocalized = deLocalizeUrl(url);\n // If the origin is identical and the href is relative,\n // return the relative path instead of the full URL.\n if (href.startsWith(\"/\") && url.origin === deLocalized.origin) {\n return deLocalized.pathname + deLocalized.search + deLocalized.hash;\n }\n return deLocalized.href;\n}\n\n/**\n * @param {string} safeModuleId\n * @param {Locale} locale\n */\nexport function trackMessageCall(safeModuleId, locale) {\n if (isServer === false)\n return;\n const store = serverAsyncLocalStorage?.getStore();\n if (store) {\n store.messageCalls?.add(`${safeModuleId}:${locale}`);\n }\n}\n\n/**\n * Generates localized URL variants for all provided URLs based on your configured locales and URL patterns.\n *\n * This function is essential for Static Site Generation (SSG) where you need to tell your framework\n * which pages to pre-render at build time. It's also useful for generating sitemaps and\n * `<link rel=\"alternate\" hreflang>` tags for SEO.\n *\n * The function respects your `urlPatterns` configuration - if you have translated pathnames\n * (e.g., `/about` → `/ueber-uns` for German), it will generate the correct localized paths.\n *\n * @see https://paraglidejs.com/static-site-generation\n *\n * @example\n * // Basic usage - generate all locale variants for a list of paths\n * const localizedUrls = generateStaticLocalizedUrls([\n * \"/\",\n * \"/about\",\n * \"/blog/post-1\",\n * ]);\n * // Returns URL objects for each locale:\n * // [\"/en/\", \"/de/\", \"/en/about\", \"/de/about\", \"/en/blog/post-1\", \"/de/blog/post-1\"]\n *\n * @example\n * // Use with framework SSG APIs\n * // SvelteKit\n * export function entries() {\n * const paths = [\"/\", \"/about\", \"/contact\"];\n * return generateStaticLocalizedUrls(paths).map(url => ({\n * locale: extractLocaleFromUrl(url)\n * }));\n * }\n *\n * @example\n * // Sitemap generation\n * const allPages = [\"/\", \"/about\", \"/blog\"];\n * const sitemapUrls = generateStaticLocalizedUrls(allPages);\n *\n * @param {(string | URL)[]} urls - List of canonical URLs or paths to generate localized versions for.\n * Can be absolute URLs (`https://example.com/about`) or paths (`/about`).\n * Paths are resolved against `http://localhost` internally.\n * @returns {URL[]} Array of URL objects representing all localized variants.\n * The order follows each input URL with all its locale variants before moving to the next URL.\n */\nexport function generateStaticLocalizedUrls(urls) {\n /** @type {Set<URL>} */\n const localizedUrls = new Set();\n // For default URL pattern, we can optimize the generation\n if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {\n for (const urlInput of urls) {\n const url = urlInput instanceof URL\n ? urlInput\n : new URL(urlInput, \"http://localhost\");\n // Base locale doesn't get a prefix\n localizedUrls.add(url);\n // Other locales get their code as prefix\n for (const locale of locales) {\n if (locale !== baseLocale) {\n const localizedPath = `/${locale}${url.pathname}${url.search}${url.hash}`;\n const localizedUrl = new URL(localizedPath, url.origin);\n localizedUrls.add(localizedUrl);\n }\n }\n }\n return Array.from(localizedUrls);\n }\n // For custom URL patterns, we need to use localizeUrl for each URL and locale\n for (const urlInput of urls) {\n const url = urlInput instanceof URL\n ? urlInput\n : new URL(urlInput, \"http://localhost\");\n // Try each URL pattern to find one that matches\n let patternFound = false;\n for (const pattern of urlPatterns) {\n try {\n // Try to match the unlocalized pattern\n const unlocalizedMatch = new URLPattern(pattern.pattern, url.href).exec(url.href);\n if (!unlocalizedMatch)\n continue;\n patternFound = true;\n // Track unique localized URLs to avoid duplicates when patterns are the same\n const seenUrls = new Set();\n // Generate localized URL for each locale\n for (const [locale] of pattern.localized) {\n try {\n const localizedUrl = localizeUrl(url, { locale });\n const urlString = localizedUrl.href;\n // Only add if we haven't seen this exact URL before\n if (!seenUrls.has(urlString)) {\n seenUrls.add(urlString);\n localizedUrls.add(localizedUrl);\n }\n }\n catch {\n // Skip if localization fails for this locale\n continue;\n }\n }\n break;\n }\n catch {\n // Skip if pattern matching fails\n continue;\n }\n }\n // If no pattern matched, use the URL as is\n if (!patternFound) {\n localizedUrls.add(url);\n }\n }\n return Array.from(localizedUrls);\n}\n\n/**\n * @typedef {\"cookie\" | \"baseLocale\" | \"globalVariable\" | \"url\" | \"preferredLanguage\" | \"localStorage\"} BuiltInStrategy\n */\n/**\n * @typedef {`custom_${string}`} CustomStrategy\n */\n/**\n * @typedef {BuiltInStrategy | CustomStrategy} Strategy\n */\n/**\n * @typedef {Array<Strategy>} Strategies\n */\n/**\n * @typedef {{ getLocale: (request?: Request) => Promise<string | undefined> | (string | undefined) }} CustomServerStrategyHandler\n */\n/**\n * @typedef {{ getLocale: () => Promise<string|undefined> | (string | undefined), setLocale: (locale: string) => Promise<void> | void }} CustomClientStrategyHandler\n */\n/** @type {Map<string, CustomServerStrategyHandler>} */\nexport const customServerStrategies = new Map();\n/** @type {Map<string, CustomClientStrategyHandler>} */\nexport const customClientStrategies = new Map();\n/**\n * Checks if the given strategy is a custom strategy.\n *\n * @param {unknown} strategy The name of the custom strategy to validate.\n * Must be a string that starts with \"custom-\" followed by alphanumeric characters, hyphens, or underscores.\n * @returns {boolean} Returns true if it is a custom strategy, false otherwise.\n */\nexport function isCustomStrategy(strategy) {\n return (typeof strategy === \"string\" && /^custom-[A-Za-z0-9_-]+$/.test(strategy));\n}\n/**\n * Defines a custom strategy that is executed on the server.\n *\n * @see https://paraglidejs.com/strategy#write-your-own-strategy\n *\n * @param {string} strategy The name of the custom strategy to define. Must follow the pattern custom-name with alphanumeric characters, hyphens, or underscores.\n * @param {CustomServerStrategyHandler} handler The handler for the custom strategy, which should implement\n * the method getLocale.\n * @returns {void}\n */\nexport function defineCustomServerStrategy(strategy, handler) {\n if (!isCustomStrategy(strategy)) {\n throw new Error(`Invalid custom strategy: \"${strategy}\". Must be a custom strategy following the pattern custom-name.`);\n }\n customServerStrategies.set(strategy, handler);\n}\n/**\n * Defines a custom strategy that is executed on the client.\n *\n * @see https://paraglidejs.com/strategy#write-your-own-strategy\n *\n * @param {string} strategy The name of the custom strategy to define. Must follow the pattern custom-name with alphanumeric characters, hyphens, or underscores.\n * @param {CustomClientStrategyHandler} handler The handler for the custom strategy, which should implement the\n * methods getLocale and setLocale.\n * @returns {void}\n */\nexport function defineCustomClientStrategy(strategy, handler) {\n if (!isCustomStrategy(strategy)) {\n throw new Error(`Invalid custom strategy: \"${strategy}\". Must be a custom strategy following the pattern custom-name.`);\n }\n customClientStrategies.set(strategy, handler);\n}\n\n// ------ TYPES ------\nexport {};\n/**\n * A locale that is available in the project.\n *\n * @example\n * setLocale(request.locale as Locale)\n *\n * @typedef {typeof locales[number]} Locale\n */\n/**\n * A branded type representing a localized string.\n *\n * Message functions return this type instead of \\`string\\`, enabling TypeScript\n * to distinguish translated strings from regular strings at compile time.\n * This allows you to enforce that only properly localized content is used\n * in your UI components.\n *\n * Since \\`LocalizedString\\` is a branded subtype of \\`string\\`, it remains fully\n * backward compatible—you can pass it anywhere a \\`string\\` is expected.\n *\n * @example\n * // Enforce localized strings in your components\n * function PageTitle(props: { title: LocalizedString }) {\n * return <h1>{props.title}</h1>\n * }\n *\n * // ✅ Correct: using a message function\n * <PageTitle title={m.welcome_title()} />\n *\n * // ❌ Type error: raw strings are not LocalizedString\n * <PageTitle title=\"Welcome\" />\n *\n * @example\n * // LocalizedString is assignable to string (backward compatible)\n * const localized: LocalizedString = m.greeting()\n * const str: string = localized // ✅ works fine\n *\n * // But string is not assignable to LocalizedString\n * const raw: LocalizedString = \"Hello\" // ❌ Type error\n *\n * @example\n * // Catches accidental string concatenation\n * function showMessage(msg: LocalizedString) { ... }\n *\n * showMessage(m.hello()) // ✅\n * showMessage(\"Hello \" + userName) // ❌ Type error\n * showMessage(m.hello_user({ name: userName })) // ✅ use params instead\n *\n * @typedef {string & { readonly __brand: 'LocalizedString' }} LocalizedString\n */\n/**\n * A single markup option passed to a tag instance.\n *\n * @typedef {{\n * name: string;\n * value: unknown;\n * }} MessageMarkupOption\n */\n/**\n * A single static markup attribute attached to a tag instance.\n *\n * @typedef {{\n * name: string;\n * value: string | true;\n * }} MessageMarkupAttribute\n */\n/**\n * Record of markup options for a tag instance.\n *\n * @typedef {Record<string, unknown>} MessageMarkupOptions\n */\n/**\n * Record of markup attributes for a tag instance.\n *\n * @typedef {Record<string, string | true>} MessageMarkupAttributes\n */\n/**\n * Type-level schema for a single markup tag.\n *\n * @typedef {{\n * options: MessageMarkupOptions;\n * attributes: MessageMarkupAttributes;\n * children: boolean;\n * }} MessageMarkupTag\n */\n/**\n * Type-level schema for all markup tags in a message.\n *\n * @typedef {Record<string, MessageMarkupTag>} MessageMarkupSchema\n */\n/**\n * Type-only metadata attached to compiled message functions.\n *\n * @template Inputs\n * @template Options\n * @template {MessageMarkupSchema} [Markup = MessageMarkupSchema]\n * @typedef {{\n * readonly __paraglide?: {\n * inputs: Inputs;\n * options: Options;\n * markup: Markup;\n * };\n * }} MessageMetadata\n */\n/**\n * A compiled, framework-neutral message part.\n *\n * @typedef {{\n * type: \"text\";\n * value: string;\n * } | {\n * type: \"markup-start\";\n * name: string;\n * options: MessageMarkupOptions;\n * attributes: MessageMarkupAttributes;\n * } | {\n * type: \"markup-end\";\n * name: string;\n * options: MessageMarkupOptions;\n * attributes: MessageMarkupAttributes;\n * } | {\n * type: \"markup-standalone\";\n * name: string;\n * options: MessageMarkupOptions;\n * attributes: MessageMarkupAttributes;\n * }} MessagePart\n */\n/**\n * A message function is a message for a specific locale.\n *\n * @example\n * m.hello({ name: 'world' })\n *\n * @typedef {(inputs?: Record<string, never>) => LocalizedString} MessageFunction\n */\n/**\n * A message bundle function that selects the message to be returned.\n *\n * Uses `getLocale()` under the hood to determine the locale with an option.\n *\n * @template {string} T\n *\n * @example\n * * m.hello({ name: 'world' }, { locale: \"en\" })\n *\n * @typedef {(params: Record<string, never>, options: { locale: T }) => LocalizedString} MessageBundleFunction\n */\n"],"mappings":";AAGA,IAAM,IAA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AU;CACd,CAAC;CAEL,EAAU;AAEd;AAuDA,SAAgB,EAAS,GAAO;CAC5B,IAAI,OAAO,KAAU,UACjB;CAEJ,IAAM,IAAa,EAAM,YAAY;CACrC,KAAK,IAAM,KAAU,GACjB,IAAI,EAAO,YAAY,MAAM,GACzB,OAAO;AAInB;AA0BA,SAAgB,EAAe,GAAO;CAClC,IAAM,IAAS,EAAS,CAAK;CAC7B,IAAI,GACA,OAAO;CACX,MAAU,MAAM,mBAAmB,EAAM,qBAAqB,EAAQ,KAAK,IAAI,GAAG;AACtF;AA8JA,IAAM,IAAoB,EAAW,QAAQ,uBAAuB,MAAM;AAC1C,OAAO,cAAc,EAAkB,SAAS;AA83BhF,IAAa,oBAAyB,IAAI,IAAI;AAQ9C,SAAgB,EAAiB,GAAU;CACvC,OAAQ,OAAO,KAAa,YAAY,0BAA0B,KAAK,CAAQ;AACnF"}
1
+ {"version":3,"file":"runtime.js","names":[],"sources":["../../src/paraglide/runtime.js"],"sourcesContent":["/* eslint-disable */\n\n/** @type {any} */\nconst URLPattern = {}\n\n/**\n * The project's base locale.\n *\n * @example\n * if (locale === baseLocale) {\n * // do something\n * }\n */\nexport const baseLocale = \"en-gb\";\n/**\n * The project's locales that have been specified in the settings.\n *\n * @example\n * if (locales.includes(userSelectedLocale) === false) {\n * throw new Error('Locale is not available');\n * }\n */\nexport const locales = /** @type {const} */ ([\"en-gb\",\"nb\"]);\n/** @type {string} */\nexport const cookieName = \"PARAGLIDE_LOCALE\";\n/** @type {number} */\nexport const cookieMaxAge = 34560000;\n/** @type {string} */\nexport const cookieDomain = \"\";\n/** @type {string} */\nexport const localStorageKey = \"PARAGLIDE_LOCALE\";\n/**\n * @type {Array<\"cookie\" | \"baseLocale\" | \"globalVariable\" | \"url\" | \"preferredLanguage\" | \"localStorage\" | `custom-${string}`>}\n */\nexport const strategy = [\n \"globalVariable\",\n \"baseLocale\"\n];\n/**\n * Route-level strategy overrides.\n *\n * `match` uses URLPattern syntax.\n *\n * @type {Array<{\n * match: string;\n * strategy?: Array<\"cookie\" | \"baseLocale\" | \"globalVariable\" | \"url\" | \"preferredLanguage\" | \"localStorage\" | `custom-${string}`>;\n * exclude?: boolean;\n * }>}\n */\nexport const routeStrategies = [];\n/**\n * The used URL patterns.\n *\n * @type {Array<{ pattern: string, localized: Array<[Locale, string]> }>}\n */\nexport const urlPatterns = [\n {\n \"pattern\": \":protocol://:domain(.*)::port?/:path(.*)?\",\n \"localized\": [\n [\n \"nb\",\n \":protocol://:domain(.*)::port?/nb/:path(.*)?\"\n ],\n [\n \"en-gb\",\n \":protocol://:domain(.*)::port?/:path(.*)?\"\n ]\n ]\n }\n];\n/** @type {string | undefined} */\nlet cachedRouteStrategyUrl;\n/** @type {{ match: string; strategy?: typeof strategy; exclude?: boolean } | undefined} */\nlet cachedRouteStrategy;\n/**\n * @param {string | URL} url\n * @returns {{ match: string; strategy?: typeof strategy; exclude?: boolean } | undefined}\n */\nfunction findMatchingRouteStrategy(url) {\n if (routeStrategies.length === 0) {\n return undefined;\n }\n const urlString = typeof url === \"string\" ? url : url.href;\n if (cachedRouteStrategyUrl === urlString) {\n return cachedRouteStrategy;\n }\n const urlObject = new URL(urlString, \"http://dummy.com\");\n let match;\n for (const routeStrategy of routeStrategies) {\n const pattern = new URLPattern(routeStrategy.match, urlObject.href);\n if (pattern.exec(urlObject.href)) {\n match = routeStrategy;\n break;\n }\n }\n cachedRouteStrategyUrl = urlString;\n cachedRouteStrategy = match;\n return match;\n}\n/**\n * Returns the strategy to use for a specific URL.\n *\n * If no route strategy matches (or the matching rule is `exclude: true`),\n * the global strategy is returned.\n *\n * @param {string | URL} url\n * @returns {typeof strategy}\n */\nexport function getStrategyForUrl(url) {\n const routeStrategy = findMatchingRouteStrategy(url);\n if (routeStrategy &&\n routeStrategy.exclude !== true &&\n Array.isArray(routeStrategy.strategy)) {\n return routeStrategy.strategy;\n }\n return strategy;\n}\n/**\n * Returns whether the given URL is excluded from middleware i18n processing.\n *\n * @param {string | URL} url\n * @returns {boolean}\n */\nexport function isExcludedByRouteStrategy(url) {\n return findMatchingRouteStrategy(url)?.exclude === true;\n}\n/**\n * @typedef {{\n * \t\tgetStore(): {\n * \t\tlocale?: Locale,\n * \t\t\torigin?: string,\n * \t\t\tmessageCalls?: Set<string>\n * \t} | undefined,\n * \t\trun: (store: { locale?: Locale, origin?: string, messageCalls?: Set<string>},\n * cb: any) => any\n * }} ParaglideAsyncLocalStorage\n */\n/**\n * Server side async local storage that is set by `serverMiddleware()`.\n *\n * The variable is used to retrieve the locale and origin in a server-side\n * rendering context without effecting other requests.\n *\n * @type {ParaglideAsyncLocalStorage | undefined}\n */\nexport let serverAsyncLocalStorage = undefined;\nexport const disableAsyncLocalStorage = false;\nexport const experimentalMiddlewareLocaleSplitting = false;\nexport const isServer = import.meta.env?.SSR ?? typeof window === 'undefined';\n/** @type {Locale | undefined} */\nexport const experimentalStaticLocale = undefined;\n/**\n * Sets the server side async local storage.\n *\n * The function is needed because the `runtime.js` file\n * must define the `serverAsyncLocalStorage` variable to\n * avoid a circular import between `runtime.js` and\n * `server.js` files.\n *\n * @param {ParaglideAsyncLocalStorage | undefined} value\n */\nexport function overwriteServerAsyncLocalStorage(value) {\n serverAsyncLocalStorage = value;\n}\nconst TREE_SHAKE_COOKIE_STRATEGY_USED = false;\nconst TREE_SHAKE_URL_STRATEGY_USED = false;\nconst TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED = true;\nconst TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED = false;\nconst TREE_SHAKE_DEFAULT_URL_PATTERN_USED = true;\nconst TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED = false;\n\n/** @type {any} */ (globalThis).__paraglide =\n\t/** @type {any} */ (globalThis).__paraglide ?? {};\n/** @type {any} */ (globalThis).__paraglide.ssr =\n\t/** @type {any} */ (globalThis).__paraglide.ssr ?? {};\n\n/**\n * This is a fallback to get started with a custom\n * strategy and avoid type errors.\n *\n * The implementation is overwritten\n * by `overwriteGetLocale()` and `defineSetLocale()`.\n *\n * @type {Locale | undefined}\n */\nlet _locale;\nlet localeInitiallySet = false;\n/**\n * Get the current locale.\n *\n * The locale is resolved using your configured strategies (URL, cookie, localStorage, etc.)\n * in the order they are defined. In SSR contexts, the locale is retrieved from AsyncLocalStorage\n * which is set by the `paraglideMiddleware()`.\n *\n * @see https://paraglidejs.com/strategy - Configure locale detection strategies\n *\n * @example\n * if (getLocale() === 'de') {\n * console.log('Germany 🇩🇪');\n * } else if (getLocale() === 'nl') {\n * console.log('Netherlands 🇳🇱');\n * }\n *\n * @returns {Locale} The current locale.\n */\nexport let getLocale = () => {\n if (experimentalStaticLocale !== undefined) {\n return experimentalStaticLocale;\n }\n // if running in a server-side rendering context\n // retrieve the locale from the async local storage\n if (serverAsyncLocalStorage) {\n const locale = serverAsyncLocalStorage?.getStore()?.locale;\n if (locale) {\n return locale;\n }\n }\n let strategyToUse = strategy;\n if (!isServer && typeof window !== \"undefined\" && window.location?.href) {\n strategyToUse = getStrategyForUrl(window.location.href);\n }\n const resolved = resolveLocaleWithStrategies(strategyToUse, typeof window !== \"undefined\" ? window.location?.href : undefined);\n if (resolved) {\n if (!localeInitiallySet) {\n _locale = resolved;\n // https://github.com/opral/inlang-paraglide-js/issues/455\n localeInitiallySet = true;\n setLocale(resolved, { reload: false });\n }\n return resolved;\n }\n throw new Error(\"No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found\");\n};\n/**\n * Resolve locale for a given URL using route-aware strategies.\n *\n * @param {string | URL} url\n * @returns {Locale}\n */\nexport function getLocaleForUrl(url) {\n if (experimentalStaticLocale !== undefined) {\n return experimentalStaticLocale;\n }\n const strategyToUse = getStrategyForUrl(url);\n const resolved = resolveLocaleWithStrategies(strategyToUse, typeof url === \"string\" ? url : url.href);\n if (resolved) {\n return resolved;\n }\n throw new Error(\"No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found\");\n}\n/**\n * @param {typeof strategy} strategyToUse\n * @param {string | undefined} urlForUrlStrategy\n * @returns {Locale | undefined}\n */\nfunction resolveLocaleWithStrategies(strategyToUse, urlForUrlStrategy) {\n /** @type {string | undefined} */\n let locale;\n for (const strat of strategyToUse) {\n if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === \"cookie\") {\n locale = extractLocaleFromCookie();\n }\n else if (strat === \"baseLocale\") {\n locale = baseLocale;\n }\n else if (TREE_SHAKE_URL_STRATEGY_USED &&\n strat === \"url\" &&\n !isServer &&\n typeof urlForUrlStrategy === \"string\") {\n locale = extractLocaleFromUrl(urlForUrlStrategy);\n }\n else if (TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED &&\n strat === \"globalVariable\" &&\n _locale !== undefined) {\n locale = _locale;\n }\n else if (TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED &&\n strat === \"preferredLanguage\" &&\n !isServer) {\n locale = extractLocaleFromNavigator();\n }\n else if (TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED &&\n strat === \"localStorage\" &&\n !isServer) {\n locale = localStorage.getItem(localStorageKey) ?? undefined;\n }\n else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {\n const handler = customClientStrategies.get(strat);\n if (handler) {\n const result = handler.getLocale();\n // Handle both sync and async results - skip async in sync getLocale\n if (result instanceof Promise) {\n // Can't await in sync function, skip async strategies\n continue;\n }\n if (result !== undefined) {\n return assertIsLocale(result);\n }\n }\n }\n const matchedLocale = toLocale(locale);\n if (matchedLocale) {\n return matchedLocale;\n }\n }\n return undefined;\n}\n/**\n * Overwrite the `getLocale()` function.\n *\n * Use this function to overwrite how the locale is resolved. This is useful\n * for custom locale resolution or advanced use cases like SSG with concurrent rendering.\n *\n * @see https://paraglidejs.com/strategy\n *\n * @example\n * overwriteGetLocale(() => {\n * return Cookies.get('locale') ?? baseLocale\n * });\n *\n * @param {() => Locale} fn - The new implementation for `getLocale()`.\n */\nexport const overwriteGetLocale = (fn) => {\n getLocale = fn;\n};\n\nconst rtlLanguages = new Set([\n \"ar\",\n \"dv\",\n \"fa\",\n \"he\",\n \"ks\",\n \"ku\",\n \"ps\",\n \"sd\",\n \"ug\",\n \"ur\",\n \"yi\",\n]);\n/**\n * Get writing direction for a locale.\n *\n * Uses `Intl.Locale` text info when available and falls back to a\n * language-based RTL check for runtimes without `getTextInfo()`.\n *\n * @example\n * getTextDirection(); // \"ltr\" or \"rtl\" for current locale\n * getTextDirection(\"ar\"); // \"rtl\"\n * getTextDirection(\"en\"); // \"ltr\"\n *\n * @param {string} [locale] - Target locale. If not provided, uses `getLocale()`\n * @returns {\"ltr\" | \"rtl\"}\n */\nexport function getTextDirection(locale = getLocale()) {\n try {\n const intlLocale = /** @type {Intl.Locale & {\n getTextInfo?: () => { direction?: string };\n textInfo?: { direction?: string };\n }} */ (new Intl.Locale(locale));\n const direction = intlLocale.getTextInfo?.().direction ?? intlLocale.textInfo?.direction;\n if (direction === \"ltr\" || direction === \"rtl\") {\n return direction;\n }\n }\n catch {\n // Ignore Intl.Locale parsing/runtime errors and use fallback below.\n }\n const language = locale.split(\"-\")[0]?.toLowerCase();\n return rtlLanguages.has(language ?? \"\") ? \"rtl\" : \"ltr\";\n}\n\n/**\n * Navigates to the localized URL, or reloads the current page\n *\n * @param {string} [newLocation] The new location\n */\nconst navigateOrReload = (newLocation) => {\n if (newLocation) {\n // reload the page by navigating to the new url\n window.location.href = newLocation;\n }\n else {\n // reload the page to reflect the new locale\n window.location.reload();\n }\n};\n/**\n * @typedef {(newLocale: Locale, options?: { reload?: boolean }) => void | Promise<void>} SetLocaleFn\n */\n/**\n * Set the locale.\n *\n * Updates the locale using your configured strategies (cookie, localStorage, URL, etc.).\n * By default, this reloads the page on the client to reflect the new locale. Reloading\n * can be disabled by passing `reload: false` as an option, but you'll need to ensure\n * the UI updates to reflect the new locale.\n *\n * If any custom strategy's `setLocale` function is async, then this function\n * will become async as well.\n *\n * @see https://paraglidejs.com/strategy\n *\n * @example\n * setLocale('en');\n *\n * @example\n * setLocale('en', { reload: false });\n *\n * @type {SetLocaleFn}\n */\nexport let setLocale = (newLocale, options) => {\n const optionsWithDefaults = {\n reload: true,\n ...options,\n };\n if (experimentalStaticLocale !== undefined &&\n newLocale !== experimentalStaticLocale &&\n optionsWithDefaults.reload === false) {\n console.warn(`Paraglide: setLocale(${JSON.stringify(newLocale)}, { reload: false }) cannot switch away from the statically built locale ${JSON.stringify(experimentalStaticLocale)}. A document navigation is required; reload has been forced to true.`);\n optionsWithDefaults.reload = true;\n }\n // locale is already set\n // https://github.com/opral/inlang-paraglide-js/issues/430\n /** @type {Locale | undefined} */\n let currentLocale;\n try {\n currentLocale = getLocale();\n }\n catch {\n // do nothing, no locale has been set yet.\n }\n /** @type {Array<Promise<void>>} */\n const customSetLocalePromises = [];\n /** @type {string | undefined} */\n let newLocation = undefined;\n let strategyToUse = strategy;\n if (!isServer && typeof window !== \"undefined\" && window.location?.href) {\n strategyToUse = getStrategyForUrl(window.location.href);\n }\n for (const strat of strategyToUse) {\n if (TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED &&\n strat === \"globalVariable\") {\n // a default for a custom strategy to get started quickly\n // is likely overwritten by `defineSetLocale()`\n _locale = newLocale;\n }\n else if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === \"cookie\") {\n if (isServer ||\n typeof document === \"undefined\" ||\n typeof window === \"undefined\") {\n continue;\n }\n // set the cookie\n const cookieString = `${cookieName}=${newLocale}; path=/; max-age=${cookieMaxAge}`;\n document.cookie = cookieDomain\n ? `${cookieString}; domain=${cookieDomain}`\n : cookieString;\n clearLocaleCookieCache();\n }\n else if (strat === \"baseLocale\") {\n // nothing to be set here. baseLocale is only a fallback\n continue;\n }\n else if (TREE_SHAKE_URL_STRATEGY_USED &&\n strat === \"url\" &&\n typeof window !== \"undefined\") {\n // route to the new url\n //\n // this triggers a page reload but a user rarely\n // switches locales, so this should be fine.\n //\n // if the behavior is not desired, the implementation\n // can be overwritten by `defineSetLocale()` to avoid\n // a full page reload.\n newLocation = localizeUrl(window.location.href, {\n locale: newLocale,\n }).href;\n }\n else if (TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED &&\n strat === \"localStorage\" &&\n typeof window !== \"undefined\") {\n // set the localStorage\n localStorage.setItem(localStorageKey, newLocale);\n }\n else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {\n const handler = customClientStrategies.get(strat);\n if (handler) {\n let result = handler.setLocale(newLocale);\n // Handle async setLocale\n if (result instanceof Promise) {\n result = result.catch((error) => {\n throw new Error(`Custom strategy \"${strat}\" setLocale failed.`, {\n cause: error,\n });\n });\n customSetLocalePromises.push(result);\n }\n }\n }\n }\n const runReload = () => {\n if (!isServer &&\n optionsWithDefaults.reload &&\n window.location &&\n newLocale !== currentLocale) {\n navigateOrReload(newLocation);\n }\n };\n if (customSetLocalePromises.length) {\n return Promise.all(customSetLocalePromises).then(() => {\n runReload();\n });\n }\n runReload();\n return;\n};\n/**\n * Overwrite the `setLocale()` function.\n *\n * Use this function to overwrite how the locale is set. For example,\n * modify a cookie, env variable, or a user's preference.\n *\n * @example\n * overwriteSetLocale((newLocale) => {\n * // set the locale in a cookie\n * return Cookies.set('locale', newLocale)\n * });\n *\n * @param {SetLocaleFn} fn\n */\nexport const overwriteSetLocale = (fn) => {\n setLocale = fn;\n};\n\n/**\n * The origin of the current URL.\n *\n * Defaults to \"http://y.com\" in non-browser environments. If this\n * behavior is not desired, the implementation can be overwritten\n * by `overwriteGetUrlOrigin()`.\n *\n * @type {() => string}\n */\nexport let getUrlOrigin = () => {\n if (serverAsyncLocalStorage) {\n return serverAsyncLocalStorage.getStore()?.origin ?? \"http://fallback.com\";\n }\n else if (typeof window !== \"undefined\") {\n return window.location.origin;\n }\n return \"http://fallback.com\";\n};\n/**\n * Overwrite the getUrlOrigin function.\n *\n * Use this function in server environments to\n * define how the URL origin is resolved.\n *\n * @param {() => string} fn - The new implementation for `getUrlOrigin()`.\n */\nexport let overwriteGetUrlOrigin = (fn) => {\n getUrlOrigin = fn;\n};\n\n/**\n * Coerces a locale-like string to the canonical locale value used by the runtime.\n *\n * @param {unknown} value\n * @returns {Locale | undefined}\n */\nexport function toLocale(value) {\n if (typeof value !== \"string\") {\n return undefined;\n }\n const lowerValue = value.toLowerCase();\n for (const locale of locales) {\n if (locale.toLowerCase() === lowerValue) {\n return locale;\n }\n }\n return undefined;\n}\n/**\n * Check if something is an available locale with the canonical project casing.\n *\n * @example\n * if (isLocale(params.locale)) {\n * setLocale(params.locale);\n * } else {\n * setLocale('en');\n * }\n *\n * Use `toLocale()` when you want case-insensitive matching and canonicalization.\n *\n * @param {unknown} locale\n * @returns {locale is Locale}\n */\nexport function isLocale(locale) {\n return !!locale && locales.some((item) => item === locale);\n}\n/**\n * Asserts that the input can be normalized to a locale.\n *\n * @param {unknown} input - The input to check.\n * @returns {Locale} The input normalized to a Locale.\n * @throws {Error} If the input is not a locale.\n */\nexport function assertIsLocale(input) {\n const locale = toLocale(input);\n if (locale)\n return locale;\n throw new Error(`Invalid locale: ${input}. Expected one of: ${locales.join(\", \")}`);\n}\n\n/**\n * @typedef {object} ExtractLocaleFromRequestOptions\n * @property {string | URL} [effectiveRequestUrl] - Effective request URL to use for route matching and locale detection with the URL strategy.\n */\n/**\n * Extracts a locale from a request.\n *\n * Use the function on the server to extract the locale\n * from a request.\n *\n * The function goes through the strategies in the order\n * they are defined. If a strategy returns an invalid locale,\n * it will fall back to the next strategy.\n *\n * Note: Custom server strategies are not supported in this synchronous version.\n * Use `extractLocaleFromRequestAsync` if you need custom server strategies with async getLocale methods.\n *\n * @example\n * const locale = extractLocaleFromRequest(request);\n *\n * @param {Request} request\n * @param {ExtractLocaleFromRequestOptions} [options]\n * @returns {Locale}\n */\nexport const extractLocaleFromRequest = (request, options = {}) => {\n const effectiveRequestUrl = resolveEffectiveRequestUrl(request, options.effectiveRequestUrl);\n return extractLocaleFromRequestWithStrategies(request, getStrategyForUrl(effectiveRequestUrl), effectiveRequestUrl);\n};\n/**\n * Extracts a locale from a request using the provided strategy order.\n *\n * @param {Request} request\n * @param {typeof strategy} strategies\n * @param {string | URL} [url]\n * @returns {Locale}\n */\nexport const extractLocaleFromRequestWithStrategies = (request, strategies, url = request.url) => {\n const effectiveRequestUrl = resolveEffectiveRequestUrl(request, url);\n /** @type {string|undefined} */\n let locale;\n for (const strat of strategies) {\n if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === \"cookie\") {\n const cookiePrefix = cookieName + \"=\";\n locale = request.headers\n .get(\"cookie\")\n ?.split(\";\")\n .map((c) => c.trim())\n .find((c) => c.startsWith(cookiePrefix))\n ?.slice(cookiePrefix.length);\n }\n else if (TREE_SHAKE_URL_STRATEGY_USED && strat === \"url\") {\n locale = extractLocaleFromUrl(effectiveRequestUrl);\n }\n else if (TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED &&\n strat === \"preferredLanguage\") {\n locale = extractLocaleFromHeader(request);\n }\n else if (strat === \"globalVariable\") {\n locale = _locale;\n }\n else if (strat === \"baseLocale\") {\n return baseLocale;\n }\n else if (strat === \"localStorage\") {\n continue;\n }\n else if (isCustomStrategy(strat)) {\n // Custom strategies are not supported in sync version\n // Use extractLocaleFromRequestAsync for custom server strategies\n continue;\n }\n const matchedLocale = toLocale(locale);\n if (matchedLocale) {\n return matchedLocale;\n }\n }\n throw new Error(\"No locale found. There is an error in your strategy. Try adding 'baseLocale' as the very last strategy. Read more here https://paraglidejs.com/errors#no-locale-found\");\n};\n/**\n * @param {Request} request\n * @param {string | URL | undefined} effectiveRequestUrl\n * @returns {URL}\n */\nfunction resolveEffectiveRequestUrl(request, effectiveRequestUrl = request.url) {\n if (effectiveRequestUrl instanceof URL) {\n return new URL(effectiveRequestUrl.href);\n }\n return new URL(effectiveRequestUrl, request.url);\n}\n\n/**\n * Asynchronously extracts a locale from a request.\n *\n * This function supports async custom server strategies, unlike the synchronous\n * `extractLocaleFromRequest`. Use this function when you have custom server strategies\n * that need to perform asynchronous operations (like database calls) in their getLocale method.\n *\n * The function first processes any custom server strategies asynchronously, then falls back\n * to the synchronous `extractLocaleFromRequest` for all other strategies.\n *\n * @see {@link https://github.com/opral/inlang-paraglide-js/issues/527#issuecomment-2978151022}\n *\n * @example\n * // Basic usage\n * const locale = await extractLocaleFromRequestAsync(request);\n *\n * @example\n * // With custom async server strategy\n * defineCustomServerStrategy(\"custom-database\", {\n * getLocale: async (request) => {\n * const userId = extractUserIdFromRequest(request);\n * return await getUserLocaleFromDatabase(userId);\n * }\n * });\n *\n * const locale = await extractLocaleFromRequestAsync(request);\n *\n * @param {Request} request - The request object to extract the locale from.\n * @param {{ effectiveRequestUrl?: string | URL }} [options] - Effective request URL to use for route matching and locale detection with the URL strategy.\n * @returns {Promise<Locale>} The extracted locale.\n */\nexport const extractLocaleFromRequestAsync = async (request, options = {}) => {\n /** @type {string|undefined} */\n let locale;\n const effectiveRequestUrl = resolveEffectiveRequestUrlFromRequestAsync(request, options.effectiveRequestUrl);\n const strategy = getStrategyForUrl(effectiveRequestUrl);\n // Process custom strategies first, in order\n for (const strat of strategy) {\n if (isCustomStrategy(strat) && customServerStrategies.has(strat)) {\n const handler = customServerStrategies.get(strat);\n if (handler) {\n /** @type {string|undefined} */\n locale = await handler.getLocale(request);\n }\n // If we got a valid locale from this custom strategy, use it\n const matchedLocale = toLocale(locale);\n if (matchedLocale) {\n return matchedLocale;\n }\n }\n }\n // If no custom strategy provided a valid locale, fall back to sync version\n return extractLocaleFromRequestWithStrategies(request, strategy, effectiveRequestUrl);\n};\n/**\n * @param {Request} request\n * @param {string | URL | undefined} effectiveRequestUrl\n * @returns {URL}\n */\nfunction resolveEffectiveRequestUrlFromRequestAsync(request, effectiveRequestUrl = request.url) {\n if (effectiveRequestUrl instanceof URL) {\n return new URL(effectiveRequestUrl.href);\n }\n return new URL(effectiveRequestUrl, request.url);\n}\n\nconst cookieNamePattern = cookieName.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\nconst localeCookiePattern = new RegExp(`(?:^|;\\\\s*)${cookieNamePattern}=([^;]*)`);\nconst noCachedLocale = Symbol();\n/** @type {Locale | undefined | typeof noCachedLocale} */\nlet cachedLocaleFromCookie = noCachedLocale;\n/**\n * Clears the cached locale from `document.cookie`.\n */\nfunction clearLocaleCookieCache() {\n cachedLocaleFromCookie = noCachedLocale;\n}\nfunction scheduleLocaleCookieCacheClear() {\n if (typeof queueMicrotask === \"function\") {\n queueMicrotask(clearLocaleCookieCache);\n }\n else {\n Promise.resolve().then(clearLocaleCookieCache);\n }\n}\n/**\n * Extracts a cookie from the document.\n *\n * Will return undefined if the document is not available or if the cookie is not set.\n * The `document` object is not available in server-side rendering, so this function should not be called in that context.\n *\n * @returns {Locale | undefined}\n */\nexport function extractLocaleFromCookie() {\n if (typeof document === \"undefined\") {\n return;\n }\n if (cachedLocaleFromCookie !== noCachedLocale) {\n return cachedLocaleFromCookie;\n }\n const match = document.cookie.match(localeCookiePattern);\n const locale = match?.[1];\n cachedLocaleFromCookie = toLocale(locale);\n scheduleLocaleCookieCacheClear();\n return cachedLocaleFromCookie;\n}\n\n/**\n * Extracts a locale from the accept-language header.\n *\n * Use the function on the server to extract the locale\n * from the accept-language header that is sent by the client.\n *\n * @example\n * const locale = extractLocaleFromHeader(request);\n *\n * @param {Request} request - The request object to extract the locale from.\n * @returns {Locale | undefined} The negotiated preferred language.\n */\nexport function extractLocaleFromHeader(request) {\n const acceptLanguageHeader = request.headers.get(\"accept-language\");\n if (acceptLanguageHeader) {\n // Parse language preferences with their q-values and base language codes\n const languages = acceptLanguageHeader\n .split(\",\")\n .map((lang) => {\n const [tag, q = \"1\"] = lang.trim().split(\";q=\");\n // Get both the full tag and base language code\n const baseTag = tag?.split(\"-\")[0];\n return {\n fullTag: tag,\n baseTag,\n q: Number(q),\n };\n })\n .sort((a, b) => b.q - a.q);\n for (const lang of languages) {\n const fullLocale = toLocale(lang.fullTag);\n if (fullLocale) {\n return fullLocale;\n }\n const baseLocale = toLocale(lang.baseTag);\n if (baseLocale) {\n return baseLocale;\n }\n }\n return undefined;\n }\n return undefined;\n}\n\n/**\n * Negotiates a preferred language from navigator.languages.\n *\n * Use the function on the client to extract the locale\n * from the navigator.languages array.\n *\n * @example\n * const locale = extractLocaleFromNavigator();\n *\n * @returns {Locale | undefined}\n */\nexport function extractLocaleFromNavigator() {\n if (!navigator?.languages?.length) {\n return undefined;\n }\n const languages = navigator.languages.map((lang) => ({\n fullTag: lang,\n baseTag: lang.split(\"-\")[0],\n }));\n for (const lang of languages) {\n const fullLocale = toLocale(lang.fullTag);\n if (fullLocale) {\n return fullLocale;\n }\n const baseLocale = toLocale(lang.baseTag);\n if (baseLocale) {\n return baseLocale;\n }\n }\n return undefined;\n}\n\n/**\n * If extractLocaleFromUrl is called many times on the same page and the URL\n * hasn't changed, we don't need to recompute it every time which can get expensive.\n * We might use a LRU cache if needed, but for now storing only the last result is enough.\n * https://github.com/opral/monorepo/pull/3575#discussion_r2066731243\n */\n/** @type {string|undefined} */\nlet cachedUrl;\n/** @type {Locale|undefined} */\nlet cachedLocale;\n/**\n * Extracts the locale from a given URL using native URLPattern.\n *\n * The built-in default `/:locale/...` routing is case-insensitive because it\n * canonicalizes the first path segment with `toLocale()`. Custom `urlPatterns`\n * keep URLPattern's normal exact matching semantics for path segments.\n *\n * @param {URL|string} url - The full URL from which to extract the locale.\n * @returns {Locale|undefined} The extracted locale, or undefined if no locale is found.\n */\nexport function extractLocaleFromUrl(url) {\n const urlString = typeof url === \"string\" ? url : url.href;\n if (cachedUrl === urlString) {\n return cachedLocale;\n }\n /** @type {Locale | undefined} */\n let result;\n if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {\n result = defaultUrlPatternExtractLocale(url);\n }\n else {\n const urlObj = typeof url === \"string\" ? new URL(url) : url;\n // Iterate over URL patterns\n for (const element of urlPatterns) {\n for (const [locale, localizedPattern] of element.localized) {\n const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);\n if (match) {\n result = locale;\n break;\n }\n }\n if (result)\n break;\n }\n }\n cachedUrl = urlString;\n cachedLocale = result;\n return result;\n}\n/**\n * https://github.com/opral/inlang-paraglide-js/issues/381\n *\n * @param {URL | string} url - The full URL from which to extract the locale.\n * @returns {Locale | undefined} The extracted locale, or undefined if no locale is found.\n */\nfunction defaultUrlPatternExtractLocale(url) {\n const urlObj = new URL(url, \"http://dummy.com\");\n const pathSegments = urlObj.pathname.split(\"/\").filter(Boolean);\n return toLocale(pathSegments[0]) || baseLocale;\n}\n\n/**\n * Lower-level URL localization function, primarily used in server contexts.\n *\n * This function is designed for server-side usage where you need precise control\n * over URL localization, such as in middleware or request handlers. It works with\n * URL objects and always returns absolute URLs.\n *\n * For client-side UI components, use `localizeHref()` instead, which provides\n * a more convenient API with relative paths and automatic locale detection.\n *\n * @see https://paraglidejs.com/i18n-routing\n *\n * @example\n * ```typescript\n * // Server middleware example\n * app.use((req, res, next) => {\n * const url = new URL(req.url, `${req.protocol}://${req.headers.host}`);\n * const localized = localizeUrl(url, { locale: \"de\" });\n *\n * if (localized.href !== url.href) {\n * return res.redirect(localized.href);\n * }\n * next();\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Using with URL patterns\n * const url = new URL(\"https://example.com/about\");\n * localizeUrl(url, { locale: \"de\" });\n * // => URL(\"https://example.com/de/about\")\n *\n * // Using with domain-based localization\n * const url = new URL(\"https://example.com/store\");\n * localizeUrl(url, { locale: \"de\" });\n * // => URL(\"https://de.example.com/store\")\n * ```\n *\n * @param {string | URL} url - The URL to localize. If string, must be absolute.\n * @param {object} [options] - Options for localization\n * @param {Locale} [options.locale] - Target locale. If not provided, uses getLocale()\n * @returns {URL} The localized URL, always absolute\n */\nexport function localizeUrl(url, options) {\n const targetLocale = options?.locale\n ? assertIsLocale(options?.locale)\n : getLocale();\n if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {\n return localizeUrlDefaultPattern(url, targetLocale);\n }\n const urlObj = typeof url === \"string\" ? new URL(url) : url;\n // Iterate over URL patterns\n for (const element of urlPatterns) {\n // match localized patterns\n for (const [, localizedPattern] of element.localized) {\n const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);\n if (!match) {\n continue;\n }\n const targetPattern = element.localized.find(([locale]) => locale === targetLocale)?.[1];\n if (!targetPattern) {\n continue;\n }\n const localizedUrl = fillPattern(targetPattern, aggregateGroups(match), urlObj.origin);\n return fillMissingUrlParts(localizedUrl, match);\n }\n const unlocalizedMatch = new URLPattern(element.pattern, urlObj.href).exec(urlObj.href);\n if (unlocalizedMatch) {\n const targetPattern = element.localized.find(([locale]) => locale === targetLocale)?.[1];\n if (targetPattern) {\n const localizedUrl = fillPattern(targetPattern, aggregateGroups(unlocalizedMatch), urlObj.origin);\n return fillMissingUrlParts(localizedUrl, unlocalizedMatch);\n }\n }\n }\n // If no match found, return the original URL\n return urlObj;\n}\n/**\n * https://github.com/opral/inlang-paraglide-js/issues/381\n *\n * @param {string | URL} url\n * @param {Locale} locale\n * @returns {URL}\n */\nfunction localizeUrlDefaultPattern(url, locale) {\n const urlObj = typeof url === \"string\" ? new URL(url, getUrlOrigin()) : new URL(url);\n const currentLocale = extractLocaleFromUrl(urlObj);\n // If current locale matches target locale, no change needed\n if (currentLocale === locale) {\n return urlObj;\n }\n const pathSegments = urlObj.pathname.split(\"/\").filter(Boolean);\n // If current path starts with a locale, remove it\n if (pathSegments.length > 0 && toLocale(pathSegments[0])) {\n pathSegments.shift();\n }\n // For base locale, don't add prefix\n if (locale === baseLocale) {\n urlObj.pathname = \"/\" + pathSegments.join(\"/\");\n }\n else {\n // For other locales, add prefix\n urlObj.pathname = \"/\" + locale + \"/\" + pathSegments.join(\"/\");\n }\n return urlObj;\n}\n/**\n * Low-level URL de-localization function, primarily used in server contexts.\n *\n * This function is designed for server-side usage where you need precise control\n * over URL de-localization, such as in middleware or request handlers. It works with\n * URL objects and always returns absolute URLs.\n *\n * For client-side UI components, use `deLocalizeHref()` instead, which provides\n * a more convenient API with relative paths.\n *\n * @see https://paraglidejs.com/i18n-routing\n *\n * @example\n * ```typescript\n * // Server middleware example\n * app.use((req, res, next) => {\n * const url = new URL(req.url, `${req.protocol}://${req.headers.host}`);\n * const baseUrl = deLocalizeUrl(url);\n *\n * // Store the base URL for later use\n * req.baseUrl = baseUrl;\n * next();\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Using with URL patterns\n * const url = new URL(\"https://example.com/de/about\");\n * deLocalizeUrl(url); // => URL(\"https://example.com/about\")\n *\n * // Using with domain-based localization\n * const url = new URL(\"https://de.example.com/store\");\n * deLocalizeUrl(url); // => URL(\"https://example.com/store\")\n * ```\n *\n * @param {string | URL} url - The URL to de-localize. If string, must be absolute.\n * @returns {URL} The de-localized URL, always absolute\n */\nexport function deLocalizeUrl(url) {\n if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {\n return deLocalizeUrlDefaultPattern(url);\n }\n const urlObj = typeof url === \"string\" ? new URL(url) : url;\n // Iterate over URL patterns\n for (const element of urlPatterns) {\n // Iterate over localized versions\n for (const [, localizedPattern] of element.localized) {\n const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);\n if (match) {\n // Convert localized URL back to the base pattern\n const groups = aggregateGroups(match);\n const baseUrl = fillPattern(element.pattern, groups, urlObj.origin);\n return fillMissingUrlParts(baseUrl, match);\n }\n }\n // match unlocalized pattern\n const unlocalizedMatch = new URLPattern(element.pattern, urlObj.href).exec(urlObj.href);\n if (unlocalizedMatch) {\n const baseUrl = fillPattern(element.pattern, aggregateGroups(unlocalizedMatch), urlObj.origin);\n return fillMissingUrlParts(baseUrl, unlocalizedMatch);\n }\n }\n // no match found return the original url\n return urlObj;\n}\n/**\n * De-localizes a URL using the default pattern (/:locale/*)\n * @param {string|URL} url\n * @returns {URL}\n */\nfunction deLocalizeUrlDefaultPattern(url) {\n const urlObj = typeof url === \"string\" ? new URL(url, getUrlOrigin()) : new URL(url);\n const pathSegments = urlObj.pathname.split(\"/\").filter(Boolean);\n // If first segment is a locale, remove it\n if (pathSegments.length > 0 && toLocale(pathSegments[0])) {\n urlObj.pathname = \"/\" + pathSegments.slice(1).join(\"/\");\n }\n return urlObj;\n}\n/**\n * Takes matches of implicit wildcards in the UrlPattern (when a part is missing\n * it is equal to '*') and adds them back to the result of fillPattern.\n *\n * At least protocol and hostname are required to create a valid URL inside fillPattern.\n *\n * @param {URL} url\n * @param {any} match\n * @returns {URL}\n */\nfunction fillMissingUrlParts(url, match) {\n if (match.protocol.groups[\"0\"]) {\n url.protocol = match.protocol.groups[\"0\"] ?? \"\";\n }\n if (match.hostname.groups[\"0\"]) {\n url.hostname = match.hostname.groups[\"0\"] ?? \"\";\n }\n if (match.username.groups[\"0\"]) {\n url.username = match.username.groups[\"0\"] ?? \"\";\n }\n if (match.password.groups[\"0\"]) {\n url.password = match.password.groups[\"0\"] ?? \"\";\n }\n if (match.port.groups[\"0\"]) {\n url.port = match.port.groups[\"0\"] ?? \"\";\n }\n if (match.pathname.groups[\"0\"]) {\n url.pathname = match.pathname.groups[\"0\"] ?? \"\";\n }\n if (match.search.groups[\"0\"]) {\n url.search = match.search.groups[\"0\"] ?? \"\";\n }\n if (match.hash.groups[\"0\"]) {\n url.hash = match.hash.groups[\"0\"] ?? \"\";\n }\n return url;\n}\n/**\n * Fills a URL pattern with values for named groups, supporting all URLPattern-style modifiers.\n *\n * This function will eventually be replaced by https://github.com/whatwg/urlpattern/issues/73\n *\n * Matches:\n * - :name -> Simple\n * - :name? -> Optional\n * - :name+ -> One or more\n * - :name* -> Zero or more\n * - :name(...) -> Regex group\n * - {text} -> Group delimiter\n * - {text}? -> Optional group delimiter\n *\n * If the value is `null`, the segment is removed.\n *\n * @param {string} pattern - The URL pattern containing named groups.\n * @param {Record<string, string | null | undefined>} values - Object of values for named groups.\n * @param {string} origin - Base URL to use for URL construction.\n * @returns {URL} - The constructed URL with named groups filled.\n */\nfunction fillPattern(pattern, values, origin) {\n // Pre-process the pattern to handle explicit port numbers\n // This detects patterns like \"http://localhost:5173\" and protects the port number\n // from being interpreted as a parameter\n let processedPattern = pattern.replace(/(https?:\\/\\/[^:/]+):(\\d+)(\\/|$)/g, (_, protocol, port, slash) => {\n // Replace \":5173\" with \"#PORT-5173#\" to protect it from parameter replacement\n return `${protocol}#PORT-${port}#${slash}`;\n });\n // First, handle group delimiters with curly braces\n let processedGroupDelimiters = processedPattern.replace(/\\{([^{}]*)\\}([?+*]?)/g, (_, content, modifier) => {\n // For optional group delimiters\n if (modifier === \"?\") {\n // For optional groups, we'll include the content\n return content;\n }\n // For non-optional group delimiters, always include the content\n return content;\n });\n // Then handle named groups\n let filled = processedGroupDelimiters.replace(/(\\/?):([a-zA-Z0-9_]+)(\\([^)]*\\))?([?+*]?)/g, (_, slash, name, __, modifier) => {\n const value = values[name];\n if (value === null) {\n // If value is null, remove the entire segment including the preceding slash\n return \"\";\n }\n if (modifier === \"?\") {\n // Optional segment\n return value !== undefined ? `${slash}${value}` : \"\";\n }\n if (modifier === \"+\" || modifier === \"*\") {\n // Repeatable segments\n if (value === undefined && modifier === \"+\") {\n throw new Error(`Missing value for \"${name}\" (one or more required)`);\n }\n return value ? `${slash}${value}` : \"\";\n }\n // Simple named group (no modifier)\n if (value === undefined) {\n throw new Error(`Missing value for \"${name}\"`);\n }\n return `${slash}${value}`;\n });\n // Restore port numbers\n filled = filled.replace(/#PORT-(\\d+)#/g, \":$1\");\n return new URL(filled, origin);\n}\n/**\n * Aggregates named groups from various parts of the URLPattern match result.\n *\n *\n * @param {any} match - The URLPattern match result object.\n * @returns {Record<string, string | null | undefined>} An object containing all named groups from the match.\n */\nexport function aggregateGroups(match) {\n return {\n ...match.hash.groups,\n ...match.hostname.groups,\n ...match.password.groups,\n ...match.pathname.groups,\n ...match.port.groups,\n ...match.protocol.groups,\n ...match.search.groups,\n ...match.username.groups,\n };\n}\n\n/**\n * @typedef {object} ShouldRedirectServerInput\n * @property {Request} request\n * @property {string | URL} [effectiveRequestUrl] - Effective request URL to use for route matching, locale detection with the URL strategy, and redirect targets.\n * @property {Locale} [locale]\n *\n * @typedef {object} ShouldRedirectClientInput\n * @property {undefined} [request]\n * @property {string | URL} [url]\n * @property {Locale} [locale]\n *\n * @typedef {ShouldRedirectServerInput | ShouldRedirectClientInput} ShouldRedirectInput\n *\n * @typedef {object} ShouldRedirectResult\n * @property {boolean} shouldRedirect - Indicates whether the consumer should perform a redirect.\n * @property {Locale} locale - Locale resolved using the configured strategies.\n * @property {URL | undefined} redirectUrl - Destination URL when a redirect is required.\n */\n/**\n * Determines whether a redirect is required to align the current URL with the active locale.\n *\n * This helper mirrors the logic that powers `paraglideMiddleware`, but works in both server\n * and client environments. It evaluates the configured strategies in order, computes the\n * canonical localized URL, and reports when the current URL does not match.\n *\n * When called in the browser without arguments, the current `window.location.href` is used.\n *\n * @see https://paraglidejs.com/i18n-routing#redirects\n *\n * @example\n * // Client side usage (e.g. TanStack Router beforeLoad hook)\n * async function beforeLoad({ location }) {\n * const decision = await shouldRedirect({ url: location.href });\n *\n * if (decision.shouldRedirect) {\n * throw redirect({ to: decision.redirectUrl.href });\n * }\n * }\n *\n * @example\n * // Server side usage with a Request\n * export async function handle(request) {\n * const decision = await shouldRedirect({ request });\n *\n * if (decision.shouldRedirect) {\n * return Response.redirect(decision.redirectUrl, 307);\n * }\n *\n * return render(request, decision.locale);\n * }\n *\n * @example\n * // Server side usage behind a proxy where request.url is not public-facing\n * export async function handle(request) {\n * const effectiveRequestUrl = new URL(request.url);\n * effectiveRequestUrl.protocol = \"https:\";\n * effectiveRequestUrl.host = \"example.com\";\n *\n * const decision = await shouldRedirect({\n * request,\n * effectiveRequestUrl,\n * });\n *\n * if (decision.shouldRedirect) {\n * return Response.redirect(decision.redirectUrl, 307);\n * }\n * }\n *\n * @param {ShouldRedirectInput} [input]\n * @returns {Promise<ShouldRedirectResult>}\n */\nexport async function shouldRedirect(input = {}) {\n const currentUrl = resolveUrl(input);\n const locale = await resolveLocale(input, currentUrl);\n const strategy = getStrategyForUrl(currentUrl.href);\n if (isExcludedByRouteStrategy(currentUrl.href) || !strategy.includes(\"url\")) {\n return { shouldRedirect: false, locale, redirectUrl: undefined };\n }\n const localizedUrl = localizeUrl(currentUrl.href, { locale });\n const shouldRedirectToLocalizedUrl = normalizeUrl(localizedUrl.href) !== normalizeUrl(currentUrl.href);\n return {\n shouldRedirect: shouldRedirectToLocalizedUrl,\n locale,\n redirectUrl: shouldRedirectToLocalizedUrl ? localizedUrl : undefined,\n };\n}\n/**\n * Resolves the locale either from the provided input or by using the configured strategies.\n *\n * @param {ShouldRedirectInput} input\n * @param {URL} currentUrl\n * @returns {Promise<Locale>}\n */\nasync function resolveLocale(input, currentUrl) {\n const locale = toLocale(input.locale);\n if (locale) {\n return locale;\n }\n if (input.request) {\n return extractLocaleFromRequestAsync(input.request, {\n effectiveRequestUrl: currentUrl,\n });\n }\n if (\"url\" in input && typeof input.url !== \"undefined\") {\n return getLocaleForUrl(currentUrl.href);\n }\n return getLocale();\n}\n/**\n * Resolves the current URL from the provided input or runtime context.\n *\n * @param {ShouldRedirectInput} input\n * @returns {URL}\n */\nfunction resolveUrl(input) {\n if (\"effectiveRequestUrl\" in input && input.effectiveRequestUrl instanceof URL) {\n return new URL(input.effectiveRequestUrl.href);\n }\n if (\"effectiveRequestUrl\" in input && typeof input.effectiveRequestUrl === \"string\") {\n return new URL(input.effectiveRequestUrl, input.request ? input.request.url : getUrlOrigin());\n }\n if (input.request) {\n return new URL(input.request.url);\n }\n if (\"url\" in input && input.url instanceof URL) {\n return new URL(input.url.href);\n }\n if (\"url\" in input && typeof input.url === \"string\") {\n return new URL(input.url, getUrlOrigin());\n }\n if (typeof window !== \"undefined\" && window?.location?.href) {\n return new URL(window.location.href);\n }\n throw new Error(\"shouldRedirect() requires either a request, an absolute URL, or must run in a browser environment.\");\n}\n/**\n * Normalize url for comparison by stripping the trailing slash.\n *\n * @param {string} url\n * @returns {string}\n */\nfunction normalizeUrl(url) {\n const urlObj = new URL(url);\n urlObj.pathname = urlObj.pathname.replace(/\\/$/, \"\");\n return urlObj.href;\n}\n\n/**\n * High-level URL localization function optimized for client-side UI usage.\n *\n * This is a convenience wrapper around `localizeUrl()` that provides features\n * needed in UI:\n *\n * - Accepts relative paths (e.g., \"/about\")\n * - Returns relative paths when possible\n * - Automatically detects current locale if not specified\n * - Handles string input/output instead of URL objects\n *\n * @see https://paraglidejs.com/i18n-routing\n *\n * @example\n * ```typescript\n * // In a React/Vue/Svelte component\n * const NavLink = ({ href }) => {\n * // Automatically uses current locale, keeps path relative\n * return <a href={localizeHref(href)}>...</a>;\n * };\n *\n * // Examples:\n * localizeHref(\"/about\")\n * // => \"/de/about\" (if current locale is \"de\")\n * localizeHref(\"/store\", { locale: \"fr\" })\n * // => \"/fr/store\" (explicit locale)\n *\n * // Cross-origin links remain absolute\n * localizeHref(\"https://other-site.com/about\")\n * // => \"https://other-site.com/de/about\"\n * ```\n *\n * For server-side URL localization (e.g., in middleware), use `localizeUrl()`\n * which provides more precise control over URL handling.\n *\n * @param {string} href - The href to localize (can be relative or absolute)\n * @param {object} [options] - Options for localization\n * @param {Locale} [options.locale] - Target locale. If not provided, uses `getLocale()`\n * @returns {string} The localized href, relative if input was relative\n */\nexport function localizeHref(href, options) {\n const currentLocale = getLocale();\n const locale = options?.locale ?? currentLocale;\n const url = new URL(href, getUrlOrigin());\n const localized = localizeUrl(url, { locale });\n // if the origin is identical and the href is relative,\n // return the relative path\n if (href.startsWith(\"/\") && url.origin === localized.origin) {\n // check for cross origin localization in which case an absolute URL must be returned.\n if (locale !== currentLocale) {\n const localizedCurrentLocale = localizeUrl(url, {\n locale: currentLocale,\n });\n if (localizedCurrentLocale.origin !== localized.origin) {\n return localized.href;\n }\n }\n return localized.pathname + localized.search + localized.hash;\n }\n return localized.href;\n}\n/**\n * High-level URL de-localization function optimized for client-side UI usage.\n *\n * This is a convenience wrapper around `deLocalizeUrl()` that provides features\n * needed in the UI:\n *\n * - Accepts relative paths (e.g., \"/de/about\")\n * - Returns relative paths when possible\n * - Handles string input/output instead of URL objects\n *\n * @see https://paraglidejs.com/i18n-routing\n *\n * @example\n * ```typescript\n * // In a React/Vue/Svelte component\n * const LocaleSwitcher = ({ href }) => {\n * // Remove locale prefix before switching\n * const baseHref = deLocalizeHref(href);\n * return locales.map(locale =>\n * <a href={localizeHref(baseHref, { locale })}>\n * Switch to {locale}\n * </a>\n * );\n * };\n *\n * // Examples:\n * deLocalizeHref(\"/de/about\") // => \"/about\"\n * deLocalizeHref(\"/fr/store\") // => \"/store\"\n *\n * // Cross-origin links remain absolute\n * deLocalizeHref(\"https://example.com/de/about\")\n * // => \"https://example.com/about\"\n * ```\n *\n * For server-side URL de-localization (e.g., in middleware), use `deLocalizeUrl()`\n * which provides more precise control over URL handling.\n *\n * @param {string} href - The href to de-localize (can be relative or absolute)\n * @returns {string} The de-localized href, relative if input was relative\n */\nexport function deLocalizeHref(href) {\n const url = new URL(href, getUrlOrigin());\n const deLocalized = deLocalizeUrl(url);\n // If the origin is identical and the href is relative,\n // return the relative path instead of the full URL.\n if (href.startsWith(\"/\") && url.origin === deLocalized.origin) {\n return deLocalized.pathname + deLocalized.search + deLocalized.hash;\n }\n return deLocalized.href;\n}\n\n/**\n * @param {string} safeModuleId\n * @param {Locale} locale\n */\nexport function trackMessageCall(safeModuleId, locale) {\n if (isServer === false)\n return;\n const store = serverAsyncLocalStorage?.getStore();\n if (store) {\n store.messageCalls?.add(`${safeModuleId}:${locale}`);\n }\n}\n\n/**\n * Generates localized URL variants for all provided URLs based on your configured locales and URL patterns.\n *\n * This function is essential for Static Site Generation (SSG) where you need to tell your framework\n * which pages to pre-render at build time. It's also useful for generating sitemaps and\n * `<link rel=\"alternate\" hreflang>` tags for SEO.\n *\n * The function respects your `urlPatterns` configuration - if you have translated pathnames\n * (e.g., `/about` → `/ueber-uns` for German), it will generate the correct localized paths.\n *\n * @see https://paraglidejs.com/static-site-generation\n *\n * @example\n * // Basic usage - generate all locale variants for a list of paths\n * const localizedUrls = generateStaticLocalizedUrls([\n * \"/\",\n * \"/about\",\n * \"/blog/post-1\",\n * ]);\n * // Returns URL objects for each locale:\n * // [\"/en/\", \"/de/\", \"/en/about\", \"/de/about\", \"/en/blog/post-1\", \"/de/blog/post-1\"]\n *\n * @example\n * // Use with framework SSG APIs\n * // SvelteKit\n * export function entries() {\n * const paths = [\"/\", \"/about\", \"/contact\"];\n * return generateStaticLocalizedUrls(paths).map(url => ({\n * locale: extractLocaleFromUrl(url)\n * }));\n * }\n *\n * @example\n * // Sitemap generation\n * const allPages = [\"/\", \"/about\", \"/blog\"];\n * const sitemapUrls = generateStaticLocalizedUrls(allPages);\n *\n * @param {(string | URL)[]} urls - List of canonical URLs or paths to generate localized versions for.\n * Can be absolute URLs (`https://example.com/about`) or paths (`/about`).\n * Paths are resolved against `http://localhost` internally.\n * @returns {URL[]} Array of URL objects representing all localized variants.\n * The order follows each input URL with all its locale variants before moving to the next URL.\n */\nexport function generateStaticLocalizedUrls(urls) {\n /** @type {Set<URL>} */\n const localizedUrls = new Set();\n // For default URL pattern, we can optimize the generation\n if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {\n for (const urlInput of urls) {\n const url = urlInput instanceof URL\n ? urlInput\n : new URL(urlInput, \"http://localhost\");\n // Base locale doesn't get a prefix\n localizedUrls.add(url);\n // Other locales get their code as prefix\n for (const locale of locales) {\n if (locale !== baseLocale) {\n const localizedPath = `/${locale}${url.pathname}${url.search}${url.hash}`;\n const localizedUrl = new URL(localizedPath, url.origin);\n localizedUrls.add(localizedUrl);\n }\n }\n }\n return Array.from(localizedUrls);\n }\n // For custom URL patterns, we need to use localizeUrl for each URL and locale\n for (const urlInput of urls) {\n const url = urlInput instanceof URL\n ? urlInput\n : new URL(urlInput, \"http://localhost\");\n // Try each URL pattern to find one that matches\n let patternFound = false;\n for (const pattern of urlPatterns) {\n try {\n // Try to match the unlocalized pattern\n const unlocalizedMatch = new URLPattern(pattern.pattern, url.href).exec(url.href);\n if (!unlocalizedMatch)\n continue;\n patternFound = true;\n // Track unique localized URLs to avoid duplicates when patterns are the same\n const seenUrls = new Set();\n // Generate localized URL for each locale\n for (const [locale] of pattern.localized) {\n try {\n const localizedUrl = localizeUrl(url, { locale });\n const urlString = localizedUrl.href;\n // Only add if we haven't seen this exact URL before\n if (!seenUrls.has(urlString)) {\n seenUrls.add(urlString);\n localizedUrls.add(localizedUrl);\n }\n }\n catch {\n // Skip if localization fails for this locale\n continue;\n }\n }\n break;\n }\n catch {\n // Skip if pattern matching fails\n continue;\n }\n }\n // If no pattern matched, use the URL as is\n if (!patternFound) {\n localizedUrls.add(url);\n }\n }\n return Array.from(localizedUrls);\n}\n\n/**\n * @typedef {\"cookie\" | \"baseLocale\" | \"globalVariable\" | \"url\" | \"preferredLanguage\" | \"localStorage\"} BuiltInStrategy\n */\n/**\n * @typedef {`custom_${string}`} CustomStrategy\n */\n/**\n * @typedef {BuiltInStrategy | CustomStrategy} Strategy\n */\n/**\n * @typedef {Array<Strategy>} Strategies\n */\n/**\n * @typedef {{ getLocale: (request?: Request) => Promise<string | undefined> | (string | undefined) }} CustomServerStrategyHandler\n */\n/**\n * @typedef {{ getLocale: () => Promise<string|undefined> | (string | undefined), setLocale: (locale: string) => Promise<void> | void }} CustomClientStrategyHandler\n */\n/** @type {Map<string, CustomServerStrategyHandler>} */\nexport const customServerStrategies = new Map();\n/** @type {Map<string, CustomClientStrategyHandler>} */\nexport const customClientStrategies = new Map();\n/**\n * Checks if the given strategy is a custom strategy.\n *\n * @param {unknown} strategy The name of the custom strategy to validate.\n * Must be a string that starts with \"custom-\" followed by alphanumeric characters, hyphens, or underscores.\n * @returns {boolean} Returns true if it is a custom strategy, false otherwise.\n */\nexport function isCustomStrategy(strategy) {\n return (typeof strategy === \"string\" && /^custom-[A-Za-z0-9_-]+$/.test(strategy));\n}\n/**\n * Defines a custom strategy that is executed on the server.\n *\n * @see https://paraglidejs.com/strategy#write-your-own-strategy\n *\n * @param {string} strategy The name of the custom strategy to define. Must follow the pattern custom-name with alphanumeric characters, hyphens, or underscores.\n * @param {CustomServerStrategyHandler} handler The handler for the custom strategy, which should implement\n * the method getLocale.\n * @returns {void}\n */\nexport function defineCustomServerStrategy(strategy, handler) {\n if (!isCustomStrategy(strategy)) {\n throw new Error(`Invalid custom strategy: \"${strategy}\". Must be a custom strategy following the pattern custom-name.`);\n }\n customServerStrategies.set(strategy, handler);\n}\n/**\n * Defines a custom strategy that is executed on the client.\n *\n * @see https://paraglidejs.com/strategy#write-your-own-strategy\n *\n * @param {string} strategy The name of the custom strategy to define. Must follow the pattern custom-name with alphanumeric characters, hyphens, or underscores.\n * @param {CustomClientStrategyHandler} handler The handler for the custom strategy, which should implement the\n * methods getLocale and setLocale.\n * @returns {void}\n */\nexport function defineCustomClientStrategy(strategy, handler) {\n if (!isCustomStrategy(strategy)) {\n throw new Error(`Invalid custom strategy: \"${strategy}\". Must be a custom strategy following the pattern custom-name.`);\n }\n customClientStrategies.set(strategy, handler);\n}\n\n// ------ TYPES ------\nexport {};\n/**\n * A locale that is available in the project.\n *\n * @example\n * setLocale(request.locale as Locale)\n *\n * @typedef {typeof locales[number]} Locale\n */\n/**\n * A branded type representing a localized string.\n *\n * Message functions return this type instead of \\`string\\`, enabling TypeScript\n * to distinguish translated strings from regular strings at compile time.\n * This allows you to enforce that only properly localized content is used\n * in your UI components.\n *\n * Since \\`LocalizedString\\` is a branded subtype of \\`string\\`, it remains fully\n * backward compatible—you can pass it anywhere a \\`string\\` is expected.\n *\n * @example\n * // Enforce localized strings in your components\n * function PageTitle(props: { title: LocalizedString }) {\n * return <h1>{props.title}</h1>\n * }\n *\n * // ✅ Correct: using a message function\n * <PageTitle title={m.welcome_title()} />\n *\n * // ❌ Type error: raw strings are not LocalizedString\n * <PageTitle title=\"Welcome\" />\n *\n * @example\n * // LocalizedString is assignable to string (backward compatible)\n * const localized: LocalizedString = m.greeting()\n * const str: string = localized // ✅ works fine\n *\n * // But string is not assignable to LocalizedString\n * const raw: LocalizedString = \"Hello\" // ❌ Type error\n *\n * @example\n * // Catches accidental string concatenation\n * function showMessage(msg: LocalizedString) { ... }\n *\n * showMessage(m.hello()) // ✅\n * showMessage(\"Hello \" + userName) // ❌ Type error\n * showMessage(m.hello_user({ name: userName })) // ✅ use params instead\n *\n * @typedef {string & { readonly __brand: 'LocalizedString' }} LocalizedString\n */\n/**\n * A single markup option passed to a tag instance.\n *\n * @typedef {{\n * name: string;\n * value: unknown;\n * }} MessageMarkupOption\n */\n/**\n * A single static markup attribute attached to a tag instance.\n *\n * @typedef {{\n * name: string;\n * value: string | true;\n * }} MessageMarkupAttribute\n */\n/**\n * Record of markup options for a tag instance.\n *\n * @typedef {Record<string, unknown>} MessageMarkupOptions\n */\n/**\n * Record of markup attributes for a tag instance.\n *\n * @typedef {Record<string, string | true>} MessageMarkupAttributes\n */\n/**\n * Type-level schema for a single markup tag.\n *\n * @typedef {{\n * options: MessageMarkupOptions;\n * attributes: MessageMarkupAttributes;\n * children: boolean;\n * }} MessageMarkupTag\n */\n/**\n * Type-level schema for all markup tags in a message.\n *\n * @typedef {Record<string, MessageMarkupTag>} MessageMarkupSchema\n */\n/**\n * Type-only metadata attached to compiled message functions.\n *\n * @template Inputs\n * @template Options\n * @template {MessageMarkupSchema} [Markup = MessageMarkupSchema]\n * @typedef {{\n * readonly __paraglide?: {\n * inputs: Inputs;\n * options: Options;\n * markup: Markup;\n * };\n * }} MessageMetadata\n */\n/**\n * A compiled, framework-neutral message part.\n *\n * @typedef {{\n * type: \"text\";\n * value: string;\n * } | {\n * type: \"markup-start\";\n * name: string;\n * options: MessageMarkupOptions;\n * attributes: MessageMarkupAttributes;\n * } | {\n * type: \"markup-end\";\n * name: string;\n * options: MessageMarkupOptions;\n * attributes: MessageMarkupAttributes;\n * } | {\n * type: \"markup-standalone\";\n * name: string;\n * options: MessageMarkupOptions;\n * attributes: MessageMarkupAttributes;\n * }} MessagePart\n */\n/**\n * A message function is a message for a specific locale.\n *\n * @example\n * m.hello({ name: 'world' })\n *\n * @typedef {(inputs?: Record<string, never>) => LocalizedString} MessageFunction\n */\n/**\n * A message bundle function that selects the message to be returned.\n *\n * Uses `getLocale()` under the hood to determine the locale with an option.\n *\n * @template {string} T\n *\n * @example\n * * m.hello({ name: 'world' }, { locale: \"en\" })\n *\n * @typedef {(params: Record<string, never>, options: { locale: T }) => LocalizedString} MessageBundleFunction\n */\n"],"mappings":";AAGA,IAAM,IAAa,CAAC,GAUP,IAAa,SASb,IAAgC,CAAC,SAAQ,IAAI,GAE7C,IAAa,oBAUb,IAAW,CACtB,kBACA,YACF,GAYa,IAAkB,CAAC,GAsB5B,GAEA;AAKJ,SAAS,EAA0B,GAAK;CACpC,IAAI,EAAgB,WAAW,GAC3B;CAEJ,IAAM,IAAY,OAAO,KAAQ,WAAW,IAAM,EAAI;CACtD,IAAI,MAA2B,GAC3B,OAAO;CAEX,IAAM,IAAY,IAAI,IAAI,GAAW,kBAAkB,GACnD;CACJ,KAAK,IAAM,KAAiB,GAExB,IAAI,IADgB,EAAW,EAAc,OAAO,EAAU,IACpD,CAAC,CAAC,KAAK,EAAU,IAAI,GAAG;EAC9B,IAAQ;EACR;CACJ;CAIJ,OAFA,IAAyB,GACzB,IAAsB,GACf;AACX;AAUA,SAAgB,EAAkB,GAAK;CACnC,IAAM,IAAgB,EAA0B,CAAG;CAMnD,OALI,KACA,EAAc,YAAY,MAC1B,MAAM,QAAQ,EAAc,QAAQ,IAC7B,EAAc,WAElB;AACX;AA6BA,IAAW,IAA0B,KAAA;AA0BlB,WAAa,cACX,WAAY,eAAe,CAAC,GAC9B,WAAa,YAAY,MACvB,WAAY,YAAY,OAAO,CAAC;AAWrD,IAAI,GACA,IAAqB,IAmBd,UAAkB;CAYzB,IAAI,IAAgB;CACpB,AAAiB,OAAO,SAAW,OAAe,OAAO,UAAU,SAC/D,IAAgB,EAAkB,OAAO,SAAS,IAAI;CAE1D,IAAM,IAAW,EAA4B,GAAe,OAAO,SAAW,MAAc,OAAO,UAAU,OAAO,KAAA,CAAS;CAC7H,IAAI,GAOA,OANK,MACD,IAAU,GAEV,IAAqB,IACrB,EAAU,GAAU,EAAE,QA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EAE3C;CACJ;CAEJ,IAAM,UAAkB;EACpB,AACI,EAAoB,UACpB,OAAO,YACP,MAAc,KACd,EAAiB,MAAW;CAEpC;CACA,IAAI,EAAwB,QACxB,OAAO,QAAQ,IAAI,CAAuB,CAAC,CAAC,WAAW;EACnD,EAAU;CACd,CAAC;CAEL,EAAU;AAEd;AAuDA,SAAgB,EAAS,GAAO;CAC5B,IAAI,OAAO,KAAU,UACjB;CAEJ,IAAM,IAAa,EAAM,YAAY;CACrC,KAAK,IAAM,KAAU,GACjB,IAAI,EAAO,YAAY,MAAM,GACzB,OAAO;AAInB;AA0BA,SAAgB,EAAe,GAAO;CAClC,IAAM,IAAS,EAAS,CAAK;CAC7B,IAAI,GACA,OAAO;CACX,MAAU,MAAM,mBAAmB,EAAM,qBAAqB,EAAQ,KAAK,IAAI,GAAG;AACtF;AA8JA,IAAM,IAAoB,EAAW,QAAQ,uBAAuB,MAAM;AAC1C,OAAO,cAAc,EAAkB,SAAS;AA83BhF,IAAa,oBAAyB,IAAI,IAAI;AAQ9C,SAAgB,EAAiB,GAAU;CACvC,OAAQ,OAAO,KAAa,YAAY,0BAA0B,KAAK,CAAQ;AACnF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@manafishrov/ui",
4
- "version": "1.5.8",
4
+ "version": "1.5.10",
5
5
  "description": "Styled component library for Manafish interfaces ",
6
6
  "license": "AGPL-3.0-or-later",
7
7
  "repository": {
@@ -249,9 +249,9 @@
249
249
  "devDependencies": {
250
250
  "@semantic-release/commit-analyzer": "13.0.1",
251
251
  "@semantic-release/exec": "7.1.0",
252
- "@semantic-release/github": "12.0.8",
252
+ "@semantic-release/github": "12.0.9",
253
253
  "@semantic-release/release-notes-generator": "14.1.1",
254
- "semantic-release": "25.0.5",
254
+ "semantic-release": "25.0.8",
255
255
  "tw-animate-css": "1.4.0",
256
256
  "unplugin-dts": "1.0.3"
257
257
  },
@@ -8,8 +8,8 @@ export type AutoSubmitProps = {
8
8
 
9
9
  export const AutoSubmit: Component<AutoSubmitProps> = (props) => {
10
10
  const form = useFormContext();
11
- const values = form.useStore((state) => state.values);
12
- const isDirty = form.useStore((state) => state.isDirty);
11
+ const values = form.useSelector((state) => state.values);
12
+ const isDirty = form.useSelector((state) => state.isDirty);
13
13
 
14
14
  createEffect(() => {
15
15
  values();
@@ -1,14 +1,22 @@
1
1
  import { MS_PER_SECOND, SIDEBAR_COOKIE_MAX_AGE, SIDEBAR_COOKIE_NAME } from './constants';
2
2
 
3
3
  export const setSidebarCookie = (openValue: boolean): void => {
4
- globalThis.cookieStore
5
- .set({
6
- name: SIDEBAR_COOKIE_NAME,
7
- value: String(openValue),
8
- expires: Date.now() + SIDEBAR_COOKIE_MAX_AGE * MS_PER_SECOND,
9
- path: '/',
10
- })
11
- .catch(() => {
12
- // Silently ignore
13
- });
4
+ try {
5
+ if (!('cookieStore' in globalThis)) {
6
+ return;
7
+ }
8
+ const { cookieStore } = globalThis;
9
+ cookieStore
10
+ .set({
11
+ name: SIDEBAR_COOKIE_NAME,
12
+ value: String(openValue),
13
+ expires: Date.now() + SIDEBAR_COOKIE_MAX_AGE * MS_PER_SECOND,
14
+ path: '/',
15
+ })
16
+ .catch(() => {
17
+ // Cookie persistence is optional; sidebar state still updates.
18
+ });
19
+ } catch {
20
+ // Accessing Cookie Store or calling set can also throw synchronously.
21
+ }
14
22
  };
@@ -1,7 +0,0 @@
1
- import { splitProps as e } from "solid-js";
2
- //#region ../../node_modules/.bun/@ark-ui+solid@5.37.1+da624007e3df32b4/node_modules/@ark-ui/solid/dist/chunk/6WEDGJKQ.jsx
3
- var t = () => (t, n) => e(t, n);
4
- //#endregion
5
- export { t as createSplitProps };
6
-
7
- //# sourceMappingURL=6WEDGJKQ.js.map
@@ -1,11 +0,0 @@
1
- //#region ../../node_modules/.bun/@ark-ui+solid@5.37.1+da624007e3df32b4/node_modules/@ark-ui/solid/dist/chunk/7IUG3E2V.jsx
2
- var e = Object.defineProperty, t = (t, n) => {
3
- for (var r in n) e(t, r, {
4
- get: n[r],
5
- enumerable: !0
6
- });
7
- };
8
- //#endregion
9
- export { t as __export };
10
-
11
- //# sourceMappingURL=7IUG3E2V.js.map
@@ -1,6 +0,0 @@
1
- //#region ../../node_modules/.bun/@ark-ui+solid@5.37.1+da624007e3df32b4/node_modules/@ark-ui/solid/dist/chunk/KGOB2IMX.jsx
2
- var e = (e) => typeof e == "function", t = (t, ...n) => e(t) ? t(...n) : t;
3
- //#endregion
4
- export { t as runIfFn };
5
-
6
- //# sourceMappingURL=KGOB2IMX.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"floating-ui.core.js","names":[],"sources":["../../../../../../../../../../node_modules/.bun/@floating-ui+core@1.7.5/node_modules/@floating-ui/core/dist/floating-ui.core.mjs"],"sourcesContent":["import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n// Maximum number of resets that can occur before bailing to avoid infinite reset loops.\nconst MAX_RESET_COUNT = 50;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const platformWithDetectOverflow = platform.detectOverflow ? platform : {\n ...platform,\n detectOverflow\n };\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let resetCount = 0;\n const middlewareData = {};\n for (let i = 0; i < middleware.length; i++) {\n const currentMiddleware = middleware[i];\n if (!currentMiddleware) {\n continue;\n }\n const {\n name,\n fn\n } = currentMiddleware;\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: platformWithDetectOverflow,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData[name] = {\n ...middlewareData[name],\n ...data\n };\n if (reset && resetCount < MAX_RESET_COUNT) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects,\n platform\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n platform\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n"],"x_google_ignoreList":[0],"mappings":";;AAGA,SAAS,EAA2B,GAAM,GAAW,GAAK;CACxD,IAAI,EACF,cACA,gBACE,GACE,IAAW,EAAY,CAAS,GAChC,IAAgB,EAAiB,CAAS,GAC1C,IAAc,EAAc,CAAa,GACzC,IAAO,EAAQ,CAAS,GACxB,IAAa,MAAa,KAC1B,IAAU,EAAU,IAAI,EAAU,QAAQ,IAAI,EAAS,QAAQ,GAC/D,IAAU,EAAU,IAAI,EAAU,SAAS,IAAI,EAAS,SAAS,GACjE,IAAc,EAAU,KAAe,IAAI,EAAS,KAAe,GACrE;CACJ,QAAQ,GAAR;EACE,KAAK;GACH,IAAS;IACP,GAAG;IACH,GAAG,EAAU,IAAI,EAAS;GAC5B;GACA;EACF,KAAK;GACH,IAAS;IACP,GAAG;IACH,GAAG,EAAU,IAAI,EAAU;GAC7B;GACA;EACF,KAAK;GACH,IAAS;IACP,GAAG,EAAU,IAAI,EAAU;IAC3B,GAAG;GACL;GACA;EACF,KAAK;GACH,IAAS;IACP,GAAG,EAAU,IAAI,EAAS;IAC1B,GAAG;GACL;GACA;EACF,SACE,IAAS;GACP,GAAG,EAAU;GACb,GAAG,EAAU;EACf;CACJ;CACA,QAAQ,EAAa,CAAS,GAA9B;EACE,KAAK;GACH,EAAO,MAAkB,KAAe,KAAO,IAAa,KAAK;G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