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

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 (137) hide show
  1. package/dist/chunks/ar-BCHXVoE2.js +114 -0
  2. package/dist/chunks/ar-BCHXVoE2.js.map +1 -0
  3. package/dist/chunks/ar-CsJNZJSr.js +2 -0
  4. package/dist/chunks/ar-CsJNZJSr.js.map +1 -0
  5. package/dist/chunks/{chrome-port-rPi6zrjD.js → chrome-port-CxW3Pwc2.js} +145 -107
  6. package/dist/chunks/chrome-port-CxW3Pwc2.js.map +1 -0
  7. package/dist/chunks/chrome-port-PhlW29BV.js +2 -0
  8. package/dist/chunks/chrome-port-PhlW29BV.js.map +1 -0
  9. package/dist/chunks/cs-B5NqpTW_.js +110 -0
  10. package/dist/chunks/cs-B5NqpTW_.js.map +1 -0
  11. package/dist/chunks/cs-BydWUC0e.js +2 -0
  12. package/dist/chunks/cs-BydWUC0e.js.map +1 -0
  13. package/dist/chunks/da-BJrGZ3LD.js +110 -0
  14. package/dist/chunks/da-BJrGZ3LD.js.map +1 -0
  15. package/dist/chunks/da-DNhiAQnh.js +2 -0
  16. package/dist/chunks/da-DNhiAQnh.js.map +1 -0
  17. package/dist/chunks/de-H8ztFOie.js +2 -0
  18. package/dist/chunks/de-H8ztFOie.js.map +1 -0
  19. package/dist/chunks/de-aepBKwsb.js +130 -0
  20. package/dist/chunks/de-aepBKwsb.js.map +1 -0
  21. package/dist/chunks/el-DRfoadtI.js +2 -0
  22. package/dist/chunks/el-DRfoadtI.js.map +1 -0
  23. package/dist/chunks/el-DTLQoX2D.js +114 -0
  24. package/dist/chunks/el-DTLQoX2D.js.map +1 -0
  25. package/dist/chunks/es-CLutF-D_.js +130 -0
  26. package/dist/chunks/es-CLutF-D_.js.map +1 -0
  27. package/dist/chunks/es-GlaYesNR.js +2 -0
  28. package/dist/chunks/es-GlaYesNR.js.map +1 -0
  29. package/dist/chunks/fi-BIHFyScH.js +2 -0
  30. package/dist/chunks/fi-BIHFyScH.js.map +1 -0
  31. package/dist/chunks/fi-DZ4csxqk.js +110 -0
  32. package/dist/chunks/fi-DZ4csxqk.js.map +1 -0
  33. package/dist/chunks/fr-BtZILUNZ.js +2 -0
  34. package/dist/chunks/fr-BtZILUNZ.js.map +1 -0
  35. package/dist/chunks/fr-jJU1SSpj.js +130 -0
  36. package/dist/chunks/fr-jJU1SSpj.js.map +1 -0
  37. package/dist/chunks/he-D9obGPNj.js +114 -0
  38. package/dist/chunks/he-D9obGPNj.js.map +1 -0
  39. package/dist/chunks/he-vSDRE4Nn.js +2 -0
  40. package/dist/chunks/he-vSDRE4Nn.js.map +1 -0
  41. package/dist/chunks/hi-B90FsnP6.js +2 -0
  42. package/dist/chunks/hi-B90FsnP6.js.map +1 -0
  43. package/dist/chunks/hi-pM8SQwZ3.js +114 -0
  44. package/dist/chunks/hi-pM8SQwZ3.js.map +1 -0
  45. package/dist/chunks/hu-DWVFODsS.js +2 -0
  46. package/dist/chunks/hu-DWVFODsS.js.map +1 -0
  47. package/dist/chunks/hu-E0m9WgbD.js +110 -0
  48. package/dist/chunks/hu-E0m9WgbD.js.map +1 -0
  49. package/dist/chunks/id-C6poPvby.js +110 -0
  50. package/dist/chunks/id-C6poPvby.js.map +1 -0
  51. package/dist/chunks/id-Ce2gzMVT.js +2 -0
  52. package/dist/chunks/id-Ce2gzMVT.js.map +1 -0
  53. package/dist/chunks/it-B2RSFyVd.js +130 -0
  54. package/dist/chunks/it-B2RSFyVd.js.map +1 -0
  55. package/dist/chunks/it-u-Gu44bl.js +2 -0
  56. package/dist/chunks/it-u-Gu44bl.js.map +1 -0
  57. package/dist/chunks/ja-CM-VgVG6.js +134 -0
  58. package/dist/chunks/ja-CM-VgVG6.js.map +1 -0
  59. package/dist/chunks/ja-CQy8RaRa.js +2 -0
  60. package/dist/chunks/ja-CQy8RaRa.js.map +1 -0
  61. package/dist/chunks/ko-BRnb7vJ7.js +2 -0
  62. package/dist/chunks/ko-BRnb7vJ7.js.map +1 -0
  63. package/dist/chunks/ko-C451fA21.js +134 -0
  64. package/dist/chunks/ko-C451fA21.js.map +1 -0
  65. package/dist/chunks/nl-CJelco6J.js +2 -0
  66. package/dist/chunks/nl-CJelco6J.js.map +1 -0
  67. package/dist/chunks/nl-DzQfJPo2.js +130 -0
  68. package/dist/chunks/nl-DzQfJPo2.js.map +1 -0
  69. package/dist/chunks/no-B51be8KT.js +110 -0
  70. package/dist/chunks/no-B51be8KT.js.map +1 -0
  71. package/dist/chunks/no-BwTjSZ4K.js +2 -0
  72. package/dist/chunks/no-BwTjSZ4K.js.map +1 -0
  73. package/dist/chunks/pl-5rTEkvfY.js +110 -0
  74. package/dist/chunks/pl-5rTEkvfY.js.map +1 -0
  75. package/dist/chunks/pl-kO82vcjb.js +2 -0
  76. package/dist/chunks/pl-kO82vcjb.js.map +1 -0
  77. package/dist/chunks/pt-CsJzaSjg.js +2 -0
  78. package/dist/chunks/pt-CsJzaSjg.js.map +1 -0
  79. package/dist/chunks/pt-JwqffZ9u.js +130 -0
  80. package/dist/chunks/pt-JwqffZ9u.js.map +1 -0
  81. package/dist/chunks/ro-BE_wJ1td.js +110 -0
  82. package/dist/chunks/ro-BE_wJ1td.js.map +1 -0
  83. package/dist/chunks/ro-ue15Ina4.js +2 -0
  84. package/dist/chunks/ro-ue15Ina4.js.map +1 -0
  85. package/dist/chunks/ru-B1iMOhX0.js +2 -0
  86. package/dist/chunks/ru-B1iMOhX0.js.map +1 -0
  87. package/dist/chunks/ru-BviATvLb.js +124 -0
  88. package/dist/chunks/ru-BviATvLb.js.map +1 -0
  89. package/dist/chunks/sv-CkNYpUVy.js +2 -0
  90. package/dist/chunks/sv-CkNYpUVy.js.map +1 -0
  91. package/dist/chunks/sv-DabGF9WL.js +110 -0
  92. package/dist/chunks/sv-DabGF9WL.js.map +1 -0
  93. package/dist/chunks/th-BiF-bNo0.js +114 -0
  94. package/dist/chunks/th-BiF-bNo0.js.map +1 -0
  95. package/dist/chunks/th-Cu80HK4y.js +2 -0
  96. package/dist/chunks/th-Cu80HK4y.js.map +1 -0
  97. package/dist/chunks/tr-B7c0afXV.js +2 -0
  98. package/dist/chunks/tr-B7c0afXV.js.map +1 -0
  99. package/dist/chunks/tr-xZuly8X8.js +110 -0
  100. package/dist/chunks/tr-xZuly8X8.js.map +1 -0
  101. package/dist/chunks/uk-BO106B0H.js +2 -0
  102. package/dist/chunks/uk-BO106B0H.js.map +1 -0
  103. package/dist/chunks/uk-KlkAaHuy.js +124 -0
  104. package/dist/chunks/uk-KlkAaHuy.js.map +1 -0
  105. package/dist/chunks/vi-BVCeumNE.js +110 -0
  106. package/dist/chunks/vi-BVCeumNE.js.map +1 -0
  107. package/dist/chunks/vi-CZ6ow40D.js +2 -0
  108. package/dist/chunks/vi-CZ6ow40D.js.map +1 -0
  109. package/dist/chunks/zh-BhP80WI1.js +2 -0
  110. package/dist/chunks/zh-BhP80WI1.js.map +1 -0
  111. package/dist/chunks/zh-C_ghwmqi.js +134 -0
  112. package/dist/chunks/zh-C_ghwmqi.js.map +1 -0
  113. package/dist/content/RemoteAuthClient.d.ts +5 -1
  114. package/dist/content/RemoteAuthClient.d.ts.map +1 -1
  115. package/dist/content/RemoteAuthClient.test-d.d.ts +2 -0
  116. package/dist/content/RemoteAuthClient.test-d.d.ts.map +1 -0
  117. package/dist/content/RemoteBillingClient.d.ts +29 -0
  118. package/dist/content/RemoteBillingClient.d.ts.map +1 -1
  119. package/dist/content/RemoteBillingClient.test-d.d.ts +2 -0
  120. package/dist/content/RemoteBillingClient.test-d.d.ts.map +1 -0
  121. package/dist/content.cjs +3 -3
  122. package/dist/content.cjs.map +1 -1
  123. package/dist/content.js +2220 -1241
  124. package/dist/content.js.map +1 -1
  125. package/dist/offscreen/server.d.ts.map +1 -1
  126. package/dist/offscreen.cjs +1 -1
  127. package/dist/offscreen.cjs.map +1 -1
  128. package/dist/offscreen.js +5 -2
  129. package/dist/offscreen.js.map +1 -1
  130. package/dist/shared/messages.d.ts +21 -1
  131. package/dist/shared/messages.d.ts.map +1 -1
  132. package/dist/shared/protocol.d.ts +1 -1
  133. package/dist/shared/protocol.d.ts.map +1 -1
  134. package/package.json +7 -6
  135. package/dist/chunks/chrome-port-rPi6zrjD.js.map +0 -1
  136. package/dist/chunks/chrome-port-vdrVaWql.js +0 -2
  137. package/dist/chunks/chrome-port-vdrVaWql.js.map +0 -1
package/dist/content.js CHANGED
@@ -1,40 +1,40 @@
1
- import { P as T, B as le, E as ae, c as ce, A as G, w as ue, a as N, r as he, b as de } from "./chunks/chrome-port-rPi6zrjD.js";
2
- import { render as q, h as W } from "preact";
3
- import { jsxs as c, jsx as o, Fragment as re } from "preact/jsx-runtime";
4
- import { useRef as P, useEffect as M, useState as y, useMemo as ne } from "preact/hooks";
5
- import { P as pe } from "./chunks/port-name-BPfQKtdb.js";
6
- const ie = '@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}*,*: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
- let Z = !1;
8
- function fe() {
9
- if (Z || (Z = !0, typeof CSS > "u" || typeof CSS.registerProperty != "function")) return;
10
- let r;
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%}}';
7
+ let he = !1;
8
+ function He() {
9
+ if (he || (he = !0, typeof CSS > "u" || typeof CSS.registerProperty != "function")) return;
10
+ let t;
11
11
  try {
12
12
  const e = new CSSStyleSheet();
13
- e.replaceSync(ie), r = e.cssRules;
13
+ e.replaceSync(_e), t = e.cssRules;
14
14
  } catch {
15
15
  return;
16
16
  }
17
- for (const e of r) {
17
+ for (const e of t) {
18
18
  if (e.constructor.name !== "CSSPropertyRule") continue;
19
- const t = e;
19
+ const n = e;
20
20
  try {
21
21
  CSS.registerProperty({
22
- name: t.name,
23
- syntax: t.syntax,
24
- inherits: t.inherits,
25
- ...t.initialValue != null ? { initialValue: t.initialValue } : {}
22
+ name: n.name,
23
+ syntax: n.syntax,
24
+ inherits: n.inherits,
25
+ ...n.initialValue != null ? { initialValue: n.initialValue } : {}
26
26
  });
27
27
  } catch {
28
28
  }
29
29
  }
30
30
  }
31
- function ge(r, e, t = {}) {
31
+ function Ge(t, e, n = {}) {
32
32
  if (typeof document > "u")
33
33
  throw new Error("mountShadow called in non-DOM environment");
34
- fe();
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 = `
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 = `
38
38
  :host {
39
39
  all: initial !important;
40
40
  display: block !important;
@@ -52,130 +52,226 @@ function ge(r, e, t = {}) {
52
52
  cursor: auto !important;
53
53
  visibility: visible !important;
54
54
  }
55
- `, l = document.createElement("style");
56
- l.textContent = s + ie + (t.injectCss ?? ""), i.appendChild(l);
57
- const a = document.createElement("div");
58
- a.style.pointerEvents = "auto", i.appendChild(a);
59
- let h = e;
60
- return q(W(r, h), a), {
55
+ `, a = document.createElement("style");
56
+ a.textContent = s + _e + (n.injectCss ?? ""), i.appendChild(a);
57
+ const l = document.createElement("div");
58
+ l.style.pointerEvents = "auto", i.appendChild(l);
59
+ let d = e;
60
+ return K(de(t, d), l), {
61
61
  shadowRoot: i,
62
62
  update(u) {
63
- h = { ...h, ...u }, q(W(r, h), a);
63
+ d = { ...d, ...u }, K(de(t, d), l);
64
64
  },
65
65
  unmount() {
66
- q(null, a), n.remove();
66
+ K(null, l), r.remove();
67
67
  }
68
68
  };
69
69
  }
70
- const Y = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
71
- function me({
72
- open: r,
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) => {
73
+ (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
74
+ s.bind(
75
+ null,
76
+ new Error(
77
+ "Unknown variable dynamic import: " + e + (e.split("/").length !== n ? ". Note that variables only represent file names one level deep." : "")
78
+ )
79
+ )
80
+ );
81
+ });
82
+ }, Ze = [
83
+ "ru",
84
+ "uk",
85
+ "de",
86
+ "es",
87
+ "fr",
88
+ "it",
89
+ "pt",
90
+ "pl",
91
+ "cs",
92
+ "hu",
93
+ "ro",
94
+ "nl",
95
+ "sv",
96
+ "da",
97
+ "no",
98
+ "fi",
99
+ "el",
100
+ "tr",
101
+ "id",
102
+ "ar",
103
+ "ja",
104
+ "ko",
105
+ "zh",
106
+ "hi",
107
+ "th",
108
+ "vi",
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) {
123
+ const e = [];
124
+ if (typeof navigator < "u" && navigator.language) {
125
+ e.push(navigator.language);
126
+ const r = navigator.language.split("-")[0];
127
+ r && r !== navigator.language && e.push(r);
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);
134
+ }
135
+ for (const r of e)
136
+ if (Ye(r)) return r;
137
+ return null;
138
+ }
139
+ function Xe(t) {
140
+ return !!t.locales && Object.keys(t.locales).length > 0;
141
+ }
142
+ async function Je(t) {
143
+ const e = X.get(t);
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) => {
148
+ const s = i.default ?? {};
149
+ return X.set(t, s), s;
150
+ }).catch((i) => {
151
+ console.warn(`[paywall] failed to load locale chunk "${t}"`, i);
152
+ const s = {};
153
+ return X.set(t, s), s;
154
+ }).finally(() => {
155
+ J.delete(t);
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));
168
+ }), () => {
169
+ d = !0;
170
+ };
171
+ }, [t]);
172
+ const a = {
173
+ locale: n,
174
+ t: i ? (l, d, u) => Ie(i[l] ?? d, u) : Se
175
+ };
176
+ return /* @__PURE__ */ o(Ce.Provider, { value: a, children: e });
177
+ }
178
+ function w() {
179
+ return Fe(Ce);
180
+ }
181
+ 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,
73
184
  onClose: e,
74
- labelledBy: t,
75
- brandColor: n,
76
- testMode: i,
185
+ labelledBy: n,
186
+ brandColor: r,
187
+ topBanner: i,
77
188
  allowClose: s = !0,
189
+ hideCloseButton: a = !1,
78
190
  inline: l = !1,
