@monetize.software/sdk-extension 3.0.0-alpha.6 → 3.0.0-alpha.8

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 (195) hide show
  1. package/README.md +18 -20
  2. package/dist/chunks/ar-BUQInJ5a.js +2 -0
  3. package/dist/chunks/ar-BUQInJ5a.js.map +1 -0
  4. package/dist/chunks/{ar-BCHXVoE2.js → ar-nh4l4WDE.js} +16 -5
  5. package/dist/chunks/ar-nh4l4WDE.js.map +1 -0
  6. package/dist/chunks/{cs-B5NqpTW_.js → cs-2UYO2rWf.js} +14 -3
  7. package/dist/chunks/cs-2UYO2rWf.js.map +1 -0
  8. package/dist/chunks/cs-i5K4KTFV.js +2 -0
  9. package/dist/chunks/cs-i5K4KTFV.js.map +1 -0
  10. package/dist/chunks/{da-BJrGZ3LD.js → da-BD0O_HfV.js} +14 -3
  11. package/dist/chunks/da-BD0O_HfV.js.map +1 -0
  12. package/dist/chunks/da-CZbhtVJO.js +2 -0
  13. package/dist/chunks/da-CZbhtVJO.js.map +1 -0
  14. package/dist/chunks/de-Bc-GoLgC.js +2 -0
  15. package/dist/chunks/de-Bc-GoLgC.js.map +1 -0
  16. package/dist/chunks/{de-aepBKwsb.js → de-BkCiXPsn.js} +12 -3
  17. package/dist/chunks/de-BkCiXPsn.js.map +1 -0
  18. package/dist/chunks/el-CcMEbl_F.js +2 -0
  19. package/dist/chunks/el-CcMEbl_F.js.map +1 -0
  20. package/dist/chunks/{el-DTLQoX2D.js → el-cIcxTp07.js} +14 -3
  21. package/dist/chunks/el-cIcxTp07.js.map +1 -0
  22. package/dist/chunks/es-BvYmomAz.js +2 -0
  23. package/dist/chunks/es-BvYmomAz.js.map +1 -0
  24. package/dist/chunks/{es-CLutF-D_.js → es-CJBC_jrV.js} +12 -3
  25. package/dist/chunks/es-CJBC_jrV.js.map +1 -0
  26. package/dist/chunks/{fi-DZ4csxqk.js → fi-DyV7ynBf.js} +14 -3
  27. package/dist/chunks/fi-DyV7ynBf.js.map +1 -0
  28. package/dist/chunks/fi-aZR-qmZN.js +2 -0
  29. package/dist/chunks/fi-aZR-qmZN.js.map +1 -0
  30. package/dist/chunks/{fr-jJU1SSpj.js → fr-BLQ4AIu7.js} +12 -3
  31. package/dist/chunks/fr-BLQ4AIu7.js.map +1 -0
  32. package/dist/chunks/fr-BgbFAgHx.js +2 -0
  33. package/dist/chunks/fr-BgbFAgHx.js.map +1 -0
  34. package/dist/chunks/{he-D9obGPNj.js → he-Bg-Bqi7r.js} +16 -5
  35. package/dist/chunks/he-Bg-Bqi7r.js.map +1 -0
  36. package/dist/chunks/he-CQ4yCuja.js +2 -0
  37. package/dist/chunks/he-CQ4yCuja.js.map +1 -0
  38. package/dist/chunks/hi-DtUsj1c-.js +2 -0
  39. package/dist/chunks/hi-DtUsj1c-.js.map +1 -0
  40. package/dist/chunks/{hi-pM8SQwZ3.js → hi-wQeE43oY.js} +16 -5
  41. package/dist/chunks/hi-wQeE43oY.js.map +1 -0
  42. package/dist/chunks/{hu-E0m9WgbD.js → hu-D9qxzu0r.js} +14 -3
  43. package/dist/chunks/hu-D9qxzu0r.js.map +1 -0
  44. package/dist/chunks/hu-DXtscQ8_.js +2 -0
  45. package/dist/chunks/hu-DXtscQ8_.js.map +1 -0
  46. package/dist/chunks/id-BByOYpeo.js +2 -0
  47. package/dist/chunks/id-BByOYpeo.js.map +1 -0
  48. package/dist/chunks/{id-C6poPvby.js → id-Rx_wYvqy.js} +14 -3
  49. package/dist/chunks/id-Rx_wYvqy.js.map +1 -0
  50. package/dist/chunks/it-52Ip42pa.js +2 -0
  51. package/dist/chunks/it-52Ip42pa.js.map +1 -0
  52. package/dist/chunks/{it-B2RSFyVd.js → it-B1SRPZ3e.js} +12 -3
  53. package/dist/chunks/it-B1SRPZ3e.js.map +1 -0
  54. package/dist/chunks/ja-CMC3Parn.js +2 -0
  55. package/dist/chunks/ja-CMC3Parn.js.map +1 -0
  56. package/dist/chunks/{ja-CM-VgVG6.js → ja-DiItm8te.js} +12 -3
  57. package/dist/chunks/ja-DiItm8te.js.map +1 -0
  58. package/dist/chunks/ko-3qY21q40.js +2 -0
  59. package/dist/chunks/ko-3qY21q40.js.map +1 -0
  60. package/dist/chunks/{ko-C451fA21.js → ko-CdGFWAKX.js} +12 -3
  61. package/dist/chunks/ko-CdGFWAKX.js.map +1 -0
  62. package/dist/chunks/nl-Borc5nw1.js +2 -0
  63. package/dist/chunks/nl-Borc5nw1.js.map +1 -0
  64. package/dist/chunks/{nl-DzQfJPo2.js → nl-CmZ3vEvj.js} +12 -3
  65. package/dist/chunks/nl-CmZ3vEvj.js.map +1 -0
  66. package/dist/chunks/{no-B51be8KT.js → no-BuxByZpq.js} +14 -3
  67. package/dist/chunks/no-BuxByZpq.js.map +1 -0
  68. package/dist/chunks/no-Do2iGedg.js +2 -0
  69. package/dist/chunks/no-Do2iGedg.js.map +1 -0
  70. package/dist/chunks/{pl-5rTEkvfY.js → pl-jZFCnDb8.js} +14 -3
  71. package/dist/chunks/pl-jZFCnDb8.js.map +1 -0
  72. package/dist/chunks/pl-mRaky_7k.js +2 -0
  73. package/dist/chunks/pl-mRaky_7k.js.map +1 -0
  74. package/dist/chunks/{pt-JwqffZ9u.js → pt-Cld7MwIW.js} +12 -3
  75. package/dist/chunks/pt-Cld7MwIW.js.map +1 -0
  76. package/dist/chunks/pt-DilDTXfs.js +2 -0
  77. package/dist/chunks/pt-DilDTXfs.js.map +1 -0
  78. package/dist/chunks/{ro-BE_wJ1td.js → ro-CuKDqj3C.js} +14 -3
  79. package/dist/chunks/ro-CuKDqj3C.js.map +1 -0
  80. package/dist/chunks/ro-DF2uzPIB.js +2 -0
  81. package/dist/chunks/ro-DF2uzPIB.js.map +1 -0
  82. package/dist/chunks/{ru-BviATvLb.js → ru-B7cjqJUm.js} +14 -3
  83. package/dist/chunks/ru-B7cjqJUm.js.map +1 -0
  84. package/dist/chunks/ru-YeaXnTO-.js +2 -0
  85. package/dist/chunks/ru-YeaXnTO-.js.map +1 -0
  86. package/dist/chunks/sv-2pHEvuSe.js +2 -0
  87. package/dist/chunks/sv-2pHEvuSe.js.map +1 -0
  88. package/dist/chunks/{sv-DabGF9WL.js → sv-D9y-M1Fo.js} +14 -3
  89. package/dist/chunks/sv-D9y-M1Fo.js.map +1 -0
  90. package/dist/chunks/{th-BiF-bNo0.js → th-D9umBjEy.js} +14 -3
  91. package/dist/chunks/th-D9umBjEy.js.map +1 -0
  92. package/dist/chunks/th-u2QSDF0G.js +2 -0
  93. package/dist/chunks/th-u2QSDF0G.js.map +1 -0
  94. package/dist/chunks/{tr-xZuly8X8.js → tr-BddMywiw.js} +14 -3
  95. package/dist/chunks/tr-BddMywiw.js.map +1 -0
  96. package/dist/chunks/tr-Bhgm6_ti.js +2 -0
  97. package/dist/chunks/tr-Bhgm6_ti.js.map +1 -0
  98. package/dist/chunks/uk-7vwqsaVK.js +2 -0
  99. package/dist/chunks/uk-7vwqsaVK.js.map +1 -0
  100. package/dist/chunks/{uk-KlkAaHuy.js → uk-Dbd31hFt.js} +14 -3
  101. package/dist/chunks/uk-Dbd31hFt.js.map +1 -0
  102. package/dist/chunks/vi-CJefLP_g.js +2 -0
  103. package/dist/chunks/vi-CJefLP_g.js.map +1 -0
  104. package/dist/chunks/{vi-BVCeumNE.js → vi-Do3BMOdh.js} +14 -3
  105. package/dist/chunks/vi-Do3BMOdh.js.map +1 -0
  106. package/dist/chunks/zh-D5C3BzYL.js +2 -0
  107. package/dist/chunks/zh-D5C3BzYL.js.map +1 -0
  108. package/dist/chunks/{zh-C_ghwmqi.js → zh-gQSYLZI3.js} +12 -3
  109. package/dist/chunks/zh-gQSYLZI3.js.map +1 -0
  110. package/dist/content.cjs +3 -3
  111. package/dist/content.cjs.map +1 -1
  112. package/dist/content.js +1147 -1098
  113. package/dist/content.js.map +1 -1
  114. package/package.json +3 -3
  115. package/dist/chunks/ar-BCHXVoE2.js.map +0 -1
  116. package/dist/chunks/ar-CsJNZJSr.js +0 -2
  117. package/dist/chunks/ar-CsJNZJSr.js.map +0 -1
  118. package/dist/chunks/cs-B5NqpTW_.js.map +0 -1
  119. package/dist/chunks/cs-BydWUC0e.js +0 -2
  120. package/dist/chunks/cs-BydWUC0e.js.map +0 -1
  121. package/dist/chunks/da-BJrGZ3LD.js.map +0 -1
  122. package/dist/chunks/da-DNhiAQnh.js +0 -2
  123. package/dist/chunks/da-DNhiAQnh.js.map +0 -1
  124. package/dist/chunks/de-H8ztFOie.js +0 -2
  125. package/dist/chunks/de-H8ztFOie.js.map +0 -1
  126. package/dist/chunks/de-aepBKwsb.js.map +0 -1
  127. package/dist/chunks/el-DRfoadtI.js +0 -2
  128. package/dist/chunks/el-DRfoadtI.js.map +0 -1
  129. package/dist/chunks/el-DTLQoX2D.js.map +0 -1
  130. package/dist/chunks/es-CLutF-D_.js.map +0 -1
  131. package/dist/chunks/es-GlaYesNR.js +0 -2
  132. package/dist/chunks/es-GlaYesNR.js.map +0 -1
  133. package/dist/chunks/fi-BIHFyScH.js +0 -2
  134. package/dist/chunks/fi-BIHFyScH.js.map +0 -1
  135. package/dist/chunks/fi-DZ4csxqk.js.map +0 -1
  136. package/dist/chunks/fr-BtZILUNZ.js +0 -2
  137. package/dist/chunks/fr-BtZILUNZ.js.map +0 -1
  138. package/dist/chunks/fr-jJU1SSpj.js.map +0 -1
  139. package/dist/chunks/he-D9obGPNj.js.map +0 -1
  140. package/dist/chunks/he-vSDRE4Nn.js +0 -2
  141. package/dist/chunks/he-vSDRE4Nn.js.map +0 -1
  142. package/dist/chunks/hi-B90FsnP6.js +0 -2
  143. package/dist/chunks/hi-B90FsnP6.js.map +0 -1
  144. package/dist/chunks/hi-pM8SQwZ3.js.map +0 -1
  145. package/dist/chunks/hu-DWVFODsS.js +0 -2
  146. package/dist/chunks/hu-DWVFODsS.js.map +0 -1
  147. package/dist/chunks/hu-E0m9WgbD.js.map +0 -1
  148. package/dist/chunks/id-C6poPvby.js.map +0 -1
  149. package/dist/chunks/id-Ce2gzMVT.js +0 -2
  150. package/dist/chunks/id-Ce2gzMVT.js.map +0 -1
  151. package/dist/chunks/it-B2RSFyVd.js.map +0 -1
  152. package/dist/chunks/it-u-Gu44bl.js +0 -2
  153. package/dist/chunks/it-u-Gu44bl.js.map +0 -1
  154. package/dist/chunks/ja-CM-VgVG6.js.map +0 -1
  155. package/dist/chunks/ja-CQy8RaRa.js +0 -2
  156. package/dist/chunks/ja-CQy8RaRa.js.map +0 -1
  157. package/dist/chunks/ko-BRnb7vJ7.js +0 -2
  158. package/dist/chunks/ko-BRnb7vJ7.js.map +0 -1
  159. package/dist/chunks/ko-C451fA21.js.map +0 -1
  160. package/dist/chunks/nl-CJelco6J.js +0 -2
  161. package/dist/chunks/nl-CJelco6J.js.map +0 -1
  162. package/dist/chunks/nl-DzQfJPo2.js.map +0 -1
  163. package/dist/chunks/no-B51be8KT.js.map +0 -1
  164. package/dist/chunks/no-BwTjSZ4K.js +0 -2
  165. package/dist/chunks/no-BwTjSZ4K.js.map +0 -1
  166. package/dist/chunks/pl-5rTEkvfY.js.map +0 -1
  167. package/dist/chunks/pl-kO82vcjb.js +0 -2
  168. package/dist/chunks/pl-kO82vcjb.js.map +0 -1
  169. package/dist/chunks/pt-CsJzaSjg.js +0 -2
  170. package/dist/chunks/pt-CsJzaSjg.js.map +0 -1
  171. package/dist/chunks/pt-JwqffZ9u.js.map +0 -1
  172. package/dist/chunks/ro-BE_wJ1td.js.map +0 -1
  173. package/dist/chunks/ro-ue15Ina4.js +0 -2
  174. package/dist/chunks/ro-ue15Ina4.js.map +0 -1
  175. package/dist/chunks/ru-B1iMOhX0.js +0 -2
  176. package/dist/chunks/ru-B1iMOhX0.js.map +0 -1
  177. package/dist/chunks/ru-BviATvLb.js.map +0 -1
  178. package/dist/chunks/sv-CkNYpUVy.js +0 -2
  179. package/dist/chunks/sv-CkNYpUVy.js.map +0 -1
  180. package/dist/chunks/sv-DabGF9WL.js.map +0 -1
  181. package/dist/chunks/th-BiF-bNo0.js.map +0 -1
  182. package/dist/chunks/th-Cu80HK4y.js +0 -2
  183. package/dist/chunks/th-Cu80HK4y.js.map +0 -1
  184. package/dist/chunks/tr-B7c0afXV.js +0 -2
  185. package/dist/chunks/tr-B7c0afXV.js.map +0 -1
  186. package/dist/chunks/tr-xZuly8X8.js.map +0 -1
  187. package/dist/chunks/uk-BO106B0H.js +0 -2
  188. package/dist/chunks/uk-BO106B0H.js.map +0 -1
  189. package/dist/chunks/uk-KlkAaHuy.js.map +0 -1
  190. package/dist/chunks/vi-BVCeumNE.js.map +0 -1
  191. package/dist/chunks/vi-CZ6ow40D.js +0 -2
  192. package/dist/chunks/vi-CZ6ow40D.js.map +0 -1
  193. package/dist/chunks/zh-BhP80WI1.js +0 -2
  194. package/dist/chunks/zh-BhP80WI1.js.map +0 -1
  195. package/dist/chunks/zh-C_ghwmqi.js.map +0 -1
