@monetize.software/sdk-extension 3.0.0-alpha.1 → 3.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +21 -20
- package/dist/chunks/ar-7cgIM-Vl.js +2 -0
- package/dist/chunks/ar-7cgIM-Vl.js.map +1 -0
- package/dist/chunks/ar-B2Wg_IrC.js +126 -0
- package/dist/chunks/ar-B2Wg_IrC.js.map +1 -0
- package/dist/chunks/{chrome-port-BXHR4SOG.js → chrome-port-CB1NEZOC.js} +367 -216
- package/dist/chunks/chrome-port-CB1NEZOC.js.map +1 -0
- package/dist/chunks/chrome-port-DptrBLez.js +2 -0
- package/dist/chunks/chrome-port-DptrBLez.js.map +1 -0
- package/dist/chunks/cs-BNo9Dx0Q.js +122 -0
- package/dist/chunks/cs-BNo9Dx0Q.js.map +1 -0
- package/dist/chunks/cs-S05PC5AC.js +2 -0
- package/dist/chunks/cs-S05PC5AC.js.map +1 -0
- package/dist/chunks/da-Bi4zBG14.js +2 -0
- package/dist/chunks/da-Bi4zBG14.js.map +1 -0
- package/dist/chunks/da-Do9Lq6En.js +122 -0
- package/dist/chunks/da-Do9Lq6En.js.map +1 -0
- package/dist/chunks/de-C8pDZNvx.js +141 -0
- package/dist/chunks/de-C8pDZNvx.js.map +1 -0
- package/dist/chunks/de-nCDB6D2W.js +2 -0
- package/dist/chunks/de-nCDB6D2W.js.map +1 -0
- package/dist/chunks/el-BrKaa978.js +2 -0
- package/dist/chunks/el-BrKaa978.js.map +1 -0
- package/dist/chunks/el-DzMNX-_P.js +126 -0
- package/dist/chunks/el-DzMNX-_P.js.map +1 -0
- package/dist/chunks/es-B-Wtyzrl.js +2 -0
- package/dist/chunks/es-B-Wtyzrl.js.map +1 -0
- package/dist/chunks/es-YrKt-q4w.js +141 -0
- package/dist/chunks/es-YrKt-q4w.js.map +1 -0
- package/dist/chunks/fi-Bh44pwZ4.js +122 -0
- package/dist/chunks/fi-Bh44pwZ4.js.map +1 -0
- package/dist/chunks/fi-D1SGXjnO.js +2 -0
- package/dist/chunks/fi-D1SGXjnO.js.map +1 -0
- package/dist/chunks/fr-Bc0pw4ws.js +141 -0
- package/dist/chunks/fr-Bc0pw4ws.js.map +1 -0
- package/dist/chunks/fr-BhYf-iKk.js +2 -0
- package/dist/chunks/fr-BhYf-iKk.js.map +1 -0
- package/dist/chunks/he-BXAaFv6Y.js +2 -0
- package/dist/chunks/he-BXAaFv6Y.js.map +1 -0
- package/dist/chunks/he-Bfm-bhe3.js +126 -0
- package/dist/chunks/he-Bfm-bhe3.js.map +1 -0
- package/dist/chunks/hi-D-O-B9Dn.js +126 -0
- package/dist/chunks/hi-D-O-B9Dn.js.map +1 -0
- package/dist/chunks/hi-xblDO0O7.js +2 -0
- package/dist/chunks/hi-xblDO0O7.js.map +1 -0
- package/dist/chunks/hu-CmIuAbLL.js +122 -0
- package/dist/chunks/hu-CmIuAbLL.js.map +1 -0
- package/dist/chunks/hu-Wa46p0y4.js +2 -0
- package/dist/chunks/hu-Wa46p0y4.js.map +1 -0
- package/dist/chunks/id-CQEo5X94.js +2 -0
- package/dist/chunks/id-CQEo5X94.js.map +1 -0
- package/dist/chunks/id-DN7IES-A.js +122 -0
- package/dist/chunks/id-DN7IES-A.js.map +1 -0
- package/dist/chunks/it-8AYCm0xz.js +2 -0
- package/dist/chunks/it-8AYCm0xz.js.map +1 -0
- package/dist/chunks/it-Cz5Nmqx5.js +141 -0
- package/dist/chunks/it-Cz5Nmqx5.js.map +1 -0
- package/dist/chunks/ja-BH9BlBh2.js +145 -0
- package/dist/chunks/ja-BH9BlBh2.js.map +1 -0
- package/dist/chunks/ja-q-COVayn.js +2 -0
- package/dist/chunks/ja-q-COVayn.js.map +1 -0
- package/dist/chunks/ko-B6HRCscZ.js +2 -0
- package/dist/chunks/ko-B6HRCscZ.js.map +1 -0
- package/dist/chunks/ko-CYV9QuYs.js +145 -0
- package/dist/chunks/ko-CYV9QuYs.js.map +1 -0
- package/dist/chunks/nl-BvkB900D.js +141 -0
- package/dist/chunks/nl-BvkB900D.js.map +1 -0
- package/dist/chunks/nl-CAd6_xlm.js +2 -0
- package/dist/chunks/nl-CAd6_xlm.js.map +1 -0
- package/dist/chunks/no-3s9_ormb.js +122 -0
- package/dist/chunks/no-3s9_ormb.js.map +1 -0
- package/dist/chunks/no-CAmz6bz6.js +2 -0
- package/dist/chunks/no-CAmz6bz6.js.map +1 -0
- package/dist/chunks/pl-C9WTGQtb.js +122 -0
- package/dist/chunks/pl-C9WTGQtb.js.map +1 -0
- package/dist/chunks/pl-DqUSTCaF.js +2 -0
- package/dist/chunks/pl-DqUSTCaF.js.map +1 -0
- package/dist/chunks/port-name-CF4WQQ3-.js +2 -0
- package/dist/chunks/port-name-CF4WQQ3-.js.map +1 -0
- package/dist/chunks/port-name-ervLBWAQ.js +6 -0
- package/dist/chunks/port-name-ervLBWAQ.js.map +1 -0
- package/dist/chunks/pt-8ARZnH0_.js +2 -0
- package/dist/chunks/pt-8ARZnH0_.js.map +1 -0
- package/dist/chunks/pt-uFVUv_Op.js +141 -0
- package/dist/chunks/pt-uFVUv_Op.js.map +1 -0
- package/dist/chunks/ro-BrqQ8Au-.js +122 -0
- package/dist/chunks/ro-BrqQ8Au-.js.map +1 -0
- package/dist/chunks/ro-D-NMbp2F.js +2 -0
- package/dist/chunks/ro-D-NMbp2F.js.map +1 -0
- package/dist/chunks/ru-8gbHPh0g.js +2 -0
- package/dist/chunks/ru-8gbHPh0g.js.map +1 -0
- package/dist/chunks/ru-DK594dA8.js +144 -0
- package/dist/chunks/ru-DK594dA8.js.map +1 -0
- package/dist/chunks/sv-CHNH8-mq.js +122 -0
- package/dist/chunks/sv-CHNH8-mq.js.map +1 -0
- package/dist/chunks/sv-D8a8hmx9.js +2 -0
- package/dist/chunks/sv-D8a8hmx9.js.map +1 -0
- package/dist/chunks/th-DfjUK0Y7.js +2 -0
- package/dist/chunks/th-DfjUK0Y7.js.map +1 -0
- package/dist/chunks/th-l24Pm5q-.js +126 -0
- package/dist/chunks/th-l24Pm5q-.js.map +1 -0
- package/dist/chunks/tr-ADpigSY5.js +122 -0
- package/dist/chunks/tr-ADpigSY5.js.map +1 -0
- package/dist/chunks/tr-BdBpz4tL.js +2 -0
- package/dist/chunks/tr-BdBpz4tL.js.map +1 -0
- package/dist/chunks/uk-CGqo4jek.js +144 -0
- package/dist/chunks/uk-CGqo4jek.js.map +1 -0
- package/dist/chunks/uk-Cx1zv1ao.js +2 -0
- package/dist/chunks/uk-Cx1zv1ao.js.map +1 -0
- package/dist/chunks/vi-Dk9bTu6f.js +122 -0
- package/dist/chunks/vi-Dk9bTu6f.js.map +1 -0
- package/dist/chunks/vi-oe2dW21I.js +2 -0
- package/dist/chunks/vi-oe2dW21I.js.map +1 -0
- package/dist/chunks/zh-CwczPMPp.js +2 -0
- package/dist/chunks/zh-CwczPMPp.js.map +1 -0
- package/dist/chunks/zh-LDkEV2D9.js +145 -0
- package/dist/chunks/zh-LDkEV2D9.js.map +1 -0
- package/dist/content/RemoteAuthClient.d.ts +8 -4
- package/dist/content/RemoteAuthClient.d.ts.map +1 -1
- package/dist/content/RemoteAuthClient.test-d.d.ts +2 -0
- package/dist/content/RemoteAuthClient.test-d.d.ts.map +1 -0
- package/dist/content/RemoteBillingClient.d.ts +29 -0
- package/dist/content/RemoteBillingClient.d.ts.map +1 -1
- package/dist/content/RemoteBillingClient.test-d.d.ts +2 -0
- package/dist/content/RemoteBillingClient.test-d.d.ts.map +1 -0
- package/dist/content.cjs +3 -3
- package/dist/content.cjs.map +1 -1
- package/dist/content.js +2106 -1040
- package/dist/content.js.map +1 -1
- package/dist/offscreen/server.d.ts.map +1 -1
- package/dist/offscreen.cjs +1 -1
- package/dist/offscreen.cjs.map +1 -1
- package/dist/offscreen.js +18 -15
- package/dist/offscreen.js.map +1 -1
- package/dist/shared/messages.d.ts +27 -4
- package/dist/shared/messages.d.ts.map +1 -1
- package/dist/shared/port-name.d.ts +1 -0
- package/dist/shared/port-name.d.ts.map +1 -1
- package/dist/shared/protocol.d.ts +1 -1
- package/dist/shared/protocol.d.ts.map +1 -1
- package/dist/sw.cjs +1 -1
- package/dist/sw.cjs.map +1 -1
- package/dist/sw.js +14 -14
- package/dist/sw.js.map +1 -1
- package/package.json +39 -21
- package/dist/chunks/chrome-port-BXHR4SOG.js.map +0 -1
- package/dist/chunks/chrome-port-EtYqHf3p.js +0 -2
- package/dist/chunks/chrome-port-EtYqHf3p.js.map +0 -1
- package/dist/chunks/port-name-BPfQKtdb.js +0 -5
- package/dist/chunks/port-name-BPfQKtdb.js.map +0 -1
- package/dist/chunks/port-name-qwB109u9.js +0 -2
- package/dist/chunks/port-name-qwB109u9.js.map +0 -1
package/dist/content.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { P as T, B as
|
|
2
|
-
import { render as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { P as
|
|
6
|
-
const oe = '@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}}';
|
|
7
|
-
let
|
|
8
|
-
function
|
|
9
|
-
if (
|
|
1
|
+
import { P as T, B as je, E as Re, c as ze, A as ce, w as De, a as X, r as qe, b as Ne } from "./chunks/chrome-port-CB1NEZOC.js";
|
|
2
|
+
import { render as J, h as ue, createContext as Fe } from "preact";
|
|
3
|
+
import { jsx as o, jsxs as u, Fragment as se } from "preact/jsx-runtime";
|
|
4
|
+
import { useState as x, useEffect as B, useContext as Ve, useRef as R, useMemo as $e, useLayoutEffect as He } from "preact/hooks";
|
|
5
|
+
import { P as Ge } from "./chunks/port-name-ervLBWAQ.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 de = !1;
|
|
8
|
+
function We() {
|
|
9
|
+
if (de || (de = !0, typeof CSS > "u" || typeof CSS.registerProperty != "function")) return;
|
|
10
10
|
let r;
|
|
11
11
|
try {
|
|
12
12
|
const e = new CSSStyleSheet();
|
|
13
|
-
e.replaceSync(
|
|
13
|
+
e.replaceSync(_e), r = e.cssRules;
|
|
14
14
|
} catch {
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
@@ -28,12 +28,12 @@ function ge() {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Ze(r, e, t = {}) {
|
|
32
32
|
if (typeof document > "u")
|
|
33
33
|
throw new Error("mountShadow called in non-DOM environment");
|
|
34
|
-
|
|
34
|
+
We();
|
|
35
35
|
const n = t.host ?? document.createElement("div");
|
|
36
|
-
n.setAttribute("data-paywall-host", ""), n.style.cssText = "all: initial; position: fixed; inset: 0; z-index: 2147483647; pointer-events: none;", n.isConnected
|
|
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
37
|
const i = n.attachShadow({ mode: t.shadowMode ?? "closed" }), s = `
|
|
38
38
|
:host {
|
|
39
39
|
all: initial !important;
|
|
@@ -52,124 +52,230 @@ function me(r, e, t = {}) {
|
|
|
52
52
|
cursor: auto !important;
|
|
53
53
|
visibility: visible !important;
|
|
54
54
|
}
|
|
55
|
-
`,
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
let
|
|
60
|
-
return
|
|
55
|
+
`, a = document.createElement("style");
|
|
56
|
+
a.textContent = s + _e + (t.injectCss ?? ""), i.appendChild(a);
|
|
57
|
+
const c = document.createElement("div");
|
|
58
|
+
c.style.pointerEvents = "auto", i.appendChild(c);
|
|
59
|
+
let l = e;
|
|
60
|
+
return J(ue(r, l), c), {
|
|
61
61
|
shadowRoot: i,
|
|
62
|
-
update(
|
|
63
|
-
|
|
62
|
+
update(f) {
|
|
63
|
+
l = { ...l, ...f }, J(ue(r, l), c);
|
|
64
64
|
},
|
|
65
65
|
unmount() {
|
|
66
|
-
|
|
66
|
+
J(null, c), n.remove();
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
|
|
70
|
+
const Ye = (r, e, t) => {
|
|
71
|
+
const n = r[e];
|
|
72
|
+
return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((i, s) => {
|
|
73
|
+
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
74
|
+
s.bind(
|
|
75
|
+
null,
|
|
76
|
+
new Error(
|
|
77
|
+
"Unknown variable dynamic import: " + e + (e.split("/").length !== t ? ". Note that variables only represent file names one level deep." : "")
|
|
78
|
+
)
|
|
79
|
+
)
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
}, Ke = [
|
|
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 = (r, e, t) => Ie(e, t), Ce = Fe({ t: Se, locale: "en" });
|
|
111
|
+
function Ie(r, e) {
|
|
112
|
+
if (!e) return r;
|
|
113
|
+
let t = r;
|
|
114
|
+
for (const [n, i] of Object.entries(e))
|
|
115
|
+
t = t.split(`{${n}}`).join(String(i));
|
|
116
|
+
return t;
|
|
117
|
+
}
|
|
118
|
+
const Q = /* @__PURE__ */ new Map(), ee = /* @__PURE__ */ new Map();
|
|
119
|
+
function Ae(r) {
|
|
120
|
+
return Ke.includes(r);
|
|
121
|
+
}
|
|
122
|
+
function Xe(r) {
|
|
123
|
+
const e = [];
|
|
124
|
+
if (typeof navigator < "u" && navigator.language) {
|
|
125
|
+
e.push(navigator.language);
|
|
126
|
+
const n = navigator.language.split("-")[0];
|
|
127
|
+
n && n !== navigator.language && e.push(n);
|
|
128
|
+
}
|
|
129
|
+
const t = r.settings.locale_default;
|
|
130
|
+
if (t) {
|
|
131
|
+
e.push(t);
|
|
132
|
+
const n = t.split("-")[0];
|
|
133
|
+
n && n !== t && e.push(n);
|
|
134
|
+
}
|
|
135
|
+
for (const n of e)
|
|
136
|
+
if (Ae(n)) return n;
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
function Je(r, e) {
|
|
140
|
+
return !!r.locales && r.locales[e] !== void 0;
|
|
141
|
+
}
|
|
142
|
+
async function Qe(r) {
|
|
143
|
+
const e = Q.get(r);
|
|
144
|
+
if (e) return e;
|
|
145
|
+
const t = ee.get(r);
|
|
146
|
+
if (t) return t;
|
|
147
|
+
const n = Ye(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./chunks/ar-B2Wg_IrC.js"), "./locales/cs.ts": () => import("./chunks/cs-BNo9Dx0Q.js"), "./locales/da.ts": () => import("./chunks/da-Do9Lq6En.js"), "./locales/de.ts": () => import("./chunks/de-C8pDZNvx.js"), "./locales/el.ts": () => import("./chunks/el-DzMNX-_P.js"), "./locales/es.ts": () => import("./chunks/es-YrKt-q4w.js"), "./locales/fi.ts": () => import("./chunks/fi-Bh44pwZ4.js"), "./locales/fr.ts": () => import("./chunks/fr-Bc0pw4ws.js"), "./locales/he.ts": () => import("./chunks/he-Bfm-bhe3.js"), "./locales/hi.ts": () => import("./chunks/hi-D-O-B9Dn.js"), "./locales/hu.ts": () => import("./chunks/hu-CmIuAbLL.js"), "./locales/id.ts": () => import("./chunks/id-DN7IES-A.js"), "./locales/it.ts": () => import("./chunks/it-Cz5Nmqx5.js"), "./locales/ja.ts": () => import("./chunks/ja-BH9BlBh2.js"), "./locales/ko.ts": () => import("./chunks/ko-CYV9QuYs.js"), "./locales/nl.ts": () => import("./chunks/nl-BvkB900D.js"), "./locales/no.ts": () => import("./chunks/no-3s9_ormb.js"), "./locales/pl.ts": () => import("./chunks/pl-C9WTGQtb.js"), "./locales/pt.ts": () => import("./chunks/pt-uFVUv_Op.js"), "./locales/ro.ts": () => import("./chunks/ro-BrqQ8Au-.js"), "./locales/ru.ts": () => import("./chunks/ru-DK594dA8.js"), "./locales/sv.ts": () => import("./chunks/sv-CHNH8-mq.js"), "./locales/th.ts": () => import("./chunks/th-l24Pm5q-.js"), "./locales/tr.ts": () => import("./chunks/tr-ADpigSY5.js"), "./locales/uk.ts": () => import("./chunks/uk-CGqo4jek.js"), "./locales/vi.ts": () => import("./chunks/vi-Dk9bTu6f.js"), "./locales/zh.ts": () => import("./chunks/zh-LDkEV2D9.js") }), `./locales/${r}.ts`, 3).then((i) => {
|
|
148
|
+
const s = i.default ?? {};
|
|
149
|
+
return Q.set(r, s), s;
|
|
150
|
+
}).catch((i) => {
|
|
151
|
+
console.warn(`[paywall] failed to load locale chunk "${r}"`, i);
|
|
152
|
+
const s = {};
|
|
153
|
+
return Q.set(r, s), s;
|
|
154
|
+
}).finally(() => {
|
|
155
|
+
ee.delete(r);
|
|
156
|
+
});
|
|
157
|
+
return ee.set(r, n), n;
|
|
158
|
+
}
|
|
159
|
+
function et({ bootstrap: r, forceLocale: e, children: t }) {
|
|
160
|
+
const [n, i] = x("en"), [s, a] = x(null);
|
|
161
|
+
B(() => {
|
|
162
|
+
const f = (e && Ae(e) ? e : null) ?? (() => {
|
|
163
|
+
if (!r) return null;
|
|
164
|
+
const d = Xe(r);
|
|
165
|
+
return !d || !Je(r, d) ? null : d;
|
|
166
|
+
})();
|
|
167
|
+
if (!f) {
|
|
168
|
+
(s !== null || n !== "en") && (i("en"), a(null));
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (f === n && s) return;
|
|
172
|
+
let h = !1;
|
|
173
|
+
return Qe(f).then((d) => {
|
|
174
|
+
h || (i(f), a(d));
|
|
175
|
+
}), () => {
|
|
176
|
+
h = !0;
|
|
177
|
+
};
|
|
178
|
+
}, [r, e]);
|
|
179
|
+
const c = {
|
|
180
|
+
locale: n,
|
|
181
|
+
t: s ? (l, f, h) => Ie(s[l] ?? f, h) : Se
|
|
182
|
+
};
|
|
183
|
+
return /* @__PURE__ */ o(Ce.Provider, { value: c, children: t });
|
|
184
|
+
}
|
|
185
|
+
function k() {
|
|
186
|
+
return Ve(Ce);
|
|
187
|
+
}
|
|
188
|
+
const he = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
189
|
+
function tt({
|
|
72
190
|
open: r,
|
|
73
191
|
onClose: e,
|
|
74
192
|
labelledBy: t,
|
|
75
193
|
brandColor: n,
|
|
76
|
-
|
|
194
|
+
topBanner: i,
|
|
77
195
|
allowClose: s = !0,
|
|
196
|
+
hideCloseButton: a = !1,
|
|
197
|
+
inline: c = !1,
|
|
78
198
|
children: l
|
|
79
199
|
}) {
|
|
80
|
-
const
|
|
81
|
-
return
|
|
200
|
+
const { t: f } = k(), h = R(null), d = R(null);
|
|
201
|
+
return B(() => {
|
|
82
202
|
if (!r) return;
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
203
|
+
d.current = document.activeElement ?? null;
|
|
204
|
+
const p = h.current;
|
|
205
|
+
p && (p.querySelector(he) ?? p).focus({ preventScroll: !0 });
|
|
206
|
+
const y = (_) => {
|
|
207
|
+
if (_.key === "Escape") {
|
|
88
208
|
if (!s) return;
|
|
89
|
-
|
|
209
|
+
_.stopPropagation(), e();
|
|
90
210
|
return;
|
|
91
211
|
}
|
|
92
|
-
if (
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
).filter((
|
|
96
|
-
if (
|
|
97
|
-
|
|
212
|
+
if (_.key !== "Tab" || !h.current) return;
|
|
213
|
+
const S = Array.from(
|
|
214
|
+
h.current.querySelectorAll(he)
|
|
215
|
+
).filter((U) => !U.hasAttribute("disabled") && U.tabIndex !== -1);
|
|
216
|
+
if (S.length === 0) {
|
|
217
|
+
_.preventDefault();
|
|
98
218
|
return;
|
|
99
219
|
}
|
|
100
|
-
const A =
|
|
101
|
-
|
|
220
|
+
const A = S[0], z = S[S.length - 1], E = document.activeElement;
|
|
221
|
+
_.shiftKey && E === A ? (_.preventDefault(), z.focus()) : !_.shiftKey && E === z && (_.preventDefault(), A.focus());
|
|
102
222
|
};
|
|
103
|
-
document.addEventListener("keydown",
|
|
104
|
-
const
|
|
105
|
-
return document.body.style.overflow = "hidden", () => {
|
|
106
|
-
document.removeEventListener("keydown",
|
|
223
|
+
document.addEventListener("keydown", y, !0);
|
|
224
|
+
const O = document.body.style.overflow;
|
|
225
|
+
return c || (document.body.style.overflow = "hidden"), () => {
|
|
226
|
+
document.removeEventListener("keydown", y, !0), c || (document.body.style.overflow = O), d.current?.focus?.({ preventScroll: !0 });
|
|
107
227
|
};
|
|
108
|
-
}, [r, e, s]), r ? /* @__PURE__ */ u(
|
|
228
|
+
}, [r, e, s, c]), r ? /* @__PURE__ */ u(
|
|
109
229
|
"div",
|
|
110
230
|
{
|
|
111
|
-
class: "
|
|
112
|
-
onClick: (
|
|
113
|
-
s &&
|
|
231
|
+
class: `${c ? "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]`,
|
|
232
|
+
onClick: (p) => {
|
|
233
|
+
s && p.target === p.currentTarget && e();
|
|
114
234
|
},
|
|
115
235
|
"data-pw-root": !0,
|
|
116
236
|
children: [
|
|
117
237
|
/* @__PURE__ */ u(
|
|
118
238
|
"div",
|
|
119
239
|
{
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
"aria-modal": "true",
|
|
123
|
-
"aria-labelledby": t,
|
|
124
|
-
tabIndex: -1,
|
|
125
|
-
class: "relative flex max-h-[calc(100dvh-1rem)] sm:max-h-[calc(100dvh-2rem)] w-full max-w-md flex-col overflow-hidden rounded-3xl bg-white outline-none ring-1 ring-black/5 animate-[pw-scale-in_220ms_cubic-bezier(0.16,1,0.3,1)]",
|
|
126
|
-
style: {
|
|
127
|
-
"--pw-accent": n ?? "#3b82f6",
|
|
128
|
-
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)"
|
|
129
|
-
},
|
|
240
|
+
class: "relative flex w-full max-w-[400px] flex-col animate-[pw-scale-in_220ms_cubic-bezier(0.16,1,0.3,1)]",
|
|
241
|
+
style: { "--pw-accent": n ?? "#3b82f6" },
|
|
130
242
|
children: [
|
|
131
|
-
i
|
|
243
|
+
i,
|
|
244
|
+
/* @__PURE__ */ u(
|
|
132
245
|
"div",
|
|
133
246
|
{
|
|
134
|
-
|
|
135
|
-
role: "
|
|
247
|
+
ref: h,
|
|
248
|
+
role: "dialog",
|
|
249
|
+
"aria-modal": "true",
|
|
250
|
+
"aria-labelledby": t,
|
|
251
|
+
tabIndex: -1,
|
|
252
|
+
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",
|
|
253
|
+
style: {
|
|
254
|
+
boxShadow: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
|
|
255
|
+
},
|
|
136
256
|
children: [
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
257
|
+
l,
|
|
258
|
+
s && !a ? /* @__PURE__ */ o(
|
|
259
|
+
"button",
|
|
260
|
+
{
|
|
261
|
+
type: "button",
|
|
262
|
+
onClick: e,
|
|
263
|
+
"aria-label": f("modal.close_aria", "Close"),
|
|
264
|
+
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)]",
|
|
265
|
+
children: /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o(
|
|
266
|
+
"path",
|
|
267
|
+
{
|
|
268
|
+
d: "M3 3l10 10M13 3L3 13",
|
|
269
|
+
stroke: "currentColor",
|
|
270
|
+
"stroke-width": "1.75",
|
|
271
|
+
"stroke-linecap": "round"
|
|
272
|
+
}
|
|
273
|
+
) })
|
|
274
|
+
}
|
|
275
|
+
) : null
|
|
151
276
|
]
|
|
152
277
|
}
|
|
153
|
-
)
|
|
154
|
-
/* @__PURE__ */ o("div", { class: "flex-1 overflow-y-auto p-7", children: l }),
|
|
155
|
-
s ? /* @__PURE__ */ o(
|
|
156
|
-
"button",
|
|
157
|
-
{
|
|
158
|
-
type: "button",
|
|
159
|
-
onClick: e,
|
|
160
|
-
"aria-label": "Close",
|
|
161
|
-
class: `absolute right-3 ${i ? "top-10" : "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)]`,
|
|
162
|
-
children: /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o(
|
|
163
|
-
"path",
|
|
164
|
-
{
|
|
165
|
-
d: "M3 3l10 10M13 3L3 13",
|
|
166
|
-
stroke: "currentColor",
|
|
167
|
-
"stroke-width": "1.75",
|
|
168
|
-
"stroke-linecap": "round"
|
|
169
|
-
}
|
|
170
|
-
) })
|
|
171
|
-
}
|
|
172
|
-
) : null
|
|
278
|
+
)
|
|
173
279
|
]
|
|
174
280
|
}
|
|
175
281
|
),
|
|
@@ -184,20 +290,60 @@ function ye({
|
|
|
184
290
|
}
|
|
185
291
|
) : null;
|
|
186
292
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
293
|
+
function rt(r, e) {
|
|
294
|
+
switch (r) {
|
|
295
|
+
case "google":
|
|
296
|
+
return e("auth.continue_with_google", "Continue with Google");
|
|
297
|
+
case "apple":
|
|
298
|
+
return e("auth.continue_with_apple", "Continue with Apple");
|
|
299
|
+
case "github":
|
|
300
|
+
return e("auth.continue_with_github", "Continue with GitHub");
|
|
301
|
+
case "facebook":
|
|
302
|
+
return e("auth.continue_with_facebook", "Continue with Facebook");
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function pe(r, e, t) {
|
|
306
|
+
const n = e === "signup" ? t("auth.signup_failed", "Sign-up failed") : t("auth.signin_failed", "Sign-in failed");
|
|
307
|
+
if (!(r instanceof T)) return n;
|
|
308
|
+
switch (r.code) {
|
|
309
|
+
case "invalid_credentials":
|
|
310
|
+
return t("auth.invalid_credentials", "Invalid email or password");
|
|
311
|
+
case "email_not_confirmed":
|
|
312
|
+
return t("auth.email_not_confirmed", "Please confirm your email before signing in.");
|
|
313
|
+
case "email_exists":
|
|
314
|
+
case "user_already_exists":
|
|
315
|
+
return t("auth.email_exists", "An account with this email already exists.");
|
|
316
|
+
case "weak_password":
|
|
317
|
+
return t("auth.weak_password", "Password is too weak.");
|
|
318
|
+
case "invalid_otp":
|
|
319
|
+
case "otp_expired":
|
|
320
|
+
case "token_expired":
|
|
321
|
+
return t("auth.invalid_otp", "The code is invalid or has expired.");
|
|
322
|
+
case "over_email_send_rate_limit":
|
|
323
|
+
case "over_request_rate_limit":
|
|
324
|
+
case "rate_limited":
|
|
325
|
+
case "http_429":
|
|
326
|
+
return t("auth.rate_limited", "Too many requests. Please try again later.");
|
|
327
|
+
case "network_error":
|
|
328
|
+
return t("auth.network_error", "Network error. Please check your connection and try again.");
|
|
329
|
+
case "upstream":
|
|
330
|
+
case "upstream_error":
|
|
331
|
+
case "http_502":
|
|
332
|
+
case "http_503":
|
|
333
|
+
case "http_504":
|
|
334
|
+
return t("auth.service_unavailable", "Service is temporarily unavailable. Please try again.");
|
|
335
|
+
default:
|
|
336
|
+
return n;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
function Le({ block: r, ctx: e }) {
|
|
340
|
+
const t = e.auth, n = e.authSession, i = r.allow_signup !== !1, s = r.allow_password_reset !== !1, a = r.hide_when_authenticated !== !1;
|
|
195
341
|
if (!t)
|
|
196
342
|
return typeof console < "u" && console.warn("[paywall] auth_panel rendered without AuthClient — pass `auth: true` to PaywallUI"), null;
|
|
197
|
-
const
|
|
198
|
-
return
|
|
343
|
+
const c = n && !n.user.is_anonymous ? n : null;
|
|
344
|
+
return c && a ? null : c ? /* @__PURE__ */ o(nt, { email: c.user.email ?? "", onSignOut: () => t.signOut().catch(() => {
|
|
199
345
|
}) }) : /* @__PURE__ */ o(
|
|
200
|
-
|
|
346
|
+
it,
|
|
201
347
|
{
|
|
202
348
|
block: r,
|
|
203
349
|
allowSignup: i,
|
|
@@ -206,10 +352,11 @@ function se({ block: r, ctx: e }) {
|
|
|
206
352
|
}
|
|
207
353
|
);
|
|
208
354
|
}
|
|
209
|
-
function
|
|
210
|
-
|
|
355
|
+
function nt({ email: r, onSignOut: e }) {
|
|
356
|
+
const { t } = k();
|
|
357
|
+
return /* @__PURE__ */ u("div", { class: "flex items-center justify-between gap-3 rounded-2xl bg-gray-100 px-4 py-3", children: [
|
|
211
358
|
/* @__PURE__ */ u("div", { class: "flex flex-col", children: [
|
|
212
|
-
/* @__PURE__ */ o("span", { class: "text-[10px] font-semibold uppercase tracking-wider text-gray-500", children: "Signed in" }),
|
|
359
|
+
/* @__PURE__ */ o("span", { class: "text-[10px] font-semibold uppercase tracking-wider text-gray-500", children: t("auth.signed_in", "Signed in") }),
|
|
213
360
|
/* @__PURE__ */ o("span", { class: "text-sm font-medium text-gray-900", children: r })
|
|
214
361
|
] }),
|
|
215
362
|
/* @__PURE__ */ o(
|
|
@@ -218,723 +365,1303 @@ function be({ email: r, onSignOut: e }) {
|
|
|
218
365
|
type: "button",
|
|
219
366
|
onClick: e,
|
|
220
367
|
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)]",
|
|
221
|
-
children: "Sign out"
|
|
368
|
+
children: t("auth.sign_out", "Sign out")
|
|
222
369
|
}
|
|
223
370
|
)
|
|
224
371
|
] });
|
|
225
372
|
}
|
|
226
|
-
function
|
|
227
|
-
const i = n.auth,
|
|
228
|
-
|
|
229
|
-
|
|
373
|
+
function it({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
374
|
+
const { t: i } = k(), s = n.auth, a = r.providers ?? [], c = n.initialAuthMode === "signup" && e ? "signup" : "signin", [l, f] = x(c), [h, d] = x(""), [b, w] = x(""), [v, p] = x(""), [y, O] = x(""), [_, S] = x(null), A = R(!1), [z, E] = x(null), [U, D] = x(null), [j, P] = x(!1), [L, q] = x(null);
|
|
375
|
+
B(() => {
|
|
376
|
+
if (typeof s.getLastLogin != "function") return;
|
|
377
|
+
let I = !1;
|
|
378
|
+
return s.getLastLogin().then(
|
|
379
|
+
(M) => {
|
|
380
|
+
I || !M || (q(M), M.email && d((V) => V === "" ? M.email : V));
|
|
381
|
+
},
|
|
382
|
+
() => {
|
|
383
|
+
}
|
|
384
|
+
), () => {
|
|
385
|
+
I = !0;
|
|
386
|
+
};
|
|
387
|
+
}, [s]);
|
|
388
|
+
const N = (I) => {
|
|
389
|
+
f(I), E(null), D(null), P(!1);
|
|
390
|
+
}, Y = async (I) => {
|
|
391
|
+
if (I.preventDefault(), !(A.current || _)) {
|
|
392
|
+
A.current = !0;
|
|
230
393
|
try {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
394
|
+
if (E(null), D(null), l === "signup" && !j) {
|
|
395
|
+
if (!h.trim()) return;
|
|
396
|
+
P(!0);
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
if (l === "signup" && b !== v) {
|
|
400
|
+
E(i("auth.passwords_mismatch", "Passwords don't match"));
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
S("email");
|
|
404
|
+
try {
|
|
405
|
+
l === "signin" ? await s.signInWithEmail({ email: h, password: b }) : l === "signup" ? (await s.signUp({ email: h, password: b })).kind === "confirmation_required" && (w(""), f("signup_verify"), D(i("auth.check_email_message", "Check your email for a confirmation code."))) : l === "forgot" ? (await s.requestPasswordReset({ email: h }), f("reset_sent"), D(
|
|
406
|
+
i("auth.reset_sent_message", "If that email exists, a reset code has been sent.")
|
|
407
|
+
)) : l === "signup_verify" ? await s.verifyOtp({ email: h, token: y, type: "email" }) : l === "reset_verify" && (await s.verifyOtp({
|
|
408
|
+
email: h,
|
|
409
|
+
token: y,
|
|
410
|
+
type: b ? "recovery" : "email"
|
|
411
|
+
}), b && await s.updatePassword({ password: b }));
|
|
412
|
+
} catch (M) {
|
|
413
|
+
E(pe(M, l === "signup" ? "signup" : l === "signup_verify" || l === "reset_verify" ? "otp" : l === "forgot" ? "reset" : "signin", i));
|
|
414
|
+
} finally {
|
|
415
|
+
S(null);
|
|
416
|
+
}
|
|
239
417
|
} finally {
|
|
240
|
-
|
|
418
|
+
A.current = !1;
|
|
241
419
|
}
|
|
242
420
|
}
|
|
243
|
-
},
|
|
244
|
-
if (!
|
|
245
|
-
|
|
421
|
+
}, m = async (I) => {
|
|
422
|
+
if (!(A.current || _)) {
|
|
423
|
+
A.current = !0, S(I), E(null), D(null);
|
|
246
424
|
try {
|
|
247
|
-
await
|
|
248
|
-
provider:
|
|
249
|
-
onPopupOpened: () =>
|
|
425
|
+
await s.signInWithOAuth({
|
|
426
|
+
provider: I,
|
|
427
|
+
onPopupOpened: () => S(null)
|
|
250
428
|
});
|
|
251
|
-
} catch (
|
|
252
|
-
if (
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
} else
|
|
256
|
-
v("Sign-in failed");
|
|
429
|
+
} catch (M) {
|
|
430
|
+
if (M instanceof T && (M.code === "oauth_cancelled" || M.code === "oauth_timeout"))
|
|
431
|
+
return;
|
|
432
|
+
E(pe(M, "signin", i));
|
|
257
433
|
} finally {
|
|
258
|
-
|
|
434
|
+
A.current = !1, S(null);
|
|
259
435
|
}
|
|
260
436
|
}
|
|
261
|
-
};
|
|
262
|
-
return /* @__PURE__ */ u("div", { class: "flex flex-col gap-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
437
|
+
}, g = a.length > 0 && (l === "signin" || l === "signup"), C = l === "signin" || l === "signup" || l === "forgot", K = l === "signin" || l === "signup" && j;
|
|
438
|
+
return /* @__PURE__ */ u("div", { class: "flex flex-col gap-5", children: [
|
|
439
|
+
/* @__PURE__ */ o(ot, { mode: l, customHeading: r.heading, customSubheading: r.subheading }),
|
|
440
|
+
g ? /* @__PURE__ */ u("div", { class: "flex flex-col gap-2.5", children: [
|
|
441
|
+
a.map((I) => /* @__PURE__ */ u("div", { class: "relative", children: [
|
|
442
|
+
/* @__PURE__ */ u(
|
|
443
|
+
"button",
|
|
444
|
+
{
|
|
445
|
+
type: "button",
|
|
446
|
+
onClick: () => m(I),
|
|
447
|
+
disabled: _ !== null,
|
|
448
|
+
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)]",
|
|
449
|
+
children: [
|
|
450
|
+
_ === 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(gt, { provider: I }),
|
|
451
|
+
/* @__PURE__ */ o("span", { children: rt(I, i) })
|
|
452
|
+
]
|
|
453
|
+
}
|
|
454
|
+
),
|
|
455
|
+
L?.method === I ? /* @__PURE__ */ o(ht, { email: L.email }) : null
|
|
456
|
+
] }, I)),
|
|
457
|
+
/* @__PURE__ */ o(ft, {})
|
|
280
458
|
] }) : null,
|
|
281
|
-
/* @__PURE__ */ u("form", { onSubmit:
|
|
282
|
-
|
|
283
|
-
|
|
459
|
+
/* @__PURE__ */ u("form", { onSubmit: Y, class: "flex flex-col gap-3", children: [
|
|
460
|
+
C && /* @__PURE__ */ o(
|
|
461
|
+
fe,
|
|
284
462
|
{
|
|
285
463
|
type: "email",
|
|
286
|
-
|
|
287
|
-
value:
|
|
288
|
-
onInput:
|
|
464
|
+
placeholder: i("auth.email", "Email address"),
|
|
465
|
+
value: h,
|
|
466
|
+
onInput: d,
|
|
289
467
|
autocomplete: "email",
|
|
290
468
|
required: !0
|
|
291
469
|
}
|
|
292
470
|
),
|
|
293
|
-
|
|
294
|
-
|
|
471
|
+
K && /* @__PURE__ */ o(
|
|
472
|
+
te,
|
|
295
473
|
{
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
onInput: b,
|
|
474
|
+
placeholder: i("auth.password", "Password"),
|
|
475
|
+
value: b,
|
|
476
|
+
onInput: w,
|
|
300
477
|
autocomplete: l === "signin" ? "current-password" : "new-password",
|
|
301
478
|
required: !0
|
|
302
479
|
}
|
|
303
480
|
),
|
|
304
|
-
l === "
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
481
|
+
l === "signup" && j && /* @__PURE__ */ o(
|
|
482
|
+
te,
|
|
483
|
+
{
|
|
484
|
+
placeholder: i("auth.repeat_password", "Repeat password"),
|
|
485
|
+
value: v,
|
|
486
|
+
onInput: p,
|
|
487
|
+
autocomplete: "new-password",
|
|
488
|
+
required: !0
|
|
489
|
+
}
|
|
490
|
+
),
|
|
491
|
+
(l === "signup_verify" || l === "reset_verify") && /* @__PURE__ */ o(
|
|
492
|
+
fe,
|
|
493
|
+
{
|
|
494
|
+
type: "text",
|
|
495
|
+
placeholder: i("auth.confirmation_code", "Confirmation code"),
|
|
496
|
+
value: y,
|
|
497
|
+
onInput: O,
|
|
498
|
+
autocomplete: "one-time-code",
|
|
499
|
+
inputMode: "numeric",
|
|
500
|
+
required: !0
|
|
501
|
+
}
|
|
502
|
+
),
|
|
503
|
+
l === "reset_verify" && /* @__PURE__ */ o(
|
|
504
|
+
te,
|
|
505
|
+
{
|
|
506
|
+
placeholder: i(
|
|
507
|
+
"auth.new_password_optional",
|
|
508
|
+
"New password (optional — only for password reset)"
|
|
509
|
+
),
|
|
510
|
+
value: b,
|
|
511
|
+
onInput: w,
|
|
512
|
+
autocomplete: "new-password"
|
|
513
|
+
}
|
|
514
|
+
),
|
|
515
|
+
l === "reset_sent" && U && /* @__PURE__ */ o("p", { class: "rounded-2xl bg-gray-100 px-4 py-3 text-sm text-gray-600", children: U }),
|
|
516
|
+
l === "signin" && t && /* @__PURE__ */ o("div", { class: "flex justify-end text-sm", children: /* @__PURE__ */ o(Z, { onClick: () => N("forgot"), children: i("auth.forgot_password", "Forgot password?") }) }),
|
|
517
|
+
z && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: z }),
|
|
518
|
+
U && l !== "reset_sent" && /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: U }),
|
|
331
519
|
l !== "reset_sent" && /* @__PURE__ */ o(
|
|
332
|
-
|
|
520
|
+
ct,
|
|
333
521
|
{
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
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)]",
|
|
337
|
-
style: {
|
|
338
|
-
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
339
|
-
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
340
|
-
},
|
|
341
|
-
children: y === "email" ? /* @__PURE__ */ o("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : we(l)
|
|
522
|
+
busy: _ === "email",
|
|
523
|
+
label: at(l, j, r.submit_label ?? r.heading, i)
|
|
342
524
|
}
|
|
343
525
|
)
|
|
344
526
|
] }),
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
527
|
+
/* @__PURE__ */ o(
|
|
528
|
+
lt,
|
|
529
|
+
{
|
|
530
|
+
mode: l,
|
|
531
|
+
allowSignup: e,
|
|
532
|
+
onSwitch: N
|
|
533
|
+
}
|
|
534
|
+
)
|
|
535
|
+
] });
|
|
536
|
+
}
|
|
537
|
+
function ot({
|
|
538
|
+
mode: r,
|
|
539
|
+
customHeading: e,
|
|
540
|
+
customSubheading: t
|
|
541
|
+
}) {
|
|
542
|
+
const { t: n } = k(), i = st(r, n), s = r === "signin" || r === "signup", a = s && e ? e : i.title, c = s && t !== void 0 ? t || null : i.subtitle;
|
|
543
|
+
return /* @__PURE__ */ u("div", { class: "flex flex-col gap-2", children: [
|
|
544
|
+
/* @__PURE__ */ o("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: a }),
|
|
545
|
+
c ? /* @__PURE__ */ o("p", { class: "text-base leading-relaxed text-gray-600", children: c }) : null
|
|
352
546
|
] });
|
|
353
547
|
}
|
|
354
|
-
function
|
|
548
|
+
function st(r, e) {
|
|
355
549
|
switch (r) {
|
|
356
550
|
case "signin":
|
|
357
|
-
return
|
|
551
|
+
return {
|
|
552
|
+
title: e("auth.welcome", "Welcome back!"),
|
|
553
|
+
subtitle: e("auth.default_subtitle", "Sign in to access all features and sync your data.")
|
|
554
|
+
};
|
|
358
555
|
case "signup":
|
|
359
|
-
return
|
|
556
|
+
return {
|
|
557
|
+
title: e("auth.welcome_signup", "Welcome!"),
|
|
558
|
+
subtitle: e("auth.default_subtitle", "Sign in to access all features and sync your data.")
|
|
559
|
+
};
|
|
360
560
|
case "forgot":
|
|
361
|
-
return
|
|
561
|
+
return {
|
|
562
|
+
title: e("auth.forgot_password_title", "Forgot password?"),
|
|
563
|
+
subtitle: e(
|
|
564
|
+
"auth.forgot_subtitle",
|
|
565
|
+
"Enter your email and we'll send you a password reset link."
|
|
566
|
+
)
|
|
567
|
+
};
|
|
568
|
+
case "reset_sent":
|
|
569
|
+
return {
|
|
570
|
+
title: e("auth.check_email_title", "Check your email"),
|
|
571
|
+
subtitle: null
|
|
572
|
+
};
|
|
362
573
|
case "reset_verify":
|
|
363
|
-
return
|
|
574
|
+
return {
|
|
575
|
+
title: e("auth.reset_password_title", "Reset password"),
|
|
576
|
+
subtitle: e(
|
|
577
|
+
"auth.reset_password_subtitle",
|
|
578
|
+
"Enter the code from your email and a new password."
|
|
579
|
+
)
|
|
580
|
+
};
|
|
581
|
+
case "signup_verify":
|
|
582
|
+
return {
|
|
583
|
+
title: e("auth.confirm_email_title", "Confirm your email"),
|
|
584
|
+
subtitle: e(
|
|
585
|
+
"auth.confirm_email_subtitle",
|
|
586
|
+
"Enter the code we sent to your email to finish creating your account."
|
|
587
|
+
)
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
function at(r, e, t, n) {
|
|
592
|
+
if (r === "signin" && t) return t;
|
|
593
|
+
switch (r) {
|
|
594
|
+
case "signin":
|
|
595
|
+
return n("auth.log_in", "Sign In");
|
|
596
|
+
case "signup":
|
|
597
|
+
return e ? n("auth.create_account", "Create Account") : n("auth.sign_up", "Sign Up");
|
|
598
|
+
case "forgot":
|
|
599
|
+
return n("auth.send_reset", "Send Reset Email");
|
|
600
|
+
case "signup_verify":
|
|
601
|
+
case "reset_verify":
|
|
602
|
+
return n("auth.verify", "Verify");
|
|
364
603
|
default:
|
|
365
|
-
return "Continue";
|
|
604
|
+
return n("cta.continue", "Continue");
|
|
366
605
|
}
|
|
367
606
|
}
|
|
368
|
-
function
|
|
369
|
-
r
|
|
607
|
+
function lt({
|
|
608
|
+
mode: r,
|
|
609
|
+
allowSignup: e,
|
|
610
|
+
onSwitch: t
|
|
611
|
+
}) {
|
|
612
|
+
const { t: n } = k();
|
|
613
|
+
return r === "signin" && e ? /* @__PURE__ */ u("p", { class: "text-center text-sm text-gray-600", children: [
|
|
614
|
+
n("auth.no_account", "Don't have an account?"),
|
|
615
|
+
" ",
|
|
616
|
+
/* @__PURE__ */ o(Z, { onClick: () => t("signup"), children: n("auth.sign_up_link", "Sign Up") })
|
|
617
|
+
] }) : r === "signup" || r === "signup_verify" ? /* @__PURE__ */ u("p", { class: "text-center text-sm text-gray-600", children: [
|
|
618
|
+
n("auth.have_account", "Already have an account?"),
|
|
619
|
+
" ",
|
|
620
|
+
/* @__PURE__ */ o(Z, { onClick: () => t("signin"), children: n("auth.log_in_link", "Log In") })
|
|
621
|
+
] }) : r === "forgot" || r === "reset_sent" || r === "reset_verify" ? /* @__PURE__ */ u("p", { class: "text-center text-sm text-gray-600", children: [
|
|
622
|
+
n("auth.no_account", "Don't have an account?"),
|
|
623
|
+
" ",
|
|
624
|
+
/* @__PURE__ */ o(Z, { onClick: () => t("signup"), children: n("auth.sign_up_link", "Sign Up") })
|
|
625
|
+
] }) : null;
|
|
626
|
+
}
|
|
627
|
+
function Z({
|
|
628
|
+
onClick: r,
|
|
629
|
+
children: e
|
|
630
|
+
}) {
|
|
631
|
+
return /* @__PURE__ */ o(
|
|
632
|
+
"button",
|
|
633
|
+
{
|
|
634
|
+
type: "button",
|
|
635
|
+
onClick: r,
|
|
636
|
+
class: "font-semibold transition-opacity hover:opacity-80 focus:outline-none focus-visible:opacity-80",
|
|
637
|
+
style: { color: "var(--pw-accent)" },
|
|
638
|
+
children: e
|
|
639
|
+
}
|
|
640
|
+
);
|
|
370
641
|
}
|
|
371
|
-
function
|
|
372
|
-
return /* @__PURE__ */
|
|
373
|
-
|
|
642
|
+
function ct({ busy: r, label: e }) {
|
|
643
|
+
return /* @__PURE__ */ o(
|
|
644
|
+
"button",
|
|
645
|
+
{
|
|
646
|
+
type: "submit",
|
|
647
|
+
disabled: r,
|
|
648
|
+
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)]",
|
|
649
|
+
style: {
|
|
650
|
+
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%)",
|
|
651
|
+
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)"
|
|
652
|
+
},
|
|
653
|
+
children: r ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: e })
|
|
654
|
+
}
|
|
655
|
+
);
|
|
656
|
+
}
|
|
657
|
+
function fe({ type: r, placeholder: e, value: t, onInput: n, autocomplete: i, inputMode: s, required: a }) {
|
|
658
|
+
return /* @__PURE__ */ o(
|
|
659
|
+
"input",
|
|
660
|
+
{
|
|
661
|
+
type: r,
|
|
662
|
+
value: t,
|
|
663
|
+
placeholder: e,
|
|
664
|
+
onInput: (c) => n(c.target.value),
|
|
665
|
+
autocomplete: i,
|
|
666
|
+
inputMode: s,
|
|
667
|
+
required: a,
|
|
668
|
+
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)]"
|
|
669
|
+
}
|
|
670
|
+
);
|
|
671
|
+
}
|
|
672
|
+
function te({ placeholder: r, value: e, onInput: t, autocomplete: n, required: i }) {
|
|
673
|
+
const { t: s } = k(), [a, c] = x(!1), l = R(null);
|
|
674
|
+
B(() => {
|
|
675
|
+
const d = l.current;
|
|
676
|
+
d && d.value !== e && (d.value = e);
|
|
677
|
+
}, [a, e]);
|
|
678
|
+
const f = s("auth.show_password", "Show password"), h = s("auth.hide_password", "Hide password");
|
|
679
|
+
return /* @__PURE__ */ u("div", { class: "relative", children: [
|
|
374
680
|
/* @__PURE__ */ o(
|
|
375
681
|
"input",
|
|
376
682
|
{
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
683
|
+
ref: l,
|
|
684
|
+
type: a ? "text" : "password",
|
|
685
|
+
value: e,
|
|
686
|
+
placeholder: r,
|
|
687
|
+
onInput: (d) => t(d.target.value),
|
|
688
|
+
autocomplete: n,
|
|
689
|
+
required: i,
|
|
690
|
+
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)]"
|
|
691
|
+
}
|
|
692
|
+
),
|
|
693
|
+
/* @__PURE__ */ o(
|
|
694
|
+
"button",
|
|
695
|
+
{
|
|
696
|
+
type: "button",
|
|
697
|
+
onClick: () => c((d) => !d),
|
|
698
|
+
"aria-label": a ? h : f,
|
|
699
|
+
tabIndex: -1,
|
|
700
|
+
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)]",
|
|
701
|
+
children: a ? /* @__PURE__ */ o(dt, {}) : /* @__PURE__ */ o(ut, {})
|
|
384
702
|
}
|
|
385
703
|
)
|
|
386
704
|
] });
|
|
387
705
|
}
|
|
388
|
-
function
|
|
389
|
-
return /* @__PURE__ */ u("
|
|
390
|
-
/* @__PURE__ */ o(
|
|
391
|
-
|
|
392
|
-
|
|
706
|
+
function ut() {
|
|
707
|
+
return /* @__PURE__ */ u("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
708
|
+
/* @__PURE__ */ o(
|
|
709
|
+
"path",
|
|
710
|
+
{
|
|
711
|
+
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",
|
|
712
|
+
stroke: "currentColor",
|
|
713
|
+
"stroke-width": "1.5",
|
|
714
|
+
"stroke-linecap": "round",
|
|
715
|
+
"stroke-linejoin": "round"
|
|
716
|
+
}
|
|
717
|
+
),
|
|
718
|
+
/* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "2.5", stroke: "currentColor", "stroke-width": "1.5" })
|
|
719
|
+
] });
|
|
720
|
+
}
|
|
721
|
+
function dt() {
|
|
722
|
+
return /* @__PURE__ */ u("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
723
|
+
/* @__PURE__ */ o(
|
|
724
|
+
"path",
|
|
725
|
+
{
|
|
726
|
+
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",
|
|
727
|
+
stroke: "currentColor",
|
|
728
|
+
"stroke-width": "1.5",
|
|
729
|
+
"stroke-linecap": "round",
|
|
730
|
+
"stroke-linejoin": "round"
|
|
731
|
+
}
|
|
732
|
+
),
|
|
733
|
+
/* @__PURE__ */ o(
|
|
734
|
+
"path",
|
|
735
|
+
{
|
|
736
|
+
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",
|
|
737
|
+
stroke: "currentColor",
|
|
738
|
+
"stroke-width": "1.5",
|
|
739
|
+
"stroke-linecap": "round",
|
|
740
|
+
"stroke-linejoin": "round"
|
|
741
|
+
}
|
|
742
|
+
)
|
|
743
|
+
] });
|
|
744
|
+
}
|
|
745
|
+
function ht({ email: r }) {
|
|
746
|
+
const { t: e } = k(), t = r ? e("auth.last_used", "Last · {email}", { email: pt(r) }) : e("auth.last_used_no_email", "Last");
|
|
747
|
+
return /* @__PURE__ */ o("span", { class: "pointer-events-none absolute -top-2 right-3 max-w-[75%] truncate rounded-full bg-gray-900 px-2 py-0.5 text-[10px] font-semibold tracking-wide text-white shadow-sm", children: t });
|
|
748
|
+
}
|
|
749
|
+
function pt(r) {
|
|
750
|
+
const [e, t] = r.split("@");
|
|
751
|
+
return t ? `${e.slice(0, 3)}*****@${t}` : r;
|
|
752
|
+
}
|
|
753
|
+
function ft() {
|
|
754
|
+
const { t: r } = k();
|
|
755
|
+
return /* @__PURE__ */ u("div", { class: "flex items-center gap-3 py-1 text-sm text-gray-400", children: [
|
|
756
|
+
/* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gray-200" }),
|
|
757
|
+
/* @__PURE__ */ o("span", { children: r("auth.or", "or") }),
|
|
758
|
+
/* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gray-200" })
|
|
393
759
|
] });
|
|
394
760
|
}
|
|
395
|
-
function
|
|
396
|
-
return r === "google" ? /* @__PURE__ */ u("svg", { width: "
|
|
761
|
+
function gt({ provider: r }) {
|
|
762
|
+
return r === "google" ? /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 18 18", "aria-hidden": "true", children: [
|
|
397
763
|
/* @__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" }),
|
|
398
764
|
/* @__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" }),
|
|
399
765
|
/* @__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" }),
|
|
400
766
|
/* @__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" })
|
|
401
|
-
] }) : r === "apple" ?
|
|
767
|
+
] }) : r === "apple" ? (
|
|
768
|
+
// viewBox 0 0 24 24 даёт воздух сверху/снизу пути, поэтому визуально
|
|
769
|
+
// Apple-яблоко выглядит меньше Google. Компенсируем увеличенным
|
|
770
|
+
// width/height — 26×26 даёт примерно equal optical size с Google 20×20.
|
|
771
|
+
/* @__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" }) })
|
|
772
|
+
) : r === "github" ? /* @__PURE__ */ o("svg", { width: "20", height: "20", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("path", { d: "M8 0C3.6 0 0 3.6 0 8a8 8 0 0 0 5.5 7.6c.4.1.5-.2.5-.4v-1.5c-2.2.5-2.7-1-2.7-1-.4-.9-.9-1.2-.9-1.2-.7-.5.1-.5.1-.5.8.1 1.2.8 1.2.8.7 1.2 1.9.9 2.4.7 0-.5.3-.9.5-1.1-1.8-.2-3.6-.9-3.6-4 0-.9.3-1.6.8-2.1-.1-.2-.4-1 .1-2.1 0 0 .7-.2 2.2.8a7.6 7.6 0 0 1 4 0c1.5-1 2.2-.8 2.2-.8.4 1.1.2 1.9.1 2.1.5.5.8 1.2.8 2.1 0 3.1-1.9 3.7-3.6 3.9.3.3.6.8.6 1.6V15c0 .2.1.5.6.4A8 8 0 0 0 16 8c0-4.4-3.6-8-8-8Z" }) }) : /* @__PURE__ */ o("svg", { width: "18", height: "20", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("path", { d: "M14 2.7C14 1.2 12.8 0 11.3 0H2.7C1.2 0 0 1.2 0 2.7v10.6C0 14.8 1.2 16 2.7 16h4V9.8H4.7v-2H6.7V6.4c0-2 1.2-3.1 3-3.1.9 0 1.7.1 2 .2V5h-1.4c-.8 0-1 .4-1 1v1.5h2.4l-.3 2H9.3V16h2c1.5 0 2.7-1.2 2.7-2.7V2.7Z" }) });
|
|
402
773
|
}
|
|
403
|
-
function
|
|
774
|
+
function mt({
|
|
404
775
|
block: r,
|
|
405
776
|
bootstrap: e,
|
|
406
777
|
auth: t,
|
|
407
778
|
authSession: n,
|
|
408
779
|
onBack: i,
|
|
409
|
-
showBack: s = !0
|
|
780
|
+
showBack: s = !0,
|
|
781
|
+
intent: a = "preauth",
|
|
782
|
+
initialMode: c
|
|
410
783
|
}) {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
784
|
+
const { t: l } = k(), f = {
|
|
785
|
+
bootstrap: e,
|
|
786
|
+
selectedPriceId: null,
|
|
787
|
+
setSelectedPriceId: () => {
|
|
788
|
+
},
|
|
789
|
+
onAction: () => {
|
|
790
|
+
},
|
|
791
|
+
auth: t,
|
|
792
|
+
authSession: n,
|
|
793
|
+
initialAuthMode: c
|
|
794
|
+
}, h = a === "restore" ? {
|
|
795
|
+
...r,
|
|
796
|
+
heading: l("auth.restore_purchases_heading", "Restore Purchases"),
|
|
797
|
+
subheading: l(
|
|
798
|
+
"auth.restore_purchases_subheading",
|
|
799
|
+
"Please sign in to restore your purchases."
|
|
800
|
+
)
|
|
801
|
+
} : a === "preauth" ? {
|
|
802
|
+
...r,
|
|
803
|
+
heading: l("auth.login_continue_purchase", "Log in to continue your purchase"),
|
|
804
|
+
subheading: l(
|
|
805
|
+
"auth.link_purchase_subheading",
|
|
806
|
+
"We'll link the purchase to your account to keep access."
|
|
807
|
+
),
|
|
808
|
+
// Preauth heading — descriptive sentence ("Log in to continue your
|
|
809
|
+
// purchase"), а не action verb. Длинные локализации (RU: "Войдите,
|
|
810
|
+
// чтобы продолжить покупку") в pill-кнопку h-12 не помещаются и
|
|
811
|
+
// переносятся на 2 строки. Явный короткий submit_label решает.
|
|
812
|
+
submit_label: l("auth.log_in", "Sign In")
|
|
813
|
+
} : r;
|
|
814
|
+
return /* @__PURE__ */ u("div", { class: "relative flex-1 min-h-0 overflow-y-auto p-6 sm:p-8", children: [
|
|
815
|
+
s ? /* @__PURE__ */ o(yt, { onClick: i, ariaLabel: l("nav.back_aria", "Back") }) : null,
|
|
816
|
+
/* @__PURE__ */ o(Le, { block: h, ctx: f })
|
|
431
817
|
] });
|
|
432
818
|
}
|
|
433
|
-
function
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
819
|
+
function yt({ onClick: r, ariaLabel: e }) {
|
|
820
|
+
return /* @__PURE__ */ o(
|
|
821
|
+
"button",
|
|
822
|
+
{
|
|
823
|
+
type: "button",
|
|
824
|
+
onClick: r,
|
|
825
|
+
"aria-label": e,
|
|
826
|
+
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)]",
|
|
827
|
+
children: /* @__PURE__ */ u("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
828
|
+
/* @__PURE__ */ o(
|
|
829
|
+
"path",
|
|
830
|
+
{
|
|
831
|
+
d: "M5 8h8a4 4 0 0 1 0 8H9",
|
|
832
|
+
stroke: "currentColor",
|
|
833
|
+
"stroke-width": "1.75",
|
|
834
|
+
"stroke-linecap": "round",
|
|
835
|
+
"stroke-linejoin": "round"
|
|
836
|
+
}
|
|
837
|
+
),
|
|
838
|
+
/* @__PURE__ */ o(
|
|
839
|
+
"path",
|
|
840
|
+
{
|
|
841
|
+
d: "M8 4 4 8l4 4",
|
|
842
|
+
stroke: "currentColor",
|
|
843
|
+
"stroke-width": "1.75",
|
|
844
|
+
"stroke-linecap": "round",
|
|
845
|
+
"stroke-linejoin": "round"
|
|
846
|
+
}
|
|
847
|
+
)
|
|
848
|
+
] })
|
|
849
|
+
}
|
|
850
|
+
);
|
|
851
|
+
}
|
|
852
|
+
const Me = (r) => `pw-offer-${r}-start`;
|
|
853
|
+
function re(r) {
|
|
854
|
+
const e = r - Date.now();
|
|
855
|
+
return e <= 0 ? { days: 0, hours: 0, minutes: 0, seconds: 0, expired: !0 } : {
|
|
856
|
+
days: Math.floor(e / (1e3 * 60 * 60 * 24)),
|
|
857
|
+
hours: Math.floor(e % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)),
|
|
858
|
+
minutes: Math.floor(e % (1e3 * 60 * 60) / (1e3 * 60)),
|
|
859
|
+
seconds: Math.floor(e % (1e3 * 60) / 1e3),
|
|
860
|
+
expired: !1
|
|
458
861
|
};
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
862
|
+
}
|
|
863
|
+
function xt(r) {
|
|
864
|
+
if (r.expires_at) {
|
|
865
|
+
const e = Date.parse(r.expires_at);
|
|
866
|
+
return Number.isFinite(e) ? e : null;
|
|
867
|
+
}
|
|
868
|
+
if (r.duration_minutes && r.duration_minutes > 0) {
|
|
869
|
+
if (typeof window > "u") return null;
|
|
870
|
+
try {
|
|
871
|
+
const e = Me(r.id);
|
|
872
|
+
let t = window.localStorage.getItem(e);
|
|
873
|
+
return t || (t = (/* @__PURE__ */ new Date()).toISOString(), window.localStorage.setItem(e, t)), Date.parse(t) + r.duration_minutes * 6e4;
|
|
874
|
+
} catch {
|
|
875
|
+
return null;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
return null;
|
|
879
|
+
}
|
|
880
|
+
function Ee(r, e) {
|
|
881
|
+
if (!r || r.length === 0) return null;
|
|
882
|
+
if (e) {
|
|
883
|
+
const t = r.find((n) => n.id === e);
|
|
884
|
+
if (t) return t;
|
|
885
|
+
}
|
|
886
|
+
return r.find((t) => t.expires_at || t.duration_minutes) ?? null;
|
|
887
|
+
}
|
|
888
|
+
function Pe(r) {
|
|
889
|
+
const e = r ? xt(r) : null, [t, n] = x(
|
|
890
|
+
() => e !== null ? re(e) : null
|
|
891
|
+
), i = R(e);
|
|
892
|
+
return i.current = e, B(() => {
|
|
893
|
+
if (e === null) {
|
|
894
|
+
n(null);
|
|
895
|
+
return;
|
|
896
|
+
}
|
|
897
|
+
n(re(e));
|
|
898
|
+
const s = setInterval(() => {
|
|
899
|
+
const a = re(i.current ?? 0);
|
|
900
|
+
if (n(a), a.expired && (clearInterval(s), r?.duration_minutes && typeof window < "u"))
|
|
901
|
+
try {
|
|
902
|
+
window.localStorage.removeItem(Me(r.id));
|
|
903
|
+
} catch {
|
|
485
904
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
]
|
|
905
|
+
}, 1e3);
|
|
906
|
+
return () => clearInterval(s);
|
|
907
|
+
}, [e, r?.duration_minutes, r?.id]), t;
|
|
908
|
+
}
|
|
909
|
+
function bt({ block: r, ctx: e }) {
|
|
910
|
+
const { t } = k(), n = Ee(e.bootstrap.offers, r.offer_id), i = Pe(n);
|
|
911
|
+
if (!n || i === null || i.expired && !r.force) return null;
|
|
912
|
+
const s = r.title ?? n.label ?? t("offer.limited_time", "Limited-time offer"), a = n.discount_percent ? `${s} ${n.discount_percent}%` : s;
|
|
913
|
+
return /* @__PURE__ */ u(
|
|
914
|
+
"div",
|
|
915
|
+
{
|
|
916
|
+
class: "flex flex-wrap items-center justify-center gap-2 rounded-2xl px-4 py-3 text-[15px] font-semibold leading-tight text-white",
|
|
917
|
+
style: {
|
|
918
|
+
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%)",
|
|
919
|
+
textShadow: "0 0 2px rgba(0, 0, 0, 0.25)"
|
|
920
|
+
},
|
|
921
|
+
role: "status",
|
|
922
|
+
children: [
|
|
923
|
+
/* @__PURE__ */ o(Be, {}),
|
|
924
|
+
/* @__PURE__ */ o("span", { children: a }),
|
|
925
|
+
/* @__PURE__ */ o(Te, { value: i, t })
|
|
926
|
+
]
|
|
927
|
+
}
|
|
928
|
+
);
|
|
489
929
|
}
|
|
490
|
-
function
|
|
491
|
-
return /* @__PURE__ */ u("
|
|
492
|
-
/* @__PURE__ */
|
|
493
|
-
|
|
930
|
+
function Te({ value: r, t: e }) {
|
|
931
|
+
return /* @__PURE__ */ u("div", { class: "flex items-center gap-1 font-mono text-sm", children: [
|
|
932
|
+
r.days > 0 ? /* @__PURE__ */ u(se, { children: [
|
|
933
|
+
/* @__PURE__ */ o($, { children: String(r.days) }),
|
|
934
|
+
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.d", "d") })
|
|
935
|
+
] }) : null,
|
|
936
|
+
/* @__PURE__ */ o($, { children: String(r.hours).padStart(2, "0") }),
|
|
937
|
+
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.h", "h") }),
|
|
938
|
+
/* @__PURE__ */ o($, { children: String(r.minutes).padStart(2, "0") }),
|
|
939
|
+
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.m", "m") }),
|
|
940
|
+
/* @__PURE__ */ o($, { children: String(r.seconds).padStart(2, "0") }),
|
|
941
|
+
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.s", "s") })
|
|
494
942
|
] });
|
|
495
943
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
944
|
+
function $({ children: r }) {
|
|
945
|
+
return /* @__PURE__ */ o("span", { class: "rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold", children: r });
|
|
946
|
+
}
|
|
947
|
+
function wt({ offer: r }) {
|
|
948
|
+
const { t: e } = k(), t = Pe(r);
|
|
949
|
+
if (t === null || t.expired) return null;
|
|
950
|
+
const n = r.label ?? e("offer.limited_time", "Limited-time offer"), i = r.discount_percent ? `${n} ${r.discount_percent}%` : n;
|
|
951
|
+
return /* @__PURE__ */ u(
|
|
952
|
+
"div",
|
|
953
|
+
{
|
|
954
|
+
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",
|
|
955
|
+
style: {
|
|
956
|
+
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%)",
|
|
957
|
+
textShadow: "0 0 2px rgba(0, 0, 0, 0.25)"
|
|
958
|
+
},
|
|
959
|
+
role: "status",
|
|
960
|
+
children: [
|
|
961
|
+
/* @__PURE__ */ o(Be, {}),
|
|
962
|
+
/* @__PURE__ */ o("span", { children: i }),
|
|
963
|
+
/* @__PURE__ */ o(Te, { value: t, t: e })
|
|
964
|
+
]
|
|
965
|
+
}
|
|
966
|
+
);
|
|
967
|
+
}
|
|
968
|
+
function Be() {
|
|
969
|
+
return /* @__PURE__ */ o(
|
|
970
|
+
"svg",
|
|
971
|
+
{
|
|
972
|
+
width: "16",
|
|
973
|
+
height: "16",
|
|
974
|
+
viewBox: "0 0 12 12",
|
|
975
|
+
fill: "none",
|
|
976
|
+
"aria-hidden": "true",
|
|
977
|
+
children: /* @__PURE__ */ o(
|
|
978
|
+
"path",
|
|
979
|
+
{
|
|
980
|
+
fill: "currentColor",
|
|
981
|
+
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"
|
|
982
|
+
}
|
|
983
|
+
)
|
|
984
|
+
}
|
|
985
|
+
);
|
|
986
|
+
}
|
|
987
|
+
const ge = 3, me = 200, ye = 5e3, ne = 5, kt = 10 * 1024 * 1024, xe = ["image/jpeg", "image/png", "image/webp"], vt = /.+@.+\..+/;
|
|
988
|
+
function _t({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
989
|
+
const { t: i } = k(), s = e?.user.email ?? "", a = s || null, [c, l] = x(s), [f, h] = x(""), [d, b] = x(""), [w, v] = x([]), [p, y] = x(!1), [O, _] = x(null), [S, A] = x({}), z = () => {
|
|
990
|
+
const P = {}, L = (a ?? c).trim(), q = f.trim(), N = d.trim();
|
|
991
|
+
return L ? vt.test(L.toLowerCase()) || (P.email = i("support.invalid_email", "Invalid email")) : P.email = i("support.required", "Required"), (q.length < ge || q.length > me) && (P.subject = i("support.subject_length", "{min}–{max} characters", {
|
|
992
|
+
min: ge,
|
|
993
|
+
max: me
|
|
994
|
+
})), (N.length < 1 || N.length > ye) && (P.message = i("support.message_length", "{min}–{max} characters", {
|
|
995
|
+
min: 1,
|
|
996
|
+
max: ye
|
|
997
|
+
})), A(P), Object.keys(P).length === 0;
|
|
998
|
+
}, E = async (P) => {
|
|
999
|
+
if (P.preventDefault(), !p && z()) {
|
|
1000
|
+
y(!0), A((L) => ({ ...L, submit: void 0 }));
|
|
507
1001
|
try {
|
|
508
|
-
const
|
|
1002
|
+
const L = (a ?? c).trim();
|
|
509
1003
|
await r.createSupportTicket({
|
|
510
|
-
subject:
|
|
511
|
-
content:
|
|
512
|
-
email:
|
|
513
|
-
files:
|
|
514
|
-
}),
|
|
515
|
-
} catch (
|
|
516
|
-
const
|
|
517
|
-
|
|
1004
|
+
subject: f.trim(),
|
|
1005
|
+
content: d.trim(),
|
|
1006
|
+
email: L || void 0,
|
|
1007
|
+
files: w.length > 0 ? w : void 0
|
|
1008
|
+
}), _(L);
|
|
1009
|
+
} catch (L) {
|
|
1010
|
+
const q = L instanceof T && L.message || "Failed to send. Please try again.";
|
|
1011
|
+
A((N) => ({ ...N, submit: q }));
|
|
518
1012
|
} finally {
|
|
519
|
-
|
|
1013
|
+
y(!1);
|
|
520
1014
|
}
|
|
521
1015
|
}
|
|
522
|
-
},
|
|
523
|
-
|
|
524
|
-
};
|
|
525
|
-
return
|
|
526
|
-
/* @__PURE__ */
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
"
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
"
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
1016
|
+
}, U = () => {
|
|
1017
|
+
h(""), b(""), v([]), A({}), _(null);
|
|
1018
|
+
}, D = "flex flex-col gap-3 bg-white px-6 pb-6 pt-3 sm:px-8", j = { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" };
|
|
1019
|
+
return O ? /* @__PURE__ */ u("div", { class: "relative flex-1 min-h-0 flex flex-col", children: [
|
|
1020
|
+
/* @__PURE__ */ u("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: [
|
|
1021
|
+
/* @__PURE__ */ o(
|
|
1022
|
+
"div",
|
|
1023
|
+
{
|
|
1024
|
+
class: "flex h-14 w-14 items-center justify-center rounded-full",
|
|
1025
|
+
style: {
|
|
1026
|
+
background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 85%, white), var(--pw-accent))",
|
|
1027
|
+
color: "#fff",
|
|
1028
|
+
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)"
|
|
1029
|
+
},
|
|
1030
|
+
"aria-hidden": "true",
|
|
1031
|
+
children: /* @__PURE__ */ o("svg", { viewBox: "0 0 24 24", class: "h-7 w-7", children: /* @__PURE__ */ o(
|
|
1032
|
+
"path",
|
|
1033
|
+
{
|
|
1034
|
+
fill: "currentColor",
|
|
1035
|
+
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"
|
|
1036
|
+
}
|
|
1037
|
+
) })
|
|
1038
|
+
}
|
|
1039
|
+
),
|
|
1040
|
+
/* @__PURE__ */ o("div", { class: "text-lg font-semibold tracking-tight text-gray-900", children: i("support.success_heading", "Request submitted") }),
|
|
1041
|
+
/* @__PURE__ */ u("div", { class: "max-w-[320px] text-sm leading-relaxed text-gray-500", children: [
|
|
1042
|
+
i(
|
|
1043
|
+
"support.success_message_prefix",
|
|
1044
|
+
"We've received your message and will respond to"
|
|
1045
|
+
),
|
|
1046
|
+
" ",
|
|
1047
|
+
/* @__PURE__ */ o("b", { class: "text-gray-700", children: O }),
|
|
1048
|
+
"."
|
|
1049
|
+
] })
|
|
551
1050
|
] }),
|
|
552
|
-
/* @__PURE__ */ u("div", { class: "
|
|
1051
|
+
/* @__PURE__ */ o("div", { class: D, style: j, children: /* @__PURE__ */ u("div", { class: "flex items-center justify-center gap-3", children: [
|
|
553
1052
|
/* @__PURE__ */ o(
|
|
554
1053
|
"button",
|
|
555
1054
|
{
|
|
556
1055
|
type: "button",
|
|
557
1056
|
onClick: n,
|
|
558
1057
|
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)]",
|
|
559
|
-
children: t === "standalone" ? "Done" : "Back"
|
|
1058
|
+
children: t === "standalone" ? i("support.done_button", "Done") : i("nav.back_aria", "Back")
|
|
560
1059
|
}
|
|
561
1060
|
),
|
|
562
1061
|
/* @__PURE__ */ o(
|
|
563
1062
|
"button",
|
|
564
1063
|
{
|
|
565
1064
|
type: "button",
|
|
566
|
-
onClick:
|
|
1065
|
+
onClick: U,
|
|
567
1066
|
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)]",
|
|
568
1067
|
style: {
|
|
569
1068
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
570
1069
|
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
571
1070
|
},
|
|
572
|
-
children: "Send another request"
|
|
1071
|
+
children: i("support.send_another", "Send another request")
|
|
573
1072
|
}
|
|
574
1073
|
)
|
|
575
|
-
] })
|
|
576
|
-
] }) : /* @__PURE__ */ u("
|
|
577
|
-
/* @__PURE__ */ o(
|
|
578
|
-
|
|
579
|
-
{
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
),
|
|
628
|
-
/* @__PURE__ */ o(Ee, { files: f, onChange: m, disabled: y }),
|
|
629
|
-
S.submit && /* @__PURE__ */ o("p", { class: "text-xs text-red-600", children: S.submit }),
|
|
630
|
-
/* @__PURE__ */ u("div", { class: "mt-1 flex items-center justify-end gap-2", children: [
|
|
1074
|
+
] }) })
|
|
1075
|
+
] }) : /* @__PURE__ */ u("form", { onSubmit: E, class: "relative flex-1 min-h-0 flex flex-col", children: [
|
|
1076
|
+
/* @__PURE__ */ o(St, { onClick: n, ariaLabel: i("nav.back_aria", "Back") }),
|
|
1077
|
+
/* @__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__ */ u("div", { class: "flex flex-col gap-5", children: [
|
|
1078
|
+
/* @__PURE__ */ u("div", { class: "flex flex-col gap-2 pr-10", children: [
|
|
1079
|
+
/* @__PURE__ */ o("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: i("support.heading", "Support") }),
|
|
1080
|
+
/* @__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.") })
|
|
1081
|
+
] }),
|
|
1082
|
+
/* @__PURE__ */ u("div", { class: "flex flex-col gap-3", children: [
|
|
1083
|
+
a ? /* @__PURE__ */ u("div", { class: "rounded-2xl bg-gray-100 px-5 py-3 text-sm text-gray-600", children: [
|
|
1084
|
+
i("support.sending_as", "Sending as"),
|
|
1085
|
+
" ",
|
|
1086
|
+
/* @__PURE__ */ o("b", { class: "font-medium text-gray-900", children: a })
|
|
1087
|
+
] }) : /* @__PURE__ */ o(
|
|
1088
|
+
be,
|
|
1089
|
+
{
|
|
1090
|
+
type: "email",
|
|
1091
|
+
placeholder: i("support.email_placeholder", "Enter your email *"),
|
|
1092
|
+
value: c,
|
|
1093
|
+
onInput: l,
|
|
1094
|
+
error: S.email,
|
|
1095
|
+
autocomplete: "email",
|
|
1096
|
+
required: !0
|
|
1097
|
+
}
|
|
1098
|
+
),
|
|
1099
|
+
/* @__PURE__ */ o(
|
|
1100
|
+
be,
|
|
1101
|
+
{
|
|
1102
|
+
type: "text",
|
|
1103
|
+
placeholder: i("support.subject_placeholder", "Enter your subject *"),
|
|
1104
|
+
value: f,
|
|
1105
|
+
onInput: h,
|
|
1106
|
+
error: S.subject,
|
|
1107
|
+
required: !0
|
|
1108
|
+
}
|
|
1109
|
+
),
|
|
1110
|
+
/* @__PURE__ */ o(
|
|
1111
|
+
Ct,
|
|
1112
|
+
{
|
|
1113
|
+
placeholder: i("support.message_placeholder", "Enter your message *"),
|
|
1114
|
+
value: d,
|
|
1115
|
+
onInput: b,
|
|
1116
|
+
error: S.message,
|
|
1117
|
+
required: !0
|
|
1118
|
+
}
|
|
1119
|
+
),
|
|
1120
|
+
/* @__PURE__ */ o(It, { files: w, onChange: v, disabled: p })
|
|
1121
|
+
] })
|
|
1122
|
+
] }) }),
|
|
1123
|
+
/* @__PURE__ */ u("div", { class: D, style: j, children: [
|
|
1124
|
+
S.submit && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: S.submit }),
|
|
1125
|
+
/* @__PURE__ */ u("div", { class: "flex items-center justify-end gap-3", children: [
|
|
631
1126
|
/* @__PURE__ */ o(
|
|
632
1127
|
"button",
|
|
633
1128
|
{
|
|
634
1129
|
type: "button",
|
|
635
1130
|
onClick: n,
|
|
636
|
-
disabled:
|
|
637
|
-
class: "rounded-
|
|
638
|
-
children: t === "standalone" ? "Close" : "Back"
|
|
1131
|
+
disabled: p,
|
|
1132
|
+
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)]",
|
|
1133
|
+
children: t === "standalone" ? i("support.close_button", "Close") : i("nav.back_aria", "Back")
|
|
639
1134
|
}
|
|
640
1135
|
),
|
|
641
1136
|
/* @__PURE__ */ o(
|
|
642
1137
|
"button",
|
|
643
1138
|
{
|
|
644
1139
|
type: "submit",
|
|
645
|
-
disabled:
|
|
646
|
-
class: "flex h-
|
|
1140
|
+
disabled: p,
|
|
1141
|
+
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)]",
|
|
647
1142
|
style: {
|
|
648
|
-
background: "linear-gradient(
|
|
649
|
-
boxShadow: "0
|
|
1143
|
+
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%)",
|
|
1144
|
+
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)"
|
|
650
1145
|
},
|
|
651
|
-
children:
|
|
1146
|
+
children: p ? /* @__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") })
|
|
652
1147
|
}
|
|
653
1148
|
)
|
|
654
1149
|
] })
|
|
655
1150
|
] })
|
|
656
1151
|
] });
|
|
657
1152
|
}
|
|
658
|
-
function
|
|
659
|
-
return /* @__PURE__ */
|
|
660
|
-
|
|
1153
|
+
function St({ onClick: r, ariaLabel: e }) {
|
|
1154
|
+
return /* @__PURE__ */ o(
|
|
1155
|
+
"button",
|
|
1156
|
+
{
|
|
1157
|
+
type: "button",
|
|
1158
|
+
onClick: r,
|
|
1159
|
+
"aria-label": e,
|
|
1160
|
+
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)]",
|
|
1161
|
+
children: /* @__PURE__ */ u("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1162
|
+
/* @__PURE__ */ o(
|
|
1163
|
+
"path",
|
|
1164
|
+
{
|
|
1165
|
+
d: "M5 8h8a4 4 0 0 1 0 8H9",
|
|
1166
|
+
stroke: "currentColor",
|
|
1167
|
+
"stroke-width": "1.75",
|
|
1168
|
+
"stroke-linecap": "round",
|
|
1169
|
+
"stroke-linejoin": "round"
|
|
1170
|
+
}
|
|
1171
|
+
),
|
|
1172
|
+
/* @__PURE__ */ o(
|
|
1173
|
+
"path",
|
|
1174
|
+
{
|
|
1175
|
+
d: "M8 4 4 8l4 4",
|
|
1176
|
+
stroke: "currentColor",
|
|
1177
|
+
"stroke-width": "1.75",
|
|
1178
|
+
"stroke-linecap": "round",
|
|
1179
|
+
"stroke-linejoin": "round"
|
|
1180
|
+
}
|
|
1181
|
+
)
|
|
1182
|
+
] })
|
|
1183
|
+
}
|
|
1184
|
+
);
|
|
1185
|
+
}
|
|
1186
|
+
function be({
|
|
1187
|
+
type: r,
|
|
1188
|
+
placeholder: e,
|
|
1189
|
+
value: t,
|
|
1190
|
+
onInput: n,
|
|
1191
|
+
error: i,
|
|
1192
|
+
autocomplete: s,
|
|
1193
|
+
required: a
|
|
1194
|
+
}) {
|
|
1195
|
+
return /* @__PURE__ */ u("div", { children: [
|
|
661
1196
|
/* @__PURE__ */ o(
|
|
662
1197
|
"input",
|
|
663
1198
|
{
|
|
664
1199
|
type: r,
|
|
665
1200
|
value: t,
|
|
666
|
-
|
|
1201
|
+
placeholder: e,
|
|
1202
|
+
onInput: (c) => n(c.target.value),
|
|
667
1203
|
autocomplete: s,
|
|
668
|
-
required:
|
|
669
|
-
class: `h-
|
|
1204
|
+
required: a,
|
|
1205
|
+
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)]"}`
|
|
670
1206
|
}
|
|
671
1207
|
),
|
|
672
|
-
i && /* @__PURE__ */ o("span", { class: "text-
|
|
1208
|
+
i && /* @__PURE__ */ o("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: i })
|
|
673
1209
|
] });
|
|
674
1210
|
}
|
|
675
|
-
function
|
|
676
|
-
|
|
677
|
-
|
|
1211
|
+
function Ct({
|
|
1212
|
+
placeholder: r,
|
|
1213
|
+
value: e,
|
|
1214
|
+
onInput: t,
|
|
1215
|
+
error: n,
|
|
1216
|
+
required: i
|
|
1217
|
+
}) {
|
|
1218
|
+
return /* @__PURE__ */ u("div", { children: [
|
|
678
1219
|
/* @__PURE__ */ o(
|
|
679
1220
|
"textarea",
|
|
680
1221
|
{
|
|
681
1222
|
value: e,
|
|
1223
|
+
placeholder: r,
|
|
682
1224
|
onInput: (s) => t(s.target.value),
|
|
683
1225
|
required: i,
|
|
684
|
-
rows:
|
|
685
|
-
class: `min-h-[
|
|
1226
|
+
rows: 5,
|
|
1227
|
+
class: `min-h-[120px] w-full rounded-2xl bg-gray-100 px-5 py-3.5 text-base leading-relaxed text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 ${n ? "shadow-[0_0_0_2px_rgba(239,68,68,0.5)]" : "focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"}`
|
|
686
1228
|
}
|
|
687
1229
|
),
|
|
688
|
-
n && /* @__PURE__ */ o("span", { class: "text-
|
|
1230
|
+
n && /* @__PURE__ */ o("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: n })
|
|
689
1231
|
] });
|
|
690
1232
|
}
|
|
691
|
-
function
|
|
692
|
-
const n =
|
|
693
|
-
if (!
|
|
694
|
-
|
|
695
|
-
const
|
|
696
|
-
if (r.length +
|
|
697
|
-
|
|
1233
|
+
function It({ files: r, onChange: e, disabled: t }) {
|
|
1234
|
+
const { t: n } = k(), i = R(null), [s, a] = x(!1), [c, l] = x(null), f = (h) => {
|
|
1235
|
+
if (!h || t) return;
|
|
1236
|
+
l(null);
|
|
1237
|
+
const d = Array.from(h);
|
|
1238
|
+
if (r.length + d.length > ne) {
|
|
1239
|
+
l(n("support.too_many_files", "Up to {max} files", { max: ne }));
|
|
698
1240
|
return;
|
|
699
1241
|
}
|
|
700
|
-
const b =
|
|
701
|
-
(
|
|
1242
|
+
const b = d.filter(
|
|
1243
|
+
(w) => xe.includes(w.type) && w.size <= kt
|
|
702
1244
|
);
|
|
703
|
-
if (b.length !==
|
|
704
|
-
|
|
1245
|
+
if (b.length !== d.length) {
|
|
1246
|
+
l(n("support.invalid_file", "Only JPEG/PNG/WebP, ≤ 10MB each"));
|
|
705
1247
|
return;
|
|
706
1248
|
}
|
|
707
1249
|
e([...r, ...b]);
|
|
708
1250
|
};
|
|
709
1251
|
return /* @__PURE__ */ u("div", { children: [
|
|
710
|
-
/* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: "Attachments (optional)" }),
|
|
1252
|
+
/* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: n("support.attachments_label", "Attachments (optional)") }),
|
|
711
1253
|
/* @__PURE__ */ u(
|
|
712
1254
|
"div",
|
|
713
1255
|
{
|
|
714
1256
|
role: "button",
|
|
715
1257
|
tabIndex: 0,
|
|
716
|
-
"aria-label": "Attachments upload",
|
|
717
|
-
onClick: () => !t &&
|
|
718
|
-
onDragOver: (
|
|
719
|
-
|
|
1258
|
+
"aria-label": n("support.attachments_aria", "Attachments upload"),
|
|
1259
|
+
onClick: () => !t && i.current?.click(),
|
|
1260
|
+
onDragOver: (h) => {
|
|
1261
|
+
h.preventDefault(), t || a(!0);
|
|
720
1262
|
},
|
|
721
|
-
onDragLeave: () =>
|
|
722
|
-
onDrop: (
|
|
723
|
-
|
|
1263
|
+
onDragLeave: () => a(!1),
|
|
1264
|
+
onDrop: (h) => {
|
|
1265
|
+
h.preventDefault(), a(!1), f(h.dataTransfer?.files ?? null);
|
|
724
1266
|
},
|
|
725
|
-
class: `mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${
|
|
1267
|
+
class: `mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${s ? "border-[var(--pw-accent)] bg-[color-mix(in_srgb,var(--pw-accent)_6%,white)]" : "border-gray-300 hover:border-gray-400 hover:bg-gray-50/60"} ${t ? "cursor-not-allowed opacity-60" : ""}`,
|
|
726
1268
|
children: [
|
|
727
|
-
/* @__PURE__ */ o("div", { class: "text-xs text-gray-500", children: "Drop images here or click to select" }),
|
|
728
|
-
/* @__PURE__ */
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
" files, ≤ 10MB each"
|
|
732
|
-
] })
|
|
1269
|
+
/* @__PURE__ */ o("div", { class: "text-xs text-gray-500", children: n("support.dropzone_text", "Drop images here or click to select") }),
|
|
1270
|
+
/* @__PURE__ */ o("div", { class: "mt-0.5 text-[11px] text-gray-400", children: n("support.file_requirements", "JPEG/PNG/WebP, up to {max} files, ≤ 10MB each", {
|
|
1271
|
+
max: ne
|
|
1272
|
+
}) })
|
|
733
1273
|
]
|
|
734
1274
|
}
|
|
735
1275
|
),
|
|
736
1276
|
/* @__PURE__ */ o(
|
|
737
1277
|
"input",
|
|
738
1278
|
{
|
|
739
|
-
ref:
|
|
1279
|
+
ref: i,
|
|
740
1280
|
type: "file",
|
|
741
1281
|
multiple: !0,
|
|
742
|
-
accept:
|
|
1282
|
+
accept: xe.join(","),
|
|
743
1283
|
class: "hidden",
|
|
744
|
-
onChange: (
|
|
745
|
-
|
|
1284
|
+
onChange: (h) => {
|
|
1285
|
+
f(h.target.files), h.currentTarget.value = "";
|
|
746
1286
|
}
|
|
747
1287
|
}
|
|
748
1288
|
),
|
|
749
|
-
|
|
750
|
-
r.length > 0 && /* @__PURE__ */ o("ul", { class: "mt-2 flex flex-col gap-1", children: r.map((
|
|
1289
|
+
c && /* @__PURE__ */ o("p", { class: "mt-1 text-xs text-red-600", children: c }),
|
|
1290
|
+
r.length > 0 && /* @__PURE__ */ o("ul", { class: "mt-2 flex flex-col gap-1", children: r.map((h, d) => /* @__PURE__ */ u(
|
|
751
1291
|
"li",
|
|
752
1292
|
{
|
|
753
1293
|
class: "flex items-center justify-between gap-2 rounded bg-gray-50 px-2 py-1 text-xs",
|
|
754
1294
|
children: [
|
|
755
|
-
/* @__PURE__ */ o("span", { class: "truncate text-gray-700", children:
|
|
1295
|
+
/* @__PURE__ */ o("span", { class: "truncate text-gray-700", children: h.name }),
|
|
756
1296
|
/* @__PURE__ */ o(
|
|
757
1297
|
"button",
|
|
758
1298
|
{
|
|
759
1299
|
type: "button",
|
|
760
1300
|
onClick: () => {
|
|
761
1301
|
const b = [...r];
|
|
762
|
-
b.splice(
|
|
1302
|
+
b.splice(d, 1), e(b);
|
|
763
1303
|
},
|
|
764
1304
|
disabled: t,
|
|
765
1305
|
class: "text-gray-500 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-60",
|
|
766
|
-
"aria-label":
|
|
1306
|
+
"aria-label": n("support.remove_file_aria", "Remove {filename}", { filename: h.name }),
|
|
767
1307
|
children: "✕"
|
|
768
1308
|
}
|
|
769
1309
|
)
|
|
770
1310
|
]
|
|
771
1311
|
},
|
|
772
|
-
`${
|
|
1312
|
+
`${h.name}-${h.size}-${d}`
|
|
773
1313
|
)) })
|
|
774
1314
|
] });
|
|
775
1315
|
}
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
1316
|
+
const At = {
|
|
1317
|
+
day: "cta.get_plan_daily",
|
|
1318
|
+
week: "cta.get_plan_weekly",
|
|
1319
|
+
month: "cta.get_plan_monthly",
|
|
1320
|
+
year: "cta.get_plan_yearly"
|
|
1321
|
+
}, Lt = {
|
|
1322
|
+
day: "Get Daily Plan",
|
|
1323
|
+
week: "Get Weekly Plan",
|
|
1324
|
+
month: "Get Monthly Plan",
|
|
1325
|
+
year: "Get Yearly Plan"
|
|
1326
|
+
};
|
|
1327
|
+
function Mt(r, e, t, n) {
|
|
1328
|
+
if (e === "close") return n("cta.close", "Close");
|
|
1329
|
+
if (!r) return n("cta.continue", "Continue");
|
|
1330
|
+
if (!t && r.trial_days && r.interval && r.interval !== "lifetime")
|
|
1331
|
+
return n("cta.start_trial", "Start {days}-Day Free Trial", { days: r.trial_days });
|
|
1332
|
+
if (!r.interval || r.interval === "lifetime")
|
|
1333
|
+
return n("cta.get_lifetime_access", "Get Lifetime Access");
|
|
1334
|
+
const i = At[r.interval];
|
|
1335
|
+
return i ? n(i, Lt[r.interval]) : n("cta.get_plan_generic", "Get {interval} Plan", {
|
|
1336
|
+
interval: Et(r.interval)
|
|
1337
|
+
});
|
|
1338
|
+
}
|
|
1339
|
+
function Et(r) {
|
|
1340
|
+
return r.length ? r[0].toUpperCase() + r.slice(1) : r;
|
|
1341
|
+
}
|
|
1342
|
+
function Pt({ block: r, ctx: e }) {
|
|
1343
|
+
const { t } = k(), [n, i] = x(!1), s = r.priceId ?? e.selectedPriceId, a = n || r.action === "checkout" && !s, c = s ? e.bootstrap.prices.find((d) => d.id === s) ?? null : null, l = e.bootstrap.user?.had_previous_trial ?? !1, f = r.label ?? Mt(c, r.action, l, t);
|
|
1344
|
+
return /* @__PURE__ */ u(
|
|
779
1345
|
"button",
|
|
780
1346
|
{
|
|
781
1347
|
type: "button",
|
|
782
|
-
disabled:
|
|
1348
|
+
disabled: a,
|
|
783
1349
|
onClick: async () => {
|
|
784
|
-
if (!
|
|
785
|
-
|
|
1350
|
+
if (!a) {
|
|
1351
|
+
i(!0);
|
|
786
1352
|
try {
|
|
787
|
-
await e.onAction(r.action, { priceId:
|
|
1353
|
+
await e.onAction(r.action, { priceId: s });
|
|
788
1354
|
} finally {
|
|
789
|
-
|
|
1355
|
+
i(!1);
|
|
790
1356
|
}
|
|
791
1357
|
}
|
|
792
1358
|
},
|
|
793
|
-
class: "relative flex h-12 w-full items-center justify-center overflow-hidden rounded-
|
|
1359
|
+
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)]",
|
|
794
1360
|
style: {
|
|
795
|
-
background: "linear-gradient(
|
|
796
|
-
boxShadow: "0
|
|
1361
|
+
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%)",
|
|
1362
|
+
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)"
|
|
797
1363
|
},
|
|
798
|
-
children:
|
|
1364
|
+
children: [
|
|
1365
|
+
/* @__PURE__ */ o(
|
|
1366
|
+
"span",
|
|
1367
|
+
{
|
|
1368
|
+
class: "absolute inset-0 opacity-40",
|
|
1369
|
+
style: {
|
|
1370
|
+
background: "radial-gradient(circle at 50% 0%, color-mix(in srgb, white 40%, transparent) 0%, transparent 70%)"
|
|
1371
|
+
},
|
|
1372
|
+
"aria-hidden": "true"
|
|
1373
|
+
}
|
|
1374
|
+
),
|
|
1375
|
+
n ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: f })
|
|
1376
|
+
]
|
|
799
1377
|
}
|
|
800
1378
|
);
|
|
801
1379
|
}
|
|
802
|
-
function
|
|
803
|
-
const e = r.authSession,
|
|
804
|
-
if (
|
|
805
|
-
const
|
|
806
|
-
if (!(!
|
|
807
|
-
|
|
1380
|
+
function Tt({ ctx: r }) {
|
|
1381
|
+
const { t: e } = k(), t = r.authSession, n = r.auth, [i, s] = x(!1), a = () => r.onAction("support");
|
|
1382
|
+
if (t && !t.user.is_anonymous) {
|
|
1383
|
+
const c = async () => {
|
|
1384
|
+
if (!(!n || i)) {
|
|
1385
|
+
s(!0);
|
|
808
1386
|
try {
|
|
809
|
-
await
|
|
1387
|
+
await n.signOut();
|
|
810
1388
|
} catch {
|
|
811
1389
|
} finally {
|
|
812
|
-
|
|
1390
|
+
s(!1);
|
|
813
1391
|
}
|
|
814
1392
|
}
|
|
815
1393
|
};
|
|
816
|
-
return /* @__PURE__ */ u("div", { class: "mt-
|
|
817
|
-
/* @__PURE__ */
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
/* @__PURE__ */ o(
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
class: "font-medium text-gray-600 underline-offset-2 hover:underline disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:underline",
|
|
827
|
-
children: n ? "Signing out…" : "Sign out"
|
|
828
|
-
}
|
|
829
|
-
),
|
|
830
|
-
/* @__PURE__ */ o(Q, {}),
|
|
831
|
-
/* @__PURE__ */ o(K, { onClick: s })
|
|
1394
|
+
return /* @__PURE__ */ u("div", { class: "-mt-3 flex flex-col items-center gap-1.5 pt-1 text-center text-[13px] text-gray-500", children: [
|
|
1395
|
+
/* @__PURE__ */ u("span", { children: [
|
|
1396
|
+
e("session.signed_in_as_prefix", "Signed in as"),
|
|
1397
|
+
" ",
|
|
1398
|
+
/* @__PURE__ */ o("b", { class: "font-medium text-gray-700", children: t.user.email })
|
|
1399
|
+
] }),
|
|
1400
|
+
/* @__PURE__ */ u("div", { class: "flex items-center justify-center gap-3", children: [
|
|
1401
|
+
/* @__PURE__ */ o(H, { onClick: c, disabled: !n || i, children: i ? e("session.signing_out", "Signing out…") : e("session.sign_out", "Sign Out") }),
|
|
1402
|
+
/* @__PURE__ */ o(we, {}),
|
|
1403
|
+
/* @__PURE__ */ o(H, { onClick: a, children: e("session.contact_support", "Contact Support") })
|
|
832
1404
|
] })
|
|
833
1405
|
] });
|
|
834
1406
|
}
|
|
835
|
-
return /* @__PURE__ */ u("div", { class: "mt-
|
|
836
|
-
/* @__PURE__ */ o(
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
type: "button",
|
|
840
|
-
onClick: () => r.onAction("restore"),
|
|
841
|
-
class: "font-medium text-gray-600 underline-offset-2 hover:underline focus:outline-none focus-visible:underline",
|
|
842
|
-
children: "Restore purchases"
|
|
843
|
-
}
|
|
844
|
-
),
|
|
845
|
-
/* @__PURE__ */ o(Q, {}),
|
|
846
|
-
/* @__PURE__ */ o(K, { onClick: s })
|
|
1407
|
+
return /* @__PURE__ */ u("div", { class: "-mt-3 flex items-center justify-center gap-3 pt-1 text-center text-[13px]", children: [
|
|
1408
|
+
/* @__PURE__ */ o(H, { onClick: () => r.onAction("restore"), children: e("session.restore_purchases", "Restore purchases") }),
|
|
1409
|
+
/* @__PURE__ */ o(we, {}),
|
|
1410
|
+
/* @__PURE__ */ o(H, { onClick: a, children: e("session.contact_support", "Contact Support") })
|
|
847
1411
|
] });
|
|
848
1412
|
}
|
|
849
|
-
function
|
|
1413
|
+
function H({
|
|
1414
|
+
onClick: r,
|
|
1415
|
+
disabled: e,
|
|
1416
|
+
children: t
|
|
1417
|
+
}) {
|
|
850
1418
|
return /* @__PURE__ */ o(
|
|
851
1419
|
"button",
|
|
852
1420
|
{
|
|
853
1421
|
type: "button",
|
|
854
1422
|
onClick: r,
|
|
855
|
-
|
|
856
|
-
|
|
1423
|
+
disabled: e,
|
|
1424
|
+
class: "font-semibold transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:opacity-80",
|
|
1425
|
+
style: { color: "var(--pw-accent)" },
|
|
1426
|
+
children: t
|
|
857
1427
|
}
|
|
858
1428
|
);
|
|
859
1429
|
}
|
|
860
|
-
function
|
|
1430
|
+
function we() {
|
|
861
1431
|
return /* @__PURE__ */ o("span", { class: "h-1 w-1 rounded-full bg-gray-300", "aria-hidden": "true" });
|
|
862
1432
|
}
|
|
863
|
-
function
|
|
1433
|
+
function Bt({ block: r }) {
|
|
864
1434
|
return r.items.length ? /* @__PURE__ */ o("ul", { class: "flex flex-col gap-2.5", role: "list", children: r.items.map((e) => /* @__PURE__ */ u("li", { class: "flex items-start gap-3 text-sm text-gray-700", children: [
|
|
865
1435
|
/* @__PURE__ */ o(
|
|
866
|
-
"
|
|
1436
|
+
"svg",
|
|
867
1437
|
{
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
1438
|
+
width: "18",
|
|
1439
|
+
height: "18",
|
|
1440
|
+
viewBox: "0 0 20 20",
|
|
1441
|
+
fill: "none",
|
|
1442
|
+
class: "mt-0.5 flex-shrink-0 text-emerald-500",
|
|
873
1443
|
"aria-hidden": "true",
|
|
874
|
-
children: /* @__PURE__ */ o(
|
|
1444
|
+
children: /* @__PURE__ */ o(
|
|
875
1445
|
"path",
|
|
876
1446
|
{
|
|
877
|
-
d: "
|
|
1447
|
+
d: "M4 10.5l3.5 3.5 8.5-8.5",
|
|
878
1448
|
stroke: "currentColor",
|
|
879
1449
|
"stroke-width": "2.5",
|
|
880
1450
|
"stroke-linecap": "round",
|
|
881
1451
|
"stroke-linejoin": "round"
|
|
882
1452
|
}
|
|
883
|
-
)
|
|
1453
|
+
)
|
|
884
1454
|
}
|
|
885
1455
|
),
|
|
886
1456
|
/* @__PURE__ */ u("div", { class: "flex flex-col gap-0.5", children: [
|
|
887
1457
|
/* @__PURE__ */ o("span", { class: "font-medium leading-snug text-gray-900", children: e.name }),
|
|
888
|
-
e.desc ? /* @__PURE__ */ o("span", { class: "text-xs leading-relaxed text-gray-
|
|
1458
|
+
e.desc ? /* @__PURE__ */ o("span", { class: "text-xs leading-relaxed text-gray-400", children: e.desc }) : null
|
|
889
1459
|
] })
|
|
890
1460
|
] }, e.id)) }) : null;
|
|
891
1461
|
}
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1462
|
+
function Ot({ block: r }) {
|
|
1463
|
+
const { t: e } = k(), t = r.title ?? e("pricing.money_back", "30-day money-back guarantee"), n = r.subtitle, i = (r.icon ?? "dollar_shield") !== "none", s = Ut(t);
|
|
1464
|
+
return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-1.5 border-b-1 pb-4 mb-1 border-gray-100", children: [
|
|
1465
|
+
/* @__PURE__ */ u("div", { class: "inline-flex items-center gap-2 text-[12px] text-gray-700", children: [
|
|
1466
|
+
i ? /* @__PURE__ */ o(jt, {}) : null,
|
|
1467
|
+
s ? /* @__PURE__ */ u("span", { children: [
|
|
1468
|
+
/* @__PURE__ */ o("b", { class: "font-bold text-gray-900", children: s.bold }),
|
|
1469
|
+
" ",
|
|
1470
|
+
/* @__PURE__ */ o("span", { class: "font-medium", children: s.rest })
|
|
1471
|
+
] }) : /* @__PURE__ */ o("span", { class: "font-medium", children: t })
|
|
1472
|
+
] }),
|
|
1473
|
+
n ? /* @__PURE__ */ o("span", { class: "text-center text-xs leading-relaxed text-gray-500", children: n }) : null
|
|
1474
|
+
] });
|
|
1475
|
+
}
|
|
1476
|
+
function Ut(r) {
|
|
1477
|
+
const e = r.match(/^(\d+[-\s]?days?)\s+(.+)$/i);
|
|
1478
|
+
return e ? { bold: e[1], rest: e[2] } : null;
|
|
1479
|
+
}
|
|
1480
|
+
function jt() {
|
|
1481
|
+
return /* @__PURE__ */ u(
|
|
1482
|
+
"svg",
|
|
1483
|
+
{
|
|
1484
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1485
|
+
viewBox: "0 0 24 24",
|
|
1486
|
+
fill: "none",
|
|
1487
|
+
width: "16",
|
|
1488
|
+
height: "16",
|
|
1489
|
+
class: "flex-shrink-0 text-emerald-500",
|
|
1490
|
+
"aria-hidden": "true",
|
|
1491
|
+
children: [
|
|
1492
|
+
/* @__PURE__ */ o(
|
|
1493
|
+
"path",
|
|
1494
|
+
{
|
|
1495
|
+
d: "M12 2 4 5v6c0 5.25 3.5 9.5 8 11 4.5-1.5 8-5.75 8-11V5l-8-3Z",
|
|
1496
|
+
stroke: "currentColor",
|
|
1497
|
+
"stroke-width": "2",
|
|
1498
|
+
"stroke-linejoin": "round"
|
|
1499
|
+
}
|
|
1500
|
+
),
|
|
1501
|
+
/* @__PURE__ */ o(
|
|
1502
|
+
"path",
|
|
1503
|
+
{
|
|
1504
|
+
d: "m9 12 2 2 4-4",
|
|
1505
|
+
stroke: "currentColor",
|
|
1506
|
+
"stroke-width": "2",
|
|
1507
|
+
"stroke-linecap": "round",
|
|
1508
|
+
"stroke-linejoin": "round"
|
|
1509
|
+
}
|
|
1510
|
+
)
|
|
1511
|
+
]
|
|
1512
|
+
}
|
|
1513
|
+
);
|
|
1514
|
+
}
|
|
1515
|
+
const Oe = 24, Rt = 16, zt = 2;
|
|
1516
|
+
function Dt(r, e) {
|
|
1517
|
+
const t = e * zt;
|
|
1518
|
+
let n = Oe;
|
|
1519
|
+
for (r.style.fontSize = `${n}px`; r.scrollHeight > t && n > Rt; )
|
|
897
1520
|
n -= 1, r.style.fontSize = `${n}px`;
|
|
898
1521
|
}
|
|
899
|
-
function
|
|
900
|
-
const t = r.level ?? 1, n = `h${t}`, i = t === 1 ? "text-[
|
|
901
|
-
return
|
|
902
|
-
if (!
|
|
903
|
-
const
|
|
904
|
-
|
|
905
|
-
}, [
|
|
1522
|
+
function qt({ block: r, ctx: e }) {
|
|
1523
|
+
const t = r.level ?? 1, n = `h${t}`, i = t === 1 ? "text-[22px] sm:text-2xl font-semibold leading-tight text-center text-balance text-gray-800" : t === 2 ? "text-xl font-semibold leading-snug text-gray-900 tracking-tight" : "text-base font-medium text-gray-900", s = R(null), a = t === 1 && !!e.bootstrap.settings.title_auto_fit;
|
|
1524
|
+
return B(() => {
|
|
1525
|
+
if (!a || !s.current) return;
|
|
1526
|
+
const c = getComputedStyle(s.current), l = parseFloat(c.lineHeight) || Oe * 1.5;
|
|
1527
|
+
Dt(s.current, l);
|
|
1528
|
+
}, [a, r.text]), /* @__PURE__ */ o(n, { ref: s, class: i, children: r.text });
|
|
906
1529
|
}
|
|
907
|
-
function
|
|
1530
|
+
function Nt(r) {
|
|
908
1531
|
const e = r.local ?? { currency: r.currency, amount: r.amount };
|
|
1532
|
+
if (r.interval === "year") {
|
|
1533
|
+
const t = (r.interval_count ?? 1) * 12;
|
|
1534
|
+
return { amount: e.amount / t, currency: e.currency };
|
|
1535
|
+
}
|
|
1536
|
+
return { amount: e.amount, currency: e.currency };
|
|
1537
|
+
}
|
|
1538
|
+
function ie(r, e) {
|
|
1539
|
+
const t = r % 1 !== 0 ? 2 : 0;
|
|
909
1540
|
try {
|
|
910
|
-
|
|
1541
|
+
const n = new Intl.NumberFormat(void 0, {
|
|
911
1542
|
style: "currency",
|
|
912
|
-
currency: e
|
|
913
|
-
|
|
914
|
-
|
|
1543
|
+
currency: e,
|
|
1544
|
+
currencyDisplay: "narrowSymbol",
|
|
1545
|
+
maximumFractionDigits: t,
|
|
1546
|
+
minimumFractionDigits: t
|
|
1547
|
+
}).formatToParts(r);
|
|
1548
|
+
let i = "", s = "";
|
|
1549
|
+
for (const a of n)
|
|
1550
|
+
a.type === "currency" ? i = a.value : a.type !== "literal" && (s += a.value);
|
|
1551
|
+
return { currency: i || e, amount: s.trim() };
|
|
915
1552
|
} catch {
|
|
916
|
-
return
|
|
1553
|
+
return { currency: e, amount: String(r) };
|
|
917
1554
|
}
|
|
918
1555
|
}
|
|
919
|
-
function
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
1556
|
+
function ae(r, e) {
|
|
1557
|
+
const { amount: t, currency: n } = Nt(r);
|
|
1558
|
+
if (!e) {
|
|
1559
|
+
const { currency: c, amount: l } = ie(t, n);
|
|
1560
|
+
return { currency: c, amount: l, originalAmount: null };
|
|
1561
|
+
}
|
|
1562
|
+
const i = t * (1 - e / 100), s = ie(i, n), a = ie(t, n);
|
|
1563
|
+
return {
|
|
1564
|
+
currency: s.currency,
|
|
1565
|
+
amount: s.amount,
|
|
1566
|
+
originalAmount: `${a.currency}${a.amount}`
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
function G(r, e) {
|
|
1570
|
+
if (!r || r.length === 0) return null;
|
|
1571
|
+
const t = r.find(
|
|
1572
|
+
(i) => i.price_id === e && i.discount_percent && i.discount_percent > 0
|
|
1573
|
+
);
|
|
1574
|
+
return t || (r.find(
|
|
1575
|
+
(i) => i.price_id == null && i.discount_percent && i.discount_percent > 0
|
|
1576
|
+
) ?? null);
|
|
1577
|
+
}
|
|
1578
|
+
function Ue(r, e) {
|
|
1579
|
+
if (r.label) return r.label.toUpperCase();
|
|
1580
|
+
if (!r.interval || r.interval === "lifetime")
|
|
1581
|
+
return e("pricing.plan_label.lifetime", "LIFETIME");
|
|
1582
|
+
const n = {
|
|
1583
|
+
day: { key: "pricing.plan_label.daily", fallback: "DAILY PLAN" },
|
|
1584
|
+
week: { key: "pricing.plan_label.weekly", fallback: "WEEKLY PLAN" },
|
|
1585
|
+
month: { key: "pricing.plan_label.monthly", fallback: "MONTHLY PLAN" },
|
|
1586
|
+
year: { key: "pricing.plan_label.yearly", fallback: "YEARLY PLAN" }
|
|
1587
|
+
}[r.interval];
|
|
1588
|
+
return n ? e(n.key, n.fallback) : `${r.interval.toUpperCase()} PLAN`;
|
|
923
1589
|
}
|
|
924
|
-
function
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
const
|
|
1590
|
+
function le(r, e) {
|
|
1591
|
+
if (!r.interval || r.interval === "lifetime")
|
|
1592
|
+
return e("pricing.interval.lifetime_short", "lifetime");
|
|
1593
|
+
if (r.interval === "year") return e("pricing.interval.month", "month");
|
|
1594
|
+
const t = r.interval_count ?? 1;
|
|
1595
|
+
return t === 1 ? e(`pricing.interval.${r.interval}`, r.interval) : `${t} ${r.interval}s`;
|
|
1596
|
+
}
|
|
1597
|
+
function Ft({ block: r, ctx: e }) {
|
|
1598
|
+
const { t } = k(), n = r.priceIds && r.priceIds.length > 0 ? new Set(r.priceIds) : null, i = e.bootstrap.prices.filter((a) => !n || n.has(a.id));
|
|
1599
|
+
if (i.length === 0)
|
|
1600
|
+
return /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: t("pricing.no_prices", "No prices available.") });
|
|
1601
|
+
const s = r.popular_label ?? t("pricing.most_popular", "Most popular");
|
|
1602
|
+
if (r.view === "compact")
|
|
1603
|
+
return /* @__PURE__ */ o(
|
|
1604
|
+
"div",
|
|
1605
|
+
{
|
|
1606
|
+
class: "flex w-full flex-col rounded-xl border border-gray-200 bg-gray-50",
|
|
1607
|
+
role: "radiogroup",
|
|
1608
|
+
"aria-label": t("pricing.plans_aria", "Plans"),
|
|
1609
|
+
children: i.map((a, c) => /* @__PURE__ */ o(
|
|
1610
|
+
$t,
|
|
1611
|
+
{
|
|
1612
|
+
price: a,
|
|
1613
|
+
isLast: c === i.length - 1,
|
|
1614
|
+
isPopular: r.popular_price_id === a.id,
|
|
1615
|
+
popularLabel: s,
|
|
1616
|
+
offer: G(e.bootstrap.offers, a.id),
|
|
1617
|
+
selected: e.selectedPriceId === a.id,
|
|
1618
|
+
onSelect: () => {
|
|
1619
|
+
e.setSelectedPriceId(a.id), e.onAction("price_selected", { priceId: a.id, price: a });
|
|
1620
|
+
},
|
|
1621
|
+
t
|
|
1622
|
+
},
|
|
1623
|
+
a.id
|
|
1624
|
+
))
|
|
1625
|
+
}
|
|
1626
|
+
);
|
|
1627
|
+
if (r.view === "horizontal") {
|
|
1628
|
+
const a = Math.min(i.length, 3), c = i.some(
|
|
1629
|
+
(l) => (G(e.bootstrap.offers, l.id)?.discount_percent ?? 0) > 0
|
|
1630
|
+
);
|
|
1631
|
+
return /* @__PURE__ */ o(
|
|
1632
|
+
"div",
|
|
1633
|
+
{
|
|
1634
|
+
class: "grid items-stretch gap-2",
|
|
1635
|
+
style: { gridTemplateColumns: `repeat(${a}, minmax(0, 1fr))` },
|
|
1636
|
+
role: "radiogroup",
|
|
1637
|
+
"aria-label": t("pricing.plans_aria", "Plans"),
|
|
1638
|
+
children: i.map((l) => /* @__PURE__ */ o(
|
|
1639
|
+
Ht,
|
|
1640
|
+
{
|
|
1641
|
+
price: l,
|
|
1642
|
+
isPopular: r.popular_price_id === l.id,
|
|
1643
|
+
popularLabel: s,
|
|
1644
|
+
offer: G(e.bootstrap.offers, l.id),
|
|
1645
|
+
reserveStrikeRow: c,
|
|
1646
|
+
selected: e.selectedPriceId === l.id,
|
|
1647
|
+
onSelect: () => {
|
|
1648
|
+
e.setSelectedPriceId(l.id), e.onAction("price_selected", { priceId: l.id, price: l });
|
|
1649
|
+
},
|
|
1650
|
+
t
|
|
1651
|
+
},
|
|
1652
|
+
l.id
|
|
1653
|
+
))
|
|
1654
|
+
}
|
|
1655
|
+
);
|
|
1656
|
+
}
|
|
929
1657
|
return /* @__PURE__ */ o(
|
|
930
1658
|
"div",
|
|
931
1659
|
{
|
|
932
|
-
class:
|
|
933
|
-
style: i ? { gridTemplateColumns: `repeat(${l}, minmax(0, 1fr))` } : void 0,
|
|
1660
|
+
class: "flex flex-col gap-2",
|
|
934
1661
|
role: "radiogroup",
|
|
935
|
-
"aria-label": "Plans",
|
|
936
|
-
children:
|
|
937
|
-
const c = e.selectedPriceId === a.id,
|
|
1662
|
+
"aria-label": t("pricing.plans_aria", "Plans"),
|
|
1663
|
+
children: i.map((a) => {
|
|
1664
|
+
const c = e.selectedPriceId === a.id, l = r.popular_price_id === a.id, h = G(e.bootstrap.offers, a.id)?.discount_percent ?? null, { currency: d, amount: b, originalAmount: w } = ae(a, h);
|
|
938
1665
|
return /* @__PURE__ */ u(
|
|
939
1666
|
"button",
|
|
940
1667
|
{
|
|
@@ -945,47 +1672,87 @@ function ze({ block: r, ctx: e }) {
|
|
|
945
1672
|
e.setSelectedPriceId(a.id), e.onAction("price_selected", { priceId: a.id, price: a });
|
|
946
1673
|
},
|
|
947
1674
|
class: [
|
|
948
|
-
"group relative rounded-2xl border px-4 py-3.5 text-left transition-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
1675
|
+
"group relative inline-flex w-full mx-auto items-center justify-between flex-row-reverse gap-4 rounded-2xl border-2 px-4 py-3.5 text-left transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
|
|
1676
|
+
// Везде border 2px — selection выражается только цветом, layout
|
|
1677
|
+
// не прыгает (равная толщина у selected/unselected). Цветовая
|
|
1678
|
+
// разница accent vs gray достаточно сильная для visual hierarchy.
|
|
1679
|
+
c ? "border-[var(--pw-accent)] bg-transparent" : "border-gray-200 bg-transparent hover:bg-gray-50"
|
|
952
1680
|
].join(" "),
|
|
953
1681
|
children: [
|
|
954
|
-
|
|
1682
|
+
/* @__PURE__ */ o(
|
|
955
1683
|
"span",
|
|
956
1684
|
{
|
|
957
|
-
class:
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
1685
|
+
class: [
|
|
1686
|
+
"flex h-6.5 w-6.5 flex-shrink-0 items-center justify-center rounded-full border transition-colors",
|
|
1687
|
+
c ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent",
|
|
1688
|
+
// Popular-label badge сидит absolute сверху-справа карточки и
|
|
1689
|
+
// визуально сдвигает центр content'а вниз. flex items-center
|
|
1690
|
+
// на карточке держит галочку по геометрическому центру, что
|
|
1691
|
+
// делает её визуально выше — компенсируем небольшим mt'ом.
|
|
1692
|
+
l ? "mt-3" : ""
|
|
1693
|
+
].join(" "),
|
|
1694
|
+
style: c ? {
|
|
1695
|
+
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%)"
|
|
1696
|
+
} : void 0,
|
|
1697
|
+
"aria-hidden": "true",
|
|
1698
|
+
children: /* @__PURE__ */ o(
|
|
1699
|
+
"svg",
|
|
1700
|
+
{
|
|
1701
|
+
width: "14",
|
|
1702
|
+
height: "10",
|
|
1703
|
+
viewBox: "0 0 17 12",
|
|
1704
|
+
fill: "none",
|
|
1705
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1706
|
+
class: c ? "opacity-100" : "opacity-0",
|
|
1707
|
+
children: /* @__PURE__ */ o(
|
|
1708
|
+
"path",
|
|
1709
|
+
{
|
|
1710
|
+
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",
|
|
1711
|
+
fill: "currentColor"
|
|
1712
|
+
}
|
|
1713
|
+
)
|
|
1714
|
+
}
|
|
1715
|
+
)
|
|
962
1716
|
}
|
|
963
|
-
)
|
|
964
|
-
/* @__PURE__ */ u("div", { class:
|
|
965
|
-
/* @__PURE__ */
|
|
966
|
-
"span",
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
].
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
]
|
|
1717
|
+
),
|
|
1718
|
+
/* @__PURE__ */ u("div", { class: "flex flex-1 flex-col gap-0.5", children: [
|
|
1719
|
+
/* @__PURE__ */ u("div", { class: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
|
|
1720
|
+
/* @__PURE__ */ o("span", { class: "text-xs font-normal uppercase tracking-normal text-gray-800/70", children: Ue(a, t) }),
|
|
1721
|
+
w ? (
|
|
1722
|
+
// opacity-60 приглушает strike: глаз сначала ловит label
|
|
1723
|
+
// и discount-badge, потом main price; original «бывшая цена»
|
|
1724
|
+
// — третичная информация, не должна конкурировать с label.
|
|
1725
|
+
/* @__PURE__ */ o("span", { class: "text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]", children: w })
|
|
1726
|
+
) : null,
|
|
1727
|
+
h ? (
|
|
1728
|
+
// Emerald pill — фиксированный «успех/выгода», не зависит от
|
|
1729
|
+
// brand_color. Читается даже на тёмных бренд-акцентах.
|
|
1730
|
+
/* @__PURE__ */ u("span", { class: "rounded-full bg-emerald-100 px-2.5 py-1 text-xs font-bold leading-none text-emerald-700", children: [
|
|
1731
|
+
"-",
|
|
1732
|
+
h,
|
|
1733
|
+
"%"
|
|
1734
|
+
] })
|
|
1735
|
+
) : null
|
|
1736
|
+
] }),
|
|
1737
|
+
/* @__PURE__ */ o("div", { class: "flex items-baseline gap-2 flex-wrap", children: /* @__PURE__ */ u("span", { class: "text-[26px] leading-tight whitespace-nowrap text-gray-800 font-medium", children: [
|
|
1738
|
+
/* @__PURE__ */ o("span", { class: "opacity-90", children: d }),
|
|
1739
|
+
b,
|
|
1740
|
+
/* @__PURE__ */ u("span", { class: "text-sm font-normal text-gray-500", children: [
|
|
1741
|
+
" ",
|
|
1742
|
+
"/ ",
|
|
1743
|
+
le(a, t)
|
|
1744
|
+
] })
|
|
1745
|
+
] }) }),
|
|
1746
|
+
a.description ? /* @__PURE__ */ o("span", { class: "mt-1 text-xs leading-relaxed text-gray-500", children: a.description }) : null
|
|
984
1747
|
] }),
|
|
985
|
-
/* @__PURE__ */
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1748
|
+
l ? /* @__PURE__ */ o(
|
|
1749
|
+
"span",
|
|
1750
|
+
{
|
|
1751
|
+
class: "absolute -top-[9px] -right-[6px] rounded-[11px] border-[5px] border-white px-2 py-1 text-[12px] font-semibold text-white",
|
|
1752
|
+
style: { background: "var(--pw-accent)" },
|
|
1753
|
+
children: s
|
|
1754
|
+
}
|
|
1755
|
+
) : null
|
|
989
1756
|
]
|
|
990
1757
|
},
|
|
991
1758
|
a.id
|
|
@@ -994,381 +1761,585 @@ function ze({ block: r, ctx: e }) {
|
|
|
994
1761
|
}
|
|
995
1762
|
);
|
|
996
1763
|
}
|
|
997
|
-
function
|
|
1764
|
+
function Vt(r, e) {
|
|
1765
|
+
return r.label ? r.label : !r.interval || r.interval === "lifetime" ? e("pricing.interval.lifetime_short", "lifetime") : e(`pricing.interval.${r.interval}`, r.interval);
|
|
1766
|
+
}
|
|
1767
|
+
function $t({
|
|
1768
|
+
price: r,
|
|
1769
|
+
isLast: e,
|
|
1770
|
+
isPopular: t,
|
|
1771
|
+
popularLabel: n,
|
|
1772
|
+
offer: i,
|
|
1773
|
+
selected: s,
|
|
1774
|
+
onSelect: a,
|
|
1775
|
+
t: c
|
|
1776
|
+
}) {
|
|
1777
|
+
const l = i?.discount_percent ?? null, { currency: f, amount: h, originalAmount: d } = ae(r, l);
|
|
1778
|
+
return /* @__PURE__ */ u(
|
|
1779
|
+
"button",
|
|
1780
|
+
{
|
|
1781
|
+
type: "button",
|
|
1782
|
+
role: "radio",
|
|
1783
|
+
"aria-checked": s,
|
|
1784
|
+
onClick: a,
|
|
1785
|
+
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)]",
|
|
1786
|
+
children: [
|
|
1787
|
+
/* @__PURE__ */ o(
|
|
1788
|
+
"span",
|
|
1789
|
+
{
|
|
1790
|
+
class: [
|
|
1791
|
+
"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border transition-colors mb-3",
|
|
1792
|
+
s ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent"
|
|
1793
|
+
].join(" "),
|
|
1794
|
+
style: s ? {
|
|
1795
|
+
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%)"
|
|
1796
|
+
} : void 0,
|
|
1797
|
+
"aria-hidden": "true",
|
|
1798
|
+
children: /* @__PURE__ */ o(
|
|
1799
|
+
"svg",
|
|
1800
|
+
{
|
|
1801
|
+
width: "14",
|
|
1802
|
+
height: "10",
|
|
1803
|
+
viewBox: "0 0 17 12",
|
|
1804
|
+
fill: "none",
|
|
1805
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1806
|
+
class: s ? "opacity-100" : "opacity-0",
|
|
1807
|
+
children: /* @__PURE__ */ o(
|
|
1808
|
+
"path",
|
|
1809
|
+
{
|
|
1810
|
+
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",
|
|
1811
|
+
fill: "currentColor"
|
|
1812
|
+
}
|
|
1813
|
+
)
|
|
1814
|
+
}
|
|
1815
|
+
)
|
|
1816
|
+
}
|
|
1817
|
+
),
|
|
1818
|
+
/* @__PURE__ */ u(
|
|
1819
|
+
"div",
|
|
1820
|
+
{
|
|
1821
|
+
class: [
|
|
1822
|
+
"flex flex-1 items-center gap-1.5 pb-3.5",
|
|
1823
|
+
e ? "" : "border-b border-gray-200"
|
|
1824
|
+
].join(" "),
|
|
1825
|
+
children: [
|
|
1826
|
+
/* @__PURE__ */ u("div", { class: "flex flex-wrap items-center gap-1 gap-x-1.5", children: [
|
|
1827
|
+
/* @__PURE__ */ o("span", { class: "text-base font-normal capitalize text-gray-800", children: Vt(r, c) }),
|
|
1828
|
+
t ? (
|
|
1829
|
+
// Pastel brand-mix pill — точно как `badge` в TelegramPricingRadio.
|
|
1830
|
+
// Низкий visual weight: pill про "имя плана" (most popular), а не
|
|
1831
|
+
// про savings — не должна конкурировать с -X% discount-pill.
|
|
1832
|
+
/* @__PURE__ */ o(
|
|
1833
|
+
"span",
|
|
1834
|
+
{
|
|
1835
|
+
class: "rounded-[9px] px-2 py-1 text-[10px] font-bold",
|
|
1836
|
+
style: {
|
|
1837
|
+
background: "linear-gradient(160deg, color-mix(in srgb, var(--pw-accent) 6%, white) 0%, color-mix(in srgb, var(--pw-accent) 15%, white) 100%)",
|
|
1838
|
+
color: "var(--pw-accent)"
|
|
1839
|
+
},
|
|
1840
|
+
children: n
|
|
1841
|
+
}
|
|
1842
|
+
)
|
|
1843
|
+
) : null,
|
|
1844
|
+
l ? /* @__PURE__ */ u("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
|
|
1845
|
+
"-",
|
|
1846
|
+
l,
|
|
1847
|
+
"%"
|
|
1848
|
+
] }) : null
|
|
1849
|
+
] }),
|
|
1850
|
+
/* @__PURE__ */ o("div", { class: "flex-1" }),
|
|
1851
|
+
/* @__PURE__ */ u("span", { class: "flex items-baseline gap-1.5 text-base font-normal text-gray-600", children: [
|
|
1852
|
+
d ? /* @__PURE__ */ o("span", { class: "text-xs text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: d }) : null,
|
|
1853
|
+
/* @__PURE__ */ u("span", { class: "whitespace-nowrap", children: [
|
|
1854
|
+
/* @__PURE__ */ o("span", { class: "opacity-90", children: f }),
|
|
1855
|
+
h,
|
|
1856
|
+
/* @__PURE__ */ u("span", { class: "text-xs text-gray-400", children: [
|
|
1857
|
+
" ",
|
|
1858
|
+
"/ ",
|
|
1859
|
+
le(r, c)
|
|
1860
|
+
] })
|
|
1861
|
+
] })
|
|
1862
|
+
] })
|
|
1863
|
+
]
|
|
1864
|
+
}
|
|
1865
|
+
)
|
|
1866
|
+
]
|
|
1867
|
+
}
|
|
1868
|
+
);
|
|
1869
|
+
}
|
|
1870
|
+
function Ht({
|
|
1871
|
+
price: r,
|
|
1872
|
+
isPopular: e,
|
|
1873
|
+
popularLabel: t,
|
|
1874
|
+
offer: n,
|
|
1875
|
+
reserveStrikeRow: i,
|
|
1876
|
+
selected: s,
|
|
1877
|
+
onSelect: a,
|
|
1878
|
+
t: c
|
|
1879
|
+
}) {
|
|
1880
|
+
const l = n?.discount_percent ?? null, { currency: f, amount: h, originalAmount: d } = ae(r, l);
|
|
1881
|
+
return /* @__PURE__ */ u(
|
|
1882
|
+
"button",
|
|
1883
|
+
{
|
|
1884
|
+
type: "button",
|
|
1885
|
+
role: "radio",
|
|
1886
|
+
"aria-checked": s,
|
|
1887
|
+
onClick: a,
|
|
1888
|
+
class: [
|
|
1889
|
+
"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)]",
|
|
1890
|
+
s ? "border-[var(--pw-accent)]" : "border-gray-200 hover:bg-gray-50"
|
|
1891
|
+
].join(" "),
|
|
1892
|
+
style: s ? { background: "color-mix(in srgb, var(--pw-accent) 6%, transparent)" } : void 0,
|
|
1893
|
+
children: [
|
|
1894
|
+
/* @__PURE__ */ o("span", { class: "flex min-h-[2.4em] items-center text-[10px] font-normal uppercase leading-tight text-gray-800/70", children: Ue(r, c) }),
|
|
1895
|
+
i ? /* @__PURE__ */ u("div", { class: "flex h-[22px] items-center justify-center gap-1.5", children: [
|
|
1896
|
+
d ? /* @__PURE__ */ o("span", { class: "text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: d }) : null,
|
|
1897
|
+
l ? /* @__PURE__ */ u("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
|
|
1898
|
+
"-",
|
|
1899
|
+
l,
|
|
1900
|
+
"%"
|
|
1901
|
+
] }) : null
|
|
1902
|
+
] }) : null,
|
|
1903
|
+
/* @__PURE__ */ u("span", { class: "text-[26px] leading-none whitespace-nowrap text-gray-800 font-medium", children: [
|
|
1904
|
+
/* @__PURE__ */ o("span", { class: "opacity-90", children: f }),
|
|
1905
|
+
h
|
|
1906
|
+
] }),
|
|
1907
|
+
/* @__PURE__ */ u("span", { class: "text-xs font-normal text-gray-500", children: [
|
|
1908
|
+
"/ ",
|
|
1909
|
+
le(r, c)
|
|
1910
|
+
] }),
|
|
1911
|
+
e ? /* @__PURE__ */ o(
|
|
1912
|
+
"span",
|
|
1913
|
+
{
|
|
1914
|
+
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",
|
|
1915
|
+
style: { background: "var(--pw-accent)" },
|
|
1916
|
+
children: t
|
|
1917
|
+
}
|
|
1918
|
+
) : null
|
|
1919
|
+
]
|
|
1920
|
+
}
|
|
1921
|
+
);
|
|
1922
|
+
}
|
|
1923
|
+
function Gt({ block: r }) {
|
|
998
1924
|
return /* @__PURE__ */ o("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children: r.text });
|
|
999
1925
|
}
|
|
1000
|
-
const
|
|
1926
|
+
const Wt = {
|
|
1001
1927
|
week: 0.25,
|
|
1002
1928
|
month: 1,
|
|
1003
1929
|
year: 12
|
|
1004
1930
|
};
|
|
1005
|
-
function
|
|
1006
|
-
return r
|
|
1931
|
+
function Zt(r, e) {
|
|
1932
|
+
return r ? e(`pricing.interval.${r}`, r) : e("pricing.interval.period", "period");
|
|
1007
1933
|
}
|
|
1008
|
-
function
|
|
1934
|
+
function Yt({ block: r, ctx: e }) {
|
|
1935
|
+
const { t } = k();
|
|
1009
1936
|
if (!r.queries.length) return null;
|
|
1010
|
-
const
|
|
1937
|
+
const i = e.bootstrap.prices.find((a) => a.id === e.selectedPriceId)?.interval ?? null, s = i ? Wt[i] : void 0;
|
|
1011
1938
|
return /* @__PURE__ */ u("div", { class: "flex flex-col gap-2", children: [
|
|
1012
|
-
/* @__PURE__ */
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
const l = Number.isFinite(s.count) ? s.count : 0, a = i !== void 0 ? Math.round(l * i) : l;
|
|
1019
|
-
return /* @__PURE__ */ u("li", { class: `flex gap-2 ${s.desc ? "" : "items-center"}`, children: [
|
|
1939
|
+
/* @__PURE__ */ o("div", { class: "text-sm font-semibold text-gray-800", children: !i || i === "lifetime" ? t("pricing.included_total", "Included for lifetime:") : t("pricing.included_per", "Included per {interval}:", {
|
|
1940
|
+
interval: Zt(i, t)
|
|
1941
|
+
}) }),
|
|
1942
|
+
/* @__PURE__ */ o("ul", { class: "flex flex-col gap-2", role: "list", children: r.queries.map((a) => {
|
|
1943
|
+
const c = Number.isFinite(a.count) ? a.count : 0, l = s !== void 0 ? Math.round(c * s) : c;
|
|
1944
|
+
return /* @__PURE__ */ u("li", { class: `flex gap-3 ${a.desc ? "items-start" : "items-center"}`, children: [
|
|
1020
1945
|
/* @__PURE__ */ o(
|
|
1021
|
-
"
|
|
1946
|
+
"svg",
|
|
1022
1947
|
{
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
}
|
|
1948
|
+
width: "18",
|
|
1949
|
+
height: "18",
|
|
1950
|
+
viewBox: "0 0 20 20",
|
|
1951
|
+
fill: "none",
|
|
1952
|
+
class: `flex-shrink-0 text-emerald-500 ${a.desc ? "mt-0.5" : ""}`,
|
|
1028
1953
|
"aria-hidden": "true",
|
|
1029
|
-
children: /* @__PURE__ */ o(
|
|
1954
|
+
children: /* @__PURE__ */ o(
|
|
1030
1955
|
"path",
|
|
1031
1956
|
{
|
|
1032
|
-
d: "
|
|
1957
|
+
d: "M4 10.5l3.5 3.5 8.5-8.5",
|
|
1033
1958
|
stroke: "currentColor",
|
|
1034
1959
|
"stroke-width": "2.5",
|
|
1035
1960
|
"stroke-linecap": "round",
|
|
1036
1961
|
"stroke-linejoin": "round"
|
|
1037
1962
|
}
|
|
1038
|
-
)
|
|
1963
|
+
)
|
|
1039
1964
|
}
|
|
1040
1965
|
),
|
|
1041
1966
|
/* @__PURE__ */ u("div", { children: [
|
|
1042
|
-
/* @__PURE__ */ o("span", { class: "font-semibold text-gray-900 text-sm", children:
|
|
1967
|
+
/* @__PURE__ */ o("span", { class: "font-semibold text-gray-900 text-sm", children: l }),
|
|
1043
1968
|
" ",
|
|
1044
|
-
/* @__PURE__ */ o("span", { class: "text-sm text-gray-800", children:
|
|
1045
|
-
|
|
1969
|
+
/* @__PURE__ */ o("span", { class: "text-sm text-gray-800", children: a.name }),
|
|
1970
|
+
a.desc ? /* @__PURE__ */ u(se, { children: [
|
|
1046
1971
|
/* @__PURE__ */ o("br", {}),
|
|
1047
|
-
/* @__PURE__ */ o("span", { class: "text-xs text-gray-
|
|
1972
|
+
/* @__PURE__ */ o("span", { class: "text-xs text-gray-400", children: a.desc })
|
|
1048
1973
|
] }) : null
|
|
1049
1974
|
] })
|
|
1050
|
-
] },
|
|
1975
|
+
] }, a.id);
|
|
1051
1976
|
}) })
|
|
1052
1977
|
] });
|
|
1053
1978
|
}
|
|
1054
|
-
const
|
|
1055
|
-
heading:
|
|
1056
|
-
text:
|
|
1057
|
-
price_grid:
|
|
1058
|
-
cta_button:
|
|
1059
|
-
auth_panel:
|
|
1060
|
-
current_session:
|
|
1061
|
-
features_list:
|
|
1062
|
-
tokenization_gate:
|
|
1979
|
+
const Kt = {
|
|
1980
|
+
heading: qt,
|
|
1981
|
+
text: Gt,
|
|
1982
|
+
price_grid: Ft,
|
|
1983
|
+
cta_button: Pt,
|
|
1984
|
+
auth_panel: Le,
|
|
1985
|
+
current_session: Tt,
|
|
1986
|
+
features_list: Bt,
|
|
1987
|
+
tokenization_gate: Yt,
|
|
1988
|
+
guarantee_badge: Ot,
|
|
1989
|
+
offer_banner: bt
|
|
1063
1990
|
};
|
|
1064
|
-
function
|
|
1065
|
-
const
|
|
1991
|
+
function Xt({ layout: r, bootstrap: e, onAction: t, auth: n, authSession: i, hasTopBanner: s }) {
|
|
1992
|
+
const a = $e(() => {
|
|
1993
|
+
for (const v of r.blocks)
|
|
1994
|
+
if (v.type === "price_grid" && v.popular_price_id && e.prices.some((p) => p.id === v.popular_price_id))
|
|
1995
|
+
return v.popular_price_id;
|
|
1996
|
+
return e.prices[0]?.id ?? null;
|
|
1997
|
+
}, [r.blocks, e.prices]), [c, l] = x(a), f = {
|
|
1066
1998
|
bootstrap: e,
|
|
1067
|
-
selectedPriceId:
|
|
1068
|
-
setSelectedPriceId:
|
|
1999
|
+
selectedPriceId: c,
|
|
2000
|
+
setSelectedPriceId: l,
|
|
1069
2001
|
onAction: t,
|
|
1070
2002
|
auth: n,
|
|
1071
2003
|
authSession: i
|
|
2004
|
+
}, h = r.blocks.findIndex((v) => v.type === "cta_button"), d = h === -1 ? r.blocks : r.blocks.slice(0, h), b = h === -1 ? [] : r.blocks.slice(h), w = (v, p) => {
|
|
2005
|
+
const y = Kt[v.type];
|
|
2006
|
+
return y ? /* @__PURE__ */ o(y, { block: v, ctx: f }, `${v.type}-${p}`) : (typeof console < "u" && console.warn(`[paywall] unknown block type: ${v.type}`), null);
|
|
1072
2007
|
};
|
|
1073
|
-
return /* @__PURE__ */
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
2008
|
+
return /* @__PURE__ */ u(se, { children: [
|
|
2009
|
+
/* @__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: d.map(w) }) }),
|
|
2010
|
+
b.length > 0 ? (
|
|
2011
|
+
// Тонкий shadow-top вместо border-t — создаёт depth, читается как
|
|
2012
|
+
// «footer закреплён к низу dialog'а». Линия выглядела как divider
|
|
2013
|
+
// в обычном flow, не передавала sticky-character.
|
|
2014
|
+
/* @__PURE__ */ o(
|
|
2015
|
+
"div",
|
|
2016
|
+
{
|
|
2017
|
+
class: "flex flex-col gap-4 bg-white px-6 pb-6 pt-3 sm:px-8",
|
|
2018
|
+
style: { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" },
|
|
2019
|
+
children: b.map((v, p) => w(v, d.length + p))
|
|
2020
|
+
}
|
|
2021
|
+
)
|
|
2022
|
+
) : null
|
|
2023
|
+
] });
|
|
1077
2024
|
}
|
|
1078
|
-
function
|
|
1079
|
-
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 === "
|
|
2025
|
+
function Jt(r, e, t, n) {
|
|
2026
|
+
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 === "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 };
|
|
1080
2027
|
}
|
|
1081
|
-
function
|
|
2028
|
+
function Qt(r, e) {
|
|
1082
2029
|
return r.open === e.open && r.view === e.view && r.error === e.error;
|
|
1083
2030
|
}
|
|
1084
|
-
function
|
|
2031
|
+
function er({
|
|
1085
2032
|
client: r,
|
|
1086
2033
|
open: e,
|
|
1087
2034
|
onClose: t,
|
|
1088
2035
|
onEvent: n,
|
|
1089
2036
|
initialView: i,
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
2037
|
+
initialAuthMode: s,
|
|
2038
|
+
purchased: a,
|
|
2039
|
+
renew: c,
|
|
2040
|
+
onState: l,
|
|
2041
|
+
inline: f,
|
|
2042
|
+
locale: h
|
|
1093
2043
|
}) {
|
|
1094
|
-
const [
|
|
2044
|
+
const [d, b] = x({ status: "idle" }), [w, v] = x(
|
|
1095
2045
|
() => r.auth?.getCachedSession() ?? null
|
|
1096
|
-
), [
|
|
1097
|
-
|
|
1098
|
-
if (!
|
|
1099
|
-
const
|
|
1100
|
-
|
|
1101
|
-
}, [e,
|
|
2046
|
+
), [p, y] = x(() => i === "support" ? { kind: "support", origin: "standalone" } : i === "auth" ? { kind: "auth_gate", origin: "standalone" } : { kind: "layout" }), O = R(!1), _ = R(null);
|
|
2047
|
+
B(() => {
|
|
2048
|
+
if (!l) return;
|
|
2049
|
+
const m = Jt(e, d, p, a), g = _.current;
|
|
2050
|
+
g && Qt(g, m) || (_.current = m, l(m));
|
|
2051
|
+
}, [e, d, p, a, l]), B(() => {
|
|
1102
2052
|
if (r.auth)
|
|
1103
|
-
return r.auth.onAuthChange((
|
|
1104
|
-
}, [r.auth]),
|
|
1105
|
-
if (
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
2053
|
+
return r.auth.onAuthChange((m, g) => v(g));
|
|
2054
|
+
}, [r.auth]), B(() => {
|
|
2055
|
+
if (typeof r.onBootstrapChange == "function")
|
|
2056
|
+
return r.onBootstrapChange((m) => {
|
|
2057
|
+
b(
|
|
2058
|
+
(g) => g.status === "ready" ? { status: "ready", data: m } : g
|
|
2059
|
+
);
|
|
2060
|
+
});
|
|
2061
|
+
}, [r]), B(() => {
|
|
2062
|
+
if (!e || d.status === "ready" || d.status === "loading") return;
|
|
2063
|
+
let m = !1;
|
|
2064
|
+
return b({ status: "loading" }), r.bootstrap().then((g) => {
|
|
2065
|
+
m || (b({ status: "ready", data: g }), n("ready", g), g.user?.has_active_subscription && !c && !i && (n("purchase_completed", {
|
|
1109
2066
|
priceId: null,
|
|
1110
2067
|
sessionId: null,
|
|
1111
2068
|
restored: !0
|
|
1112
|
-
}),
|
|
1113
|
-
}).catch((
|
|
1114
|
-
if (
|
|
1115
|
-
const
|
|
1116
|
-
|
|
2069
|
+
}), y({ kind: "purchase_success", restored: !0 })));
|
|
2070
|
+
}).catch((g) => {
|
|
2071
|
+
if (m) return;
|
|
2072
|
+
const C = g instanceof T ? g : new T("unknown", "Failed to load paywall", { cause: g });
|
|
2073
|
+
b({ status: "error", error: C }), n("error", C);
|
|
1117
2074
|
}), () => {
|
|
1118
|
-
|
|
2075
|
+
m = !0;
|
|
1119
2076
|
};
|
|
1120
|
-
}, [e, r]),
|
|
2077
|
+
}, [e, r]), He(() => {
|
|
1121
2078
|
if (!e) {
|
|
1122
|
-
|
|
2079
|
+
y({ kind: "layout" }), O.current = !1;
|
|
1123
2080
|
return;
|
|
1124
2081
|
}
|
|
1125
|
-
i === "support" ?
|
|
2082
|
+
i === "support" ? y({ kind: "support", origin: "standalone" }) : i === "auth" && y({ kind: "auth_gate", origin: "standalone" });
|
|
1126
2083
|
}, [e, i]);
|
|
1127
|
-
const
|
|
2084
|
+
const S = async (m) => {
|
|
1128
2085
|
try {
|
|
1129
|
-
const
|
|
1130
|
-
priceId:
|
|
1131
|
-
ignoreActivePurchase:
|
|
2086
|
+
const g = await r.createCheckout({
|
|
2087
|
+
priceId: m,
|
|
2088
|
+
ignoreActivePurchase: c === !0
|
|
1132
2089
|
});
|
|
1133
|
-
if (n("checkout_started", { priceId:
|
|
1134
|
-
const
|
|
1135
|
-
if (
|
|
2090
|
+
if (n("checkout_started", { priceId: m, url: g.url, acquiring: g.acquiring }), typeof window > "u" || !g.url) return;
|
|
2091
|
+
const C = window.open(g.url, "_blank");
|
|
2092
|
+
if (C) {
|
|
1136
2093
|
try {
|
|
1137
|
-
|
|
2094
|
+
C.opener = null;
|
|
1138
2095
|
} catch {
|
|
1139
2096
|
}
|
|
1140
|
-
|
|
2097
|
+
y({ kind: "awaiting_payment", priceId: m, url: g.url });
|
|
1141
2098
|
} else
|
|
1142
|
-
|
|
1143
|
-
} catch (
|
|
1144
|
-
if (
|
|
2099
|
+
y({ kind: "popup_blocked", priceId: m, url: g.url });
|
|
2100
|
+
} catch (g) {
|
|
2101
|
+
if (g instanceof T && g.code === "already_purchased") {
|
|
1145
2102
|
try {
|
|
1146
2103
|
await r.getUser({ force: !0 });
|
|
1147
2104
|
} catch {
|
|
1148
2105
|
}
|
|
1149
|
-
n("purchase_completed", { priceId:
|
|
2106
|
+
n("purchase_completed", { priceId: m, sessionId: null, restored: !0 }), y({ kind: "purchase_success", restored: !0 });
|
|
1150
2107
|
return;
|
|
1151
2108
|
}
|
|
1152
|
-
const
|
|
1153
|
-
n("error",
|
|
2109
|
+
const C = g instanceof T ? g : new T("checkout_failed", "Checkout failed", { cause: g });
|
|
2110
|
+
n("error", C), y({ kind: "layout" });
|
|
1154
2111
|
}
|
|
1155
|
-
},
|
|
2112
|
+
}, A = (m, g) => {
|
|
1156
2113
|
if (typeof window > "u") return;
|
|
1157
|
-
const
|
|
1158
|
-
if (
|
|
2114
|
+
const C = window.open(g, "_blank");
|
|
2115
|
+
if (C) {
|
|
1159
2116
|
try {
|
|
1160
|
-
|
|
2117
|
+
C.opener = null;
|
|
1161
2118
|
} catch {
|
|
1162
2119
|
}
|
|
1163
|
-
|
|
2120
|
+
y({ kind: "awaiting_payment", priceId: m, url: g });
|
|
1164
2121
|
}
|
|
1165
2122
|
};
|
|
1166
|
-
|
|
1167
|
-
if (
|
|
1168
|
-
|
|
1169
|
-
const
|
|
1170
|
-
|
|
1171
|
-
if (!
|
|
2123
|
+
B(() => {
|
|
2124
|
+
if (p.kind !== "auth_gate" || !w || w.user.is_anonymous || O.current) return;
|
|
2125
|
+
O.current = !0;
|
|
2126
|
+
const m = p.pendingCheckout, g = p.origin;
|
|
2127
|
+
y({ kind: "verifying" }), (async () => {
|
|
2128
|
+
if (!c)
|
|
1172
2129
|
try {
|
|
1173
2130
|
if ((await r.getUser({ force: !0 })).has_active_subscription) {
|
|
1174
2131
|
n("purchase_completed", {
|
|
1175
|
-
priceId:
|
|
2132
|
+
priceId: m?.priceId ?? null,
|
|
1176
2133
|
sessionId: null,
|
|
1177
2134
|
restored: !0
|
|
1178
|
-
}),
|
|
2135
|
+
}), y({ kind: "purchase_success", restored: !0 });
|
|
1179
2136
|
return;
|
|
1180
2137
|
}
|
|
1181
2138
|
} catch {
|
|
1182
2139
|
}
|
|
1183
|
-
if (!
|
|
1184
|
-
|
|
2140
|
+
if (!m) {
|
|
2141
|
+
g === "standalone" ? t() : y({ kind: "layout" });
|
|
1185
2142
|
return;
|
|
1186
2143
|
}
|
|
1187
|
-
await
|
|
2144
|
+
await S(m.priceId);
|
|
1188
2145
|
})().finally(() => {
|
|
1189
|
-
|
|
2146
|
+
O.current = !1;
|
|
1190
2147
|
});
|
|
1191
|
-
}, [
|
|
1192
|
-
const
|
|
1193
|
-
if (
|
|
2148
|
+
}, [w, p]);
|
|
2149
|
+
const z = async (m, g) => {
|
|
2150
|
+
if (m === "close") {
|
|
1194
2151
|
t();
|
|
1195
2152
|
return;
|
|
1196
2153
|
}
|
|
1197
|
-
if (
|
|
1198
|
-
n("price_selected",
|
|
2154
|
+
if (m === "price_selected") {
|
|
2155
|
+
n("price_selected", g);
|
|
1199
2156
|
return;
|
|
1200
2157
|
}
|
|
1201
|
-
if (
|
|
1202
|
-
if (!r.auth
|
|
1203
|
-
|
|
2158
|
+
if (m === "restore") {
|
|
2159
|
+
if (!r.auth) return;
|
|
2160
|
+
const C = r.auth.getCachedSession();
|
|
2161
|
+
if (C && !C.user.is_anonymous) return;
|
|
2162
|
+
y({ kind: "auth_gate", intent: "restore" });
|
|
1204
2163
|
return;
|
|
1205
2164
|
}
|
|
1206
|
-
if (
|
|
1207
|
-
|
|
2165
|
+
if (m === "support") {
|
|
2166
|
+
y({ kind: "support", origin: "layout" });
|
|
1208
2167
|
return;
|
|
1209
2168
|
}
|
|
1210
|
-
if (
|
|
1211
|
-
const
|
|
1212
|
-
if (!
|
|
2169
|
+
if (m === "checkout" && d.status === "ready") {
|
|
2170
|
+
const C = g?.priceId;
|
|
2171
|
+
if (!C) {
|
|
1213
2172
|
n("error", new T("no_price", "No price selected"));
|
|
1214
2173
|
return;
|
|
1215
2174
|
}
|
|
1216
|
-
|
|
1217
|
-
|
|
2175
|
+
const K = d.data.settings.checkout_mode ?? "guest", I = r.auth?.getCachedSession() ?? null, M = !!I && !I.user.is_anonymous;
|
|
2176
|
+
if (K === "preauth" && !!r.auth && !M) {
|
|
2177
|
+
y({ kind: "auth_gate", pendingCheckout: { priceId: C } });
|
|
1218
2178
|
return;
|
|
1219
2179
|
}
|
|
1220
|
-
await
|
|
2180
|
+
await S(C);
|
|
1221
2181
|
}
|
|
1222
|
-
},
|
|
2182
|
+
}, E = d.status === "ready" ? d.data.settings.brand_color : null, U = d.status === "ready" ? d.data.settings.allow_close !== !1 : !0, j = p.kind === "layout" && d.status === "ready" ? Ee(d.data.offers) : null, P = j ? /* @__PURE__ */ o(wt, { offer: j }) : null, L = {
|
|
1223
2183
|
type: "auth_panel",
|
|
1224
|
-
|
|
2184
|
+
// Заголовок не задаём — AuthGate сам решит по intent'у (restore →
|
|
2185
|
+
// "Restore Purchases", остальные → дефолтный "Welcome back!").
|
|
1225
2186
|
allow_signup: !0,
|
|
1226
2187
|
allow_password_reset: !0,
|
|
1227
2188
|
// Не скрываем при наличии сессии — auto-resume useEffect отрабатывает быстрее,
|
|
1228
2189
|
// чем хотим показывать "Signed in as ..." промежуточным экраном.
|
|
1229
2190
|
hide_when_authenticated: !1,
|
|
1230
|
-
providers:
|
|
1231
|
-
},
|
|
1232
|
-
|
|
2191
|
+
providers: d.status === "ready" ? d.data.settings.auth_providers : void 0
|
|
2192
|
+
}, q = p.kind === "support" ? /* @__PURE__ */ o(
|
|
2193
|
+
_t,
|
|
1233
2194
|
{
|
|
1234
2195
|
client: r,
|
|
1235
|
-
authSession:
|
|
1236
|
-
origin:
|
|
2196
|
+
authSession: w,
|
|
2197
|
+
origin: p.origin,
|
|
1237
2198
|
onBack: () => {
|
|
1238
|
-
|
|
2199
|
+
p.origin === "standalone" ? t() : y({ kind: "layout" });
|
|
1239
2200
|
}
|
|
1240
2201
|
}
|
|
1241
|
-
) : null;
|
|
1242
|
-
return /* @__PURE__ */ o(
|
|
1243
|
-
|
|
2202
|
+
) : null, N = p.kind === "auth_gate" && p.origin !== "standalone" || p.kind === "support", Y = d.status === "ready" ? d.data : null;
|
|
2203
|
+
return /* @__PURE__ */ o(et, { bootstrap: Y, forceLocale: h, children: /* @__PURE__ */ o(
|
|
2204
|
+
tt,
|
|
1244
2205
|
{
|
|
1245
2206
|
open: e,
|
|
1246
2207
|
onClose: t,
|
|
1247
|
-
brandColor:
|
|
1248
|
-
|
|
1249
|
-
allowClose:
|
|
2208
|
+
brandColor: E,
|
|
2209
|
+
topBanner: P,
|
|
2210
|
+
allowClose: U,
|
|
2211
|
+
hideCloseButton: N,
|
|
2212
|
+
inline: f,
|
|
1250
2213
|
labelledBy: "pw-title",
|
|
1251
|
-
children:
|
|
1252
|
-
|
|
1253
|
-
/* @__PURE__ */ o("span", { class: "text-xs font-medium tracking-wide text-gray-500", children: f.kind === "verifying" ? "Checking your subscription…" : "Loading…" })
|
|
1254
|
-
] }) : c.status === "error" ? /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
|
|
1255
|
-
/* @__PURE__ */ o("div", { class: "flex h-11 w-11 items-center justify-center rounded-full bg-red-50", children: /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1256
|
-
/* @__PURE__ */ o(
|
|
1257
|
-
"path",
|
|
1258
|
-
{
|
|
1259
|
-
d: "M10 6v5M10 14h.01",
|
|
1260
|
-
stroke: "#dc2626",
|
|
1261
|
-
"stroke-width": "2",
|
|
1262
|
-
"stroke-linecap": "round"
|
|
1263
|
-
}
|
|
1264
|
-
),
|
|
1265
|
-
/* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "8", stroke: "#dc2626", "stroke-width": "1.75" })
|
|
1266
|
-
] }) }),
|
|
1267
|
-
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: "Something went wrong" }),
|
|
1268
|
-
/* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: c.error.message })
|
|
1269
|
-
] }) : f.kind === "auth_gate" && r.auth ? /* @__PURE__ */ o(
|
|
1270
|
-
Se,
|
|
2214
|
+
children: a ? /* @__PURE__ */ o(ke, { onContinue: t }) : p.kind === "purchase_success" ? /* @__PURE__ */ o(ke, { restored: p.restored, onContinue: t }) : q || (d.status === "loading" || d.status === "idle" || p.kind === "verifying" ? /* @__PURE__ */ o(tr, { verifying: p.kind === "verifying" }) : d.status === "error" ? /* @__PURE__ */ o(rr, { message: d.error.message }) : p.kind === "auth_gate" && r.auth ? /* @__PURE__ */ o(
|
|
2215
|
+
mt,
|
|
1271
2216
|
{
|
|
1272
|
-
block:
|
|
1273
|
-
bootstrap:
|
|
2217
|
+
block: L,
|
|
2218
|
+
bootstrap: d.data,
|
|
1274
2219
|
auth: r.auth,
|
|
1275
|
-
authSession:
|
|
1276
|
-
showBack:
|
|
2220
|
+
authSession: w,
|
|
2221
|
+
showBack: p.origin !== "standalone",
|
|
2222
|
+
intent: p.intent ?? (p.origin === "standalone" ? "standalone" : "preauth"),
|
|
2223
|
+
initialMode: p.origin === "standalone" ? s : void 0,
|
|
1277
2224
|
onBack: () => {
|
|
1278
|
-
|
|
2225
|
+
p.origin === "standalone" ? t() : y({ kind: "layout" });
|
|
1279
2226
|
}
|
|
1280
2227
|
}
|
|
1281
|
-
) :
|
|
1282
|
-
|
|
1283
|
-
{
|
|
1284
|
-
auth: r.auth,
|
|
1285
|
-
onSuccess: () => {
|
|
1286
|
-
f.origin === "standalone" ? t() : m({ kind: "layout" });
|
|
1287
|
-
},
|
|
1288
|
-
onBack: f.origin === "standalone" ? void 0 : () => m({ kind: "layout" })
|
|
1289
|
-
}
|
|
1290
|
-
) : f.kind === "awaiting_payment" ? /* @__PURE__ */ o(
|
|
1291
|
-
Xe,
|
|
2228
|
+
) : p.kind === "awaiting_payment" ? /* @__PURE__ */ o(
|
|
2229
|
+
ir,
|
|
1292
2230
|
{
|
|
1293
2231
|
client: r,
|
|
1294
|
-
onBack: () =>
|
|
2232
|
+
onBack: () => y({ kind: "layout" }),
|
|
1295
2233
|
onReopen: () => {
|
|
1296
2234
|
if (typeof window > "u") return;
|
|
1297
|
-
const
|
|
1298
|
-
if (
|
|
2235
|
+
const m = window.open(p.url, "_blank");
|
|
2236
|
+
if (m)
|
|
1299
2237
|
try {
|
|
1300
|
-
|
|
2238
|
+
m.opener = null;
|
|
1301
2239
|
} catch {
|
|
1302
2240
|
}
|
|
1303
2241
|
},
|
|
1304
|
-
onRetry: () =>
|
|
2242
|
+
onRetry: () => S(p.priceId)
|
|
1305
2243
|
}
|
|
1306
|
-
) :
|
|
1307
|
-
|
|
1308
|
-
"div",
|
|
1309
|
-
{
|
|
1310
|
-
class: "flex h-11 w-11 items-center justify-center rounded-full",
|
|
1311
|
-
style: { background: "color-mix(in srgb, var(--pw-accent) 12%, white)", color: "var(--pw-accent)" },
|
|
1312
|
-
"aria-hidden": "true",
|
|
1313
|
-
children: /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
|
|
1314
|
-
/* @__PURE__ */ o(
|
|
1315
|
-
"path",
|
|
1316
|
-
{
|
|
1317
|
-
d: "M4 5h12v10H4z",
|
|
1318
|
-
stroke: "currentColor",
|
|
1319
|
-
"stroke-width": "1.75",
|
|
1320
|
-
"stroke-linejoin": "round"
|
|
1321
|
-
}
|
|
1322
|
-
),
|
|
1323
|
-
/* @__PURE__ */ o("path", { d: "M7 9l3 3 4-5", stroke: "currentColor", "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" })
|
|
1324
|
-
] })
|
|
1325
|
-
}
|
|
1326
|
-
),
|
|
1327
|
-
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: "Allow popups to continue" }),
|
|
1328
|
-
/* @__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." }),
|
|
1329
|
-
/* @__PURE__ */ o(
|
|
1330
|
-
"button",
|
|
1331
|
-
{
|
|
1332
|
-
type: "button",
|
|
1333
|
-
onClick: () => v(f.priceId, f.url),
|
|
1334
|
-
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)]",
|
|
1335
|
-
style: {
|
|
1336
|
-
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
1337
|
-
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
1338
|
-
},
|
|
1339
|
-
children: "Open checkout"
|
|
1340
|
-
}
|
|
1341
|
-
)
|
|
1342
|
-
] }) : /* @__PURE__ */ o(
|
|
1343
|
-
He,
|
|
2244
|
+
) : p.kind === "popup_blocked" ? /* @__PURE__ */ o(nr, { onReopen: () => A(p.priceId, p.url) }) : /* @__PURE__ */ o(
|
|
2245
|
+
Xt,
|
|
1344
2246
|
{
|
|
1345
|
-
layout:
|
|
1346
|
-
bootstrap:
|
|
1347
|
-
onAction:
|
|
2247
|
+
layout: d.data.layout,
|
|
2248
|
+
bootstrap: d.data,
|
|
2249
|
+
onAction: z,
|
|
1348
2250
|
auth: r.auth,
|
|
1349
|
-
authSession:
|
|
2251
|
+
authSession: w
|
|
1350
2252
|
}
|
|
1351
2253
|
))
|
|
1352
2254
|
}
|
|
1353
|
-
);
|
|
2255
|
+
) });
|
|
2256
|
+
}
|
|
2257
|
+
function tr({ verifying: r }) {
|
|
2258
|
+
const { t: e } = k();
|
|
2259
|
+
return /* @__PURE__ */ u("div", { class: "flex flex-col items-center justify-center gap-3 py-12", children: [
|
|
2260
|
+
/* @__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)]" }),
|
|
2261
|
+
/* @__PURE__ */ o("span", { class: "text-xs font-medium tracking-wide text-gray-500", children: r ? e("modal.verifying_subscription", "Checking your subscription…") : e("modal.loading", "Loading…") })
|
|
2262
|
+
] });
|
|
2263
|
+
}
|
|
2264
|
+
function rr({ message: r }) {
|
|
2265
|
+
const { t: e } = k();
|
|
2266
|
+
return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
|
|
2267
|
+
/* @__PURE__ */ o("div", { class: "flex h-11 w-11 items-center justify-center rounded-full bg-red-50", children: /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2268
|
+
/* @__PURE__ */ o("path", { d: "M10 6v5M10 14h.01", stroke: "#dc2626", "stroke-width": "2", "stroke-linecap": "round" }),
|
|
2269
|
+
/* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "8", stroke: "#dc2626", "stroke-width": "1.75" })
|
|
2270
|
+
] }) }),
|
|
2271
|
+
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: e("modal.error_generic", "Something went wrong") }),
|
|
2272
|
+
/* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: r })
|
|
2273
|
+
] });
|
|
2274
|
+
}
|
|
2275
|
+
function nr({ onReopen: r }) {
|
|
2276
|
+
const { t: e } = k();
|
|
2277
|
+
return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
|
|
2278
|
+
/* @__PURE__ */ o(
|
|
2279
|
+
"div",
|
|
2280
|
+
{
|
|
2281
|
+
class: "flex h-11 w-11 items-center justify-center rounded-full",
|
|
2282
|
+
style: { background: "color-mix(in srgb, var(--pw-accent) 12%, white)", color: "var(--pw-accent)" },
|
|
2283
|
+
"aria-hidden": "true",
|
|
2284
|
+
children: /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
|
|
2285
|
+
/* @__PURE__ */ o("path", { d: "M4 5h12v10H4z", stroke: "currentColor", "stroke-width": "1.75", "stroke-linejoin": "round" }),
|
|
2286
|
+
/* @__PURE__ */ o("path", { d: "M7 9l3 3 4-5", stroke: "currentColor", "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" })
|
|
2287
|
+
] })
|
|
2288
|
+
}
|
|
2289
|
+
),
|
|
2290
|
+
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: e("payment.popup_blocked_title", "Allow popups to continue") }),
|
|
2291
|
+
/* @__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.") }),
|
|
2292
|
+
/* @__PURE__ */ o(
|
|
2293
|
+
"button",
|
|
2294
|
+
{
|
|
2295
|
+
type: "button",
|
|
2296
|
+
onClick: r,
|
|
2297
|
+
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)]",
|
|
2298
|
+
style: {
|
|
2299
|
+
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
2300
|
+
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
2301
|
+
},
|
|
2302
|
+
children: e("payment.open_checkout_button", "Open checkout")
|
|
2303
|
+
}
|
|
2304
|
+
)
|
|
2305
|
+
] });
|
|
1354
2306
|
}
|
|
1355
|
-
function
|
|
2307
|
+
function ir({
|
|
1356
2308
|
client: r,
|
|
1357
2309
|
onBack: e,
|
|
1358
2310
|
onReopen: t,
|
|
1359
2311
|
onRetry: n
|
|
1360
2312
|
}) {
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
}, [])
|
|
2313
|
+
const { t: i } = k(), [s, a] = x(!1), [c, l] = x(!1), f = R(null);
|
|
2314
|
+
B(() => () => {
|
|
2315
|
+
f.current !== null && clearTimeout(f.current);
|
|
2316
|
+
}, []);
|
|
2317
|
+
const h = async () => {
|
|
2318
|
+
if (!s) {
|
|
2319
|
+
a(!0), l(!1);
|
|
2320
|
+
try {
|
|
2321
|
+
if ((await r.getUser({ force: !0 })).has_active_subscription) {
|
|
2322
|
+
typeof window < "u" && window.postMessage({ type: "paywall_purchase" }, "*");
|
|
2323
|
+
return;
|
|
2324
|
+
}
|
|
2325
|
+
l(!0), f.current !== null && clearTimeout(f.current), f.current = setTimeout(() => {
|
|
2326
|
+
l(!1), f.current = null;
|
|
2327
|
+
}, 5e3);
|
|
2328
|
+
} catch {
|
|
2329
|
+
l(!0);
|
|
2330
|
+
} finally {
|
|
2331
|
+
a(!1);
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2334
|
+
};
|
|
2335
|
+
return /* @__PURE__ */ u("div", { class: "flex flex-col gap-3 px-6 pb-6 pt-4 sm:px-8 sm:pb-8 sm:pt-5", children: [
|
|
1365
2336
|
/* @__PURE__ */ o(
|
|
1366
2337
|
"button",
|
|
1367
2338
|
{
|
|
1368
2339
|
type: "button",
|
|
1369
2340
|
onClick: e,
|
|
1370
2341
|
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)]",
|
|
1371
|
-
children: "← Back"
|
|
2342
|
+
children: i("nav.back", "← Back")
|
|
1372
2343
|
}
|
|
1373
2344
|
),
|
|
1374
2345
|
/* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-3 py-6 text-center", children: [
|
|
@@ -1383,50 +2354,36 @@ function Xe({
|
|
|
1383
2354
|
),
|
|
1384
2355
|
/* @__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)]" })
|
|
1385
2356
|
] }),
|
|
1386
|
-
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: "Complete payment in the new tab" }),
|
|
1387
|
-
/* @__PURE__ */ o("p", { class: "max-w-[20rem] text-xs leading-relaxed text-gray-500", children:
|
|
2357
|
+
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: i("payment.awaiting_title", "Complete payment in the new tab") }),
|
|
2358
|
+
/* @__PURE__ */ o("p", { class: "max-w-[20rem] text-xs leading-relaxed text-gray-500", children: i(
|
|
2359
|
+
"payment.awaiting_subtitle",
|
|
2360
|
+
"We'll detect your payment automatically — or click below once you're done."
|
|
2361
|
+
) }),
|
|
1388
2362
|
/* @__PURE__ */ o(
|
|
1389
2363
|
"button",
|
|
1390
2364
|
{
|
|
1391
2365
|
type: "button",
|
|
1392
|
-
onClick:
|
|
1393
|
-
|
|
1394
|
-
s(!0), a(!1);
|
|
1395
|
-
try {
|
|
1396
|
-
if ((await r.getUser({ force: !0 })).has_active_subscription) {
|
|
1397
|
-
typeof window < "u" && window.postMessage({ type: "paywall_purchase" }, "*");
|
|
1398
|
-
return;
|
|
1399
|
-
}
|
|
1400
|
-
a(!0), c.current !== null && clearTimeout(c.current), c.current = setTimeout(() => {
|
|
1401
|
-
a(!1), c.current = null;
|
|
1402
|
-
}, 5e3);
|
|
1403
|
-
} catch {
|
|
1404
|
-
a(!0);
|
|
1405
|
-
} finally {
|
|
1406
|
-
s(!1);
|
|
1407
|
-
}
|
|
1408
|
-
}
|
|
1409
|
-
},
|
|
1410
|
-
disabled: i,
|
|
2366
|
+
onClick: h,
|
|
2367
|
+
disabled: s,
|
|
1411
2368
|
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)]",
|
|
1412
2369
|
style: {
|
|
1413
2370
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
1414
2371
|
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
1415
2372
|
},
|
|
1416
|
-
children:
|
|
2373
|
+
children: s ? i("payment.checking", "Checking…") : i("payment.ive_paid", "I've paid")
|
|
1417
2374
|
}
|
|
1418
2375
|
),
|
|
1419
|
-
|
|
2376
|
+
c ? /* @__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
|
|
1420
2377
|
] }),
|
|
1421
2378
|
/* @__PURE__ */ u("div", { class: "rounded-2xl border border-gray-200 bg-gray-50/60 p-3.5", children: [
|
|
1422
|
-
/* @__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." }),
|
|
2379
|
+
/* @__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.") }),
|
|
1423
2380
|
/* @__PURE__ */ o(
|
|
1424
2381
|
"button",
|
|
1425
2382
|
{
|
|
1426
2383
|
type: "button",
|
|
1427
2384
|
onClick: t,
|
|
1428
2385
|
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)]",
|
|
1429
|
-
children: "Open checkout again"
|
|
2386
|
+
children: i("payment.open_checkout_again", "Open checkout again")
|
|
1430
2387
|
}
|
|
1431
2388
|
)
|
|
1432
2389
|
] }),
|
|
@@ -1436,15 +2393,16 @@ function Xe({
|
|
|
1436
2393
|
type: "button",
|
|
1437
2394
|
onClick: n,
|
|
1438
2395
|
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)]",
|
|
1439
|
-
children: "Tab closed? Try again"
|
|
2396
|
+
children: i("payment.tab_closed_retry", "Tab closed? Try again")
|
|
1440
2397
|
}
|
|
1441
2398
|
)
|
|
1442
2399
|
] });
|
|
1443
2400
|
}
|
|
1444
|
-
function
|
|
2401
|
+
function ke({
|
|
1445
2402
|
onContinue: r,
|
|
1446
2403
|
restored: e = !1
|
|
1447
2404
|
}) {
|
|
2405
|
+
const { t } = k();
|
|
1448
2406
|
return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
|
|
1449
2407
|
/* @__PURE__ */ o(
|
|
1450
2408
|
"div",
|
|
@@ -1469,8 +2427,11 @@ function te({
|
|
|
1469
2427
|
) })
|
|
1470
2428
|
}
|
|
1471
2429
|
),
|
|
1472
|
-
/* @__PURE__ */ o("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children: e ? "Subscription restored" : "Payment received" }),
|
|
1473
|
-
/* @__PURE__ */ o("p", { class: "text-sm leading-relaxed text-gray-500", children: e ?
|
|
2430
|
+
/* @__PURE__ */ o("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children: e ? t("modal.purchase_restored_title", "Subscription restored") : t("modal.purchase_success_title", "Payment received") }),
|
|
2431
|
+
/* @__PURE__ */ o("p", { class: "text-sm leading-relaxed text-gray-500", children: e ? t(
|
|
2432
|
+
"modal.purchase_restored_subtitle",
|
|
2433
|
+
"Welcome back — your subscription is already active."
|
|
2434
|
+
) : t("modal.purchase_success_subtitle", "Your subscription is now active.") }),
|
|
1474
2435
|
/* @__PURE__ */ o(
|
|
1475
2436
|
"button",
|
|
1476
2437
|
{
|
|
@@ -1481,22 +2442,22 @@ function te({
|
|
|
1481
2442
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
1482
2443
|
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
1483
2444
|
},
|
|
1484
|
-
children: "Continue"
|
|
2445
|
+
children: t("modal.continue", "Continue")
|
|
1485
2446
|
}
|
|
1486
2447
|
)
|
|
1487
2448
|
] });
|
|
1488
2449
|
}
|
|
1489
|
-
const
|
|
1490
|
-
class
|
|
2450
|
+
const or = 10 * 6e4, sr = 5e3, ar = 3e4;
|
|
2451
|
+
class lr {
|
|
1491
2452
|
constructor(e) {
|
|
1492
2453
|
this.timer = null, this.timeoutTimer = null, this.visibilityHandler = null, this.focusHandler = null, this.messageHandler = null, this.stopped = !1, this.checking = !1, this.opts = {
|
|
1493
2454
|
client: e.client,
|
|
1494
2455
|
onActive: e.onActive,
|
|
1495
2456
|
onTimeout: e.onTimeout ?? (() => {
|
|
1496
2457
|
}),
|
|
1497
|
-
timeoutMs: e.timeoutMs ??
|
|
1498
|
-
visibleIntervalMs: e.visibleIntervalMs ??
|
|
1499
|
-
hiddenIntervalMs: e.hiddenIntervalMs ??
|
|
2458
|
+
timeoutMs: e.timeoutMs ?? or,
|
|
2459
|
+
visibleIntervalMs: e.visibleIntervalMs ?? sr,
|
|
2460
|
+
hiddenIntervalMs: e.hiddenIntervalMs ?? ar
|
|
1500
2461
|
};
|
|
1501
2462
|
}
|
|
1502
2463
|
start() {
|
|
@@ -1535,22 +2496,22 @@ class Qe {
|
|
|
1535
2496
|
!t || typeof t != "object" || t.type === "paywall_purchase" && this.check();
|
|
1536
2497
|
}
|
|
1537
2498
|
}
|
|
1538
|
-
function
|
|
2499
|
+
function cr() {
|
|
1539
2500
|
return !(typeof document > "u" || typeof window > "u" || typeof location < "u" && location.protocol === "chrome-extension:");
|
|
1540
2501
|
}
|
|
1541
|
-
const
|
|
2502
|
+
const oe = { open: !1, view: null, error: null }, F = {
|
|
1542
2503
|
status: "paywall_status",
|
|
1543
2504
|
priceId: "paywall_price_id",
|
|
1544
2505
|
sessionId: "paywall_session_id"
|
|
1545
2506
|
};
|
|
1546
|
-
let
|
|
2507
|
+
let ur = class {
|
|
1547
2508
|
constructor(e) {
|
|
1548
|
-
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 =
|
|
1549
|
-
const { auth: t, ownsAuth: n } =
|
|
1550
|
-
this.auth = t, this.ownsAuth = n, this.billing = e.client ?? new
|
|
2509
|
+
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 = oe, this.stateListeners = /* @__PURE__ */ new Set();
|
|
2510
|
+
const { auth: t, ownsAuth: n } = dr(e);
|
|
2511
|
+
this.auth = t, this.ownsAuth = n, this.billing = e.client ?? new je({ ...e, auth: this.auth }), this.host = e.host, this.shadowMode = e.shadowMode ?? "closed", this.mountThenLoad = e.mountThenLoad ?? !0, this.inline = e.inline === !0, this.forceLocale = e.locale ?? null, this.userUnsub = this.billing.onUserChange((i) => {
|
|
1551
2512
|
this.emit("userChange", i);
|
|
1552
|
-
}), this.auth && (this.authUnsub = this.auth.onAuthChange((i) => {
|
|
1553
|
-
this.emit("authChange", i);
|
|
2513
|
+
}), this.auth && (this.authUnsub = this.auth.onAuthChange((i, s) => {
|
|
2514
|
+
this.emit("authChange", { event: i, session: s });
|
|
1554
2515
|
})), this.initTracker(e.analytics), e.autoDetectReturn !== !1 && typeof window < "u" && queueMicrotask(() => this.checkReturn());
|
|
1555
2516
|
}
|
|
1556
2517
|
initTracker(e) {
|
|
@@ -1558,7 +2519,7 @@ let tt = class {
|
|
|
1558
2519
|
const t = typeof e == "object" && e !== null ? e : {};
|
|
1559
2520
|
if (t.enabled === !1) return;
|
|
1560
2521
|
const n = t.endpoint ?? `${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;
|
|
1561
|
-
this.tracker = new
|
|
2522
|
+
this.tracker = new Re({
|
|
1562
2523
|
endpoint: n,
|
|
1563
2524
|
paywallId: this.billing.paywallId,
|
|
1564
2525
|
capabilities: this.billing.capabilities,
|
|
@@ -1632,6 +2593,31 @@ let tt = class {
|
|
|
1632
2593
|
onUserChange(e) {
|
|
1633
2594
|
return this.on("userChange", e);
|
|
1634
2595
|
}
|
|
2596
|
+
/**
|
|
2597
|
+
* Заменить cachedBootstrap живыми данными — для preview-режима в редакторе
|
|
2598
|
+
* админки. Если модалка открыта, PaywallRoot подписан на onBootstrapChange
|
|
2599
|
+
* и перерендерится мгновенно. До open() — затравка для bootstrap()-effect'а.
|
|
2600
|
+
*
|
|
2601
|
+
* См. {@link BillingClientOptions.preview} — обычно эту опцию ставят на
|
|
2602
|
+
* клиент, чтобы заодно отключить сетевой revalidate. setBootstrap технически
|
|
2603
|
+
* работает и в production-режиме, но конкуренция с revalidate'ом из сети
|
|
2604
|
+
* почти всегда нежелательна.
|
|
2605
|
+
*/
|
|
2606
|
+
setBootstrap(e) {
|
|
2607
|
+
this.billing.setBootstrap(e);
|
|
2608
|
+
}
|
|
2609
|
+
/**
|
|
2610
|
+
* Сменить force-locale на лету — для live-preview редактора админки, когда
|
|
2611
|
+
* юзер переключает «Preview as user from <country>». Грузит соответствующий
|
|
2612
|
+
* static-чанк и форсит re-render через handle.update. См. PaywallUIOptions.locale.
|
|
2613
|
+
*
|
|
2614
|
+
* Передай `null`/`undefined`, чтобы вернуть автоматическую резолв-логику
|
|
2615
|
+
* (navigator.language → locale_default).
|
|
2616
|
+
*/
|
|
2617
|
+
setLocale(e) {
|
|
2618
|
+
const t = e ?? null;
|
|
2619
|
+
t !== this.forceLocale && (this.forceLocale = t, this.handle && this.handle.update({ locale: t }));
|
|
2620
|
+
}
|
|
1635
2621
|
on(e, t) {
|
|
1636
2622
|
let n = this.listeners.get(e);
|
|
1637
2623
|
return n || (n = /* @__PURE__ */ new Set(), this.listeners.set(e, n)), n.add(t), () => n.delete(t);
|
|
@@ -1646,8 +2632,8 @@ let tt = class {
|
|
|
1646
2632
|
for (const s of n)
|
|
1647
2633
|
try {
|
|
1648
2634
|
s(i);
|
|
1649
|
-
} catch (
|
|
1650
|
-
typeof console < "u" && console.error("[paywall] listener error",
|
|
2635
|
+
} catch (a) {
|
|
2636
|
+
typeof console < "u" && console.error("[paywall] listener error", a);
|
|
1651
2637
|
}
|
|
1652
2638
|
}
|
|
1653
2639
|
open(e = {}) {
|
|
@@ -1700,43 +2686,63 @@ let tt = class {
|
|
|
1700
2686
|
this.auth && this.openInternal("auth", { ...e, skipTrial: !0 });
|
|
1701
2687
|
}
|
|
1702
2688
|
/**
|
|
1703
|
-
*
|
|
1704
|
-
* `
|
|
1705
|
-
*
|
|
1706
|
-
*
|
|
1707
|
-
*
|
|
1708
|
-
*
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
2689
|
+
* Шорткат над `openAuth()` — открывает модалку сразу на signin-форме.
|
|
2690
|
+
* Эквивалент `openAuth()` (signin — дефолт). Существует для симметрии с
|
|
2691
|
+
* `openSignup()` и читаемости host-кода:
|
|
2692
|
+
* - `paywall.openSignin()` — «вход в существующий аккаунт»
|
|
2693
|
+
* - `paywall.openSignup()` — «новая регистрация»
|
|
2694
|
+
* Без managed-auth — no-op.
|
|
2695
|
+
*/
|
|
2696
|
+
openSignin(e = {}) {
|
|
2697
|
+
this.auth && this.openInternal("auth", { ...e, skipTrial: !0, authMode: "signin" });
|
|
2698
|
+
}
|
|
2699
|
+
/**
|
|
2700
|
+
* Открывает модалку с auth-gate сразу в режиме регистрации (signup-mode
|
|
2701
|
+
* AuthPanel'а — email/password/repeat). Если в paywall layout админ
|
|
2702
|
+
* отключил allow_signup, AuthPanel игнорит mode и стартует с signin —
|
|
2703
|
+
* соблюдается admin-конфиг.
|
|
2704
|
+
* Без managed-auth — no-op.
|
|
2705
|
+
*/
|
|
2706
|
+
openSignup(e = {}) {
|
|
2707
|
+
this.auth && this.openInternal("auth", { ...e, skipTrial: !0, authMode: "signup" });
|
|
2708
|
+
}
|
|
2709
|
+
/**
|
|
2710
|
+
* Headless anonymous signin без открытия модалки. Внутри:
|
|
2711
|
+
* idempotent (если уже анон — instant return) → resume через сохранённый
|
|
2712
|
+
* refresh_token → fresh /auth/anonymous/signin. Дедуплицирует
|
|
2713
|
+
* параллельные вызовы внутри AuthClient'а.
|
|
1714
2714
|
*
|
|
1715
|
-
*
|
|
1716
|
-
*
|
|
1717
|
-
*
|
|
2715
|
+
* Удобно для host-кнопок типа «Continue as guest» — host сам управляет
|
|
2716
|
+
* loading-стейтом на своей кнопке, без полупустой модалки со спиннером.
|
|
2717
|
+
* Без managed-auth — резолвится rejected promise'ом (нет AuthClient'а
|
|
2718
|
+
* чтобы делать signin).
|
|
1718
2719
|
*/
|
|
1719
|
-
|
|
1720
|
-
this.auth
|
|
2720
|
+
signInAnonymously() {
|
|
2721
|
+
return this.auth ? this.auth.signInAnonymously() : Promise.reject(
|
|
2722
|
+
new T(
|
|
2723
|
+
"invalid_config",
|
|
2724
|
+
"signInAnonymously requires managed-auth. Pass `auth: true` to PaywallUI."
|
|
2725
|
+
)
|
|
2726
|
+
);
|
|
1721
2727
|
}
|
|
1722
2728
|
openInternal(e, t) {
|
|
1723
2729
|
t.identity && this.billing.setIdentity(t.identity), this.purchased = !1;
|
|
1724
|
-
const n = t.skipTrial === !0 || e === "support", i = t.skipVisibility === !0 || e === "support" || e === "auth"
|
|
2730
|
+
const n = t.skipTrial === !0 || e === "support", i = t.skipVisibility === !0 || e === "support" || e === "auth", s = t.renew === !0;
|
|
1725
2731
|
if (n && i) {
|
|
1726
|
-
this.mountAndShow(e, { renew: s });
|
|
2732
|
+
this.mountAndShow(e, { renew: s, authMode: t.authMode });
|
|
1727
2733
|
return;
|
|
1728
2734
|
}
|
|
1729
|
-
const
|
|
1730
|
-
if (
|
|
1731
|
-
this.runOpenGates(e,
|
|
2735
|
+
const a = this.billing.getCachedBootstrap();
|
|
2736
|
+
if (a) {
|
|
2737
|
+
this.runOpenGates(e, a, { skipTrial: n, skipVisibility: i, renew: s });
|
|
1732
2738
|
return;
|
|
1733
2739
|
}
|
|
1734
2740
|
if (this.mountThenLoad) {
|
|
1735
|
-
this.mountAndShow(e, { renew: s }), this.billing.bootstrap().then((
|
|
2741
|
+
this.mountAndShow(e, { renew: s }), this.billing.bootstrap().then((c) => this.runDelayedGates(c, { skipTrial: n, skipVisibility: i })).catch(() => {
|
|
1736
2742
|
});
|
|
1737
2743
|
return;
|
|
1738
2744
|
}
|
|
1739
|
-
this.billing.bootstrap().then((
|
|
2745
|
+
this.billing.bootstrap().then((c) => this.runOpenGates(e, c, { skipTrial: n, skipVisibility: i, renew: s })).catch(() => {
|
|
1740
2746
|
this.mountAndShow(e, { renew: s });
|
|
1741
2747
|
});
|
|
1742
2748
|
}
|
|
@@ -1759,9 +2765,9 @@ let tt = class {
|
|
|
1759
2765
|
i.check().then(async (s) => {
|
|
1760
2766
|
if (this.isOpen && (this.lastTrialStatus = s, s.mode !== "none")) {
|
|
1761
2767
|
if (s.blocked) {
|
|
1762
|
-
const
|
|
1763
|
-
if (this.lastTrialStatus =
|
|
1764
|
-
this.close(), this.emit("trial_blocked",
|
|
2768
|
+
const a = await i.recordBlock();
|
|
2769
|
+
if (this.lastTrialStatus = a, !this.isOpen) return;
|
|
2770
|
+
this.close(), this.emit("trial_blocked", a);
|
|
1765
2771
|
return;
|
|
1766
2772
|
}
|
|
1767
2773
|
this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired"));
|
|
@@ -1795,53 +2801,62 @@ let tt = class {
|
|
|
1795
2801
|
return;
|
|
1796
2802
|
}
|
|
1797
2803
|
const s = this.ensureTrialStore(i);
|
|
1798
|
-
s.check().then(async (
|
|
1799
|
-
if (this.lastTrialStatus =
|
|
2804
|
+
s.check().then(async (a) => {
|
|
2805
|
+
if (this.lastTrialStatus = a, a.mode === "none") {
|
|
1800
2806
|
this.mountAndShow(e, { renew: n });
|
|
1801
2807
|
return;
|
|
1802
2808
|
}
|
|
1803
|
-
if (
|
|
1804
|
-
const
|
|
1805
|
-
this.lastTrialStatus =
|
|
2809
|
+
if (a.blocked) {
|
|
2810
|
+
const c = await s.recordBlock();
|
|
2811
|
+
this.lastTrialStatus = c, this.emit("trial_blocked", c);
|
|
1806
2812
|
return;
|
|
1807
2813
|
}
|
|
1808
2814
|
this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(e, { renew: n });
|
|
1809
|
-
}).catch((
|
|
1810
|
-
typeof console < "u" && console.warn("[paywall] trial check failed",
|
|
2815
|
+
}).catch((a) => {
|
|
2816
|
+
typeof console < "u" && console.warn("[paywall] trial check failed", a), this.mountAndShow(e, { renew: n });
|
|
1811
2817
|
});
|
|
1812
2818
|
}
|
|
1813
2819
|
ensureTrialStore(e) {
|
|
1814
|
-
if (this.trialStore && this.trialStoreConfig &&
|
|
2820
|
+
if (this.trialStore && this.trialStoreConfig && fr(this.trialStoreConfig, e))
|
|
1815
2821
|
return this.trialStore;
|
|
1816
2822
|
this.trialStoreConfig = e;
|
|
1817
2823
|
const t = this.billing.createTrialStore;
|
|
1818
|
-
return this.trialStore = typeof t == "function" ? t.call(this.billing, e) :
|
|
2824
|
+
return this.trialStore = typeof t == "function" ? t.call(this.billing, e) : ze(this.billing.getStorage(), this.billing.paywallId, e), this.trialStore;
|
|
1819
2825
|
}
|
|
1820
2826
|
mountAndShow(e, t = {}) {
|
|
1821
|
-
const n = t.renew === !0;
|
|
2827
|
+
const n = t.renew === !0, i = t.authMode;
|
|
1822
2828
|
if (this.handle) {
|
|
1823
|
-
this.isOpen = !0, this.handle.update({
|
|
2829
|
+
this.isOpen = !0, this.handle.update({
|
|
2830
|
+
open: !0,
|
|
2831
|
+
initialView: e,
|
|
2832
|
+
initialAuthMode: i,
|
|
2833
|
+
purchased: !1,
|
|
2834
|
+
renew: n
|
|
2835
|
+
}), this.emit("open");
|
|
1824
2836
|
return;
|
|
1825
2837
|
}
|
|
1826
|
-
this.isOpen = !0, this.handle =
|
|
1827
|
-
|
|
2838
|
+
this.isOpen = !0, this.handle = Ze(
|
|
2839
|
+
er,
|
|
1828
2840
|
{
|
|
1829
2841
|
client: this.billing,
|
|
1830
2842
|
open: !0,
|
|
1831
2843
|
initialView: e,
|
|
2844
|
+
initialAuthMode: i,
|
|
1832
2845
|
purchased: !1,
|
|
1833
2846
|
renew: n,
|
|
1834
2847
|
onClose: () => this.close(),
|
|
1835
|
-
onEvent: (
|
|
1836
|
-
this.emit(
|
|
2848
|
+
onEvent: (s, a) => {
|
|
2849
|
+
this.emit(s, a), s === "checkout_started" && this.startUserWatcher();
|
|
1837
2850
|
},
|
|
1838
|
-
onState: (
|
|
2851
|
+
onState: (s) => this.applyState(s),
|
|
2852
|
+
inline: this.inline,
|
|
2853
|
+
locale: this.forceLocale
|
|
1839
2854
|
},
|
|
1840
|
-
{ host: this.host, shadowMode: this.shadowMode }
|
|
2855
|
+
{ host: this.host, shadowMode: this.shadowMode, inline: this.inline }
|
|
1841
2856
|
), this.emit("open");
|
|
1842
2857
|
}
|
|
1843
2858
|
applyState(e) {
|
|
1844
|
-
if (!
|
|
2859
|
+
if (!pr(this.currentState, e)) {
|
|
1845
2860
|
this.currentState = e;
|
|
1846
2861
|
for (const t of this.stateListeners)
|
|
1847
2862
|
try {
|
|
@@ -1952,19 +2967,19 @@ let tt = class {
|
|
|
1952
2967
|
try {
|
|
1953
2968
|
t = await this.billing.bootstrap({ signal: e.signal });
|
|
1954
2969
|
} catch {
|
|
1955
|
-
const
|
|
1956
|
-
return
|
|
2970
|
+
const a = this.billing.getCachedUser();
|
|
2971
|
+
return a?.has_active_subscription ? {
|
|
1957
2972
|
access: "granted",
|
|
1958
2973
|
reason: "has_subscription",
|
|
1959
2974
|
visibility: null,
|
|
1960
2975
|
trial: null,
|
|
1961
|
-
user:
|
|
2976
|
+
user: a
|
|
1962
2977
|
} : {
|
|
1963
2978
|
access: "blocked",
|
|
1964
2979
|
reason: "no_subscription",
|
|
1965
2980
|
visibility: null,
|
|
1966
2981
|
trial: null,
|
|
1967
|
-
user:
|
|
2982
|
+
user: a
|
|
1968
2983
|
};
|
|
1969
2984
|
}
|
|
1970
2985
|
const n = t.user ?? null;
|
|
@@ -1978,19 +2993,19 @@ let tt = class {
|
|
|
1978
2993
|
};
|
|
1979
2994
|
let i = null;
|
|
1980
2995
|
if (!e.skipVisibility) {
|
|
1981
|
-
const
|
|
1982
|
-
if (
|
|
2996
|
+
const a = t.settings.visibility;
|
|
2997
|
+
if (a && (i = a, this.lastVisibility = a, !a.visible))
|
|
1983
2998
|
return { access: "granted", reason: "visibility_blocked", visibility: i, trial: null, user: n };
|
|
1984
2999
|
}
|
|
1985
3000
|
let s = null;
|
|
1986
3001
|
if (!e.skipTrial) {
|
|
1987
|
-
const
|
|
1988
|
-
if (
|
|
3002
|
+
const a = t.settings.trial;
|
|
3003
|
+
if (a)
|
|
1989
3004
|
try {
|
|
1990
|
-
if (s = await this.ensureTrialStore(
|
|
3005
|
+
if (s = await this.ensureTrialStore(a).check(), this.lastTrialStatus = s, s.blocked)
|
|
1991
3006
|
return { access: "granted", reason: "trial_blocked", visibility: i, trial: s, user: n };
|
|
1992
|
-
} catch (
|
|
1993
|
-
typeof console < "u" && console.warn("[paywall] getAccess: trial check failed",
|
|
3007
|
+
} catch (c) {
|
|
3008
|
+
typeof console < "u" && console.warn("[paywall] getAccess: trial check failed", c);
|
|
1994
3009
|
}
|
|
1995
3010
|
}
|
|
1996
3011
|
return { access: "blocked", reason: "no_subscription", visibility: i, trial: s, user: n };
|
|
@@ -2007,7 +3022,7 @@ let tt = class {
|
|
|
2007
3022
|
// В extension popup runtime — no-op (popup не доживёт). Там полагаемся на
|
|
2008
3023
|
// bootstrap при следующем открытии.
|
|
2009
3024
|
startUserWatcher() {
|
|
2010
|
-
this.watcher ||
|
|
3025
|
+
this.watcher || cr() && (this.watcher = new lr({
|
|
2011
3026
|
client: this.billing,
|
|
2012
3027
|
onActive: (e) => {
|
|
2013
3028
|
this.watcher = null, this.emit("purchase_completed", { priceId: null, sessionId: null });
|
|
@@ -2026,7 +3041,7 @@ let tt = class {
|
|
|
2026
3041
|
}), this.watcher.start());
|
|
2027
3042
|
}
|
|
2028
3043
|
close() {
|
|
2029
|
-
!this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(
|
|
3044
|
+
!this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(oe), this.emit("close"));
|
|
2030
3045
|
}
|
|
2031
3046
|
/**
|
|
2032
3047
|
* Сканирует текущий URL на маркеры возврата с checkout и эмитит
|
|
@@ -2036,23 +3051,23 @@ let tt = class {
|
|
|
2036
3051
|
*/
|
|
2037
3052
|
checkReturn() {
|
|
2038
3053
|
if (typeof window > "u") return;
|
|
2039
|
-
const e = new URL(window.location.href), t =
|
|
3054
|
+
const e = new URL(window.location.href), t = ve(e.hash.replace(/^#/, "")), n = ve(e.search.replace(/^\?/, "")), i = t ?? n;
|
|
2040
3055
|
i && (i.status === "paid" ? (this.emit("purchase_completed", {
|
|
2041
3056
|
priceId: i.priceId,
|
|
2042
3057
|
sessionId: i.sessionId
|
|
2043
|
-
}),
|
|
3058
|
+
}), gr(i)) : (i.status === "failed" || i.status === "cancelled") && this.emit("purchase_failed", { reason: i.status }), mr(e));
|
|
2044
3059
|
}
|
|
2045
3060
|
destroy() {
|
|
2046
|
-
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 =
|
|
3061
|
+
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 = oe;
|
|
2047
3062
|
}
|
|
2048
3063
|
};
|
|
2049
|
-
function
|
|
3064
|
+
function dr(r) {
|
|
2050
3065
|
if (!r.auth) return { auth: void 0, ownsAuth: !1 };
|
|
2051
|
-
if (r.auth instanceof
|
|
3066
|
+
if (r.auth instanceof ce || hr(r.auth))
|
|
2052
3067
|
return { auth: r.auth, ownsAuth: !1 };
|
|
2053
3068
|
const e = r.auth === !0 ? {} : r.auth;
|
|
2054
3069
|
return {
|
|
2055
|
-
auth: new
|
|
3070
|
+
auth: new ce({
|
|
2056
3071
|
paywallId: r.paywallId,
|
|
2057
3072
|
apiOrigin: e.apiOrigin ?? r.apiOrigin,
|
|
2058
3073
|
storage: e.storage ?? r.storage,
|
|
@@ -2062,27 +3077,27 @@ function rt(r) {
|
|
|
2062
3077
|
ownsAuth: !0
|
|
2063
3078
|
};
|
|
2064
3079
|
}
|
|
2065
|
-
function
|
|
3080
|
+
function hr(r) {
|
|
2066
3081
|
if (typeof r != "object" || r === null) return !1;
|
|
2067
3082
|
const e = r;
|
|
2068
3083
|
return typeof e.onAuthChange == "function" && typeof e.getCachedSession == "function" && typeof e.signOut == "function";
|
|
2069
3084
|
}
|
|
2070
|
-
function
|
|
3085
|
+
function pr(r, e) {
|
|
2071
3086
|
return r.open === e.open && r.view === e.view && r.error === e.error;
|
|
2072
3087
|
}
|
|
2073
|
-
function
|
|
3088
|
+
function fr(r, e) {
|
|
2074
3089
|
return r.mode === e.mode && r.payload === e.payload && r.storage === e.storage;
|
|
2075
3090
|
}
|
|
2076
|
-
function
|
|
3091
|
+
function ve(r) {
|
|
2077
3092
|
if (!r) return null;
|
|
2078
|
-
const e = new URLSearchParams(r), t = e.get(
|
|
3093
|
+
const e = new URLSearchParams(r), t = e.get(F.status);
|
|
2079
3094
|
return t ? {
|
|
2080
3095
|
status: t,
|
|
2081
|
-
priceId: e.get(
|
|
2082
|
-
sessionId: e.get(
|
|
3096
|
+
priceId: e.get(F.priceId),
|
|
3097
|
+
sessionId: e.get(F.sessionId)
|
|
2083
3098
|
} : null;
|
|
2084
3099
|
}
|
|
2085
|
-
function
|
|
3100
|
+
function gr(r) {
|
|
2086
3101
|
if (!(typeof window > "u" || !window.opener))
|
|
2087
3102
|
try {
|
|
2088
3103
|
window.opener.postMessage(
|
|
@@ -2097,17 +3112,17 @@ function st(r) {
|
|
|
2097
3112
|
} catch {
|
|
2098
3113
|
}
|
|
2099
3114
|
}
|
|
2100
|
-
function
|
|
3115
|
+
function mr(r) {
|
|
2101
3116
|
const e = (n, i) => {
|
|
2102
3117
|
if (!n) return "";
|
|
2103
3118
|
const s = new URLSearchParams(n.replace(/^[?#]/, ""));
|
|
2104
|
-
s.delete(
|
|
2105
|
-
const
|
|
2106
|
-
return
|
|
3119
|
+
s.delete(F.status), s.delete(F.priceId), s.delete(F.sessionId);
|
|
3120
|
+
const a = s.toString();
|
|
3121
|
+
return a ? i + a : "";
|
|
2107
3122
|
}, t = r.pathname + e(r.search, "?") + e(r.hash, "#");
|
|
2108
3123
|
window.history.replaceState(null, "", t);
|
|
2109
3124
|
}
|
|
2110
|
-
class
|
|
3125
|
+
class yr {
|
|
2111
3126
|
constructor(e, t, n) {
|
|
2112
3127
|
this.transport = e, this.paywallId = t, this.config = n;
|
|
2113
3128
|
}
|
|
@@ -2130,9 +3145,9 @@ class at {
|
|
|
2130
3145
|
});
|
|
2131
3146
|
}
|
|
2132
3147
|
}
|
|
2133
|
-
class
|
|
3148
|
+
class xr {
|
|
2134
3149
|
constructor(e, t) {
|
|
2135
|
-
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 = {
|
|
3150
|
+
this.transport = e, this.cachedBootstrap = null, this.cachedUser = null, this.cachedBalances = null, this.identity = null, this.userListeners = /* @__PURE__ */ new Set(), this.balanceListeners = /* @__PURE__ */ new Set(), this.bootstrapListeners = /* @__PURE__ */ new Set(), this.unsubUserBroadcast = null, this.unsubBalancesBroadcast = null, this.paywallId = t.paywallId, this.apiOrigin = t.apiOrigin, this.remoteStorageAdapter = {
|
|
2136
3151
|
getItem: (n) => this.transport.request("storage.get", { key: n }),
|
|
2137
3152
|
setItem: async (n, i) => {
|
|
2138
3153
|
await this.transport.request("storage.set", { key: n, value: i });
|
|
@@ -2156,11 +3171,39 @@ class ct {
|
|
|
2156
3171
|
{ force: e.force },
|
|
2157
3172
|
{ signal: e.signal }
|
|
2158
3173
|
);
|
|
2159
|
-
return this.
|
|
3174
|
+
return this.applyBootstrap(t), t.user && this.applyUser(t.user), t;
|
|
2160
3175
|
}
|
|
2161
3176
|
getCachedBootstrap() {
|
|
2162
3177
|
return this.cachedBootstrap;
|
|
2163
3178
|
}
|
|
3179
|
+
/** Подписка на bootstrap-state. Структурно совместима с
|
|
3180
|
+
* `BillingClient.onBootstrapChange` — те же микротаск-семантики для initial
|
|
3181
|
+
* snapshot. В extension-режиме offscreen пока не broadcast'ит bootstrapChange,
|
|
3182
|
+
* поэтому listener срабатывает только на self-инициированные `bootstrap()`
|
|
3183
|
+
* внутри этого RemoteBillingClient'а (popup перезапрашивает bootstrap → mirror
|
|
3184
|
+
* обновляется → listener вызывается). Cross-surface revalidate (другая вкладка
|
|
3185
|
+
* обновила bootstrap) не доезжает до popup'а — для этого нужен отдельный
|
|
3186
|
+
* bootstrapChange-broadcast в protocol.ts/server.ts. */
|
|
3187
|
+
onBootstrapChange(e, t = {}) {
|
|
3188
|
+
this.bootstrapListeners.add(e);
|
|
3189
|
+
const n = t.immediate ?? "microtask";
|
|
3190
|
+
if (this.cachedBootstrap && n !== "none") {
|
|
3191
|
+
const i = this.cachedBootstrap;
|
|
3192
|
+
if (n === "sync")
|
|
3193
|
+
try {
|
|
3194
|
+
e(i);
|
|
3195
|
+
} catch (s) {
|
|
3196
|
+
console.warn("[paywall] onBootstrapChange initial sync threw", s);
|
|
3197
|
+
}
|
|
3198
|
+
else
|
|
3199
|
+
queueMicrotask(() => {
|
|
3200
|
+
this.bootstrapListeners.has(e) && e(i);
|
|
3201
|
+
});
|
|
3202
|
+
}
|
|
3203
|
+
return () => {
|
|
3204
|
+
this.bootstrapListeners.delete(e);
|
|
3205
|
+
};
|
|
3206
|
+
}
|
|
2164
3207
|
/** Шорткат над `bootstrap()` — возвращает цены пейвола (locale-оверрайды
|
|
2165
3208
|
* уже применены в offscreen'е). Те же кэш-семантики, что у `bootstrap()`. */
|
|
2166
3209
|
async getPrices(e = {}) {
|
|
@@ -2256,6 +3299,13 @@ class ct {
|
|
|
2256
3299
|
signal: e.signal
|
|
2257
3300
|
})];
|
|
2258
3301
|
}
|
|
3302
|
+
/** Саппорт-тикет через offscreen'овский BillingClient. File-объекты
|
|
3303
|
+
* переживают chrome.runtime structured-clone (port forward'ит as-is) —
|
|
3304
|
+
* Bearer-токен/email-substitution делает offscreen, как в обычном
|
|
3305
|
+
* BillingClient. */
|
|
3306
|
+
async createSupportTicket(e) {
|
|
3307
|
+
return this.transport.request("billing.createSupportTicket", e);
|
|
3308
|
+
}
|
|
2259
3309
|
/** Отменить подписку через бэк. По умолчанию cancel в конце текущего
|
|
2260
3310
|
* периода (юзер сохраняет access до renewal date'ы). reason обязательна
|
|
2261
3311
|
* (валидируется бэком) — собирается через select причин в host-UI. */
|
|
@@ -2276,7 +3326,7 @@ class ct {
|
|
|
2276
3326
|
* read-modify-write. PaywallUI duck-types этот метод и предпочитает его
|
|
2277
3327
|
* локальной фабрике, если он есть. */
|
|
2278
3328
|
createTrialStore(e) {
|
|
2279
|
-
return new
|
|
3329
|
+
return new yr(this.transport, this.paywallId, e);
|
|
2280
3330
|
}
|
|
2281
3331
|
// === Identity ===
|
|
2282
3332
|
getIdentity() {
|
|
@@ -2293,17 +3343,26 @@ class ct {
|
|
|
2293
3343
|
return this.identity = e, e;
|
|
2294
3344
|
}
|
|
2295
3345
|
destroy() {
|
|
2296
|
-
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;
|
|
3346
|
+
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;
|
|
3347
|
+
}
|
|
3348
|
+
applyBootstrap(e) {
|
|
3349
|
+
this.cachedBootstrap = e;
|
|
3350
|
+
for (const t of [...this.bootstrapListeners])
|
|
3351
|
+
try {
|
|
3352
|
+
t(e);
|
|
3353
|
+
} catch (n) {
|
|
3354
|
+
console.warn("[paywall] onBootstrapChange listener threw", n);
|
|
3355
|
+
}
|
|
2297
3356
|
}
|
|
2298
3357
|
/** Обновить mirror user'а и эмитнуть listener'ам если он реально изменился.
|
|
2299
3358
|
* Используется и для self-инициированных RPC (bootstrap/getUser), и для
|
|
2300
3359
|
* broadcast'ов от offscreen — чтобы host'овский onUserChange handler
|
|
2301
3360
|
* получил signal независимо от того, кто триггернул обновление. */
|
|
2302
3361
|
applyUser(e) {
|
|
2303
|
-
|
|
3362
|
+
br(this.cachedUser, e) || (this.cachedUser = e, this.fireUserListeners(e));
|
|
2304
3363
|
}
|
|
2305
3364
|
applyBalances(e) {
|
|
2306
|
-
|
|
3365
|
+
wr(this.cachedBalances, e) || (this.cachedBalances = e, this.fireBalanceListeners(e));
|
|
2307
3366
|
}
|
|
2308
3367
|
fireUserListeners(e) {
|
|
2309
3368
|
for (const t of [...this.userListeners])
|
|
@@ -2322,22 +3381,22 @@ class ct {
|
|
|
2322
3381
|
}
|
|
2323
3382
|
}
|
|
2324
3383
|
}
|
|
2325
|
-
function
|
|
3384
|
+
function br(r, e) {
|
|
2326
3385
|
return r === e ? !0 : !r || !e ? !1 : r.has_active_subscription === e.has_active_subscription && (r.purchases?.length ?? 0) === (e.purchases?.length ?? 0);
|
|
2327
3386
|
}
|
|
2328
|
-
function
|
|
3387
|
+
function wr(r, e) {
|
|
2329
3388
|
if (r === e) return !0;
|
|
2330
3389
|
if (!r || !e || r.length !== e.length) return !1;
|
|
2331
3390
|
for (let t = 0; t < r.length; t++)
|
|
2332
3391
|
if (r[t].type !== e[t].type || r[t].count !== e[t].count) return !1;
|
|
2333
3392
|
return !0;
|
|
2334
3393
|
}
|
|
2335
|
-
class
|
|
3394
|
+
class kr {
|
|
2336
3395
|
constructor(e, t) {
|
|
2337
|
-
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", (n) => {
|
|
2338
|
-
this.applySession(n);
|
|
3396
|
+
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 }) => {
|
|
3397
|
+
this.applySession(n, i);
|
|
2339
3398
|
}), this.hydrated = this.transport.request("auth.getCachedSession", void 0).then((n) => {
|
|
2340
|
-
this.session === null && n !== null && this.
|
|
3399
|
+
this.session === null && n !== null && (this.session = n);
|
|
2341
3400
|
}).catch(() => {
|
|
2342
3401
|
});
|
|
2343
3402
|
}
|
|
@@ -2353,31 +3412,32 @@ class dt {
|
|
|
2353
3412
|
return this.session?.user ?? null;
|
|
2354
3413
|
}
|
|
2355
3414
|
onAuthChange(e) {
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
3415
|
+
return this.listeners.add(e), this.hydrated.then(() => {
|
|
3416
|
+
if (this.listeners.has(e))
|
|
3417
|
+
try {
|
|
3418
|
+
e("INITIAL_SESSION", this.session);
|
|
3419
|
+
} catch (t) {
|
|
3420
|
+
console.warn("[paywall] onAuthChange INITIAL_SESSION threw", t);
|
|
3421
|
+
}
|
|
3422
|
+
}), () => {
|
|
2363
3423
|
this.listeners.delete(e);
|
|
2364
3424
|
};
|
|
2365
3425
|
}
|
|
2366
3426
|
// === Email/password ===
|
|
2367
3427
|
async signInWithEmail(e) {
|
|
2368
3428
|
const t = await this.transport.request("auth.signInWithEmail", e);
|
|
2369
|
-
return this.applySession(t), t;
|
|
3429
|
+
return this.applySession("SIGNED_IN", t), t;
|
|
2370
3430
|
}
|
|
2371
3431
|
async signUp(e) {
|
|
2372
3432
|
const t = await this.transport.request("auth.signUp", e);
|
|
2373
|
-
return t.kind === "signed_in" && this.applySession(t.session), t;
|
|
3433
|
+
return t.kind === "signed_in" && this.applySession("SIGNED_IN", t.session), t;
|
|
2374
3434
|
}
|
|
2375
3435
|
async signOut() {
|
|
2376
3436
|
await this.transport.request("auth.signOut", void 0);
|
|
2377
3437
|
}
|
|
2378
3438
|
async refresh() {
|
|
2379
3439
|
const e = await this.transport.request("auth.refresh", void 0);
|
|
2380
|
-
return this.applySession(e), e;
|
|
3440
|
+
return this.applySession(e ? "TOKEN_REFRESHED" : "SIGNED_OUT", e), e;
|
|
2381
3441
|
}
|
|
2382
3442
|
// === OTP / password reset / confirmation ===
|
|
2383
3443
|
async sendOtp(e) {
|
|
@@ -2385,7 +3445,7 @@ class dt {
|
|
|
2385
3445
|
}
|
|
2386
3446
|
async verifyOtp(e) {
|
|
2387
3447
|
const t = await this.transport.request("auth.verifyOtp", e);
|
|
2388
|
-
return this.applySession(t), t;
|
|
3448
|
+
return this.applySession(e.type === "recovery" ? "PASSWORD_RECOVERY" : "SIGNED_IN", t), t;
|
|
2389
3449
|
}
|
|
2390
3450
|
async resendConfirmation(e) {
|
|
2391
3451
|
await this.transport.request("auth.resendConfirmation", e);
|
|
@@ -2399,18 +3459,24 @@ class dt {
|
|
|
2399
3459
|
async revokeAllSessions() {
|
|
2400
3460
|
await this.transport.request("auth.revokeAllSessions", void 0);
|
|
2401
3461
|
}
|
|
3462
|
+
/** Last-used auth method + email — читается из offscreen-storage. AuthPanel
|
|
3463
|
+
* использует для "Last used"-бейджа и pre-fill'а email. Storage paywall-
|
|
3464
|
+
* scoped, и offscreen — единый источник правды для всех вкладок/popup'ов. */
|
|
3465
|
+
async getLastLogin() {
|
|
3466
|
+
return this.transport.request("auth.getLastLogin", void 0);
|
|
3467
|
+
}
|
|
2402
3468
|
// === Anonymous sign-in ===
|
|
2403
3469
|
/** Анонимный sign-in (Supabase user без email). Логика (idempotent-check +
|
|
2404
3470
|
* resume через сохранённый refresh_token + fresh signin) живёт в
|
|
2405
3471
|
* offscreen-AuthClient'е — content только проксирует. captchaToken и
|
|
2406
|
-
*
|
|
3472
|
+
* forceNewAnon — pass-through для forward-compat / switch-account flow. */
|
|
2407
3473
|
async signInAnonymously(e = {}) {
|
|
2408
3474
|
const t = await this.transport.request("auth.signInAnonymously", {
|
|
2409
3475
|
captchaToken: e.captchaToken,
|
|
2410
3476
|
userMeta: e.userMeta,
|
|
2411
|
-
|
|
3477
|
+
forceNewAnon: e.forceNewAnon
|
|
2412
3478
|
});
|
|
2413
|
-
return this.applySession(t), t;
|
|
3479
|
+
return this.applySession("SIGNED_IN", t), t;
|
|
2414
3480
|
}
|
|
2415
3481
|
/** Текущий access token (lazy-refreshable в offscreen'е). content/popup
|
|
2416
3482
|
* использует для Bearer'а в внешние fetch'и — ApiGatewayClient в
|
|
@@ -2443,7 +3509,7 @@ class dt {
|
|
|
2443
3509
|
"popup_blocked",
|
|
2444
3510
|
"browser blocked auth popup — call from a user gesture"
|
|
2445
3511
|
);
|
|
2446
|
-
|
|
3512
|
+
Sr(n, e.provider);
|
|
2447
3513
|
try {
|
|
2448
3514
|
const { authorizeUrl: i, state: s } = await this.transport.request("auth.oauthStart", {
|
|
2449
3515
|
provider: e.provider,
|
|
@@ -2451,8 +3517,8 @@ class dt {
|
|
|
2451
3517
|
userMeta: e.userMeta
|
|
2452
3518
|
});
|
|
2453
3519
|
n.name = `pw-oauth-${s}`, n.location.replace(i), e.onPopupOpened?.();
|
|
2454
|
-
const
|
|
2455
|
-
return this.applySession(
|
|
3520
|
+
const a = await De(n, s), c = await this.transport.request("auth.oauthExchange", { state: s, code: a });
|
|
3521
|
+
return this.applySession("SIGNED_IN", c), c;
|
|
2456
3522
|
} catch (i) {
|
|
2457
3523
|
try {
|
|
2458
3524
|
n.close();
|
|
@@ -2464,29 +3530,29 @@ class dt {
|
|
|
2464
3530
|
destroy() {
|
|
2465
3531
|
this.unsubBroadcast?.(), this.unsubBroadcast = null, this.listeners.clear(), this.session = null;
|
|
2466
3532
|
}
|
|
2467
|
-
applySession(e) {
|
|
2468
|
-
if (!
|
|
2469
|
-
this.session =
|
|
2470
|
-
for (const
|
|
3533
|
+
applySession(e, t) {
|
|
3534
|
+
if (!vr(this.session, t)) {
|
|
3535
|
+
this.session = t;
|
|
3536
|
+
for (const n of [...this.listeners])
|
|
2471
3537
|
try {
|
|
2472
|
-
|
|
2473
|
-
} catch (
|
|
2474
|
-
console.warn("[paywall] onAuthChange listener threw",
|
|
3538
|
+
n(e, t);
|
|
3539
|
+
} catch (i) {
|
|
3540
|
+
console.warn("[paywall] onAuthChange listener threw", i);
|
|
2475
3541
|
}
|
|
2476
3542
|
}
|
|
2477
3543
|
}
|
|
2478
3544
|
}
|
|
2479
|
-
function
|
|
3545
|
+
function vr(r, e) {
|
|
2480
3546
|
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;
|
|
2481
3547
|
}
|
|
2482
|
-
const
|
|
3548
|
+
const _r = {
|
|
2483
3549
|
google: "Google",
|
|
2484
3550
|
apple: "Apple",
|
|
2485
3551
|
github: "GitHub",
|
|
2486
3552
|
facebook: "Facebook"
|
|
2487
3553
|
};
|
|
2488
|
-
function
|
|
2489
|
-
const t =
|
|
3554
|
+
function Sr(r, e) {
|
|
3555
|
+
const t = _r[e] ?? e;
|
|
2490
3556
|
try {
|
|
2491
3557
|
const n = r.document;
|
|
2492
3558
|
n.title = `Sign in with ${t}`;
|
|
@@ -2494,14 +3560,14 @@ function gt(r, e) {
|
|
|
2494
3560
|
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);
|
|
2495
3561
|
const s = n.createElement("div");
|
|
2496
3562
|
s.className = "pw-oauth-wrap";
|
|
2497
|
-
const l = n.createElement("div");
|
|
2498
|
-
l.className = "pw-oauth-spinner";
|
|
2499
3563
|
const a = n.createElement("div");
|
|
2500
|
-
a.className = "pw-oauth-
|
|
3564
|
+
a.className = "pw-oauth-spinner";
|
|
3565
|
+
const c = n.createElement("div");
|
|
3566
|
+
c.className = "pw-oauth-label", c.textContent = `Connecting to ${t}…`, s.appendChild(a), s.appendChild(c), n.body.appendChild(s);
|
|
2501
3567
|
} catch {
|
|
2502
3568
|
}
|
|
2503
3569
|
}
|
|
2504
|
-
class
|
|
3570
|
+
class Cr {
|
|
2505
3571
|
constructor(e) {
|
|
2506
3572
|
this.transport = e;
|
|
2507
3573
|
}
|
|
@@ -2513,7 +3579,7 @@ class mt {
|
|
|
2513
3579
|
});
|
|
2514
3580
|
}
|
|
2515
3581
|
}
|
|
2516
|
-
class
|
|
3582
|
+
class Ir {
|
|
2517
3583
|
constructor(e) {
|
|
2518
3584
|
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)}`;
|
|
2519
3585
|
}
|
|
@@ -2527,21 +3593,21 @@ class yt {
|
|
|
2527
3593
|
this.channel = e;
|
|
2528
3594
|
const t = e.onMessage((i) => this.handleMessage(i)), n = e.onDisconnect(() => this.handleDisconnect());
|
|
2529
3595
|
return this.channelDisposers = [t, n], this.request("handshake", {
|
|
2530
|
-
protocolVersion:
|
|
3596
|
+
protocolVersion: X,
|
|
2531
3597
|
clientId: this.clientId
|
|
2532
3598
|
}).then((i) => {
|
|
2533
|
-
i.protocolVersion !==
|
|
2534
|
-
`[sdk-extension] protocol version mismatch: client=${
|
|
3599
|
+
i.protocolVersion !== X && console.warn(
|
|
3600
|
+
`[sdk-extension] protocol version mismatch: client=${X}, offscreen=${i.protocolVersion}. Update host's @monetize.software/sdk-extension.`
|
|
2535
3601
|
);
|
|
2536
3602
|
}).catch(() => {
|
|
2537
3603
|
}), e;
|
|
2538
3604
|
}
|
|
2539
3605
|
handleMessage(e) {
|
|
2540
|
-
if (
|
|
3606
|
+
if (Lr(e)) {
|
|
2541
3607
|
if (e.type === "response") {
|
|
2542
3608
|
const t = this.pending.get(e.id);
|
|
2543
3609
|
if (!t) return;
|
|
2544
|
-
this.pending.delete(e.id), t.signal?.removeEventListener("abort", t.abortListener), e.ok ? t.resolve(e.result) : t.reject(
|
|
3610
|
+
this.pending.delete(e.id), t.signal?.removeEventListener("abort", t.abortListener), e.ok ? t.resolve(e.result) : t.reject(qe(e.error));
|
|
2545
3611
|
return;
|
|
2546
3612
|
}
|
|
2547
3613
|
if (e.type === "event") {
|
|
@@ -2562,7 +3628,7 @@ class yt {
|
|
|
2562
3628
|
const e = Array.from(this.pending.values());
|
|
2563
3629
|
this.pending.clear();
|
|
2564
3630
|
for (const t of e)
|
|
2565
|
-
t.signal?.removeEventListener("abort", t.abortListener), t.reject(new
|
|
3631
|
+
t.signal?.removeEventListener("abort", t.abortListener), t.reject(new Ar());
|
|
2566
3632
|
}
|
|
2567
3633
|
request(e, t, n = {}) {
|
|
2568
3634
|
if (this.destroyed)
|
|
@@ -2570,31 +3636,31 @@ class yt {
|
|
|
2570
3636
|
if (n.signal?.aborted)
|
|
2571
3637
|
return Promise.reject(new DOMException("Aborted", "AbortError"));
|
|
2572
3638
|
const i = this.ensureChannel(), s = `r${++this.nextId}`;
|
|
2573
|
-
return new Promise((
|
|
2574
|
-
const
|
|
2575
|
-
resolve:
|
|
2576
|
-
reject:
|
|
3639
|
+
return new Promise((a, c) => {
|
|
3640
|
+
const l = {
|
|
3641
|
+
resolve: a,
|
|
3642
|
+
reject: c,
|
|
2577
3643
|
signal: n.signal
|
|
2578
3644
|
};
|
|
2579
|
-
n.signal && (
|
|
3645
|
+
n.signal && (l.abortListener = () => {
|
|
2580
3646
|
if (this.pending.delete(s)) {
|
|
2581
|
-
|
|
3647
|
+
c(new DOMException("Aborted", "AbortError"));
|
|
2582
3648
|
try {
|
|
2583
3649
|
i.send({ type: "cancel", id: s });
|
|
2584
3650
|
} catch {
|
|
2585
3651
|
}
|
|
2586
3652
|
}
|
|
2587
|
-
}, n.signal.addEventListener("abort",
|
|
2588
|
-
const
|
|
3653
|
+
}, n.signal.addEventListener("abort", l.abortListener)), this.pending.set(s, l);
|
|
3654
|
+
const f = {
|
|
2589
3655
|
type: "request",
|
|
2590
3656
|
id: s,
|
|
2591
3657
|
kind: e,
|
|
2592
3658
|
params: t
|
|
2593
3659
|
};
|
|
2594
3660
|
try {
|
|
2595
|
-
i.send(
|
|
2596
|
-
} catch (
|
|
2597
|
-
this.pending.delete(s), n.signal?.removeEventListener("abort",
|
|
3661
|
+
i.send(f);
|
|
3662
|
+
} catch (h) {
|
|
3663
|
+
this.pending.delete(s), n.signal?.removeEventListener("abort", l.abortListener), c(h);
|
|
2598
3664
|
}
|
|
2599
3665
|
});
|
|
2600
3666
|
}
|
|
@@ -2618,28 +3684,28 @@ class yt {
|
|
|
2618
3684
|
this.channel?.close(), this.channel = null;
|
|
2619
3685
|
}
|
|
2620
3686
|
}
|
|
2621
|
-
class
|
|
3687
|
+
class Ar extends Error {
|
|
2622
3688
|
constructor() {
|
|
2623
3689
|
super("Transport channel disconnected mid-request"), this.code = "transport_disconnected", this.name = "TransportDisconnectedError";
|
|
2624
3690
|
}
|
|
2625
3691
|
}
|
|
2626
|
-
function
|
|
3692
|
+
function Lr(r) {
|
|
2627
3693
|
if (typeof r != "object" || r === null) return !1;
|
|
2628
3694
|
const e = r.type;
|
|
2629
3695
|
return e === "request" || e === "response" || e === "event";
|
|
2630
3696
|
}
|
|
2631
|
-
let
|
|
2632
|
-
function
|
|
2633
|
-
return
|
|
3697
|
+
let W = null;
|
|
3698
|
+
function Mr() {
|
|
3699
|
+
return W || (W = new Ir(() => Ne(Ge)), W);
|
|
2634
3700
|
}
|
|
2635
|
-
class
|
|
3701
|
+
class jr extends ur {
|
|
2636
3702
|
constructor(e) {
|
|
2637
|
-
const t =
|
|
3703
|
+
const t = Mr(), n = new xr(t, {
|
|
2638
3704
|
paywallId: e.paywallId,
|
|
2639
3705
|
apiOrigin: e.apiOrigin
|
|
2640
3706
|
});
|
|
2641
3707
|
let i;
|
|
2642
|
-
e.auth === !0 ? i = new
|
|
3708
|
+
e.auth === !0 ? i = new kr(t, {
|
|
2643
3709
|
paywallId: e.paywallId,
|
|
2644
3710
|
apiOrigin: e.apiOrigin
|
|
2645
3711
|
}) : e.auth && console.warn(
|
|
@@ -2655,7 +3721,7 @@ class Tt extends tt {
|
|
|
2655
3721
|
// Внутренний EventTracker отключаем — единственный tracker живёт в
|
|
2656
3722
|
// offscreen'е. Манчиально подписываемся ниже.
|
|
2657
3723
|
analytics: !1
|
|
2658
|
-
}), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new
|
|
3724
|
+
}), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new Cr(t), this.bindAnalytics());
|
|
2659
3725
|
}
|
|
2660
3726
|
/** Зеркало sdk/PaywallUI.initTracker'овских биндингов, но с RemoteEventTracker.
|
|
2661
3727
|
* Когда @monetize.software/sdk экспоузнет публичный hook для inject'а tracker'а,
|
|
@@ -2713,11 +3779,11 @@ class Tt extends tt {
|
|
|
2713
3779
|
}
|
|
2714
3780
|
}
|
|
2715
3781
|
export {
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
3782
|
+
X as PROTOCOL_VERSION,
|
|
3783
|
+
jr as PaywallUI,
|
|
3784
|
+
kr as RemoteAuthClient,
|
|
3785
|
+
xr as RemoteBillingClient,
|
|
3786
|
+
Cr as RemoteEventTracker,
|
|
3787
|
+
Mr as getContentTransport
|
|
2722
3788
|
};
|
|
2723
3789
|
//# sourceMappingURL=content.js.map
|