79
- children: a
191
+ children: d
80
192
  }) {
81
- const h = P(null), u = P(null);
82
- return M(() => {
83
- if (!r) return;
84
- u.current = document.activeElement ?? null;
85
- const f = h.current;
86
- f && (f.querySelector(Y) ?? f).focus({ preventScroll: !0 });
87
- const g = (v) => {
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) => {
88
200
  if (v.key === "Escape") {
89
201
  if (!s) return;
90
202
  v.stopPropagation(), e();
91
203
  return;
92
204
  }
93
- if (v.key !== "Tab" || !h.current) return;
94
- const b = Array.from(
95
- h.current.querySelectorAll(Y)
96
- ).filter((L) => !L.hasAttribute("disabled") && L.tabIndex !== -1);
97
- if (b.length === 0) {
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) {
98
210
  v.preventDefault();
99
211
  return;
100
212
  }
101
- const S = b[0], w = b[b.length - 1], B = document.activeElement;
102
- v.shiftKey && B === S ? (v.preventDefault(), w.focus()) : !v.shiftKey && B === w && (v.preventDefault(), S.focus());
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());
103
215
  };
104
- document.addEventListener("keydown", g, !0);
105
- const _ = document.body.style.overflow;
216
+ document.addEventListener("keydown", j, !0);
217
+ const T = document.body.style.overflow;
106
218
  return l || (document.body.style.overflow = "hidden"), () => {
107
- document.removeEventListener("keydown", g, !0), l || (document.body.style.overflow = _), u.current?.focus?.({ preventScroll: !0 });
219
+ document.removeEventListener("keydown", j, !0), l || (document.body.style.overflow = T), f.current?.focus?.({ preventScroll: !0 });
108
220
  };
109
- }, [r, e, s, l]), r ? /* @__PURE__ */ c(
221
+ }, [t, e, s, l]), t ? /* @__PURE__ */ c(
110
222
  "div",
111
223
  {
112
224
  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]`,
113
- onClick: (f) => {
114
- s && f.target === f.currentTarget && e();
225
+ onClick: (k) => {
226
+ s && k.target === k.currentTarget && e();
115
227
  },
116
228
  "data-pw-root": !0,
117
229
  children: [
118
- /* @__PURE__ */ c("div", { class: "relative w-full max-w-md animate-[pw-scale-in_220ms_cubic-bezier(0.16,1,0.3,1)]", children: [
119
- i && /* @__PURE__ */ c(
120
- "div",
121
- {
122
- class: "absolute right-3 top-0 z-20 flex -translate-y-[calc(100%+6px)] items-center gap-1.5 rounded-full bg-gradient-to-r from-amber-300 to-amber-400 px-3 py-1 text-[11px] font-semibold uppercase tracking-wider text-amber-950 shadow-[0_4px_12px_-2px_rgba(245,158,11,0.45),0_0_0_1px_rgba(255,255,255,0.6)]",
123
- role: "status",
124
- children: [
125
- /* @__PURE__ */ c("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
126
- /* @__PURE__ */ o(
127
- "path",
128
- {
129
- d: "M8 1L15 14H1L8 1Z",
130
- stroke: "currentColor",
131
- "stroke-width": "1.5",
132
- "stroke-linejoin": "round"
133
- }
134
- ),
135
- /* @__PURE__ */ o("path", { d: "M8 6v3", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round" }),
136
- /* @__PURE__ */ o("circle", { cx: "8", cy: "11.5", r: "0.5", fill: "currentColor" })
137
- ] }),
138
- "Test mode — no real charge"
139
- ]
140
- }
141
- ),
142
- /* @__PURE__ */ c(
143
- "div",
144
- {
145
- ref: h,
146
- role: "dialog",
147
- "aria-modal": "true",
148
- "aria-labelledby": t,
149
- tabIndex: -1,
150
- class: "relative flex max-h-[calc(100dvh-1rem)] sm:max-h-[calc(100dvh-2rem)] w-full flex-col overflow-hidden rounded-3xl bg-white outline-none ring-1 ring-black/5",
151
- style: {
152
- "--pw-accent": n ?? "#3b82f6",
153
- boxShadow: "0 1px 2px rgba(15,23,42,0.04), 0 12px 32px -8px rgba(15,23,42,0.18), 0 24px 64px -16px rgba(15,23,42,0.22)"
154
- },
155
- children: [
156
- /* @__PURE__ */ o("div", { class: "flex-1 overflow-y-auto p-8", children: a }),
157
- s ? /* @__PURE__ */ o(
158
- "button",
159
- {
160
- type: "button",
161
- onClick: e,
162
- "aria-label": "Close",
163
- class: "absolute right-3 top-3 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white/80 text-gray-400 backdrop-blur-sm transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
164
- children: /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o(
165
- "path",
230
+ /* @__PURE__ */ c(
231
+ "div",
232
+ {
233
+ 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" },
235
+ children: [
236
+ i,
237
+ /* @__PURE__ */ c(
238
+ "div",
239
+ {
240
+ ref: p,
241
+ role: "dialog",
242
+ "aria-modal": "true",
243
+ "aria-labelledby": n,
244
+ tabIndex: -1,
245
+ 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
+ style: {
247
+ boxShadow: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
248
+ },
249
+ children: [
250
+ d,
251
+ s && !a ? /* @__PURE__ */ o(
252
+ "button",
166
253
  {
167
- d: "M3 3l10 10M13 3L3 13",
168
- stroke: "currentColor",
169
- "stroke-width": "1.75",
170
- "stroke-linecap": "round"
254
+ type: "button",
255
+ onClick: e,
256
+ "aria-label": u("modal.close_aria", "Close"),
257
+ 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
+ children: /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o(
259
+ "path",
260
+ {
261
+ d: "M3 3l10 10M13 3L3 13",
262
+ stroke: "currentColor",
263
+ "stroke-width": "1.75",
264
+ "stroke-linecap": "round"
265
+ }
266
+ ) })
171
267
  }
172
- ) })
173
- }
174
- ) : null
175
- ]
176
- }
177
- )
178
- ] }),
268
+ ) : null
269
+ ]
270
+ }
271
+ )
272
+ ]
273
+ }
274
+ ),
179
275
  /* @__PURE__ */ o("style", { children: `
180
276
  @keyframes pw-fade-in { from { opacity: 0 } to { opacity: 1 } }
181
277
  @keyframes pw-scale-in {
@@ -187,33 +283,40 @@ function me({
187
283
  }
188
284
  ) : null;
189
285
  }
190
- const ye = {
191
- google: "Continue with Google",
192
- apple: "Continue with Apple",
193
- github: "Continue with GitHub",
194
- facebook: "Continue with Facebook"
195
- };
196
- function oe({ block: r, ctx: e }) {
197
- const t = e.auth, n = e.authSession, i = r.allow_signup !== !1, s = r.allow_password_reset !== !1, l = r.hide_when_authenticated !== !1;
198
- if (!t)
286
+ function tt(t, e) {
287
+ switch (t) {
288
+ case "google":
289
+ return e("auth.continue_with_google", "Continue with Google");
290
+ case "apple":
291
+ return e("auth.continue_with_apple", "Continue with Apple");
292
+ case "github":
293
+ return e("auth.continue_with_github", "Continue with GitHub");
294
+ case "facebook":
295
+ return e("auth.continue_with_facebook", "Continue with Facebook");
296
+ }
297
+ }
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)
199
301
  return typeof console < "u" && console.warn("[paywall] auth_panel rendered without AuthClient — pass `auth: true` to PaywallUI"), null;
200
- const a = n && !n.user.is_anonymous ? n : null;
201
- return a && l ? null : a ? /* @__PURE__ */ o(xe, { email: a.user.email ?? "", onSignOut: () => t.signOut().catch(() => {
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(() => {
202
304
  }) }) : /* @__PURE__ */ o(
203
- be,
305
+ rt,
204
306
  {
205
- block: r,
307
+ block: t,
206
308
  allowSignup: i,
207
309
  allowReset: s,
208
310
  ctx: e
209
311
  }
210
312
  );
211
313
  }
212
- function xe({ email: r, onSignOut: e }) {
213
- return /* @__PURE__ */ c("div", { class: "flex items-center justify-between gap-3 rounded-2xl border border-gray-200 bg-gray-50/60 px-4 py-3", children: [
314
+ function nt({ email: t, onSignOut: e }) {
315
+ const { t: n } = w();
316
+ return /* @__PURE__ */ c("div", { class: "flex items-center justify-between gap-3 rounded-2xl bg-gray-100 px-4 py-3", children: [
214
317
  /* @__PURE__ */ c("div", { class: "flex flex-col", children: [
215
- /* @__PURE__ */ o("span", { class: "text-[10px] font-semibold uppercase tracking-wider text-gray-500", children: "Signed in" }),
216
- /* @__PURE__ */ o("span", { class: "text-sm font-medium text-gray-900", children: r })
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 })
217
320
  ] }),
218
321
  /* @__PURE__ */ o(
219
322
  "button",
@@ -221,815 +324,1451 @@ function xe({ email: r, onSignOut: e }) {
221
324
  type: "button",
222
325
  onClick: e,
223
326
  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)]",
224
- children: "Sign out"
327
+ children: n("auth.sign_out", "Sign out")
225
328
  }
226
329
  )
227
330
  ] });
228
331
  }
229
- function be({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
230
- const i = n.auth, s = r.providers ?? [], [l, a] = y("signin"), [h, u] = y(""), [m, x] = y(""), [A, f] = y(""), [g, _] = y(null), [v, b] = y(null), [S, w] = y(null), B = async (I) => {
231
- if (I.preventDefault(), !g) {
232
- _("email"), b(null), w(null);
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(() => {
335
+ if (typeof s.getLastLogin != "function") return;
336
+ let S = !1;
337
+ return s.getLastLogin().then(
338
+ (E) => {
339
+ S || !E || (D(E), E.email && p((F) => F === "" ? E.email : F));
340
+ },
341
+ () => {
342
+ }
343
+ ), () => {
344
+ S = !0;
345
+ };
346
+ }, [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;
353
+ q(!0);
354
+ return;
355
+ }
356
+ if (l === "signup" && f !== h) {
357
+ C(i("auth.passwords_mismatch", "Passwords don't match"));
358
+ return;
359
+ }
360
+ v("email");
233
361
  try {
234
- l === "signin" ? await i.signInWithEmail({ email: h, password: m }) : l === "signup" ? (await i.signUp({ email: h, password: m })).kind === "confirmation_required" && (a("reset_verify"), w("Check your email for a confirmation code.")) : l === "forgot" ? (await i.requestPasswordReset({ email: h }), a("reset_sent"), w("If that email exists, a reset code has been sent.")) : l === "reset_verify" && (await i.verifyOtp({
235
- email: h,
236
- token: A,
237
- type: m ? "recovery" : "email"
238
- }), m && await i.updatePassword({ password: m }));
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(
363
+ i("auth.reset_sent_message", "If that email exists, a reset code has been sent.")
364
+ )) : l === "reset_verify" && (await s.verifyOtp({
365
+ email: u,
366
+ token: k,
367
+ type: f ? "recovery" : "email"
368
+ }), f && await s.updatePassword({ password: f }));
239
369
  } catch (E) {
240
- const C = E instanceof T ? E.message : "Something went wrong";
241
- b(C);
370
+ const F = E instanceof U ? E.message : i("auth.generic_error", "Something went wrong");
371
+ C(F);
242
372
  } finally {
243
- _(null);
373
+ v(null);
244
374
  }
245
375
  }
246
- }, L = async (I) => {
247
- if (!g) {
248
- _(I), b(null), w(null);
376
+ }, m = async (S) => {
377
+ if (!T) {
378
+ v(S), C(null), O(null);
249
379
  try {
250
- await i.signInWithOAuth({
251
- provider: I,
252
- onPopupOpened: () => _(null)
380
+ await s.signInWithOAuth({
381
+ provider: S,
382
+ onPopupOpened: () => v(null)
253
383
  });
254
384
  } catch (E) {
255
- if (E instanceof T) {
385
+ if (E instanceof U) {
256
386
  if (E.code === "oauth_cancelled" || E.code === "oauth_timeout") return;
257
- b(E.message);
387
+ C(E.message);
258
388
  } else
259
- b("Sign-in failed");
389
+ C(i("auth.signin_failed", "Sign-in failed"));
260
390
  } finally {
261
- _(null);
391
+ v(null);
262
392
  }
263
393
  }
264
- };
265
- return /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
266
- r.heading ? /* @__PURE__ */ o("h2", { class: "text-lg font-semibold tracking-tight text-gray-900", children: r.heading }) : null,
267
- s.length > 0 && (l === "signin" || l === "signup") ? /* @__PURE__ */ c("div", { class: "flex flex-col gap-2", children: [
268
- s.map((I) => /* @__PURE__ */ c(
269
- "button",
270
- {
271
- type: "button",
272
- onClick: () => L(I),
273
- disabled: g !== null,
274
- class: "flex h-11 w-full items-center justify-center gap-2 rounded-xl border border-gray-200 bg-white px-4 text-sm font-medium text-gray-900 shadow-[0_1px_0_rgba(15,23,42,0.04)] transition-all hover:-translate-y-px hover:border-gray-300 hover:bg-gray-50 hover:shadow-sm disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 disabled:hover:shadow-[0_1px_0_rgba(15,23,42,0.04)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
275
- children: [
276
- g === I ? /* @__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(ve, { provider: I }),
277
- /* @__PURE__ */ o("span", { children: ye[I] })
278
- ]
279
- },
280
- I
281
- )),
282
- /* @__PURE__ */ o(we, {})
394
+ }, g = a.length > 0 && (l === "signin" || l === "signup"), _ = l === "signin" || l === "signup" || l === "forgot", Z = l === "signin" || l === "signup" && M;
395
+ 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: [
398
+ a.map((S) => /* @__PURE__ */ c("div", { class: "relative", children: [
399
+ /* @__PURE__ */ c(
400
+ "button",
401
+ {
402
+ type: "button",
403
+ onClick: () => m(S),
404
+ disabled: T !== null,
405
+ 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
+ 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) })
409
+ ]
410
+ }
411
+ ),
412
+ z?.method === S ? /* @__PURE__ */ o(ge, { email: z.email }) : null
413
+ ] }, S)),
414
+ /* @__PURE__ */ o(ht, {})
283
415
  ] }) : null,
284
- /* @__PURE__ */ c("form", { onSubmit: B, class: "flex flex-col gap-2", children: [
285
- (l === "signin" || l === "signup" || l === "forgot") && /* @__PURE__ */ o(
286
- j,
416
+ /* @__PURE__ */ c("form", { onSubmit: I, class: "flex flex-col gap-3", children: [
417
+ _ && /* @__PURE__ */ o(
418
+ fe,
287
419
  {
288
420
  type: "email",
289
- label: "Email",
290
- value: h,
291
- onInput: u,
421
+ placeholder: i("auth.email", "Email address"),
422
+ value: u,
423
+ onInput: p,
292
424
  autocomplete: "email",
293
425
  required: !0
294
426
  }
295
427
  ),
296
- (l === "signin" || l === "signup") && /* @__PURE__ */ o(
297
- j,
428
+ Z && /* @__PURE__ */ o(
429
+ Q,
298
430
  {
299
- type: "password",
300
- label: "Password",
301
- value: m,
302
- onInput: x,
431
+ placeholder: i("auth.password", "Password"),
432
+ value: f,
433
+ onInput: b,
303
434
  autocomplete: l === "signin" ? "current-password" : "new-password",
304
435
  required: !0
305
436
  }
306
437
  ),
307
- l === "reset_verify" && /* @__PURE__ */ c(re, { children: [
438
+ l === "signup" && M && /* @__PURE__ */ o(
439
+ Q,
440
+ {
441
+ placeholder: i("auth.repeat_password", "Repeat password"),
442
+ value: h,
443
+ onInput: y,
444
+ autocomplete: "new-password",
445
+ required: !0
446
+ }
447
+ ),
448
+ l === "reset_verify" && /* @__PURE__ */ c(W, { children: [
308
449
  /* @__PURE__ */ o(
309
- j,
450
+ fe,
310
451
  {
311
452
  type: "text",
312
- label: "Confirmation code",
313
- value: A,
314
- onInput: f,
453
+ placeholder: i("auth.confirmation_code", "Confirmation code"),
454
+ value: k,
455
+ onInput: j,
315
456
  autocomplete: "one-time-code",
316
457
  inputMode: "numeric",
317
458
  required: !0
318
459
  }
319
460
  ),
320
461
  /* @__PURE__ */ o(
321
- j,
462
+ Q,
322
463
  {
323
- type: "password",
324
- label: "New password (optional — only for password reset)",
325
- value: m,
326
- onInput: x,
464
+ placeholder: i(
465
+ "auth.new_password_optional",
466
+ "New password (optional — only for password reset)"
467
+ ),
468
+ value: f,
469
+ onInput: b,
327
470
  autocomplete: "new-password"
328
471
  }
329
472
  )
330
473
  ] }),
331
- l === "reset_sent" && S && /* @__PURE__ */ o("p", { class: "rounded-lg bg-gray-50 px-3 py-2 text-xs text-gray-600", children: S }),
332
- v && /* @__PURE__ */ o("p", { class: "text-xs text-red-600", children: v }),
333
- S && l !== "reset_sent" && /* @__PURE__ */ o("p", { class: "text-xs text-gray-500", children: S }),
334
- l !== "reset_sent" && /* @__PURE__ */ o(
335
- "button",
336
- {
337
- type: "submit",
338
- disabled: g !== null,
339
- class: "flex h-11 w-full items-center justify-center rounded-xl px-4 text-sm font-semibold tracking-tight 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)]",
340
- style: {
341
- background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
342
- boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
343
- },
344
- children: g === "email" ? /* @__PURE__ */ o("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : ke(l)
345
- }
346
- )
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 }),
478
+ l !== "reset_sent" && /* @__PURE__ */ c("div", { class: "relative", children: [
479
+ /* @__PURE__ */ o(
480
+ lt,
481
+ {
482
+ busy: T === "email",
483
+ label: st(l, M, t.submit_label ?? t.heading, i)
484
+ }
485
+ ),
486
+ l === "signin" && z?.method === "email" ? /* @__PURE__ */ o(ge, { email: z.email }) : null
487
+ ] })
347
488
  ] }),
348
- /* @__PURE__ */ c("div", { class: "flex flex-wrap items-center justify-between gap-x-3 gap-y-1 text-xs text-gray-500", children: [
349
- l === "signin" && e && /* @__PURE__ */ o("button", { type: "button", onClick: () => O(a, b, w, "signup"), class: "font-medium text-gray-700 hover:underline", children: "Create account" }),
350
- l === "signup" && /* @__PURE__ */ o("button", { type: "button", onClick: () => O(a, b, w, "signin"), class: "font-medium text-gray-700 hover:underline", children: "I already have an account" }),
351
- l === "signin" && t && /* @__PURE__ */ o("button", { type: "button", onClick: () => O(a, b, w, "forgot"), class: "hover:underline", children: "Forgot password?" }),
352
- (l === "forgot" || l === "reset_sent" || l === "reset_verify") && /* @__PURE__ */ o("button", { type: "button", onClick: () => O(a, b, w, "signin"), class: "hover:underline", children: "Back to sign in" }),
353
- l === "reset_sent" && /* @__PURE__ */ o("button", { type: "button", onClick: () => O(a, b, w, "reset_verify"), class: "font-medium text-gray-700 hover:underline", children: "I have a code" })
354
- ] })
489
+ /* @__PURE__ */ o(
490
+ at,
491
+ {
492
+ mode: l,
493
+ allowSignup: e,
494
+ onSwitch: A
495
+ }
496
+ )
497
+ ] });
498
+ }
499
+ function it({
500
+ mode: t,
501
+ customHeading: e,
502
+ customSubheading: n
503
+ }) {
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;
505
+ return /* @__PURE__ */ c("div", { class: "flex flex-col gap-2", children: [
506
+ /* @__PURE__ */ o("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: a }),
507
+ l ? /* @__PURE__ */ o("p", { class: "text-base leading-relaxed text-gray-600", children: l }) : null
355
508
  ] });
356
509
  }
357
- function ke(r) {
358
- switch (r) {
510
+ function ot(t, e) {
511
+ switch (t) {
359
512
  case "signin":
360
- return "Sign in";
513
+ return {
514
+ title: e("auth.welcome", "Welcome back!"),
515
+ subtitle: e("auth.default_subtitle", "Sign in to access all features and sync your data.")
516
+ };
361
517
  case "signup":
362
- return "Create account";
518
+ return {
519
+ title: e("auth.welcome_signup", "Welcome!"),
520
+ subtitle: e("auth.default_subtitle", "Sign in to access all features and sync your data.")
521
+ };
363
522
  case "forgot":
364
- return "Send reset code";
523
+ return {
524
+ title: e("auth.forgot_password_title", "Forgot password?"),
525
+ subtitle: e(
526
+ "auth.forgot_subtitle",
527
+ "Enter your email and we'll send you a password reset link."
528
+ )
529
+ };
530
+ case "reset_sent":
531
+ return {
532
+ title: e("auth.check_email_title", "Check your email"),
533
+ subtitle: null
534
+ };
365
535
  case "reset_verify":
366
- return "Verify";
536
+ return {
537
+ title: e("auth.reset_password_title", "Reset password"),
538
+ subtitle: e(
539
+ "auth.reset_password_subtitle",
540
+ "Enter the code from your email and a new password."
541
+ )
542
+ };
543
+ }
544
+ }
545
+ function st(t, e, n, r) {
546
+ if (t === "signin" && n) return n;
547
+ switch (t) {
548
+ case "signin":
549
+ return r("auth.log_in", "Sign In");
550
+ case "signup":
551
+ return e ? r("auth.create_account", "Create Account") : r("auth.sign_up", "Sign Up");
552
+ case "forgot":
553
+ return r("auth.send_reset", "Send Reset Email");
554
+ case "reset_verify":
555
+ return r("auth.verify", "Verify");
367
556
  default:
368
- return "Continue";
557
+ return r("cta.continue", "Continue");
369
558
  }
370
559
  }
371
- function O(r, e, t, n) {
372
- r(n), e(null), t(null);
560
+ function at({
561
+ mode: t,
562
+ allowSignup: e,
563
+ onSwitch: n
564
+ }) {
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?"),
568
+ " ",
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?"),
572
+ " ",
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?"),
576
+ " ",
577
+ /* @__PURE__ */ o(G, { onClick: () => n("signup"), children: r("auth.sign_up_link", "Sign Up") })
578
+ ] }) : null;
579
+ }
580
+ function G({
581
+ onClick: t,
582
+ children: e
583
+ }) {
584
+ return /* @__PURE__ */ o(
585
+ "button",
586
+ {
587
+ type: "button",
588
+ onClick: t,
589
+ class: "font-semibold transition-opacity hover:opacity-80 focus:outline-none focus-visible:opacity-80",
590
+ style: { color: "var(--pw-accent)" },
591
+ children: e
592
+ }
593
+ );
594
+ }
595
+ function lt({ busy: t, label: e }) {
596
+ return /* @__PURE__ */ o(
597
+ "button",
598
+ {
599
+ type: "submit",
600
+ disabled: t,
601
+ 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
+ style: {
603
+ 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
+ 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
+ },
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 })
607
+ }
608
+ );
609
+ }
610
+ function fe({ type: t, placeholder: e, value: n, onInput: r, autocomplete: i, inputMode: s, required: a }) {
611
+ return /* @__PURE__ */ o(
612
+ "input",
613
+ {
614
+ type: t,
615
+ value: n,
616
+ placeholder: e,
617
+ onInput: (l) => r(l.target.value),
618
+ autocomplete: i,
619
+ inputMode: s,
620
+ required: a,
621
+ 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 focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"
622
+ }
623
+ );
373
624
  }
374
- function j({ type: r, label: e, value: t, onInput: n, autocomplete: i, inputMode: s, required: l }) {
375
- return /* @__PURE__ */ c("label", { class: "flex flex-col gap-1.5", children: [
376
- /* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: e }),
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);
630
+ }, [a, e]);
631
+ const u = s("auth.show_password", "Show password"), p = s("auth.hide_password", "Hide password");
632
+ return /* @__PURE__ */ c("div", { class: "relative", children: [
377
633
  /* @__PURE__ */ o(
378
634
  "input",
379
635
  {
380
- type: r,
381
- value: t,
382
- onInput: (a) => n(a.target.value),
383
- autocomplete: i,
384
- inputMode: s,
385
- required: l,
386
- class: "h-11 w-full rounded-xl border border-gray-200 bg-white px-3.5 text-sm text-gray-900 shadow-[0_1px_0_rgba(15,23,42,0.02)] outline-none transition-all placeholder:text-gray-400 hover:border-gray-300 focus:border-[var(--pw-accent)] focus:shadow-[0_0_0_3px_color-mix(in_srgb,var(--pw-accent)_18%,transparent)]"
636
+ ref: d,
637
+ type: a ? "text" : "password",
638
+ value: e,
639
+ placeholder: t,
640
+ onInput: (f) => n(f.target.value),
641
+ autocomplete: r,
642
+ required: i,
643
+ 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
+ }
645
+ ),
646
+ /* @__PURE__ */ o(
647
+ "button",
648
+ {
649
+ type: "button",
650
+ onClick: () => l((f) => !f),
651
+ "aria-label": a ? p : u,
652
+ tabIndex: -1,
653
+ 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, {})
387
655
  }
388
656
  )
389
657
  ] });
390
658
  }
391
- function we() {
392
- return /* @__PURE__ */ c("div", { class: "flex items-center gap-2 py-1 text-[10px] uppercase tracking-[0.14em] text-gray-400", children: [
393
- /* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gradient-to-r from-gray-200 to-transparent" }),
394
- /* @__PURE__ */ o("span", { children: "or" }),
395
- /* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gradient-to-r from-transparent to-gray-200" })
659
+ function ct() {
660
+ return /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
661
+ /* @__PURE__ */ o(
662
+ "path",
663
+ {
664
+ d: "M1.667 10S4.583 4.167 10 4.167 18.333 10 18.333 10 15.417 15.833 10 15.833 1.667 10 1.667 10Z",
665
+ stroke: "currentColor",
666
+ "stroke-width": "1.5",
667
+ "stroke-linecap": "round",
668
+ "stroke-linejoin": "round"
669
+ }
670
+ ),
671
+ /* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "2.5", stroke: "currentColor", "stroke-width": "1.5" })
396
672
  ] });
397
673
  }
398
- function ve({ provider: r }) {
399
- return r === "google" ? /* @__PURE__ */ c("svg", { width: "16", height: "16", viewBox: "0 0 18 18", "aria-hidden": "true", children: [
674
+ function ut() {
675
+ return /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
676
+ /* @__PURE__ */ o(
677
+ "path",
678
+ {
679
+ d: "M8.236 4.293A6.96 6.96 0 0 1 10 4.167C15.417 4.167 18.333 10 18.333 10a13.5 13.5 0 0 1-1.92 2.755M11.768 11.768A2.5 2.5 0 0 1 8.233 8.233",
680
+ stroke: "currentColor",
681
+ "stroke-width": "1.5",
682
+ "stroke-linecap": "round",
683
+ "stroke-linejoin": "round"
684
+ }
685
+ ),
686
+ /* @__PURE__ */ o(
687
+ "path",
688
+ {
689
+ d: "M14.953 14.953A8.84 8.84 0 0 1 10 15.833C4.583 15.833 1.667 10 1.667 10a13.5 13.5 0 0 1 3.38-3.953M1.667 1.667l16.666 16.666",
690
+ stroke: "currentColor",
691
+ "stroke-width": "1.5",
692
+ "stroke-linecap": "round",
693
+ "stroke-linejoin": "round"
694
+ }
695
+ )
696
+ ] });
697
+ }
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 });
701
+ }
702
+ function dt(t) {
703
+ const [e, n] = t.split("@");
704
+ return n ? `${e.slice(0, 3)}*****@${n}` : t;
705
+ }
706
+ function ht() {
707
+ const { t } = w();
708
+ return /* @__PURE__ */ c("div", { class: "flex items-center gap-3 py-1 text-sm text-gray-400", children: [
709
+ /* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gray-200" }),
710
+ /* @__PURE__ */ o("span", { children: t("auth.or", "or") }),
711
+ /* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gray-200" })
712
+ ] });
713
+ }
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: [
400
716
  /* @__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" }),
401
717
  /* @__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" }),
402
718
  /* @__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" }),
403
719
  /* @__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" })
404
- ] }) : r === "apple" ? /* @__PURE__ */ o("svg", { width: "14", height: "16", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("path", { d: "M11.4 8.5c0-2 1.6-3 1.7-3-.9-1.3-2.4-1.5-2.9-1.5-1.2-.1-2.4.7-3 .7-.6 0-1.6-.7-2.6-.7-1.3 0-2.6.8-3.3 2C-.4 8.4.7 12.5 2.2 14.7c.7 1.1 1.6 2.3 2.7 2.3 1.1 0 1.5-.7 2.8-.7 1.3 0 1.7.7 2.8.7 1.2 0 1.9-1.1 2.6-2.2.6-.9 1-1.8 1.1-2.7-1.4-.5-2.8-1.7-2.8-3.6Zm-2-6.5C10 1.3 10.4.4 10.3 0c-.7 0-1.6.5-2.1 1.1-.5.5-1 1.4-.9 2.2.7 0 1.5-.4 2.1-1.3Z" }) }) : r === "github" ? /* @__PURE__ */ o("svg", { width: "16", height: "16", 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: "14", height: "16", 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" }) });
720
+ ] }) : t === "apple" ? (
721
+ // viewBox 0 0 24 24 даёт воздух сверху/снизу пути, поэтому визуально
722
+ // Apple-яблоко выглядит меньше Google. Компенсируем увеличенным
723
+ // width/height — 26×26 даёт примерно equal optical size с Google 20×20.
724
+ /* @__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" }) });
405
726
  }
406
- function _e({
407
- block: r,
727
+ function ft({
728
+ block: t,
408
729
  bootstrap: e,
409
- auth: t,
410
- authSession: n,
730
+ auth: n,
731
+ authSession: r,
411
732
  onBack: i,
412
- showBack: s = !0
733
+ showBack: s = !0,
734
+ intent: a = "preauth"
413
735
  }) {
414
- return /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
415
- s ? /* @__PURE__ */ o(
416
- "button",
417
- {
418
- type: "button",
419
- onClick: i,
420
- 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)]",
421
- children: "← Back"
422
- }
423
- ) : null,
424
- /* @__PURE__ */ o(oe, { block: r, ctx: {
425
- bootstrap: e,
426
- selectedPriceId: null,
427
- setSelectedPriceId: () => {
428
- },
429
- onAction: () => {
430
- },
431
- auth: t,
432
- authSession: n
433
- } })
736
+ const { t: l } = w(), d = {
737
+ bootstrap: e,
738
+ selectedPriceId: null,
739
+ setSelectedPriceId: () => {
740
+ },
741
+ onAction: () => {
742
+ },
743
+ auth: n,
744
+ authSession: r
745
+ }, u = a === "restore" ? {
746
+ ...t,
747
+ heading: l("auth.restore_purchases_heading", "Restore Purchases"),
748
+ subheading: l(
749
+ "auth.restore_purchases_subheading",
750
+ "Please sign in to restore your purchases."
751
+ )
752
+ } : a === "preauth" ? {
753
+ ...t,
754
+ heading: l("auth.login_continue_purchase", "Log in to continue your purchase"),
755
+ subheading: l(
756
+ "auth.link_purchase_subheading",
757
+ "We'll link the purchase to your account to keep access."
758
+ ),
759
+ // Preauth heading — descriptive sentence ("Log in to continue your
760
+ // purchase"), а не action verb. Длинные локализации (RU: "Войдите,
761
+ // чтобы продолжить покупку") в pill-кнопку h-12 не помещаются и
762
+ // переносятся на 2 строки. Явный короткий submit_label решает.
763
+ submit_label: l("auth.log_in", "Sign In")
764
+ } : t;
765
+ 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 })
434
768
  ] });
435
769
  }
436
- function Se({
437
- auth: r,
770
+ function gt({ onClick: t, ariaLabel: e }) {
771
+ return /* @__PURE__ */ o(
772
+ "button",
773
+ {
774
+ type: "button",
775
+ onClick: t,
776
+ "aria-label": e,
777
+ 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
+ children: /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
779
+ /* @__PURE__ */ o(
780
+ "path",
781
+ {
782
+ d: "M5 8h8a4 4 0 0 1 0 8H9",
783
+ stroke: "currentColor",
784
+ "stroke-width": "1.75",
785
+ "stroke-linecap": "round",
786
+ "stroke-linejoin": "round"
787
+ }
788
+ ),
789
+ /* @__PURE__ */ o(
790
+ "path",
791
+ {
792
+ d: "M8 4 4 8l4 4",
793
+ stroke: "currentColor",
794
+ "stroke-width": "1.75",
795
+ "stroke-linecap": "round",
796
+ "stroke-linejoin": "round"
797
+ }
798
+ )
799
+ ] })
800
+ }
801
+ );
802
+ }
803
+ function mt({
804
+ auth: t,
438
805
  onSuccess: e,
439
- onBack: t,
440
- heading: n = "Continue as guest",
441
- description: i = "Setting up your guest session…"
806
+ onBack: n,
807
+ heading: r,
808
+ description: i
442
809
  }) {
443
- const [s, l] = y({ kind: "signing-in" }), a = P(!0);
444
- M(() => () => {
445
- a.current = !1;
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;
446
813
  }, []);
447
- const h = () => {
448
- l({ kind: "signing-in" }), (async () => {
814
+ const f = () => {
815
+ u({ kind: "signing-in" }), (async () => {
449
816
  try {
450
- const u = await r.signInAnonymously();
451
- if (!a.current) return;
452
- e(u);
453
- } catch (u) {
454
- if (!a.current) return;
455
- l({
817
+ const b = await t.signInAnonymously();
818
+ if (!p.current) return;
819
+ e(b);
820
+ } catch (b) {
821
+ if (!p.current) return;
822
+ u({
456
823
  kind: "error",
457
- message: u instanceof Error ? u.message : "Anonymous sign-in failed"
824
+ message: b instanceof Error ? b.message : "Anonymous sign-in failed"
458
825
  });
459
826
  }
460
827
  })();
461
828
  };
462
- return M(() => {
463
- h();
829
+ return B(() => {
830
+ f();
464
831
  }, []), /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
465
- t ? /* @__PURE__ */ o(
832
+ n ? /* @__PURE__ */ o(
466
833
  "button",
467
834
  {
468
835
  type: "button",
469
- onClick: t,
836
+ onClick: n,
470
837
  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)]",
471
- children: "← Back"
838
+ children: s("nav.back", "← Back")
472
839
  }
473
840
  ) : null,
474
841
  /* @__PURE__ */ c("div", { class: "flex flex-col gap-1", children: [
475
- /* @__PURE__ */ o("h2", { class: "text-xl font-semibold text-gray-900", children: n }),
476
- /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: i })
842
+ /* @__PURE__ */ o("h2", { class: "text-xl font-semibold text-gray-900", children: a }),
843
+ /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: l })
477
844
  ] }),
478
- s.kind === "signing-in" ? /* @__PURE__ */ o("div", { class: "flex items-center justify-center py-6", children: /* @__PURE__ */ o(Ce, {}) }) : null,
479
- s.kind === "error" ? /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
480
- /* @__PURE__ */ o("div", { class: "rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700", children: s.message }),
845
+ d.kind === "signing-in" ? /* @__PURE__ */ o("div", { class: "flex items-center justify-center py-6", children: /* @__PURE__ */ o(yt, {}) }) : null,
846
+ d.kind === "error" ? /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
847
+ /* @__PURE__ */ o("div", { class: "rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700", children: d.message }),
481
848
  /* @__PURE__ */ o(
482
849
  "button",
483
850
  {
484
851
  type: "button",
485
- onClick: h,
852
+ onClick: f,
486
853
  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",
487
- children: "Try again"
854
+ children: s("anon.try_again", "Try again")
488
855
  }
489
856
  )
490
857
  ] }) : null
491
858
  ] });
492
859
  }