package/dist/content.js CHANGED
@@ -1,40 +1,40 @@
1
- import { P as U, B as Ue, E as je, c as Re, A as ue, w as ze, a as Y, r as De, b as qe } from "./chunks/chrome-port-CxW3Pwc2.js";
2
- import { render as K, h as de, createContext as Ne } from "preact";
3
- import { jsx as o, jsxs as c, Fragment as W } from "preact/jsx-runtime";
4
- import { useState as x, useEffect as B, useContext as Fe, useRef as R, useMemo as ve, useLayoutEffect as Ve } from "preact/hooks";
5
- import { P as $e } from "./chunks/port-name-BPfQKtdb.js";
6
- const _e = '@layer theme,base,components,utilities;@layer theme{@theme default{ --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; --color-red-50: oklch(97.1% .013 17.38); --color-red-100: oklch(93.6% .032 17.717); --color-red-200: oklch(88.5% .062 18.334); --color-red-300: oklch(80.8% .114 19.571); --color-red-400: oklch(70.4% .191 22.216); --color-red-500: oklch(63.7% .237 25.331); --color-red-600: oklch(57.7% .245 27.325); --color-red-700: oklch(50.5% .213 27.518); --color-red-800: oklch(44.4% .177 26.899); --color-red-900: oklch(39.6% .141 25.723); --color-red-950: oklch(25.8% .092 26.042); --color-orange-50: oklch(98% .016 73.684); --color-orange-100: oklch(95.4% .038 75.164); --color-orange-200: oklch(90.1% .076 70.697); --color-orange-300: oklch(83.7% .128 66.29); --color-orange-400: oklch(75% .183 55.934); --color-orange-500: oklch(70.5% .213 47.604); --color-orange-600: oklch(64.6% .222 41.116); --color-orange-700: oklch(55.3% .195 38.402); --color-orange-800: oklch(47% .157 37.304); --color-orange-900: oklch(40.8% .123 38.172); --color-orange-950: oklch(26.6% .079 36.259); --color-amber-50: oklch(98.7% .022 95.277); --color-amber-100: oklch(96.2% .059 95.617); --color-amber-200: oklch(92.4% .12 95.746); --color-amber-300: oklch(87.9% .169 91.605); --color-amber-400: oklch(82.8% .189 84.429); --color-amber-500: oklch(76.9% .188 70.08); --color-amber-600: oklch(66.6% .179 58.318); --color-amber-700: oklch(55.5% .163 48.998); --color-amber-800: oklch(47.3% .137 46.201); --color-amber-900: oklch(41.4% .112 45.904); --color-amber-950: oklch(27.9% .077 45.635); --color-yellow-50: oklch(98.7% .026 102.212); --color-yellow-100: oklch(97.3% .071 103.193); --color-yellow-200: oklch(94.5% .129 101.54); --color-yellow-300: oklch(90.5% .182 98.111); --color-yellow-400: oklch(85.2% .199 91.936); --color-yellow-500: oklch(79.5% .184 86.047); --color-yellow-600: oklch(68.1% .162 75.834); --color-yellow-700: oklch(55.4% .135 66.442); --color-yellow-800: oklch(47.6% .114 61.907); --color-yellow-900: oklch(42.1% .095 57.708); --color-yellow-950: oklch(28.6% .066 53.813); --color-lime-50: oklch(98.6% .031 120.757); --color-lime-100: oklch(96.7% .067 122.328); --color-lime-200: oklch(93.8% .127 124.321); --color-lime-300: oklch(89.7% .196 126.665); --color-lime-400: oklch(84.1% .238 128.85); --color-lime-500: oklch(76.8% .233 130.85); --color-lime-600: oklch(64.8% .2 131.684); --color-lime-700: oklch(53.2% .157 131.589); --color-lime-800: oklch(45.3% .124 130.933); --color-lime-900: oklch(40.5% .101 131.063); --color-lime-950: oklch(27.4% .072 132.109); --color-green-50: oklch(98.2% .018 155.826); --color-green-100: oklch(96.2% .044 156.743); --color-green-200: oklch(92.5% .084 155.995); --color-green-300: oklch(87.1% .15 154.449); --color-green-400: oklch(79.2% .209 151.711); --color-green-500: oklch(72.3% .219 149.579); --color-green-600: oklch(62.7% .194 149.214); --color-green-700: oklch(52.7% .154 150.069); --color-green-800: oklch(44.8% .119 151.328); --color-green-900: oklch(39.3% .095 152.535); --color-green-950: oklch(26.6% .065 152.934); --color-emerald-50: oklch(97.9% .021 166.113); --color-emerald-100: oklch(95% .052 163.051); --color-emerald-200: oklch(90.5% .093 164.15); --color-emerald-300: oklch(84.5% .143 164.978); --color-emerald-400: oklch(76.5% .177 163.223); --color-emerald-500: oklch(69.6% .17 162.48); --color-emerald-600: oklch(59.6% .145 163.225); --color-emerald-700: oklch(50.8% .118 165.612); --color-emerald-800: oklch(43.2% .095 166.913); --color-emerald-900: oklch(37.8% .077 168.94); --color-emerald-950: oklch(26.2% .051 172.552); --color-teal-50: oklch(98.4% .014 180.72); --color-teal-100: oklch(95.3% .051 180.801); --color-teal-200: oklch(91% .096 180.426); --color-teal-300: oklch(85.5% .138 181.071); --color-teal-400: oklch(77.7% .152 181.912); --color-teal-500: oklch(70.4% .14 182.503); --color-teal-600: oklch(60% .118 184.704); --color-teal-700: oklch(51.1% .096 186.391); --color-teal-800: oklch(43.7% .078 188.216); --color-teal-900: oklch(38.6% .063 188.416); --color-teal-950: oklch(27.7% .046 192.524); --color-cyan-50: oklch(98.4% .019 200.873); --color-cyan-100: oklch(95.6% .045 203.388); --color-cyan-200: oklch(91.7% .08 205.041); --color-cyan-300: oklch(86.5% .127 207.078); --color-cyan-400: oklch(78.9% .154 211.53); --color-cyan-500: oklch(71.5% .143 215.221); --color-cyan-600: oklch(60.9% .126 221.723); --color-cyan-700: oklch(52% .105 223.128); --color-cyan-800: oklch(45% .085 224.283); --color-cyan-900: oklch(39.8% .07 227.392); --color-cyan-950: oklch(30.2% .056 229.695); --color-sky-50: oklch(97.7% .013 236.62); --color-sky-100: oklch(95.1% .026 236.824); --color-sky-200: oklch(90.1% .058 230.902); --color-sky-300: oklch(82.8% .111 230.318); --color-sky-400: oklch(74.6% .16 232.661); --color-sky-500: oklch(68.5% .169 237.323); --color-sky-600: oklch(58.8% .158 241.966); --color-sky-700: oklch(50% .134 242.749); --color-sky-800: oklch(44.3% .11 240.79); --color-sky-900: oklch(39.1% .09 240.876); --color-sky-950: oklch(29.3% .066 243.157); --color-blue-50: oklch(97% .014 254.604); --color-blue-100: oklch(93.2% .032 255.585); --color-blue-200: oklch(88.2% .059 254.128); --color-blue-300: oklch(80.9% .105 251.813); --color-blue-400: oklch(70.7% .165 254.624); --color-blue-500: oklch(62.3% .214 259.815); --color-blue-600: oklch(54.6% .245 262.881); --color-blue-700: oklch(48.8% .243 264.376); --color-blue-800: oklch(42.4% .199 265.638); --color-blue-900: oklch(37.9% .146 265.522); --color-blue-950: oklch(28.2% .091 267.935); --color-indigo-50: oklch(96.2% .018 272.314); --color-indigo-100: oklch(93% .034 272.788); --color-indigo-200: oklch(87% .065 274.039); --color-indigo-300: oklch(78.5% .115 274.713); --color-indigo-400: oklch(67.3% .182 276.935); --color-indigo-500: oklch(58.5% .233 277.117); --color-indigo-600: oklch(51.1% .262 276.966); --color-indigo-700: oklch(45.7% .24 277.023); --color-indigo-800: oklch(39.8% .195 277.366); --color-indigo-900: oklch(35.9% .144 278.697); --color-indigo-950: oklch(25.7% .09 281.288); --color-violet-50: oklch(96.9% .016 293.756); --color-violet-100: oklch(94.3% .029 294.588); --color-violet-200: oklch(89.4% .057 293.283); --color-violet-300: oklch(81.1% .111 293.571); --color-violet-400: oklch(70.2% .183 293.541); --color-violet-500: oklch(60.6% .25 292.717); --color-violet-600: oklch(54.1% .281 293.009); --color-violet-700: oklch(49.1% .27 292.581); --color-violet-800: oklch(43.2% .232 292.759); --color-violet-900: oklch(38% .189 293.745); --color-violet-950: oklch(28.3% .141 291.089); --color-purple-50: oklch(97.7% .014 308.299); --color-purple-100: oklch(94.6% .033 307.174); --color-purple-200: oklch(90.2% .063 306.703); --color-purple-300: oklch(82.7% .119 306.383); --color-purple-400: oklch(71.4% .203 305.504); --color-purple-500: oklch(62.7% .265 303.9); --color-purple-600: oklch(55.8% .288 302.321); --color-purple-700: oklch(49.6% .265 301.924); --color-purple-800: oklch(43.8% .218 303.724); --color-purple-900: oklch(38.1% .176 304.987); --color-purple-950: oklch(29.1% .149 302.717); --color-fuchsia-50: oklch(97.7% .017 320.058); --color-fuchsia-100: oklch(95.2% .037 318.852); --color-fuchsia-200: oklch(90.3% .076 319.62); --color-fuchsia-300: oklch(83.3% .145 321.434); --color-fuchsia-400: oklch(74% .238 322.16); --color-fuchsia-500: oklch(66.7% .295 322.15); --color-fuchsia-600: oklch(59.1% .293 322.896); --color-fuchsia-700: oklch(51.8% .253 323.949); --color-fuchsia-800: oklch(45.2% .211 324.591); --color-fuchsia-900: oklch(40.1% .17 325.612); --color-fuchsia-950: oklch(29.3% .136 325.661); --color-pink-50: oklch(97.1% .014 343.198); --color-pink-100: oklch(94.8% .028 342.258); --color-pink-200: oklch(89.9% .061 343.231); --color-pink-300: oklch(82.3% .12 346.018); --color-pink-400: oklch(71.8% .202 349.761); --color-pink-500: oklch(65.6% .241 354.308); --color-pink-600: oklch(59.2% .249 .584); --color-pink-700: oklch(52.5% .223 3.958); --color-pink-800: oklch(45.9% .187 3.815); --color-pink-900: oklch(40.8% .153 2.432); --color-pink-950: oklch(28.4% .109 3.907); --color-rose-50: oklch(96.9% .015 12.422); --color-rose-100: oklch(94.1% .03 12.58); --color-rose-200: oklch(89.2% .058 10.001); --color-rose-300: oklch(81% .117 11.638); --color-rose-400: oklch(71.2% .194 13.428); --color-rose-500: oklch(64.5% .246 16.439); --color-rose-600: oklch(58.6% .253 17.585); --color-rose-700: oklch(51.4% .222 16.935); --color-rose-800: oklch(45.5% .188 13.697); --color-rose-900: oklch(41% .159 10.272); --color-rose-950: oklch(27.1% .105 12.094); --color-slate-50: oklch(98.4% .003 247.858); --color-slate-100: oklch(96.8% .007 247.896); --color-slate-200: oklch(92.9% .013 255.508); --color-slate-300: oklch(86.9% .022 252.894); --color-slate-400: oklch(70.4% .04 256.788); --color-slate-500: oklch(55.4% .046 257.417); --color-slate-600: oklch(44.6% .043 257.281); --color-slate-700: oklch(37.2% .044 257.287); --color-slate-800: oklch(27.9% .041 260.031); --color-slate-900: oklch(20.8% .042 265.755); --color-slate-950: oklch(12.9% .042 264.695); --color-gray-50: oklch(98.5% .002 247.839); --color-gray-100: oklch(96.7% .003 264.542); --color-gray-200: oklch(92.8% .006 264.531); --color-gray-300: oklch(87.2% .01 258.338); --color-gray-400: oklch(70.7% .022 261.325); --color-gray-500: oklch(55.1% .027 264.364); --color-gray-600: oklch(44.6% .03 256.802); --color-gray-700: oklch(37.3% .034 259.733); --color-gray-800: oklch(27.8% .033 256.848); --color-gray-900: oklch(21% .034 264.665); --color-gray-950: oklch(13% .028 261.692); --color-zinc-50: oklch(98.5% 0 0); --color-zinc-100: oklch(96.7% .001 286.375); --color-zinc-200: oklch(92% .004 286.32); --color-zinc-300: oklch(87.1% .006 286.286); --color-zinc-400: oklch(70.5% .015 286.067); --color-zinc-500: oklch(55.2% .016 285.938); --color-zinc-600: oklch(44.2% .017 285.786); --color-zinc-700: oklch(37% .013 285.805); --color-zinc-800: oklch(27.4% .006 286.033); --color-zinc-900: oklch(21% .006 285.885); --color-zinc-950: oklch(14.1% .005 285.823); --color-neutral-50: oklch(98.5% 0 0); --color-neutral-100: oklch(97% 0 0); --color-neutral-200: oklch(92.2% 0 0); --color-neutral-300: oklch(87% 0 0); --color-neutral-400: oklch(70.8% 0 0); --color-neutral-500: oklch(55.6% 0 0); --color-neutral-600: oklch(43.9% 0 0); --color-neutral-700: oklch(37.1% 0 0); --color-neutral-800: oklch(26.9% 0 0); --color-neutral-900: oklch(20.5% 0 0); --color-neutral-950: oklch(14.5% 0 0); --color-stone-50: oklch(98.5% .001 106.423); --color-stone-100: oklch(97% .001 106.424); --color-stone-200: oklch(92.3% .003 48.717); --color-stone-300: oklch(86.9% .005 56.366); --color-stone-400: oklch(70.9% .01 56.259); --color-stone-500: oklch(55.3% .013 58.071); --color-stone-600: oklch(44.4% .011 73.639); --color-stone-700: oklch(37.4% .01 67.558); --color-stone-800: oklch(26.8% .007 34.298); --color-stone-900: oklch(21.6% .006 56.043); --color-stone-950: oklch(14.7% .004 49.25); --color-mauve-50: oklch(98.5% 0 0); --color-mauve-100: oklch(96% .003 325.6); --color-mauve-200: oklch(92.2% .005 325.62); --color-mauve-300: oklch(86.5% .012 325.68); --color-mauve-400: oklch(71.1% .019 323.02); --color-mauve-500: oklch(54.2% .034 322.5); --color-mauve-600: oklch(43.5% .029 321.78); --color-mauve-700: oklch(36.4% .029 323.89); --color-mauve-800: oklch(26.3% .024 320.12); --color-mauve-900: oklch(21.2% .019 322.12); --color-mauve-950: oklch(14.5% .008 326); --color-olive-50: oklch(98.8% .003 106.5); --color-olive-100: oklch(96.6% .005 106.5); --color-olive-200: oklch(93% .007 106.5); --color-olive-300: oklch(88% .011 106.6); --color-olive-400: oklch(73.7% .021 106.9); --color-olive-500: oklch(58% .031 107.3); --color-olive-600: oklch(46.6% .025 107.3); --color-olive-700: oklch(39.4% .023 107.4); --color-olive-800: oklch(28.6% .016 107.4); --color-olive-900: oklch(22.8% .013 107.4); --color-olive-950: oklch(15.3% .006 107.1); --color-mist-50: oklch(98.7% .002 197.1); --color-mist-100: oklch(96.3% .002 197.1); --color-mist-200: oklch(92.5% .005 214.3); --color-mist-300: oklch(87.2% .007 219.6); --color-mist-400: oklch(72.3% .014 214.4); --color-mist-500: oklch(56% .021 213.5); --color-mist-600: oklch(45% .017 213.2); --color-mist-700: oklch(37.8% .015 216); --color-mist-800: oklch(27.5% .011 216.9); --color-mist-900: oklch(21.8% .008 223.9); --color-mist-950: oklch(14.8% .004 228.8); --color-taupe-50: oklch(98.6% .002 67.8); --color-taupe-100: oklch(96% .002 17.2); --color-taupe-200: oklch(92.2% .005 34.3); --color-taupe-300: oklch(86.8% .007 39.5); --color-taupe-400: oklch(71.4% .014 41.2); --color-taupe-500: oklch(54.7% .021 43.1); --color-taupe-600: oklch(43.8% .017 39.3); --color-taupe-700: oklch(36.7% .016 35.7); --color-taupe-800: oklch(26.8% .011 36.5); --color-taupe-900: oklch(21.4% .009 43.1); --color-taupe-950: oklch(14.7% .004 49.3); --color-black: #000; --color-white: #fff; --spacing: .25rem; --breakpoint-sm: 40rem; --breakpoint-md: 48rem; --breakpoint-lg: 64rem; --breakpoint-xl: 80rem; --breakpoint-2xl: 96rem; --container-3xs: 16rem; --container-2xs: 18rem; --container-xs: 20rem; --container-sm: 24rem; --container-md: 28rem; --container-lg: 32rem; --container-xl: 36rem; --container-2xl: 42rem; --container-3xl: 48rem; --container-4xl: 56rem; --container-5xl: 64rem; --container-6xl: 72rem; --container-7xl: 80rem; --text-xs: .75rem; --text-xs--line-height: calc(1 / .75); --text-sm: .875rem; --text-sm--line-height: calc(1.25 / .875); --text-base: 1rem; --text-base--line-height: 1.5 ; --text-lg: 1.125rem; --text-lg--line-height: calc(1.75 / 1.125); --text-xl: 1.25rem; --text-xl--line-height: calc(1.75 / 1.25); --text-2xl: 1.5rem; --text-2xl--line-height: calc(2 / 1.5); --text-3xl: 1.875rem; --text-3xl--line-height: 1.2 ; --text-4xl: 2.25rem; --text-4xl--line-height: calc(2.5 / 2.25); --text-5xl: 3rem; --text-5xl--line-height: 1; --text-6xl: 3.75rem; --text-6xl--line-height: 1; --text-7xl: 4.5rem; --text-7xl--line-height: 1; --text-8xl: 6rem; --text-8xl--line-height: 1; --text-9xl: 8rem; --text-9xl--line-height: 1; --font-weight-thin: 100; --font-weight-extralight: 200; --font-weight-light: 300; --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700; --font-weight-extrabold: 800; --font-weight-black: 900; --tracking-tighter: -.05em; --tracking-tight: -.025em; --tracking-normal: 0em; --tracking-wide: .025em; --tracking-wider: .05em; --tracking-widest: .1em; --leading-tight: 1.25; --leading-snug: 1.375; --leading-normal: 1.5; --leading-relaxed: 1.625; --leading-loose: 2; --radius-xs: .125rem; --radius-sm: .25rem; --radius-md: .375rem; --radius-lg: .5rem; --radius-xl: .75rem; --radius-2xl: 1rem; --radius-3xl: 1.5rem; --radius-4xl: 2rem; --shadow-2xs: 0 1px rgb(0 0 0 / .05); --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05); --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1); --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1); --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25); --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / .05); --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / .05); --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / .05); --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / .05); --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / .15); --drop-shadow-md: 0 3px 3px rgb(0 0 0 / .12); --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / .15); --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / .1); --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / .15); --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / .15); --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / .2); --text-shadow-sm: 0px 1px 0px rgb(0 0 0 / .075), 0px 1px 1px rgb(0 0 0 / .075), 0px 2px 2px rgb(0 0 0 / .075); --text-shadow-md: 0px 1px 1px rgb(0 0 0 / .1), 0px 1px 2px rgb(0 0 0 / .1), 0px 2px 4px rgb(0 0 0 / .1); --text-shadow-lg: 0px 1px 2px rgb(0 0 0 / .1), 0px 3px 2px rgb(0 0 0 / .1), 0px 4px 8px rgb(0 0 0 / .1); --ease-in: cubic-bezier(.4, 0, 1, 1); --ease-out: cubic-bezier(0, 0, .2, 1); --ease-in-out: cubic-bezier(.4, 0, .2, 1); --animate-spin: spin 1s linear infinite; --animate-ping: ping 1s cubic-bezier(0, 0, .2, 1) infinite; --animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; --animate-bounce: bounce 1s infinite; @keyframes spin { to { transform: rotate(360deg); } } @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } } @keyframes pulse { 50% { opacity: .5; } } @keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); } 50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); } } --blur-xs: 4px; --blur-sm: 8px; --blur-md: 12px; --blur-lg: 16px; --blur-xl: 24px; --blur-2xl: 40px; --blur-3xl: 64px; --perspective-dramatic: 100px; --perspective-near: 300px; --perspective-normal: 500px; --perspective-midrange: 800px; --perspective-distant: 1200px; --aspect-video: 16 / 9; --default-transition-duration: .15s; --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1); --default-font-family: --theme(--font-sans, initial); --default-font-feature-settings: --theme( --font-sans--font-feature-settings, initial ); --default-font-variation-settings: --theme( --font-sans--font-variation-settings, initial ); --default-mono-font-family: --theme(--font-mono, initial); --default-mono-font-feature-settings: --theme( --font-mono--font-feature-settings, initial ); --default-mono-font-variation-settings: --theme( --font-mono--font-variation-settings, initial ); }@theme default inline reference{ --blur: 8px; --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / .05); --drop-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 1px 1px rgb(0 0 0 / .06); --radius: .25rem; --max-width-prose: 65ch; }}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:--theme(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:--theme(--default-font-feature-settings,normal);font-variation-settings:--theme(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:--theme(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:--theme(--default-mono-font-feature-settings,normal);font-variation-settings:--theme(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{@tailwind utilities;}@source "../**/*.{ts,tsx,js,jsx}";@layer base{:host{all:initial;color-scheme:light;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}*,*:before,*:after{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*,*:before,*:after{box-sizing:border-box}button{font-family:inherit;cursor:pointer}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}.pw-cta-shimmer:before{content:"";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.35) 50%,transparent);animation:pw-cta-shimmer 3s infinite;z-index:1}@keyframes pw-cta-shimmer{0%{left:-100%}to{left:100%}}';
1
+ import { P as j, B as Re, E as ze, c as De, A as ue, w as qe, a as K, r as Ne, b as Fe } from "./chunks/chrome-port-CxW3Pwc2.js";
2
+ import { render as X, h as de, createContext as Ve } from "preact";
3
+ import { jsx as o, jsxs as c, Fragment as Y } from "preact/jsx-runtime";
4
+ import { useState as x, useEffect as T, useContext as $e, useRef as z, useMemo as _e, useLayoutEffect as He } from "preact/hooks";
5
+ import { P as Ge } from "./chunks/port-name-BPfQKtdb.js";
6
+ const Se = '@layer theme,base,components,utilities;@layer theme{@theme default{ --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; --color-red-50: oklch(97.1% .013 17.38); --color-red-100: oklch(93.6% .032 17.717); --color-red-200: oklch(88.5% .062 18.334); --color-red-300: oklch(80.8% .114 19.571); --color-red-400: oklch(70.4% .191 22.216); --color-red-500: oklch(63.7% .237 25.331); --color-red-600: oklch(57.7% .245 27.325); --color-red-700: oklch(50.5% .213 27.518); --color-red-800: oklch(44.4% .177 26.899); --color-red-900: oklch(39.6% .141 25.723); --color-red-950: oklch(25.8% .092 26.042); --color-orange-50: oklch(98% .016 73.684); --color-orange-100: oklch(95.4% .038 75.164); --color-orange-200: oklch(90.1% .076 70.697); --color-orange-300: oklch(83.7% .128 66.29); --color-orange-400: oklch(75% .183 55.934); --color-orange-500: oklch(70.5% .213 47.604); --color-orange-600: oklch(64.6% .222 41.116); --color-orange-700: oklch(55.3% .195 38.402); --color-orange-800: oklch(47% .157 37.304); --color-orange-900: oklch(40.8% .123 38.172); --color-orange-950: oklch(26.6% .079 36.259); --color-amber-50: oklch(98.7% .022 95.277); --color-amber-100: oklch(96.2% .059 95.617); --color-amber-200: oklch(92.4% .12 95.746); --color-amber-300: oklch(87.9% .169 91.605); --color-amber-400: oklch(82.8% .189 84.429); --color-amber-500: oklch(76.9% .188 70.08); --color-amber-600: oklch(66.6% .179 58.318); --color-amber-700: oklch(55.5% .163 48.998); --color-amber-800: oklch(47.3% .137 46.201); --color-amber-900: oklch(41.4% .112 45.904); --color-amber-950: oklch(27.9% .077 45.635); --color-yellow-50: oklch(98.7% .026 102.212); --color-yellow-100: oklch(97.3% .071 103.193); --color-yellow-200: oklch(94.5% .129 101.54); --color-yellow-300: oklch(90.5% .182 98.111); --color-yellow-400: oklch(85.2% .199 91.936); --color-yellow-500: oklch(79.5% .184 86.047); --color-yellow-600: oklch(68.1% .162 75.834); --color-yellow-700: oklch(55.4% .135 66.442); --color-yellow-800: oklch(47.6% .114 61.907); --color-yellow-900: oklch(42.1% .095 57.708); --color-yellow-950: oklch(28.6% .066 53.813); --color-lime-50: oklch(98.6% .031 120.757); --color-lime-100: oklch(96.7% .067 122.328); --color-lime-200: oklch(93.8% .127 124.321); --color-lime-300: oklch(89.7% .196 126.665); --color-lime-400: oklch(84.1% .238 128.85); --color-lime-500: oklch(76.8% .233 130.85); --color-lime-600: oklch(64.8% .2 131.684); --color-lime-700: oklch(53.2% .157 131.589); --color-lime-800: oklch(45.3% .124 130.933); --color-lime-900: oklch(40.5% .101 131.063); --color-lime-950: oklch(27.4% .072 132.109); --color-green-50: oklch(98.2% .018 155.826); --color-green-100: oklch(96.2% .044 156.743); --color-green-200: oklch(92.5% .084 155.995); --color-green-300: oklch(87.1% .15 154.449); --color-green-400: oklch(79.2% .209 151.711); --color-green-500: oklch(72.3% .219 149.579); --color-green-600: oklch(62.7% .194 149.214); --color-green-700: oklch(52.7% .154 150.069); --color-green-800: oklch(44.8% .119 151.328); --color-green-900: oklch(39.3% .095 152.535); --color-green-950: oklch(26.6% .065 152.934); --color-emerald-50: oklch(97.9% .021 166.113); --color-emerald-100: oklch(95% .052 163.051); --color-emerald-200: oklch(90.5% .093 164.15); --color-emerald-300: oklch(84.5% .143 164.978); --color-emerald-400: oklch(76.5% .177 163.223); --color-emerald-500: oklch(69.6% .17 162.48); --color-emerald-600: oklch(59.6% .145 163.225); --color-emerald-700: oklch(50.8% .118 165.612); --color-emerald-800: oklch(43.2% .095 166.913); --color-emerald-900: oklch(37.8% .077 168.94); --color-emerald-950: oklch(26.2% .051 172.552); --color-teal-50: oklch(98.4% .014 180.72); --color-teal-100: oklch(95.3% .051 180.801); --color-teal-200: oklch(91% .096 180.426); --color-teal-300: oklch(85.5% .138 181.071); --color-teal-400: oklch(77.7% .152 181.912); --color-teal-500: oklch(70.4% .14 182.503); --color-teal-600: oklch(60% .118 184.704); --color-teal-700: oklch(51.1% .096 186.391); --color-teal-800: oklch(43.7% .078 188.216); --color-teal-900: oklch(38.6% .063 188.416); --color-teal-950: oklch(27.7% .046 192.524); --color-cyan-50: oklch(98.4% .019 200.873); --color-cyan-100: oklch(95.6% .045 203.388); --color-cyan-200: oklch(91.7% .08 205.041); --color-cyan-300: oklch(86.5% .127 207.078); --color-cyan-400: oklch(78.9% .154 211.53); --color-cyan-500: oklch(71.5% .143 215.221); --color-cyan-600: oklch(60.9% .126 221.723); --color-cyan-700: oklch(52% .105 223.128); --color-cyan-800: oklch(45% .085 224.283); --color-cyan-900: oklch(39.8% .07 227.392); --color-cyan-950: oklch(30.2% .056 229.695); --color-sky-50: oklch(97.7% .013 236.62); --color-sky-100: oklch(95.1% .026 236.824); --color-sky-200: oklch(90.1% .058 230.902); --color-sky-300: oklch(82.8% .111 230.318); --color-sky-400: oklch(74.6% .16 232.661); --color-sky-500: oklch(68.5% .169 237.323); --color-sky-600: oklch(58.8% .158 241.966); --color-sky-700: oklch(50% .134 242.749); --color-sky-800: oklch(44.3% .11 240.79); --color-sky-900: oklch(39.1% .09 240.876); --color-sky-950: oklch(29.3% .066 243.157); --color-blue-50: oklch(97% .014 254.604); --color-blue-100: oklch(93.2% .032 255.585); --color-blue-200: oklch(88.2% .059 254.128); --color-blue-300: oklch(80.9% .105 251.813); --color-blue-400: oklch(70.7% .165 254.624); --color-blue-500: oklch(62.3% .214 259.815); --color-blue-600: oklch(54.6% .245 262.881); --color-blue-700: oklch(48.8% .243 264.376); --color-blue-800: oklch(42.4% .199 265.638); --color-blue-900: oklch(37.9% .146 265.522); --color-blue-950: oklch(28.2% .091 267.935); --color-indigo-50: oklch(96.2% .018 272.314); --color-indigo-100: oklch(93% .034 272.788); --color-indigo-200: oklch(87% .065 274.039); --color-indigo-300: oklch(78.5% .115 274.713); --color-indigo-400: oklch(67.3% .182 276.935); --color-indigo-500: oklch(58.5% .233 277.117); --color-indigo-600: oklch(51.1% .262 276.966); --color-indigo-700: oklch(45.7% .24 277.023); --color-indigo-800: oklch(39.8% .195 277.366); --color-indigo-900: oklch(35.9% .144 278.697); --color-indigo-950: oklch(25.7% .09 281.288); --color-violet-50: oklch(96.9% .016 293.756); --color-violet-100: oklch(94.3% .029 294.588); --color-violet-200: oklch(89.4% .057 293.283); --color-violet-300: oklch(81.1% .111 293.571); --color-violet-400: oklch(70.2% .183 293.541); --color-violet-500: oklch(60.6% .25 292.717); --color-violet-600: oklch(54.1% .281 293.009); --color-violet-700: oklch(49.1% .27 292.581); --color-violet-800: oklch(43.2% .232 292.759); --color-violet-900: oklch(38% .189 293.745); --color-violet-950: oklch(28.3% .141 291.089); --color-purple-50: oklch(97.7% .014 308.299); --color-purple-100: oklch(94.6% .033 307.174); --color-purple-200: oklch(90.2% .063 306.703); --color-purple-300: oklch(82.7% .119 306.383); --color-purple-400: oklch(71.4% .203 305.504); --color-purple-500: oklch(62.7% .265 303.9); --color-purple-600: oklch(55.8% .288 302.321); --color-purple-700: oklch(49.6% .265 301.924); --color-purple-800: oklch(43.8% .218 303.724); --color-purple-900: oklch(38.1% .176 304.987); --color-purple-950: oklch(29.1% .149 302.717); --color-fuchsia-50: oklch(97.7% .017 320.058); --color-fuchsia-100: oklch(95.2% .037 318.852); --color-fuchsia-200: oklch(90.3% .076 319.62); --color-fuchsia-300: oklch(83.3% .145 321.434); --color-fuchsia-400: oklch(74% .238 322.16); --color-fuchsia-500: oklch(66.7% .295 322.15); --color-fuchsia-600: oklch(59.1% .293 322.896); --color-fuchsia-700: oklch(51.8% .253 323.949); --color-fuchsia-800: oklch(45.2% .211 324.591); --color-fuchsia-900: oklch(40.1% .17 325.612); --color-fuchsia-950: oklch(29.3% .136 325.661); --color-pink-50: oklch(97.1% .014 343.198); --color-pink-100: oklch(94.8% .028 342.258); --color-pink-200: oklch(89.9% .061 343.231); --color-pink-300: oklch(82.3% .12 346.018); --color-pink-400: oklch(71.8% .202 349.761); --color-pink-500: oklch(65.6% .241 354.308); --color-pink-600: oklch(59.2% .249 .584); --color-pink-700: oklch(52.5% .223 3.958); --color-pink-800: oklch(45.9% .187 3.815); --color-pink-900: oklch(40.8% .153 2.432); --color-pink-950: oklch(28.4% .109 3.907); --color-rose-50: oklch(96.9% .015 12.422); --color-rose-100: oklch(94.1% .03 12.58); --color-rose-200: oklch(89.2% .058 10.001); --color-rose-300: oklch(81% .117 11.638); --color-rose-400: oklch(71.2% .194 13.428); --color-rose-500: oklch(64.5% .246 16.439); --color-rose-600: oklch(58.6% .253 17.585); --color-rose-700: oklch(51.4% .222 16.935); --color-rose-800: oklch(45.5% .188 13.697); --color-rose-900: oklch(41% .159 10.272); --color-rose-950: oklch(27.1% .105 12.094); --color-slate-50: oklch(98.4% .003 247.858); --color-slate-100: oklch(96.8% .007 247.896); --color-slate-200: oklch(92.9% .013 255.508); --color-slate-300: oklch(86.9% .022 252.894); --color-slate-400: oklch(70.4% .04 256.788); --color-slate-500: oklch(55.4% .046 257.417); --color-slate-600: oklch(44.6% .043 257.281); --color-slate-700: oklch(37.2% .044 257.287); --color-slate-800: oklch(27.9% .041 260.031); --color-slate-900: oklch(20.8% .042 265.755); --color-slate-950: oklch(12.9% .042 264.695); --color-gray-50: oklch(98.5% .002 247.839); --color-gray-100: oklch(96.7% .003 264.542); --color-gray-200: oklch(92.8% .006 264.531); --color-gray-300: oklch(87.2% .01 258.338); --color-gray-400: oklch(70.7% .022 261.325); --color-gray-500: oklch(55.1% .027 264.364); --color-gray-600: oklch(44.6% .03 256.802); --color-gray-700: oklch(37.3% .034 259.733); --color-gray-800: oklch(27.8% .033 256.848); --color-gray-900: oklch(21% .034 264.665); --color-gray-950: oklch(13% .028 261.692); --color-zinc-50: oklch(98.5% 0 0); --color-zinc-100: oklch(96.7% .001 286.375); --color-zinc-200: oklch(92% .004 286.32); --color-zinc-300: oklch(87.1% .006 286.286); --color-zinc-400: oklch(70.5% .015 286.067); --color-zinc-500: oklch(55.2% .016 285.938); --color-zinc-600: oklch(44.2% .017 285.786); --color-zinc-700: oklch(37% .013 285.805); --color-zinc-800: oklch(27.4% .006 286.033); --color-zinc-900: oklch(21% .006 285.885); --color-zinc-950: oklch(14.1% .005 285.823); --color-neutral-50: oklch(98.5% 0 0); --color-neutral-100: oklch(97% 0 0); --color-neutral-200: oklch(92.2% 0 0); --color-neutral-300: oklch(87% 0 0); --color-neutral-400: oklch(70.8% 0 0); --color-neutral-500: oklch(55.6% 0 0); --color-neutral-600: oklch(43.9% 0 0); --color-neutral-700: oklch(37.1% 0 0); --color-neutral-800: oklch(26.9% 0 0); --color-neutral-900: oklch(20.5% 0 0); --color-neutral-950: oklch(14.5% 0 0); --color-stone-50: oklch(98.5% .001 106.423); --color-stone-100: oklch(97% .001 106.424); --color-stone-200: oklch(92.3% .003 48.717); --color-stone-300: oklch(86.9% .005 56.366); --color-stone-400: oklch(70.9% .01 56.259); --color-stone-500: oklch(55.3% .013 58.071); --color-stone-600: oklch(44.4% .011 73.639); --color-stone-700: oklch(37.4% .01 67.558); --color-stone-800: oklch(26.8% .007 34.298); --color-stone-900: oklch(21.6% .006 56.043); --color-stone-950: oklch(14.7% .004 49.25); --color-mauve-50: oklch(98.5% 0 0); --color-mauve-100: oklch(96% .003 325.6); --color-mauve-200: oklch(92.2% .005 325.62); --color-mauve-300: oklch(86.5% .012 325.68); --color-mauve-400: oklch(71.1% .019 323.02); --color-mauve-500: oklch(54.2% .034 322.5); --color-mauve-600: oklch(43.5% .029 321.78); --color-mauve-700: oklch(36.4% .029 323.89); --color-mauve-800: oklch(26.3% .024 320.12); --color-mauve-900: oklch(21.2% .019 322.12); --color-mauve-950: oklch(14.5% .008 326); --color-olive-50: oklch(98.8% .003 106.5); --color-olive-100: oklch(96.6% .005 106.5); --color-olive-200: oklch(93% .007 106.5); --color-olive-300: oklch(88% .011 106.6); --color-olive-400: oklch(73.7% .021 106.9); --color-olive-500: oklch(58% .031 107.3); --color-olive-600: oklch(46.6% .025 107.3); --color-olive-700: oklch(39.4% .023 107.4); --color-olive-800: oklch(28.6% .016 107.4); --color-olive-900: oklch(22.8% .013 107.4); --color-olive-950: oklch(15.3% .006 107.1); --color-mist-50: oklch(98.7% .002 197.1); --color-mist-100: oklch(96.3% .002 197.1); --color-mist-200: oklch(92.5% .005 214.3); --color-mist-300: oklch(87.2% .007 219.6); --color-mist-400: oklch(72.3% .014 214.4); --color-mist-500: oklch(56% .021 213.5); --color-mist-600: oklch(45% .017 213.2); --color-mist-700: oklch(37.8% .015 216); --color-mist-800: oklch(27.5% .011 216.9); --color-mist-900: oklch(21.8% .008 223.9); --color-mist-950: oklch(14.8% .004 228.8); --color-taupe-50: oklch(98.6% .002 67.8); --color-taupe-100: oklch(96% .002 17.2); --color-taupe-200: oklch(92.2% .005 34.3); --color-taupe-300: oklch(86.8% .007 39.5); --color-taupe-400: oklch(71.4% .014 41.2); --color-taupe-500: oklch(54.7% .021 43.1); --color-taupe-600: oklch(43.8% .017 39.3); --color-taupe-700: oklch(36.7% .016 35.7); --color-taupe-800: oklch(26.8% .011 36.5); --color-taupe-900: oklch(21.4% .009 43.1); --color-taupe-950: oklch(14.7% .004 49.3); --color-black: #000; --color-white: #fff; --spacing: .25rem; --breakpoint-sm: 40rem; --breakpoint-md: 48rem; --breakpoint-lg: 64rem; --breakpoint-xl: 80rem; --breakpoint-2xl: 96rem; --container-3xs: 16rem; --container-2xs: 18rem; --container-xs: 20rem; --container-sm: 24rem; --container-md: 28rem; --container-lg: 32rem; --container-xl: 36rem; --container-2xl: 42rem; --container-3xl: 48rem; --container-4xl: 56rem; --container-5xl: 64rem; --container-6xl: 72rem; --container-7xl: 80rem; --text-xs: .75rem; --text-xs--line-height: calc(1 / .75); --text-sm: .875rem; --text-sm--line-height: calc(1.25 / .875); --text-base: 1rem; --text-base--line-height: 1.5 ; --text-lg: 1.125rem; --text-lg--line-height: calc(1.75 / 1.125); --text-xl: 1.25rem; --text-xl--line-height: calc(1.75 / 1.25); --text-2xl: 1.5rem; --text-2xl--line-height: calc(2 / 1.5); --text-3xl: 1.875rem; --text-3xl--line-height: 1.2 ; --text-4xl: 2.25rem; --text-4xl--line-height: calc(2.5 / 2.25); --text-5xl: 3rem; --text-5xl--line-height: 1; --text-6xl: 3.75rem; --text-6xl--line-height: 1; --text-7xl: 4.5rem; --text-7xl--line-height: 1; --text-8xl: 6rem; --text-8xl--line-height: 1; --text-9xl: 8rem; --text-9xl--line-height: 1; --font-weight-thin: 100; --font-weight-extralight: 200; --font-weight-light: 300; --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700; --font-weight-extrabold: 800; --font-weight-black: 900; --tracking-tighter: -.05em; --tracking-tight: -.025em; --tracking-normal: 0em; --tracking-wide: .025em; --tracking-wider: .05em; --tracking-widest: .1em; --leading-tight: 1.25; --leading-snug: 1.375; --leading-normal: 1.5; --leading-relaxed: 1.625; --leading-loose: 2; --radius-xs: .125rem; --radius-sm: .25rem; --radius-md: .375rem; --radius-lg: .5rem; --radius-xl: .75rem; --radius-2xl: 1rem; --radius-3xl: 1.5rem; --radius-4xl: 2rem; --shadow-2xs: 0 1px rgb(0 0 0 / .05); --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05); --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1); --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1); --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25); --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / .05); --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / .05); --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / .05); --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / .05); --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / .15); --drop-shadow-md: 0 3px 3px rgb(0 0 0 / .12); --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / .15); --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / .1); --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / .15); --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / .15); --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / .2); --text-shadow-sm: 0px 1px 0px rgb(0 0 0 / .075), 0px 1px 1px rgb(0 0 0 / .075), 0px 2px 2px rgb(0 0 0 / .075); --text-shadow-md: 0px 1px 1px rgb(0 0 0 / .1), 0px 1px 2px rgb(0 0 0 / .1), 0px 2px 4px rgb(0 0 0 / .1); --text-shadow-lg: 0px 1px 2px rgb(0 0 0 / .1), 0px 3px 2px rgb(0 0 0 / .1), 0px 4px 8px rgb(0 0 0 / .1); --ease-in: cubic-bezier(.4, 0, 1, 1); --ease-out: cubic-bezier(0, 0, .2, 1); --ease-in-out: cubic-bezier(.4, 0, .2, 1); --animate-spin: spin 1s linear infinite; --animate-ping: ping 1s cubic-bezier(0, 0, .2, 1) infinite; --animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; --animate-bounce: bounce 1s infinite; @keyframes spin { to { transform: rotate(360deg); } } @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } } @keyframes pulse { 50% { opacity: .5; } } @keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); } 50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); } } --blur-xs: 4px; --blur-sm: 8px; --blur-md: 12px; --blur-lg: 16px; --blur-xl: 24px; --blur-2xl: 40px; --blur-3xl: 64px; --perspective-dramatic: 100px; --perspective-near: 300px; --perspective-normal: 500px; --perspective-midrange: 800px; --perspective-distant: 1200px; --aspect-video: 16 / 9; --default-transition-duration: .15s; --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1); --default-font-family: --theme(--font-sans, initial); --default-font-feature-settings: --theme( --font-sans--font-feature-settings, initial ); --default-font-variation-settings: --theme( --font-sans--font-variation-settings, initial ); --default-mono-font-family: --theme(--font-mono, initial); --default-mono-font-feature-settings: --theme( --font-mono--font-feature-settings, initial ); --default-mono-font-variation-settings: --theme( --font-mono--font-variation-settings, initial ); }@theme default inline reference{ --blur: 8px; --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / .05); --drop-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 1px 1px rgb(0 0 0 / .06); --radius: .25rem; --max-width-prose: 65ch; }}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:--theme(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:--theme(--default-font-feature-settings,normal);font-variation-settings:--theme(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:--theme(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:--theme(--default-mono-font-feature-settings,normal);font-variation-settings:--theme(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{@tailwind utilities;}@source "../**/*.{ts,tsx,js,jsx}";@layer base{:host{all:initial;color-scheme:light;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}*,*:before,*:after{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*,*:before,*:after{box-sizing:border-box}button{font-family:inherit;cursor:pointer}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}.pw-cta-shimmer:before{content:"";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.35) 50%,transparent);animation:pw-cta-shimmer 3s infinite;z-index:1}@keyframes pw-cta-shimmer{0%{left:-100%}to{left:100%}}';
7
7
  let he = !1;