493
- function Ce() {
860
+ function yt() {
494
861
  return /* @__PURE__ */ c("svg", { class: "h-5 w-5 animate-spin text-[var(--pw-accent)]", viewBox: "0 0 24 24", fill: "none", children: [
495
862
  /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "3", "stroke-opacity": "0.2" }),
496
863
  /* @__PURE__ */ o("path", { d: "M22 12a10 10 0 0 0-10-10", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round" })
497
864
  ] });
498
865
  }
499
- const D = 3, F = 200, V = 5e3, H = 5, Ie = 10 * 1024 * 1024, X = ["image/jpeg", "image/png", "image/webp"], K = /.+@.+\..+/;
500
- function Ae({ client: r, authSession: e, origin: t, onBack: n }) {
501
- const i = e?.user.email ?? "", s = i || null, [l, a] = y(i), [h, u] = y(""), [m, x] = y(""), [A, f] = y([]), [g, _] = y(!1), [v, b] = y(null), [S, w] = y({}), B = ne(() => {
502
- const C = (s ?? l).trim().toLowerCase(), d = h.trim(), p = m.trim();
503
- return K.test(C) && d.length >= D && d.length <= F && p.length >= 1 && p.length <= V;
504
- }, [s, l, h, m]), L = () => {
505
- const C = {}, d = (s ?? l).trim(), p = h.trim(), k = m.trim();
506
- return d ? K.test(d.toLowerCase()) || (C.email = "Invalid email") : C.email = "Required", (p.length < D || p.length > F) && (C.subject = `${D}–${F} characters`), (k.length < 1 || k.length > V) && (C.message = `1–${V} characters`), w(C), Object.keys(C).length === 0;
507
- }, I = async (C) => {
508
- if (C.preventDefault(), !g && L()) {
509
- _(!0), w((d) => ({ ...d, submit: void 0 }));
866
+ const Ae = (t) => `pw-offer-${t}-start`;
867
+ function ee(t) {
868
+ const e = t - Date.now();
869
+ return e <= 0 ? { days: 0, hours: 0, minutes: 0, seconds: 0, expired: !0 } : {
870
+ days: Math.floor(e / (1e3 * 60 * 60 * 24)),
871
+ hours: Math.floor(e % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)),
872
+ minutes: Math.floor(e % (1e3 * 60 * 60) / (1e3 * 60)),
873
+ seconds: Math.floor(e % (1e3 * 60) / 1e3),
874
+ expired: !1
875
+ };
876
+ }
877
+ function xt(t) {
878
+ if (t.expires_at) {
879
+ const e = Date.parse(t.expires_at);
880
+ return Number.isFinite(e) ? e : null;
881
+ }
882
+ if (t.duration_minutes && t.duration_minutes > 0) {
883
+ if (typeof window > "u") return null;
884
+ 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;
888
+ } catch {
889
+ return null;
890
+ }
891
+ }
892
+ return null;
893
+ }
894
+ function Ee(t, e) {
895
+ if (!t || t.length === 0) return null;
896
+ if (e) {
897
+ const n = t.find((r) => r.id === e);
898
+ if (n) return n;
899
+ }
900
+ return t.find((n) => n.expires_at || n.duration_minutes) ?? null;
901
+ }
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(() => {
907
+ if (e === null) {
908
+ r(null);
909
+ return;
910
+ }
911
+ r(ee(e));
912
+ const s = setInterval(() => {
913
+ const a = ee(i.current ?? 0);
914
+ if (r(a), a.expired && (clearInterval(s), t?.duration_minutes && typeof window < "u"))
915
+ try {
916
+ window.localStorage.removeItem(Ae(t.id));
917
+ } catch {
918
+ }
919
+ }, 1e3);
920
+ return () => clearInterval(s);
921
+ }, [e, t?.duration_minutes, t?.id]), n;
922
+ }
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;
927
+ return /* @__PURE__ */ c(
928
+ "div",
929
+ {
930
+ class: "flex flex-wrap items-center justify-center gap-2 rounded-2xl px-4 py-3 text-[15px] font-semibold leading-tight text-white",
931
+ style: {
932
+ background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)",
933
+ textShadow: "0 0 2px rgba(0, 0, 0, 0.25)"
934
+ },
935
+ role: "status",
936
+ children: [
937
+ /* @__PURE__ */ o(Me, {}),
938
+ /* @__PURE__ */ o("span", { children: a }),
939
+ /* @__PURE__ */ o(Be, { value: i, t: n })
940
+ ]
941
+ }
942
+ );
943
+ }
944
+ function Be({ value: t, t: e }) {
945
+ 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) }),
948
+ /* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.d", "d") })
949
+ ] }) : null,
950
+ /* @__PURE__ */ o(V, { children: String(t.hours).padStart(2, "0") }),
951
+ /* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.h", "h") }),
952
+ /* @__PURE__ */ o(V, { children: String(t.minutes).padStart(2, "0") }),
953
+ /* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.m", "m") }),
954
+ /* @__PURE__ */ o(V, { children: String(t.seconds).padStart(2, "0") }),
955
+ /* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.s", "s") })
956
+ ] });
957
+ }
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 });
960
+ }
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;
965
+ return /* @__PURE__ */ c(
966
+ "div",
967
+ {
968
+ class: "-mb-2 flex flex-wrap items-center justify-center gap-2 rounded-t-xl px-4 pb-5 pt-3 text-[15px] font-semibold leading-tight text-white",
969
+ style: {
970
+ background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)",
971
+ textShadow: "0 0 2px rgba(0, 0, 0, 0.25)"
972
+ },
973
+ role: "status",
974
+ children: [
975
+ /* @__PURE__ */ o(Me, {}),
976
+ /* @__PURE__ */ o("span", { children: i }),
977
+ /* @__PURE__ */ o(Be, { value: n, t: e })
978
+ ]
979
+ }
980
+ );
981
+ }
982
+ function Me() {
983
+ return /* @__PURE__ */ o(
984
+ "svg",
985
+ {
986
+ width: "16",
987
+ height: "16",
988
+ viewBox: "0 0 12 12",
989
+ fill: "none",
990
+ "aria-hidden": "true",
991
+ children: /* @__PURE__ */ o(
992
+ "path",
993
+ {
994
+ fill: "currentColor",
995
+ d: "m9.44 5.359-2.394-.895.61-3.036c.062-.31-.345-.531-.57-.291L2.434 6.105a.336.336 0 0 0 .126.537l2.395.894-.61 3.037c-.062.31.345.53.57.29l4.653-4.968a.336.336 0 0 0-.126-.536Z"
996
+ }
997
+ )
998
+ }
999
+ );
1000
+ }
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,
1010
+ max: ne
1011
+ })), (g.length < 1 || g.length > re) && (A.message = i("support.message_length", "{min}–{max} characters", {
1012
+ 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 }));
510
1018
  try {
511
- const d = (s ?? l).trim();
512
- await r.createSupportTicket({
513
- subject: h.trim(),
514
- content: m.trim(),
515
- email: d || void 0,
516
- files: A.length > 0 ? A : void 0
517
- }), b(d);
518
- } catch (d) {
519
- const p = d instanceof T && d.message || "Failed to send. Please try again.";
520
- w((k) => ({ ...k, submit: p }));
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 }));
521
1029
  } finally {
522
- _(!1);
1030
+ j(!1);
523
1031
  }
524
1032
  }
525
- }, E = () => {
526
- u(""), x(""), f([]), w({}), b(null);
527
- };
528
- return v ? /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-4 py-2 text-center", children: [
529
- /* @__PURE__ */ o(
530
- "div",
531
- {
532
- class: "flex h-14 w-14 items-center justify-center rounded-full",
533
- style: {
534
- background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 85%, white), var(--pw-accent))",
535
- color: "#fff",
536
- boxShadow: "0 0 0 8px color-mix(in srgb, var(--pw-accent) 12%, transparent), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 45%, transparent)"
537
- },
538
- "aria-hidden": "true",
539
- children: /* @__PURE__ */ o("svg", { viewBox: "0 0 24 24", class: "h-7 w-7", children: /* @__PURE__ */ o(
540
- "path",
541
- {
542
- fill: "currentColor",
543
- d: "M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24Zm6.93 8.2-6.85 9.29a1.01 1.01 0 0 1-1.43.19L5.76 13.77a1 1 0 1 1 1.25-1.56l4.08 3.26 6.23-8.45a1 1 0 1 1 1.61 1.18Z"
544
- }
545
- ) })
546
- }
547
- ),
548
- /* @__PURE__ */ o("div", { class: "text-lg font-semibold tracking-tight text-gray-900", children: "Request submitted" }),
549
- /* @__PURE__ */ c("div", { class: "max-w-[320px] text-sm leading-relaxed text-gray-500", children: [
550
- "We've received your message and will respond to",
551
- " ",
552
- /* @__PURE__ */ o("b", { class: "text-gray-700", children: v }),
553
- "."
1033
+ }, 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: [
1037
+ /* @__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
+ /* @__PURE__ */ o(
1039
+ "div",
1040
+ {
1041
+ class: "flex h-14 w-14 items-center justify-center rounded-full",
1042
+ style: {
1043
+ background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 85%, white), var(--pw-accent))",
1044
+ color: "#fff",
1045
+ boxShadow: "0 0 0 8px color-mix(in srgb, var(--pw-accent) 12%, transparent), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 45%, transparent)"
1046
+ },
1047
+ "aria-hidden": "true",
1048
+ children: /* @__PURE__ */ o("svg", { viewBox: "0 0 24 24", class: "h-7 w-7", children: /* @__PURE__ */ o(
1049
+ "path",
1050
+ {
1051
+ fill: "currentColor",
1052
+ d: "M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24Zm6.93 8.2-6.85 9.29a1.01 1.01 0 0 1-1.43.19L5.76 13.77a1 1 0 1 1 1.25-1.56l4.08 3.26 6.23-8.45a1 1 0 1 1 1.61 1.18Z"
1053
+ }
1054
+ ) })
1055
+ }
1056
+ ),
1057
+ /* @__PURE__ */ o("div", { class: "text-lg font-semibold tracking-tight text-gray-900", children: i("support.success_heading", "Request submitted") }),
1058
+ /* @__PURE__ */ c("div", { class: "max-w-[320px] text-sm leading-relaxed text-gray-500", children: [
1059
+ i(
1060
+ "support.success_message_prefix",
1061
+ "We've received your message and will respond to"
1062
+ ),
1063
+ " ",
1064
+ /* @__PURE__ */ o("b", { class: "text-gray-700", children: T }),
1065
+ "."
1066
+ ] })
554
1067
  ] }),
555
- /* @__PURE__ */ c("div", { class: "mt-2 flex items-center justify-center gap-3", children: [
1068
+ /* @__PURE__ */ o("div", { class: z, style: D, children: /* @__PURE__ */ c("div", { class: "flex items-center justify-center gap-3", children: [
556
1069
  /* @__PURE__ */ o(
557
1070
  "button",
558
1071
  {
559
1072
  type: "button",
560
- onClick: n,
1073
+ onClick: r,
561
1074
  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)]",
562
- children: t === "standalone" ? "Done" : "Back"
1075
+ children: n === "standalone" ? i("support.done_button", "Done") : i("nav.back_aria", "Back")
563
1076
  }
564
1077
  ),
565
1078
  /* @__PURE__ */ o(
566
1079
  "button",
567
1080
  {
568
1081
  type: "button",
569
- onClick: E,
1082
+ onClick: q,
570
1083
  class: "flex h-10 items-center justify-center rounded-xl px-4 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)]",
571
1084
  style: {
572
1085
  background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
573
1086
  boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
574
1087
  },
575
- children: "Send another request"
1088
+ children: i("support.send_another", "Send another request")
576
1089
  }
577
1090
  )
578
- ] })
579
- ] }) : /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
580
- /* @__PURE__ */ o("div", { class: "flex items-center justify-between", children: /* @__PURE__ */ c(
581
- "button",
582
- {
583
- type: "button",
584
- onClick: n,
585
- class: "-ml-1 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)]",
586
- children: [
587
- " ",
588
- t === "standalone" ? "Close" : "Back"
589
- ]
590
- }
591
- ) }),
592
- /* @__PURE__ */ o("h2", { class: "text-lg font-semibold tracking-tight text-gray-900", children: "Contact Support" }),
593
- /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: "Fill out the form below and we'll get back to you." }),
594
- /* @__PURE__ */ c("form", { onSubmit: I, class: "flex flex-col gap-3", children: [
595
- s ? /* @__PURE__ */ c("div", { class: "rounded-xl border border-gray-200 bg-gray-50/60 px-3 py-2 text-xs text-gray-500", children: [
596
- "Sending as ",
597
- /* @__PURE__ */ o("b", { class: "font-medium text-gray-700", children: s })
598
- ] }) : /* @__PURE__ */ o(
599
- J,
600
- {
601
- type: "email",
602
- label: "Your email",
603
- value: l,
604
- onInput: a,
605
- error: S.email,
606
- autocomplete: "email",
607
- required: !0
608
- }
609
- ),
610
- /* @__PURE__ */ o(
611
- J,
612
- {
613
- type: "text",
614
- label: "Subject",
615
- value: h,
616
- onInput: u,
617
- error: S.subject,
618
- required: !0
619
- }
620
- ),
621
- /* @__PURE__ */ o(
622
- Ee,
623
- {
624
- label: "Message",
625
- value: m,
626
- onInput: x,
627
- error: S.message,
628
- required: !0
629
- }
630
- ),
631
- /* @__PURE__ */ o(Te, { files: A, onChange: f, disabled: g }),
632
- S.submit && /* @__PURE__ */ o("p", { class: "text-xs text-red-600", children: S.submit }),
633
- /* @__PURE__ */ c("div", { class: "mt-1 flex items-center justify-end gap-2", children: [
1091
+ ] }) })
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") }),
1094
+ /* @__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
+ /* @__PURE__ */ c("div", { class: "flex flex-col gap-2 pr-10", children: [
1096
+ /* @__PURE__ */ o("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: i("support.heading", "Support") }),
1097
+ /* @__PURE__ */ o("p", { class: "text-base leading-relaxed text-gray-600", children: i("support.instruction", "Please fill out the form below to submit your support request.") })
1098
+ ] }),
1099
+ /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
1100
+ a ? /* @__PURE__ */ c("div", { class: "rounded-2xl bg-gray-100 px-5 py-3 text-sm text-gray-600", children: [
1101
+ i("support.sending_as", "Sending as"),
1102
+ " ",
1103
+ /* @__PURE__ */ o("b", { class: "font-medium text-gray-900", children: a })
1104
+ ] }) : /* @__PURE__ */ o(
1105
+ xe,
1106
+ {
1107
+ type: "email",
1108
+ placeholder: i("support.email_placeholder", "Enter your email *"),
1109
+ value: l,
1110
+ onInput: d,
1111
+ error: L.email,
1112
+ autocomplete: "email",
1113
+ required: !0
1114
+ }
1115
+ ),
1116
+ /* @__PURE__ */ o(
1117
+ xe,
1118
+ {
1119
+ type: "text",
1120
+ placeholder: i("support.subject_placeholder", "Enter your subject *"),
1121
+ value: u,
1122
+ onInput: p,
1123
+ error: L.subject,
1124
+ required: !0
1125
+ }
1126
+ ),
1127
+ /* @__PURE__ */ o(
1128
+ St,
1129
+ {
1130
+ placeholder: i("support.message_placeholder", "Enter your message *"),
1131
+ value: f,
1132
+ onInput: b,
1133
+ error: L.message,
1134
+ required: !0
1135
+ }
1136
+ ),
1137
+ /* @__PURE__ */ o(Ct, { files: h, onChange: y, disabled: k })
1138
+ ] })
1139
+ ] }) }),
1140
+ /* @__PURE__ */ c("div", { class: z, style: D, children: [
1141
+ L.submit && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: L.submit }),
1142
+ /* @__PURE__ */ c("div", { class: "flex items-center justify-end gap-3", children: [
634
1143
  /* @__PURE__ */ o(
635
1144
  "button",
636
1145
  {
637
1146
  type: "button",
638
- onClick: n,
639
- disabled: g,
640
- class: "rounded-xl px-3 py-2 text-sm font-medium text-gray-600 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)]",
641
- children: t === "standalone" ? "Close" : "Back"
1147
+ onClick: r,
1148
+ disabled: k,
1149
+ 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")
642
1151
  }
643
1152
  ),
644
1153
  /* @__PURE__ */ o(
645
1154
  "button",
646
1155
  {
647
1156
  type: "submit",
648
- disabled: !B || g,
649
- class: "flex h-10 items-center justify-center rounded-xl px-4 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)]",
1157
+ disabled: !P || k,
1158
+ 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)]",
650
1159
  style: {
651
- background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
652
- boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
1160
+ 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
+ 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)"
653
1162
  },
654
- children: g ? /* @__PURE__ */ o("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : "Send"
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") })
655
1164
  }
656
1165
  )
657
1166
  ] })
658
1167
  ] })
659
1168
  ] });
660
1169
  }
661
- function J({ type: r, label: e, value: t, onInput: n, error: i, autocomplete: s, required: l }) {
662
- return /* @__PURE__ */ c("label", { class: "flex flex-col gap-1.5", children: [
663
- /* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: e }),
1170
+ function _t({ onClick: t, ariaLabel: e }) {
1171
+ return /* @__PURE__ */ o(
1172
+ "button",
1173
+ {
1174
+ type: "button",
1175
+ onClick: t,
1176
+ "aria-label": e,
1177
+ 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
+ children: /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
1179
+ /* @__PURE__ */ o(
1180
+ "path",
1181
+ {
1182
+ d: "M5 8h8a4 4 0 0 1 0 8H9",
1183
+ stroke: "currentColor",
1184
+ "stroke-width": "1.75",
1185
+ "stroke-linecap": "round",
1186
+ "stroke-linejoin": "round"
1187
+ }
1188
+ ),
1189
+ /* @__PURE__ */ o(
1190
+ "path",
1191
+ {
1192
+ d: "M8 4 4 8l4 4",
1193
+ stroke: "currentColor",
1194
+ "stroke-width": "1.75",
1195
+ "stroke-linecap": "round",
1196
+ "stroke-linejoin": "round"
1197
+ }
1198
+ )
1199
+ ] })
1200
+ }
1201
+ );
1202
+ }
1203
+ function xe({
1204
+ type: t,
1205
+ placeholder: e,
1206
+ value: n,
1207
+ onInput: r,
1208
+ error: i,
1209
+ autocomplete: s,
1210
+ required: a
1211
+ }) {
1212
+ return /* @__PURE__ */ c("div", { children: [
664
1213
  /* @__PURE__ */ o(
665
1214
  "input",
666
1215
  {
667
- type: r,
668
- value: t,
669
- onInput: (a) => n(a.target.value),
1216
+ type: t,
1217
+ value: n,
1218
+ placeholder: e,
1219
+ onInput: (l) => r(l.target.value),
670
1220
  autocomplete: s,
671
- required: l,
672
- class: `h-11 w-full rounded-xl border bg-white px-3.5 text-sm text-gray-900 shadow-[0_1px_0_rgba(15,23,42,0.02)] outline-none transition-all placeholder:text-gray-400 ${i ? "border-red-400 focus:border-red-500 focus:shadow-[0_0_0_3px_rgba(239,68,68,0.18)]" : "border-gray-200 hover:border-gray-300 focus:border-[var(--pw-accent)] focus:shadow-[0_0_0_3px_color-mix(in_srgb,var(--pw-accent)_18%,transparent)]"}`
1221
+ required: a,
1222
+ 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)]"}`
673
1223
  }
674
1224
  ),
675
- i && /* @__PURE__ */ o("span", { class: "text-xs text-red-600", children: i })
1225
+ i && /* @__PURE__ */ o("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: i })
676
1226
  ] });
677
1227
  }
678
- function Ee({ label: r, value: e, onInput: t, error: n, required: i }) {
679
- return /* @__PURE__ */ c("label", { class: "flex flex-col gap-1.5", children: [
680
- /* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: r }),
1228
+ function St({
1229
+ placeholder: t,
1230
+ value: e,
1231
+ onInput: n,
1232
+ error: r,
1233
+ required: i
1234
+ }) {
1235
+ return /* @__PURE__ */ c("div", { children: [
681
1236
  /* @__PURE__ */ o(
682
1237
  "textarea",
683
1238
  {
684
1239
  value: e,
685
- onInput: (s) => t(s.target.value),
1240
+ placeholder: t,
1241
+ onInput: (s) => n(s.target.value),
686
1242
  required: i,
687
- rows: 4,
688
- class: `min-h-[104px] w-full rounded-xl border bg-white px-3.5 py-2.5 text-sm leading-relaxed text-gray-900 shadow-[0_1px_0_rgba(15,23,42,0.02)] outline-none transition-all placeholder:text-gray-400 ${n ? "border-red-400 focus:border-red-500 focus:shadow-[0_0_0_3px_rgba(239,68,68,0.18)]" : "border-gray-200 hover:border-gray-300 focus:border-[var(--pw-accent)] focus:shadow-[0_0_0_3px_color-mix(in_srgb,var(--pw-accent)_18%,transparent)]"}`
1243
+ 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)]"}`
689
1245
  }
690
1246
  ),
691
- n && /* @__PURE__ */ o("span", { class: "text-xs text-red-600", children: n })
1247
+ r && /* @__PURE__ */ o("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: r })
692
1248
  ] });
693
1249
  }
694
- function Te({ files: r, onChange: e, disabled: t }) {
695
- const n = P(null), [i, s] = y(!1), [l, a] = y(null), h = (u) => {
696
- if (!u || t) return;
697
- a(null);
698
- const m = Array.from(u);
699
- if (r.length + m.length > H) {
700
- a(`Up to ${H} files`);
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;
1253
+ 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 }));
701
1257
  return;
702
1258
  }
703
- const x = m.filter(
704
- (A) => X.includes(A.type) && A.size <= Ie
1259
+ const b = f.filter(
1260
+ (h) => me.includes(h.type) && h.size <= kt
705
1261
  );
706
- if (x.length !== m.length) {
707
- a("Only JPEG/PNG/WebP, ≤ 10MB each");
1262
+ if (b.length !== f.length) {
1263
+ d(r("support.invalid_file", "Only JPEG/PNG/WebP, ≤ 10MB each"));
708
1264
  return;
709
1265
  }
710
- e([...r, ...x]);
1266
+ e([...t, ...b]);
711
1267
  };
712
1268
  return /* @__PURE__ */ c("div", { children: [
713
- /* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: "Attachments (optional)" }),
1269
+ /* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: r("support.attachments_label", "Attachments (optional)") }),
714
1270
  /* @__PURE__ */ c(
715
1271
  "div",
716
1272
  {
717
1273
  role: "button",
718
1274
  tabIndex: 0,
719
- "aria-label": "Attachments upload",
720
- onClick: () => !t && n.current?.click(),
721
- onDragOver: (u) => {
722
- u.preventDefault(), t || s(!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);
723
1279
  },
724
- onDragLeave: () => s(!1),
725
- onDrop: (u) => {
726
- u.preventDefault(), s(!1), h(u.dataTransfer?.files ?? null);
1280
+ onDragLeave: () => a(!1),
1281
+ onDrop: (p) => {
1282
+ p.preventDefault(), a(!1), u(p.dataTransfer?.files ?? null);
727
1283
  },
728
- class: `mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${i ? "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" : ""}`,
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" : ""}`,
729
1285
  children: [
730
- /* @__PURE__ */ o("div", { class: "text-xs text-gray-500", children: "Drop images here or click to select" }),
731
- /* @__PURE__ */ c("div", { class: "mt-0.5 text-[11px] text-gray-400", children: [
732
- "JPEG/PNG/WebP, up to ",
733
- H,
734
- " files, ≤ 10MB each"
735
- ] })
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
1289
+ }) })
736
1290
  ]
737
1291
  }
738
1292
  ),
739
1293
  /* @__PURE__ */ o(
740
1294
  "input",
741
1295
  {
742
- ref: n,
1296
+ ref: i,
743
1297
  type: "file",
744
1298
  multiple: !0,
745
- accept: X.join(","),
1299
+ accept: me.join(","),
746
1300
  class: "hidden",
747
- onChange: (u) => {
748
- h(u.target.files), u.currentTarget.value = "";
1301
+ onChange: (p) => {
1302
+ u(p.target.files), p.currentTarget.value = "";
749
1303
  }
750
1304
  }
751
1305
  ),
752
1306
  l && /* @__PURE__ */ o("p", { class: "mt-1 text-xs text-red-600", children: l }),
753
- r.length > 0 && /* @__PURE__ */ o("ul", { class: "mt-2 flex flex-col gap-1", children: r.map((u, m) => /* @__PURE__ */ c(
1307
+ t.length > 0 && /* @__PURE__ */ o("ul", { class: "mt-2 flex flex-col gap-1", children: t.map((p, f) => /* @__PURE__ */ c(
754
1308
  "li",
755
1309
  {
756
1310
  class: "flex items-center justify-between gap-2 rounded bg-gray-50 px-2 py-1 text-xs",
757
1311
  children: [
758
- /* @__PURE__ */ o("span", { class: "truncate text-gray-700", children: u.name }),
1312
+ /* @__PURE__ */ o("span", { class: "truncate text-gray-700", children: p.name }),
759
1313
  /* @__PURE__ */ o(
760
1314
  "button",
761
1315
  {
762
1316
  type: "button",
763
1317
  onClick: () => {
764
- const x = [...r];
765
- x.splice(m, 1), e(x);
1318
+ const b = [...t];
1319
+ b.splice(f, 1), e(b);
766
1320
  },
767
- disabled: t,
1321
+ disabled: n,
768
1322
  class: "text-gray-500 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-60",
769
- "aria-label": `Remove ${u.name}`,
1323
+ "aria-label": r("support.remove_file_aria", "Remove {filename}", { filename: p.name }),
770
1324
  children: "✕"
771
1325
  }
772
1326
  )
773
1327
  ]
774
1328
  },
775
- `${u.name}-${u.size}-${m}`
1329
+ `${p.name}-${p.size}-${f}`
776
1330
  )) })
777
1331
  ] });
778
1332
  }
779
- function Me({ block: r, ctx: e }) {
780
- const [t, n] = y(!1), i = r.priceId ?? e.selectedPriceId, s = t || r.action === "checkout" && !i;
781
- return /* @__PURE__ */ o(
1333
+ const It = {
1334
+ day: "cta.get_plan_daily",
1335
+ week: "cta.get_plan_weekly",
1336
+ month: "cta.get_plan_monthly",
1337
+ year: "cta.get_plan_yearly"
1338
+ }, Lt = {
1339
+ day: "Get Daily Plan",
1340
+ week: "Get Weekly Plan",
1341
+ month: "Get Monthly Plan",
1342
+ year: "Get Yearly Plan"
1343
+ };
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)
1354
+ });
1355
+ }
1356
+ function Et(t) {
1357
+ return t.length ? t[0].toUpperCase() + t.slice(1) : t;
1358
+ }
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);
1361
+ return /* @__PURE__ */ c(
782
1362
  "button",
783
1363
  {
784
1364
  type: "button",
785
- disabled: s,
1365
+ disabled: a,
786
1366
  onClick: async () => {
787
- if (!s) {
788
- n(!0);
1367
+ if (!a) {
1368
+ i(!0);
789
1369
  try {
790
- await e.onAction(r.action, { priceId: i });
1370
+ await e.onAction(t.action, { priceId: s });
791
1371
  } finally {
792
- n(!1);
1372
+ i(!1);
793
1373
  }
794
1374
  }
795
1375
  },
796
- class: "pw-cta-shimmer relative mt-1 flex h-14 w-full items-center justify-center overflow-hidden rounded-full px-6 text-base font-semibold tracking-tight text-white transition-transform duration-150 hover:-translate-y-px active:scale-[0.98] active:translate-y-0 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
1376
+ class: "pw-cta-shimmer relative 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)]",
797
1377
  style: {
798
1378
  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%)",
799
- boxShadow: "0 0 24px 0 color-mix(in srgb, var(--pw-accent) 35%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent), 0 1px 2px rgba(15,23,42,0.08)"
1379
+ 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)"
800
1380
  },
801
- 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: r.label })
1381
+ children: [
1382
+ /* @__PURE__ */ o(
1383
+ "span",
1384
+ {
1385
+ class: "absolute inset-0 opacity-40",
1386
+ style: {
1387
+ background: "radial-gradient(circle at 50% 0%, color-mix(in srgb, white 40%, transparent) 0%, transparent 70%)"
1388
+ },
1389
+ "aria-hidden": "true"
1390
+ }
1391
+ ),
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 })
1393
+ ]
802
1394
  }
803
1395
  );
804
1396
  }
805
- function Be({ ctx: r }) {
806
- const e = r.authSession, t = r.auth, [n, i] = y(!1), s = () => r.onAction("support");
807
- if (e && !e.user.is_anonymous) {
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) {
808
1400
  const l = async () => {
809
- if (!(!t || n)) {
810
- i(!0);
1401
+ if (!(!r || i)) {
1402
+ s(!0);
811
1403
  try {
812
- await t.signOut();
1404
+ await r.signOut();
813
1405
  } catch {
814
1406
  } finally {
815
- i(!1);
1407
+ s(!1);
816
1408
  }
817
1409
  }
818
1410
  };
819
1411
  return /* @__PURE__ */ c("div", { class: "-mt-3 flex flex-col items-center gap-1.5 pt-1 text-center text-[13px] text-gray-500", children: [
820
1412
  /* @__PURE__ */ c("span", { children: [
821
- "Signed in as",
1413
+ e("session.signed_in_as_prefix", "Signed in as"),
822
1414
  " ",
823
- /* @__PURE__ */ o("b", { class: "font-medium text-gray-700", children: e.user.email })
1415
+ /* @__PURE__ */ o("b", { class: "font-medium text-gray-700", children: n.user.email })
824
1416
  ] }),
825
1417
  /* @__PURE__ */ c("div", { class: "flex items-center justify-center gap-3", children: [
826
- /* @__PURE__ */ o(z, { onClick: l, disabled: !t || n, children: n ? "Signing out…" : "Sign Out" }),
827
- /* @__PURE__ */ o(Q, {}),
828
- /* @__PURE__ */ o(z, { onClick: s, children: "Contact Support" })
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") })
829
1421
  ] })
830
1422
  ] });
831
1423
  }
832
1424
  return /* @__PURE__ */ c("div", { class: "-mt-3 flex items-center justify-center gap-3 pt-1 text-center text-[13px]", children: [
833
- /* @__PURE__ */ o(z, { onClick: () => r.onAction("restore"), children: "Restore purchases" }),
834
- /* @__PURE__ */ o(Q, {}),
835
- /* @__PURE__ */ o(z, { onClick: s, children: "Contact Support" })
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") })
836
1428
  ] });
837
1429
  }
838
- function z({
839
- onClick: r,
1430
+ function $({
1431
+ onClick: t,
840
1432
  disabled: e,
841
- children: t
1433
+ children: n
842
1434
  }) {
843
1435
  return /* @__PURE__ */ o(
844
1436
  "button",
845
1437
  {
846
1438
  type: "button",
847
- onClick: r,
1439
+ onClick: t,
848
1440
  disabled: e,
849
- class: "font-semibold underline underline-offset-2 transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:opacity-80",
1441
+ class: "font-semibold transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:opacity-80",
850
1442
  style: { color: "var(--pw-accent)" },
851
- children: t
1443
+ children: n
852
1444
  }
853
1445
  );
854
1446
  }
855
- function Q() {
1447
+ function be() {
856
1448
  return /* @__PURE__ */ o("span", { class: "h-1 w-1 rounded-full bg-gray-300", "aria-hidden": "true" });
857
1449
  }
858
- function Le({ block: r }) {
859
- 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: [
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: [
860
1452
  /* @__PURE__ */ o(
861
- "span",
1453
+ "svg",
862
1454
  {
863
- class: "mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full",
864
- style: {
865
- background: "color-mix(in srgb, var(--pw-accent) 12%, white)",
866
- color: "var(--pw-accent)"
867
- },
1455
+ width: "18",
1456
+ height: "18",
1457
+ viewBox: "0 0 20 20",
1458
+ fill: "none",
1459
+ class: "mt-0.5 flex-shrink-0 text-emerald-500",
868
1460
  "aria-hidden": "true",
869
- children: /* @__PURE__ */ o("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ o(
1461
+ children: /* @__PURE__ */ o(
870
1462
  "path",
871
1463
  {
872
- d: "M5 10l3 3 7-7",
1464
+ d: "M4 10.5l3.5 3.5 8.5-8.5",
873
1465
  stroke: "currentColor",
874
1466
  "stroke-width": "2.5",
875
1467
  "stroke-linecap": "round",
876
1468
  "stroke-linejoin": "round"
877
1469
  }
878
- ) })
1470
+ )
879
1471
  }
880
1472
  ),
881
1473
  /* @__PURE__ */ c("div", { class: "flex flex-col gap-0.5", children: [
882
1474
  /* @__PURE__ */ o("span", { class: "font-medium leading-snug text-gray-900", children: e.name }),
883
- e.desc ? /* @__PURE__ */ o("span", { class: "text-xs leading-relaxed text-gray-500", children: e.desc }) : null
1475
+ e.desc ? /* @__PURE__ */ o("span", { class: "text-xs leading-relaxed text-gray-400", children: e.desc }) : null
884
1476
  ] })
885
1477
  ] }, e.id)) }) : null;
886
1478
  }
887
- function Pe({ block: r }) {
888
- const e = r.title ?? "100% Money-Back Guarantee", t = r.subtitle ?? "Not satisfied? We'll refund you no questions asked.", n = (r.icon ?? "dollar_shield") !== "none";
889
- return /* @__PURE__ */ c("div", { class: "-mt-1 flex flex-col items-center gap-1 border-b border-gray-200 pb-4 text-center", children: [
890
- /* @__PURE__ */ c("div", { class: "flex items-center justify-center gap-1.5", children: [
891
- n ? /* @__PURE__ */ o(Ue, {}) : null,
892
- /* @__PURE__ */ o("b", { class: "text-[14px] font-semibold text-gray-700", children: e })
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);
1481
+ 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
+ /* @__PURE__ */ c("div", { class: "inline-flex items-center gap-2 text-[12px] text-gray-700", children: [
1483
+ i ? /* @__PURE__ */ o(Ut, {}) : null,
1484
+ s ? /* @__PURE__ */ c("span", { children: [
1485
+ /* @__PURE__ */ o("b", { class: "font-bold text-gray-900", children: s.bold }),
1486
+ " ",
1487
+ /* @__PURE__ */ o("span", { class: "font-medium", children: s.rest })
1488
+ ] }) : /* @__PURE__ */ o("span", { class: "font-medium", children: n })
893
1489
  ] }),
894
- t ? /* @__PURE__ */ o("span", { class: "text-[12px] leading-relaxed text-gray-500", children: t }) : null
1490
+ r ? /* @__PURE__ */ o("span", { class: "text-center text-xs leading-relaxed text-gray-500", children: r }) : null
895
1491
  ] });
896
1492
  }
897
- function Ue() {
898
- return /* @__PURE__ */ o(
1493
+ function Ot(t) {
1494
+ const e = t.match(/^(\d+[-\s]?days?)\s+(.+)$/i);
1495
+ return e ? { bold: e[1], rest: e[2] } : null;
1496
+ }
1497
+ function Ut() {
1498
+ return /* @__PURE__ */ c(
899
1499
  "svg",
900
1500
  {
901
1501
  xmlns: "http://www.w3.org/2000/svg",
902
- viewBox: "0 0 512 512",
903
- fill: "currentColor",
904
- width: "18",
905
- height: "18",
906
- class: "text-emerald-500",
1502
+ viewBox: "0 0 24 24",
1503
+ fill: "none",
1504
+ width: "16",
1505
+ height: "16",
1506
+ class: "flex-shrink-0 text-emerald-500",
907
1507
  "aria-hidden": "true",
908
- children: /* @__PURE__ */ o("path", { d: "M257.5 .1l3.1 .4 192 42.7c4.3 1 8.2 3.2 11.2 6.5s4.8 7.4 5.3 11.8l.2 2.5 0 234.7C469.3 416.5 373.8 512 256 512C140.1 512 45.9 419.7 42.7 304.6l-.1-6L42.7 64c0-4.4 1.4-8.8 3.9-12.4s6.2-6.3 10.4-7.8l2.4-.7L251.4 .5c2-.4 4.1-.6 6.2-.4zM256 85.3c-12.8 0-21.3 8.5-21.3 21.3l0 23.5c-36.3 4.3-64 34.1-64 72.5c0 44.8 34.1 61.9 64 70.4l0 66.1c-11.9-4-20.1-15.3-21.2-27.1l-.1-2.7c0-12.8-8.5-21.3-21.3-21.3s-21.3 8.5-21.3 21.3c0 38.4 27.7 68.3 64 72.5l0 23.5c0 12.8 8.5 21.3 21.3 21.3s21.3-8.5 21.3-21.3l0-23.5c36.3-4.3 64-36.3 64-72.5c0-44.8-34.1-61.9-64-70.4l0-66.1c11.9 4 20.1 15.3 21.2 27.1l.1 2.7c0 12.8 8.5 21.3 21.3 21.3s21.3-8.5 21.3-21.3c0-38.4-27.7-68.3-64-72.5l0-23.5c0-12.8-8.5-21.3-21.3-21.3zm21.3 198.4c14.9 6.4 21.3 12.8 21.3 25.6c0 14.9-8.5 25.6-21.3 29.9l0-55.5zM234.7 172.8l0 55.5c-14.9-6.4-21.3-12.8-21.3-25.6c0-14.9 8.5-25.6 21.3-29.9z" })
1508
+ children: [
1509
+ /* @__PURE__ */ o(
1510
+ "path",
1511
+ {
1512
+ d: "M12 2 4 5v6c0 5.25 3.5 9.5 8 11 4.5-1.5 8-5.75 8-11V5l-8-3Z",
1513
+ stroke: "currentColor",
1514
+ "stroke-width": "2",
1515
+ "stroke-linejoin": "round"
1516
+ }
1517
+ ),
1518
+ /* @__PURE__ */ o(
1519
+ "path",
1520
+ {
1521
+ d: "m9 12 2 2 4-4",
1522
+ stroke: "currentColor",
1523
+ "stroke-width": "2",
1524
+ "stroke-linecap": "round",
1525
+ "stroke-linejoin": "round"
1526
+ }
1527
+ )
1528
+ ]
909
1529
  }
910
1530
  );
911
1531
  }
912
- const se = 30, Oe = 16, je = 2;
913
- function ze(r, e) {
914
- const t = e * je;
915
- let n = se;
916
- for (r.style.fontSize = `${n}px`; r.scrollHeight > t && n > Oe; )
917
- n -= 1, r.style.fontSize = `${n}px`;
918
- }
919
- function Re({ block: r, ctx: e }) {
920
- const t = r.level ?? 1, n = `h${t}`, i = t === 1 ? "text-[1.875rem] font-bold leading-[1.15] text-center text-balance text-gray-900 tracking-[-0.02em]" : t === 2 ? "text-xl font-semibold leading-snug text-gray-900 tracking-tight" : "text-base font-medium text-gray-900", s = P(null), l = t === 1 && !!e.bootstrap.settings.title_auto_fit;
921
- return M(() => {
922
- if (!l || !s.current) return;
923
- const a = getComputedStyle(s.current), h = parseFloat(a.lineHeight) || se * 1.5;
924
- ze(s.current, h);
925
- }, [l, r.text]), /* @__PURE__ */ o(n, { ref: s, class: i, children: r.text });
926
- }
927
- function Ne(r) {
928
- const e = r.local ?? { currency: r.currency, amount: r.amount };
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`;
1538
+ }
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(() => {
1542
+ 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 });
1546
+ }
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 };
1552
+ }
1553
+ return { amount: e.amount, currency: e.currency };
1554
+ }
1555
+ function oe(t, e) {
1556
+ const n = t % 1 !== 0 ? 2 : 0;
929
1557
  try {
930
- const t = new Intl.NumberFormat(void 0, {
1558
+ const r = new Intl.NumberFormat(void 0, {
931
1559
  style: "currency",
932
- currency: e.currency,
1560
+ currency: e,
933
1561
  currencyDisplay: "narrowSymbol",
934
- maximumFractionDigits: e.amount % 1 === 0 ? 0 : 2,
935
- minimumFractionDigits: e.amount % 1 === 0 ? 0 : 2
936
- }).formatToParts(e.amount);
937
- let n = "", i = "";
938
- for (const s of t)
939
- s.type === "currency" ? n = s.value : s.type !== "literal" && (i += s.value);
940
- return { currency: n || e.currency, amount: i.trim() };
1562
+ maximumFractionDigits: n,
1563
+ minimumFractionDigits: n
1564
+ }).formatToParts(t);
1565
+ let i = "", s = "";
1566
+ for (const a of r)
1567
+ a.type === "currency" ? i = a.value : a.type !== "literal" && (s += a.value);
1568
+ return { currency: i || e, amount: s.trim() };
941
1569
  } catch {
942
- return { currency: e.currency, amount: String(e.amount) };
943
- }
944
- }
945
- function qe(r) {
946
- return r.label ? r.label.toUpperCase() : !r.interval || r.interval === "lifetime" ? "LIFETIME" : {
947
- day: "DAILY PLAN",
948
- week: "WEEKLY PLAN",
949
- month: "MONTHLY PLAN",
950
- year: "YEARLY PLAN"
951
- }[r.interval] ?? `${r.interval.toUpperCase()} PLAN`;
952
- }
953
- function De(r) {
954
- if (!r.interval || r.interval === "lifetime") return "lifetime";
955
- const e = r.interval_count ?? 1;
956
- return e === 1 ? r.interval : `${e} ${r.interval}s`;
957
- }
958
- function Fe({ block: r, ctx: e }) {
959
- const t = r.priceIds && r.priceIds.length > 0 ? new Set(r.priceIds) : null, n = e.bootstrap.prices.filter((a) => !t || t.has(a.id));
960
- if (n.length === 0)
961
- return /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: "No prices available." });
962
- const i = r.view === "horizontal", s = r.popular_label ?? "Most popular", l = i ? Math.min(n.length, 3) : 1;
1570
+ return { currency: e, amount: String(t) };
1571
+ }
1572
+ }
1573
+ function le(t, e) {
1574
+ const { amount: n, currency: r } = qt(t);
1575
+ if (!e) {
1576
+ const { currency: l, amount: d } = oe(n, r);
1577
+ return { currency: l, amount: d, originalAmount: null };
1578
+ }
1579
+ const i = n * (1 - e / 100), s = oe(i, r), a = oe(n, r);
1580
+ return {
1581
+ currency: s.currency,
1582
+ amount: s.amount,
1583
+ originalAmount: `${a.currency}${a.amount}`
1584
+ };
1585
+ }
1586
+ function se(t, e) {
1587
+ if (!t || t.length === 0) return null;
1588
+ const n = t.find(
1589
+ (i) => i.price_id === e && i.discount_percent && i.discount_percent > 0
1590
+ );
1591
+ return n || (t.find(
1592
+ (i) => i.price_id == null && i.discount_percent && i.discount_percent > 0
1593
+ ) ?? null);
1594
+ }
1595
+ function Oe(t, e) {
1596
+ if (t.label) return t.label.toUpperCase();
1597
+ if (!t.interval || t.interval === "lifetime")
1598
+ return e("pricing.plan_label.lifetime", "LIFETIME");
1599
+ const r = {
1600
+ day: { key: "pricing.plan_label.daily", fallback: "DAILY PLAN" },
1601
+ week: { key: "pricing.plan_label.weekly", fallback: "WEEKLY PLAN" },
1602
+ month: { key: "pricing.plan_label.monthly", fallback: "MONTHLY PLAN" },
1603
+ year: { key: "pricing.plan_label.yearly", fallback: "YEARLY PLAN" }
1604
+ }[t.interval];
1605
+ return r ? e(r.key, r.fallback) : `${t.interval.toUpperCase()} PLAN`;
1606
+ }
1607
+ function ce(t, e) {
1608
+ if (!t.interval || t.interval === "lifetime")
1609
+ 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`;
1613
+ }
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));
1616
+ 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")
1620
+ return /* @__PURE__ */ o(
1621
+ "div",
1622
+ {
1623
+ class: "flex w-full flex-col",
1624
+ role: "radiogroup",
1625
+ "aria-label": n("pricing.plans_aria", "Plans"),
1626
+ children: i.map((a, l) => /* @__PURE__ */ o(
1627
+ Vt,
1628
+ {
1629
+ price: a,
1630
+ isLast: l === i.length - 1,
1631
+ isPopular: t.popular_price_id === a.id,
1632
+ popularLabel: s,
1633
+ offer: se(e.bootstrap.offers, a.id),
1634
+ selected: e.selectedPriceId === a.id,
1635
+ onSelect: () => {
1636
+ e.setSelectedPriceId(a.id), e.onAction("price_selected", { priceId: a.id, price: a });
1637
+ },
1638
+ t: n
1639
+ },
1640
+ a.id
1641
+ ))
1642
+ }
1643
+ );
1644
+ if (t.view === "horizontal") {
1645
+ const a = Math.min(i.length, 3);
1646
+ return /* @__PURE__ */ o(
1647
+ "div",
1648
+ {
1649
+ class: "grid items-stretch gap-2",
1650
+ style: { gridTemplateColumns: `repeat(${a}, minmax(0, 1fr))` },
1651
+ role: "radiogroup",
1652
+ "aria-label": n("pricing.plans_aria", "Plans"),
1653
+ children: i.map((l) => /* @__PURE__ */ o(
1654
+ $t,
1655
+ {
1656
+ price: l,
1657
+ isPopular: t.popular_price_id === l.id,
1658
+ popularLabel: s,
1659
+ offer: se(e.bootstrap.offers, l.id),
1660
+ selected: e.selectedPriceId === l.id,
1661
+ onSelect: () => {
1662
+ e.setSelectedPriceId(l.id), e.onAction("price_selected", { priceId: l.id, price: l });
1663
+ },
1664
+ t: n
1665
+ },
1666
+ l.id
1667
+ ))
1668
+ }
1669
+ );
1670
+ }
963
1671
  return /* @__PURE__ */ o(
964
1672
  "div",
965
1673
  {
966
- class: i ? "grid gap-2.5" : "flex flex-col gap-2.5",
967
- style: i ? { gridTemplateColumns: `repeat(${l}, minmax(0, 1fr))` } : void 0,
1674
+ class: "flex flex-col gap-2",
968
1675
  role: "radiogroup",
969
- "aria-label": "Plans",
970
- children: n.map((a) => {
971
- const h = e.selectedPriceId === a.id, u = r.popular_price_id === a.id, { currency: m, amount: x } = Ne(a);
1676
+ "aria-label": n("pricing.plans_aria", "Plans"),
1677
+ 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);
972
1679
  return /* @__PURE__ */ c(
973
1680
  "button",
974
1681
  {
975
1682
  type: "button",
976
1683
  role: "radio",
977
- "aria-checked": h,
1684
+ "aria-checked": l,
978
1685
  onClick: () => {
979
1686
  e.setSelectedPriceId(a.id), e.onAction("price_selected", { priceId: a.id, price: a });
980
1687
  },
981
1688
  class: [
982
- "group relative flex w-full items-center gap-3 rounded-2xl border px-4 py-3 text-left transition-all duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
983
- h ? "border-[var(--pw-accent)] shadow-[0_0_0_1px_var(--pw-accent)]" : "border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm",
984
- u ? "mt-2.5" : ""
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)]",
1690
+ // Везде border 2px selection выражается только цветом, layout
1691
+ // не прыгает (равная толщина у selected/unselected). Цветовая
1692
+ // разница accent vs gray достаточно сильная для visual hierarchy.
1693
+ l ? "border-[var(--pw-accent)] bg-transparent" : "border-gray-200 bg-transparent hover:bg-gray-50"
985
1694
  ].join(" "),
986
1695
  children: [
987
- u ? /* @__PURE__ */ o(
1696
+ /* @__PURE__ */ o(
988
1697
  "span",
989
1698
  {
990
- class: "absolute -top-2.5 left-4 rounded-full px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white shadow-sm",
991
- style: {
992
- background: "linear-gradient(135deg, var(--pw-accent), color-mix(in srgb, var(--pw-accent) 70%, black))"
993
- },
994
- children: s
1699
+ class: [
1700
+ "flex h-6.5 w-6.5 flex-shrink-0 items-center justify-center rounded-full border transition-colors",
1701
+ l ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent",
1702
+ // Popular-label badge сидит absolute сверху-справа карточки и
1703
+ // визуально сдвигает центр content'а вниз. flex items-center
1704
+ // на карточке держит галочку по геометрическому центру, что
1705
+ // делает её визуально выше — компенсируем небольшим mt'ом.
1706
+ d ? "mt-3" : ""
1707
+ ].join(" "),
1708
+ style: l ? {
1709
+ background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 70%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)"
1710
+ } : void 0,
1711
+ "aria-hidden": "true",
1712
+ children: /* @__PURE__ */ o(
1713
+ "svg",
1714
+ {
1715
+ width: "14",
1716
+ height: "10",
1717
+ viewBox: "0 0 17 12",
1718
+ fill: "none",
1719
+ xmlns: "http://www.w3.org/2000/svg",
1720
+ class: l ? "opacity-100" : "opacity-0",
1721
+ children: /* @__PURE__ */ o(
1722
+ "path",
1723
+ {
1724
+ d: "M16.5234 0.476562C16.9805 0.898438 16.9805 1.63672 16.5234 2.05859L7.52344 11.0586C7.10156 11.5156 6.36328 11.5156 5.94141 11.0586L1.44141 6.55859C0.984375 6.13672 0.984375 5.39844 1.44141 4.97656C1.86328 4.51953 2.60156 4.51953 3.02344 4.97656L6.75 8.66797L14.9414 0.476562C15.3633 0.0195312 16.1016 0.0195312 16.5234 0.476562Z",
1725
+ fill: "currentColor"
1726
+ }
1727
+ )
1728
+ }
1729
+ )
995
1730
  }
996
- ) : null,
1731
+ ),
997
1732
  /* @__PURE__ */ c("div", { class: "flex flex-1 flex-col gap-0.5", children: [
998
- /* @__PURE__ */ o("span", { class: "text-[11px] font-medium uppercase tracking-[0.08em] text-gray-500", children: qe(a) }),
999
- /* @__PURE__ */ c("div", { class: "flex items-baseline gap-1.5 leading-none", children: [
1000
- /* @__PURE__ */ o("span", { class: "text-[24px] font-normal text-gray-400", children: m }),
1001
- /* @__PURE__ */ o("span", { class: "text-[34px] font-semibold tracking-tight text-gray-900", children: x }),
1002
- /* @__PURE__ */ c("span", { class: "ml-1 text-sm font-medium text-gray-400", children: [
1733
+ /* @__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 ? (
1736
+ // opacity-60 приглушает strike: глаз сначала ловит label
1737
+ // и discount-badge, потом main price; original «бывшая цена»
1738
+ // — третичная информация, не должна конкурировать с 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 })
1740
+ ) : null,
1741
+ p ? (
1742
+ // Emerald pill — фиксированный «успех/выгода», не зависит от
1743
+ // brand_color. Читается даже на тёмных бренд-акцентах.
1744
+ /* @__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
+ "-",
1746
+ p,
1747
+ "%"
1748
+ ] })
1749
+ ) : null
1750
+ ] }),
1751
+ /* @__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
+ " ",
1754
+ b,
1755
+ /* @__PURE__ */ c("span", { class: "text-sm font-normal text-gray-500", children: [
1756
+ " ",
1003
1757
  "/ ",
1004
- De(a)
1758
+ ce(a, n)
1005
1759
  ] })
1006
- ] }),
1760
+ ] }) }),
1007
1761
  a.description ? /* @__PURE__ */ o("span", { class: "mt-1 text-xs leading-relaxed text-gray-500", children: a.description }) : null,
1008
- a.trial_days ? /* @__PURE__ */ c("span", { class: "mt-1 text-xs font-medium text-[var(--pw-accent)]", children: [
1009
- a.trial_days,
1010
- "-day free trial"
1011
- ] }) : 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
1012
1763
  ] }),
1013
- /* @__PURE__ */ o(
1764
+ d ? /* @__PURE__ */ o(
1014
1765
  "span",
1015
1766
  {
1016
- class: [
1017
- "flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border transition-colors",
1018
- h ? "border-[var(--pw-accent)] bg-[var(--pw-accent)] text-white" : "border-gray-300 bg-white text-transparent group-hover:border-gray-400"
1019
- ].join(" "),
1020
- "aria-hidden": "true",
1021
- children: /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ o(
1022
- "path",
1023
- {
1024
- d: "M3.5 8.5l3 3 6-7",
1025
- stroke: "currentColor",
1026
- "stroke-width": "2",
1027
- "stroke-linecap": "round",
1028
- "stroke-linejoin": "round"
1029
- }
1030
- ) })
1767
+ class: "absolute -top-[9px] -right-[6px] rounded-[11px] border-[5px] border-white px-2 py-1 text-[12px] font-semibold text-white",
1768
+ style: { background: "var(--pw-accent)" },
1769
+ children: s
1031
1770
  }
1032
- )
1771
+ ) : null
1033
1772
  ]