8
- function He() {
8
+ function We() {
9
9
  if (he || (he = !0, typeof CSS > "u" || typeof CSS.registerProperty != "function")) return;
10
- let t;
10
+ let r;
11
11
  try {
12
12
  const e = new CSSStyleSheet();
13
- e.replaceSync(_e), t = e.cssRules;
13
+ e.replaceSync(Se), r = e.cssRules;
14
14
  } catch {
15
15
  return;
16
16
  }
17
- for (const e of t) {
17
+ for (const e of r) {
18
18
  if (e.constructor.name !== "CSSPropertyRule") continue;
19
- const n = e;
19
+ const t = e;
20
20
  try {
21
21
  CSS.registerProperty({
22
- name: n.name,
23
- syntax: n.syntax,
24
- inherits: n.inherits,
25
- ...n.initialValue != null ? { initialValue: n.initialValue } : {}
22
+ name: t.name,
23
+ syntax: t.syntax,
24
+ inherits: t.inherits,
25
+ ...t.initialValue != null ? { initialValue: t.initialValue } : {}
26
26
  });
27
27
  } catch {
28
28
  }
29
29
  }
30
30
  }
31
- function Ge(t, e, n = {}) {
31
+ function Ze(r, e, t = {}) {
32
32
  if (typeof document > "u")
33
33
  throw new Error("mountShadow called in non-DOM environment");
34
- He();
35
- const r = n.host ?? document.createElement("div");
36
- r.setAttribute("data-paywall-host", ""), r.style.cssText = n.inline ? "all: initial; position: absolute; inset: 0; z-index: 1; pointer-events: none;" : "all: initial; position: fixed; inset: 0; z-index: 2147483647; pointer-events: none;", !r.isConnected && !n.inline && document.body.appendChild(r);
37
- const i = r.attachShadow({ mode: n.shadowMode ?? "closed" }), s = `
34
+ We();
35
+ const n = t.host ?? document.createElement("div");
36
+ n.setAttribute("data-paywall-host", ""), n.style.cssText = t.inline ? "all: initial; position: absolute; inset: 0; z-index: 1; pointer-events: none;" : "all: initial; position: fixed; inset: 0; z-index: 2147483647; pointer-events: none;", !n.isConnected && !t.inline && document.body.appendChild(n);
37
+ const i = n.attachShadow({ mode: t.shadowMode ?? "closed" }), s = `
38
38
  :host {
39
39
  all: initial !important;
40
40
  display: block !important;
@@ -53,33 +53,33 @@ function Ge(t, e, n = {}) {
53
53
  visibility: visible !important;
54
54
  }
55
55
  `, a = document.createElement("style");
56
- a.textContent = s + _e + (n.injectCss ?? ""), i.appendChild(a);
56
+ a.textContent = s + Se + (t.injectCss ?? ""), i.appendChild(a);
57
57
  const l = document.createElement("div");
58
58
  l.style.pointerEvents = "auto", i.appendChild(l);
59
59
  let d = e;
60
- return K(de(t, d), l), {
60
+ return X(de(r, d), l), {
61
61
  shadowRoot: i,
62
- update(u) {
63
- d = { ...d, ...u }, K(de(t, d), l);
62
+ update(p) {
63
+ d = { ...d, ...p }, X(de(r, d), l);
64
64
  },
65
65
  unmount() {
66
- K(null, l), r.remove();
66
+ X(null, l), n.remove();
67
67
  }
68
68
  };
69
69
  }
70
- const We = (t, e, n) => {
71
- const r = t[e];
72
- return r ? typeof r == "function" ? r() : Promise.resolve(r) : new Promise((i, s) => {
70
+ const Ye = (r, e, t) => {
71
+ const n = r[e];
72
+ return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((i, s) => {
73
73
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
74
74
  s.bind(
75
75
  null,
76
76
  new Error(
77
- "Unknown variable dynamic import: " + e + (e.split("/").length !== n ? ". Note that variables only represent file names one level deep." : "")
77
+ "Unknown variable dynamic import: " + e + (e.split("/").length !== t ? ". Note that variables only represent file names one level deep." : "")
78
78
  )
79
79
  )
80
80
  );
81
81
  });
82
- }, Ze = [
82
+ }, Ke = [
83
83
  "ru",
84
84
  "uk",
85
85
  "de",
@@ -107,123 +107,126 @@ const We = (t, e, n) => {
107
107
  "th",
108
108
  "vi",
109
109
  "he"
110
- ], Se = (t, e, n) => Ie(e, n), Ce = Ne({ t: Se, locale: "en" });
111
- function Ie(t, e) {
112
- if (!e) return t;
113
- let n = t;
114
- for (const [r, i] of Object.entries(e))
115
- n = n.split(`{${r}}`).join(String(i));
116
- return n;
117
- }
118
- const X = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map();
119
- function Ye(t) {
120
- return Ze.includes(t);
121
- }
122
- function Ke(t) {
110
+ ], Ce = (r, e, t) => Le(e, t), Ie = Ve({ t: Ce, locale: "en" });
111
+ function Le(r, e) {
112
+ if (!e) return r;
113
+ let t = r;
114
+ for (const [n, i] of Object.entries(e))
115
+ t = t.split(`{${n}}`).join(String(i));
116
+ return t;
117
+ }
118
+ const J = /* @__PURE__ */ new Map(), Q = /* @__PURE__ */ new Map();
119
+ function Ae(r) {
120
+ return Ke.includes(r);
121
+ }
122
+ function Xe(r) {
123
123
  const e = [];
124
124
  if (typeof navigator < "u" && navigator.language) {
125
125
  e.push(navigator.language);
126
- const r = navigator.language.split("-")[0];
127
- r && r !== navigator.language && e.push(r);
126
+ const n = navigator.language.split("-")[0];
127
+ n && n !== navigator.language && e.push(n);
128
128
  }
129
- const n = t.settings.locale_default;
130
- if (n) {
131
- e.push(n);
132
- const r = n.split("-")[0];
133
- r && r !== n && e.push(r);
129
+ const t = r.settings.locale_default;
130
+ if (t) {
131
+ e.push(t);
132
+ const n = t.split("-")[0];
133
+ n && n !== t && e.push(n);
134
134
  }
135
- for (const r of e)
136
- if (Ye(r)) return r;
135
+ for (const n of e)
136
+ if (Ae(n)) return n;
137
137
  return null;
138
138
  }
139
- function Xe(t) {
140
- return !!t.locales && Object.keys(t.locales).length > 0;
139
+ function Je(r) {
140
+ return !!r.locales && Object.keys(r.locales).length > 0;
141
141
  }
142
- async function Je(t) {
143
- const e = X.get(t);
142
+ async function Qe(r) {
143
+ const e = J.get(r);
144
144
  if (e) return e;
145
- const n = J.get(t);
146
- if (n) return n;
147
- const r = We(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./chunks/ar-BCHXVoE2.js"), "./locales/cs.ts": () => import("./chunks/cs-B5NqpTW_.js"), "./locales/da.ts": () => import("./chunks/da-BJrGZ3LD.js"), "./locales/de.ts": () => import("./chunks/de-aepBKwsb.js"), "./locales/el.ts": () => import("./chunks/el-DTLQoX2D.js"), "./locales/es.ts": () => import("./chunks/es-CLutF-D_.js"), "./locales/fi.ts": () => import("./chunks/fi-DZ4csxqk.js"), "./locales/fr.ts": () => import("./chunks/fr-jJU1SSpj.js"), "./locales/he.ts": () => import("./chunks/he-D9obGPNj.js"), "./locales/hi.ts": () => import("./chunks/hi-pM8SQwZ3.js"), "./locales/hu.ts": () => import("./chunks/hu-E0m9WgbD.js"), "./locales/id.ts": () => import("./chunks/id-C6poPvby.js"), "./locales/it.ts": () => import("./chunks/it-B2RSFyVd.js"), "./locales/ja.ts": () => import("./chunks/ja-CM-VgVG6.js"), "./locales/ko.ts": () => import("./chunks/ko-C451fA21.js"), "./locales/nl.ts": () => import("./chunks/nl-DzQfJPo2.js"), "./locales/no.ts": () => import("./chunks/no-B51be8KT.js"), "./locales/pl.ts": () => import("./chunks/pl-5rTEkvfY.js"), "./locales/pt.ts": () => import("./chunks/pt-JwqffZ9u.js"), "./locales/ro.ts": () => import("./chunks/ro-BE_wJ1td.js"), "./locales/ru.ts": () => import("./chunks/ru-BviATvLb.js"), "./locales/sv.ts": () => import("./chunks/sv-DabGF9WL.js"), "./locales/th.ts": () => import("./chunks/th-BiF-bNo0.js"), "./locales/tr.ts": () => import("./chunks/tr-xZuly8X8.js"), "./locales/uk.ts": () => import("./chunks/uk-KlkAaHuy.js"), "./locales/vi.ts": () => import("./chunks/vi-BVCeumNE.js"), "./locales/zh.ts": () => import("./chunks/zh-C_ghwmqi.js") }), `./locales/${t}.ts`, 3).then((i) => {
145
+ const t = Q.get(r);
146
+ if (t) return t;
147
+ const n = Ye(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./chunks/ar-nh4l4WDE.js"), "./locales/cs.ts": () => import("./chunks/cs-2UYO2rWf.js"), "./locales/da.ts": () => import("./chunks/da-BD0O_HfV.js"), "./locales/de.ts": () => import("./chunks/de-BkCiXPsn.js"), "./locales/el.ts": () => import("./chunks/el-cIcxTp07.js"), "./locales/es.ts": () => import("./chunks/es-CJBC_jrV.js"), "./locales/fi.ts": () => import("./chunks/fi-DyV7ynBf.js"), "./locales/fr.ts": () => import("./chunks/fr-BLQ4AIu7.js"), "./locales/he.ts": () => import("./chunks/he-Bg-Bqi7r.js"), "./locales/hi.ts": () => import("./chunks/hi-wQeE43oY.js"), "./locales/hu.ts": () => import("./chunks/hu-D9qxzu0r.js"), "./locales/id.ts": () => import("./chunks/id-Rx_wYvqy.js"), "./locales/it.ts": () => import("./chunks/it-B1SRPZ3e.js"), "./locales/ja.ts": () => import("./chunks/ja-DiItm8te.js"), "./locales/ko.ts": () => import("./chunks/ko-CdGFWAKX.js"), "./locales/nl.ts": () => import("./chunks/nl-CmZ3vEvj.js"), "./locales/no.ts": () => import("./chunks/no-BuxByZpq.js"), "./locales/pl.ts": () => import("./chunks/pl-jZFCnDb8.js"), "./locales/pt.ts": () => import("./chunks/pt-Cld7MwIW.js"), "./locales/ro.ts": () => import("./chunks/ro-CuKDqj3C.js"), "./locales/ru.ts": () => import("./chunks/ru-B7cjqJUm.js"), "./locales/sv.ts": () => import("./chunks/sv-D9y-M1Fo.js"), "./locales/th.ts": () => import("./chunks/th-D9umBjEy.js"), "./locales/tr.ts": () => import("./chunks/tr-BddMywiw.js"), "./locales/uk.ts": () => import("./chunks/uk-Dbd31hFt.js"), "./locales/vi.ts": () => import("./chunks/vi-Do3BMOdh.js"), "./locales/zh.ts": () => import("./chunks/zh-gQSYLZI3.js") }), `./locales/${r}.ts`, 3).then((i) => {
148
148
  const s = i.default ?? {};
149
- return X.set(t, s), s;
149
+ return J.set(r, s), s;
150
150
  }).catch((i) => {
151
- console.warn(`[paywall] failed to load locale chunk "${t}"`, i);
151
+ console.warn(`[paywall] failed to load locale chunk "${r}"`, i);
152
152
  const s = {};
153
- return X.set(t, s), s;
153
+ return J.set(r, s), s;
154
154
  }).finally(() => {
155
- J.delete(t);
155
+ Q.delete(r);
156
156
  });
157
- return J.set(t, r), r;
158
- }
159
- function Qe({ bootstrap: t, children: e }) {
160
- const [n, r] = x("en"), [i, s] = x(null);
161
- B(() => {
162
- if (!t || !Xe(t)) return;
163
- const l = Ke(t);
164
- if (!l || l === n && i) return;
165
- let d = !1;
166
- return Je(l).then((u) => {
167
- d || (r(l), s(u));
157
+ return Q.set(r, n), n;
158
+ }
159
+ function et({ bootstrap: r, forceLocale: e, children: t }) {
160
+ const [n, i] = x("en"), [s, a] = x(null);
161
+ T(() => {
162
+ const p = (e && Ae(e) ? e : null) ?? (!r || !Je(r) ? null : Xe(r));
163
+ if (!p) {
164
+ (s !== null || n !== "en") && (i("en"), a(null));
165
+ return;
166
+ }
167
+ if (p === n && s) return;
168
+ let u = !1;
169
+ return Qe(p).then((h) => {
170
+ u || (i(p), a(h));
168
171
  }), () => {
169
- d = !0;
172
+ u = !0;
170
173
  };
171
- }, [t]);
172
- const a = {
174
+ }, [r, e]);
175
+ const l = {
173
176
  locale: n,
174
- t: i ? (l, d, u) => Ie(i[l] ?? d, u) : Se
177
+ t: s ? (d, p, u) => Le(s[d] ?? p, u) : Ce
175
178
  };
176
- return /* @__PURE__ */ o(Ce.Provider, { value: a, children: e });
179
+ return /* @__PURE__ */ o(Ie.Provider, { value: l, children: t });
177
180
  }
178
181
  function w() {
179
- return Fe(Ce);
182
+ return $e(Ie);
180
183
  }
181
184
  const pe = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
182
- function et({
183
- open: t,
185
+ function tt({
186
+ open: r,
184
187
  onClose: e,
185
- labelledBy: n,
186
- brandColor: r,
188
+ labelledBy: t,
189
+ brandColor: n,
187
190
  topBanner: i,
188
191
  allowClose: s = !0,
189
192
  hideCloseButton: a = !1,
190
193
  inline: l = !1,
191
194
  children: d
192
195
  }) {
193
- const { t: u } = w(), p = R(null), f = R(null);
194
- return B(() => {
195
- if (!t) return;
196
- f.current = document.activeElement ?? null;
197
- const k = p.current;
198
- k && (k.querySelector(pe) ?? k).focus({ preventScroll: !0 });
199
- const j = (v) => {
200
- if (v.key === "Escape") {
196
+ const { t: p } = w(), u = z(null), h = z(null);
197
+ return T(() => {
198
+ if (!r) return;
199
+ h.current = document.activeElement ?? null;
200
+ const g = u.current;
201
+ g && (g.querySelector(pe) ?? g).focus({ preventScroll: !0 });
202
+ const A = (k) => {
203
+ if (k.key === "Escape") {
201
204
  if (!s) return;
202
- v.stopPropagation(), e();
205
+ k.stopPropagation(), e();
203
206
  return;
204
207
  }
205
- if (v.key !== "Tab" || !p.current) return;
206
- const L = Array.from(
207
- p.current.querySelectorAll(pe)
208
- ).filter((M) => !M.hasAttribute("disabled") && M.tabIndex !== -1);
209
- if (L.length === 0) {
210
- v.preventDefault();
208
+ if (k.key !== "Tab" || !u.current) return;
209
+ const E = Array.from(
210
+ u.current.querySelectorAll(pe)
211
+ ).filter((R) => !R.hasAttribute("disabled") && R.tabIndex !== -1);
212
+ if (E.length === 0) {
213
+ k.preventDefault();
211
214
  return;
212
215
  }
213
- const C = L[0], P = L[L.length - 1], O = document.activeElement;
214
- v.shiftKey && O === C ? (v.preventDefault(), P.focus()) : !v.shiftKey && O === P && (v.preventDefault(), C.focus());
216
+ const I = E[0], O = E[E.length - 1], B = document.activeElement;
217
+ k.shiftKey && B === I ? (k.preventDefault(), O.focus()) : !k.shiftKey && B === O && (k.preventDefault(), I.focus());
215
218
  };
216
- document.addEventListener("keydown", j, !0);
217
- const T = document.body.style.overflow;
219
+ document.addEventListener("keydown", A, !0);
220
+ const M = document.body.style.overflow;
218
221
  return l || (document.body.style.overflow = "hidden"), () => {
219
- document.removeEventListener("keydown", j, !0), l || (document.body.style.overflow = T), f.current?.focus?.({ preventScroll: !0 });
222
+ document.removeEventListener("keydown", A, !0), l || (document.body.style.overflow = M), h.current?.focus?.({ preventScroll: !0 });
220
223
  };
221
- }, [t, e, s, l]), t ? /* @__PURE__ */ c(
224
+ }, [r, e, s, l]), r ? /* @__PURE__ */ c(
222
225
  "div",
223
226
  {
224
227
  class: `${l ? "absolute z-[1]" : "fixed z-[2147483647]"} inset-0 flex items-center justify-center bg-slate-950/50 p-2 sm:p-4 backdrop-blur-md animate-[pw-fade-in_180ms_ease-out]`,
225
- onClick: (k) => {
226
- s && k.target === k.currentTarget && e();
228
+ onClick: (g) => {
229
+ s && g.target === g.currentTarget && e();
227
230
  },
228
231
  "data-pw-root": !0,
229
232
  children: [
@@ -231,16 +234,16 @@ function et({
231
234
  "div",
232
235
  {
233
236
  class: "relative flex w-full max-w-[400px] flex-col animate-[pw-scale-in_220ms_cubic-bezier(0.16,1,0.3,1)]",
234
- style: { "--pw-accent": r ?? "#3b82f6" },
237
+ style: { "--pw-accent": n ?? "#3b82f6" },
235
238
  children: [
236
239
  i,
237
240
  /* @__PURE__ */ c(
238
241
  "div",
239
242
  {
240
- ref: p,
243
+ ref: u,
241
244
  role: "dialog",
242
245
  "aria-modal": "true",
243
- "aria-labelledby": n,
246
+ "aria-labelledby": t,
244
247
  tabIndex: -1,
245
248
  class: "relative flex max-h-[calc(100dvh-1rem)] sm:max-h-[calc(100dvh-2rem)] w-full flex-col overflow-hidden rounded-xl bg-white outline-none",
246
249
  style: {
@@ -253,7 +256,7 @@ function et({
253
256
  {
254
257
  type: "button",
255
258
  onClick: e,
256
- "aria-label": u("modal.close_aria", "Close"),
259
+ "aria-label": p("modal.close_aria", "Close"),
257
260
  class: "absolute right-3 top-3 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white/80 text-gray-500 backdrop-blur-sm transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
258
261
  children: /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o(
259
262
  "path",
@@ -283,8 +286,8 @@ function et({
283
286
  }
284
287
  ) : null;
285
288
  }
286
- function tt(t, e) {
287
- switch (t) {
289
+ function rt(r, e) {
290
+ switch (r) {
288
291
  case "google":
289
292
  return e("auth.continue_with_google", "Continue with Google");
290
293
  case "apple":
@@ -295,28 +298,62 @@ function tt(t, e) {
295
298
  return e("auth.continue_with_facebook", "Continue with Facebook");
296
299
  }
297
300
  }
298
- function Le({ block: t, ctx: e }) {
299
- const n = e.auth, r = e.authSession, i = t.allow_signup !== !1, s = t.allow_password_reset !== !1, a = t.hide_when_authenticated !== !1;
300
- if (!n)
301
+ function fe(r, e, t) {
302
+ const n = e === "signup" ? t("auth.signup_failed", "Sign-up failed") : t("auth.signin_failed", "Sign-in failed");
303
+ if (!(r instanceof j)) return n;
304
+ switch (r.code) {
305
+ case "invalid_credentials":
306
+ return t("auth.invalid_credentials", "Invalid email or password");
307
+ case "email_not_confirmed":
308
+ return t("auth.email_not_confirmed", "Please confirm your email before signing in.");
309
+ case "email_exists":
310
+ case "user_already_exists":
311
+ return t("auth.email_exists", "An account with this email already exists.");
312
+ case "weak_password":
313
+ return t("auth.weak_password", "Password is too weak.");
314
+ case "invalid_otp":
315
+ case "otp_expired":
316
+ case "token_expired":
317
+ return t("auth.invalid_otp", "The code is invalid or has expired.");
318
+ case "over_email_send_rate_limit":
319
+ case "over_request_rate_limit":
320
+ case "rate_limited":
321
+ case "http_429":
322
+ return t("auth.rate_limited", "Too many requests. Please try again in a moment.");
323
+ case "network_error":
324
+ return t("auth.network_error", "Network error. Please check your connection and try again.");
325
+ case "upstream":
326
+ case "upstream_error":
327
+ case "http_502":
328
+ case "http_503":
329
+ case "http_504":
330
+ return t("auth.service_unavailable", "Service is temporarily unavailable. Please try again.");
331
+ default:
332
+ return n;
333
+ }
334
+ }
335
+ function Ee({ block: r, ctx: e }) {
336
+ const t = e.auth, n = e.authSession, i = r.allow_signup !== !1, s = r.allow_password_reset !== !1, a = r.hide_when_authenticated !== !1;
337
+ if (!t)
301
338
  return typeof console < "u" && console.warn("[paywall] auth_panel rendered without AuthClient — pass `auth: true` to PaywallUI"), null;
302
- const l = r && !r.user.is_anonymous ? r : null;
303
- return l && a ? null : l ? /* @__PURE__ */ o(nt, { email: l.user.email ?? "", onSignOut: () => n.signOut().catch(() => {
339
+ const l = n && !n.user.is_anonymous ? n : null;
340
+ return l && a ? null : l ? /* @__PURE__ */ o(nt, { email: l.user.email ?? "", onSignOut: () => t.signOut().catch(() => {
304
341
  }) }) : /* @__PURE__ */ o(
305
- rt,
342
+ it,
306
343
  {
307
- block: t,
344
+ block: r,
308
345
  allowSignup: i,
309
346
  allowReset: s,
310
347
  ctx: e
311
348
  }
312
349
  );
313
350
  }
314
- function nt({ email: t, onSignOut: e }) {
315
- const { t: n } = w();
351
+ function nt({ email: r, onSignOut: e }) {
352
+ const { t } = w();
316
353
  return /* @__PURE__ */ c("div", { class: "flex items-center justify-between gap-3 rounded-2xl bg-gray-100 px-4 py-3", children: [
317
354
  /* @__PURE__ */ c("div", { class: "flex flex-col", children: [
318
- /* @__PURE__ */ o("span", { class: "text-[10px] font-semibold uppercase tracking-wider text-gray-500", children: n("auth.signed_in", "Signed in") }),
319
- /* @__PURE__ */ o("span", { class: "text-sm font-medium text-gray-900", children: t })
355
+ /* @__PURE__ */ o("span", { class: "text-[10px] font-semibold uppercase tracking-wider text-gray-500", children: t("auth.signed_in", "Signed in") }),
356
+ /* @__PURE__ */ o("span", { class: "text-sm font-medium text-gray-900", children: r })
320
357
  ] }),
321
358
  /* @__PURE__ */ o(
322
359
  "button",
@@ -324,19 +361,19 @@ function nt({ email: t, onSignOut: e }) {
324
361
  type: "button",
325
362
  onClick: e,
326
363
  class: "rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-600 transition-colors hover:bg-white hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
327
- children: n("auth.sign_out", "Sign out")
364
+ children: t("auth.sign_out", "Sign out")
328
365
  }
329
366
  )
330
367
  ] });
331
368
  }
332
- function rt({ block: t, allowSignup: e, allowReset: n, ctx: r }) {
333
- const { t: i } = w(), s = r.auth, a = t.providers ?? [], [l, d] = x("signin"), [u, p] = x(""), [f, b] = x(""), [h, y] = x(""), [k, j] = x(""), [T, v] = x(null), [L, C] = x(null), [P, O] = x(null), [M, q] = x(!1), [z, D] = x(null);
334
- B(() => {
369
+ function it({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
370
+ const { t: i } = w(), s = n.auth, a = r.providers ?? [], [l, d] = x("signin"), [p, u] = x(""), [h, b] = x(""), [_, f] = x(""), [g, A] = x(""), [M, k] = x(null), [E, I] = x(null), [O, B] = x(null), [R, q] = x(!1), [D, N] = x(null);
371
+ T(() => {
335
372
  if (typeof s.getLastLogin != "function") return;
336
373
  let S = !1;
337
374
  return s.getLastLogin().then(
338
- (E) => {
339
- S || !E || (D(E), E.email && p((F) => F === "" ? E.email : F));
375
+ (P) => {
376
+ S || !P || (N(P), P.email && u((V) => V === "" ? P.email : V));
340
377
  },
341
378
  () => {
342
379
  }
@@ -344,171 +381,168 @@ function rt({ block: t, allowSignup: e, allowReset: n, ctx: r }) {
344
381
  S = !0;
345
382
  };
346
383
  }, [s]);
347
- const A = (S) => {
348
- d(S), C(null), O(null), q(!1);
349
- }, I = async (S) => {
350
- if (S.preventDefault(), !T) {
351
- if (C(null), O(null), l === "signup" && !M) {
352
- if (!u.trim()) return;
384
+ const L = (S) => {
385
+ d(S), I(null), B(null), q(!1);
386
+ }, C = async (S) => {
387
+ if (S.preventDefault(), !M) {
388
+ if (I(null), B(null), l === "signup" && !R) {
389
+ if (!p.trim()) return;
353
390
  q(!0);
354
391
  return;
355
392
  }
356
- if (l === "signup" && f !== h) {
357
- C(i("auth.passwords_mismatch", "Passwords don't match"));
393
+ if (l === "signup" && h !== _) {
394
+ I(i("auth.passwords_mismatch", "Passwords don't match"));
358
395
  return;
359
396
  }
360
- v("email");
397
+ k("email");
361
398
  try {
362
- l === "signin" ? await s.signInWithEmail({ email: u, password: f }) : l === "signup" ? (await s.signUp({ email: u, password: f })).kind === "confirmation_required" && (d("reset_verify"), O(i("auth.check_email_message", "Check your email for a confirmation code."))) : l === "forgot" ? (await s.requestPasswordReset({ email: u }), d("reset_sent"), O(
399
+ l === "signin" ? await s.signInWithEmail({ email: p, password: h }) : l === "signup" ? (await s.signUp({ email: p, password: h })).kind === "confirmation_required" && (d("reset_verify"), B(i("auth.check_email_message", "Check your email for a confirmation code."))) : l === "forgot" ? (await s.requestPasswordReset({ email: p }), d("reset_sent"), B(
363
400
  i("auth.reset_sent_message", "If that email exists, a reset code has been sent.")
364
401
  )) : l === "reset_verify" && (await s.verifyOtp({
365
- email: u,
366
- token: k,
367
- type: f ? "recovery" : "email"
368
- }), f && await s.updatePassword({ password: f }));
369
- } catch (E) {
370
- const F = E instanceof U ? E.message : i("auth.generic_error", "Something went wrong");
371
- C(F);
402
+ email: p,
403
+ token: g,
404
+ type: h ? "recovery" : "email"
405
+ }), h && await s.updatePassword({ password: h }));
406
+ } catch (P) {
407
+ I(fe(P, l === "signup" ? "signup" : l === "reset_verify" ? "otp" : l === "forgot" ? "reset" : "signin", i));
372
408
  } finally {
373
- v(null);
409
+ k(null);
374
410
  }
375
411
  }
376
- }, m = async (S) => {
377
- if (!T) {
378
- v(S), C(null), O(null);
412
+ }, U = async (S) => {
413
+ if (!M) {
414
+ k(S), I(null), B(null);
379
415
  try {
380
416
  await s.signInWithOAuth({
381
417
  provider: S,
382
- onPopupOpened: () => v(null)
418
+ onPopupOpened: () => k(null)
383
419
  });
384
- } catch (E) {
385
- if (E instanceof U) {
386
- if (E.code === "oauth_cancelled" || E.code === "oauth_timeout") return;
387
- C(E.message);
388
- } else
389
- C(i("auth.signin_failed", "Sign-in failed"));
420
+ } catch (P) {
421
+ if (P instanceof j && (P.code === "oauth_cancelled" || P.code === "oauth_timeout"))
422
+ return;
423
+ I(fe(P, "signin", i));
390
424
  } finally {
391
- v(null);
425
+ k(null);
392
426
  }
393
427
  }
394
- }, g = a.length > 0 && (l === "signin" || l === "signup"), _ = l === "signin" || l === "signup" || l === "forgot", Z = l === "signin" || l === "signup" && M;
428
+ }, m = a.length > 0 && (l === "signin" || l === "signup"), y = l === "signin" || l === "signup" || l === "forgot", v = l === "signin" || l === "signup" && R;
395
429
  return /* @__PURE__ */ c("div", { class: "flex flex-col gap-5", children: [
396
- /* @__PURE__ */ o(it, { mode: l, customHeading: t.heading, customSubheading: t.subheading }),
397
- g ? /* @__PURE__ */ c("div", { class: "flex flex-col gap-2.5", children: [
430
+ /* @__PURE__ */ o(ot, { mode: l, customHeading: r.heading, customSubheading: r.subheading }),
431
+ m ? /* @__PURE__ */ c("div", { class: "flex flex-col gap-2.5", children: [
398
432
  a.map((S) => /* @__PURE__ */ c("div", { class: "relative", children: [
399
433
  /* @__PURE__ */ c(
400
434
  "button",
401
435
  {
402
436
  type: "button",
403
- onClick: () => m(S),
404
- disabled: T !== null,
437
+ onClick: () => U(S),
438
+ disabled: M !== null,
405
439
  class: "flex h-12 w-full items-center justify-center gap-2.5 rounded-full border-1 border-gray-200 bg-white px-5 text-base font-medium text-gray-900 transition-all hover:border-gray-300 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
406
440
  children: [
407
- T === S ? /* @__PURE__ */ o("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700" }) : /* @__PURE__ */ o(pt, { provider: S }),
408
- /* @__PURE__ */ o("span", { children: tt(S, i) })
441
+ M === S ? /* @__PURE__ */ o("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700" }) : /* @__PURE__ */ o(ft, { provider: S }),
442
+ /* @__PURE__ */ o("span", { children: rt(S, i) })
409
443
  ]
410
444
  }
411
445
  ),
412
- z?.method === S ? /* @__PURE__ */ o(ge, { email: z.email }) : null
446
+ D?.method === S ? /* @__PURE__ */ o(me, { email: D.email }) : null
413
447
  ] }, S)),
414
- /* @__PURE__ */ o(ht, {})
448
+ /* @__PURE__ */ o(pt, {})
415
449
  ] }) : null,
416
- /* @__PURE__ */ c("form", { onSubmit: I, class: "flex flex-col gap-3", children: [
417
- _ && /* @__PURE__ */ o(
418
- fe,
450
+ /* @__PURE__ */ c("form", { onSubmit: C, class: "flex flex-col gap-3", children: [
451
+ y && /* @__PURE__ */ o(
452
+ ge,
419
453
  {
420
454
  type: "email",
421
455
  placeholder: i("auth.email", "Email address"),
422
- value: u,
423
- onInput: p,
456
+ value: p,
457
+ onInput: u,
424
458
  autocomplete: "email",
425
459
  required: !0
426
460
  }
427
461
  ),
428
- Z && /* @__PURE__ */ o(
429
- Q,
462
+ v && /* @__PURE__ */ o(
463
+ ee,
430
464
  {
431
465
  placeholder: i("auth.password", "Password"),
432
- value: f,
466
+ value: h,
433
467
  onInput: b,
434
468
  autocomplete: l === "signin" ? "current-password" : "new-password",
435
469
  required: !0
436
470
  }
437
471
  ),
438
- l === "signup" && M && /* @__PURE__ */ o(
439
- Q,
472
+ l === "signup" && R && /* @__PURE__ */ o(
473
+ ee,
440
474
  {
441
475
  placeholder: i("auth.repeat_password", "Repeat password"),
442
- value: h,
443
- onInput: y,
476
+ value: _,
477
+ onInput: f,
444
478
  autocomplete: "new-password",
445
479
  required: !0
446
480
  }
447
481
  ),
448
- l === "reset_verify" && /* @__PURE__ */ c(W, { children: [
482
+ l === "reset_verify" && /* @__PURE__ */ c(Y, { children: [
449
483
  /* @__PURE__ */ o(
450
- fe,
484
+ ge,
451
485
  {
452
486
  type: "text",
453
487
  placeholder: i("auth.confirmation_code", "Confirmation code"),
454
- value: k,
455
- onInput: j,
488
+ value: g,
489
+ onInput: A,
456
490
  autocomplete: "one-time-code",
457
491
  inputMode: "numeric",
458
492
  required: !0
459
493
  }
460
494
  ),
461
495
  /* @__PURE__ */ o(
462
- Q,
496
+ ee,
463
497
  {
464
498
  placeholder: i(
465
499
  "auth.new_password_optional",
466
500
  "New password (optional — only for password reset)"
467
501
  ),
468
- value: f,
502
+ value: h,
469
503
  onInput: b,
470
504
  autocomplete: "new-password"
471
505
  }
472
506
  )
473
507
  ] }),
474
- l === "reset_sent" && P && /* @__PURE__ */ o("p", { class: "rounded-2xl bg-gray-100 px-4 py-3 text-sm text-gray-600", children: P }),
475
- l === "signin" && n && /* @__PURE__ */ o("div", { class: "flex justify-end text-sm", children: /* @__PURE__ */ o(G, { onClick: () => A("forgot"), children: i("auth.forgot_password", "Forgot password?") }) }),
476
- L && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: L }),
477
- P && l !== "reset_sent" && /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: P }),
508
+ l === "reset_sent" && O && /* @__PURE__ */ o("p", { class: "rounded-2xl bg-gray-100 px-4 py-3 text-sm text-gray-600", children: O }),
509
+ l === "signin" && t && /* @__PURE__ */ o("div", { class: "flex justify-end text-sm", children: /* @__PURE__ */ o(Z, { onClick: () => L("forgot"), children: i("auth.forgot_password", "Forgot password?") }) }),
510
+ E && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: E }),
511
+ O && l !== "reset_sent" && /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: O }),
478
512
  l !== "reset_sent" && /* @__PURE__ */ c("div", { class: "relative", children: [
479
513
  /* @__PURE__ */ o(
480
- lt,
514
+ ct,
481
515
  {
482
- busy: T === "email",
483
- label: st(l, M, t.submit_label ?? t.heading, i)
516
+ busy: M === "email",
517
+ label: at(l, R, r.submit_label ?? r.heading, i)
484
518
  }
485
519
  ),
486
- l === "signin" && z?.method === "email" ? /* @__PURE__ */ o(ge, { email: z.email }) : null
520
+ l === "signin" && D?.method === "email" ? /* @__PURE__ */ o(me, { email: D.email }) : null
487
521
  ] })
488
522
  ] }),
489
523
  /* @__PURE__ */ o(
490
- at,
524
+ lt,
491
525
  {
492
526
  mode: l,
493
527
  allowSignup: e,
494
- onSwitch: A
528
+ onSwitch: L
495
529
  }
496
530
  )
497
531
  ] });
498
532
  }
499
- function it({
500
- mode: t,
533
+ function ot({
534
+ mode: r,
501
535
  customHeading: e,
502
- customSubheading: n
536
+ customSubheading: t
503
537
  }) {
504
- const { t: r } = w(), i = ot(t, r), s = t === "signin" || t === "signup", a = s && e ? e : i.title, l = s && n !== void 0 ? n || null : i.subtitle;
538
+ const { t: n } = w(), i = st(r, n), s = r === "signin" || r === "signup", a = s && e ? e : i.title, l = s && t !== void 0 ? t || null : i.subtitle;
505
539
  return /* @__PURE__ */ c("div", { class: "flex flex-col gap-2", children: [
506
540
  /* @__PURE__ */ o("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: a }),
507
541
  l ? /* @__PURE__ */ o("p", { class: "text-base leading-relaxed text-gray-600", children: l }) : null
508
542
  ] });
509
543
  }
510
- function ot(t, e) {
511
- switch (t) {
544
+ function st(r, e) {
545
+ switch (r) {
512
546
  case "signin":
513
547
  return {
514
548
  title: e("auth.welcome", "Welcome back!"),
@@ -542,79 +576,79 @@ function ot(t, e) {
542
576
  };
543
577
  }
544
578
  }
545
- function st(t, e, n, r) {
546
- if (t === "signin" && n) return n;
547
- switch (t) {
579
+ function at(r, e, t, n) {
580
+ if (r === "signin" && t) return t;
581
+ switch (r) {
548
582
  case "signin":
549
- return r("auth.log_in", "Sign In");
583
+ return n("auth.log_in", "Sign In");
550
584
  case "signup":
551
- return e ? r("auth.create_account", "Create Account") : r("auth.sign_up", "Sign Up");
585
+ return e ? n("auth.create_account", "Create Account") : n("auth.sign_up", "Sign Up");
552
586
  case "forgot":
553
- return r("auth.send_reset", "Send Reset Email");
587
+ return n("auth.send_reset", "Send Reset Email");
554
588
  case "reset_verify":
555
- return r("auth.verify", "Verify");
589
+ return n("auth.verify", "Verify");
556
590
  default:
557
- return r("cta.continue", "Continue");
591
+ return n("cta.continue", "Continue");
558
592
  }
559
593
  }
560
- function at({
561
- mode: t,
594
+ function lt({
595
+ mode: r,
562
596
  allowSignup: e,
563
- onSwitch: n
597
+ onSwitch: t
564
598
  }) {
565
- const { t: r } = w();
566
- return t === "signin" && e ? /* @__PURE__ */ c("p", { class: "text-center text-sm text-gray-600", children: [
567
- r("auth.no_account", "Don't have an account?"),
599
+ const { t: n } = w();
600
+ return r === "signin" && e ? /* @__PURE__ */ c("p", { class: "text-center text-sm text-gray-600", children: [
601
+ n("auth.no_account", "Don't have an account?"),
568
602
  " ",
569
- /* @__PURE__ */ o(G, { onClick: () => n("signup"), children: r("auth.sign_up_link", "Sign Up") })
570
- ] }) : t === "signup" ? /* @__PURE__ */ c("p", { class: "text-center text-sm text-gray-600", children: [
571
- r("auth.have_account", "Already have an account?"),
603
+ /* @__PURE__ */ o(Z, { onClick: () => t("signup"), children: n("auth.sign_up_link", "Sign Up") })
604
+ ] }) : r === "signup" ? /* @__PURE__ */ c("p", { class: "text-center text-sm text-gray-600", children: [
605
+ n("auth.have_account", "Already have an account?"),
572
606
  " ",
573
- /* @__PURE__ */ o(G, { onClick: () => n("signin"), children: r("auth.log_in_link", "Log In") })
574
- ] }) : t === "forgot" || t === "reset_sent" || t === "reset_verify" ? /* @__PURE__ */ c("p", { class: "text-center text-sm text-gray-600", children: [
575
- r("auth.no_account", "Don't have an account?"),
607
+ /* @__PURE__ */ o(Z, { onClick: () => t("signin"), children: n("auth.log_in_link", "Log In") })
608
+ ] }) : r === "forgot" || r === "reset_sent" || r === "reset_verify" ? /* @__PURE__ */ c("p", { class: "text-center text-sm text-gray-600", children: [
609
+ n("auth.no_account", "Don't have an account?"),
576
610
  " ",
577
- /* @__PURE__ */ o(G, { onClick: () => n("signup"), children: r("auth.sign_up_link", "Sign Up") })
611
+ /* @__PURE__ */ o(Z, { onClick: () => t("signup"), children: n("auth.sign_up_link", "Sign Up") })
578
612
  ] }) : null;
579
613
  }
580
- function G({
581
- onClick: t,
614
+ function Z({
615
+ onClick: r,
582
616
  children: e
583
617
  }) {
584
618
  return /* @__PURE__ */ o(
585
619
  "button",
586
620
  {
587
621
  type: "button",
588
- onClick: t,
622
+ onClick: r,
589
623
  class: "font-semibold transition-opacity hover:opacity-80 focus:outline-none focus-visible:opacity-80",
590
624
  style: { color: "var(--pw-accent)" },
591
625
  children: e
592
626
  }
593
627
  );
594
628
  }
595
- function lt({ busy: t, label: e }) {
629
+ function ct({ busy: r, label: e }) {
596
630
  return /* @__PURE__ */ o(
597
631
  "button",
598
632
  {
599
633
  type: "submit",
600
- disabled: t,
634
+ disabled: r,
601
635
  class: "pw-cta-shimmer relative mt-1 flex min-h-12 w-full items-center justify-center overflow-hidden rounded-3xl px-5 py-2 text-center text-base font-semibold leading-tight text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
602
636
  style: {
603
637
  background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",
604
638
  boxShadow: "0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"
605
639
  },
606
- children: t ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: e })
640
+ children: r ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: e })
607
641
  }
608
642
  );
609
643
  }
610
- function fe({ type: t, placeholder: e, value: n, onInput: r, autocomplete: i, inputMode: s, required: a }) {
644
+ function ge({ type: r, placeholder: e, value: t, onInput: n, autocomplete: i, inputMode: s, required: a }) {
611
645
  return /* @__PURE__ */ o(
612
646
  "input",
613
647
  {
614
- type: t,
615
- value: n,
648
+ type: r,
649
+ value: t,
616
650
  placeholder: e,
617
- onInput: (l) => r(l.target.value),
651
+ onInput: (l) => n(l.target.value),
618
652
  autocomplete: i,
619
653
  inputMode: s,
620
654
  required: a,
@@ -622,13 +656,13 @@ function fe({ type: t, placeholder: e, value: n, onInput: r, autocomplete: i, in
622
656
  }
623
657
  );
624
658
  }
625
- function Q({ placeholder: t, value: e, onInput: n, autocomplete: r, required: i }) {
626
- const { t: s } = w(), [a, l] = x(!1), d = R(null);
627
- B(() => {
628
- const f = d.current;
629
- f && f.value !== e && (f.value = e);
659
+ function ee({ placeholder: r, value: e, onInput: t, autocomplete: n, required: i }) {
660
+ const { t: s } = w(), [a, l] = x(!1), d = z(null);
661
+ T(() => {
662
+ const h = d.current;
663
+ h && h.value !== e && (h.value = e);
630
664
  }, [a, e]);
631
- const u = s("auth.show_password", "Show password"), p = s("auth.hide_password", "Hide password");
665
+ const p = s("auth.show_password", "Show password"), u = s("auth.hide_password", "Hide password");
632
666
  return /* @__PURE__ */ c("div", { class: "relative", children: [
633
667
  /* @__PURE__ */ o(
634
668
  "input",
@@ -636,9 +670,9 @@ function Q({ placeholder: t, value: e, onInput: n, autocomplete: r, required: i
636
670
  ref: d,
637
671
  type: a ? "text" : "password",
638
672
  value: e,
639
- placeholder: t,
640
- onInput: (f) => n(f.target.value),
641
- autocomplete: r,
673
+ placeholder: r,
674
+ onInput: (h) => t(h.target.value),
675
+ autocomplete: n,
642
676
  required: i,
643
677
  class: "h-14 w-full rounded-2xl bg-gray-100 pl-5 pr-12 text-base text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"
644
678
  }
@@ -647,16 +681,16 @@ function Q({ placeholder: t, value: e, onInput: n, autocomplete: r, required: i
647
681
  "button",
648
682
  {
649
683
  type: "button",
650
- onClick: () => l((f) => !f),
651
- "aria-label": a ? p : u,
684
+ onClick: () => l((h) => !h),
685
+ "aria-label": a ? u : p,
652
686
  tabIndex: -1,
653
687
  class: "absolute right-4 top-1/2 -translate-y-1/2 flex h-6 w-6 items-center justify-center rounded text-gray-500 transition-colors hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
654
- children: a ? /* @__PURE__ */ o(ut, {}) : /* @__PURE__ */ o(ct, {})
688
+ children: a ? /* @__PURE__ */ o(dt, {}) : /* @__PURE__ */ o(ut, {})
655
689
  }
656
690
  )
657
691
  ] });
658
692
  }
659
- function ct() {
693
+ function ut() {
660
694
  return /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
661
695
  /* @__PURE__ */ o(
662
696
  "path",
@@ -671,7 +705,7 @@ function ct() {
671
705
  /* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "2.5", stroke: "currentColor", "stroke-width": "1.5" })
672
706
  ] });
673
707
  }
674
- function ut() {
708
+ function dt() {
675
709
  return /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
676
710
  /* @__PURE__ */ o(
677
711
  "path",
@@ -695,40 +729,40 @@ function ut() {
695
729
  )
696
730
  ] });
697
731
  }
698
- function ge({ email: t }) {
699
- const { t: e } = w(), n = t ? e("auth.last_used", "Last · {email}", { email: dt(t) }) : e("auth.last_used_no_email", "Last");
700
- return /* @__PURE__ */ o("span", { class: "pointer-events-none absolute -top-2 right-3 max-w-[75%] truncate rounded-full bg-gray-900 px-2 py-0.5 text-[10px] font-semibold tracking-wide text-white shadow-sm", children: n });
732
+ function me({ email: r }) {
733
+ const { t: e } = w(), t = r ? e("auth.last_used", "Last · {email}", { email: ht(r) }) : e("auth.last_used_no_email", "Last");
734
+ return /* @__PURE__ */ o("span", { class: "pointer-events-none absolute -top-2 right-3 max-w-[75%] truncate rounded-full bg-gray-900 px-2 py-0.5 text-[10px] font-semibold tracking-wide text-white shadow-sm", children: t });
701
735
  }
702
- function dt(t) {
703
- const [e, n] = t.split("@");
704
- return n ? `${e.slice(0, 3)}*****@${n}` : t;
736
+ function ht(r) {
737
+ const [e, t] = r.split("@");
738
+ return t ? `${e.slice(0, 3)}*****@${t}` : r;
705
739
  }
706
- function ht() {
707
- const { t } = w();
740
+ function pt() {
741
+ const { t: r } = w();
708
742
  return /* @__PURE__ */ c("div", { class: "flex items-center gap-3 py-1 text-sm text-gray-400", children: [
709
743
  /* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gray-200" }),
710
- /* @__PURE__ */ o("span", { children: t("auth.or", "or") }),
744
+ /* @__PURE__ */ o("span", { children: r("auth.or", "or") }),
711
745
  /* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gray-200" })
712
746
  ] });
713
747
  }
714
- function pt({ provider: t }) {
715
- return t === "google" ? /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 18 18", "aria-hidden": "true", children: [
748
+ function ft({ provider: r }) {
749
+ return r === "google" ? /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 18 18", "aria-hidden": "true", children: [
716
750
  /* @__PURE__ */ o("path", { fill: "#4285F4", d: "M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.49h4.84a4.14 4.14 0 0 1-1.79 2.71v2.26h2.9c1.7-1.56 2.69-3.87 2.69-6.62Z" }),
717
751
  /* @__PURE__ */ o("path", { fill: "#34A853", d: "M9 18c2.43 0 4.47-.8 5.96-2.18l-2.9-2.26c-.8.54-1.83.86-3.06.86-2.36 0-4.36-1.59-5.07-3.74H.92v2.33A9 9 0 0 0 9 18Z" }),
718
752
  /* @__PURE__ */ o("path", { fill: "#FBBC05", d: "M3.93 10.68a5.4 5.4 0 0 1 0-3.36V4.99H.92a9 9 0 0 0 0 8.02l3-2.33Z" }),
719
753
  /* @__PURE__ */ o("path", { fill: "#EA4335", d: "M9 3.58c1.32 0 2.5.45 3.44 1.34l2.58-2.58A9 9 0 0 0 .92 4.99l3.01 2.33C4.64 5.17 6.64 3.58 9 3.58Z" })
720
- ] }) : t === "apple" ? (
754
+ ] }) : r === "apple" ? (
721
755
  // viewBox 0 0 24 24 даёт воздух сверху/снизу пути, поэтому визуально
722
756
  // Apple-яблоко выглядит меньше Google. Компенсируем увеличенным
723
757
  // width/height — 26×26 даёт примерно equal optical size с Google 20×20.
724
758
  /* @__PURE__ */ o("svg", { width: "26", height: "26", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("path", { d: "M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z" }) })
725
- ) : t === "github" ? /* @__PURE__ */ o("svg", { width: "20", height: "20", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("path", { d: "M8 0C3.6 0 0 3.6 0 8a8 8 0 0 0 5.5 7.6c.4.1.5-.2.5-.4v-1.5c-2.2.5-2.7-1-2.7-1-.4-.9-.9-1.2-.9-1.2-.7-.5.1-.5.1-.5.8.1 1.2.8 1.2.8.7 1.2 1.9.9 2.4.7 0-.5.3-.9.5-1.1-1.8-.2-3.6-.9-3.6-4 0-.9.3-1.6.8-2.1-.1-.2-.4-1 .1-2.1 0 0 .7-.2 2.2.8a7.6 7.6 0 0 1 4 0c1.5-1 2.2-.8 2.2-.8.4 1.1.2 1.9.1 2.1.5.5.8 1.2.8 2.1 0 3.1-1.9 3.7-3.6 3.9.3.3.6.8.6 1.6V15c0 .2.1.5.6.4A8 8 0 0 0 16 8c0-4.4-3.6-8-8-8Z" }) }) : /* @__PURE__ */ o("svg", { width: "18", height: "20", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("path", { d: "M14 2.7C14 1.2 12.8 0 11.3 0H2.7C1.2 0 0 1.2 0 2.7v10.6C0 14.8 1.2 16 2.7 16h4V9.8H4.7v-2H6.7V6.4c0-2 1.2-3.1 3-3.1.9 0 1.7.1 2 .2V5h-1.4c-.8 0-1 .4-1 1v1.5h2.4l-.3 2H9.3V16h2c1.5 0 2.7-1.2 2.7-2.7V2.7Z" }) });
759
+ ) : r === "github" ? /* @__PURE__ */ o("svg", { width: "20", height: "20", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("path", { d: "M8 0C3.6 0 0 3.6 0 8a8 8 0 0 0 5.5 7.6c.4.1.5-.2.5-.4v-1.5c-2.2.5-2.7-1-2.7-1-.4-.9-.9-1.2-.9-1.2-.7-.5.1-.5.1-.5.8.1 1.2.8 1.2.8.7 1.2 1.9.9 2.4.7 0-.5.3-.9.5-1.1-1.8-.2-3.6-.9-3.6-4 0-.9.3-1.6.8-2.1-.1-.2-.4-1 .1-2.1 0 0 .7-.2 2.2.8a7.6 7.6 0 0 1 4 0c1.5-1 2.2-.8 2.2-.8.4 1.1.2 1.9.1 2.1.5.5.8 1.2.8 2.1 0 3.1-1.9 3.7-3.6 3.9.3.3.6.8.6 1.6V15c0 .2.1.5.6.4A8 8 0 0 0 16 8c0-4.4-3.6-8-8-8Z" }) }) : /* @__PURE__ */ o("svg", { width: "18", height: "20", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("path", { d: "M14 2.7C14 1.2 12.8 0 11.3 0H2.7C1.2 0 0 1.2 0 2.7v10.6C0 14.8 1.2 16 2.7 16h4V9.8H4.7v-2H6.7V6.4c0-2 1.2-3.1 3-3.1.9 0 1.7.1 2 .2V5h-1.4c-.8 0-1 .4-1 1v1.5h2.4l-.3 2H9.3V16h2c1.5 0 2.7-1.2 2.7-2.7V2.7Z" }) });
726
760
  }
727
- function ft({
728
- block: t,
761
+ function gt({
762
+ block: r,
729
763
  bootstrap: e,
730
- auth: n,
731
- authSession: r,
764
+ auth: t,
765
+ authSession: n,
732
766
  onBack: i,
733
767
  showBack: s = !0,
734
768
  intent: a = "preauth"
@@ -740,17 +774,17 @@ function ft({
740
774
  },
741
775
  onAction: () => {
742
776
  },
743
- auth: n,
744
- authSession: r
745
- }, u = a === "restore" ? {
746
- ...t,
777
+ auth: t,
778
+ authSession: n
779
+ }, p = a === "restore" ? {
780
+ ...r,
747
781
  heading: l("auth.restore_purchases_heading", "Restore Purchases"),
748
782
  subheading: l(
749
783
  "auth.restore_purchases_subheading",
750
784
  "Please sign in to restore your purchases."
751
785
  )
752
786
  } : a === "preauth" ? {
753
- ...t,
787
+ ...r,
754
788
  heading: l("auth.login_continue_purchase", "Log in to continue your purchase"),
755
789
  subheading: l(
756
790
  "auth.link_purchase_subheading",
@@ -761,18 +795,18 @@ function ft({
761
795
  // чтобы продолжить покупку") в pill-кнопку h-12 не помещаются и
762
796
  // переносятся на 2 строки. Явный короткий submit_label решает.
763
797
  submit_label: l("auth.log_in", "Sign In")
764
- } : t;
798
+ } : r;
765
799
  return /* @__PURE__ */ c("div", { class: "relative flex-1 min-h-0 overflow-y-auto p-6 sm:p-8", children: [
766
- s ? /* @__PURE__ */ o(gt, { onClick: i, ariaLabel: l("nav.back_aria", "Back") }) : null,
767
- /* @__PURE__ */ o(Le, { block: u, ctx: d })
800
+ s ? /* @__PURE__ */ o(mt, { onClick: i, ariaLabel: l("nav.back_aria", "Back") }) : null,
801
+ /* @__PURE__ */ o(Ee, { block: p, ctx: d })
768
802
  ] });
769
803
  }
770
- function gt({ onClick: t, ariaLabel: e }) {
804
+ function mt({ onClick: r, ariaLabel: e }) {
771
805
  return /* @__PURE__ */ o(
772
806
  "button",
773
807
  {
774
808
  type: "button",
775
- onClick: t,
809
+ onClick: r,
776
810
  "aria-label": e,
777
811
  class: "absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
778
812
  children: /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
@@ -800,40 +834,40 @@ function gt({ onClick: t, ariaLabel: e }) {
800
834
  }
801
835
  );
802
836
  }
803
- function mt({
804
- auth: t,
837
+ function yt({
838
+ auth: r,
805
839
  onSuccess: e,
806
- onBack: n,
807
- heading: r,
840
+ onBack: t,
841
+ heading: n,
808
842
  description: i
809
843
  }) {
810
- const { t: s } = w(), a = r ?? s("anon.heading_default", "Continue as guest"), l = i ?? s("anon.description_default", "Setting up your guest session…"), [d, u] = x({ kind: "signing-in" }), p = R(!0);
811
- B(() => () => {
812
- p.current = !1;
844
+ const { t: s } = w(), a = n ?? s("anon.heading_default", "Continue as guest"), l = i ?? s("anon.description_default", "Setting up your guest session…"), [d, p] = x({ kind: "signing-in" }), u = z(!0);
845
+ T(() => () => {
846
+ u.current = !1;
813
847
  }, []);
814
- const f = () => {
815
- u({ kind: "signing-in" }), (async () => {
848
+ const h = () => {
849
+ p({ kind: "signing-in" }), (async () => {
816
850
  try {
817
- const b = await t.signInAnonymously();
818
- if (!p.current) return;
851
+ const b = await r.signInAnonymously();
852
+ if (!u.current) return;
819
853
  e(b);
820
854
  } catch (b) {
821
- if (!p.current) return;
822
- u({
855
+ if (!u.current) return;
856
+ p({
823
857
  kind: "error",
824
858
  message: b instanceof Error ? b.message : "Anonymous sign-in failed"
825
859
  });
826
860
  }
827
861
  })();
828
862
  };
829
- return B(() => {
830
- f();
863
+ return T(() => {
864
+ h();
831
865
  }, []), /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
832
- n ? /* @__PURE__ */ o(
866
+ t ? /* @__PURE__ */ o(
833
867
  "button",
834
868
  {
835
869
  type: "button",
836
- onClick: n,
870
+ onClick: t,
837
871
  class: "-ml-1 self-start rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
838
872
  children: s("nav.back", "← Back")
839
873
  }
@@ -842,14 +876,14 @@ function mt({
842
876
  /* @__PURE__ */ o("h2", { class: "text-xl font-semibold text-gray-900", children: a }),
843
877
  /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: l })
844
878
  ] }),
845
- d.kind === "signing-in" ? /* @__PURE__ */ o("div", { class: "flex items-center justify-center py-6", children: /* @__PURE__ */ o(yt, {}) }) : null,
879
+ d.kind === "signing-in" ? /* @__PURE__ */ o("div", { class: "flex items-center justify-center py-6", children: /* @__PURE__ */ o(xt, {}) }) : null,
846
880
  d.kind === "error" ? /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
847
881
  /* @__PURE__ */ o("div", { class: "rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700", children: d.message }),
848
882
  /* @__PURE__ */ o(
849
883
  "button",
850
884
  {
851
885
  type: "button",
852
- onClick: f,
886
+ onClick: h,
853
887
  class: "self-start rounded-md bg-[var(--pw-accent)] px-3 py-1.5 text-sm font-medium text-white hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)] focus-visible:ring-offset-2",
854
888
  children: s("anon.try_again", "Try again")
855
889
  }
@@ -857,15 +891,15 @@ function mt({
857
891
  ] }) : null
858
892
  ] });
859
893
  }
860
- function yt() {
894
+ function xt() {
861
895
  return /* @__PURE__ */ c("svg", { class: "h-5 w-5 animate-spin text-[var(--pw-accent)]", viewBox: "0 0 24 24", fill: "none", children: [
862
896
  /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "3", "stroke-opacity": "0.2" }),
863
897
  /* @__PURE__ */ o("path", { d: "M22 12a10 10 0 0 0-10-10", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round" })
864
898
  ] });
865
899
  }
866
- const Ae = (t) => `pw-offer-${t}-start`;
867
- function ee(t) {
868
- const e = t - Date.now();
900
+ const Pe = (r) => `pw-offer-${r}-start`;
901
+ function te(r) {
902
+ const e = r - Date.now();
869
903
  return e <= 0 ? { days: 0, hours: 0, minutes: 0, seconds: 0, expired: !0 } : {
870
904
  days: Math.floor(e / (1e3 * 60 * 60 * 24)),
871
905
  hours: Math.floor(e % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)),
@@ -874,56 +908,56 @@ function ee(t) {
874
908
  expired: !1
875
909
  };
876
910
  }
877
- function xt(t) {
878
- if (t.expires_at) {
879
- const e = Date.parse(t.expires_at);
911
+ function bt(r) {
912
+ if (r.expires_at) {
913
+ const e = Date.parse(r.expires_at);
880
914
  return Number.isFinite(e) ? e : null;
881
915
  }
882
- if (t.duration_minutes && t.duration_minutes > 0) {
916
+ if (r.duration_minutes && r.duration_minutes > 0) {
883
917
  if (typeof window > "u") return null;
884
918
  try {
885
- const e = Ae(t.id);
886
- let n = window.localStorage.getItem(e);
887
- return n || (n = (/* @__PURE__ */ new Date()).toISOString(), window.localStorage.setItem(e, n)), Date.parse(n) + t.duration_minutes * 6e4;
919
+ const e = Pe(r.id);
920
+ let t = window.localStorage.getItem(e);
921
+ return t || (t = (/* @__PURE__ */ new Date()).toISOString(), window.localStorage.setItem(e, t)), Date.parse(t) + r.duration_minutes * 6e4;
888
922
  } catch {
889
923
  return null;
890
924
  }
891
925
  }
892
926
  return null;
893
927
  }
894
- function Ee(t, e) {
895
- if (!t || t.length === 0) return null;
928
+ function Te(r, e) {
929
+ if (!r || r.length === 0) return null;
896
930
  if (e) {
897
- const n = t.find((r) => r.id === e);
898
- if (n) return n;
931
+ const t = r.find((n) => n.id === e);
932
+ if (t) return t;
899
933
  }
900
- return t.find((n) => n.expires_at || n.duration_minutes) ?? null;
934
+ return r.find((t) => t.expires_at || t.duration_minutes) ?? null;
901
935
  }
902
- function Te(t) {
903
- const e = t ? xt(t) : null, [n, r] = x(
904
- () => e !== null ? ee(e) : null
905
- ), i = R(e);
906
- return i.current = e, B(() => {
936
+ function Me(r) {
937
+ const e = r ? bt(r) : null, [t, n] = x(
938
+ () => e !== null ? te(e) : null
939
+ ), i = z(e);
940
+ return i.current = e, T(() => {
907
941
  if (e === null) {
908
- r(null);
942
+ n(null);
909
943
  return;
910
944
  }
911
- r(ee(e));
945
+ n(te(e));
912
946
  const s = setInterval(() => {
913
- const a = ee(i.current ?? 0);
914
- if (r(a), a.expired && (clearInterval(s), t?.duration_minutes && typeof window < "u"))
947
+ const a = te(i.current ?? 0);
948
+ if (n(a), a.expired && (clearInterval(s), r?.duration_minutes && typeof window < "u"))
915
949
  try {
916
- window.localStorage.removeItem(Ae(t.id));
950
+ window.localStorage.removeItem(Pe(r.id));
917
951
  } catch {
918
952
  }
919
953
  }, 1e3);
920
954
  return () => clearInterval(s);
921
- }, [e, t?.duration_minutes, t?.id]), n;
955
+ }, [e, r?.duration_minutes, r?.id]), t;
922
956
  }
923
- function bt({ block: t, ctx: e }) {
924
- const { t: n } = w(), r = Ee(e.bootstrap.offers, t.offer_id), i = Te(r);
925
- if (!r || i === null || i.expired && !t.force) return null;
926
- const s = t.title ?? r.label ?? n("offer.limited_time", "Limited-time offer"), a = r.discount_percent ? `${s} ${r.discount_percent}%` : s;
957
+ function wt({ block: r, ctx: e }) {
958
+ const { t } = w(), n = Te(e.bootstrap.offers, r.offer_id), i = Me(n);
959
+ if (!n || i === null || i.expired && !r.force) return null;
960
+ const s = r.title ?? n.label ?? t("offer.limited_time", "Limited-time offer"), a = n.discount_percent ? `${s} ${n.discount_percent}%` : s;
927
961
  return /* @__PURE__ */ c(
928
962
  "div",
929
963
  {
@@ -934,34 +968,34 @@ function bt({ block: t, ctx: e }) {
934
968
  },
935
969
  role: "status",
936
970
  children: [
937
- /* @__PURE__ */ o(Me, {}),
971
+ /* @__PURE__ */ o(Oe, {}),
938
972
  /* @__PURE__ */ o("span", { children: a }),
939
- /* @__PURE__ */ o(Be, { value: i, t: n })
973
+ /* @__PURE__ */ o(Be, { value: i, t })
940
974
  ]
941
975
  }
942
976
  );
943
977
  }
944
- function Be({ value: t, t: e }) {
978
+ function Be({ value: r, t: e }) {
945
979
  return /* @__PURE__ */ c("div", { class: "flex items-center gap-1 font-mono text-sm", children: [
946
- t.days > 0 ? /* @__PURE__ */ c(W, { children: [
947
- /* @__PURE__ */ o(V, { children: String(t.days) }),
980
+ r.days > 0 ? /* @__PURE__ */ c(Y, { children: [
981
+ /* @__PURE__ */ o($, { children: String(r.days) }),
948
982
  /* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.d", "d") })
949
983
  ] }) : null,
950
- /* @__PURE__ */ o(V, { children: String(t.hours).padStart(2, "0") }),
984
+ /* @__PURE__ */ o($, { children: String(r.hours).padStart(2, "0") }),
951
985
  /* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.h", "h") }),
952
- /* @__PURE__ */ o(V, { children: String(t.minutes).padStart(2, "0") }),
986
+ /* @__PURE__ */ o($, { children: String(r.minutes).padStart(2, "0") }),
953
987
  /* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.m", "m") }),
954
- /* @__PURE__ */ o(V, { children: String(t.seconds).padStart(2, "0") }),
988
+ /* @__PURE__ */ o($, { children: String(r.seconds).padStart(2, "0") }),
955
989
  /* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.s", "s") })
956
990
  ] });
957
991
  }
958
- function V({ children: t }) {
959
- return /* @__PURE__ */ o("span", { class: "rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold", children: t });
992
+ function $({ children: r }) {
993
+ return /* @__PURE__ */ o("span", { class: "rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold", children: r });
960
994
  }
961
- function wt({ offer: t }) {
962
- const { t: e } = w(), n = Te(t);
963
- if (n === null || n.expired) return null;
964
- const r = t.label ?? e("offer.limited_time", "Limited-time offer"), i = t.discount_percent ? `${r} ${t.discount_percent}%` : r;
995
+ function kt({ offer: r }) {
996
+ const { t: e } = w(), t = Me(r);
997
+ if (t === null || t.expired) return null;
998
+ const n = r.label ?? e("offer.limited_time", "Limited-time offer"), i = r.discount_percent ? `${n} ${r.discount_percent}%` : n;
965
999
  return /* @__PURE__ */ c(
966
1000
  "div",
967
1001
  {
@@ -972,14 +1006,14 @@ function wt({ offer: t }) {
972
1006
  },
973
1007
  role: "status",
974
1008
  children: [
975
- /* @__PURE__ */ o(Me, {}),
1009
+ /* @__PURE__ */ o(Oe, {}),
976
1010
  /* @__PURE__ */ o("span", { children: i }),
977
- /* @__PURE__ */ o(Be, { value: n, t: e })
1011
+ /* @__PURE__ */ o(Be, { value: t, t: e })
978
1012
  ]
979
1013
  }
980
1014
  );
981
1015
  }
982
- function Me() {
1016
+ function Oe() {
983
1017
  return /* @__PURE__ */ o(
984
1018
  "svg",
985
1019
  {
@@ -998,42 +1032,42 @@ function Me() {
998
1032
  }
999
1033
  );
1000
1034
  }
1001
- const te = 3, ne = 200, re = 5e3, ie = 5, kt = 10 * 1024 * 1024, me = ["image/jpeg", "image/png", "image/webp"], ye = /.+@.+\..+/;
1002
- function vt({ client: t, authSession: e, origin: n, onBack: r }) {
1003
- const { t: i } = w(), s = e?.user.email ?? "", a = s || null, [l, d] = x(s), [u, p] = x(""), [f, b] = x(""), [h, y] = x([]), [k, j] = x(!1), [T, v] = x(null), [L, C] = x({}), P = ve(() => {
1004
- const A = (a ?? l).trim().toLowerCase(), I = u.trim(), m = f.trim();
1005
- return ye.test(A) && I.length >= te && I.length <= ne && m.length >= 1 && m.length <= re;
1006
- }, [a, l, u, f]), O = () => {
1007
- const A = {}, I = (a ?? l).trim(), m = u.trim(), g = f.trim();
1008
- return I ? ye.test(I.toLowerCase()) || (A.email = i("support.invalid_email", "Invalid email")) : A.email = i("support.required", "Required"), (m.length < te || m.length > ne) && (A.subject = i("support.subject_length", "{min}–{max} characters", {
1009
- min: te,
1035
+ const re = 3, ne = 200, ie = 5e3, oe = 5, vt = 10 * 1024 * 1024, ye = ["image/jpeg", "image/png", "image/webp"], xe = /.+@.+\..+/;
1036
+ function _t({ client: r, authSession: e, origin: t, onBack: n }) {
1037
+ const { t: i } = w(), s = e?.user.email ?? "", a = s || null, [l, d] = x(s), [p, u] = x(""), [h, b] = x(""), [_, f] = x([]), [g, A] = x(!1), [M, k] = x(null), [E, I] = x({}), O = _e(() => {
1038
+ const L = (a ?? l).trim().toLowerCase(), C = p.trim(), U = h.trim();
1039
+ return xe.test(L) && C.length >= re && C.length <= ne && U.length >= 1 && U.length <= ie;
1040
+ }, [a, l, p, h]), B = () => {
1041
+ const L = {}, C = (a ?? l).trim(), U = p.trim(), m = h.trim();
1042
+ return C ? xe.test(C.toLowerCase()) || (L.email = i("support.invalid_email", "Invalid email")) : L.email = i("support.required", "Required"), (U.length < re || U.length > ne) && (L.subject = i("support.subject_length", "{min}–{max} characters", {
1043
+ min: re,
1010
1044
  max: ne
1011
- })), (g.length < 1 || g.length > re) && (A.message = i("support.message_length", "{min}–{max} characters", {
1045
+ })), (m.length < 1 || m.length > ie) && (L.message = i("support.message_length", "{min}–{max} characters", {
1012
1046
  min: 1,
1013
- max: re
1014
- })), C(A), Object.keys(A).length === 0;
1015
- }, M = async (A) => {
1016
- if (A.preventDefault(), !k && O()) {
1017
- j(!0), C((I) => ({ ...I, submit: void 0 }));
1047
+ max: ie
1048
+ })), I(L), Object.keys(L).length === 0;
1049
+ }, R = async (L) => {
1050
+ if (L.preventDefault(), !g && B()) {
1051
+ A(!0), I((C) => ({ ...C, submit: void 0 }));
1018
1052
  try {
1019
- const I = (a ?? l).trim();
1020
- await t.createSupportTicket({
1021
- subject: u.trim(),
1022
- content: f.trim(),
1023
- email: I || void 0,
1024
- files: h.length > 0 ? h : void 0
1025
- }), v(I);
1026
- } catch (I) {
1027
- const m = I instanceof U && I.message || "Failed to send. Please try again.";
1028
- C((g) => ({ ...g, submit: m }));
1053
+ const C = (a ?? l).trim();
1054
+ await r.createSupportTicket({
1055
+ subject: p.trim(),
1056
+ content: h.trim(),
1057
+ email: C || void 0,
1058
+ files: _.length > 0 ? _ : void 0
1059
+ }), k(C);
1060
+ } catch (C) {
1061
+ const U = C instanceof j && C.message || "Failed to send. Please try again.";
1062
+ I((m) => ({ ...m, submit: U }));
1029
1063
  } finally {
1030
- j(!1);
1064
+ A(!1);
1031
1065
  }
1032
1066
  }
1033
1067
  }, q = () => {
1034
- p(""), b(""), y([]), C({}), v(null);
1035
- }, z = "flex flex-col gap-3 bg-white px-6 pb-6 pt-3 sm:px-8", D = { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" };
1036
- return T ? /* @__PURE__ */ c("div", { class: "relative flex-1 min-h-0 flex flex-col", children: [
1068
+ u(""), b(""), f([]), I({}), k(null);
1069
+ }, D = "flex flex-col gap-3 bg-white px-6 pb-6 pt-3 sm:px-8", N = { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" };
1070
+ return M ? /* @__PURE__ */ c("div", { class: "relative flex-1 min-h-0 flex flex-col", children: [
1037
1071
  /* @__PURE__ */ c("div", { class: "flex-1 min-h-0 overflow-y-auto flex flex-col items-center gap-4 px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8 text-center", children: [
1038
1072
  /* @__PURE__ */ o(
1039
1073
  "div",
@@ -1061,18 +1095,18 @@ function vt({ client: t, authSession: e, origin: n, onBack: r }) {
1061
1095
  "We've received your message and will respond to"
1062
1096
  ),
1063
1097
  " ",
1064
- /* @__PURE__ */ o("b", { class: "text-gray-700", children: T }),
1098
+ /* @__PURE__ */ o("b", { class: "text-gray-700", children: M }),
1065
1099
  "."
1066
1100
  ] })
1067
1101
  ] }),
1068
- /* @__PURE__ */ o("div", { class: z, style: D, children: /* @__PURE__ */ c("div", { class: "flex items-center justify-center gap-3", children: [
1102
+ /* @__PURE__ */ o("div", { class: D, style: N, children: /* @__PURE__ */ c("div", { class: "flex items-center justify-center gap-3", children: [
1069
1103
  /* @__PURE__ */ o(
1070
1104
  "button",
1071
1105
  {
1072
1106
  type: "button",
1073
- onClick: r,
1107
+ onClick: n,
1074
1108
  class: "rounded-xl px-3 py-2 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
1075
- children: n === "standalone" ? i("support.done_button", "Done") : i("nav.back_aria", "Back")
1109
+ children: t === "standalone" ? i("support.done_button", "Done") : i("nav.back_aria", "Back")
1076
1110
  }
1077
1111
  ),
1078
1112
  /* @__PURE__ */ o(
@@ -1089,8 +1123,8 @@ function vt({ client: t, authSession: e, origin: n, onBack: r }) {
1089
1123
  }
1090
1124
  )
1091
1125
  ] }) })
1092
- ] }) : /* @__PURE__ */ c("form", { onSubmit: M, class: "relative flex-1 min-h-0 flex flex-col", children: [
1093
- /* @__PURE__ */ o(_t, { onClick: r, ariaLabel: i("nav.back_aria", "Back") }),
1126
+ ] }) : /* @__PURE__ */ c("form", { onSubmit: R, class: "relative flex-1 min-h-0 flex flex-col", children: [
1127
+ /* @__PURE__ */ o(St, { onClick: n, ariaLabel: i("nav.back_aria", "Back") }),
1094
1128
  /* @__PURE__ */ o("div", { class: "flex-1 min-h-0 overflow-y-auto px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8", children: /* @__PURE__ */ c("div", { class: "flex flex-col gap-5", children: [
1095
1129
  /* @__PURE__ */ c("div", { class: "flex flex-col gap-2 pr-10", children: [
1096
1130
  /* @__PURE__ */ o("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: i("support.heading", "Support") }),
@@ -1102,77 +1136,77 @@ function vt({ client: t, authSession: e, origin: n, onBack: r }) {
1102
1136
  " ",
1103
1137
  /* @__PURE__ */ o("b", { class: "font-medium text-gray-900", children: a })
1104
1138
  ] }) : /* @__PURE__ */ o(
1105
- xe,
1139
+ be,
1106
1140
  {
1107
1141
  type: "email",
1108
1142
  placeholder: i("support.email_placeholder", "Enter your email *"),
1109
1143
  value: l,
1110
1144
  onInput: d,
1111
- error: L.email,
1145
+ error: E.email,
1112
1146
  autocomplete: "email",
1113
1147
  required: !0
1114
1148
  }
1115
1149
  ),
1116
1150
  /* @__PURE__ */ o(
1117
- xe,
1151
+ be,
1118
1152
  {
1119
1153
  type: "text",
1120
1154
  placeholder: i("support.subject_placeholder", "Enter your subject *"),
1121
- value: u,
1122
- onInput: p,
1123
- error: L.subject,
1155
+ value: p,
1156
+ onInput: u,
1157
+ error: E.subject,
1124
1158
  required: !0
1125
1159
  }
1126
1160
  ),
1127
1161
  /* @__PURE__ */ o(
1128
- St,
1162
+ Ct,
1129
1163
  {
1130
1164
  placeholder: i("support.message_placeholder", "Enter your message *"),
1131
- value: f,
1165
+ value: h,
1132
1166
  onInput: b,
1133
- error: L.message,
1167
+ error: E.message,
1134
1168
  required: !0
1135
1169
  }
1136
1170
  ),
1137
- /* @__PURE__ */ o(Ct, { files: h, onChange: y, disabled: k })
1171
+ /* @__PURE__ */ o(It, { files: _, onChange: f, disabled: g })
1138
1172
  ] })
1139
1173
  ] }) }),
1140
- /* @__PURE__ */ c("div", { class: z, style: D, children: [
1141
- L.submit && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: L.submit }),
1174
+ /* @__PURE__ */ c("div", { class: D, style: N, children: [
1175
+ E.submit && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: E.submit }),
1142
1176
  /* @__PURE__ */ c("div", { class: "flex items-center justify-end gap-3", children: [
1143
1177
  /* @__PURE__ */ o(
1144
1178
  "button",
1145
1179
  {
1146
1180
  type: "button",
1147
- onClick: r,
1148
- disabled: k,
1181
+ onClick: n,
1182
+ disabled: g,
1149
1183
  class: "rounded-full px-4 py-2 text-base font-medium text-gray-700 transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
1150
- children: n === "standalone" ? i("support.close_button", "Close") : i("nav.back_aria", "Back")
1184
+ children: t === "standalone" ? i("support.close_button", "Close") : i("nav.back_aria", "Back")
1151
1185
  }
1152
1186
  ),
1153
1187
  /* @__PURE__ */ o(
1154
1188
  "button",
1155
1189
  {
1156
1190
  type: "submit",
1157
- disabled: !P || k,
1191
+ disabled: !O || g,
1158
1192
  class: "pw-cta-shimmer relative flex h-12 items-center justify-center overflow-hidden rounded-full px-8 text-base font-semibold text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
1159
1193
  style: {
1160
1194
  background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",
1161
1195
  boxShadow: "0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"
1162
1196
  },
1163
- children: k ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: i("support.send_button", "Send") })
1197
+ children: g ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: i("support.send_button", "Send") })
1164
1198
  }
1165
1199
  )
1166
1200
  ] })
1167
1201
  ] })
1168
1202
  ] });
1169
1203
  }
1170
- function _t({ onClick: t, ariaLabel: e }) {
1204
+ function St({ onClick: r, ariaLabel: e }) {
1171
1205
  return /* @__PURE__ */ o(
1172
1206
  "button",
1173
1207
  {
1174
1208
  type: "button",
1175
- onClick: t,
1209
+ onClick: r,
1176
1210
  "aria-label": e,
1177
1211
  class: "absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
1178
1212
  children: /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
@@ -1200,11 +1234,11 @@ function _t({ onClick: t, ariaLabel: e }) {
1200
1234
  }
1201
1235
  );
1202
1236
  }
1203
- function xe({
1204
- type: t,
1237
+ function be({
1238
+ type: r,
1205
1239
  placeholder: e,
1206
- value: n,
1207
- onInput: r,
1240
+ value: t,
1241
+ onInput: n,
1208
1242
  error: i,
1209
1243
  autocomplete: s,
1210
1244
  required: a
@@ -1213,10 +1247,10 @@ function xe({
1213
1247
  /* @__PURE__ */ o(
1214
1248
  "input",
1215
1249
  {
1216
- type: t,
1217
- value: n,
1250
+ type: r,
1251
+ value: t,
1218
1252
  placeholder: e,
1219
- onInput: (l) => r(l.target.value),
1253
+ onInput: (l) => n(l.target.value),
1220
1254
  autocomplete: s,
1221
1255
  required: a,
1222
1256
  class: `h-14 w-full rounded-2xl bg-gray-100 px-5 text-base text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 ${i ? "shadow-[0_0_0_2px_rgba(239,68,68,0.5)]" : "focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"}`
@@ -1225,11 +1259,11 @@ function xe({
1225
1259
  i && /* @__PURE__ */ o("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: i })
1226
1260
  ] });
1227
1261
  }
1228
- function St({
1229
- placeholder: t,
1262
+ function Ct({
1263
+ placeholder: r,
1230
1264
  value: e,
1231
- onInput: n,
1232
- error: r,
1265
+ onInput: t,
1266
+ error: n,
1233
1267
  required: i
1234
1268
  }) {
1235
1269
  return /* @__PURE__ */ c("div", { children: [
@@ -1237,55 +1271,55 @@ function St({
1237
1271
  "textarea",
1238
1272
  {
1239
1273
  value: e,
1240
- placeholder: t,
1241
- onInput: (s) => n(s.target.value),
1274
+ placeholder: r,
1275
+ onInput: (s) => t(s.target.value),
1242
1276
  required: i,
1243
1277
  rows: 5,
1244
- class: `min-h-[120px] w-full rounded-2xl bg-gray-100 px-5 py-3.5 text-base leading-relaxed text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 ${r ? "shadow-[0_0_0_2px_rgba(239,68,68,0.5)]" : "focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"}`
1278
+ class: `min-h-[120px] w-full rounded-2xl bg-gray-100 px-5 py-3.5 text-base leading-relaxed text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 ${n ? "shadow-[0_0_0_2px_rgba(239,68,68,0.5)]" : "focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"}`
1245
1279
  }
1246
1280
  ),
1247
- r && /* @__PURE__ */ o("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: r })
1281
+ n && /* @__PURE__ */ o("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: n })
1248
1282
  ] });
1249
1283
  }
1250
- function Ct({ files: t, onChange: e, disabled: n }) {
1251
- const { t: r } = w(), i = R(null), [s, a] = x(!1), [l, d] = x(null), u = (p) => {
1252
- if (!p || n) return;
1284
+ function It({ files: r, onChange: e, disabled: t }) {
1285
+ const { t: n } = w(), i = z(null), [s, a] = x(!1), [l, d] = x(null), p = (u) => {
1286
+ if (!u || t) return;
1253
1287
  d(null);
1254
- const f = Array.from(p);
1255
- if (t.length + f.length > ie) {
1256
- d(r("support.too_many_files", "Up to {max} files", { max: ie }));
1288
+ const h = Array.from(u);
1289
+ if (r.length + h.length > oe) {
1290
+ d(n("support.too_many_files", "Up to {max} files", { max: oe }));
1257
1291
  return;
1258
1292
  }
1259
- const b = f.filter(
1260
- (h) => me.includes(h.type) && h.size <= kt
1293
+ const b = h.filter(
1294
+ (_) => ye.includes(_.type) && _.size <= vt
1261
1295
  );
1262
- if (b.length !== f.length) {
1263
- d(r("support.invalid_file", "Only JPEG/PNG/WebP, ≤ 10MB each"));
1296
+ if (b.length !== h.length) {
1297
+ d(n("support.invalid_file", "Only JPEG/PNG/WebP, ≤ 10MB each"));
1264
1298
  return;
1265
1299
  }
1266
- e([...t, ...b]);
1300
+ e([...r, ...b]);
1267
1301
  };
1268
1302
  return /* @__PURE__ */ c("div", { children: [
1269
- /* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: r("support.attachments_label", "Attachments (optional)") }),
1303
+ /* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: n("support.attachments_label", "Attachments (optional)") }),
1270
1304
  /* @__PURE__ */ c(
1271
1305
  "div",
1272
1306
  {
1273
1307
  role: "button",
1274
1308
  tabIndex: 0,
1275
- "aria-label": r("support.attachments_aria", "Attachments upload"),
1276
- onClick: () => !n && i.current?.click(),
1277
- onDragOver: (p) => {
1278
- p.preventDefault(), n || a(!0);
1309
+ "aria-label": n("support.attachments_aria", "Attachments upload"),
1310
+ onClick: () => !t && i.current?.click(),
1311
+ onDragOver: (u) => {
1312
+ u.preventDefault(), t || a(!0);
1279
1313
  },
1280
1314
  onDragLeave: () => a(!1),
1281
- onDrop: (p) => {
1282
- p.preventDefault(), a(!1), u(p.dataTransfer?.files ?? null);
1315
+ onDrop: (u) => {
1316
+ u.preventDefault(), a(!1), p(u.dataTransfer?.files ?? null);
1283
1317
  },
1284
- class: `mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${s ? "border-[var(--pw-accent)] bg-[color-mix(in_srgb,var(--pw-accent)_6%,white)]" : "border-gray-300 hover:border-gray-400 hover:bg-gray-50/60"} ${n ? "cursor-not-allowed opacity-60" : ""}`,
1318
+ class: `mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${s ? "border-[var(--pw-accent)] bg-[color-mix(in_srgb,var(--pw-accent)_6%,white)]" : "border-gray-300 hover:border-gray-400 hover:bg-gray-50/60"} ${t ? "cursor-not-allowed opacity-60" : ""}`,
1285
1319
  children: [
1286
- /* @__PURE__ */ o("div", { class: "text-xs text-gray-500", children: r("support.dropzone_text", "Drop images here or click to select") }),
1287
- /* @__PURE__ */ o("div", { class: "mt-0.5 text-[11px] text-gray-400", children: r("support.file_requirements", "JPEG/PNG/WebP, up to {max} files, ≤ 10MB each", {
1288
- max: ie
1320
+ /* @__PURE__ */ o("div", { class: "text-xs text-gray-500", children: n("support.dropzone_text", "Drop images here or click to select") }),
1321
+ /* @__PURE__ */ o("div", { class: "mt-0.5 text-[11px] text-gray-400", children: n("support.file_requirements", "JPEG/PNG/WebP, up to {max} files, ≤ 10MB each", {
1322
+ max: oe
1289
1323
  }) })
1290
1324
  ]
1291
1325
  }
@@ -1296,68 +1330,68 @@ function Ct({ files: t, onChange: e, disabled: n }) {
1296
1330
  ref: i,
1297
1331
  type: "file",
1298
1332
  multiple: !0,
1299
- accept: me.join(","),
1333
+ accept: ye.join(","),
1300
1334
  class: "hidden",
1301
- onChange: (p) => {
1302
- u(p.target.files), p.currentTarget.value = "";
1335
+ onChange: (u) => {
1336
+ p(u.target.files), u.currentTarget.value = "";
1303
1337
  }
1304
1338
  }
1305
1339
  ),
1306
1340
  l && /* @__PURE__ */ o("p", { class: "mt-1 text-xs text-red-600", children: l }),
1307
- t.length > 0 && /* @__PURE__ */ o("ul", { class: "mt-2 flex flex-col gap-1", children: t.map((p, f) => /* @__PURE__ */ c(
1341
+ r.length > 0 && /* @__PURE__ */ o("ul", { class: "mt-2 flex flex-col gap-1", children: r.map((u, h) => /* @__PURE__ */ c(
1308
1342
  "li",
1309
1343
  {
1310
1344
  class: "flex items-center justify-between gap-2 rounded bg-gray-50 px-2 py-1 text-xs",
1311
1345
  children: [
1312
- /* @__PURE__ */ o("span", { class: "truncate text-gray-700", children: p.name }),
1346
+ /* @__PURE__ */ o("span", { class: "truncate text-gray-700", children: u.name }),
1313
1347
  /* @__PURE__ */ o(
1314
1348
  "button",
1315
1349
  {
1316
1350
  type: "button",
1317
1351
  onClick: () => {
1318
- const b = [...t];
1319
- b.splice(f, 1), e(b);
1352
+ const b = [...r];
1353
+ b.splice(h, 1), e(b);
1320
1354
  },
1321
- disabled: n,
1355
+ disabled: t,
1322
1356
  class: "text-gray-500 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-60",
1323
- "aria-label": r("support.remove_file_aria", "Remove {filename}", { filename: p.name }),
1357
+ "aria-label": n("support.remove_file_aria", "Remove {filename}", { filename: u.name }),
1324
1358
  children: "✕"
1325
1359
  }
1326
1360
  )
1327
1361
  ]
1328
1362
  },
1329
- `${p.name}-${p.size}-${f}`
1363
+ `${u.name}-${u.size}-${h}`
1330
1364
  )) })
1331
1365
  ] });
1332
1366
  }
1333
- const It = {
1367
+ const Lt = {
1334
1368
  day: "cta.get_plan_daily",
1335
1369
  week: "cta.get_plan_weekly",
1336
1370
  month: "cta.get_plan_monthly",
1337
1371
  year: "cta.get_plan_yearly"
1338
- }, Lt = {
1372
+ }, At = {
1339
1373
  day: "Get Daily Plan",
1340
1374
  week: "Get Weekly Plan",
1341
1375
  month: "Get Monthly Plan",
1342
1376
  year: "Get Yearly Plan"
1343
1377
  };
1344
- function At(t, e, n, r) {
1345
- if (e === "close") return r("cta.close", "Close");
1346
- if (!t) return r("cta.continue", "Continue");
1347
- if (!n && t.trial_days && t.interval && t.interval !== "lifetime")
1348
- return r("cta.start_trial", "Start {days}-Day Free Trial", { days: t.trial_days });
1349
- if (!t.interval || t.interval === "lifetime")
1350
- return r("cta.get_lifetime_access", "Get Lifetime Access");
1351
- const i = It[t.interval];
1352
- return i ? r(i, Lt[t.interval]) : r("cta.get_plan_generic", "Get {interval} Plan", {
1353
- interval: Et(t.interval)
1378
+ function Et(r, e, t, n) {
1379
+ if (e === "close") return n("cta.close", "Close");
1380
+ if (!r) return n("cta.continue", "Continue");
1381
+ if (!t && r.trial_days && r.interval && r.interval !== "lifetime")
1382
+ return n("cta.start_trial", "Start {days}-Day Free Trial", { days: r.trial_days });
1383
+ if (!r.interval || r.interval === "lifetime")
1384
+ return n("cta.get_lifetime_access", "Get Lifetime Access");
1385
+ const i = Lt[r.interval];
1386
+ return i ? n(i, At[r.interval]) : n("cta.get_plan_generic", "Get {interval} Plan", {
1387
+ interval: Pt(r.interval)
1354
1388
  });
1355
1389
  }
1356
- function Et(t) {
1357
- return t.length ? t[0].toUpperCase() + t.slice(1) : t;
1390
+ function Pt(r) {
1391
+ return r.length ? r[0].toUpperCase() + r.slice(1) : r;
1358
1392
  }
1359
- function Tt({ block: t, ctx: e }) {
1360
- const { t: n } = w(), [r, i] = x(!1), s = t.priceId ?? e.selectedPriceId, a = r || t.action === "checkout" && !s, l = s ? e.bootstrap.prices.find((f) => f.id === s) ?? null : null, d = e.bootstrap.user?.had_previous_trial ?? !1, u = t.label ?? At(l, t.action, d, n);
1393
+ function Tt({ block: r, ctx: e }) {
1394
+ const { t } = w(), [n, i] = x(!1), s = r.priceId ?? e.selectedPriceId, a = n || r.action === "checkout" && !s, l = s ? e.bootstrap.prices.find((h) => h.id === s) ?? null : null, d = e.bootstrap.user?.had_previous_trial ?? !1, p = r.label ?? Et(l, r.action, d, t);
1361
1395
  return /* @__PURE__ */ c(
1362
1396
  "button",
1363
1397
  {
@@ -1367,7 +1401,7 @@ function Tt({ block: t, ctx: e }) {
1367
1401
  if (!a) {
1368
1402
  i(!0);
1369
1403
  try {
1370
- await e.onAction(t.action, { priceId: s });
1404
+ await e.onAction(r.action, { priceId: s });
1371
1405
  } finally {
1372
1406
  i(!1);
1373
1407
  }
@@ -1389,19 +1423,19 @@ function Tt({ block: t, ctx: e }) {
1389
1423
  "aria-hidden": "true"
1390
1424
  }
1391
1425
  ),
1392
- r ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: u })
1426
+ n ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: p })
1393
1427
  ]
1394
1428
  }
1395
1429
  );
1396
1430
  }
1397
- function Bt({ ctx: t }) {
1398
- const { t: e } = w(), n = t.authSession, r = t.auth, [i, s] = x(!1), a = () => t.onAction("support");
1399
- if (n && !n.user.is_anonymous) {
1431
+ function Mt({ ctx: r }) {
1432
+ const { t: e } = w(), t = r.authSession, n = r.auth, [i, s] = x(!1), a = () => r.onAction("support");
1433
+ if (t && !t.user.is_anonymous) {
1400
1434
  const l = async () => {
1401
- if (!(!r || i)) {
1435
+ if (!(!n || i)) {
1402
1436
  s(!0);
1403
1437
  try {
1404
- await r.signOut();
1438
+ await n.signOut();
1405
1439
  } catch {
1406
1440
  } finally {
1407
1441
  s(!1);
@@ -1412,43 +1446,43 @@ function Bt({ ctx: t }) {
1412
1446
  /* @__PURE__ */ c("span", { children: [
1413
1447
  e("session.signed_in_as_prefix", "Signed in as"),
1414
1448
  " ",
1415
- /* @__PURE__ */ o("b", { class: "font-medium text-gray-700", children: n.user.email })
1449
+ /* @__PURE__ */ o("b", { class: "font-medium text-gray-700", children: t.user.email })
1416
1450
  ] }),
1417
1451
  /* @__PURE__ */ c("div", { class: "flex items-center justify-center gap-3", children: [
1418
- /* @__PURE__ */ o($, { onClick: l, disabled: !r || i, children: i ? e("session.signing_out", "Signing out…") : e("session.sign_out", "Sign Out") }),
1419
- /* @__PURE__ */ o(be, {}),
1420
- /* @__PURE__ */ o($, { onClick: a, children: e("session.contact_support", "Contact Support") })
1452
+ /* @__PURE__ */ o(H, { onClick: l, disabled: !n || i, children: i ? e("session.signing_out", "Signing out…") : e("session.sign_out", "Sign Out") }),
1453
+ /* @__PURE__ */ o(we, {}),
1454
+ /* @__PURE__ */ o(H, { onClick: a, children: e("session.contact_support", "Contact Support") })
1421
1455
  ] })
1422
1456
  ] });
1423
1457
  }
1424
1458
  return /* @__PURE__ */ c("div", { class: "-mt-3 flex items-center justify-center gap-3 pt-1 text-center text-[13px]", children: [
1425
- /* @__PURE__ */ o($, { onClick: () => t.onAction("restore"), children: e("session.restore_purchases", "Restore purchases") }),
1426
- /* @__PURE__ */ o(be, {}),
1427
- /* @__PURE__ */ o($, { onClick: a, children: e("session.contact_support", "Contact Support") })
1459
+ /* @__PURE__ */ o(H, { onClick: () => r.onAction("restore"), children: e("session.restore_purchases", "Restore purchases") }),
1460
+ /* @__PURE__ */ o(we, {}),
1461
+ /* @__PURE__ */ o(H, { onClick: a, children: e("session.contact_support", "Contact Support") })
1428
1462
  ] });
1429
1463
  }
1430
- function $({
1431
- onClick: t,
1464
+ function H({
1465
+ onClick: r,
1432
1466
  disabled: e,
1433
- children: n
1467
+ children: t
1434
1468
  }) {
1435
1469
  return /* @__PURE__ */ o(
1436
1470
  "button",
1437
1471
  {
1438
1472
  type: "button",
1439
- onClick: t,
1473
+ onClick: r,
1440
1474
  disabled: e,
1441
1475
  class: "font-semibold transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:opacity-80",
1442
1476
  style: { color: "var(--pw-accent)" },
1443
- children: n
1477
+ children: t
1444
1478
  }
1445
1479
  );
1446
1480
  }
1447
- function be() {
1481
+ function we() {
1448
1482
  return /* @__PURE__ */ o("span", { class: "h-1 w-1 rounded-full bg-gray-300", "aria-hidden": "true" });
1449
1483
  }
1450
- function Mt({ block: t }) {
1451
- return t.items.length ? /* @__PURE__ */ o("ul", { class: "flex flex-col gap-2.5", role: "list", children: t.items.map((e) => /* @__PURE__ */ c("li", { class: "flex items-start gap-3 text-sm text-gray-700", children: [
1484
+ function Bt({ block: r }) {
1485
+ return r.items.length ? /* @__PURE__ */ o("ul", { class: "flex flex-col gap-2.5", role: "list", children: r.items.map((e) => /* @__PURE__ */ c("li", { class: "flex items-start gap-3 text-sm text-gray-700", children: [
1452
1486
  /* @__PURE__ */ o(
1453
1487
  "svg",
1454
1488
  {
@@ -1476,25 +1510,25 @@ function Mt({ block: t }) {
1476
1510
  ] })
1477
1511
  ] }, e.id)) }) : null;
1478
1512
  }
1479
- function Pt({ block: t }) {
1480
- const { t: e } = w(), n = t.title ?? e("pricing.money_back", "30-day money-back guarantee"), r = t.subtitle, i = (t.icon ?? "dollar_shield") !== "none", s = Ot(n);
1513
+ function Ot({ block: r }) {
1514
+ const { t: e } = w(), t = r.title ?? e("pricing.money_back", "30-day money-back guarantee"), n = r.subtitle, i = (r.icon ?? "dollar_shield") !== "none", s = Ut(t);
1481
1515
  return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-1.5 border-b-1 pb-4 mb-1 border-gray-100", children: [
1482
1516
  /* @__PURE__ */ c("div", { class: "inline-flex items-center gap-2 text-[12px] text-gray-700", children: [
1483
- i ? /* @__PURE__ */ o(Ut, {}) : null,
1517
+ i ? /* @__PURE__ */ o(jt, {}) : null,
1484
1518
  s ? /* @__PURE__ */ c("span", { children: [
1485
1519
  /* @__PURE__ */ o("b", { class: "font-bold text-gray-900", children: s.bold }),
1486
1520
  " ",
1487
1521
  /* @__PURE__ */ o("span", { class: "font-medium", children: s.rest })
1488
- ] }) : /* @__PURE__ */ o("span", { class: "font-medium", children: n })
1522
+ ] }) : /* @__PURE__ */ o("span", { class: "font-medium", children: t })
1489
1523
  ] }),
1490
- r ? /* @__PURE__ */ o("span", { class: "text-center text-xs leading-relaxed text-gray-500", children: r }) : null
1524
+ n ? /* @__PURE__ */ o("span", { class: "text-center text-xs leading-relaxed text-gray-500", children: n }) : null
1491
1525
  ] });
1492
1526
  }
1493
- function Ot(t) {
1494
- const e = t.match(/^(\d+[-\s]?days?)\s+(.+)$/i);
1527
+ function Ut(r) {
1528
+ const e = r.match(/^(\d+[-\s]?days?)\s+(.+)$/i);
1495
1529
  return e ? { bold: e[1], rest: e[2] } : null;
1496
1530
  }
1497
- function Ut() {
1531
+ function jt() {
1498
1532
  return /* @__PURE__ */ c(
1499
1533
  "svg",
1500
1534
  {
@@ -1529,141 +1563,144 @@ function Ut() {
1529
1563
  }
1530
1564
  );
1531
1565
  }
1532
- const Pe = 24, jt = 16, Rt = 2;
1533
- function zt(t, e) {
1534
- const n = e * Rt;
1535
- let r = Pe;
1536
- for (t.style.fontSize = `${r}px`; t.scrollHeight > n && r > jt; )
1537
- r -= 1, t.style.fontSize = `${r}px`;
1566
+ const Ue = 24, Rt = 16, zt = 2;
1567
+ function Dt(r, e) {
1568
+ const t = e * zt;
1569
+ let n = Ue;
1570
+ for (r.style.fontSize = `${n}px`; r.scrollHeight > t && n > Rt; )
1571
+ n -= 1, r.style.fontSize = `${n}px`;
1538
1572
  }
1539
- function Dt({ block: t, ctx: e }) {
1540
- const n = t.level ?? 1, r = `h${n}`, i = n === 1 ? "text-[22px] sm:text-2xl font-semibold leading-tight text-center text-balance text-gray-800" : n === 2 ? "text-xl font-semibold leading-snug text-gray-900 tracking-tight" : "text-base font-medium text-gray-900", s = R(null), a = n === 1 && !!e.bootstrap.settings.title_auto_fit;
1541
- return B(() => {
1573
+ function qt({ block: r, ctx: e }) {
1574
+ const t = r.level ?? 1, n = `h${t}`, i = t === 1 ? "text-[22px] sm:text-2xl font-semibold leading-tight text-center text-balance text-gray-800" : t === 2 ? "text-xl font-semibold leading-snug text-gray-900 tracking-tight" : "text-base font-medium text-gray-900", s = z(null), a = t === 1 && !!e.bootstrap.settings.title_auto_fit;
1575
+ return T(() => {
1542
1576
  if (!a || !s.current) return;
1543
- const l = getComputedStyle(s.current), d = parseFloat(l.lineHeight) || Pe * 1.5;
1544
- zt(s.current, d);
1545
- }, [a, t.text]), /* @__PURE__ */ o(r, { ref: s, class: i, children: t.text });
1577
+ const l = getComputedStyle(s.current), d = parseFloat(l.lineHeight) || Ue * 1.5;
1578
+ Dt(s.current, d);
1579
+ }, [a, r.text]), /* @__PURE__ */ o(n, { ref: s, class: i, children: r.text });
1546
1580
  }
1547
- function qt(t) {
1548
- const e = t.local ?? { currency: t.currency, amount: t.amount };
1549
- if (t.interval === "year") {
1550
- const n = (t.interval_count ?? 1) * 12;
1551
- return { amount: e.amount / n, currency: e.currency };
1581
+ function Nt(r) {
1582
+ const e = r.local ?? { currency: r.currency, amount: r.amount };
1583
+ if (r.interval === "year") {
1584
+ const t = (r.interval_count ?? 1) * 12;
1585
+ return { amount: e.amount / t, currency: e.currency };
1552
1586
  }
1553
1587
  return { amount: e.amount, currency: e.currency };
1554
1588
  }
1555
- function oe(t, e) {
1556
- const n = t % 1 !== 0 ? 2 : 0;
1589
+ function se(r, e) {
1590
+ const t = r % 1 !== 0 ? 2 : 0;
1557
1591
  try {
1558
- const r = new Intl.NumberFormat(void 0, {
1592
+ const n = new Intl.NumberFormat(void 0, {
1559
1593
  style: "currency",
1560
1594
  currency: e,
1561
1595
  currencyDisplay: "narrowSymbol",
1562
- maximumFractionDigits: n,
1563
- minimumFractionDigits: n
1564
- }).formatToParts(t);
1596
+ maximumFractionDigits: t,
1597
+ minimumFractionDigits: t
1598
+ }).formatToParts(r);
1565
1599
  let i = "", s = "";
1566
- for (const a of r)
1600
+ for (const a of n)
1567
1601
  a.type === "currency" ? i = a.value : a.type !== "literal" && (s += a.value);
1568
1602
  return { currency: i || e, amount: s.trim() };
1569
1603
  } catch {
1570
- return { currency: e, amount: String(t) };
1604
+ return { currency: e, amount: String(r) };
1571
1605
  }
1572
1606
  }
1573
- function le(t, e) {
1574
- const { amount: n, currency: r } = qt(t);
1607
+ function le(r, e) {
1608
+ const { amount: t, currency: n } = Nt(r);
1575
1609
  if (!e) {
1576
- const { currency: l, amount: d } = oe(n, r);
1610
+ const { currency: l, amount: d } = se(t, n);
1577
1611
  return { currency: l, amount: d, originalAmount: null };
1578
1612
  }
1579
- const i = n * (1 - e / 100), s = oe(i, r), a = oe(n, r);
1613
+ const i = t * (1 - e / 100), s = se(i, n), a = se(t, n);
1580
1614
  return {
1581
1615
  currency: s.currency,
1582
1616
  amount: s.amount,
1583
1617
  originalAmount: `${a.currency}${a.amount}`
1584
1618
  };
1585
1619
  }
1586
- function se(t, e) {
1587
- if (!t || t.length === 0) return null;
1588
- const n = t.find(
1620
+ function G(r, e) {
1621
+ if (!r || r.length === 0) return null;
1622
+ const t = r.find(
1589
1623
  (i) => i.price_id === e && i.discount_percent && i.discount_percent > 0
1590
1624
  );
1591
- return n || (t.find(
1625
+ return t || (r.find(
1592
1626
  (i) => i.price_id == null && i.discount_percent && i.discount_percent > 0
1593
1627
  ) ?? null);
1594
1628
  }
1595
- function Oe(t, e) {
1596
- if (t.label) return t.label.toUpperCase();
1597
- if (!t.interval || t.interval === "lifetime")
1629
+ function je(r, e) {
1630
+ if (r.label) return r.label.toUpperCase();
1631
+ if (!r.interval || r.interval === "lifetime")
1598
1632
  return e("pricing.plan_label.lifetime", "LIFETIME");
1599
- const r = {
1633
+ const n = {
1600
1634
  day: { key: "pricing.plan_label.daily", fallback: "DAILY PLAN" },
1601
1635
  week: { key: "pricing.plan_label.weekly", fallback: "WEEKLY PLAN" },
1602
1636
  month: { key: "pricing.plan_label.monthly", fallback: "MONTHLY PLAN" },
1603
1637
  year: { key: "pricing.plan_label.yearly", fallback: "YEARLY PLAN" }
1604
- }[t.interval];
1605
- return r ? e(r.key, r.fallback) : `${t.interval.toUpperCase()} PLAN`;
1638
+ }[r.interval];
1639
+ return n ? e(n.key, n.fallback) : `${r.interval.toUpperCase()} PLAN`;
1606
1640
  }
1607
- function ce(t, e) {
1608
- if (!t.interval || t.interval === "lifetime")
1641
+ function ce(r, e) {
1642
+ if (!r.interval || r.interval === "lifetime")
1609
1643
  return e("pricing.interval.lifetime_short", "lifetime");
1610
- if (t.interval === "year") return e("pricing.interval.month", "month");
1611
- const n = t.interval_count ?? 1;
1612
- return n === 1 ? e(`pricing.interval.${t.interval}`, t.interval) : `${n} ${t.interval}s`;
1644
+ if (r.interval === "year") return e("pricing.interval.month", "month");
1645
+ const t = r.interval_count ?? 1;
1646
+ return t === 1 ? e(`pricing.interval.${r.interval}`, r.interval) : `${t} ${r.interval}s`;
1613
1647
  }
1614
- function Nt({ block: t, ctx: e }) {
1615
- const { t: n } = w(), r = t.priceIds && t.priceIds.length > 0 ? new Set(t.priceIds) : null, i = e.bootstrap.prices.filter((a) => !r || r.has(a.id));
1648
+ function Ft({ block: r, ctx: e }) {
1649
+ const { t } = w(), n = r.priceIds && r.priceIds.length > 0 ? new Set(r.priceIds) : null, i = e.bootstrap.prices.filter((a) => !n || n.has(a.id));
1616
1650
  if (i.length === 0)
1617
- return /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: n("pricing.no_prices", "No prices available.") });
1618
- const s = t.popular_label ?? n("pricing.most_popular", "Most popular");
1619
- if (t.view === "compact")
1651
+ return /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: t("pricing.no_prices", "No prices available.") });
1652
+ const s = r.popular_label ?? t("pricing.most_popular", "Most popular");
1653
+ if (r.view === "compact")
1620
1654
  return /* @__PURE__ */ o(
1621
1655
  "div",
1622
1656
  {
1623
- class: "flex w-full flex-col",
1657
+ class: "flex w-full flex-col rounded-xl border border-gray-200 bg-gray-50",
1624
1658
  role: "radiogroup",
1625
- "aria-label": n("pricing.plans_aria", "Plans"),
1659
+ "aria-label": t("pricing.plans_aria", "Plans"),
1626
1660
  children: i.map((a, l) => /* @__PURE__ */ o(
1627
- Vt,
1661
+ $t,
1628
1662
  {
1629
1663
  price: a,
1630
1664
  isLast: l === i.length - 1,
1631
- isPopular: t.popular_price_id === a.id,
1665
+ isPopular: r.popular_price_id === a.id,
1632
1666
  popularLabel: s,
1633
- offer: se(e.bootstrap.offers, a.id),
1667
+ offer: G(e.bootstrap.offers, a.id),
1634
1668
  selected: e.selectedPriceId === a.id,
1635
1669
  onSelect: () => {
1636
1670
  e.setSelectedPriceId(a.id), e.onAction("price_selected", { priceId: a.id, price: a });
1637
1671
  },
1638
- t: n
1672
+ t
1639
1673
  },
1640
1674
  a.id
1641
1675
  ))
1642
1676
  }
1643
1677
  );
1644
- if (t.view === "horizontal") {
1645
- const a = Math.min(i.length, 3);
1678
+ if (r.view === "horizontal") {
1679
+ const a = Math.min(i.length, 3), l = i.some(
1680
+ (d) => (G(e.bootstrap.offers, d.id)?.discount_percent ?? 0) > 0
1681
+ );
1646
1682
  return /* @__PURE__ */ o(
1647
1683
  "div",
1648
1684
  {
1649
1685
  class: "grid items-stretch gap-2",
1650
1686
  style: { gridTemplateColumns: `repeat(${a}, minmax(0, 1fr))` },
1651
1687
  role: "radiogroup",
1652
- "aria-label": n("pricing.plans_aria", "Plans"),
1653
- children: i.map((l) => /* @__PURE__ */ o(
1654
- $t,
1688
+ "aria-label": t("pricing.plans_aria", "Plans"),
1689
+ children: i.map((d) => /* @__PURE__ */ o(
1690
+ Ht,
1655
1691
  {
1656
- price: l,
1657
- isPopular: t.popular_price_id === l.id,
1692
+ price: d,
1693
+ isPopular: r.popular_price_id === d.id,
1658
1694
  popularLabel: s,
1659
- offer: se(e.bootstrap.offers, l.id),
1660
- selected: e.selectedPriceId === l.id,
1695
+ offer: G(e.bootstrap.offers, d.id),
1696
+ reserveStrikeRow: l,
1697
+ selected: e.selectedPriceId === d.id,
1661
1698
  onSelect: () => {
1662
- e.setSelectedPriceId(l.id), e.onAction("price_selected", { priceId: l.id, price: l });
1699
+ e.setSelectedPriceId(d.id), e.onAction("price_selected", { priceId: d.id, price: d });
1663
1700
  },
1664
- t: n
1701
+ t
1665
1702
  },
1666
- l.id
1703
+ d.id
1667
1704
  ))
1668
1705
  }
1669
1706
  );
@@ -1673,9 +1710,9 @@ function Nt({ block: t, ctx: e }) {
1673
1710
  {
1674
1711
  class: "flex flex-col gap-2",
1675
1712
  role: "radiogroup",
1676
- "aria-label": n("pricing.plans_aria", "Plans"),
1713
+ "aria-label": t("pricing.plans_aria", "Plans"),
1677
1714
  children: i.map((a) => {
1678
- const l = e.selectedPriceId === a.id, d = t.popular_price_id === a.id, p = se(e.bootstrap.offers, a.id)?.discount_percent ?? null, { currency: f, amount: b, originalAmount: h } = le(a, p);
1715
+ const l = e.selectedPriceId === a.id, d = r.popular_price_id === a.id, u = G(e.bootstrap.offers, a.id)?.discount_percent ?? null, { currency: h, amount: b, originalAmount: _ } = le(a, u);
1679
1716
  return /* @__PURE__ */ c(
1680
1717
  "button",
1681
1718
  {
@@ -1686,7 +1723,7 @@ function Nt({ block: t, ctx: e }) {
1686
1723
  e.setSelectedPriceId(a.id), e.onAction("price_selected", { priceId: a.id, price: a });
1687
1724
  },
1688
1725
  class: [
1689
- "group relative inline-flex w-full mx-auto items-center justify-between flex-row-reverse gap-4 rounded-2xl border-2 p-4 text-left transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
1726
+ "group relative inline-flex w-full mx-auto items-center justify-between flex-row-reverse gap-4 rounded-2xl border-2 px-4 py-3.5 text-left transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
1690
1727
  // Везде border 2px — selection выражается только цветом, layout
1691
1728
  // не прыгает (равная толщина у selected/unselected). Цветовая
1692
1729
  // разница accent vs gray достаточно сильная для visual hierarchy.
@@ -1731,35 +1768,33 @@ function Nt({ block: t, ctx: e }) {
1731
1768
  ),
1732
1769
  /* @__PURE__ */ c("div", { class: "flex flex-1 flex-col gap-0.5", children: [
1733
1770
  /* @__PURE__ */ c("div", { class: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
1734
- /* @__PURE__ */ o("span", { class: "text-xs font-normal uppercase tracking-normal text-gray-800/70", children: Oe(a, n) }),
1735
- h ? (
1771
+ /* @__PURE__ */ o("span", { class: "text-xs font-normal uppercase tracking-normal text-gray-800/70", children: je(a, t) }),
1772
+ _ ? (
1736
1773
  // opacity-60 приглушает strike: глаз сначала ловит label
1737
1774
  // и discount-badge, потом main price; original «бывшая цена»
1738
1775
  // — третичная информация, не должна конкурировать с label.
1739
- /* @__PURE__ */ o("span", { class: "text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]", children: h })
1776
+ /* @__PURE__ */ o("span", { class: "text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]", children: _ })
1740
1777
  ) : null,
1741
- p ? (
1778
+ u ? (
1742
1779
  // Emerald pill — фиксированный «успех/выгода», не зависит от
1743
1780
  // brand_color. Читается даже на тёмных бренд-акцентах.
1744
1781
  /* @__PURE__ */ c("span", { class: "rounded-full bg-emerald-100 px-2.5 py-1 text-xs font-bold leading-none text-emerald-700", children: [
1745
1782
  "-",
1746
- p,
1783
+ u,
1747
1784
  "%"
1748
1785
  ] })
1749
1786
  ) : null
1750
1787
  ] }),
1751
1788
  /* @__PURE__ */ o("div", { class: "flex items-baseline gap-2 flex-wrap", children: /* @__PURE__ */ c("span", { class: "text-[26px] leading-tight whitespace-nowrap text-gray-800 font-medium", children: [
1752
- /* @__PURE__ */ o("span", { class: "opacity-90", children: f }),
1753
- " ",
1789
+ /* @__PURE__ */ o("span", { class: "opacity-90", children: h }),
1754
1790
  b,
1755
1791
  /* @__PURE__ */ c("span", { class: "text-sm font-normal text-gray-500", children: [
1756
1792
  " ",
1757
1793
  "/ ",
1758
- ce(a, n)
1794
+ ce(a, t)
1759
1795
  ] })
1760
1796
  ] }) }),
1761
- a.description ? /* @__PURE__ */ o("span", { class: "mt-1 text-xs leading-relaxed text-gray-500", children: a.description }) : null,
1762
- a.trial_days ? /* @__PURE__ */ o("span", { class: "mt-1 text-xs font-medium text-[var(--pw-accent)]", children: n("pricing.free_trial_days", "{days}-day free trial", { days: a.trial_days }) }) : null
1797
+ a.description ? /* @__PURE__ */ o("span", { class: "mt-1 text-xs leading-relaxed text-gray-500", children: a.description }) : null
1763
1798
  ] }),
1764
1799
  d ? /* @__PURE__ */ o(
1765
1800
  "span",
@@ -1777,20 +1812,20 @@ function Nt({ block: t, ctx: e }) {
1777
1812
  }
1778
1813
  );
1779
1814
  }
1780
- function Ft(t, e) {
1781
- return t.label ? t.label : !t.interval || t.interval === "lifetime" ? e("pricing.interval.lifetime_short", "lifetime") : e(`pricing.interval.${t.interval}`, t.interval);
1815
+ function Vt(r, e) {
1816
+ return r.label ? r.label : !r.interval || r.interval === "lifetime" ? e("pricing.interval.lifetime_short", "lifetime") : e(`pricing.interval.${r.interval}`, r.interval);
1782
1817
  }
1783
- function Vt({
1784
- price: t,
1818
+ function $t({
1819
+ price: r,
1785
1820
  isLast: e,
1786
- isPopular: n,
1787
- popularLabel: r,
1821
+ isPopular: t,
1822
+ popularLabel: n,
1788
1823
  offer: i,
1789
1824
  selected: s,
1790
1825
  onSelect: a,
1791
1826
  t: l
1792
1827
  }) {
1793
- const d = i?.discount_percent ?? null, { currency: u, amount: p, originalAmount: f } = le(t, d);
1828
+ const d = i?.discount_percent ?? null, { currency: p, amount: u, originalAmount: h } = le(r, d);
1794
1829
  return /* @__PURE__ */ c(
1795
1830
  "button",
1796
1831
  {
@@ -1840,8 +1875,8 @@ function Vt({
1840
1875
  ].join(" "),
1841
1876
  children: [
1842
1877
  /* @__PURE__ */ c("div", { class: "flex flex-wrap items-center gap-1 gap-x-1.5", children: [
1843
- /* @__PURE__ */ o("span", { class: "text-base font-normal capitalize text-gray-800", children: Ft(t, l) }),
1844
- n ? (
1878
+ /* @__PURE__ */ o("span", { class: "text-base font-normal capitalize text-gray-800", children: Vt(r, l) }),
1879
+ t ? (
1845
1880
  // Pastel brand-mix pill — точно как `badge` в TelegramPricingRadio.
1846
1881
  // Низкий visual weight: pill про "имя плана" (most popular), а не
1847
1882
  // про savings — не должна конкурировать с -X% discount-pill.
@@ -1853,7 +1888,7 @@ function Vt({
1853
1888
  background: "linear-gradient(160deg, color-mix(in srgb, var(--pw-accent) 6%, white) 0%, color-mix(in srgb, var(--pw-accent) 15%, white) 100%)",
1854
1889
  color: "var(--pw-accent)"
1855
1890
  },
1856
- children: r
1891
+ children: n
1857
1892
  }
1858
1893
  )
1859
1894
  ) : null,
@@ -1865,14 +1900,14 @@ function Vt({
1865
1900
  ] }),
1866
1901
  /* @__PURE__ */ o("div", { class: "flex-1" }),
1867
1902
  /* @__PURE__ */ c("span", { class: "flex items-baseline gap-1.5 text-base font-normal text-gray-600", children: [
1868
- f ? /* @__PURE__ */ o("span", { class: "text-xs text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: f }) : null,
1903
+ h ? /* @__PURE__ */ o("span", { class: "text-xs text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: h }) : null,
1869
1904
  /* @__PURE__ */ c("span", { class: "whitespace-nowrap", children: [
1870
- /* @__PURE__ */ o("span", { class: "opacity-90", children: u }),
1871
- p,
1905
+ /* @__PURE__ */ o("span", { class: "opacity-90", children: p }),
1906
+ u,
1872
1907
  /* @__PURE__ */ c("span", { class: "text-xs text-gray-400", children: [
1873
1908
  " ",
1874
1909
  "/ ",
1875
- ce(t, l)
1910
+ ce(r, l)
1876
1911
  ] })
1877
1912
  ] })
1878
1913
  ] })
@@ -1883,79 +1918,79 @@ function Vt({
1883
1918
  }
1884
1919
  );
1885
1920
  }
1886
- function $t({
1887
- price: t,
1921
+ function Ht({
1922
+ price: r,
1888
1923
  isPopular: e,
1889
- popularLabel: n,
1890
- offer: r,
1891
- selected: i,
1892
- onSelect: s,
1893
- t: a
1924
+ popularLabel: t,
1925
+ offer: n,
1926
+ reserveStrikeRow: i,
1927
+ selected: s,
1928
+ onSelect: a,
1929
+ t: l
1894
1930
  }) {
1895
- const l = r?.discount_percent ?? null, { currency: d, amount: u, originalAmount: p } = le(t, l);
1931
+ const d = n?.discount_percent ?? null, { currency: p, amount: u, originalAmount: h } = le(r, d);
1896
1932
  return /* @__PURE__ */ c(
1897
1933
  "button",
1898
1934
  {
1899
1935
  type: "button",
1900
1936
  role: "radio",
1901
- "aria-checked": i,
1902
- onClick: s,
1937
+ "aria-checked": s,
1938
+ onClick: a,
1903
1939
  class: [
1904
1940
  "group relative flex h-full flex-col items-center justify-start gap-1 rounded-2xl border-2 px-3 pb-4 pt-3.5 text-center transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
1905
- i ? "border-[var(--pw-accent)]" : "border-gray-200 hover:bg-gray-50"
1941
+ s ? "border-[var(--pw-accent)]" : "border-gray-200 hover:bg-gray-50"
1906
1942
  ].join(" "),
1907
- style: i ? { background: "color-mix(in srgb, var(--pw-accent) 6%, transparent)" } : void 0,
1943
+ style: s ? { background: "color-mix(in srgb, var(--pw-accent) 6%, transparent)" } : void 0,
1908
1944
  children: [
1909
- /* @__PURE__ */ o("span", { class: "flex min-h-[2.4em] items-center text-[11px] font-normal uppercase leading-tight text-gray-800/70", children: Oe(t, a) }),
1910
- /* @__PURE__ */ c("div", { class: "flex h-[22px] items-center justify-center gap-1.5", children: [
1911
- p ? /* @__PURE__ */ o("span", { class: "text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: p }) : null,
1912
- l ? /* @__PURE__ */ c("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
1945
+ /* @__PURE__ */ o("span", { class: "flex min-h-[2.4em] items-center text-[10px] font-normal uppercase leading-tight text-gray-800/70", children: je(r, l) }),
1946
+ i ? /* @__PURE__ */ c("div", { class: "flex h-[22px] items-center justify-center gap-1.5", children: [
1947
+ h ? /* @__PURE__ */ o("span", { class: "text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: h }) : null,
1948
+ d ? /* @__PURE__ */ c("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
1913
1949
  "-",
1914
- l,
1950
+ d,
1915
1951
  "%"
1916
1952
  ] }) : null
1917
- ] }),
1953
+ ] }) : null,
1918
1954
  /* @__PURE__ */ c("span", { class: "text-[26px] leading-none whitespace-nowrap text-gray-800 font-medium", children: [
1919
- /* @__PURE__ */ o("span", { class: "opacity-90", children: d }),
1955
+ /* @__PURE__ */ o("span", { class: "opacity-90", children: p }),
1920
1956
  u
1921
1957
  ] }),
1922
1958
  /* @__PURE__ */ c("span", { class: "text-xs font-normal text-gray-500", children: [
1923
1959
  "/ ",
1924
- ce(t, a)
1960
+ ce(r, l)
1925
1961
  ] }),
1926
- t.trial_days ? /* @__PURE__ */ o("span", { class: "mt-1 text-[11px] font-medium text-[var(--pw-accent)]", children: a("pricing.free_trial_days", "{days}-day free trial", { days: t.trial_days }) }) : null,
1927
1962
  e ? /* @__PURE__ */ o(
1928
1963
  "span",
1929
1964
  {
1930
1965
  class: "absolute -top-[10px] left-1/2 -translate-x-1/2 whitespace-nowrap rounded-[11px] border-[3px] border-white px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",
1931
1966
  style: { background: "var(--pw-accent)" },
1932
- children: n
1967
+ children: t
1933
1968
  }
1934
1969
  ) : null
1935
1970
  ]
1936
1971
  }
1937
1972
  );
1938
1973
  }
1939
- function Ht({ block: t }) {
1940
- return /* @__PURE__ */ o("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children: t.text });
1974
+ function Gt({ block: r }) {
1975
+ return /* @__PURE__ */ o("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children: r.text });
1941
1976
  }
1942
- const Gt = {
1977
+ const Wt = {
1943
1978
  week: 0.25,
1944
1979
  month: 1,
1945
1980
  year: 12
1946
1981
  };
1947
- function Wt(t, e) {
1948
- return t ? e(`pricing.interval.${t}`, t) : e("pricing.interval.period", "period");
1982
+ function Zt(r, e) {
1983
+ return r ? e(`pricing.interval.${r}`, r) : e("pricing.interval.period", "period");
1949
1984
  }
1950
- function Zt({ block: t, ctx: e }) {
1951
- const { t: n } = w();
1952
- if (!t.queries.length) return null;
1953
- const i = e.bootstrap.prices.find((a) => a.id === e.selectedPriceId)?.interval ?? null, s = i ? Gt[i] : void 0;
1985
+ function Yt({ block: r, ctx: e }) {
1986
+ const { t } = w();
1987
+ if (!r.queries.length) return null;
1988
+ const i = e.bootstrap.prices.find((a) => a.id === e.selectedPriceId)?.interval ?? null, s = i ? Wt[i] : void 0;
1954
1989
  return /* @__PURE__ */ c("div", { class: "flex flex-col gap-2", children: [
1955
- /* @__PURE__ */ o("div", { class: "text-sm font-semibold text-gray-800", children: n("pricing.included_per", "Included per {interval}:", {
1956
- interval: Wt(i, n)
1990
+ /* @__PURE__ */ o("div", { class: "text-sm font-semibold text-gray-800", children: !i || i === "lifetime" ? t("pricing.included_total", "Included for lifetime:") : t("pricing.included_per", "Included per {interval}:", {
1991
+ interval: Zt(i, t)
1957
1992
  }) }),
1958
- /* @__PURE__ */ o("ul", { class: "flex flex-col gap-2", role: "list", children: t.queries.map((a) => {
1993
+ /* @__PURE__ */ o("ul", { class: "flex flex-col gap-2", role: "list", children: r.queries.map((a) => {
1959
1994
  const l = Number.isFinite(a.count) ? a.count : 0, d = s !== void 0 ? Math.round(l * s) : l;
1960
1995
  return /* @__PURE__ */ c("li", { class: `flex gap-3 ${a.desc ? "items-start" : "items-center"}`, children: [
1961
1996
  /* @__PURE__ */ o(
@@ -1983,7 +2018,7 @@ function Zt({ block: t, ctx: e }) {
1983
2018
  /* @__PURE__ */ o("span", { class: "font-semibold text-gray-900 text-sm", children: d }),
1984
2019
  " ",
1985
2020
  /* @__PURE__ */ o("span", { class: "text-sm text-gray-800", children: a.name }),
1986
- a.desc ? /* @__PURE__ */ c(W, { children: [
2021
+ a.desc ? /* @__PURE__ */ c(Y, { children: [
1987
2022
  /* @__PURE__ */ o("br", {}),
1988
2023
  /* @__PURE__ */ o("span", { class: "text-xs text-gray-400", children: a.desc })
1989
2024
  ] }) : null
@@ -1992,38 +2027,38 @@ function Zt({ block: t, ctx: e }) {
1992
2027
  }) })
1993
2028
  ] });
1994
2029
  }
1995
- const Yt = {
1996
- heading: Dt,
1997
- text: Ht,
1998
- price_grid: Nt,
2030
+ const Kt = {
2031
+ heading: qt,
2032
+ text: Gt,
2033
+ price_grid: Ft,
1999
2034
  cta_button: Tt,
2000
- auth_panel: Le,
2001
- current_session: Bt,
2002
- features_list: Mt,
2003
- tokenization_gate: Zt,
2004
- guarantee_badge: Pt,
2005
- offer_banner: bt
2035
+ auth_panel: Ee,
2036
+ current_session: Mt,
2037
+ features_list: Bt,
2038
+ tokenization_gate: Yt,
2039
+ guarantee_badge: Ot,
2040
+ offer_banner: wt
2006
2041
  };
2007
- function Kt({ layout: t, bootstrap: e, onAction: n, auth: r, authSession: i }) {
2008
- const s = ve(() => {
2009
- for (const h of t.blocks)
2010
- if (h.type === "price_grid" && h.popular_price_id && e.prices.some((y) => y.id === h.popular_price_id))
2011
- return h.popular_price_id;
2042
+ function Xt({ layout: r, bootstrap: e, onAction: t, auth: n, authSession: i, hasTopBanner: s }) {
2043
+ const a = _e(() => {
2044
+ for (const f of r.blocks)
2045
+ if (f.type === "price_grid" && f.popular_price_id && e.prices.some((g) => g.id === f.popular_price_id))
2046
+ return f.popular_price_id;
2012
2047
  return e.prices[0]?.id ?? null;
2013
- }, [t.blocks, e.prices]), [a, l] = x(s), d = {
2048
+ }, [r.blocks, e.prices]), [l, d] = x(a), p = {
2014
2049
  bootstrap: e,
2015
- selectedPriceId: a,
2016
- setSelectedPriceId: l,
2017
- onAction: n,
2018
- auth: r,
2050
+ selectedPriceId: l,
2051
+ setSelectedPriceId: d,
2052
+ onAction: t,
2053
+ auth: n,
2019
2054
  authSession: i
2020
- }, u = t.blocks.findIndex((h) => h.type === "cta_button"), p = u === -1 ? t.blocks : t.blocks.slice(0, u), f = u === -1 ? [] : t.blocks.slice(u), b = (h, y) => {
2021
- const k = Yt[h.type];
2022
- return k ? /* @__PURE__ */ o(k, { block: h, ctx: d }, `${h.type}-${y}`) : (typeof console < "u" && console.warn(`[paywall] unknown block type: ${h.type}`), null);
2055
+ }, u = r.blocks.findIndex((f) => f.type === "cta_button"), h = u === -1 ? r.blocks : r.blocks.slice(0, u), b = u === -1 ? [] : r.blocks.slice(u), _ = (f, g) => {
2056
+ const A = Kt[f.type];
2057
+ return A ? /* @__PURE__ */ o(A, { block: f, ctx: p }, `${f.type}-${g}`) : (typeof console < "u" && console.warn(`[paywall] unknown block type: ${f.type}`), null);
2023
2058
  };
2024
- return /* @__PURE__ */ c(W, { children: [
2025
- /* @__PURE__ */ o("div", { class: "flex-1 min-h-0 overflow-y-auto px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8", children: /* @__PURE__ */ o("div", { class: "flex flex-col gap-6", children: p.map(b) }) }),
2026
- f.length > 0 ? (
2059
+ return /* @__PURE__ */ c(Y, { children: [
2060
+ /* @__PURE__ */ o("div", { class: "flex-1 min-h-0 overflow-y-auto px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8", children: /* @__PURE__ */ o("div", { class: "flex flex-col gap-6", children: h.map(_) }) }),
2061
+ b.length > 0 ? (
2027
2062
  // Тонкий shadow-top вместо border-t — создаёт depth, читается как
2028
2063
  // «footer закреплён к низу dialog'а». Линия выглядела как divider
2029
2064
  // в обычном flow, не передавала sticky-character.
@@ -2032,168 +2067,169 @@ function Kt({ layout: t, bootstrap: e, onAction: n, auth: r, authSession: i }) {
2032
2067
  {
2033
2068
  class: "flex flex-col gap-4 bg-white px-6 pb-6 pt-3 sm:px-8",
2034
2069
  style: { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" },
2035
- children: f.map((h, y) => b(h, p.length + y))
2070
+ children: b.map((f, g) => _(f, h.length + g))
2036
2071
  }
2037
2072
  )
2038
2073
  ) : null
2039
2074
  ] });
2040
2075
  }
2041
- function Xt(t, e, n, r) {
2042
- return t ? r ? { open: !0, view: "purchased", error: null } : e.status === "idle" || e.status === "loading" ? { open: !0, view: "loading", error: null } : e.status === "error" ? { open: !0, view: "error", error: e.error } : n.kind === "support" ? { open: !0, view: "support", error: null } : n.kind === "auth_gate" ? { open: !0, view: "auth", error: null } : n.kind === "anon_gate" ? { open: !0, view: "anon", error: null } : n.kind === "awaiting_payment" ? { open: !0, view: "awaiting_payment", error: null } : n.kind === "popup_blocked" ? { open: !0, view: "popup_blocked", error: null } : n.kind === "purchase_success" ? { open: !0, view: "purchased", error: null } : n.kind === "verifying" ? { open: !0, view: "loading", error: null } : { open: !0, view: "layout", error: null } : { open: !1, view: null, error: null };
2076
+ function Jt(r, e, t, n) {
2077
+ return r ? n ? { open: !0, view: "purchased", error: null } : e.status === "idle" || e.status === "loading" ? { open: !0, view: "loading", error: null } : e.status === "error" ? { open: !0, view: "error", error: e.error } : t.kind === "support" ? { open: !0, view: "support", error: null } : t.kind === "auth_gate" ? { open: !0, view: "auth", error: null } : t.kind === "anon_gate" ? { open: !0, view: "anon", error: null } : t.kind === "awaiting_payment" ? { open: !0, view: "awaiting_payment", error: null } : t.kind === "popup_blocked" ? { open: !0, view: "popup_blocked", error: null } : t.kind === "purchase_success" ? { open: !0, view: "purchased", error: null } : t.kind === "verifying" ? { open: !0, view: "loading", error: null } : { open: !0, view: "layout", error: null } : { open: !1, view: null, error: null };
2043
2078
  }
2044
- function Jt(t, e) {
2045
- return t.open === e.open && t.view === e.view && t.error === e.error;
2079
+ function Qt(r, e) {
2080
+ return r.open === e.open && r.view === e.view && r.error === e.error;
2046
2081
  }
2047
- function Qt({
2048
- client: t,
2082
+ function er({
2083
+ client: r,
2049
2084
  open: e,
2050
- onClose: n,
2051
- onEvent: r,
2085
+ onClose: t,
2086
+ onEvent: n,
2052
2087
  initialView: i,
2053
2088
  purchased: s,
2054
2089
  renew: a,
2055
2090
  onState: l,
2056
- inline: d
2091
+ inline: d,
2092
+ locale: p
2057
2093
  }) {
2058
- const [u, p] = x({ status: "idle" }), [f, b] = x(
2059
- () => t.auth?.getCachedSession() ?? null
2060
- ), [h, y] = x(() => i === "support" ? { kind: "support", origin: "standalone" } : i === "auth" ? { kind: "auth_gate", origin: "standalone" } : i === "anon" ? { kind: "anon_gate", origin: "standalone" } : { kind: "layout" }), k = R(!1), j = R(null);
2061
- B(() => {
2094
+ const [u, h] = x({ status: "idle" }), [b, _] = x(
2095
+ () => r.auth?.getCachedSession() ?? null
2096
+ ), [f, g] = x(() => i === "support" ? { kind: "support", origin: "standalone" } : i === "auth" ? { kind: "auth_gate", origin: "standalone" } : i === "anon" ? { kind: "anon_gate", origin: "standalone" } : { kind: "layout" }), A = z(!1), M = z(null);
2097
+ T(() => {
2062
2098
  if (!l) return;
2063
- const m = Xt(e, u, h, s), g = j.current;
2064
- g && Jt(g, m) || (j.current = m, l(m));
2065
- }, [e, u, h, s, l]), B(() => {
2066
- if (t.auth)
2067
- return t.auth.onAuthChange((m, g) => b(g));
2068
- }, [t.auth]), B(() => {
2069
- if (typeof t.onBootstrapChange == "function")
2070
- return t.onBootstrapChange((m) => {
2071
- p(
2072
- (g) => g.status === "ready" ? { status: "ready", data: m } : g
2099
+ const m = Jt(e, u, f, s), y = M.current;
2100
+ y && Qt(y, m) || (M.current = m, l(m));
2101
+ }, [e, u, f, s, l]), T(() => {
2102
+ if (r.auth)
2103
+ return r.auth.onAuthChange((m, y) => _(y));
2104
+ }, [r.auth]), T(() => {
2105
+ if (typeof r.onBootstrapChange == "function")
2106
+ return r.onBootstrapChange((m) => {
2107
+ h(
2108
+ (y) => y.status === "ready" ? { status: "ready", data: m } : y
2073
2109
  );
2074
2110
  });
2075
- }, [t]), B(() => {
2111
+ }, [r]), T(() => {
2076
2112
  if (!e || u.status === "ready" || u.status === "loading") return;
2077
2113
  let m = !1;
2078
- return p({ status: "loading" }), t.bootstrap().then((g) => {
2079
- m || (p({ status: "ready", data: g }), r("ready", g), g.user?.has_active_subscription && !a && (r("purchase_completed", {
2114
+ return h({ status: "loading" }), r.bootstrap().then((y) => {
2115
+ m || (h({ status: "ready", data: y }), n("ready", y), y.user?.has_active_subscription && !a && (n("purchase_completed", {
2080
2116
  priceId: null,
2081
2117
  sessionId: null,
2082
2118
  restored: !0
2083
- }), y({ kind: "purchase_success", restored: !0 })));
2084
- }).catch((g) => {
2119
+ }), g({ kind: "purchase_success", restored: !0 })));
2120
+ }).catch((y) => {
2085
2121
  if (m) return;
2086
- const _ = g instanceof U ? g : new U("unknown", "Failed to load paywall", { cause: g });
2087
- p({ status: "error", error: _ }), r("error", _);
2122
+ const v = y instanceof j ? y : new j("unknown", "Failed to load paywall", { cause: y });
2123
+ h({ status: "error", error: v }), n("error", v);
2088
2124
  }), () => {
2089
2125
  m = !0;
2090
2126
  };
2091
- }, [e, t]), Ve(() => {
2127
+ }, [e, r]), He(() => {
2092
2128
  if (!e) {
2093
- y({ kind: "layout" }), k.current = !1;
2129
+ g({ kind: "layout" }), A.current = !1;
2094
2130
  return;
2095
2131
  }
2096
- i === "support" ? y({ kind: "support", origin: "standalone" }) : i === "auth" ? y({ kind: "auth_gate", origin: "standalone" }) : i === "anon" && y({ kind: "anon_gate", origin: "standalone" });
2132
+ i === "support" ? g({ kind: "support", origin: "standalone" }) : i === "auth" ? g({ kind: "auth_gate", origin: "standalone" }) : i === "anon" && g({ kind: "anon_gate", origin: "standalone" });
2097
2133
  }, [e, i]);
2098
- const T = async (m) => {
2134
+ const k = async (m) => {
2099
2135
  try {
2100
- const g = await t.createCheckout({
2136
+ const y = await r.createCheckout({
2101
2137
  priceId: m,
2102
2138
  ignoreActivePurchase: a === !0
2103
2139
  });
2104
- if (r("checkout_started", { priceId: m, url: g.url, acquiring: g.acquiring }), typeof window > "u" || !g.url) return;
2105
- const _ = window.open(g.url, "_blank");
2106
- if (_) {
2140
+ if (n("checkout_started", { priceId: m, url: y.url, acquiring: y.acquiring }), typeof window > "u" || !y.url) return;
2141
+ const v = window.open(y.url, "_blank");
2142
+ if (v) {
2107
2143
  try {
2108
- _.opener = null;
2144
+ v.opener = null;
2109
2145
  } catch {
2110
2146
  }
2111
- y({ kind: "awaiting_payment", priceId: m, url: g.url });
2147
+ g({ kind: "awaiting_payment", priceId: m, url: y.url });
2112
2148
  } else
2113
- y({ kind: "popup_blocked", priceId: m, url: g.url });
2114
- } catch (g) {
2115
- if (g instanceof U && g.code === "already_purchased") {
2149
+ g({ kind: "popup_blocked", priceId: m, url: y.url });
2150
+ } catch (y) {
2151
+ if (y instanceof j && y.code === "already_purchased") {
2116
2152
  try {
2117
- await t.getUser({ force: !0 });
2153
+ await r.getUser({ force: !0 });
2118
2154
  } catch {
2119
2155
  }
2120
- r("purchase_completed", { priceId: m, sessionId: null, restored: !0 }), y({ kind: "purchase_success", restored: !0 });
2156
+ n("purchase_completed", { priceId: m, sessionId: null, restored: !0 }), g({ kind: "purchase_success", restored: !0 });
2121
2157
  return;
2122
2158
  }
2123
- const _ = g instanceof U ? g : new U("checkout_failed", "Checkout failed", { cause: g });
2124
- r("error", _), y({ kind: "layout" });
2159
+ const v = y instanceof j ? y : new j("checkout_failed", "Checkout failed", { cause: y });
2160
+ n("error", v), g({ kind: "layout" });
2125
2161
  }
2126
- }, v = (m, g) => {
2162
+ }, E = (m, y) => {
2127
2163
  if (typeof window > "u") return;
2128
- const _ = window.open(g, "_blank");
2129
- if (_) {
2164
+ const v = window.open(y, "_blank");
2165
+ if (v) {
2130
2166
  try {
2131
- _.opener = null;
2167
+ v.opener = null;
2132
2168
  } catch {
2133
2169
  }
2134
- y({ kind: "awaiting_payment", priceId: m, url: g });
2170
+ g({ kind: "awaiting_payment", priceId: m, url: y });
2135
2171
  }
2136
2172
  };
2137
- B(() => {
2138
- if (h.kind !== "auth_gate" || !f || f.user.is_anonymous || k.current) return;
2139
- k.current = !0;
2140
- const m = h.pendingCheckout, g = h.origin;
2141
- y({ kind: "verifying" }), (async () => {
2173
+ T(() => {
2174
+ if (f.kind !== "auth_gate" || !b || b.user.is_anonymous || A.current) return;
2175
+ A.current = !0;
2176
+ const m = f.pendingCheckout, y = f.origin;
2177
+ g({ kind: "verifying" }), (async () => {
2142
2178
  if (!a)
2143
2179
  try {
2144
- if ((await t.getUser({ force: !0 })).has_active_subscription) {
2145
- r("purchase_completed", {
2180
+ if ((await r.getUser({ force: !0 })).has_active_subscription) {
2181
+ n("purchase_completed", {
2146
2182
  priceId: m?.priceId ?? null,
2147
2183
  sessionId: null,
2148
2184
  restored: !0
2149
- }), y({ kind: "purchase_success", restored: !0 });
2185
+ }), g({ kind: "purchase_success", restored: !0 });
2150
2186
  return;
2151
2187
  }
2152
2188
  } catch {
2153
2189
  }
2154
2190
  if (!m) {
2155
- g === "standalone" ? n() : y({ kind: "layout" });
2191
+ y === "standalone" ? t() : g({ kind: "layout" });
2156
2192
  return;
2157
2193
  }
2158
- await T(m.priceId);
2194
+ await k(m.priceId);
2159
2195
  })().finally(() => {
2160
- k.current = !1;
2196
+ A.current = !1;
2161
2197
  });
2162
- }, [f, h]);
2163
- const L = async (m, g) => {
2198
+ }, [b, f]);
2199
+ const I = async (m, y) => {
2164
2200
  if (m === "close") {
2165
- n();
2201
+ t();
2166
2202
  return;
2167
2203
  }
2168
2204
  if (m === "price_selected") {
2169
- r("price_selected", g);
2205
+ n("price_selected", y);
2170
2206
  return;
2171
2207
  }
2172
2208
  if (m === "restore") {
2173
- if (!t.auth) return;
2174
- const _ = t.auth.getCachedSession();
2175
- if (_ && !_.user.is_anonymous) return;
2176
- y({ kind: "auth_gate", intent: "restore" });
2209
+ if (!r.auth) return;
2210
+ const v = r.auth.getCachedSession();
2211
+ if (v && !v.user.is_anonymous) return;
2212
+ g({ kind: "auth_gate", intent: "restore" });
2177
2213
  return;
2178
2214
  }
2179
2215
  if (m === "support") {
2180
- y({ kind: "support", origin: "layout" });
2216
+ g({ kind: "support", origin: "layout" });
2181
2217
  return;
2182
2218
  }
2183
2219
  if (m === "checkout" && u.status === "ready") {
2184
- const _ = g?.priceId;
2185
- if (!_) {
2186
- r("error", new U("no_price", "No price selected"));
2220
+ const v = y?.priceId;
2221
+ if (!v) {
2222
+ n("error", new j("no_price", "No price selected"));
2187
2223
  return;
2188
2224
  }
2189
- const Z = u.data.settings.checkout_mode ?? "guest", S = t.auth?.getCachedSession() ?? null, E = !!S && !S.user.is_anonymous;
2190
- if (Z === "preauth" && !!t.auth && !E) {
2191
- y({ kind: "auth_gate", pendingCheckout: { priceId: _ } });
2225
+ const S = u.data.settings.checkout_mode ?? "guest", P = r.auth?.getCachedSession() ?? null, V = !!P && !P.user.is_anonymous;
2226
+ if (S === "preauth" && !!r.auth && !V) {
2227
+ g({ kind: "auth_gate", pendingCheckout: { priceId: v } });
2192
2228
  return;
2193
2229
  }
2194
- await T(_);
2230
+ await k(v);
2195
2231
  }
2196
- }, C = u.status === "ready" ? u.data.settings.brand_color : null, P = u.status === "ready" ? u.data.settings.allow_close !== !1 : !0, M = h.kind === "layout" && u.status === "ready" ? Ee(u.data.offers) : null, q = M ? /* @__PURE__ */ o(wt, { offer: M }) : null, z = {
2232
+ }, O = u.status === "ready" ? u.data.settings.brand_color : null, B = u.status === "ready" ? u.data.settings.allow_close !== !1 : !0, q = f.kind === "layout" && u.status === "ready" ? Te(u.data.offers) : null, D = q ? /* @__PURE__ */ o(kt, { offer: q }) : null, N = {
2197
2233
  type: "auth_panel",
2198
2234
  // Заголовок не задаём — AuthGate сам решит по intent'у (restore →
2199
2235
  // "Restore Purchases", остальные → дефолтный "Welcome back!").
@@ -2203,87 +2239,87 @@ function Qt({
2203
2239
  // чем хотим показывать "Signed in as ..." промежуточным экраном.
2204
2240
  hide_when_authenticated: !1,
2205
2241
  providers: u.status === "ready" ? u.data.settings.auth_providers : void 0
2206
- }, D = h.kind === "support" ? /* @__PURE__ */ o(
2207
- vt,
2242
+ }, L = f.kind === "support" ? /* @__PURE__ */ o(
2243
+ _t,
2208
2244
  {
2209
- client: t,
2210
- authSession: f,
2211
- origin: h.origin,
2245
+ client: r,
2246
+ authSession: b,
2247
+ origin: f.origin,
2212
2248
  onBack: () => {
2213
- h.origin === "standalone" ? n() : y({ kind: "layout" });
2249
+ f.origin === "standalone" ? t() : g({ kind: "layout" });
2214
2250
  }
2215
2251
  }
2216
- ) : null, A = h.kind === "auth_gate" && h.origin !== "standalone" || h.kind === "support", I = u.status === "ready" ? u.data : null;
2217
- return /* @__PURE__ */ o(Qe, { bootstrap: I, children: /* @__PURE__ */ o(
2218
- et,
2252
+ ) : null, C = f.kind === "auth_gate" && f.origin !== "standalone" || f.kind === "support", U = u.status === "ready" ? u.data : null;
2253
+ return /* @__PURE__ */ o(et, { bootstrap: U, forceLocale: p, children: /* @__PURE__ */ o(
2254
+ tt,
2219
2255
  {
2220
2256
  open: e,
2221
- onClose: n,
2222
- brandColor: C,
2223
- topBanner: q,
2224
- allowClose: P,
2225
- hideCloseButton: A,
2257
+ onClose: t,
2258
+ brandColor: O,
2259
+ topBanner: D,
2260
+ allowClose: B,
2261
+ hideCloseButton: C,
2226
2262
  inline: d,
2227
2263
  labelledBy: "pw-title",
2228
- children: s ? /* @__PURE__ */ o(we, { onContinue: n }) : h.kind === "purchase_success" ? /* @__PURE__ */ o(we, { restored: h.restored, onContinue: n }) : D || (u.status === "loading" || u.status === "idle" || h.kind === "verifying" ? /* @__PURE__ */ o(en, { verifying: h.kind === "verifying" }) : u.status === "error" ? /* @__PURE__ */ o(tn, { message: u.error.message }) : h.kind === "auth_gate" && t.auth ? /* @__PURE__ */ o(
2229
- ft,
2264
+ children: s ? /* @__PURE__ */ o(ke, { onContinue: t }) : f.kind === "purchase_success" ? /* @__PURE__ */ o(ke, { restored: f.restored, onContinue: t }) : L || (u.status === "loading" || u.status === "idle" || f.kind === "verifying" ? /* @__PURE__ */ o(tr, { verifying: f.kind === "verifying" }) : u.status === "error" ? /* @__PURE__ */ o(rr, { message: u.error.message }) : f.kind === "auth_gate" && r.auth ? /* @__PURE__ */ o(
2265
+ gt,
2230
2266
  {
2231
- block: z,
2267
+ block: N,
2232
2268
  bootstrap: u.data,
2233
- auth: t.auth,
2234
- authSession: f,
2235
- showBack: h.origin !== "standalone",
2236
- intent: h.intent ?? (h.origin === "standalone" ? "standalone" : "preauth"),
2269
+ auth: r.auth,
2270
+ authSession: b,
2271
+ showBack: f.origin !== "standalone",
2272
+ intent: f.intent ?? (f.origin === "standalone" ? "standalone" : "preauth"),
2237
2273
  onBack: () => {
2238
- h.origin === "standalone" ? n() : y({ kind: "layout" });
2274
+ f.origin === "standalone" ? t() : g({ kind: "layout" });
2239
2275
  }
2240
2276
  }
2241
- ) : h.kind === "anon_gate" && t.auth ? /* @__PURE__ */ o(
2242
- mt,
2277
+ ) : f.kind === "anon_gate" && r.auth ? /* @__PURE__ */ o(
2278
+ yt,
2243
2279
  {
2244
- auth: t.auth,
2280
+ auth: r.auth,
2245
2281
  onSuccess: () => {
2246
- h.origin === "standalone" ? n() : y({ kind: "layout" });
2282
+ f.origin === "standalone" ? t() : g({ kind: "layout" });
2247
2283
  },
2248
- onBack: h.origin === "standalone" ? void 0 : () => y({ kind: "layout" })
2284
+ onBack: f.origin === "standalone" ? void 0 : () => g({ kind: "layout" })
2249
2285
  }
2250
- ) : h.kind === "awaiting_payment" ? /* @__PURE__ */ o(
2251
- rn,
2286
+ ) : f.kind === "awaiting_payment" ? /* @__PURE__ */ o(
2287
+ ir,
2252
2288
  {
2253
- client: t,
2254
- onBack: () => y({ kind: "layout" }),
2289
+ client: r,
2290
+ onBack: () => g({ kind: "layout" }),
2255
2291
  onReopen: () => {
2256
2292
  if (typeof window > "u") return;
2257
- const m = window.open(h.url, "_blank");
2293
+ const m = window.open(f.url, "_blank");
2258
2294
  if (m)
2259
2295
  try {
2260
2296
  m.opener = null;
2261
2297
  } catch {
2262
2298
  }
2263
2299
  },
2264
- onRetry: () => T(h.priceId)
2300
+ onRetry: () => k(f.priceId)
2265
2301
  }
2266
- ) : h.kind === "popup_blocked" ? /* @__PURE__ */ o(nn, { onReopen: () => v(h.priceId, h.url) }) : /* @__PURE__ */ o(
2267
- Kt,
2302
+ ) : f.kind === "popup_blocked" ? /* @__PURE__ */ o(nr, { onReopen: () => E(f.priceId, f.url) }) : /* @__PURE__ */ o(
2303
+ Xt,
2268
2304
  {
2269
2305
  layout: u.data.layout,
2270
2306
  bootstrap: u.data,
2271
- onAction: L,
2272
- auth: t.auth,
2273
- authSession: f
2307
+ onAction: I,
2308
+ auth: r.auth,
2309
+ authSession: b
2274
2310
  }
2275
2311
  ))
2276
2312
  }
2277
2313
  ) });
2278
2314
  }
2279
- function en({ verifying: t }) {
2315
+ function tr({ verifying: r }) {
2280
2316
  const { t: e } = w();
2281
2317
  return /* @__PURE__ */ c("div", { class: "flex flex-col items-center justify-center gap-3 py-12", children: [
2282
2318
  /* @__PURE__ */ o("span", { class: "inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]" }),
2283
- /* @__PURE__ */ o("span", { class: "text-xs font-medium tracking-wide text-gray-500", children: t ? e("modal.verifying_subscription", "Checking your subscription…") : e("modal.loading", "Loading…") })
2319
+ /* @__PURE__ */ o("span", { class: "text-xs font-medium tracking-wide text-gray-500", children: r ? e("modal.verifying_subscription", "Checking your subscription…") : e("modal.loading", "Loading…") })
2284
2320
  ] });
2285
2321
  }
2286
- function tn({ message: t }) {
2322
+ function rr({ message: r }) {
2287
2323
  const { t: e } = w();
2288
2324
  return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
2289
2325
  /* @__PURE__ */ o("div", { class: "flex h-11 w-11 items-center justify-center rounded-full bg-red-50", children: /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
@@ -2291,10 +2327,10 @@ function tn({ message: t }) {
2291
2327
  /* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "8", stroke: "#dc2626", "stroke-width": "1.75" })
2292
2328
  ] }) }),
2293
2329
  /* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: e("modal.error_generic", "Something went wrong") }),
2294
- /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: t })
2330
+ /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: r })
2295
2331
  ] });
2296
2332
  }
2297
- function nn({ onReopen: t }) {
2333
+ function nr({ onReopen: r }) {
2298
2334
  const { t: e } = w();
2299
2335
  return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
2300
2336
  /* @__PURE__ */ o(
@@ -2315,7 +2351,7 @@ function nn({ onReopen: t }) {
2315
2351
  "button",
2316
2352
  {
2317
2353
  type: "button",
2318
- onClick: t,
2354
+ onClick: r,
2319
2355
  class: "mt-1 rounded-xl px-4 py-2 text-xs font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
2320
2356
  style: {
2321
2357
  background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
@@ -2326,26 +2362,26 @@ function nn({ onReopen: t }) {
2326
2362
  )
2327
2363
  ] });
2328
2364
  }
2329
- function rn({
2330
- client: t,
2365
+ function ir({
2366
+ client: r,
2331
2367
  onBack: e,
2332
- onReopen: n,
2333
- onRetry: r
2368
+ onReopen: t,
2369
+ onRetry: n
2334
2370
  }) {
2335
- const { t: i } = w(), [s, a] = x(!1), [l, d] = x(!1), u = R(null);
2336
- B(() => () => {
2337
- u.current !== null && clearTimeout(u.current);
2371
+ const { t: i } = w(), [s, a] = x(!1), [l, d] = x(!1), p = z(null);
2372
+ T(() => () => {
2373
+ p.current !== null && clearTimeout(p.current);
2338
2374
  }, []);
2339
- const p = async () => {
2375
+ const u = async () => {
2340
2376
  if (!s) {
2341
2377
  a(!0), d(!1);
2342
2378
  try {
2343
- if ((await t.getUser({ force: !0 })).has_active_subscription) {
2379
+ if ((await r.getUser({ force: !0 })).has_active_subscription) {
2344
2380
  typeof window < "u" && window.postMessage({ type: "paywall_purchase" }, "*");
2345
2381
  return;
2346
2382
  }
2347
- d(!0), u.current !== null && clearTimeout(u.current), u.current = setTimeout(() => {
2348
- d(!1), u.current = null;
2383
+ d(!0), p.current !== null && clearTimeout(p.current), p.current = setTimeout(() => {
2384
+ d(!1), p.current = null;
2349
2385
  }, 5e3);
2350
2386
  } catch {
2351
2387
  d(!0);
@@ -2385,7 +2421,7 @@ function rn({
2385
2421
  "button",
2386
2422
  {
2387
2423
  type: "button",
2388
- onClick: p,
2424
+ onClick: u,
2389
2425
  disabled: s,
2390
2426
  class: "mt-1 rounded-xl px-5 py-2.5 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 disabled:hover:brightness-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
2391
2427
  style: {
@@ -2403,7 +2439,7 @@ function rn({
2403
2439
  "button",
2404
2440
  {
2405
2441
  type: "button",
2406
- onClick: n,
2442
+ onClick: t,
2407
2443
  class: "mt-2.5 w-full rounded-xl border border-gray-200 bg-white px-3 py-2 text-xs font-semibold text-gray-700 transition-colors hover:border-gray-300 hover:bg-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
2408
2444
  children: i("payment.open_checkout_again", "Open checkout again")
2409
2445
  }
@@ -2413,18 +2449,18 @@ function rn({
2413
2449
  "button",
2414
2450
  {
2415
2451
  type: "button",
2416
- onClick: r,
2452
+ onClick: n,
2417
2453
  class: "self-center rounded-md px-2 py-1 text-xs text-gray-500 underline-offset-2 hover:text-gray-900 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
2418
2454
  children: i("payment.tab_closed_retry", "Tab closed? Try again")
2419
2455
  }
2420
2456
  )
2421
2457
  ] });
2422
2458
  }
2423
- function we({
2424
- onContinue: t,
2459
+ function ke({
2460
+ onContinue: r,
2425
2461
  restored: e = !1
2426
2462
  }) {
2427
- const { t: n } = w();
2463
+ const { t } = w();
2428
2464
  return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
2429
2465
  /* @__PURE__ */ o(
2430
2466
  "div",
@@ -2449,37 +2485,37 @@ function we({
2449
2485
  ) })
2450
2486
  }
2451
2487
  ),
2452
- /* @__PURE__ */ o("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children: e ? n("modal.purchase_restored_title", "Subscription restored") : n("modal.purchase_success_title", "Payment received") }),
2453
- /* @__PURE__ */ o("p", { class: "text-sm leading-relaxed text-gray-500", children: e ? n(
2488
+ /* @__PURE__ */ o("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children: e ? t("modal.purchase_restored_title", "Subscription restored") : t("modal.purchase_success_title", "Payment received") }),
2489
+ /* @__PURE__ */ o("p", { class: "text-sm leading-relaxed text-gray-500", children: e ? t(
2454
2490
  "modal.purchase_restored_subtitle",
2455
2491
  "Welcome back — your subscription is already active."
2456
- ) : n("modal.purchase_success_subtitle", "Your subscription is now active.") }),
2492
+ ) : t("modal.purchase_success_subtitle", "Your subscription is now active.") }),
2457
2493
  /* @__PURE__ */ o(
2458
2494
  "button",
2459
2495
  {
2460
2496
  type: "button",
2461
- onClick: t,
2497
+ onClick: r,
2462
2498
  class: "mt-3 rounded-xl px-5 py-2.5 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
2463
2499
  style: {
2464
2500
  background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
2465
2501
  boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
2466
2502
  },
2467
- children: n("modal.continue", "Continue")
2503
+ children: t("modal.continue", "Continue")
2468
2504
  }
2469
2505
  )
2470
2506
  ] });
2471
2507
  }
2472
- const on = 10 * 6e4, sn = 5e3, an = 3e4;
2473
- class ln {
2508
+ const or = 10 * 6e4, sr = 5e3, ar = 3e4;
2509
+ class lr {
2474
2510
  constructor(e) {
2475
2511
  this.timer = null, this.timeoutTimer = null, this.visibilityHandler = null, this.focusHandler = null, this.messageHandler = null, this.stopped = !1, this.checking = !1, this.opts = {
2476
2512
  client: e.client,
2477
2513
  onActive: e.onActive,
2478
2514
  onTimeout: e.onTimeout ?? (() => {
2479
2515
  }),
2480
- timeoutMs: e.timeoutMs ?? on,
2481
- visibleIntervalMs: e.visibleIntervalMs ?? sn,
2482
- hiddenIntervalMs: e.hiddenIntervalMs ?? an
2516
+ timeoutMs: e.timeoutMs ?? or,
2517
+ visibleIntervalMs: e.visibleIntervalMs ?? sr,
2518
+ hiddenIntervalMs: e.hiddenIntervalMs ?? ar
2483
2519
  };
2484
2520
  }
2485
2521
  start() {
@@ -2505,32 +2541,32 @@ class ln {
2505
2541
  }
2506
2542
  scheduleNext() {
2507
2543
  if (this.stopped) return;
2508
- const n = typeof document < "u" && document.visibilityState === "visible" ? this.opts.visibleIntervalMs : this.opts.hiddenIntervalMs;
2544
+ const t = typeof document < "u" && document.visibilityState === "visible" ? this.opts.visibleIntervalMs : this.opts.hiddenIntervalMs;
2509
2545
  this.timer = setTimeout(async () => {
2510
2546
  await this.check(), this.scheduleNext();
2511
- }, n);
2547
+ }, t);
2512
2548
  }
2513
2549
  handleVisibilityChange() {
2514
2550
  typeof document > "u" || (document.visibilityState === "visible" && this.check(), this.timer !== null && (clearTimeout(this.timer), this.timer = null), this.scheduleNext());
2515
2551
  }
2516
2552
  handleMessage(e) {
2517
- const n = e.data;
2518
- !n || typeof n != "object" || n.type === "paywall_purchase" && this.check();
2553
+ const t = e.data;
2554
+ !t || typeof t != "object" || t.type === "paywall_purchase" && this.check();
2519
2555
  }
2520
2556
  }
2521
- function cn() {
2557
+ function cr() {
2522
2558
  return !(typeof document > "u" || typeof window > "u" || typeof location < "u" && location.protocol === "chrome-extension:");
2523
2559
  }
2524
- const ae = { open: !1, view: null, error: null }, N = {
2560
+ const ae = { open: !1, view: null, error: null }, F = {
2525
2561
  status: "paywall_status",
2526
2562
  priceId: "paywall_price_id",
2527
2563
  sessionId: "paywall_session_id"
2528
2564
  };
2529
- let un = class {
2565
+ let ur = class {
2530
2566
  constructor(e) {
2531
2567
  this.handle = null, this.isOpen = !1, this.listeners = /* @__PURE__ */ new Map(), this.userUnsub = null, this.authUnsub = null, this.watcher = null, this.tracker = null, this.purchased = !1, this.trialStore = null, this.trialStoreConfig = null, this.lastTrialStatus = null, this.trialExpiredFired = !1, this.lastVisibility = null, this.currentState = ae, this.stateListeners = /* @__PURE__ */ new Set();
2532
- const { auth: n, ownsAuth: r } = dn(e);
2533
- this.auth = n, this.ownsAuth = r, this.billing = e.client ?? new Ue({ ...e, auth: this.auth }), this.host = e.host, this.shadowMode = e.shadowMode ?? "closed", this.mountThenLoad = e.mountThenLoad ?? !0, this.inline = e.inline === !0, this.userUnsub = this.billing.onUserChange((i) => {
2568
+ const { auth: t, ownsAuth: n } = dr(e);
2569
+ this.auth = t, this.ownsAuth = n, this.billing = e.client ?? new Re({ ...e, auth: this.auth }), this.host = e.host, this.shadowMode = e.shadowMode ?? "closed", this.mountThenLoad = e.mountThenLoad ?? !0, this.inline = e.inline === !0, this.forceLocale = e.locale ?? null, this.userUnsub = this.billing.onUserChange((i) => {
2534
2570
  this.emit("userChange", i);
2535
2571
  }), this.auth && (this.authUnsub = this.auth.onAuthChange((i, s) => {
2536
2572
  this.emit("authChange", { event: i, session: s });
@@ -2538,20 +2574,20 @@ let un = class {
2538
2574
  }
2539
2575
  initTracker(e) {
2540
2576
  if (e === !1) return;
2541
- const n = typeof e == "object" && e !== null ? e : {};
2542
- if (n.enabled === !1) return;
2543
- const r = n.endpoint ?? `${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;
2544
- this.tracker = new je({
2545
- endpoint: r,
2577
+ const t = typeof e == "object" && e !== null ? e : {};
2578
+ if (t.enabled === !1) return;
2579
+ const n = t.endpoint ?? `${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;
2580
+ this.tracker = new ze({
2581
+ endpoint: n,
2546
2582
  paywallId: this.billing.paywallId,
2547
2583
  capabilities: this.billing.capabilities,
2548
2584
  getVisitorId: () => this.billing.getVisitorId(),
2549
2585
  getCachedVisitorId: () => this.billing.getCachedVisitorId(),
2550
2586
  getUserId: () => this.billing.getIdentity()?.userId ?? null,
2551
- flushIntervalMs: n.flushIntervalMs,
2552
- maxBufferSize: n.maxBufferSize,
2553
- fetch: n.fetch,
2554
- sendBeacon: n.sendBeacon
2587
+ flushIntervalMs: t.flushIntervalMs,
2588
+ maxBufferSize: t.maxBufferSize,
2589
+ fetch: t.fetch,
2590
+ sendBeacon: t.sendBeacon
2555
2591
  }), this.on("open", () => this.tracker?.track("paywall_opened")), this.on(
2556
2592
  "ready",
2557
2593
  (i) => this.tracker?.track("paywall_viewed", {
@@ -2604,8 +2640,8 @@ let un = class {
2604
2640
  * Самый частый кейс — `track('app_opened')` от хоста сразу после загрузки
2605
2641
  * приложения, чтобы зафиксировать воронку до открытия пейвола.
2606
2642
  */
2607
- track(e, n) {
2608
- this.tracker?.track(e, n);
2643
+ track(e, t) {
2644
+ this.tracker?.track(e, t);
2609
2645
  }
2610
2646
  /**
2611
2647
  * Удобный шорткат вместо `paywall.on('userChange', cb)` — самый частый
@@ -2628,18 +2664,30 @@ let un = class {
2628
2664
  setBootstrap(e) {
2629
2665
  this.billing.setBootstrap(e);
2630
2666
  }
2631
- on(e, n) {
2632
- let r = this.listeners.get(e);
2633
- return r || (r = /* @__PURE__ */ new Set(), this.listeners.set(e, r)), r.add(n), () => r.delete(n);
2634
- }
2635
- off(e, n) {
2636
- this.listeners.get(e)?.delete(n);
2637
- }
2638
- emit(e, ...n) {
2639
- const r = this.listeners.get(e);
2640
- if (!r) return;
2641
- const i = n[0];
2642
- for (const s of r)
2667
+ /**
2668
+ * Сменить force-locale на лету — для live-preview редактора админки, когда
2669
+ * юзер переключает «Preview as user from <country>». Грузит соответствующий
2670
+ * static-чанк и форсит re-render через handle.update. См. PaywallUIOptions.locale.
2671
+ *
2672
+ * Передай `null`/`undefined`, чтобы вернуть автоматическую резолв-логику
2673
+ * (navigator.language → locale_default).
2674
+ */
2675
+ setLocale(e) {
2676
+ const t = e ?? null;
2677
+ t !== this.forceLocale && (this.forceLocale = t, this.handle && this.handle.update({ locale: t }));
2678
+ }
2679
+ on(e, t) {
2680
+ let n = this.listeners.get(e);
2681
+ return n || (n = /* @__PURE__ */ new Set(), this.listeners.set(e, n)), n.add(t), () => n.delete(t);
2682
+ }
2683
+ off(e, t) {
2684
+ this.listeners.get(e)?.delete(t);
2685
+ }
2686
+ emit(e, ...t) {
2687
+ const n = this.listeners.get(e);
2688
+ if (!n) return;
2689
+ const i = t[0];
2690
+ for (const s of n)
2643
2691
  try {
2644
2692
  s(i);
2645
2693
  } catch (a) {
@@ -2715,43 +2763,43 @@ let un = class {
2715
2763
  openAnonGate(e = {}) {
2716
2764
  this.auth && this.openInternal("anon", { ...e, skipTrial: !0, skipVisibility: !0 });
2717
2765
  }
2718
- openInternal(e, n) {
2719
- n.identity && this.billing.setIdentity(n.identity), this.purchased = !1;
2720
- const r = n.skipTrial === !0 || e === "support", i = n.skipVisibility === !0 || e === "support" || e === "auth" || e === "anon", s = n.renew === !0;
2721
- if (r && i) {
2766
+ openInternal(e, t) {
2767
+ t.identity && this.billing.setIdentity(t.identity), this.purchased = !1;
2768
+ const n = t.skipTrial === !0 || e === "support", i = t.skipVisibility === !0 || e === "support" || e === "auth" || e === "anon", s = t.renew === !0;
2769
+ if (n && i) {
2722
2770
  this.mountAndShow(e, { renew: s });
2723
2771
  return;
2724
2772
  }
2725
2773
  const a = this.billing.getCachedBootstrap();
2726
2774
  if (a) {
2727
- this.runOpenGates(e, a, { skipTrial: r, skipVisibility: i, renew: s });
2775
+ this.runOpenGates(e, a, { skipTrial: n, skipVisibility: i, renew: s });
2728
2776
  return;
2729
2777
  }
2730
2778
  if (this.mountThenLoad) {
2731
- this.mountAndShow(e, { renew: s }), this.billing.bootstrap().then((l) => this.runDelayedGates(l, { skipTrial: r, skipVisibility: i })).catch(() => {
2779
+ this.mountAndShow(e, { renew: s }), this.billing.bootstrap().then((l) => this.runDelayedGates(l, { skipTrial: n, skipVisibility: i })).catch(() => {
2732
2780
  });
2733
2781
  return;
2734
2782
  }
2735
- this.billing.bootstrap().then((l) => this.runOpenGates(e, l, { skipTrial: r, skipVisibility: i, renew: s })).catch(() => {
2783
+ this.billing.bootstrap().then((l) => this.runOpenGates(e, l, { skipTrial: n, skipVisibility: i, renew: s })).catch(() => {
2736
2784
  this.mountAndShow(e, { renew: s });
2737
2785
  });
2738
2786
  }
2739
2787
  /** Применить gates ПОСЛЕ того, как модалка уже смонтирована (mount-then-load
2740
2788
  * путь). Если gate блокирует — close() + emit. Если юзер уже сам закрыл
2741
2789
  * модалку до резолва bootstrap'а — no-op (isOpen=false). */
2742
- runDelayedGates(e, n) {
2790
+ runDelayedGates(e, t) {
2743
2791
  if (!this.isOpen) return;
2744
- if (!n.skipVisibility) {
2792
+ if (!t.skipVisibility) {
2745
2793
  const s = e.settings.visibility;
2746
2794
  if (s && (this.lastVisibility = s, !s.visible)) {
2747
2795
  this.close(), this.emit("visibility_blocked", s);
2748
2796
  return;
2749
2797
  }
2750
2798
  }
2751
- if (n.skipTrial) return;
2752
- const r = e.settings.trial;
2753
- if (!r) return;
2754
- const i = this.ensureTrialStore(r);
2799
+ if (t.skipTrial) return;
2800
+ const n = e.settings.trial;
2801
+ if (!n) return;
2802
+ const i = this.ensureTrialStore(n);
2755
2803
  i.check().then(async (s) => {
2756
2804
  if (this.isOpen && (this.lastTrialStatus = s, s.mode !== "none")) {
2757
2805
  if (s.blocked) {
@@ -2770,30 +2818,30 @@ let un = class {
2770
2818
  // вести trial-стейт «осталось N показов» под юзером, который вообще не
2771
2819
  // должен увидеть пейвол по таргетингу — бессмысленно: при возврате в
2772
2820
  // правильную страну он окажется со «слипшимся» триал-счётчиком.
2773
- runOpenGates(e, n, r) {
2774
- if (!r.skipVisibility) {
2775
- const i = n.settings.visibility;
2821
+ runOpenGates(e, t, n) {
2822
+ if (!n.skipVisibility) {
2823
+ const i = t.settings.visibility;
2776
2824
  if (i && (this.lastVisibility = i, !i.visible)) {
2777
2825
  this.emit("visibility_blocked", i);
2778
2826
  return;
2779
2827
  }
2780
2828
  }
2781
- if (r.skipTrial) {
2782
- this.mountAndShow(e, { renew: r.renew });
2829
+ if (n.skipTrial) {
2830
+ this.mountAndShow(e, { renew: n.renew });
2783
2831
  return;
2784
2832
  }
2785
- this.gateThroughTrial(e, n, r.renew);
2833
+ this.gateThroughTrial(e, t, n.renew);
2786
2834
  }
2787
- gateThroughTrial(e, n, r) {
2788
- const i = n.settings.trial;
2835
+ gateThroughTrial(e, t, n) {
2836
+ const i = t.settings.trial;
2789
2837
  if (!i) {
2790
- this.mountAndShow(e, { renew: r });
2838
+ this.mountAndShow(e, { renew: n });
2791
2839
  return;
2792
2840
  }
2793
2841
  const s = this.ensureTrialStore(i);
2794
2842
  s.check().then(async (a) => {
2795
2843
  if (this.lastTrialStatus = a, a.mode === "none") {
2796
- this.mountAndShow(e, { renew: r });
2844
+ this.mountAndShow(e, { renew: n });
2797
2845
  return;
2798
2846
  }
2799
2847
  if (a.blocked) {
@@ -2801,50 +2849,51 @@ let un = class {
2801
2849
  this.lastTrialStatus = l, this.emit("trial_blocked", l);
2802
2850
  return;
2803
2851
  }
2804
- this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(e, { renew: r });
2852
+ this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(e, { renew: n });
2805
2853
  }).catch((a) => {
2806
- typeof console < "u" && console.warn("[paywall] trial check failed", a), this.mountAndShow(e, { renew: r });
2854
+ typeof console < "u" && console.warn("[paywall] trial check failed", a), this.mountAndShow(e, { renew: n });
2807
2855
  });
2808
2856
  }
2809
2857
  ensureTrialStore(e) {
2810
- if (this.trialStore && this.trialStoreConfig && fn(this.trialStoreConfig, e))
2858
+ if (this.trialStore && this.trialStoreConfig && fr(this.trialStoreConfig, e))
2811
2859
  return this.trialStore;
2812
2860
  this.trialStoreConfig = e;
2813
- const n = this.billing.createTrialStore;
2814
- return this.trialStore = typeof n == "function" ? n.call(this.billing, e) : Re(this.billing.getStorage(), this.billing.paywallId, e), this.trialStore;
2861
+ const t = this.billing.createTrialStore;
2862
+ return this.trialStore = typeof t == "function" ? t.call(this.billing, e) : De(this.billing.getStorage(), this.billing.paywallId, e), this.trialStore;
2815
2863
  }
2816
- mountAndShow(e, n = {}) {
2817
- const r = n.renew === !0;
2864
+ mountAndShow(e, t = {}) {
2865
+ const n = t.renew === !0;
2818
2866
  if (this.handle) {
2819
- this.isOpen = !0, this.handle.update({ open: !0, initialView: e, purchased: !1, renew: r }), this.emit("open");
2867
+ this.isOpen = !0, this.handle.update({ open: !0, initialView: e, purchased: !1, renew: n }), this.emit("open");
2820
2868
  return;
2821
2869
  }
2822
- this.isOpen = !0, this.handle = Ge(
2823
- Qt,
2870
+ this.isOpen = !0, this.handle = Ze(
2871
+ er,
2824
2872
  {
2825
2873
  client: this.billing,
2826
2874
  open: !0,
2827
2875
  initialView: e,
2828
2876
  purchased: !1,
2829
- renew: r,
2877
+ renew: n,
2830
2878
  onClose: () => this.close(),
2831
2879
  onEvent: (i, s) => {
2832
2880
  this.emit(i, s), i === "checkout_started" && this.startUserWatcher();
2833
2881
  },
2834
2882
  onState: (i) => this.applyState(i),
2835
- inline: this.inline
2883
+ inline: this.inline,
2884
+ locale: this.forceLocale
2836
2885
  },
2837
2886
  { host: this.host, shadowMode: this.shadowMode, inline: this.inline }
2838
2887
  ), this.emit("open");
2839
2888
  }
2840
2889
  applyState(e) {
2841
- if (!pn(this.currentState, e)) {
2890
+ if (!pr(this.currentState, e)) {
2842
2891
  this.currentState = e;
2843
- for (const n of this.stateListeners)
2892
+ for (const t of this.stateListeners)
2844
2893
  try {
2845
- n(e);
2846
- } catch (r) {
2847
- console.warn("[paywall] onStateChange listener threw", r);
2894
+ t(e);
2895
+ } catch (n) {
2896
+ console.warn("[paywall] onStateChange listener threw", n);
2848
2897
  }
2849
2898
  }
2850
2899
  }
@@ -2869,12 +2918,12 @@ let un = class {
2869
2918
  *
2870
2919
  * Возвращает unsubscribe.
2871
2920
  */
2872
- onStateChange(e, n = {}) {
2921
+ onStateChange(e, t = {}) {
2873
2922
  this.stateListeners.add(e);
2874
- const r = n.immediate ?? "microtask";
2875
- if (r !== "none") {
2923
+ const n = t.immediate ?? "microtask";
2924
+ if (n !== "none") {
2876
2925
  const i = this.currentState;
2877
- if (r === "sync")
2926
+ if (n === "sync")
2878
2927
  try {
2879
2928
  e(i);
2880
2929
  } catch (s) {
@@ -2944,10 +2993,10 @@ let un = class {
2944
2993
  * `getAccess()`, а не только после первого `open()`.
2945
2994
  */
2946
2995
  async getAccess(e = {}) {
2947
- let n = this.billing.getCachedBootstrap();
2948
- if (!n)
2996
+ let t = this.billing.getCachedBootstrap();
2997
+ if (!t)
2949
2998
  try {
2950
- n = await this.billing.bootstrap({ signal: e.signal });
2999
+ t = await this.billing.bootstrap({ signal: e.signal });
2951
3000
  } catch {
2952
3001
  const a = this.billing.getCachedUser();
2953
3002
  return a?.has_active_subscription ? {
@@ -2964,33 +3013,33 @@ let un = class {
2964
3013
  user: a
2965
3014
  };
2966
3015
  }
2967
- const r = n.user ?? null;
2968
- if (r?.has_active_subscription)
3016
+ const n = t.user ?? null;
3017
+ if (n?.has_active_subscription)
2969
3018
  return {
2970
3019
  access: "granted",
2971
3020
  reason: "has_subscription",
2972
- visibility: n.settings.visibility ?? null,
3021
+ visibility: t.settings.visibility ?? null,
2973
3022
  trial: null,
2974
- user: r
3023
+ user: n
2975
3024
  };
2976
3025
  let i = null;
2977
3026
  if (!e.skipVisibility) {
2978
- const a = n.settings.visibility;
3027
+ const a = t.settings.visibility;
2979
3028
  if (a && (i = a, this.lastVisibility = a, !a.visible))
2980
- return { access: "granted", reason: "visibility_blocked", visibility: i, trial: null, user: r };
3029
+ return { access: "granted", reason: "visibility_blocked", visibility: i, trial: null, user: n };
2981
3030
  }
2982
3031
  let s = null;
2983
3032
  if (!e.skipTrial) {
2984
- const a = n.settings.trial;
3033
+ const a = t.settings.trial;
2985
3034
  if (a)
2986
3035
  try {
2987
3036
  if (s = await this.ensureTrialStore(a).check(), this.lastTrialStatus = s, s.blocked)
2988
- return { access: "granted", reason: "trial_blocked", visibility: i, trial: s, user: r };
3037
+ return { access: "granted", reason: "trial_blocked", visibility: i, trial: s, user: n };
2989
3038
  } catch (l) {
2990
3039
  typeof console < "u" && console.warn("[paywall] getAccess: trial check failed", l);
2991
3040
  }
2992
3041
  }
2993
- return { access: "blocked", reason: "no_subscription", visibility: i, trial: s, user: r };
3042
+ return { access: "blocked", reason: "no_subscription", visibility: i, trial: s, user: n };
2994
3043
  }
2995
3044
  /** Сбросить состояние триала в storage. Полезно для дев-режима / админ-кнопки
2996
3045
  * «прогнать сценарий заново». В проде хост обычно не дёргает. */
@@ -3004,14 +3053,14 @@ let un = class {
3004
3053
  // В extension popup runtime — no-op (popup не доживёт). Там полагаемся на
3005
3054
  // bootstrap при следующем открытии.
3006
3055
  startUserWatcher() {
3007
- this.watcher || cn() && (this.watcher = new ln({
3056
+ this.watcher || cr() && (this.watcher = new lr({
3008
3057
  client: this.billing,
3009
3058
  onActive: (e) => {
3010
3059
  this.watcher = null, this.emit("purchase_completed", { priceId: null, sessionId: null });
3011
- const n = this.billing.getCachedBootstrap()?.settings.success_redirect_url;
3012
- if (n && typeof window < "u")
3060
+ const t = this.billing.getCachedBootstrap()?.settings.success_redirect_url;
3061
+ if (t && typeof window < "u")
3013
3062
  try {
3014
- window.location.assign(n);
3063
+ window.location.assign(t);
3015
3064
  return;
3016
3065
  } catch {
3017
3066
  }
@@ -3033,80 +3082,80 @@ let un = class {
3033
3082
  */
3034
3083
  checkReturn() {
3035
3084
  if (typeof window > "u") return;
3036
- const e = new URL(window.location.href), n = ke(e.hash.replace(/^#/, "")), r = ke(e.search.replace(/^\?/, "")), i = n ?? r;
3085
+ const e = new URL(window.location.href), t = ve(e.hash.replace(/^#/, "")), n = ve(e.search.replace(/^\?/, "")), i = t ?? n;
3037
3086
  i && (i.status === "paid" ? (this.emit("purchase_completed", {
3038
3087
  priceId: i.priceId,
3039
3088
  sessionId: i.sessionId
3040
- }), gn(i)) : (i.status === "failed" || i.status === "cancelled") && this.emit("purchase_failed", { reason: i.status }), mn(e));
3089
+ }), gr(i)) : (i.status === "failed" || i.status === "cancelled") && this.emit("purchase_failed", { reason: i.status }), mr(e));
3041
3090
  }
3042
3091
  destroy() {
3043
3092
  this.tracker?.destroy(), this.tracker = null, this.listeners.clear(), this.stateListeners.clear(), this.watcher?.stop(), this.watcher = null, this.userUnsub?.(), this.userUnsub = null, this.authUnsub?.(), this.authUnsub = null, this.ownsAuth && this.auth && this.auth.destroy?.(), this.ownsAuth = !1, this.billing.destroy?.(), this.handle?.unmount(), this.handle = null, this.isOpen = !1, this.currentState = ae;
3044
3093
  }
3045
3094
  };
3046
- function dn(t) {
3047
- if (!t.auth) return { auth: void 0, ownsAuth: !1 };
3048
- if (t.auth instanceof ue || hn(t.auth))
3049
- return { auth: t.auth, ownsAuth: !1 };
3050
- const e = t.auth === !0 ? {} : t.auth;
3095
+ function dr(r) {
3096
+ if (!r.auth) return { auth: void 0, ownsAuth: !1 };
3097
+ if (r.auth instanceof ue || hr(r.auth))
3098
+ return { auth: r.auth, ownsAuth: !1 };
3099
+ const e = r.auth === !0 ? {} : r.auth;
3051
3100
  return {
3052
3101
  auth: new ue({
3053
- paywallId: t.paywallId,
3054
- apiOrigin: e.apiOrigin ?? t.apiOrigin,
3055
- storage: e.storage ?? t.storage,
3056
- fetch: e.fetch ?? t.fetch,
3102
+ paywallId: r.paywallId,
3103
+ apiOrigin: e.apiOrigin ?? r.apiOrigin,
3104
+ storage: e.storage ?? r.storage,
3105
+ fetch: e.fetch ?? r.fetch,
3057
3106
  openPopup: e.openPopup
3058
3107
  }),
3059
3108
  ownsAuth: !0
3060
3109
  };
3061
3110
  }
3062
- function hn(t) {
3063
- if (typeof t != "object" || t === null) return !1;
3064
- const e = t;
3111
+ function hr(r) {
3112
+ if (typeof r != "object" || r === null) return !1;
3113
+ const e = r;
3065
3114
  return typeof e.onAuthChange == "function" && typeof e.getCachedSession == "function" && typeof e.signOut == "function";
3066
3115
  }
3067
- function pn(t, e) {
3068
- return t.open === e.open && t.view === e.view && t.error === e.error;
3116
+ function pr(r, e) {
3117
+ return r.open === e.open && r.view === e.view && r.error === e.error;
3069
3118
  }
3070
- function fn(t, e) {
3071
- return t.mode === e.mode && t.payload === e.payload && t.storage === e.storage;
3119
+ function fr(r, e) {
3120
+ return r.mode === e.mode && r.payload === e.payload && r.storage === e.storage;
3072
3121
  }
3073
- function ke(t) {
3074
- if (!t) return null;
3075
- const e = new URLSearchParams(t), n = e.get(N.status);
3076
- return n ? {
3077
- status: n,
3078
- priceId: e.get(N.priceId),
3079
- sessionId: e.get(N.sessionId)
3122
+ function ve(r) {
3123
+ if (!r) return null;
3124
+ const e = new URLSearchParams(r), t = e.get(F.status);
3125
+ return t ? {
3126
+ status: t,
3127
+ priceId: e.get(F.priceId),
3128
+ sessionId: e.get(F.sessionId)
3080
3129
  } : null;
3081
3130
  }
3082
- function gn(t) {
3131
+ function gr(r) {
3083
3132
  if (!(typeof window > "u" || !window.opener))
3084
3133
  try {
3085
3134
  window.opener.postMessage(
3086
3135
  {
3087
3136
  type: "paywall_purchase",
3088
- status: t.status,
3089
- priceId: t.priceId,
3090
- sessionId: t.sessionId
3137
+ status: r.status,
3138
+ priceId: r.priceId,
3139
+ sessionId: r.sessionId
3091
3140
  },
3092
3141
  "*"
3093
3142
  );
3094
3143
  } catch {
3095
3144
  }
3096
3145
  }
3097
- function mn(t) {
3098
- const e = (r, i) => {
3099
- if (!r) return "";
3100
- const s = new URLSearchParams(r.replace(/^[?#]/, ""));
3101
- s.delete(N.status), s.delete(N.priceId), s.delete(N.sessionId);
3146
+ function mr(r) {
3147
+ const e = (n, i) => {
3148
+ if (!n) return "";
3149
+ const s = new URLSearchParams(n.replace(/^[?#]/, ""));
3150
+ s.delete(F.status), s.delete(F.priceId), s.delete(F.sessionId);
3102
3151
  const a = s.toString();
3103
3152
  return a ? i + a : "";
3104
- }, n = t.pathname + e(t.search, "?") + e(t.hash, "#");
3105
- window.history.replaceState(null, "", n);
3153
+ }, t = r.pathname + e(r.search, "?") + e(r.hash, "#");
3154
+ window.history.replaceState(null, "", t);
3106
3155
  }
3107
- class yn {
3108
- constructor(e, n, r) {
3109
- this.transport = e, this.paywallId = n, this.config = r;
3156
+ class yr {
3157
+ constructor(e, t, n) {
3158
+ this.transport = e, this.paywallId = t, this.config = n;
3110
3159
  }
3111
3160
  async check() {
3112
3161
  return this.transport.request("trial.check", {
@@ -3127,33 +3176,33 @@ class yn {
3127
3176
  });
3128
3177
  }
3129
3178
  }
3130
- class xn {
3131
- constructor(e, n) {
3132
- this.transport = e, this.cachedBootstrap = null, this.cachedUser = null, this.cachedBalances = null, this.identity = null, this.userListeners = /* @__PURE__ */ new Set(), this.balanceListeners = /* @__PURE__ */ new Set(), this.bootstrapListeners = /* @__PURE__ */ new Set(), this.unsubUserBroadcast = null, this.unsubBalancesBroadcast = null, this.paywallId = n.paywallId, this.apiOrigin = n.apiOrigin, this.remoteStorageAdapter = {
3133
- getItem: (r) => this.transport.request("storage.get", { key: r }),
3134
- setItem: async (r, i) => {
3135
- await this.transport.request("storage.set", { key: r, value: i });
3179
+ class xr {
3180
+ constructor(e, t) {
3181
+ this.transport = e, this.cachedBootstrap = null, this.cachedUser = null, this.cachedBalances = null, this.identity = null, this.userListeners = /* @__PURE__ */ new Set(), this.balanceListeners = /* @__PURE__ */ new Set(), this.bootstrapListeners = /* @__PURE__ */ new Set(), this.unsubUserBroadcast = null, this.unsubBalancesBroadcast = null, this.paywallId = t.paywallId, this.apiOrigin = t.apiOrigin, this.remoteStorageAdapter = {
3182
+ getItem: (n) => this.transport.request("storage.get", { key: n }),
3183
+ setItem: async (n, i) => {
3184
+ await this.transport.request("storage.set", { key: n, value: i });
3136
3185
  },
3137
- removeItem: async (r) => {
3138
- await this.transport.request("storage.remove", { key: r });
3186
+ removeItem: async (n) => {
3187
+ await this.transport.request("storage.remove", { key: n });
3139
3188
  }
3140
3189
  // watch не реализуем — для cross-context уведомлений consumer'ы (AuthClient,
3141
3190
  // TrialStore) подписываются на broadcast-events напрямую через transport.
3142
3191
  // Если когда-то понадобится — добавим storage.watch broadcast.
3143
- }, this.unsubUserBroadcast = this.transport.on("userChange", (r) => {
3144
- this.applyUser(r);
3145
- }), this.unsubBalancesBroadcast = this.transport.on("balancesChange", (r) => {
3146
- this.applyBalances([...r]);
3192
+ }, this.unsubUserBroadcast = this.transport.on("userChange", (n) => {
3193
+ this.applyUser(n);
3194
+ }), this.unsubBalancesBroadcast = this.transport.on("balancesChange", (n) => {
3195
+ this.applyBalances([...n]);
3147
3196
  });
3148
3197
  }
3149
3198
  // === Bootstrap ===
3150
3199
  async bootstrap(e = {}) {
3151
- const n = await this.transport.request(
3200
+ const t = await this.transport.request(
3152
3201
  "billing.bootstrap",
3153
3202
  { force: e.force },
3154
3203
  { signal: e.signal }
3155
3204
  );
3156
- return this.applyBootstrap(n), n.user && this.applyUser(n.user), n;
3205
+ return this.applyBootstrap(t), t.user && this.applyUser(t.user), t;
3157
3206
  }
3158
3207
  getCachedBootstrap() {
3159
3208
  return this.cachedBootstrap;
@@ -3166,12 +3215,12 @@ class xn {
3166
3215
  * обновляется → listener вызывается). Cross-surface revalidate (другая вкладка
3167
3216
  * обновила bootstrap) не доезжает до popup'а — для этого нужен отдельный
3168
3217
  * bootstrapChange-broadcast в protocol.ts/server.ts. */
3169
- onBootstrapChange(e, n = {}) {
3218
+ onBootstrapChange(e, t = {}) {
3170
3219
  this.bootstrapListeners.add(e);
3171
- const r = n.immediate ?? "microtask";
3172
- if (this.cachedBootstrap && r !== "none") {
3220
+ const n = t.immediate ?? "microtask";
3221
+ if (this.cachedBootstrap && n !== "none") {
3173
3222
  const i = this.cachedBootstrap;
3174
- if (r === "sync")
3223
+ if (n === "sync")
3175
3224
  try {
3176
3225
  e(i);
3177
3226
  } catch (s) {
@@ -3201,12 +3250,12 @@ class xn {
3201
3250
  }
3202
3251
  // === User ===
3203
3252
  async getUser(e = {}) {
3204
- const n = await this.transport.request(
3253
+ const t = await this.transport.request(
3205
3254
  "billing.getUser",
3206
3255
  { force: e.force },
3207
3256
  { signal: e.signal }
3208
3257
  );
3209
- return this.applyUser(n), n;
3258
+ return this.applyUser(t), t;
3210
3259
  }
3211
3260
  getCachedUser() {
3212
3261
  return this.cachedUser;
@@ -3214,12 +3263,12 @@ class xn {
3214
3263
  /** Подписка на user-state. Mirror'имся на broadcast'ы offscreen'а; initial
3215
3264
  * snapshot отдаётся через microtask из локального cache (если есть) —
3216
3265
  * ровно как в BillingClient.onUserChange. Возвращает функцию отписки. */
3217
- onUserChange(e, n = {}) {
3266
+ onUserChange(e, t = {}) {
3218
3267
  this.userListeners.add(e);
3219
- const r = n.immediate ?? "microtask";
3220
- if (this.cachedUser && r !== "none") {
3268
+ const n = t.immediate ?? "microtask";
3269
+ if (this.cachedUser && n !== "none") {
3221
3270
  const i = this.cachedUser;
3222
- if (r === "sync")
3271
+ if (n === "sync")
3223
3272
  try {
3224
3273
  e(i);
3225
3274
  } catch (s) {
@@ -3236,22 +3285,22 @@ class xn {
3236
3285
  }
3237
3286
  // === Balances ===
3238
3287
  async getBalances(e = {}) {
3239
- const r = [...await this.transport.request(
3288
+ const n = [...await this.transport.request(
3240
3289
  "billing.getBalances",
3241
3290
  { force: e.force },
3242
3291
  { signal: e.signal }
3243
3292
  )];
3244
- return this.applyBalances(r), r;
3293
+ return this.applyBalances(n), n;
3245
3294
  }
3246
3295
  getCachedBalances() {
3247
3296
  return this.cachedBalances;
3248
3297
  }
3249
- onBalanceChange(e, n = {}) {
3298
+ onBalanceChange(e, t = {}) {
3250
3299
  this.balanceListeners.add(e);
3251
- const r = n.immediate ?? "microtask";
3252
- if (this.cachedBalances && r !== "none") {
3300
+ const n = t.immediate ?? "microtask";
3301
+ if (this.cachedBalances && n !== "none") {
3253
3302
  const i = this.cachedBalances;
3254
- if (r === "sync")
3303
+ if (n === "sync")
3255
3304
  try {
3256
3305
  e(i);
3257
3306
  } catch (s) {
@@ -3268,8 +3317,8 @@ class xn {
3268
3317
  }
3269
3318
  // === Checkout ===
3270
3319
  async createCheckout(e) {
3271
- const { signal: n, ...r } = e;
3272
- return this.transport.request("billing.createCheckout", r, { signal: n });
3320
+ const { signal: t, ...n } = e;
3321
+ return this.transport.request("billing.createCheckout", n, { signal: t });
3273
3322
  }
3274
3323
  // === Customer portal: list/cancel purchases ===
3275
3324
  /** Rich-shape список покупок юзера (с ценой, валютой, interval, discount,
@@ -3292,8 +3341,8 @@ class xn {
3292
3341
  * периода (юзер сохраняет access до renewal date'ы). reason обязательна
3293
3342
  * (валидируется бэком) — собирается через select причин в host-UI. */
3294
3343
  async cancelSubscription(e) {
3295
- const { signal: n, ...r } = e;
3296
- return this.transport.request("billing.cancelSubscription", r, { signal: n });
3344
+ const { signal: t, ...n } = e;
3345
+ return this.transport.request("billing.cancelSubscription", n, { signal: t });
3297
3346
  }
3298
3347
  // === Storage ===
3299
3348
  /** PaywallUI просит storage у billing-клиента для TrialStore и других
@@ -3308,7 +3357,7 @@ class xn {
3308
3357
  * read-modify-write. PaywallUI duck-types этот метод и предпочитает его
3309
3358
  * локальной фабрике, если он есть. */
3310
3359
  createTrialStore(e) {
3311
- return new yn(this.transport, this.paywallId, e);
3360
+ return new yr(this.transport, this.paywallId, e);
3312
3361
  }
3313
3362
  // === Identity ===
3314
3363
  getIdentity() {
@@ -3329,11 +3378,11 @@ class xn {
3329
3378
  }
3330
3379
  applyBootstrap(e) {
3331
3380
  this.cachedBootstrap = e;
3332
- for (const n of [...this.bootstrapListeners])
3381
+ for (const t of [...this.bootstrapListeners])
3333
3382
  try {
3334
- n(e);
3335
- } catch (r) {
3336
- console.warn("[paywall] onBootstrapChange listener threw", r);
3383
+ t(e);
3384
+ } catch (n) {
3385
+ console.warn("[paywall] onBootstrapChange listener threw", n);
3337
3386
  }
3338
3387
  }
3339
3388
  /** Обновить mirror user'а и эмитнуть listener'ам если он реально изменился.
@@ -3341,44 +3390,44 @@ class xn {
3341
3390
  * broadcast'ов от offscreen — чтобы host'овский onUserChange handler
3342
3391
  * получил signal независимо от того, кто триггернул обновление. */
3343
3392
  applyUser(e) {
3344
- bn(this.cachedUser, e) || (this.cachedUser = e, this.fireUserListeners(e));
3393
+ br(this.cachedUser, e) || (this.cachedUser = e, this.fireUserListeners(e));
3345
3394
  }
3346
3395
  applyBalances(e) {
3347
- wn(this.cachedBalances, e) || (this.cachedBalances = e, this.fireBalanceListeners(e));
3396
+ wr(this.cachedBalances, e) || (this.cachedBalances = e, this.fireBalanceListeners(e));
3348
3397
  }
3349
3398
  fireUserListeners(e) {
3350
- for (const n of [...this.userListeners])
3399
+ for (const t of [...this.userListeners])
3351
3400
  try {
3352
- n(e);
3353
- } catch (r) {
3354
- console.warn("[paywall] onUserChange listener threw", r);
3401
+ t(e);
3402
+ } catch (n) {
3403
+ console.warn("[paywall] onUserChange listener threw", n);
3355
3404
  }
3356
3405
  }
3357
3406
  fireBalanceListeners(e) {
3358
- for (const n of [...this.balanceListeners])
3407
+ for (const t of [...this.balanceListeners])
3359
3408
  try {
3360
- n(e);
3361
- } catch (r) {
3362
- console.warn("[paywall] onBalanceChange listener threw", r);
3409
+ t(e);
3410
+ } catch (n) {
3411
+ console.warn("[paywall] onBalanceChange listener threw", n);
3363
3412
  }
3364
3413
  }
3365
3414
  }
3366
- function bn(t, e) {
3367
- return t === e ? !0 : !t || !e ? !1 : t.has_active_subscription === e.has_active_subscription && (t.purchases?.length ?? 0) === (e.purchases?.length ?? 0);
3415
+ function br(r, e) {
3416
+ return r === e ? !0 : !r || !e ? !1 : r.has_active_subscription === e.has_active_subscription && (r.purchases?.length ?? 0) === (e.purchases?.length ?? 0);
3368
3417
  }
3369
- function wn(t, e) {
3370
- if (t === e) return !0;
3371
- if (!t || !e || t.length !== e.length) return !1;
3372
- for (let n = 0; n < t.length; n++)
3373
- if (t[n].type !== e[n].type || t[n].count !== e[n].count) return !1;
3418
+ function wr(r, e) {
3419
+ if (r === e) return !0;
3420
+ if (!r || !e || r.length !== e.length) return !1;
3421
+ for (let t = 0; t < r.length; t++)
3422
+ if (r[t].type !== e[t].type || r[t].count !== e[t].count) return !1;
3374
3423
  return !0;
3375
3424
  }
3376
- class kn {
3377
- constructor(e, n) {
3378
- this.transport = e, this.session = null, this.listeners = /* @__PURE__ */ new Set(), this.unsubBroadcast = null, this.paywallId = n.paywallId, this.apiOrigin = n.apiOrigin, this.unsubBroadcast = this.transport.on("authChange", ({ event: r, session: i }) => {
3379
- this.applySession(r, i);
3380
- }), this.hydrated = this.transport.request("auth.getCachedSession", void 0).then((r) => {
3381
- this.session === null && r !== null && (this.session = r);
3425
+ class kr {
3426
+ constructor(e, t) {
3427
+ this.transport = e, this.session = null, this.listeners = /* @__PURE__ */ new Set(), this.unsubBroadcast = null, this.paywallId = t.paywallId, this.apiOrigin = t.apiOrigin, this.unsubBroadcast = this.transport.on("authChange", ({ event: n, session: i }) => {
3428
+ this.applySession(n, i);
3429
+ }), this.hydrated = this.transport.request("auth.getCachedSession", void 0).then((n) => {
3430
+ this.session === null && n !== null && (this.session = n);
3382
3431
  }).catch(() => {
3383
3432
  });
3384
3433
  }
@@ -3398,8 +3447,8 @@ class kn {
3398
3447
  if (this.listeners.has(e))
3399
3448
  try {
3400
3449
  e("INITIAL_SESSION", this.session);
3401
- } catch (n) {
3402
- console.warn("[paywall] onAuthChange INITIAL_SESSION threw", n);
3450
+ } catch (t) {
3451
+ console.warn("[paywall] onAuthChange INITIAL_SESSION threw", t);
3403
3452
  }
3404
3453
  }), () => {
3405
3454
  this.listeners.delete(e);
@@ -3407,12 +3456,12 @@ class kn {
3407
3456
  }
3408
3457
  // === Email/password ===
3409
3458
  async signInWithEmail(e) {
3410
- const n = await this.transport.request("auth.signInWithEmail", e);
3411
- return this.applySession("SIGNED_IN", n), n;
3459
+ const t = await this.transport.request("auth.signInWithEmail", e);
3460
+ return this.applySession("SIGNED_IN", t), t;
3412
3461
  }
3413
3462
  async signUp(e) {
3414
- const n = await this.transport.request("auth.signUp", e);
3415
- return n.kind === "signed_in" && this.applySession("SIGNED_IN", n.session), n;
3463
+ const t = await this.transport.request("auth.signUp", e);
3464
+ return t.kind === "signed_in" && this.applySession("SIGNED_IN", t.session), t;
3416
3465
  }
3417
3466
  async signOut() {
3418
3467
  await this.transport.request("auth.signOut", void 0);
@@ -3426,8 +3475,8 @@ class kn {
3426
3475
  await this.transport.request("auth.sendOtp", e);
3427
3476
  }
3428
3477
  async verifyOtp(e) {
3429
- const n = await this.transport.request("auth.verifyOtp", e);
3430
- return this.applySession(e.type === "recovery" ? "PASSWORD_RECOVERY" : "SIGNED_IN", n), n;
3478
+ const t = await this.transport.request("auth.verifyOtp", e);
3479
+ return this.applySession(e.type === "recovery" ? "PASSWORD_RECOVERY" : "SIGNED_IN", t), t;
3431
3480
  }
3432
3481
  async resendConfirmation(e) {
3433
3482
  await this.transport.request("auth.resendConfirmation", e);
@@ -3453,12 +3502,12 @@ class kn {
3453
3502
  * offscreen-AuthClient'е — content только проксирует. captchaToken и
3454
3503
  * forceCaptcha — pass-through для forward-compat / switch-account flow. */
3455
3504
  async signInAnonymously(e = {}) {
3456
- const n = await this.transport.request("auth.signInAnonymously", {
3505
+ const t = await this.transport.request("auth.signInAnonymously", {
3457
3506
  captchaToken: e.captchaToken,
3458
3507
  userMeta: e.userMeta,
3459
3508
  forceCaptcha: e.forceCaptcha
3460
3509
  });
3461
- return this.applySession("SIGNED_IN", n), n;
3510
+ return this.applySession("SIGNED_IN", t), t;
3462
3511
  }
3463
3512
  /** Текущий access token (lazy-refreshable в offscreen'е). content/popup
3464
3513
  * использует для Bearer'а в внешние fetch'и — ApiGatewayClient в
@@ -3484,26 +3533,26 @@ class kn {
3484
3533
  */
3485
3534
  async signInWithOAuth(e) {
3486
3535
  if (typeof window > "u")
3487
- throw new U("oauth_unavailable", "window is required for OAuth");
3488
- const n = `pw-oauth-pending-${Math.random().toString(36).slice(2, 10)}`, r = window.open("about:blank", n, "width=480,height=640,popup=yes");
3489
- if (!r)
3490
- throw new U(
3536
+ throw new j("oauth_unavailable", "window is required for OAuth");
3537
+ const t = `pw-oauth-pending-${Math.random().toString(36).slice(2, 10)}`, n = window.open("about:blank", t, "width=480,height=640,popup=yes");
3538
+ if (!n)
3539
+ throw new j(
3491
3540
  "popup_blocked",
3492
3541
  "browser blocked auth popup — call from a user gesture"
3493
3542
  );
3494
- Sn(r, e.provider);
3543
+ Sr(n, e.provider);
3495
3544
  try {
3496
3545
  const { authorizeUrl: i, state: s } = await this.transport.request("auth.oauthStart", {
3497
3546
  provider: e.provider,
3498
3547
  scopes: e.scopes,
3499
3548
  userMeta: e.userMeta
3500
3549
  });
3501
- r.name = `pw-oauth-${s}`, r.location.replace(i), e.onPopupOpened?.();
3502
- const a = await ze(r, s), l = await this.transport.request("auth.oauthExchange", { state: s, code: a });
3550
+ n.name = `pw-oauth-${s}`, n.location.replace(i), e.onPopupOpened?.();
3551
+ const a = await qe(n, s), l = await this.transport.request("auth.oauthExchange", { state: s, code: a });
3503
3552
  return this.applySession("SIGNED_IN", l), l;
3504
3553
  } catch (i) {
3505
3554
  try {
3506
- r.close();
3555
+ n.close();
3507
3556
  } catch {
3508
3557
  }
3509
3558
  throw i;
@@ -3512,56 +3561,56 @@ class kn {
3512
3561
  destroy() {
3513
3562
  this.unsubBroadcast?.(), this.unsubBroadcast = null, this.listeners.clear(), this.session = null;
3514
3563
  }
3515
- applySession(e, n) {
3516
- if (!vn(this.session, n)) {
3517
- this.session = n;
3518
- for (const r of [...this.listeners])
3564
+ applySession(e, t) {
3565
+ if (!vr(this.session, t)) {
3566
+ this.session = t;
3567
+ for (const n of [...this.listeners])
3519
3568
  try {
3520
- r(e, n);
3569
+ n(e, t);
3521
3570
  } catch (i) {
3522
3571
  console.warn("[paywall] onAuthChange listener threw", i);
3523
3572
  }
3524
3573
  }
3525
3574
  }
3526
3575
  }
3527
- function vn(t, e) {
3528
- return t === e ? !0 : !t || !e ? !1 : t.access_token === e.access_token && t.refresh_token === e.refresh_token && t.expires_at === e.expires_at && t.user.id === e.user.id;
3576
+ function vr(r, e) {
3577
+ return r === e ? !0 : !r || !e ? !1 : r.access_token === e.access_token && r.refresh_token === e.refresh_token && r.expires_at === e.expires_at && r.user.id === e.user.id;
3529
3578
  }
3530
- const _n = {
3579
+ const _r = {
3531
3580
  google: "Google",
3532
3581
  apple: "Apple",
3533
3582
  github: "GitHub",
3534
3583
  facebook: "Facebook"
3535
3584
  };
3536
- function Sn(t, e) {
3537
- const n = _n[e] ?? e;
3585
+ function Sr(r, e) {
3586
+ const t = _r[e] ?? e;
3538
3587
  try {
3539
- const r = t.document;
3540
- r.title = `Sign in with ${n}`;
3541
- const i = r.createElement("style");
3542
- i.textContent = "html,body{margin:0;padding:0;height:100%;font-family:-apple-system,system-ui,sans-serif;background:#fafafa;color:#475569}.pw-oauth-wrap{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:16px}.pw-oauth-spinner{width:36px;height:36px;border:3px solid #e2e8f0;border-top-color:#7c3aed;border-radius:50%;animation:pw-oauth-spin 800ms linear infinite}.pw-oauth-label{font-size:14px;font-weight:500;letter-spacing:-0.01em}@keyframes pw-oauth-spin{to{transform:rotate(360deg)}}", r.head.appendChild(i);
3543
- const s = r.createElement("div");
3588
+ const n = r.document;
3589
+ n.title = `Sign in with ${t}`;
3590
+ const i = n.createElement("style");
3591
+ i.textContent = "html,body{margin:0;padding:0;height:100%;font-family:-apple-system,system-ui,sans-serif;background:#fafafa;color:#475569}.pw-oauth-wrap{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:16px}.pw-oauth-spinner{width:36px;height:36px;border:3px solid #e2e8f0;border-top-color:#7c3aed;border-radius:50%;animation:pw-oauth-spin 800ms linear infinite}.pw-oauth-label{font-size:14px;font-weight:500;letter-spacing:-0.01em}@keyframes pw-oauth-spin{to{transform:rotate(360deg)}}", n.head.appendChild(i);
3592
+ const s = n.createElement("div");
3544
3593
  s.className = "pw-oauth-wrap";
3545
- const a = r.createElement("div");
3594
+ const a = n.createElement("div");
3546
3595
  a.className = "pw-oauth-spinner";
3547
- const l = r.createElement("div");
3548
- l.className = "pw-oauth-label", l.textContent = `Connecting to ${n}…`, s.appendChild(a), s.appendChild(l), r.body.appendChild(s);
3596
+ const l = n.createElement("div");
3597
+ l.className = "pw-oauth-label", l.textContent = `Connecting to ${t}…`, s.appendChild(a), s.appendChild(l), n.body.appendChild(s);
3549
3598
  } catch {
3550
3599
  }
3551
3600
  }
3552
- class Cn {
3601
+ class Cr {
3553
3602
  constructor(e) {
3554
3603
  this.transport = e;
3555
3604
  }
3556
3605
  /** Отправить событие. Fire-and-forget — не возвращает Promise, не throw'ает.
3557
3606
  * Сетевые/транспортные ошибки логируются в console и не блокируют caller. */
3558
- track(e, n) {
3559
- typeof e != "string" || e.length === 0 || this.transport.request("tracker.track", { name: e, props: n }).catch((r) => {
3560
- console.warn("[paywall] track failed", r);
3607
+ track(e, t) {
3608
+ typeof e != "string" || e.length === 0 || this.transport.request("tracker.track", { name: e, props: t }).catch((n) => {
3609
+ console.warn("[paywall] track failed", n);
3561
3610
  });
3562
3611
  }
3563
3612
  }
3564
- class In {
3613
+ class Ir {
3565
3614
  constructor(e) {
3566
3615
  this.factory = e, this.channel = null, this.channelDisposers = [], this.pending = /* @__PURE__ */ new Map(), this.listeners = /* @__PURE__ */ new Map(), this.destroyed = !1, this.nextId = 0, this.clientId = `c-${Math.random().toString(36).slice(2, 10)}`;
3567
3616
  }
@@ -3573,31 +3622,31 @@ class In {
3573
3622
  if (this.channel) return this.channel;
3574
3623
  const e = this.factory();
3575
3624
  this.channel = e;
3576
- const n = e.onMessage((i) => this.handleMessage(i)), r = e.onDisconnect(() => this.handleDisconnect());
3577
- return this.channelDisposers = [n, r], this.request("handshake", {
3578
- protocolVersion: Y,
3625
+ const t = e.onMessage((i) => this.handleMessage(i)), n = e.onDisconnect(() => this.handleDisconnect());
3626
+ return this.channelDisposers = [t, n], this.request("handshake", {
3627
+ protocolVersion: K,
3579
3628
  clientId: this.clientId
3580
3629
  }).then((i) => {
3581
- i.protocolVersion !== Y && console.warn(
3582
- `[sdk-extension] protocol version mismatch: client=${Y}, offscreen=${i.protocolVersion}. Update host's @monetize.software/sdk-extension.`
3630
+ i.protocolVersion !== K && console.warn(
3631
+ `[sdk-extension] protocol version mismatch: client=${K}, offscreen=${i.protocolVersion}. Update host's @monetize.software/sdk-extension.`
3583
3632
  );
3584
3633
  }).catch(() => {
3585
3634
  }), e;
3586
3635
  }
3587
3636
  handleMessage(e) {
3588
- if (An(e)) {
3637
+ if (Ar(e)) {
3589
3638
  if (e.type === "response") {
3590
- const n = this.pending.get(e.id);
3591
- if (!n) return;
3592
- this.pending.delete(e.id), n.signal?.removeEventListener("abort", n.abortListener), e.ok ? n.resolve(e.result) : n.reject(De(e.error));
3639
+ const t = this.pending.get(e.id);
3640
+ if (!t) return;
3641
+ this.pending.delete(e.id), t.signal?.removeEventListener("abort", t.abortListener), e.ok ? t.resolve(e.result) : t.reject(Ne(e.error));
3593
3642
  return;
3594
3643
  }
3595
3644
  if (e.type === "event") {
3596
- const n = this.listeners.get(e.kind);
3597
- if (!n) return;
3598
- for (const r of [...n])
3645
+ const t = this.listeners.get(e.kind);
3646
+ if (!t) return;
3647
+ for (const n of [...t])
3599
3648
  try {
3600
- r(e.payload);
3649
+ n(e.payload);
3601
3650
  } catch (i) {
3602
3651
  console.error("[sdk-extension] event handler threw", i);
3603
3652
  }
@@ -3605,26 +3654,26 @@ class In {
3605
3654
  }
3606
3655
  }
3607
3656
  handleDisconnect() {
3608
- for (const n of this.channelDisposers) n();
3657
+ for (const t of this.channelDisposers) t();
3609
3658
  this.channelDisposers = [], this.channel = null;
3610
3659
  const e = Array.from(this.pending.values());
3611
3660
  this.pending.clear();
3612
- for (const n of e)
3613
- n.signal?.removeEventListener("abort", n.abortListener), n.reject(new Ln());
3661
+ for (const t of e)
3662
+ t.signal?.removeEventListener("abort", t.abortListener), t.reject(new Lr());
3614
3663
  }
3615
- request(e, n, r = {}) {
3664
+ request(e, t, n = {}) {
3616
3665
  if (this.destroyed)
3617
3666
  return Promise.reject(new Error("TransportClient destroyed"));
3618
- if (r.signal?.aborted)
3667
+ if (n.signal?.aborted)
3619
3668
  return Promise.reject(new DOMException("Aborted", "AbortError"));
3620
3669
  const i = this.ensureChannel(), s = `r${++this.nextId}`;
3621
3670
  return new Promise((a, l) => {
3622
3671
  const d = {
3623
3672
  resolve: a,
3624
3673
  reject: l,
3625
- signal: r.signal
3674
+ signal: n.signal
3626
3675
  };
3627
- r.signal && (d.abortListener = () => {
3676
+ n.signal && (d.abortListener = () => {
3628
3677
  if (this.pending.delete(s)) {
3629
3678
  l(new DOMException("Aborted", "AbortError"));
3630
3679
  try {
@@ -3632,78 +3681,78 @@ class In {
3632
3681
  } catch {
3633
3682
  }
3634
3683
  }
3635
- }, r.signal.addEventListener("abort", d.abortListener)), this.pending.set(s, d);
3636
- const u = {
3684
+ }, n.signal.addEventListener("abort", d.abortListener)), this.pending.set(s, d);
3685
+ const p = {
3637
3686
  type: "request",
3638
3687
  id: s,
3639
3688
  kind: e,
3640
- params: n
3689
+ params: t
3641
3690
  };
3642
3691
  try {
3643
- i.send(u);
3644
- } catch (p) {
3645
- this.pending.delete(s), r.signal?.removeEventListener("abort", d.abortListener), l(p);
3692
+ i.send(p);
3693
+ } catch (u) {
3694
+ this.pending.delete(s), n.signal?.removeEventListener("abort", d.abortListener), l(u);
3646
3695
  }
3647
3696
  });
3648
3697
  }
3649
- on(e, n) {
3650
- let r = this.listeners.get(e);
3651
- r || (r = /* @__PURE__ */ new Set(), this.listeners.set(e, r));
3652
- const i = n;
3653
- return r.add(i), this.ensureChannel(), () => {
3654
- r.delete(i);
3698
+ on(e, t) {
3699
+ let n = this.listeners.get(e);
3700
+ n || (n = /* @__PURE__ */ new Set(), this.listeners.set(e, n));
3701
+ const i = t;
3702
+ return n.add(i), this.ensureChannel(), () => {
3703
+ n.delete(i);
3655
3704
  };
3656
3705
  }
3657
3706
  destroy() {
3658
3707
  if (this.destroyed) return;
3659
3708
  this.destroyed = !0;
3660
- for (const n of this.channelDisposers) n();
3709
+ for (const t of this.channelDisposers) t();
3661
3710
  this.channelDisposers = [], this.listeners.clear();
3662
3711
  const e = Array.from(this.pending.values());
3663
3712
  this.pending.clear();
3664
- for (const n of e)
3665
- n.signal?.removeEventListener("abort", n.abortListener), n.reject(new Error("TransportClient destroyed"));
3713
+ for (const t of e)
3714
+ t.signal?.removeEventListener("abort", t.abortListener), t.reject(new Error("TransportClient destroyed"));
3666
3715
  this.channel?.close(), this.channel = null;
3667
3716
  }
3668
3717
  }
3669
- class Ln extends Error {
3718
+ class Lr extends Error {
3670
3719
  constructor() {
3671
3720
  super("Transport channel disconnected mid-request"), this.code = "transport_disconnected", this.name = "TransportDisconnectedError";
3672
3721
  }
3673
3722
  }
3674
- function An(t) {
3675
- if (typeof t != "object" || t === null) return !1;
3676
- const e = t.type;
3723
+ function Ar(r) {
3724
+ if (typeof r != "object" || r === null) return !1;
3725
+ const e = r.type;
3677
3726
  return e === "request" || e === "response" || e === "event";
3678
3727
  }
3679
- let H = null;
3680
- function En() {
3681
- return H || (H = new In(() => qe($e)), H);
3728
+ let W = null;
3729
+ function Er() {
3730
+ return W || (W = new Ir(() => Fe(Ge)), W);
3682
3731
  }
3683
- class jn extends un {
3732
+ class Rr extends ur {
3684
3733
  constructor(e) {
3685
- const n = En(), r = new xn(n, {
3734
+ const t = Er(), n = new xr(t, {
3686
3735
  paywallId: e.paywallId,
3687
3736
  apiOrigin: e.apiOrigin
3688
3737
  });
3689
3738
  let i;
3690
- e.auth === !0 ? i = new kn(n, {
3739
+ e.auth === !0 ? i = new kr(t, {
3691
3740
  paywallId: e.paywallId,
3692
3741
  apiOrigin: e.apiOrigin
3693
3742
  }) : e.auth && console.warn(
3694
3743
  "[sdk-extension] passing AuthClient instance to PaywallUI.opts.auth is not supported in extension mode — pass `auth: true` to use offscreen-shared auth, or omit for hybrid identity-only mode."
3695
- ), i && (r.auth = i), super({
3744
+ ), i && (n.auth = i), super({
3696
3745
  ...e,
3697
3746
  // Cast'ы безопасны: PaywallUI'ев resolveAuth duck-type'ит auth (см.
3698
3747
  // sdk/src/ui/PaywallUI.ts isAuthClientLike), а billing-параметр идёт
3699
3748
  // через `opts.client ?? new BillingClient(...)` — RemoteBillingClient
3700
3749
  // там используется как есть, методы все сходятся.
3701
- client: r,
3750
+ client: n,
3702
3751
  auth: i,
3703
3752
  // Внутренний EventTracker отключаем — единственный tracker живёт в
3704
3753
  // offscreen'е. Манчиально подписываемся ниже.
3705
3754
  analytics: !1
3706
- }), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new Cn(n), this.bindAnalytics());
3755
+ }), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new Cr(t), this.bindAnalytics());
3707
3756
  }
3708
3757
  /** Зеркало sdk/PaywallUI.initTracker'овских биндингов, но с RemoteEventTracker.
3709
3758
  * Когда @monetize.software/sdk экспоузнет публичный hook для inject'а tracker'а,
@@ -3714,46 +3763,46 @@ class jn extends un {
3714
3763
  this.on("open", () => e.track("paywall_opened")),
3715
3764
  this.on(
3716
3765
  "ready",
3717
- (n) => e.track("paywall_viewed", {
3718
- is_test_mode: n.settings.is_test_mode,
3719
- prices_count: n.prices.length,
3720
- offers_count: n.offers.length
3766
+ (t) => e.track("paywall_viewed", {
3767
+ is_test_mode: t.settings.is_test_mode,
3768
+ prices_count: t.prices.length,
3769
+ offers_count: t.offers.length
3721
3770
  })
3722
3771
  ),
3723
3772
  this.on(
3724
3773
  "price_selected",
3725
- (n) => e.track("price_selected", { price_id: n.priceId })
3774
+ (t) => e.track("price_selected", { price_id: t.priceId })
3726
3775
  ),
3727
3776
  this.on(
3728
3777
  "checkout_started",
3729
- (n) => e.track("checkout_started", { price_id: n.priceId, acquiring: n.acquiring })
3778
+ (t) => e.track("checkout_started", { price_id: t.priceId, acquiring: t.acquiring })
3730
3779
  ),
3731
3780
  this.on(
3732
3781
  "purchase_completed",
3733
- (n) => e.track("purchase_completed", { price_id: n.priceId, session_id: n.sessionId })
3782
+ (t) => e.track("purchase_completed", { price_id: t.priceId, session_id: t.sessionId })
3734
3783
  ),
3735
- this.on("purchase_failed", (n) => e.track("purchase_failed", { reason: n.reason })),
3784
+ this.on("purchase_failed", (t) => e.track("purchase_failed", { reason: t.reason })),
3736
3785
  this.on("close", () => e.track("paywall_closed")),
3737
3786
  this.on(
3738
3787
  "trial_blocked",
3739
- (n) => e.track("trial_blocked", {
3740
- mode: n.mode,
3741
- ...n.mode === "time" ? { remaining_ms: n.remainingMs, total_ms: n.totalMs } : n.mode === "opens" ? { remaining_actions: n.remainingActions, total_actions: n.totalActions } : {}
3788
+ (t) => e.track("trial_blocked", {
3789
+ mode: t.mode,
3790
+ ...t.mode === "time" ? { remaining_ms: t.remainingMs, total_ms: t.totalMs } : t.mode === "opens" ? { remaining_actions: t.remainingActions, total_actions: t.totalActions } : {}
3742
3791
  })
3743
3792
  ),
3744
3793
  this.on("trial_expired", () => e.track("trial_expired")),
3745
3794
  this.on(
3746
3795
  "visibility_blocked",
3747
- (n) => e.track("visibility_blocked", { reason: n.reason, country: n.country, tier: n.tier })
3796
+ (t) => e.track("visibility_blocked", { reason: t.reason, country: t.country, tier: t.tier })
3748
3797
  ),
3749
- this.on("error", (n) => e.track("error", { code: n.code, message: n.message }))
3798
+ this.on("error", (t) => e.track("error", { code: t.code, message: t.message }))
3750
3799
  );
3751
3800
  }
3752
3801
  /** Прокси через RemoteEventTracker. Hosts могут вызывать paywall.track
3753
3802
  * для произвольных аналитических событий — летит в единственный
3754
3803
  * offscreen-tracker наряду с auto-emit'ами PaywallUI. */
3755
- track(e, n) {
3756
- this.remoteTracker?.track(e, n);
3804
+ track(e, t) {
3805
+ this.remoteTracker?.track(e, t);
3757
3806
  }
3758
3807
  destroy() {
3759
3808
  for (const e of this.trackerUnsubs) e();
@@ -3761,11 +3810,11 @@ class jn extends un {
3761
3810
  }
3762
3811
  }
3763
3812
  export {
3764
- Y as PROTOCOL_VERSION,
3765
- jn as PaywallUI,
3766
- kn as RemoteAuthClient,
3767
- xn as RemoteBillingClient,
3768
- Cn as RemoteEventTracker,
3769
- En as getContentTransport
3813
+ K as PROTOCOL_VERSION,
3814
+ Rr as PaywallUI,
3815
+ kr as RemoteAuthClient,
3816
+ xr as RemoteBillingClient,
3817
+ Cr as RemoteEventTracker,
3818
+ Er as getContentTransport
3770
3819
  };
3771
3820
  //# sourceMappingURL=content.js.map