1034
1773
  },
1035
1774
  a.id
@@ -1038,391 +1777,591 @@ function Fe({ block: r, ctx: e }) {
1038
1777
  }
1039
1778
  );
1040
1779
  }
1041
- function Ve({ block: r }) {
1042
- return /* @__PURE__ */ o("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children: r.text });
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);
1782
+ }
1783
+ function Vt({
1784
+ price: t,
1785
+ isLast: e,
1786
+ isPopular: n,
1787
+ popularLabel: r,
1788
+ offer: i,
1789
+ selected: s,
1790
+ onSelect: a,
1791
+ t: l
1792
+ }) {
1793
+ const d = i?.discount_percent ?? null, { currency: u, amount: p, originalAmount: f } = le(t, d);
1794
+ return /* @__PURE__ */ c(
1795
+ "button",
1796
+ {
1797
+ type: "button",
1798
+ role: "radio",
1799
+ "aria-checked": s,
1800
+ onClick: a,
1801
+ class: "group relative inline-flex w-full max-w-[360px] mx-auto items-center justify-between gap-4 px-4 pt-3.5 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--pw-accent)]",
1802
+ children: [
1803
+ /* @__PURE__ */ o(
1804
+ "span",
1805
+ {
1806
+ class: [
1807
+ "flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border transition-colors mb-3",
1808
+ s ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent"
1809
+ ].join(" "),
1810
+ style: s ? {
1811
+ background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 70%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)"
1812
+ } : void 0,
1813
+ "aria-hidden": "true",
1814
+ children: /* @__PURE__ */ o(
1815
+ "svg",
1816
+ {
1817
+ width: "14",
1818
+ height: "10",
1819
+ viewBox: "0 0 17 12",
1820
+ fill: "none",
1821
+ xmlns: "http://www.w3.org/2000/svg",
1822
+ class: s ? "opacity-100" : "opacity-0",
1823
+ children: /* @__PURE__ */ o(
1824
+ "path",
1825
+ {
1826
+ d: "M16.5234 0.476562C16.9805 0.898438 16.9805 1.63672 16.5234 2.05859L7.52344 11.0586C7.10156 11.5156 6.36328 11.5156 5.94141 11.0586L1.44141 6.55859C0.984375 6.13672 0.984375 5.39844 1.44141 4.97656C1.86328 4.51953 2.60156 4.51953 3.02344 4.97656L6.75 8.66797L14.9414 0.476562C15.3633 0.0195312 16.1016 0.0195312 16.5234 0.476562Z",
1827
+ fill: "currentColor"
1828
+ }
1829
+ )
1830
+ }
1831
+ )
1832
+ }
1833
+ ),
1834
+ /* @__PURE__ */ c(
1835
+ "div",
1836
+ {
1837
+ class: [
1838
+ "flex flex-1 items-center gap-1.5 pb-3.5",
1839
+ e ? "" : "border-b border-gray-200"
1840
+ ].join(" "),
1841
+ children: [
1842
+ /* @__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 ? (
1845
+ // Pastel brand-mix pill — точно как `badge` в TelegramPricingRadio.
1846
+ // Низкий visual weight: pill про "имя плана" (most popular), а не
1847
+ // про savings — не должна конкурировать с -X% discount-pill.
1848
+ /* @__PURE__ */ o(
1849
+ "span",
1850
+ {
1851
+ class: "rounded-[9px] px-2 py-1 text-[10px] font-bold",
1852
+ style: {
1853
+ 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
+ color: "var(--pw-accent)"
1855
+ },
1856
+ children: r
1857
+ }
1858
+ )
1859
+ ) : null,
1860
+ 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: [
1861
+ "-",
1862
+ d,
1863
+ "%"
1864
+ ] }) : null
1865
+ ] }),
1866
+ /* @__PURE__ */ o("div", { class: "flex-1" }),
1867
+ /* @__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,
1869
+ /* @__PURE__ */ c("span", { class: "whitespace-nowrap", children: [
1870
+ /* @__PURE__ */ o("span", { class: "opacity-90", children: u }),
1871
+ p,
1872
+ /* @__PURE__ */ c("span", { class: "text-xs text-gray-400", children: [
1873
+ " ",
1874
+ "/ ",
1875
+ ce(t, l)
1876
+ ] })
1877
+ ] })
1878
+ ] })
1879
+ ]
1880
+ }
1881
+ )
1882
+ ]
1883
+ }
1884
+ );
1885
+ }
1886
+ function $t({
1887
+ price: t,
1888
+ isPopular: e,
1889
+ popularLabel: n,
1890
+ offer: r,
1891
+ selected: i,
1892
+ onSelect: s,
1893
+ t: a
1894
+ }) {
1895
+ const l = r?.discount_percent ?? null, { currency: d, amount: u, originalAmount: p } = le(t, l);
1896
+ return /* @__PURE__ */ c(
1897
+ "button",
1898
+ {
1899
+ type: "button",
1900
+ role: "radio",
1901
+ "aria-checked": i,
1902
+ onClick: s,
1903
+ class: [
1904
+ "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"
1906
+ ].join(" "),
1907
+ style: i ? { background: "color-mix(in srgb, var(--pw-accent) 6%, transparent)" } : void 0,
1908
+ 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: [
1913
+ "-",
1914
+ l,
1915
+ "%"
1916
+ ] }) : null
1917
+ ] }),
1918
+ /* @__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 }),
1920
+ u
1921
+ ] }),
1922
+ /* @__PURE__ */ c("span", { class: "text-xs font-normal text-gray-500", children: [
1923
+ "/ ",
1924
+ ce(t, a)
1925
+ ] }),
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
+ e ? /* @__PURE__ */ o(
1928
+ "span",
1929
+ {
1930
+ 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
+ style: { background: "var(--pw-accent)" },
1932
+ children: n
1933
+ }
1934
+ ) : null
1935
+ ]
1936
+ }
1937
+ );
1938
+ }
1939
+ function Ht({ block: t }) {
1940
+ return /* @__PURE__ */ o("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children: t.text });
1043
1941
  }
1044
- const He = {
1942
+ const Gt = {
1045
1943
  week: 0.25,
1046
1944
  month: 1,
1047
1945
  year: 12
1048
1946
  };
1049
- function $e(r) {
1050
- return r || "period";
1947
+ function Wt(t, e) {
1948
+ return t ? e(`pricing.interval.${t}`, t) : e("pricing.interval.period", "period");
1051
1949
  }
1052
- function Ge({ block: r, ctx: e }) {
1053
- if (!r.queries.length) return null;
1054
- const n = e.bootstrap.prices.find((s) => s.id === e.selectedPriceId)?.interval ?? null, i = n ? He[n] : void 0;
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;
1055
1954
  return /* @__PURE__ */ c("div", { class: "flex flex-col gap-2", children: [
1056
- /* @__PURE__ */ c("div", { class: "text-sm font-semibold text-gray-800", children: [
1057
- "Included per ",
1058
- /* @__PURE__ */ o("span", { children: $e(n) }),
1059
- ":"
1060
- ] }),
1061
- /* @__PURE__ */ o("ul", { class: "flex flex-col gap-2", role: "list", children: r.queries.map((s) => {
1062
- const l = Number.isFinite(s.count) ? s.count : 0, a = i !== void 0 ? Math.round(l * i) : l;
1063
- return /* @__PURE__ */ c("li", { class: `flex gap-2 ${s.desc ? "" : "items-center"}`, 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)
1957
+ }) }),
1958
+ /* @__PURE__ */ o("ul", { class: "flex flex-col gap-2", role: "list", children: t.queries.map((a) => {
1959
+ const l = Number.isFinite(a.count) ? a.count : 0, d = s !== void 0 ? Math.round(l * s) : l;
1960
+ return /* @__PURE__ */ c("li", { class: `flex gap-3 ${a.desc ? "items-start" : "items-center"}`, children: [
1064
1961
  /* @__PURE__ */ o(
1065
- "span",
1962
+ "svg",
1066
1963
  {
1067
- class: `flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full ${s.desc ? "mt-0.5" : ""}`,
1068
- style: {
1069
- background: "var(--pw-accent)",
1070
- color: "#ffffff"
1071
- },
1964
+ width: "18",
1965
+ height: "18",
1966
+ viewBox: "0 0 20 20",
1967
+ fill: "none",
1968
+ class: `flex-shrink-0 text-emerald-500 ${a.desc ? "mt-0.5" : ""}`,
1072
1969
  "aria-hidden": "true",
1073
- children: /* @__PURE__ */ o("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ o(
1970
+ children: /* @__PURE__ */ o(
1074
1971
  "path",
1075
1972
  {
1076
- d: "M5 10l3 3 7-7",
1973
+ d: "M4 10.5l3.5 3.5 8.5-8.5",
1077
1974
  stroke: "currentColor",
1078
- "stroke-width": "2.75",
1975
+ "stroke-width": "2.5",
1079
1976
  "stroke-linecap": "round",
1080
1977
  "stroke-linejoin": "round"
1081
1978
  }
1082
- ) })
1979
+ )
1083
1980
  }
1084
1981
  ),
1085
1982
  /* @__PURE__ */ c("div", { children: [
1086
- /* @__PURE__ */ o("span", { class: "font-semibold text-gray-900 text-sm", children: a }),
1983
+ /* @__PURE__ */ o("span", { class: "font-semibold text-gray-900 text-sm", children: d }),
1087
1984
  " ",
1088
- /* @__PURE__ */ o("span", { class: "text-sm text-gray-800", children: s.name }),
1089
- s.desc ? /* @__PURE__ */ c(re, { children: [
1985
+ /* @__PURE__ */ o("span", { class: "text-sm text-gray-800", children: a.name }),
1986
+ a.desc ? /* @__PURE__ */ c(W, { children: [
1090
1987
  /* @__PURE__ */ o("br", {}),
1091
- /* @__PURE__ */ o("span", { class: "text-xs text-gray-500", children: s.desc })
1988
+ /* @__PURE__ */ o("span", { class: "text-xs text-gray-400", children: a.desc })
1092
1989
  ] }) : null
1093
1990
  ] })
1094
- ] }, s.id);
1991
+ ] }, a.id);
1095
1992
  }) })
1096
1993
  ] });
1097
1994
  }
1098
- const We = {
1099
- heading: Re,
1100
- text: Ve,
1101
- price_grid: Fe,
1102
- cta_button: Me,
1103
- auth_panel: oe,
1104
- current_session: Be,
1105
- features_list: Le,
1106
- tokenization_gate: Ge,
1107
- guarantee_badge: Pe
1995
+ const Yt = {
1996
+ heading: Dt,
1997
+ text: Ht,
1998
+ price_grid: Nt,
1999
+ 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
1108
2006
  };
1109
- function Ze({ layout: r, bootstrap: e, onAction: t, auth: n, authSession: i }) {
1110
- const s = ne(() => e.prices[0]?.id ?? null, [e.prices]), [l, a] = y(s), h = {
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;
2012
+ return e.prices[0]?.id ?? null;
2013
+ }, [t.blocks, e.prices]), [a, l] = x(s), d = {
1111
2014
  bootstrap: e,
1112
- selectedPriceId: l,
1113
- setSelectedPriceId: a,
1114
- onAction: t,
1115
- auth: n,
2015
+ selectedPriceId: a,
2016
+ setSelectedPriceId: l,
2017
+ onAction: n,
2018
+ auth: r,
1116
2019
  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);
1117
2023
  };
1118
- return /* @__PURE__ */ o("div", { class: "flex flex-col gap-4", children: r.blocks.map((u, m) => {
1119
- const x = We[u.type];
1120
- return x ? /* @__PURE__ */ o(x, { block: u, ctx: h }, m) : (typeof console < "u" && console.warn(`[paywall] unknown block type: ${u.type}`), null);
1121
- }) });
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 ? (
2027
+ // Тонкий shadow-top вместо border-t — создаёт depth, читается как
2028
+ // «footer закреплён к низу dialog'а». Линия выглядела как divider
2029
+ // в обычном flow, не передавала sticky-character.
2030
+ /* @__PURE__ */ o(
2031
+ "div",
2032
+ {
2033
+ class: "flex flex-col gap-4 bg-white px-6 pb-6 pt-3 sm:px-8",
2034
+ style: { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" },
2035
+ children: f.map((h, y) => b(h, p.length + y))
2036
+ }
2037
+ )
2038
+ ) : null
2039
+ ] });
1122
2040
  }
1123
- function Ye(r, e, t, n) {
1124
- 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 };
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 };
1125
2043
  }
1126
- function Xe(r, e) {
1127
- return r.open === e.open && r.view === e.view && r.error === e.error;
2044
+ function Jt(t, e) {
2045
+ return t.open === e.open && t.view === e.view && t.error === e.error;
1128
2046
  }
1129
- function Ke({
1130
- client: r,
2047
+ function Qt({
2048
+ client: t,
1131
2049
  open: e,
1132
- onClose: t,
1133
- onEvent: n,
2050
+ onClose: n,
2051
+ onEvent: r,
1134
2052
  initialView: i,
1135
2053
  purchased: s,
1136
- renew: l,
1137
- onState: a,
1138
- inline: h
2054
+ renew: a,
2055
+ onState: l,
2056
+ inline: d
1139
2057
  }) {
1140
- const [u, m] = y({ status: "idle" }), [x, A] = y(
1141
- () => r.auth?.getCachedSession() ?? null
1142
- ), [f, g] = y(() => i === "support" ? { kind: "support", origin: "standalone" } : i === "auth" ? { kind: "auth_gate", origin: "standalone" } : i === "anon" ? { kind: "anon_gate", origin: "standalone" } : { kind: "layout" }), _ = P(!1), v = P(null);
1143
- M(() => {
1144
- if (!a) return;
1145
- const d = Ye(e, u, f, s), p = v.current;
1146
- p && Xe(p, d) || (v.current = d, a(d));
1147
- }, [e, u, f, s, a]), M(() => {
1148
- if (r.auth)
1149
- return r.auth.onAuthChange((d, p) => A(p));
1150
- }, [r.auth]), M(() => {
1151
- if (typeof r.onBootstrapChange == "function")
1152
- return r.onBootstrapChange((d) => {
1153
- m(
1154
- (p) => p.status === "ready" ? { status: "ready", data: d } : p
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(() => {
2062
+ 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
1155
2073
  );
1156
2074
  });
1157
- }, [r]), M(() => {
2075
+ }, [t]), B(() => {
1158
2076
  if (!e || u.status === "ready" || u.status === "loading") return;
1159
- let d = !1;
1160
- return m({ status: "loading" }), r.bootstrap().then((p) => {
1161
- d || (m({ status: "ready", data: p }), n("ready", p), p.user?.has_active_subscription && !l && (n("purchase_completed", {
2077
+ 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", {
1162
2080
  priceId: null,
1163
2081
  sessionId: null,
1164
2082
  restored: !0
1165
- }), g({ kind: "purchase_success", restored: !0 })));
1166
- }).catch((p) => {
1167
- if (d) return;
1168
- const k = p instanceof T ? p : new T("unknown", "Failed to load paywall", { cause: p });
1169
- m({ status: "error", error: k }), n("error", k);
2083
+ }), y({ kind: "purchase_success", restored: !0 })));
2084
+ }).catch((g) => {
2085
+ 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", _);
1170
2088
  }), () => {
1171
- d = !0;
2089
+ m = !0;
1172
2090
  };
1173
- }, [e, r]), M(() => {
2091
+ }, [e, t]), Ve(() => {
1174
2092
  if (!e) {
1175
- g({ kind: "layout" }), _.current = !1;
2093
+ y({ kind: "layout" }), k.current = !1;
1176
2094
  return;
1177
2095
  }
1178
- i === "support" ? g({ kind: "support", origin: "standalone" }) : i === "auth" ? g({ kind: "auth_gate", origin: "standalone" }) : i === "anon" && g({ kind: "anon_gate", origin: "standalone" });
2096
+ i === "support" ? y({ kind: "support", origin: "standalone" }) : i === "auth" ? y({ kind: "auth_gate", origin: "standalone" }) : i === "anon" && y({ kind: "anon_gate", origin: "standalone" });
1179
2097
  }, [e, i]);
1180
- const b = async (d) => {
2098
+ const T = async (m) => {
1181
2099
  try {
1182
- const p = await r.createCheckout({
1183
- priceId: d,
1184
- ignoreActivePurchase: l === !0
2100
+ const g = await t.createCheckout({
2101
+ priceId: m,
2102
+ ignoreActivePurchase: a === !0
1185
2103
  });
1186
- if (n("checkout_started", { priceId: d, url: p.url, acquiring: p.acquiring }), typeof window > "u" || !p.url) return;
1187
- const k = window.open(p.url, "_blank");
1188
- if (k) {
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 (_) {
1189
2107
  try {
1190
- k.opener = null;
2108
+ _.opener = null;
1191
2109
  } catch {
1192
2110
  }
1193
- g({ kind: "awaiting_payment", priceId: d, url: p.url });
2111
+ y({ kind: "awaiting_payment", priceId: m, url: g.url });
1194
2112
  } else
1195
- g({ kind: "popup_blocked", priceId: d, url: p.url });
1196
- } catch (p) {
1197
- if (p instanceof T && p.code === "already_purchased") {
2113
+ y({ kind: "popup_blocked", priceId: m, url: g.url });
2114
+ } catch (g) {
2115
+ if (g instanceof U && g.code === "already_purchased") {
1198
2116
  try {
1199
- await r.getUser({ force: !0 });
2117
+ await t.getUser({ force: !0 });
1200
2118
  } catch {
1201
2119
  }
1202
- n("purchase_completed", { priceId: d, sessionId: null, restored: !0 }), g({ kind: "purchase_success", restored: !0 });
2120
+ r("purchase_completed", { priceId: m, sessionId: null, restored: !0 }), y({ kind: "purchase_success", restored: !0 });
1203
2121
  return;
1204
2122
  }
1205
- const k = p instanceof T ? p : new T("checkout_failed", "Checkout failed", { cause: p });
1206
- n("error", k), g({ kind: "layout" });
2123
+ const _ = g instanceof U ? g : new U("checkout_failed", "Checkout failed", { cause: g });
2124
+ r("error", _), y({ kind: "layout" });
1207
2125
  }
1208
- }, S = (d, p) => {
2126
+ }, v = (m, g) => {
1209
2127
  if (typeof window > "u") return;
1210
- const k = window.open(p, "_blank");
1211
- if (k) {
2128
+ const _ = window.open(g, "_blank");
2129
+ if (_) {
1212
2130
  try {
1213
- k.opener = null;
2131
+ _.opener = null;
1214
2132
  } catch {
1215
2133
  }
1216
- g({ kind: "awaiting_payment", priceId: d, url: p });
2134
+ y({ kind: "awaiting_payment", priceId: m, url: g });
1217
2135
  }
1218
2136
  };
1219
- M(() => {
1220
- if (f.kind !== "auth_gate" || !x || x.user.is_anonymous || _.current) return;
1221
- _.current = !0;
1222
- const d = f.pendingCheckout, p = f.origin;
1223
- g({ kind: "verifying" }), (async () => {
1224
- if (!l)
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 () => {
2142
+ if (!a)
1225
2143
  try {
1226
- if ((await r.getUser({ force: !0 })).has_active_subscription) {
1227
- n("purchase_completed", {
1228
- priceId: d?.priceId ?? null,
2144
+ if ((await t.getUser({ force: !0 })).has_active_subscription) {
2145
+ r("purchase_completed", {
2146
+ priceId: m?.priceId ?? null,
1229
2147
  sessionId: null,
1230
2148
  restored: !0
1231
- }), g({ kind: "purchase_success", restored: !0 });
2149
+ }), y({ kind: "purchase_success", restored: !0 });
1232
2150
  return;
1233
2151
  }
1234
2152
  } catch {
1235
2153
  }
1236
- if (!d) {
1237
- p === "standalone" ? t() : g({ kind: "layout" });
2154
+ if (!m) {
2155
+ g === "standalone" ? n() : y({ kind: "layout" });
1238
2156
  return;
1239
2157
  }
1240
- await b(d.priceId);
2158
+ await T(m.priceId);
1241
2159
  })().finally(() => {
1242
- _.current = !1;
2160
+ k.current = !1;
1243
2161
  });
1244
- }, [x, f]);
1245
- const w = async (d, p) => {
1246
- if (d === "close") {
1247
- t();
2162
+ }, [f, h]);
2163
+ const L = async (m, g) => {
2164
+ if (m === "close") {
2165
+ n();
1248
2166
  return;
1249
2167
  }
1250
- if (d === "price_selected") {
1251
- n("price_selected", p);
2168
+ if (m === "price_selected") {
2169
+ r("price_selected", g);
1252
2170
  return;
1253
2171
  }
1254
- if (d === "restore") {
1255
- if (!r.auth || r.auth.getCachedSession()) return;
1256
- g({ kind: "auth_gate" });
2172
+ 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" });
1257
2177
  return;
1258
2178
  }
1259
- if (d === "support") {
1260
- g({ kind: "support", origin: "layout" });
2179
+ if (m === "support") {
2180
+ y({ kind: "support", origin: "layout" });
1261
2181
  return;
1262
2182
  }
1263
- if (d === "checkout" && u.status === "ready") {
1264
- const k = p?.priceId;
1265
- if (!k) {
1266
- n("error", new T("no_price", "No price selected"));
2183
+ if (m === "checkout" && u.status === "ready") {
2184
+ const _ = g?.priceId;
2185
+ if (!_) {
2186
+ r("error", new U("no_price", "No price selected"));
1267
2187
  return;
1268
2188
  }
1269
- if ((u.data.settings.checkout_mode ?? "guest") === "preauth" && !!r.auth && !r.auth.getCachedSession()) {
1270
- g({ kind: "auth_gate", pendingCheckout: { priceId: k } });
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: _ } });
1271
2192
  return;
1272
2193
  }
1273
- await b(k);
2194
+ await T(_);
1274
2195
  }
1275
- }, B = u.status === "ready" ? u.data.settings.brand_color : null, L = u.status === "ready" ? !!u.data.settings.is_test_mode : !1, I = u.status === "ready" ? u.data.settings.allow_close !== !1 : !0, E = {
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 = {
1276
2197
  type: "auth_panel",
1277
- heading: "Sign in to continue",
2198
+ // Заголовок не задаём — AuthGate сам решит по intent'у (restore →
2199
+ // "Restore Purchases", остальные → дефолтный "Welcome back!").
1278
2200
  allow_signup: !0,
1279
2201
  allow_password_reset: !0,
1280
2202
  // Не скрываем при наличии сессии — auto-resume useEffect отрабатывает быстрее,
1281
2203
  // чем хотим показывать "Signed in as ..." промежуточным экраном.
1282
2204
  hide_when_authenticated: !1,
1283
2205
  providers: u.status === "ready" ? u.data.settings.auth_providers : void 0
1284
- }, C = f.kind === "support" ? /* @__PURE__ */ o(
1285
- Ae,
2206
+ }, D = h.kind === "support" ? /* @__PURE__ */ o(
2207
+ vt,
1286
2208
  {
1287
- client: r,
1288
- authSession: x,
1289
- origin: f.origin,
2209
+ client: t,
2210
+ authSession: f,
2211
+ origin: h.origin,
1290
2212
  onBack: () => {
1291
- f.origin === "standalone" ? t() : g({ kind: "layout" });
2213
+ h.origin === "standalone" ? n() : y({ kind: "layout" });
1292
2214
  }
1293
2215
  }
1294
- ) : null;
1295
- return /* @__PURE__ */ o(
1296
- me,
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,
1297
2219
  {
1298
2220
  open: e,
1299
- onClose: t,
1300
- brandColor: B,
1301
- testMode: L,
1302
- allowClose: I,
1303
- inline: h,
2221
+ onClose: n,
2222
+ brandColor: C,
2223
+ topBanner: q,
2224
+ allowClose: P,
2225
+ hideCloseButton: A,
2226
+ inline: d,
1304
2227
  labelledBy: "pw-title",
1305
- children: s ? /* @__PURE__ */ o(ee, { onContinue: t }) : f.kind === "purchase_success" ? /* @__PURE__ */ o(ee, { restored: f.restored, onContinue: t }) : C || (u.status === "loading" || u.status === "idle" || f.kind === "verifying" ? /* @__PURE__ */ c("div", { class: "flex flex-col items-center justify-center gap-3 py-12", children: [
1306
- /* @__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)]" }),
1307
- /* @__PURE__ */ o("span", { class: "text-xs font-medium tracking-wide text-gray-500", children: f.kind === "verifying" ? "Checking your subscription…" : "Loading…" })
1308
- ] }) : u.status === "error" ? /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
1309
- /* @__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: [
1310
- /* @__PURE__ */ o(
1311
- "path",
1312
- {
1313
- d: "M10 6v5M10 14h.01",
1314
- stroke: "#dc2626",
1315
- "stroke-width": "2",
1316
- "stroke-linecap": "round"
1317
- }
1318
- ),
1319
- /* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "8", stroke: "#dc2626", "stroke-width": "1.75" })
1320
- ] }) }),
1321
- /* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: "Something went wrong" }),
1322
- /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: u.error.message })
1323
- ] }) : f.kind === "auth_gate" && r.auth ? /* @__PURE__ */ o(
1324
- _e,
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,
1325
2230
  {
1326
- block: E,
2231
+ block: z,
1327
2232
  bootstrap: u.data,
1328
- auth: r.auth,
1329
- authSession: x,
1330
- showBack: f.origin !== "standalone",
2233
+ auth: t.auth,
2234
+ authSession: f,
2235
+ showBack: h.origin !== "standalone",
2236
+ intent: h.intent ?? (h.origin === "standalone" ? "standalone" : "preauth"),
1331
2237
  onBack: () => {
1332
- f.origin === "standalone" ? t() : g({ kind: "layout" });
2238
+ h.origin === "standalone" ? n() : y({ kind: "layout" });
1333
2239
  }
1334
2240
  }
1335
- ) : f.kind === "anon_gate" && r.auth ? /* @__PURE__ */ o(
1336
- Se,
2241
+ ) : h.kind === "anon_gate" && t.auth ? /* @__PURE__ */ o(
2242
+ mt,
1337
2243
  {
1338
- auth: r.auth,
2244
+ auth: t.auth,
1339
2245
  onSuccess: () => {
1340
- f.origin === "standalone" ? t() : g({ kind: "layout" });
2246
+ h.origin === "standalone" ? n() : y({ kind: "layout" });
1341
2247
  },
1342
- onBack: f.origin === "standalone" ? void 0 : () => g({ kind: "layout" })
2248
+ onBack: h.origin === "standalone" ? void 0 : () => y({ kind: "layout" })
1343
2249
  }
1344
- ) : f.kind === "awaiting_payment" ? /* @__PURE__ */ o(
1345
- Je,
2250
+ ) : h.kind === "awaiting_payment" ? /* @__PURE__ */ o(
2251
+ rn,
1346
2252
  {
1347
- client: r,
1348
- onBack: () => g({ kind: "layout" }),
2253
+ client: t,
2254
+ onBack: () => y({ kind: "layout" }),
1349
2255
  onReopen: () => {
1350
2256
  if (typeof window > "u") return;
1351
- const d = window.open(f.url, "_blank");
1352
- if (d)
2257
+ const m = window.open(h.url, "_blank");
2258
+ if (m)
1353
2259
  try {
1354
- d.opener = null;
2260
+ m.opener = null;
1355
2261
  } catch {
1356
2262
  }
1357
2263
  },
1358
- onRetry: () => b(f.priceId)
2264
+ onRetry: () => T(h.priceId)
1359
2265
  }
1360
- ) : f.kind === "popup_blocked" ? /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
1361
- /* @__PURE__ */ o(
1362
- "div",
1363
- {
1364
- class: "flex h-11 w-11 items-center justify-center rounded-full",
1365
- style: { background: "color-mix(in srgb, var(--pw-accent) 12%, white)", color: "var(--pw-accent)" },
1366
- "aria-hidden": "true",
1367
- children: /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
1368
- /* @__PURE__ */ o(
1369
- "path",
1370
- {
1371
- d: "M4 5h12v10H4z",
1372
- stroke: "currentColor",
1373
- "stroke-width": "1.75",
1374
- "stroke-linejoin": "round"
1375
- }
1376
- ),
1377
- /* @__PURE__ */ o("path", { d: "M7 9l3 3 4-5", stroke: "currentColor", "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" })
1378
- ] })
1379
- }
1380
- ),
1381
- /* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: "Allow popups to continue" }),
1382
- /* @__PURE__ */ o("p", { class: "max-w-[18rem] text-xs leading-relaxed text-gray-500", children: "Your browser blocked the checkout tab. Click below to open it." }),
1383
- /* @__PURE__ */ o(
1384
- "button",
1385
- {
1386
- type: "button",
1387
- onClick: () => S(f.priceId, f.url),
1388
- 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)]",
1389
- style: {
1390
- background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
1391
- boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
1392
- },
1393
- children: "Open checkout"
1394
- }
1395
- )
1396
- ] }) : /* @__PURE__ */ o(
1397
- Ze,
2266
+ ) : h.kind === "popup_blocked" ? /* @__PURE__ */ o(nn, { onReopen: () => v(h.priceId, h.url) }) : /* @__PURE__ */ o(
2267
+ Kt,
1398
2268
  {
1399
2269
  layout: u.data.layout,
1400
2270
  bootstrap: u.data,
1401
- onAction: w,
1402
- auth: r.auth,
1403
- authSession: x
2271
+ onAction: L,
2272
+ auth: t.auth,
2273
+ authSession: f
1404
2274
  }
1405
2275
  ))
1406
2276
  }
1407
- );
2277
+ ) });
2278
+ }
2279
+ function en({ verifying: t }) {
2280
+ const { t: e } = w();
2281
+ return /* @__PURE__ */ c("div", { class: "flex flex-col items-center justify-center gap-3 py-12", children: [
2282
+ /* @__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…") })
2284
+ ] });
2285
+ }
2286
+ function tn({ message: t }) {
2287
+ const { t: e } = w();
2288
+ return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
2289
+ /* @__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: [
2290
+ /* @__PURE__ */ o("path", { d: "M10 6v5M10 14h.01", stroke: "#dc2626", "stroke-width": "2", "stroke-linecap": "round" }),
2291
+ /* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "8", stroke: "#dc2626", "stroke-width": "1.75" })
2292
+ ] }) }),
2293
+ /* @__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 })
2295
+ ] });
2296
+ }
2297
+ function nn({ onReopen: t }) {
2298
+ const { t: e } = w();
2299
+ return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
2300
+ /* @__PURE__ */ o(
2301
+ "div",
2302
+ {
2303
+ class: "flex h-11 w-11 items-center justify-center rounded-full",
2304
+ style: { background: "color-mix(in srgb, var(--pw-accent) 12%, white)", color: "var(--pw-accent)" },
2305
+ "aria-hidden": "true",
2306
+ children: /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
2307
+ /* @__PURE__ */ o("path", { d: "M4 5h12v10H4z", stroke: "currentColor", "stroke-width": "1.75", "stroke-linejoin": "round" }),
2308
+ /* @__PURE__ */ o("path", { d: "M7 9l3 3 4-5", stroke: "currentColor", "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" })
2309
+ ] })
2310
+ }
2311
+ ),
2312
+ /* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: e("payment.popup_blocked_title", "Allow popups to continue") }),
2313
+ /* @__PURE__ */ o("p", { class: "max-w-[18rem] text-xs leading-relaxed text-gray-500", children: e("payment.popup_blocked_message", "Your browser blocked the checkout tab. Click below to open it.") }),
2314
+ /* @__PURE__ */ o(
2315
+ "button",
2316
+ {
2317
+ type: "button",
2318
+ onClick: t,
2319
+ 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
+ style: {
2321
+ background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
2322
+ boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
2323
+ },
2324
+ children: e("payment.open_checkout_button", "Open checkout")
2325
+ }
2326
+ )
2327
+ ] });
1408
2328
  }
1409
- function Je({
1410
- client: r,
2329
+ function rn({
2330
+ client: t,
1411
2331
  onBack: e,
1412
- onReopen: t,
1413
- onRetry: n
2332
+ onReopen: n,
2333
+ onRetry: r
1414
2334
  }) {
1415
- const [i, s] = y(!1), [l, a] = y(!1), h = P(null);
1416
- return M(() => () => {
1417
- h.current !== null && clearTimeout(h.current);
1418
- }, []), /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
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);
2338
+ }, []);
2339
+ const p = async () => {
2340
+ if (!s) {
2341
+ a(!0), d(!1);
2342
+ try {
2343
+ if ((await t.getUser({ force: !0 })).has_active_subscription) {
2344
+ typeof window < "u" && window.postMessage({ type: "paywall_purchase" }, "*");
2345
+ return;
2346
+ }
2347
+ d(!0), u.current !== null && clearTimeout(u.current), u.current = setTimeout(() => {
2348
+ d(!1), u.current = null;
2349
+ }, 5e3);
2350
+ } catch {
2351
+ d(!0);
2352
+ } finally {
2353
+ a(!1);
2354
+ }
2355
+ }
2356
+ };
2357
+ return /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
1419
2358
  /* @__PURE__ */ o(
1420
2359
  "button",
1421
2360
  {
1422
2361
  type: "button",
1423
2362
  onClick: e,
1424
2363
  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)]",
1425
- children: "← Back"
2364
+ children: i("nav.back", "← Back")
1426
2365
  }
1427
2366
  ),
1428
2367
  /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-6 text-center", children: [
@@ -1437,50 +2376,36 @@ function Je({
1437
2376
  ),
1438
2377
  /* @__PURE__ */ o("span", { class: "relative inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]" })
1439
2378
  ] }),
1440
- /* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: "Complete payment in the new tab" }),
1441
- /* @__PURE__ */ o("p", { class: "max-w-[20rem] text-xs leading-relaxed text-gray-500", children: "We'll detect your payment automatically — or click below once you're done." }),
2379
+ /* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: i("payment.awaiting_title", "Complete payment in the new tab") }),
2380
+ /* @__PURE__ */ o("p", { class: "max-w-[20rem] text-xs leading-relaxed text-gray-500", children: i(
2381
+ "payment.awaiting_subtitle",
2382
+ "We'll detect your payment automatically — or click below once you're done."
2383
+ ) }),
1442
2384
  /* @__PURE__ */ o(
1443
2385
  "button",
1444
2386
  {
1445
2387
  type: "button",
1446
- onClick: async () => {
1447
- if (!i) {
1448
- s(!0), a(!1);
1449
- try {
1450
- if ((await r.getUser({ force: !0 })).has_active_subscription) {
1451
- typeof window < "u" && window.postMessage({ type: "paywall_purchase" }, "*");
1452
- return;
1453
- }
1454
- a(!0), h.current !== null && clearTimeout(h.current), h.current = setTimeout(() => {
1455
- a(!1), h.current = null;
1456
- }, 5e3);
1457
- } catch {
1458
- a(!0);
1459
- } finally {
1460
- s(!1);
1461
- }
1462
- }
1463
- },
1464
- disabled: i,
2388
+ onClick: p,
2389
+ disabled: s,
1465
2390
  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)]",
1466
2391
  style: {
1467
2392
  background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
1468
2393
  boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
1469
2394
  },
1470
- children: i ? "Checking…" : "I've paid"
2395
+ children: s ? i("payment.checking", "Checking…") : i("payment.ive_paid", "I've paid")
1471
2396
  }
1472
2397
  ),
1473
- l ? /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: "Payment is still being processed. Please try again in a moment." }) : null
2398
+ l ? /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: i("payment.still_processing", "Payment is still being processed. Please try again in a moment.") }) : null
1474
2399
  ] }),
1475
2400
  /* @__PURE__ */ c("div", { class: "rounded-2xl border border-gray-200 bg-gray-50/60 p-3.5", children: [
1476
- /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-600", children: "Checkout window didn't open or got blocked? Click here to open it again." }),
2401
+ /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-600", children: i("payment.popup_help_text", "Checkout window didn't open or got blocked? Click here to open it again.") }),
1477
2402
  /* @__PURE__ */ o(
1478
2403
  "button",
1479
2404
  {
1480
2405
  type: "button",
1481
- onClick: t,
2406
+ onClick: n,
1482
2407
  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)]",
1483
- children: "Open checkout again"
2408
+ children: i("payment.open_checkout_again", "Open checkout again")
1484
2409
  }
1485
2410
  )
1486
2411
  ] }),
@@ -1488,17 +2413,18 @@ function Je({
1488
2413
  "button",
1489
2414
  {
1490
2415
  type: "button",
1491
- onClick: n,
2416
+ onClick: r,
1492
2417
  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)]",
1493
- children: "Tab closed? Try again"
2418
+ children: i("payment.tab_closed_retry", "Tab closed? Try again")
1494
2419
  }
1495
2420
  )
1496
2421
  ] });
1497
2422
  }
1498
- function ee({
1499
- onContinue: r,
2423
+ function we({
2424
+ onContinue: t,
1500
2425
  restored: e = !1
1501
2426
  }) {
2427
+ const { t: n } = w();
1502
2428
  return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
1503
2429
  /* @__PURE__ */ o(
1504
2430
  "div",
@@ -1523,34 +2449,37 @@ function ee({
1523
2449
  ) })
1524
2450
  }
1525
2451
  ),
1526
- /* @__PURE__ */ o("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children: e ? "Subscription restored" : "Payment received" }),
1527
- /* @__PURE__ */ o("p", { class: "text-sm leading-relaxed text-gray-500", children: e ? "Welcome back — your subscription is already active." : "Your subscription is now active." }),
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(
2454
+ "modal.purchase_restored_subtitle",
2455
+ "Welcome back — your subscription is already active."
2456
+ ) : n("modal.purchase_success_subtitle", "Your subscription is now active.") }),
1528
2457
  /* @__PURE__ */ o(
1529
2458
  "button",
1530
2459
  {
1531
2460
  type: "button",
1532
- onClick: r,
2461
+ onClick: t,
1533
2462
  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)]",
1534
2463
  style: {
1535
2464
  background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
1536
2465
  boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
1537
2466
  },
1538
- children: "Continue"
2467
+ children: n("modal.continue", "Continue")
1539
2468
  }
1540
2469
  )
1541
2470
  ] });
1542
2471
  }
1543
- const Qe = 10 * 6e4, et = 5e3, tt = 3e4;
1544
- class rt {
2472
+ const on = 10 * 6e4, sn = 5e3, an = 3e4;
2473
+ class ln {
1545
2474
  constructor(e) {
1546
2475
  this.timer = null, this.timeoutTimer = null, this.visibilityHandler = null, this.focusHandler = null, this.messageHandler = null, this.stopped = !1, this.checking = !1, this.opts = {
1547
2476
  client: e.client,
1548
2477
  onActive: e.onActive,
1549
2478
  onTimeout: e.onTimeout ?? (() => {
1550
2479
  }),
1551
- timeoutMs: e.timeoutMs ?? Qe,
1552
- visibleIntervalMs: e.visibleIntervalMs ?? et,
1553
- hiddenIntervalMs: e.hiddenIntervalMs ?? tt
2480
+ timeoutMs: e.timeoutMs ?? on,
2481
+ visibleIntervalMs: e.visibleIntervalMs ?? sn,
2482
+ hiddenIntervalMs: e.hiddenIntervalMs ?? an
1554
2483
  };
1555
2484
  }
1556
2485
  start() {
@@ -1576,32 +2505,32 @@ class rt {
1576
2505
  }
1577
2506
  scheduleNext() {
1578
2507
  if (this.stopped) return;
1579
- const t = typeof document < "u" && document.visibilityState === "visible" ? this.opts.visibleIntervalMs : this.opts.hiddenIntervalMs;
2508
+ const n = typeof document < "u" && document.visibilityState === "visible" ? this.opts.visibleIntervalMs : this.opts.hiddenIntervalMs;
1580
2509
  this.timer = setTimeout(async () => {
1581
2510
  await this.check(), this.scheduleNext();
1582
- }, t);
2511
+ }, n);
1583
2512
  }
1584
2513
  handleVisibilityChange() {
1585
2514
  typeof document > "u" || (document.visibilityState === "visible" && this.check(), this.timer !== null && (clearTimeout(this.timer), this.timer = null), this.scheduleNext());
1586
2515
  }
1587
2516
  handleMessage(e) {
1588
- const t = e.data;
1589
- !t || typeof t != "object" || t.type === "paywall_purchase" && this.check();
2517
+ const n = e.data;
2518
+ !n || typeof n != "object" || n.type === "paywall_purchase" && this.check();
1590
2519
  }
1591
2520
  }
1592
- function nt() {
2521
+ function cn() {
1593
2522
  return !(typeof document > "u" || typeof window > "u" || typeof location < "u" && location.protocol === "chrome-extension:");
1594
2523
  }
1595
- const $ = { open: !1, view: null, error: null }, U = {
2524
+ const ae = { open: !1, view: null, error: null }, N = {
1596
2525
  status: "paywall_status",
1597
2526
  priceId: "paywall_price_id",
1598
2527
  sessionId: "paywall_session_id"
1599
2528
  };
1600
- let it = class {
2529
+ let un = class {
1601
2530
  constructor(e) {
1602
- 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 = $, this.stateListeners = /* @__PURE__ */ new Set();
1603
- const { auth: t, ownsAuth: n } = ot(e);
1604
- this.auth = t, this.ownsAuth = n, this.billing = e.client ?? new le({ ...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) => {
2531
+ 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) => {
1605
2534
  this.emit("userChange", i);
1606
2535
  }), this.auth && (this.authUnsub = this.auth.onAuthChange((i, s) => {
1607
2536
  this.emit("authChange", { event: i, session: s });
@@ -1609,20 +2538,20 @@ let it = class {
1609
2538
  }
1610
2539
  initTracker(e) {
1611
2540
  if (e === !1) return;
1612
- const t = typeof e == "object" && e !== null ? e : {};
1613
- if (t.enabled === !1) return;
1614
- const n = t.endpoint ?? `${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;
1615
- this.tracker = new ae({
1616
- endpoint: n,
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,
1617
2546
  paywallId: this.billing.paywallId,
1618
2547
  capabilities: this.billing.capabilities,
1619
2548
  getVisitorId: () => this.billing.getVisitorId(),
1620
2549
  getCachedVisitorId: () => this.billing.getCachedVisitorId(),
1621
2550
  getUserId: () => this.billing.getIdentity()?.userId ?? null,
1622
- flushIntervalMs: t.flushIntervalMs,
1623
- maxBufferSize: t.maxBufferSize,
1624
- fetch: t.fetch,
1625
- sendBeacon: t.sendBeacon
2551
+ flushIntervalMs: n.flushIntervalMs,
2552
+ maxBufferSize: n.maxBufferSize,
2553
+ fetch: n.fetch,
2554
+ sendBeacon: n.sendBeacon
1626
2555
  }), this.on("open", () => this.tracker?.track("paywall_opened")), this.on(
1627
2556
  "ready",
1628
2557
  (i) => this.tracker?.track("paywall_viewed", {
@@ -1675,8 +2604,8 @@ let it = class {
1675
2604
  * Самый частый кейс — `track('app_opened')` от хоста сразу после загрузки
1676
2605
  * приложения, чтобы зафиксировать воронку до открытия пейвола.
1677
2606
  */
1678
- track(e, t) {
1679
- this.tracker?.track(e, t);
2607
+ track(e, n) {
2608
+ this.tracker?.track(e, n);
1680
2609
  }
1681
2610
  /**
1682
2611
  * Удобный шорткат вместо `paywall.on('userChange', cb)` — самый частый
@@ -1699,22 +2628,22 @@ let it = class {
1699
2628
  setBootstrap(e) {
1700
2629
  this.billing.setBootstrap(e);
1701
2630
  }
1702
- on(e, t) {
1703
- let n = this.listeners.get(e);
1704
- return n || (n = /* @__PURE__ */ new Set(), this.listeners.set(e, n)), n.add(t), () => n.delete(t);
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);
1705
2634
  }
1706
- off(e, t) {
1707
- this.listeners.get(e)?.delete(t);
2635
+ off(e, n) {
2636
+ this.listeners.get(e)?.delete(n);
1708
2637
  }
1709
- emit(e, ...t) {
1710
- const n = this.listeners.get(e);
1711
- if (!n) return;
1712
- const i = t[0];
1713
- for (const s of n)
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)
1714
2643
  try {
1715
2644
  s(i);
1716
- } catch (l) {
1717
- typeof console < "u" && console.error("[paywall] listener error", l);
2645
+ } catch (a) {
2646
+ typeof console < "u" && console.error("[paywall] listener error", a);
1718
2647
  }
1719
2648
  }
1720
2649
  open(e = {}) {
@@ -1786,49 +2715,49 @@ let it = class {
1786
2715
  openAnonGate(e = {}) {
1787
2716
  this.auth && this.openInternal("anon", { ...e, skipTrial: !0, skipVisibility: !0 });
1788
2717
  }
1789
- openInternal(e, t) {
1790
- t.identity && this.billing.setIdentity(t.identity), this.purchased = !1;
1791
- const n = t.skipTrial === !0 || e === "support", i = t.skipVisibility === !0 || e === "support" || e === "auth" || e === "anon", s = t.renew === !0;
1792
- if (n && i) {
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) {
1793
2722
  this.mountAndShow(e, { renew: s });
1794
2723
  return;
1795
2724
  }
1796
- const l = this.billing.getCachedBootstrap();
1797
- if (l) {
1798
- this.runOpenGates(e, l, { skipTrial: n, skipVisibility: i, renew: s });
2725
+ const a = this.billing.getCachedBootstrap();
2726
+ if (a) {
2727
+ this.runOpenGates(e, a, { skipTrial: r, skipVisibility: i, renew: s });
1799
2728
  return;
1800
2729
  }
1801
2730
  if (this.mountThenLoad) {
1802
- this.mountAndShow(e, { renew: s }), this.billing.bootstrap().then((a) => this.runDelayedGates(a, { skipTrial: n, skipVisibility: i })).catch(() => {
2731
+ this.mountAndShow(e, { renew: s }), this.billing.bootstrap().then((l) => this.runDelayedGates(l, { skipTrial: r, skipVisibility: i })).catch(() => {
1803
2732
  });
1804
2733
  return;
1805
2734
  }
1806
- this.billing.bootstrap().then((a) => this.runOpenGates(e, a, { skipTrial: n, skipVisibility: i, renew: s })).catch(() => {
2735
+ this.billing.bootstrap().then((l) => this.runOpenGates(e, l, { skipTrial: r, skipVisibility: i, renew: s })).catch(() => {
1807
2736
  this.mountAndShow(e, { renew: s });
1808
2737
  });
1809
2738
  }
1810
2739
  /** Применить gates ПОСЛЕ того, как модалка уже смонтирована (mount-then-load
1811
2740
  * путь). Если gate блокирует — close() + emit. Если юзер уже сам закрыл
1812
2741
  * модалку до резолва bootstrap'а — no-op (isOpen=false). */
1813
- runDelayedGates(e, t) {
2742
+ runDelayedGates(e, n) {
1814
2743
  if (!this.isOpen) return;
1815
- if (!t.skipVisibility) {
2744
+ if (!n.skipVisibility) {
1816
2745
  const s = e.settings.visibility;
1817
2746
  if (s && (this.lastVisibility = s, !s.visible)) {
1818
2747
  this.close(), this.emit("visibility_blocked", s);
1819
2748
  return;
1820
2749
  }
1821
2750
  }
1822
- if (t.skipTrial) return;
1823
- const n = e.settings.trial;
1824
- if (!n) return;
1825
- const i = this.ensureTrialStore(n);
2751
+ if (n.skipTrial) return;
2752
+ const r = e.settings.trial;
2753
+ if (!r) return;
2754
+ const i = this.ensureTrialStore(r);
1826
2755
  i.check().then(async (s) => {
1827
2756
  if (this.isOpen && (this.lastTrialStatus = s, s.mode !== "none")) {
1828
2757
  if (s.blocked) {
1829
- const l = await i.recordBlock();
1830
- if (this.lastTrialStatus = l, !this.isOpen) return;
1831
- this.close(), this.emit("trial_blocked", l);
2758
+ const a = await i.recordBlock();
2759
+ if (this.lastTrialStatus = a, !this.isOpen) return;
2760
+ this.close(), this.emit("trial_blocked", a);
1832
2761
  return;
1833
2762
  }
1834
2763
  this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired"));
@@ -1841,63 +2770,63 @@ let it = class {
1841
2770
  // вести trial-стейт «осталось N показов» под юзером, который вообще не
1842
2771
  // должен увидеть пейвол по таргетингу — бессмысленно: при возврате в
1843
2772
  // правильную страну он окажется со «слипшимся» триал-счётчиком.
1844
- runOpenGates(e, t, n) {
1845
- if (!n.skipVisibility) {
1846
- const i = t.settings.visibility;
2773
+ runOpenGates(e, n, r) {
2774
+ if (!r.skipVisibility) {
2775
+ const i = n.settings.visibility;
1847
2776
  if (i && (this.lastVisibility = i, !i.visible)) {
1848
2777
  this.emit("visibility_blocked", i);
1849
2778
  return;
1850
2779
  }
1851
2780
  }
1852
- if (n.skipTrial) {
1853
- this.mountAndShow(e, { renew: n.renew });
2781
+ if (r.skipTrial) {
2782
+ this.mountAndShow(e, { renew: r.renew });
1854
2783
  return;
1855
2784
  }
1856
- this.gateThroughTrial(e, t, n.renew);
2785
+ this.gateThroughTrial(e, n, r.renew);
1857
2786
  }
1858
- gateThroughTrial(e, t, n) {
1859
- const i = t.settings.trial;
2787
+ gateThroughTrial(e, n, r) {
2788
+ const i = n.settings.trial;
1860
2789
  if (!i) {
1861
- this.mountAndShow(e, { renew: n });
2790
+ this.mountAndShow(e, { renew: r });
1862
2791
  return;
1863
2792
  }
1864
2793
  const s = this.ensureTrialStore(i);
1865
- s.check().then(async (l) => {
1866
- if (this.lastTrialStatus = l, l.mode === "none") {
1867
- this.mountAndShow(e, { renew: n });
2794
+ s.check().then(async (a) => {
2795
+ if (this.lastTrialStatus = a, a.mode === "none") {
2796
+ this.mountAndShow(e, { renew: r });
1868
2797
  return;
1869
2798
  }
1870
- if (l.blocked) {
1871
- const a = await s.recordBlock();
1872
- this.lastTrialStatus = a, this.emit("trial_blocked", a);
2799
+ if (a.blocked) {
2800
+ const l = await s.recordBlock();
2801
+ this.lastTrialStatus = l, this.emit("trial_blocked", l);
1873
2802
  return;
1874
2803
  }
1875
- this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(e, { renew: n });
1876
- }).catch((l) => {
1877
- typeof console < "u" && console.warn("[paywall] trial check failed", l), this.mountAndShow(e, { renew: n });
2804
+ this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(e, { renew: r });
2805
+ }).catch((a) => {
2806
+ typeof console < "u" && console.warn("[paywall] trial check failed", a), this.mountAndShow(e, { renew: r });
1878
2807
  });
1879
2808
  }
1880
2809
  ensureTrialStore(e) {
1881
- if (this.trialStore && this.trialStoreConfig && at(this.trialStoreConfig, e))
2810
+ if (this.trialStore && this.trialStoreConfig && fn(this.trialStoreConfig, e))
1882
2811
  return this.trialStore;
1883
2812
  this.trialStoreConfig = e;
1884
- const t = this.billing.createTrialStore;
1885
- return this.trialStore = typeof t == "function" ? t.call(this.billing, e) : ce(this.billing.getStorage(), this.billing.paywallId, e), this.trialStore;
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;
1886
2815
  }
1887
- mountAndShow(e, t = {}) {
1888
- const n = t.renew === !0;
2816
+ mountAndShow(e, n = {}) {
2817
+ const r = n.renew === !0;
1889
2818
  if (this.handle) {
1890
- this.isOpen = !0, this.handle.update({ open: !0, initialView: e, purchased: !1, renew: n }), this.emit("open");
2819
+ this.isOpen = !0, this.handle.update({ open: !0, initialView: e, purchased: !1, renew: r }), this.emit("open");
1891
2820
  return;
1892
2821
  }
1893
- this.isOpen = !0, this.handle = ge(
1894
- Ke,
2822
+ this.isOpen = !0, this.handle = Ge(
2823
+ Qt,
1895
2824
  {
1896
2825
  client: this.billing,
1897
2826
  open: !0,
1898
2827
  initialView: e,
1899
2828
  purchased: !1,
1900
- renew: n,
2829
+ renew: r,
1901
2830
  onClose: () => this.close(),
1902
2831
  onEvent: (i, s) => {
1903
2832
  this.emit(i, s), i === "checkout_started" && this.startUserWatcher();
@@ -1909,13 +2838,13 @@ let it = class {
1909
2838
  ), this.emit("open");
1910
2839
  }
1911
2840
  applyState(e) {
1912
- if (!lt(this.currentState, e)) {
2841
+ if (!pn(this.currentState, e)) {
1913
2842
  this.currentState = e;
1914
- for (const t of this.stateListeners)
2843
+ for (const n of this.stateListeners)
1915
2844
  try {
1916
- t(e);
1917
- } catch (n) {
1918
- console.warn("[paywall] onStateChange listener threw", n);
2845
+ n(e);
2846
+ } catch (r) {
2847
+ console.warn("[paywall] onStateChange listener threw", r);
1919
2848
  }
1920
2849
  }
1921
2850
  }
@@ -1940,12 +2869,12 @@ let it = class {
1940
2869
  *
1941
2870
  * Возвращает unsubscribe.
1942
2871
  */
1943
- onStateChange(e, t = {}) {
2872
+ onStateChange(e, n = {}) {
1944
2873
  this.stateListeners.add(e);
1945
- const n = t.immediate ?? "microtask";
1946
- if (n !== "none") {
2874
+ const r = n.immediate ?? "microtask";
2875
+ if (r !== "none") {
1947
2876
  const i = this.currentState;
1948
- if (n === "sync")
2877
+ if (r === "sync")
1949
2878
  try {
1950
2879
  e(i);
1951
2880
  } catch (s) {
@@ -2015,53 +2944,53 @@ let it = class {
2015
2944
  * `getAccess()`, а не только после первого `open()`.
2016
2945
  */
2017
2946
  async getAccess(e = {}) {
2018
- let t = this.billing.getCachedBootstrap();
2019
- if (!t)
2947
+ let n = this.billing.getCachedBootstrap();
2948
+ if (!n)
2020
2949
  try {
2021
- t = await this.billing.bootstrap({ signal: e.signal });
2950
+ n = await this.billing.bootstrap({ signal: e.signal });
2022
2951
  } catch {
2023
- const l = this.billing.getCachedUser();
2024
- return l?.has_active_subscription ? {
2952
+ const a = this.billing.getCachedUser();
2953
+ return a?.has_active_subscription ? {
2025
2954
  access: "granted",
2026
2955
  reason: "has_subscription",
2027
2956
  visibility: null,
2028
2957
  trial: null,
2029
- user: l
2958
+ user: a
2030
2959
  } : {
2031
2960
  access: "blocked",
2032
2961
  reason: "no_subscription",
2033
2962
  visibility: null,
2034
2963
  trial: null,
2035
- user: l
2964
+ user: a
2036
2965
  };
2037
2966
  }
2038
- const n = t.user ?? null;
2039
- if (n?.has_active_subscription)
2967
+ const r = n.user ?? null;
2968
+ if (r?.has_active_subscription)
2040
2969
  return {
2041
2970
  access: "granted",
2042
2971
  reason: "has_subscription",
2043
- visibility: t.settings.visibility ?? null,
2972
+ visibility: n.settings.visibility ?? null,
2044
2973
  trial: null,
2045
- user: n
2974
+ user: r
2046
2975
  };
2047
2976
  let i = null;
2048
2977
  if (!e.skipVisibility) {
2049
- const l = t.settings.visibility;
2050
- if (l && (i = l, this.lastVisibility = l, !l.visible))
2051
- return { access: "granted", reason: "visibility_blocked", visibility: i, trial: null, user: n };
2978
+ const a = n.settings.visibility;
2979
+ if (a && (i = a, this.lastVisibility = a, !a.visible))
2980
+ return { access: "granted", reason: "visibility_blocked", visibility: i, trial: null, user: r };
2052
2981
  }
2053
2982
  let s = null;
2054
2983
  if (!e.skipTrial) {
2055
- const l = t.settings.trial;
2056
- if (l)
2984
+ const a = n.settings.trial;
2985
+ if (a)
2057
2986
  try {
2058
- if (s = await this.ensureTrialStore(l).check(), this.lastTrialStatus = s, s.blocked)
2059
- return { access: "granted", reason: "trial_blocked", visibility: i, trial: s, user: n };
2060
- } catch (a) {
2061
- typeof console < "u" && console.warn("[paywall] getAccess: trial check failed", a);
2987
+ 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 };
2989
+ } catch (l) {
2990
+ typeof console < "u" && console.warn("[paywall] getAccess: trial check failed", l);
2062
2991
  }
2063
2992
  }
2064
- return { access: "blocked", reason: "no_subscription", visibility: i, trial: s, user: n };
2993
+ return { access: "blocked", reason: "no_subscription", visibility: i, trial: s, user: r };
2065
2994
  }
2066
2995
  /** Сбросить состояние триала в storage. Полезно для дев-режима / админ-кнопки
2067
2996
  * «прогнать сценарий заново». В проде хост обычно не дёргает. */
@@ -2075,14 +3004,14 @@ let it = class {
2075
3004
  // В extension popup runtime — no-op (popup не доживёт). Там полагаемся на
2076
3005
  // bootstrap при следующем открытии.
2077
3006
  startUserWatcher() {
2078
- this.watcher || nt() && (this.watcher = new rt({
3007
+ this.watcher || cn() && (this.watcher = new ln({
2079
3008
  client: this.billing,
2080
3009
  onActive: (e) => {
2081
3010
  this.watcher = null, this.emit("purchase_completed", { priceId: null, sessionId: null });
2082
- const t = this.billing.getCachedBootstrap()?.settings.success_redirect_url;
2083
- if (t && typeof window < "u")
3011
+ const n = this.billing.getCachedBootstrap()?.settings.success_redirect_url;
3012
+ if (n && typeof window < "u")
2084
3013
  try {
2085
- window.location.assign(t);
3014
+ window.location.assign(n);
2086
3015
  return;
2087
3016
  } catch {
2088
3017
  }
@@ -2094,7 +3023,7 @@ let it = class {
2094
3023
  }), this.watcher.start());
2095
3024
  }
2096
3025
  close() {
2097
- !this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState($), this.emit("close"));
3026
+ !this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(ae), this.emit("close"));
2098
3027
  }
2099
3028
  /**
2100
3029
  * Сканирует текущий URL на маркеры возврата с checkout и эмитит
@@ -2104,80 +3033,80 @@ let it = class {
2104
3033
  */
2105
3034
  checkReturn() {
2106
3035
  if (typeof window > "u") return;
2107
- const e = new URL(window.location.href), t = te(e.hash.replace(/^#/, "")), n = te(e.search.replace(/^\?/, "")), i = t ?? n;
3036
+ const e = new URL(window.location.href), n = ke(e.hash.replace(/^#/, "")), r = ke(e.search.replace(/^\?/, "")), i = n ?? r;
2108
3037
  i && (i.status === "paid" ? (this.emit("purchase_completed", {
2109
3038
  priceId: i.priceId,
2110
3039
  sessionId: i.sessionId
2111
- }), ct(i)) : (i.status === "failed" || i.status === "cancelled") && this.emit("purchase_failed", { reason: i.status }), ut(e));
3040
+ }), gn(i)) : (i.status === "failed" || i.status === "cancelled") && this.emit("purchase_failed", { reason: i.status }), mn(e));
2112
3041
  }
2113
3042
  destroy() {
2114
- 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 = $;
3043
+ 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;
2115
3044
  }
2116
3045
  };
2117
- function ot(r) {
2118
- if (!r.auth) return { auth: void 0, ownsAuth: !1 };
2119
- if (r.auth instanceof G || st(r.auth))
2120
- return { auth: r.auth, ownsAuth: !1 };
2121
- const e = r.auth === !0 ? {} : r.auth;
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;
2122
3051
  return {
2123
- auth: new G({
2124
- paywallId: r.paywallId,
2125
- apiOrigin: e.apiOrigin ?? r.apiOrigin,
2126
- storage: e.storage ?? r.storage,
2127
- fetch: e.fetch ?? r.fetch,
3052
+ 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,
2128
3057
  openPopup: e.openPopup
2129
3058
  }),
2130
3059
  ownsAuth: !0
2131
3060
  };
2132
3061
  }
2133
- function st(r) {
2134
- if (typeof r != "object" || r === null) return !1;
2135
- const e = r;
3062
+ function hn(t) {
3063
+ if (typeof t != "object" || t === null) return !1;
3064
+ const e = t;
2136
3065
  return typeof e.onAuthChange == "function" && typeof e.getCachedSession == "function" && typeof e.signOut == "function";
2137
3066
  }
2138
- function lt(r, e) {
2139
- return r.open === e.open && r.view === e.view && r.error === e.error;
3067
+ function pn(t, e) {
3068
+ return t.open === e.open && t.view === e.view && t.error === e.error;
2140
3069
  }
2141
- function at(r, e) {
2142
- return r.mode === e.mode && r.payload === e.payload && r.storage === e.storage;
3070
+ function fn(t, e) {
3071
+ return t.mode === e.mode && t.payload === e.payload && t.storage === e.storage;
2143
3072
  }
2144
- function te(r) {
2145
- if (!r) return null;
2146
- const e = new URLSearchParams(r), t = e.get(U.status);
2147
- return t ? {
2148
- status: t,
2149
- priceId: e.get(U.priceId),
2150
- sessionId: e.get(U.sessionId)
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)
2151
3080
  } : null;
2152
3081
  }
2153
- function ct(r) {
3082
+ function gn(t) {
2154
3083
  if (!(typeof window > "u" || !window.opener))
2155
3084
  try {
2156
3085
  window.opener.postMessage(
2157
3086
  {
2158
3087
  type: "paywall_purchase",
2159
- status: r.status,
2160
- priceId: r.priceId,
2161
- sessionId: r.sessionId
3088
+ status: t.status,
3089
+ priceId: t.priceId,
3090
+ sessionId: t.sessionId
2162
3091
  },
2163
3092
  "*"
2164
3093
  );
2165
3094
  } catch {
2166
3095
  }
2167
3096
  }
2168
- function ut(r) {
2169
- const e = (n, i) => {
2170
- if (!n) return "";
2171
- const s = new URLSearchParams(n.replace(/^[?#]/, ""));
2172
- s.delete(U.status), s.delete(U.priceId), s.delete(U.sessionId);
2173
- const l = s.toString();
2174
- return l ? i + l : "";
2175
- }, t = r.pathname + e(r.search, "?") + e(r.hash, "#");
2176
- window.history.replaceState(null, "", t);
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);
3102
+ const a = s.toString();
3103
+ return a ? i + a : "";
3104
+ }, n = t.pathname + e(t.search, "?") + e(t.hash, "#");
3105
+ window.history.replaceState(null, "", n);
2177
3106
  }
2178
- class ht {
2179
- constructor(e, t, n) {
2180
- this.transport = e, this.paywallId = t, this.config = n;
3107
+ class yn {
3108
+ constructor(e, n, r) {
3109
+ this.transport = e, this.paywallId = n, this.config = r;
2181
3110
  }
2182
3111
  async check() {
2183
3112
  return this.transport.request("trial.check", {
@@ -2198,37 +3127,65 @@ class ht {
2198
3127
  });
2199
3128
  }
2200
3129
  }
2201
- class dt {
2202
- constructor(e, t) {
2203
- 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.unsubUserBroadcast = null, this.unsubBalancesBroadcast = null, this.paywallId = t.paywallId, this.apiOrigin = t.apiOrigin, this.remoteStorageAdapter = {
2204
- getItem: (n) => this.transport.request("storage.get", { key: n }),
2205
- setItem: async (n, i) => {
2206
- await this.transport.request("storage.set", { key: n, value: i });
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 });
2207
3136
  },
2208
- removeItem: async (n) => {
2209
- await this.transport.request("storage.remove", { key: n });
3137
+ removeItem: async (r) => {
3138
+ await this.transport.request("storage.remove", { key: r });
2210
3139
  }
2211
3140
  // watch не реализуем — для cross-context уведомлений consumer'ы (AuthClient,
2212
3141
  // TrialStore) подписываются на broadcast-events напрямую через transport.
2213
3142
  // Если когда-то понадобится — добавим storage.watch broadcast.
2214
- }, this.unsubUserBroadcast = this.transport.on("userChange", (n) => {
2215
- this.applyUser(n);
2216
- }), this.unsubBalancesBroadcast = this.transport.on("balancesChange", (n) => {
2217
- this.applyBalances([...n]);
3143
+ }, this.unsubUserBroadcast = this.transport.on("userChange", (r) => {
3144
+ this.applyUser(r);
3145
+ }), this.unsubBalancesBroadcast = this.transport.on("balancesChange", (r) => {
3146
+ this.applyBalances([...r]);
2218
3147
  });
2219
3148
  }
2220
3149
  // === Bootstrap ===
2221
3150
  async bootstrap(e = {}) {
2222
- const t = await this.transport.request(
3151
+ const n = await this.transport.request(
2223
3152
  "billing.bootstrap",
2224
3153
  { force: e.force },
2225
3154
  { signal: e.signal }
2226
3155
  );
2227
- return this.cachedBootstrap = t, t.user && this.applyUser(t.user), t;
3156
+ return this.applyBootstrap(n), n.user && this.applyUser(n.user), n;
2228
3157
  }
2229
3158
  getCachedBootstrap() {
2230
3159
  return this.cachedBootstrap;
2231
3160
  }
3161
+ /** Подписка на bootstrap-state. Структурно совместима с
3162
+ * `BillingClient.onBootstrapChange` — те же микротаск-семантики для initial
3163
+ * snapshot. В extension-режиме offscreen пока не broadcast'ит bootstrapChange,
3164
+ * поэтому listener срабатывает только на self-инициированные `bootstrap()`
3165
+ * внутри этого RemoteBillingClient'а (popup перезапрашивает bootstrap → mirror
3166
+ * обновляется → listener вызывается). Cross-surface revalidate (другая вкладка
3167
+ * обновила bootstrap) не доезжает до popup'а — для этого нужен отдельный
3168
+ * bootstrapChange-broadcast в protocol.ts/server.ts. */
3169
+ onBootstrapChange(e, n = {}) {
3170
+ this.bootstrapListeners.add(e);
3171
+ const r = n.immediate ?? "microtask";
3172
+ if (this.cachedBootstrap && r !== "none") {
3173
+ const i = this.cachedBootstrap;
3174
+ if (r === "sync")
3175
+ try {
3176
+ e(i);
3177
+ } catch (s) {
3178
+ console.warn("[paywall] onBootstrapChange initial sync threw", s);
3179
+ }
3180
+ else
3181
+ queueMicrotask(() => {
3182
+ this.bootstrapListeners.has(e) && e(i);
3183
+ });
3184
+ }
3185
+ return () => {
3186
+ this.bootstrapListeners.delete(e);
3187
+ };
3188
+ }
2232
3189
  /** Шорткат над `bootstrap()` — возвращает цены пейвола (locale-оверрайды
2233
3190
  * уже применены в offscreen'е). Те же кэш-семантики, что у `bootstrap()`. */
2234
3191
  async getPrices(e = {}) {
@@ -2244,12 +3201,12 @@ class dt {
2244
3201
  }
2245
3202
  // === User ===
2246
3203
  async getUser(e = {}) {
2247
- const t = await this.transport.request(
3204
+ const n = await this.transport.request(
2248
3205
  "billing.getUser",
2249
3206
  { force: e.force },
2250
3207
  { signal: e.signal }
2251
3208
  );
2252
- return this.applyUser(t), t;
3209
+ return this.applyUser(n), n;
2253
3210
  }
2254
3211
  getCachedUser() {
2255
3212
  return this.cachedUser;
@@ -2257,12 +3214,12 @@ class dt {
2257
3214
  /** Подписка на user-state. Mirror'имся на broadcast'ы offscreen'а; initial
2258
3215
  * snapshot отдаётся через microtask из локального cache (если есть) —
2259
3216
  * ровно как в BillingClient.onUserChange. Возвращает функцию отписки. */
2260
- onUserChange(e, t = {}) {
3217
+ onUserChange(e, n = {}) {
2261
3218
  this.userListeners.add(e);
2262
- const n = t.immediate ?? "microtask";
2263
- if (this.cachedUser && n !== "none") {
3219
+ const r = n.immediate ?? "microtask";
3220
+ if (this.cachedUser && r !== "none") {
2264
3221
  const i = this.cachedUser;
2265
- if (n === "sync")
3222
+ if (r === "sync")
2266
3223
  try {
2267
3224
  e(i);
2268
3225
  } catch (s) {
@@ -2279,22 +3236,22 @@ class dt {
2279
3236
  }
2280
3237
  // === Balances ===
2281
3238
  async getBalances(e = {}) {
2282
- const n = [...await this.transport.request(
3239
+ const r = [...await this.transport.request(
2283
3240
  "billing.getBalances",
2284
3241
  { force: e.force },
2285
3242
  { signal: e.signal }
2286
3243
  )];
2287
- return this.applyBalances(n), n;
3244
+ return this.applyBalances(r), r;
2288
3245
  }
2289
3246
  getCachedBalances() {
2290
3247
  return this.cachedBalances;
2291
3248
  }
2292
- onBalanceChange(e, t = {}) {
3249
+ onBalanceChange(e, n = {}) {
2293
3250
  this.balanceListeners.add(e);
2294
- const n = t.immediate ?? "microtask";
2295
- if (this.cachedBalances && n !== "none") {
3251
+ const r = n.immediate ?? "microtask";
3252
+ if (this.cachedBalances && r !== "none") {
2296
3253
  const i = this.cachedBalances;
2297
- if (n === "sync")
3254
+ if (r === "sync")
2298
3255
  try {
2299
3256
  e(i);
2300
3257
  } catch (s) {
@@ -2311,8 +3268,8 @@ class dt {
2311
3268
  }
2312
3269
  // === Checkout ===
2313
3270
  async createCheckout(e) {
2314
- const { signal: t, ...n } = e;
2315
- return this.transport.request("billing.createCheckout", n, { signal: t });
3271
+ const { signal: n, ...r } = e;
3272
+ return this.transport.request("billing.createCheckout", r, { signal: n });
2316
3273
  }
2317
3274
  // === Customer portal: list/cancel purchases ===
2318
3275
  /** Rich-shape список покупок юзера (с ценой, валютой, interval, discount,
@@ -2324,12 +3281,19 @@ class dt {
2324
3281
  signal: e.signal
2325
3282
  })];
2326
3283
  }
3284
+ /** Саппорт-тикет через offscreen'овский BillingClient. File-объекты
3285
+ * переживают chrome.runtime structured-clone (port forward'ит as-is) —
3286
+ * Bearer-токен/email-substitution делает offscreen, как в обычном
3287
+ * BillingClient. */
3288
+ async createSupportTicket(e) {
3289
+ return this.transport.request("billing.createSupportTicket", e);
3290
+ }
2327
3291
  /** Отменить подписку через бэк. По умолчанию cancel в конце текущего
2328
3292
  * периода (юзер сохраняет access до renewal date'ы). reason обязательна
2329
3293
  * (валидируется бэком) — собирается через select причин в host-UI. */
2330
3294
  async cancelSubscription(e) {
2331
- const { signal: t, ...n } = e;
2332
- return this.transport.request("billing.cancelSubscription", n, { signal: t });
3295
+ const { signal: n, ...r } = e;
3296
+ return this.transport.request("billing.cancelSubscription", r, { signal: n });
2333
3297
  }
2334
3298
  // === Storage ===
2335
3299
  /** PaywallUI просит storage у billing-клиента для TrialStore и других
@@ -2344,7 +3308,7 @@ class dt {
2344
3308
  * read-modify-write. PaywallUI duck-types этот метод и предпочитает его
2345
3309
  * локальной фабрике, если он есть. */
2346
3310
  createTrialStore(e) {
2347
- return new ht(this.transport, this.paywallId, e);
3311
+ return new yn(this.transport, this.paywallId, e);
2348
3312
  }
2349
3313
  // === Identity ===
2350
3314
  getIdentity() {
@@ -2361,51 +3325,60 @@ class dt {
2361
3325
  return this.identity = e, e;
2362
3326
  }
2363
3327
  destroy() {
2364
- this.unsubUserBroadcast?.(), this.unsubBalancesBroadcast?.(), this.unsubUserBroadcast = null, this.unsubBalancesBroadcast = null, this.userListeners.clear(), this.balanceListeners.clear(), this.cachedBootstrap = null, this.cachedUser = null, this.cachedBalances = null, this.identity = null;
3328
+ this.unsubUserBroadcast?.(), this.unsubBalancesBroadcast?.(), this.unsubUserBroadcast = null, this.unsubBalancesBroadcast = null, this.userListeners.clear(), this.balanceListeners.clear(), this.bootstrapListeners.clear(), this.cachedBootstrap = null, this.cachedUser = null, this.cachedBalances = null, this.identity = null;
3329
+ }
3330
+ applyBootstrap(e) {
3331
+ this.cachedBootstrap = e;
3332
+ for (const n of [...this.bootstrapListeners])
3333
+ try {
3334
+ n(e);
3335
+ } catch (r) {
3336
+ console.warn("[paywall] onBootstrapChange listener threw", r);
3337
+ }
2365
3338
  }
2366
3339
  /** Обновить mirror user'а и эмитнуть listener'ам если он реально изменился.
2367
3340
  * Используется и для self-инициированных RPC (bootstrap/getUser), и для
2368
3341
  * broadcast'ов от offscreen — чтобы host'овский onUserChange handler
2369
3342
  * получил signal независимо от того, кто триггернул обновление. */
2370
3343
  applyUser(e) {
2371
- pt(this.cachedUser, e) || (this.cachedUser = e, this.fireUserListeners(e));
3344
+ bn(this.cachedUser, e) || (this.cachedUser = e, this.fireUserListeners(e));
2372
3345
  }
2373
3346
  applyBalances(e) {
2374
- ft(this.cachedBalances, e) || (this.cachedBalances = e, this.fireBalanceListeners(e));
3347
+ wn(this.cachedBalances, e) || (this.cachedBalances = e, this.fireBalanceListeners(e));
2375
3348
  }
2376
3349
  fireUserListeners(e) {
2377
- for (const t of [...this.userListeners])
3350
+ for (const n of [...this.userListeners])
2378
3351
  try {
2379
- t(e);
2380
- } catch (n) {
2381
- console.warn("[paywall] onUserChange listener threw", n);
3352
+ n(e);
3353
+ } catch (r) {
3354
+ console.warn("[paywall] onUserChange listener threw", r);
2382
3355
  }
2383
3356
  }
2384
3357
  fireBalanceListeners(e) {
2385
- for (const t of [...this.balanceListeners])
3358
+ for (const n of [...this.balanceListeners])
2386
3359
  try {
2387
- t(e);
2388
- } catch (n) {
2389
- console.warn("[paywall] onBalanceChange listener threw", n);
3360
+ n(e);
3361
+ } catch (r) {
3362
+ console.warn("[paywall] onBalanceChange listener threw", r);
2390
3363
  }
2391
3364
  }
2392
3365
  }
2393
- function pt(r, e) {
2394
- return r === e ? !0 : !r || !e ? !1 : r.has_active_subscription === e.has_active_subscription && (r.purchases?.length ?? 0) === (e.purchases?.length ?? 0);
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);
2395
3368
  }
2396
- function ft(r, e) {
2397
- if (r === e) return !0;
2398
- if (!r || !e || r.length !== e.length) return !1;
2399
- for (let t = 0; t < r.length; t++)
2400
- if (r[t].type !== e[t].type || r[t].count !== e[t].count) return !1;
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;
2401
3374
  return !0;
2402
3375
  }
2403
- class gt {
2404
- constructor(e, t) {
2405
- 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 }) => {
2406
- this.applySession(n, i);
2407
- }), this.hydrated = this.transport.request("auth.getCachedSession", void 0).then((n) => {
2408
- this.session === null && n !== null && (this.session = n);
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);
2409
3382
  }).catch(() => {
2410
3383
  });
2411
3384
  }
@@ -2425,8 +3398,8 @@ class gt {
2425
3398
  if (this.listeners.has(e))
2426
3399
  try {
2427
3400
  e("INITIAL_SESSION", this.session);
2428
- } catch (t) {
2429
- console.warn("[paywall] onAuthChange INITIAL_SESSION threw", t);
3401
+ } catch (n) {
3402
+ console.warn("[paywall] onAuthChange INITIAL_SESSION threw", n);
2430
3403
  }
2431
3404
  }), () => {
2432
3405
  this.listeners.delete(e);
@@ -2434,12 +3407,12 @@ class gt {
2434
3407
  }
2435
3408
  // === Email/password ===
2436
3409
  async signInWithEmail(e) {
2437
- const t = await this.transport.request("auth.signInWithEmail", e);
2438
- return this.applySession("SIGNED_IN", t), t;
3410
+ const n = await this.transport.request("auth.signInWithEmail", e);
3411
+ return this.applySession("SIGNED_IN", n), n;
2439
3412
  }
2440
3413
  async signUp(e) {
2441
- const t = await this.transport.request("auth.signUp", e);
2442
- return t.kind === "signed_in" && this.applySession("SIGNED_IN", t.session), t;
3414
+ const n = await this.transport.request("auth.signUp", e);
3415
+ return n.kind === "signed_in" && this.applySession("SIGNED_IN", n.session), n;
2443
3416
  }
2444
3417
  async signOut() {
2445
3418
  await this.transport.request("auth.signOut", void 0);
@@ -2453,8 +3426,8 @@ class gt {
2453
3426
  await this.transport.request("auth.sendOtp", e);
2454
3427
  }
2455
3428
  async verifyOtp(e) {
2456
- const t = await this.transport.request("auth.verifyOtp", e);
2457
- return this.applySession(e.type === "recovery" ? "PASSWORD_RECOVERY" : "SIGNED_IN", t), t;
3429
+ const n = await this.transport.request("auth.verifyOtp", e);
3430
+ return this.applySession(e.type === "recovery" ? "PASSWORD_RECOVERY" : "SIGNED_IN", n), n;
2458
3431
  }
2459
3432
  async resendConfirmation(e) {
2460
3433
  await this.transport.request("auth.resendConfirmation", e);
@@ -2468,18 +3441,24 @@ class gt {
2468
3441
  async revokeAllSessions() {
2469
3442
  await this.transport.request("auth.revokeAllSessions", void 0);
2470
3443
  }
3444
+ /** Last-used auth method + email — читается из offscreen-storage. AuthPanel
3445
+ * использует для "Last used"-бейджа и pre-fill'а email. Storage paywall-
3446
+ * scoped, и offscreen — единый источник правды для всех вкладок/popup'ов. */
3447
+ async getLastLogin() {
3448
+ return this.transport.request("auth.getLastLogin", void 0);
3449
+ }
2471
3450
  // === Anonymous sign-in ===
2472
3451
  /** Анонимный sign-in (Supabase user без email). Логика (idempotent-check +
2473
3452
  * resume через сохранённый refresh_token + fresh signin) живёт в
2474
3453
  * offscreen-AuthClient'е — content только проксирует. captchaToken и
2475
3454
  * forceCaptcha — pass-through для forward-compat / switch-account flow. */
2476
3455
  async signInAnonymously(e = {}) {
2477
- const t = await this.transport.request("auth.signInAnonymously", {
3456
+ const n = await this.transport.request("auth.signInAnonymously", {
2478
3457
  captchaToken: e.captchaToken,
2479
3458
  userMeta: e.userMeta,
2480
3459
  forceCaptcha: e.forceCaptcha
2481
3460
  });
2482
- return this.applySession("SIGNED_IN", t), t;
3461
+ return this.applySession("SIGNED_IN", n), n;
2483
3462
  }
2484
3463
  /** Текущий access token (lazy-refreshable в offscreen'е). content/popup
2485
3464
  * использует для Bearer'а в внешние fetch'и — ApiGatewayClient в
@@ -2505,26 +3484,26 @@ class gt {
2505
3484
  */
2506
3485
  async signInWithOAuth(e) {
2507
3486
  if (typeof window > "u")
2508
- throw new T("oauth_unavailable", "window is required for OAuth");
2509
- const t = `pw-oauth-pending-${Math.random().toString(36).slice(2, 10)}`, n = window.open("about:blank", t, "width=480,height=640,popup=yes");
2510
- if (!n)
2511
- throw new T(
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(
2512
3491
  "popup_blocked",
2513
3492
  "browser blocked auth popup — call from a user gesture"
2514
3493
  );
2515
- xt(n, e.provider);
3494
+ Sn(r, e.provider);
2516
3495
  try {
2517
3496
  const { authorizeUrl: i, state: s } = await this.transport.request("auth.oauthStart", {
2518
3497
  provider: e.provider,
2519
3498
  scopes: e.scopes,
2520
3499
  userMeta: e.userMeta
2521
3500
  });
2522
- n.name = `pw-oauth-${s}`, n.location.replace(i), e.onPopupOpened?.();
2523
- const l = await ue(n, s), a = await this.transport.request("auth.oauthExchange", { state: s, code: l });
2524
- return this.applySession("SIGNED_IN", a), a;
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 });
3503
+ return this.applySession("SIGNED_IN", l), l;
2525
3504
  } catch (i) {
2526
3505
  try {
2527
- n.close();
3506
+ r.close();
2528
3507
  } catch {
2529
3508
  }
2530
3509
  throw i;
@@ -2533,56 +3512,56 @@ class gt {
2533
3512
  destroy() {
2534
3513
  this.unsubBroadcast?.(), this.unsubBroadcast = null, this.listeners.clear(), this.session = null;
2535
3514
  }
2536
- applySession(e, t) {
2537
- if (!mt(this.session, t)) {
2538
- this.session = t;
2539
- for (const n of [...this.listeners])
3515
+ applySession(e, n) {
3516
+ if (!vn(this.session, n)) {
3517
+ this.session = n;
3518
+ for (const r of [...this.listeners])
2540
3519
  try {
2541
- n(e, t);
3520
+ r(e, n);
2542
3521
  } catch (i) {
2543
3522
  console.warn("[paywall] onAuthChange listener threw", i);
2544
3523
  }
2545
3524
  }
2546
3525
  }
2547
3526
  }
2548
- function mt(r, e) {
2549
- 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;
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;
2550
3529
  }
2551
- const yt = {
3530
+ const _n = {
2552
3531
  google: "Google",
2553
3532
  apple: "Apple",
2554
3533
  github: "GitHub",
2555
3534
  facebook: "Facebook"
2556
3535
  };
2557
- function xt(r, e) {
2558
- const t = yt[e] ?? e;
3536
+ function Sn(t, e) {
3537
+ const n = _n[e] ?? e;
2559
3538
  try {
2560
- const n = r.document;
2561
- n.title = `Sign in with ${t}`;
2562
- const i = n.createElement("style");
2563
- 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);
2564
- const s = n.createElement("div");
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");
2565
3544
  s.className = "pw-oauth-wrap";
2566
- const l = n.createElement("div");
2567
- l.className = "pw-oauth-spinner";
2568
- const a = n.createElement("div");
2569
- a.className = "pw-oauth-label", a.textContent = `Connecting to ${t}…`, s.appendChild(l), s.appendChild(a), n.body.appendChild(s);
3545
+ const a = r.createElement("div");
3546
+ 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);
2570
3549
  } catch {
2571
3550
  }
2572
3551
  }
2573
- class bt {
3552
+ class Cn {
2574
3553
  constructor(e) {
2575
3554
  this.transport = e;
2576
3555
  }
2577
3556
  /** Отправить событие. Fire-and-forget — не возвращает Promise, не throw'ает.
2578
3557
  * Сетевые/транспортные ошибки логируются в console и не блокируют caller. */
2579
- track(e, t) {
2580
- typeof e != "string" || e.length === 0 || this.transport.request("tracker.track", { name: e, props: t }).catch((n) => {
2581
- console.warn("[paywall] track failed", n);
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);
2582
3561
  });
2583
3562
  }
2584
3563
  }
2585
- class kt {
3564
+ class In {
2586
3565
  constructor(e) {
2587
3566
  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)}`;
2588
3567
  }
@@ -2594,31 +3573,31 @@ class kt {
2594
3573
  if (this.channel) return this.channel;
2595
3574
  const e = this.factory();
2596
3575
  this.channel = e;
2597
- const t = e.onMessage((i) => this.handleMessage(i)), n = e.onDisconnect(() => this.handleDisconnect());
2598
- return this.channelDisposers = [t, n], this.request("handshake", {
2599
- protocolVersion: N,
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,
2600
3579
  clientId: this.clientId
2601
3580
  }).then((i) => {
2602
- i.protocolVersion !== N && console.warn(
2603
- `[sdk-extension] protocol version mismatch: client=${N}, offscreen=${i.protocolVersion}. Update host's @monetize.software/sdk-extension.`
3581
+ i.protocolVersion !== Y && console.warn(
3582
+ `[sdk-extension] protocol version mismatch: client=${Y}, offscreen=${i.protocolVersion}. Update host's @monetize.software/sdk-extension.`
2604
3583
  );
2605
3584
  }).catch(() => {
2606
3585
  }), e;
2607
3586
  }
2608
3587
  handleMessage(e) {
2609
- if (vt(e)) {
3588
+ if (An(e)) {
2610
3589
  if (e.type === "response") {
2611
- const t = this.pending.get(e.id);
2612
- if (!t) return;
2613
- this.pending.delete(e.id), t.signal?.removeEventListener("abort", t.abortListener), e.ok ? t.resolve(e.result) : t.reject(he(e.error));
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));
2614
3593
  return;
2615
3594
  }
2616
3595
  if (e.type === "event") {
2617
- const t = this.listeners.get(e.kind);
2618
- if (!t) return;
2619
- for (const n of [...t])
3596
+ const n = this.listeners.get(e.kind);
3597
+ if (!n) return;
3598
+ for (const r of [...n])
2620
3599
  try {
2621
- n(e.payload);
3600
+ r(e.payload);
2622
3601
  } catch (i) {
2623
3602
  console.error("[sdk-extension] event handler threw", i);
2624
3603
  }
@@ -2626,105 +3605,105 @@ class kt {
2626
3605
  }
2627
3606
  }
2628
3607
  handleDisconnect() {
2629
- for (const t of this.channelDisposers) t();
3608
+ for (const n of this.channelDisposers) n();
2630
3609
  this.channelDisposers = [], this.channel = null;
2631
3610
  const e = Array.from(this.pending.values());
2632
3611
  this.pending.clear();
2633
- for (const t of e)
2634
- t.signal?.removeEventListener("abort", t.abortListener), t.reject(new wt());
3612
+ for (const n of e)
3613
+ n.signal?.removeEventListener("abort", n.abortListener), n.reject(new Ln());
2635
3614
  }
2636
- request(e, t, n = {}) {
3615
+ request(e, n, r = {}) {
2637
3616
  if (this.destroyed)
2638
3617
  return Promise.reject(new Error("TransportClient destroyed"));
2639
- if (n.signal?.aborted)
3618
+ if (r.signal?.aborted)
2640
3619
  return Promise.reject(new DOMException("Aborted", "AbortError"));
2641
3620
  const i = this.ensureChannel(), s = `r${++this.nextId}`;
2642
- return new Promise((l, a) => {
2643
- const h = {
2644
- resolve: l,
2645
- reject: a,
2646
- signal: n.signal
3621
+ return new Promise((a, l) => {
3622
+ const d = {
3623
+ resolve: a,
3624
+ reject: l,
3625
+ signal: r.signal
2647
3626
  };
2648
- n.signal && (h.abortListener = () => {
3627
+ r.signal && (d.abortListener = () => {
2649
3628
  if (this.pending.delete(s)) {
2650
- a(new DOMException("Aborted", "AbortError"));
3629
+ l(new DOMException("Aborted", "AbortError"));
2651
3630
  try {
2652
3631
  i.send({ type: "cancel", id: s });
2653
3632
  } catch {
2654
3633
  }
2655
3634
  }
2656
- }, n.signal.addEventListener("abort", h.abortListener)), this.pending.set(s, h);
3635
+ }, r.signal.addEventListener("abort", d.abortListener)), this.pending.set(s, d);
2657
3636
  const u = {
2658
3637
  type: "request",
2659
3638
  id: s,
2660
3639
  kind: e,
2661
- params: t
3640
+ params: n
2662
3641
  };
2663
3642
  try {
2664
3643
  i.send(u);
2665
- } catch (m) {
2666
- this.pending.delete(s), n.signal?.removeEventListener("abort", h.abortListener), a(m);
3644
+ } catch (p) {
3645
+ this.pending.delete(s), r.signal?.removeEventListener("abort", d.abortListener), l(p);
2667
3646
  }
2668
3647
  });
2669
3648
  }
2670
- on(e, t) {
2671
- let n = this.listeners.get(e);
2672
- n || (n = /* @__PURE__ */ new Set(), this.listeners.set(e, n));
2673
- const i = t;
2674
- return n.add(i), this.ensureChannel(), () => {
2675
- n.delete(i);
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);
2676
3655
  };
2677
3656
  }
2678
3657
  destroy() {
2679
3658
  if (this.destroyed) return;
2680
3659
  this.destroyed = !0;
2681
- for (const t of this.channelDisposers) t();
3660
+ for (const n of this.channelDisposers) n();
2682
3661
  this.channelDisposers = [], this.listeners.clear();
2683
3662
  const e = Array.from(this.pending.values());
2684
3663
  this.pending.clear();
2685
- for (const t of e)
2686
- t.signal?.removeEventListener("abort", t.abortListener), t.reject(new Error("TransportClient destroyed"));
3664
+ for (const n of e)
3665
+ n.signal?.removeEventListener("abort", n.abortListener), n.reject(new Error("TransportClient destroyed"));
2687
3666
  this.channel?.close(), this.channel = null;
2688
3667
  }
2689
3668
  }
2690
- class wt extends Error {
3669
+ class Ln extends Error {
2691
3670
  constructor() {
2692
3671
  super("Transport channel disconnected mid-request"), this.code = "transport_disconnected", this.name = "TransportDisconnectedError";
2693
3672
  }
2694
3673
  }
2695
- function vt(r) {
2696
- if (typeof r != "object" || r === null) return !1;
2697
- const e = r.type;
3674
+ function An(t) {
3675
+ if (typeof t != "object" || t === null) return !1;
3676
+ const e = t.type;
2698
3677
  return e === "request" || e === "response" || e === "event";
2699
3678
  }
2700
- let R = null;
2701
- function _t() {
2702
- return R || (R = new kt(() => de(pe)), R);
3679
+ let H = null;
3680
+ function En() {
3681
+ return H || (H = new In(() => qe($e)), H);
2703
3682
  }
2704
- class Lt extends it {
3683
+ class jn extends un {
2705
3684
  constructor(e) {
2706
- const t = _t(), n = new dt(t, {
3685
+ const n = En(), r = new xn(n, {
2707
3686
  paywallId: e.paywallId,
2708
3687
  apiOrigin: e.apiOrigin
2709
3688
  });
2710
3689
  let i;
2711
- e.auth === !0 ? i = new gt(t, {
3690
+ e.auth === !0 ? i = new kn(n, {
2712
3691
  paywallId: e.paywallId,
2713
3692
  apiOrigin: e.apiOrigin
2714
3693
  }) : e.auth && console.warn(
2715
3694
  "[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."
2716
- ), i && (n.auth = i), super({
3695
+ ), i && (r.auth = i), super({
2717
3696
  ...e,
2718
3697
  // Cast'ы безопасны: PaywallUI'ев resolveAuth duck-type'ит auth (см.
2719
3698
  // sdk/src/ui/PaywallUI.ts isAuthClientLike), а billing-параметр идёт
2720
3699
  // через `opts.client ?? new BillingClient(...)` — RemoteBillingClient
2721
3700
  // там используется как есть, методы все сходятся.
2722
- client: n,
3701
+ client: r,
2723
3702
  auth: i,
2724
3703
  // Внутренний EventTracker отключаем — единственный tracker живёт в
2725
3704
  // offscreen'е. Манчиально подписываемся ниже.
2726
3705
  analytics: !1
2727
- }), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new bt(t), this.bindAnalytics());
3706
+ }), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new Cn(n), this.bindAnalytics());
2728
3707
  }
2729
3708
  /** Зеркало sdk/PaywallUI.initTracker'овских биндингов, но с RemoteEventTracker.
2730
3709
  * Когда @monetize.software/sdk экспоузнет публичный hook для inject'а tracker'а,
@@ -2735,46 +3714,46 @@ class Lt extends it {
2735
3714
  this.on("open", () => e.track("paywall_opened")),
2736
3715
  this.on(
2737
3716
  "ready",
2738
- (t) => e.track("paywall_viewed", {
2739
- is_test_mode: t.settings.is_test_mode,
2740
- prices_count: t.prices.length,
2741
- offers_count: t.offers.length
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
2742
3721
  })
2743
3722
  ),
2744
3723
  this.on(
2745
3724
  "price_selected",
2746
- (t) => e.track("price_selected", { price_id: t.priceId })
3725
+ (n) => e.track("price_selected", { price_id: n.priceId })
2747
3726
  ),
2748
3727
  this.on(
2749
3728
  "checkout_started",
2750
- (t) => e.track("checkout_started", { price_id: t.priceId, acquiring: t.acquiring })
3729
+ (n) => e.track("checkout_started", { price_id: n.priceId, acquiring: n.acquiring })
2751
3730
  ),
2752
3731
  this.on(
2753
3732
  "purchase_completed",
2754
- (t) => e.track("purchase_completed", { price_id: t.priceId, session_id: t.sessionId })
3733
+ (n) => e.track("purchase_completed", { price_id: n.priceId, session_id: n.sessionId })
2755
3734
  ),
2756
- this.on("purchase_failed", (t) => e.track("purchase_failed", { reason: t.reason })),
3735
+ this.on("purchase_failed", (n) => e.track("purchase_failed", { reason: n.reason })),
2757
3736
  this.on("close", () => e.track("paywall_closed")),
2758
3737
  this.on(
2759
3738
  "trial_blocked",
2760
- (t) => e.track("trial_blocked", {
2761
- mode: t.mode,
2762
- ...t.mode === "time" ? { remaining_ms: t.remainingMs, total_ms: t.totalMs } : t.mode === "opens" ? { remaining_actions: t.remainingActions, total_actions: t.totalActions } : {}
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 } : {}
2763
3742
  })
2764
3743
  ),
2765
3744
  this.on("trial_expired", () => e.track("trial_expired")),
2766
3745
  this.on(
2767
3746
  "visibility_blocked",
2768
- (t) => e.track("visibility_blocked", { reason: t.reason, country: t.country, tier: t.tier })
3747
+ (n) => e.track("visibility_blocked", { reason: n.reason, country: n.country, tier: n.tier })
2769
3748
  ),
2770
- this.on("error", (t) => e.track("error", { code: t.code, message: t.message }))
3749
+ this.on("error", (n) => e.track("error", { code: n.code, message: n.message }))
2771
3750
  );
2772
3751
  }
2773
3752
  /** Прокси через RemoteEventTracker. Hosts могут вызывать paywall.track
2774
3753
  * для произвольных аналитических событий — летит в единственный
2775
3754
  * offscreen-tracker наряду с auto-emit'ами PaywallUI. */
2776
- track(e, t) {
2777
- this.remoteTracker?.track(e, t);
3755
+ track(e, n) {
3756
+ this.remoteTracker?.track(e, n);
2778
3757
  }
2779
3758
  destroy() {
2780
3759
  for (const e of this.trackerUnsubs) e();
@@ -2782,11 +3761,11 @@ class Lt extends it {
2782
3761
  }
2783
3762
  }
2784
3763
  export {
2785
- N as PROTOCOL_VERSION,
2786
- Lt as PaywallUI,
2787
- gt as RemoteAuthClient,
2788
- dt as RemoteBillingClient,
2789
- bt as RemoteEventTracker,
2790
- _t as getContentTransport
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
2791
3770
  };
2792
3771
  //# sourceMappingURL=content.js.map