@monetize.software/sdk-extension 3.0.0-alpha.23 → 3.0.0-alpha.25
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/dist/content.cjs +3 -3
- package/dist/content.cjs.map +1 -1
- package/dist/content.js +359 -352
- package/dist/content.js.map +1 -1
- package/package.json +3 -3
package/dist/content.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { P as L, B as
|
|
2
|
-
import { render as
|
|
3
|
-
import { jsx as o, jsxs as u, Fragment as
|
|
4
|
-
import { useState as k, useEffect as P, useContext as
|
|
5
|
-
import { P as
|
|
6
|
-
function
|
|
1
|
+
import { P as L, B as qe, E as Ne, c as Fe, A as de, w as Ve, a as Q, r as $e, b as He } from "./chunks/chrome-port-bfTUUDz_.js";
|
|
2
|
+
import { render as ee, h as he, createContext as Ge } from "preact";
|
|
3
|
+
import { jsx as o, jsxs as u, Fragment as le } from "preact/jsx-runtime";
|
|
4
|
+
import { useState as k, useEffect as P, useContext as We, useRef as j, useMemo as Ze, useLayoutEffect as Ye } from "preact/hooks";
|
|
5
|
+
import { P as Ke } from "./chunks/port-name-ervLBWAQ.js";
|
|
6
|
+
function Xe(r) {
|
|
7
7
|
return `pw-offer-${r}-start`;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function Ce(r, e) {
|
|
10
10
|
if (!r || r.length === 0) return null;
|
|
11
11
|
const t = r.find(
|
|
12
12
|
(i) => i.price_id === e && (i.discount_percent ?? 0) > 0
|
|
@@ -15,13 +15,17 @@ function N(r, e) {
|
|
|
15
15
|
(i) => i.price_id == null && (i.discount_percent ?? 0) > 0
|
|
16
16
|
) ?? null);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function $(r, e, t = {}) {
|
|
19
|
+
const n = Ce(r, e);
|
|
20
|
+
return n && Ie(n, t) ? n : null;
|
|
21
|
+
}
|
|
22
|
+
function Ie(r, e = {}) {
|
|
19
23
|
const t = r.discount_percent ?? 0;
|
|
20
24
|
if (t <= 0) return null;
|
|
21
|
-
const n = e.now ?? Date.now(), i =
|
|
25
|
+
const n = e.now ?? Date.now(), i = Je(r, e.readStart), s = Qe(r, i), a = i !== null ? Math.max(0, i - n) : null;
|
|
22
26
|
return i !== null && i <= n ? null : { offer: r, discountPercent: t, remainingMs: a, totalMs: s, expiresAt: i };
|
|
23
27
|
}
|
|
24
|
-
function
|
|
28
|
+
function Je(r, e) {
|
|
25
29
|
if (r.expires_at) {
|
|
26
30
|
const t = Date.parse(r.expires_at);
|
|
27
31
|
return Number.isFinite(t) ? t : null;
|
|
@@ -34,25 +38,25 @@ function Ke(r, e) {
|
|
|
34
38
|
}
|
|
35
39
|
return null;
|
|
36
40
|
}
|
|
37
|
-
function
|
|
41
|
+
function Qe(r, e) {
|
|
38
42
|
return r.duration_minutes && r.duration_minutes > 0 ? r.duration_minutes * 6e4 : e !== null ? e - Date.now() : null;
|
|
39
43
|
}
|
|
40
|
-
function
|
|
44
|
+
function N(r) {
|
|
41
45
|
if (typeof window > "u") return null;
|
|
42
46
|
try {
|
|
43
|
-
return window.localStorage.getItem(
|
|
47
|
+
return window.localStorage.getItem(Xe(r));
|
|
44
48
|
} catch {
|
|
45
49
|
return null;
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
|
-
const Se = '@layer theme,base,components,utilities;@layer theme{@theme default{ --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; --color-red-50: oklch(97.1% .013 17.38); --color-red-100: oklch(93.6% .032 17.717); --color-red-200: oklch(88.5% .062 18.334); --color-red-300: oklch(80.8% .114 19.571); --color-red-400: oklch(70.4% .191 22.216); --color-red-500: oklch(63.7% .237 25.331); --color-red-600: oklch(57.7% .245 27.325); --color-red-700: oklch(50.5% .213 27.518); --color-red-800: oklch(44.4% .177 26.899); --color-red-900: oklch(39.6% .141 25.723); --color-red-950: oklch(25.8% .092 26.042); --color-orange-50: oklch(98% .016 73.684); --color-orange-100: oklch(95.4% .038 75.164); --color-orange-200: oklch(90.1% .076 70.697); --color-orange-300: oklch(83.7% .128 66.29); --color-orange-400: oklch(75% .183 55.934); --color-orange-500: oklch(70.5% .213 47.604); --color-orange-600: oklch(64.6% .222 41.116); --color-orange-700: oklch(55.3% .195 38.402); --color-orange-800: oklch(47% .157 37.304); --color-orange-900: oklch(40.8% .123 38.172); --color-orange-950: oklch(26.6% .079 36.259); --color-amber-50: oklch(98.7% .022 95.277); --color-amber-100: oklch(96.2% .059 95.617); --color-amber-200: oklch(92.4% .12 95.746); --color-amber-300: oklch(87.9% .169 91.605); --color-amber-400: oklch(82.8% .189 84.429); --color-amber-500: oklch(76.9% .188 70.08); --color-amber-600: oklch(66.6% .179 58.318); --color-amber-700: oklch(55.5% .163 48.998); --color-amber-800: oklch(47.3% .137 46.201); --color-amber-900: oklch(41.4% .112 45.904); --color-amber-950: oklch(27.9% .077 45.635); --color-yellow-50: oklch(98.7% .026 102.212); --color-yellow-100: oklch(97.3% .071 103.193); --color-yellow-200: oklch(94.5% .129 101.54); --color-yellow-300: oklch(90.5% .182 98.111); --color-yellow-400: oklch(85.2% .199 91.936); --color-yellow-500: oklch(79.5% .184 86.047); --color-yellow-600: oklch(68.1% .162 75.834); --color-yellow-700: oklch(55.4% .135 66.442); --color-yellow-800: oklch(47.6% .114 61.907); --color-yellow-900: oklch(42.1% .095 57.708); --color-yellow-950: oklch(28.6% .066 53.813); --color-lime-50: oklch(98.6% .031 120.757); --color-lime-100: oklch(96.7% .067 122.328); --color-lime-200: oklch(93.8% .127 124.321); --color-lime-300: oklch(89.7% .196 126.665); --color-lime-400: oklch(84.1% .238 128.85); --color-lime-500: oklch(76.8% .233 130.85); --color-lime-600: oklch(64.8% .2 131.684); --color-lime-700: oklch(53.2% .157 131.589); --color-lime-800: oklch(45.3% .124 130.933); --color-lime-900: oklch(40.5% .101 131.063); --color-lime-950: oklch(27.4% .072 132.109); --color-green-50: oklch(98.2% .018 155.826); --color-green-100: oklch(96.2% .044 156.743); --color-green-200: oklch(92.5% .084 155.995); --color-green-300: oklch(87.1% .15 154.449); --color-green-400: oklch(79.2% .209 151.711); --color-green-500: oklch(72.3% .219 149.579); --color-green-600: oklch(62.7% .194 149.214); --color-green-700: oklch(52.7% .154 150.069); --color-green-800: oklch(44.8% .119 151.328); --color-green-900: oklch(39.3% .095 152.535); --color-green-950: oklch(26.6% .065 152.934); --color-emerald-50: oklch(97.9% .021 166.113); --color-emerald-100: oklch(95% .052 163.051); --color-emerald-200: oklch(90.5% .093 164.15); --color-emerald-300: oklch(84.5% .143 164.978); --color-emerald-400: oklch(76.5% .177 163.223); --color-emerald-500: oklch(69.6% .17 162.48); --color-emerald-600: oklch(59.6% .145 163.225); --color-emerald-700: oklch(50.8% .118 165.612); --color-emerald-800: oklch(43.2% .095 166.913); --color-emerald-900: oklch(37.8% .077 168.94); --color-emerald-950: oklch(26.2% .051 172.552); --color-teal-50: oklch(98.4% .014 180.72); --color-teal-100: oklch(95.3% .051 180.801); --color-teal-200: oklch(91% .096 180.426); --color-teal-300: oklch(85.5% .138 181.071); --color-teal-400: oklch(77.7% .152 181.912); --color-teal-500: oklch(70.4% .14 182.503); --color-teal-600: oklch(60% .118 184.704); --color-teal-700: oklch(51.1% .096 186.391); --color-teal-800: oklch(43.7% .078 188.216); --color-teal-900: oklch(38.6% .063 188.416); --color-teal-950: oklch(27.7% .046 192.524); --color-cyan-50: oklch(98.4% .019 200.873); --color-cyan-100: oklch(95.6% .045 203.388); --color-cyan-200: oklch(91.7% .08 205.041); --color-cyan-300: oklch(86.5% .127 207.078); --color-cyan-400: oklch(78.9% .154 211.53); --color-cyan-500: oklch(71.5% .143 215.221); --color-cyan-600: oklch(60.9% .126 221.723); --color-cyan-700: oklch(52% .105 223.128); --color-cyan-800: oklch(45% .085 224.283); --color-cyan-900: oklch(39.8% .07 227.392); --color-cyan-950: oklch(30.2% .056 229.695); --color-sky-50: oklch(97.7% .013 236.62); --color-sky-100: oklch(95.1% .026 236.824); --color-sky-200: oklch(90.1% .058 230.902); --color-sky-300: oklch(82.8% .111 230.318); --color-sky-400: oklch(74.6% .16 232.661); --color-sky-500: oklch(68.5% .169 237.323); --color-sky-600: oklch(58.8% .158 241.966); --color-sky-700: oklch(50% .134 242.749); --color-sky-800: oklch(44.3% .11 240.79); --color-sky-900: oklch(39.1% .09 240.876); --color-sky-950: oklch(29.3% .066 243.157); --color-blue-50: oklch(97% .014 254.604); --color-blue-100: oklch(93.2% .032 255.585); --color-blue-200: oklch(88.2% .059 254.128); --color-blue-300: oklch(80.9% .105 251.813); --color-blue-400: oklch(70.7% .165 254.624); --color-blue-500: oklch(62.3% .214 259.815); --color-blue-600: oklch(54.6% .245 262.881); --color-blue-700: oklch(48.8% .243 264.376); --color-blue-800: oklch(42.4% .199 265.638); --color-blue-900: oklch(37.9% .146 265.522); --color-blue-950: oklch(28.2% .091 267.935); --color-indigo-50: oklch(96.2% .018 272.314); --color-indigo-100: oklch(93% .034 272.788); --color-indigo-200: oklch(87% .065 274.039); --color-indigo-300: oklch(78.5% .115 274.713); --color-indigo-400: oklch(67.3% .182 276.935); --color-indigo-500: oklch(58.5% .233 277.117); --color-indigo-600: oklch(51.1% .262 276.966); --color-indigo-700: oklch(45.7% .24 277.023); --color-indigo-800: oklch(39.8% .195 277.366); --color-indigo-900: oklch(35.9% .144 278.697); --color-indigo-950: oklch(25.7% .09 281.288); --color-violet-50: oklch(96.9% .016 293.756); --color-violet-100: oklch(94.3% .029 294.588); --color-violet-200: oklch(89.4% .057 293.283); --color-violet-300: oklch(81.1% .111 293.571); --color-violet-400: oklch(70.2% .183 293.541); --color-violet-500: oklch(60.6% .25 292.717); --color-violet-600: oklch(54.1% .281 293.009); --color-violet-700: oklch(49.1% .27 292.581); --color-violet-800: oklch(43.2% .232 292.759); --color-violet-900: oklch(38% .189 293.745); --color-violet-950: oklch(28.3% .141 291.089); --color-purple-50: oklch(97.7% .014 308.299); --color-purple-100: oklch(94.6% .033 307.174); --color-purple-200: oklch(90.2% .063 306.703); --color-purple-300: oklch(82.7% .119 306.383); --color-purple-400: oklch(71.4% .203 305.504); --color-purple-500: oklch(62.7% .265 303.9); --color-purple-600: oklch(55.8% .288 302.321); --color-purple-700: oklch(49.6% .265 301.924); --color-purple-800: oklch(43.8% .218 303.724); --color-purple-900: oklch(38.1% .176 304.987); --color-purple-950: oklch(29.1% .149 302.717); --color-fuchsia-50: oklch(97.7% .017 320.058); --color-fuchsia-100: oklch(95.2% .037 318.852); --color-fuchsia-200: oklch(90.3% .076 319.62); --color-fuchsia-300: oklch(83.3% .145 321.434); --color-fuchsia-400: oklch(74% .238 322.16); --color-fuchsia-500: oklch(66.7% .295 322.15); --color-fuchsia-600: oklch(59.1% .293 322.896); --color-fuchsia-700: oklch(51.8% .253 323.949); --color-fuchsia-800: oklch(45.2% .211 324.591); --color-fuchsia-900: oklch(40.1% .17 325.612); --color-fuchsia-950: oklch(29.3% .136 325.661); --color-pink-50: oklch(97.1% .014 343.198); --color-pink-100: oklch(94.8% .028 342.258); --color-pink-200: oklch(89.9% .061 343.231); --color-pink-300: oklch(82.3% .12 346.018); --color-pink-400: oklch(71.8% .202 349.761); --color-pink-500: oklch(65.6% .241 354.308); --color-pink-600: oklch(59.2% .249 .584); --color-pink-700: oklch(52.5% .223 3.958); --color-pink-800: oklch(45.9% .187 3.815); --color-pink-900: oklch(40.8% .153 2.432); --color-pink-950: oklch(28.4% .109 3.907); --color-rose-50: oklch(96.9% .015 12.422); --color-rose-100: oklch(94.1% .03 12.58); --color-rose-200: oklch(89.2% .058 10.001); --color-rose-300: oklch(81% .117 11.638); --color-rose-400: oklch(71.2% .194 13.428); --color-rose-500: oklch(64.5% .246 16.439); --color-rose-600: oklch(58.6% .253 17.585); --color-rose-700: oklch(51.4% .222 16.935); --color-rose-800: oklch(45.5% .188 13.697); --color-rose-900: oklch(41% .159 10.272); --color-rose-950: oklch(27.1% .105 12.094); --color-slate-50: oklch(98.4% .003 247.858); --color-slate-100: oklch(96.8% .007 247.896); --color-slate-200: oklch(92.9% .013 255.508); --color-slate-300: oklch(86.9% .022 252.894); --color-slate-400: oklch(70.4% .04 256.788); --color-slate-500: oklch(55.4% .046 257.417); --color-slate-600: oklch(44.6% .043 257.281); --color-slate-700: oklch(37.2% .044 257.287); --color-slate-800: oklch(27.9% .041 260.031); --color-slate-900: oklch(20.8% .042 265.755); --color-slate-950: oklch(12.9% .042 264.695); --color-gray-50: oklch(98.5% .002 247.839); --color-gray-100: oklch(96.7% .003 264.542); --color-gray-200: oklch(92.8% .006 264.531); --color-gray-300: oklch(87.2% .01 258.338); --color-gray-400: oklch(70.7% .022 261.325); --color-gray-500: oklch(55.1% .027 264.364); --color-gray-600: oklch(44.6% .03 256.802); --color-gray-700: oklch(37.3% .034 259.733); --color-gray-800: oklch(27.8% .033 256.848); --color-gray-900: oklch(21% .034 264.665); --color-gray-950: oklch(13% .028 261.692); --color-zinc-50: oklch(98.5% 0 0); --color-zinc-100: oklch(96.7% .001 286.375); --color-zinc-200: oklch(92% .004 286.32); --color-zinc-300: oklch(87.1% .006 286.286); --color-zinc-400: oklch(70.5% .015 286.067); --color-zinc-500: oklch(55.2% .016 285.938); --color-zinc-600: oklch(44.2% .017 285.786); --color-zinc-700: oklch(37% .013 285.805); --color-zinc-800: oklch(27.4% .006 286.033); --color-zinc-900: oklch(21% .006 285.885); --color-zinc-950: oklch(14.1% .005 285.823); --color-neutral-50: oklch(98.5% 0 0); --color-neutral-100: oklch(97% 0 0); --color-neutral-200: oklch(92.2% 0 0); --color-neutral-300: oklch(87% 0 0); --color-neutral-400: oklch(70.8% 0 0); --color-neutral-500: oklch(55.6% 0 0); --color-neutral-600: oklch(43.9% 0 0); --color-neutral-700: oklch(37.1% 0 0); --color-neutral-800: oklch(26.9% 0 0); --color-neutral-900: oklch(20.5% 0 0); --color-neutral-950: oklch(14.5% 0 0); --color-stone-50: oklch(98.5% .001 106.423); --color-stone-100: oklch(97% .001 106.424); --color-stone-200: oklch(92.3% .003 48.717); --color-stone-300: oklch(86.9% .005 56.366); --color-stone-400: oklch(70.9% .01 56.259); --color-stone-500: oklch(55.3% .013 58.071); --color-stone-600: oklch(44.4% .011 73.639); --color-stone-700: oklch(37.4% .01 67.558); --color-stone-800: oklch(26.8% .007 34.298); --color-stone-900: oklch(21.6% .006 56.043); --color-stone-950: oklch(14.7% .004 49.25); --color-mauve-50: oklch(98.5% 0 0); --color-mauve-100: oklch(96% .003 325.6); --color-mauve-200: oklch(92.2% .005 325.62); --color-mauve-300: oklch(86.5% .012 325.68); --color-mauve-400: oklch(71.1% .019 323.02); --color-mauve-500: oklch(54.2% .034 322.5); --color-mauve-600: oklch(43.5% .029 321.78); --color-mauve-700: oklch(36.4% .029 323.89); --color-mauve-800: oklch(26.3% .024 320.12); --color-mauve-900: oklch(21.2% .019 322.12); --color-mauve-950: oklch(14.5% .008 326); --color-olive-50: oklch(98.8% .003 106.5); --color-olive-100: oklch(96.6% .005 106.5); --color-olive-200: oklch(93% .007 106.5); --color-olive-300: oklch(88% .011 106.6); --color-olive-400: oklch(73.7% .021 106.9); --color-olive-500: oklch(58% .031 107.3); --color-olive-600: oklch(46.6% .025 107.3); --color-olive-700: oklch(39.4% .023 107.4); --color-olive-800: oklch(28.6% .016 107.4); --color-olive-900: oklch(22.8% .013 107.4); --color-olive-950: oklch(15.3% .006 107.1); --color-mist-50: oklch(98.7% .002 197.1); --color-mist-100: oklch(96.3% .002 197.1); --color-mist-200: oklch(92.5% .005 214.3); --color-mist-300: oklch(87.2% .007 219.6); --color-mist-400: oklch(72.3% .014 214.4); --color-mist-500: oklch(56% .021 213.5); --color-mist-600: oklch(45% .017 213.2); --color-mist-700: oklch(37.8% .015 216); --color-mist-800: oklch(27.5% .011 216.9); --color-mist-900: oklch(21.8% .008 223.9); --color-mist-950: oklch(14.8% .004 228.8); --color-taupe-50: oklch(98.6% .002 67.8); --color-taupe-100: oklch(96% .002 17.2); --color-taupe-200: oklch(92.2% .005 34.3); --color-taupe-300: oklch(86.8% .007 39.5); --color-taupe-400: oklch(71.4% .014 41.2); --color-taupe-500: oklch(54.7% .021 43.1); --color-taupe-600: oklch(43.8% .017 39.3); --color-taupe-700: oklch(36.7% .016 35.7); --color-taupe-800: oklch(26.8% .011 36.5); --color-taupe-900: oklch(21.4% .009 43.1); --color-taupe-950: oklch(14.7% .004 49.3); --color-black: #000; --color-white: #fff; --spacing: .25rem; --breakpoint-sm: 40rem; --breakpoint-md: 48rem; --breakpoint-lg: 64rem; --breakpoint-xl: 80rem; --breakpoint-2xl: 96rem; --container-3xs: 16rem; --container-2xs: 18rem; --container-xs: 20rem; --container-sm: 24rem; --container-md: 28rem; --container-lg: 32rem; --container-xl: 36rem; --container-2xl: 42rem; --container-3xl: 48rem; --container-4xl: 56rem; --container-5xl: 64rem; --container-6xl: 72rem; --container-7xl: 80rem; --text-xs: .75rem; --text-xs--line-height: calc(1 / .75); --text-sm: .875rem; --text-sm--line-height: calc(1.25 / .875); --text-base: 1rem; --text-base--line-height: 1.5 ; --text-lg: 1.125rem; --text-lg--line-height: calc(1.75 / 1.125); --text-xl: 1.25rem; --text-xl--line-height: calc(1.75 / 1.25); --text-2xl: 1.5rem; --text-2xl--line-height: calc(2 / 1.5); --text-3xl: 1.875rem; --text-3xl--line-height: 1.2 ; --text-4xl: 2.25rem; --text-4xl--line-height: calc(2.5 / 2.25); --text-5xl: 3rem; --text-5xl--line-height: 1; --text-6xl: 3.75rem; --text-6xl--line-height: 1; --text-7xl: 4.5rem; --text-7xl--line-height: 1; --text-8xl: 6rem; --text-8xl--line-height: 1; --text-9xl: 8rem; --text-9xl--line-height: 1; --font-weight-thin: 100; --font-weight-extralight: 200; --font-weight-light: 300; --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700; --font-weight-extrabold: 800; --font-weight-black: 900; --tracking-tighter: -.05em; --tracking-tight: -.025em; --tracking-normal: 0em; --tracking-wide: .025em; --tracking-wider: .05em; --tracking-widest: .1em; --leading-tight: 1.25; --leading-snug: 1.375; --leading-normal: 1.5; --leading-relaxed: 1.625; --leading-loose: 2; --radius-xs: .125rem; --radius-sm: .25rem; --radius-md: .375rem; --radius-lg: .5rem; --radius-xl: .75rem; --radius-2xl: 1rem; --radius-3xl: 1.5rem; --radius-4xl: 2rem; --shadow-2xs: 0 1px rgb(0 0 0 / .05); --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05); --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1); --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1); --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25); --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / .05); --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / .05); --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / .05); --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / .05); --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / .15); --drop-shadow-md: 0 3px 3px rgb(0 0 0 / .12); --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / .15); --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / .1); --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / .15); --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / .15); --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / .2); --text-shadow-sm: 0px 1px 0px rgb(0 0 0 / .075), 0px 1px 1px rgb(0 0 0 / .075), 0px 2px 2px rgb(0 0 0 / .075); --text-shadow-md: 0px 1px 1px rgb(0 0 0 / .1), 0px 1px 2px rgb(0 0 0 / .1), 0px 2px 4px rgb(0 0 0 / .1); --text-shadow-lg: 0px 1px 2px rgb(0 0 0 / .1), 0px 3px 2px rgb(0 0 0 / .1), 0px 4px 8px rgb(0 0 0 / .1); --ease-in: cubic-bezier(.4, 0, 1, 1); --ease-out: cubic-bezier(0, 0, .2, 1); --ease-in-out: cubic-bezier(.4, 0, .2, 1); --animate-spin: spin 1s linear infinite; --animate-ping: ping 1s cubic-bezier(0, 0, .2, 1) infinite; --animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; --animate-bounce: bounce 1s infinite; @keyframes spin { to { transform: rotate(360deg); } } @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } } @keyframes pulse { 50% { opacity: .5; } } @keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); } 50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); } } --blur-xs: 4px; --blur-sm: 8px; --blur-md: 12px; --blur-lg: 16px; --blur-xl: 24px; --blur-2xl: 40px; --blur-3xl: 64px; --perspective-dramatic: 100px; --perspective-near: 300px; --perspective-normal: 500px; --perspective-midrange: 800px; --perspective-distant: 1200px; --aspect-video: 16 / 9; --default-transition-duration: .15s; --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1); --default-font-family: --theme(--font-sans, initial); --default-font-feature-settings: --theme( --font-sans--font-feature-settings, initial ); --default-font-variation-settings: --theme( --font-sans--font-variation-settings, initial ); --default-mono-font-family: --theme(--font-mono, initial); --default-mono-font-feature-settings: --theme( --font-mono--font-feature-settings, initial ); --default-mono-font-variation-settings: --theme( --font-mono--font-variation-settings, initial ); }@theme default inline reference{ --blur: 8px; --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / .05); --drop-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 1px 1px rgb(0 0 0 / .06); --radius: .25rem; --max-width-prose: 65ch; }}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:--theme(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:--theme(--default-font-feature-settings,normal);font-variation-settings:--theme(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:--theme(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:--theme(--default-mono-font-feature-settings,normal);font-variation-settings:--theme(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{@tailwind utilities;}@source "../**/*.{ts,tsx,js,jsx}";@layer base{:host{all:initial;color-scheme:light;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}*,*:before,*:after{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*,*:before,*:after{box-sizing:border-box}button{font-family:inherit;cursor:pointer}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}.pw-cta-shimmer:before{content:"";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.35) 50%,transparent);animation:pw-cta-shimmer 3s infinite;z-index:1}@keyframes pw-cta-shimmer{0%{left:-100%}to{left:100%}}';
|
|
49
|
-
let
|
|
50
|
-
function
|
|
51
|
-
if (
|
|
52
|
+
const Ae = '@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%}}';
|
|
53
|
+
let pe = !1;
|
|
54
|
+
function et() {
|
|
55
|
+
if (pe || (pe = !0, typeof CSS > "u" || typeof CSS.registerProperty != "function")) return;
|
|
52
56
|
let r;
|
|
53
57
|
try {
|
|
54
58
|
const e = new CSSStyleSheet();
|
|
55
|
-
e.replaceSync(
|
|
59
|
+
e.replaceSync(Ae), r = e.cssRules;
|
|
56
60
|
} catch {
|
|
57
61
|
return;
|
|
58
62
|
}
|
|
@@ -70,10 +74,10 @@ function Qe() {
|
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
|
-
function
|
|
77
|
+
function tt(r, e, t = {}) {
|
|
74
78
|
if (typeof document > "u")
|
|
75
79
|
throw new Error("mountShadow called in non-DOM environment");
|
|
76
|
-
|
|
80
|
+
et();
|
|
77
81
|
const n = t.host ?? document.createElement("div");
|
|
78
82
|
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);
|
|
79
83
|
const i = n.attachShadow({ mode: t.shadowMode ?? "closed" }), s = `
|
|
@@ -95,21 +99,21 @@ function et(r, e, t = {}) {
|
|
|
95
99
|
visibility: visible !important;
|
|
96
100
|
}
|
|
97
101
|
`, a = document.createElement("style");
|
|
98
|
-
a.textContent = s +
|
|
102
|
+
a.textContent = s + Ae + (t.injectCss ?? ""), i.appendChild(a);
|
|
99
103
|
const l = document.createElement("div");
|
|
100
104
|
l.style.pointerEvents = "auto", i.appendChild(l);
|
|
101
105
|
let c = e;
|
|
102
|
-
return
|
|
106
|
+
return ee(he(r, c), l), {
|
|
103
107
|
shadowRoot: i,
|
|
104
108
|
update(h) {
|
|
105
|
-
c = { ...c, ...h },
|
|
109
|
+
c = { ...c, ...h }, ee(he(r, c), l);
|
|
106
110
|
},
|
|
107
111
|
unmount() {
|
|
108
|
-
|
|
112
|
+
ee(null, l), n.remove();
|
|
109
113
|
}
|
|
110
114
|
};
|
|
111
115
|
}
|
|
112
|
-
const
|
|
116
|
+
const rt = (r, e, t) => {
|
|
113
117
|
const n = r[e];
|
|
114
118
|
return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((i, s) => {
|
|
115
119
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
@@ -121,7 +125,7 @@ const tt = (r, e, t) => {
|
|
|
121
125
|
)
|
|
122
126
|
);
|
|
123
127
|
});
|
|
124
|
-
},
|
|
128
|
+
}, nt = [
|
|
125
129
|
"ru",
|
|
126
130
|
"uk",
|
|
127
131
|
"de",
|
|
@@ -149,19 +153,19 @@ const tt = (r, e, t) => {
|
|
|
149
153
|
"th",
|
|
150
154
|
"vi",
|
|
151
155
|
"he"
|
|
152
|
-
],
|
|
153
|
-
function
|
|
156
|
+
], Le = (r, e, t) => Ee(e, t), Me = Ge({ t: Le, locale: "en" });
|
|
157
|
+
function Ee(r, e) {
|
|
154
158
|
if (!e) return r;
|
|
155
159
|
let t = r;
|
|
156
160
|
for (const [n, i] of Object.entries(e))
|
|
157
161
|
t = t.split(`{${n}}`).join(String(i));
|
|
158
162
|
return t;
|
|
159
163
|
}
|
|
160
|
-
const
|
|
161
|
-
function
|
|
162
|
-
return
|
|
164
|
+
const te = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map();
|
|
165
|
+
function Te(r) {
|
|
166
|
+
return nt.includes(r);
|
|
163
167
|
}
|
|
164
|
-
function
|
|
168
|
+
function it(r) {
|
|
165
169
|
const e = [];
|
|
166
170
|
if (typeof navigator < "u" && navigator.language) {
|
|
167
171
|
e.push(navigator.language);
|
|
@@ -175,36 +179,36 @@ function nt(r) {
|
|
|
175
179
|
n && n !== t && e.push(n);
|
|
176
180
|
}
|
|
177
181
|
for (const n of e)
|
|
178
|
-
if (
|
|
182
|
+
if (Te(n)) return n;
|
|
179
183
|
return null;
|
|
180
184
|
}
|
|
181
|
-
function
|
|
185
|
+
function ot(r, e) {
|
|
182
186
|
return !!r.locales && r.locales[e] !== void 0;
|
|
183
187
|
}
|
|
184
|
-
async function
|
|
185
|
-
const e =
|
|
188
|
+
async function st(r) {
|
|
189
|
+
const e = te.get(r);
|
|
186
190
|
if (e) return e;
|
|
187
|
-
const t =
|
|
191
|
+
const t = re.get(r);
|
|
188
192
|
if (t) return t;
|
|
189
|
-
const n =
|
|
193
|
+
const n = rt(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./chunks/ar-rSKgwKvp.js"), "./locales/cs.ts": () => import("./chunks/cs-DIWkcge_.js"), "./locales/da.ts": () => import("./chunks/da-DdMW98j3.js"), "./locales/de.ts": () => import("./chunks/de-D1bSmD_-.js"), "./locales/el.ts": () => import("./chunks/el-C4LtWpfP.js"), "./locales/es.ts": () => import("./chunks/es-Bhx7w85J.js"), "./locales/fi.ts": () => import("./chunks/fi-C34Oc6rg.js"), "./locales/fr.ts": () => import("./chunks/fr-BrWtqej3.js"), "./locales/he.ts": () => import("./chunks/he-Byr2r07x.js"), "./locales/hi.ts": () => import("./chunks/hi-CABVgpKU.js"), "./locales/hu.ts": () => import("./chunks/hu-CSQ9avfJ.js"), "./locales/id.ts": () => import("./chunks/id-BJ5w6RSU.js"), "./locales/it.ts": () => import("./chunks/it-Df8ChmTK.js"), "./locales/ja.ts": () => import("./chunks/ja-a53E5b2s.js"), "./locales/ko.ts": () => import("./chunks/ko-AZ8GrmXu.js"), "./locales/nl.ts": () => import("./chunks/nl-sF6ms5FU.js"), "./locales/no.ts": () => import("./chunks/no-DGf5PuW5.js"), "./locales/pl.ts": () => import("./chunks/pl-Dd-Ze6wn.js"), "./locales/pt.ts": () => import("./chunks/pt-BL9X8Du2.js"), "./locales/ro.ts": () => import("./chunks/ro-CGYmtR8q.js"), "./locales/ru.ts": () => import("./chunks/ru-oPoQtUxk.js"), "./locales/sv.ts": () => import("./chunks/sv-kXHP1Ct3.js"), "./locales/th.ts": () => import("./chunks/th-DMcmb36d.js"), "./locales/tr.ts": () => import("./chunks/tr-zjLbddlL.js"), "./locales/uk.ts": () => import("./chunks/uk-BYSiM14V.js"), "./locales/vi.ts": () => import("./chunks/vi-FbVRwy9D.js"), "./locales/zh.ts": () => import("./chunks/zh-Cv0Yw4qR.js") }), `./locales/${r}.ts`, 3).then((i) => {
|
|
190
194
|
const s = i.default ?? {};
|
|
191
|
-
return
|
|
195
|
+
return te.set(r, s), s;
|
|
192
196
|
}).catch((i) => {
|
|
193
197
|
console.warn(`[paywall] failed to load locale chunk "${r}"`, i);
|
|
194
198
|
const s = {};
|
|
195
|
-
return
|
|
199
|
+
return te.set(r, s), s;
|
|
196
200
|
}).finally(() => {
|
|
197
|
-
|
|
201
|
+
re.delete(r);
|
|
198
202
|
});
|
|
199
|
-
return
|
|
203
|
+
return re.set(r, n), n;
|
|
200
204
|
}
|
|
201
|
-
function
|
|
205
|
+
function at({ bootstrap: r, forceLocale: e, children: t }) {
|
|
202
206
|
const [n, i] = k("en"), [s, a] = k(null);
|
|
203
207
|
P(() => {
|
|
204
|
-
const h = (e &&
|
|
208
|
+
const h = (e && Te(e) ? e : null) ?? (() => {
|
|
205
209
|
if (!r) return null;
|
|
206
|
-
const g =
|
|
207
|
-
return !g || !
|
|
210
|
+
const g = it(r);
|
|
211
|
+
return !g || !ot(r, g) ? null : g;
|
|
208
212
|
})();
|
|
209
213
|
if (!h) {
|
|
210
214
|
(s !== null || n !== "en") && (i("en"), a(null));
|
|
@@ -212,7 +216,7 @@ function st({ bootstrap: r, forceLocale: e, children: t }) {
|
|
|
212
216
|
}
|
|
213
217
|
if (h === n && s) return;
|
|
214
218
|
let d = !1;
|
|
215
|
-
return
|
|
219
|
+
return st(h).then((g) => {
|
|
216
220
|
d || (i(h), a(g));
|
|
217
221
|
}), () => {
|
|
218
222
|
d = !0;
|
|
@@ -220,15 +224,15 @@ function st({ bootstrap: r, forceLocale: e, children: t }) {
|
|
|
220
224
|
}, [r, e]);
|
|
221
225
|
const l = {
|
|
222
226
|
locale: n,
|
|
223
|
-
t: s ? (c, h, d) =>
|
|
227
|
+
t: s ? (c, h, d) => Ee(s[c] ?? h, d) : Le
|
|
224
228
|
};
|
|
225
|
-
return /* @__PURE__ */ o(
|
|
229
|
+
return /* @__PURE__ */ o(Me.Provider, { value: l, children: t });
|
|
226
230
|
}
|
|
227
231
|
function S() {
|
|
228
|
-
return
|
|
232
|
+
return We(Me);
|
|
229
233
|
}
|
|
230
|
-
const
|
|
231
|
-
function
|
|
234
|
+
const fe = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
235
|
+
function lt({
|
|
232
236
|
open: r,
|
|
233
237
|
onClose: e,
|
|
234
238
|
labelledBy: t,
|
|
@@ -244,7 +248,7 @@ function at({
|
|
|
244
248
|
if (!r) return;
|
|
245
249
|
g.current = document.activeElement ?? null;
|
|
246
250
|
const m = d.current;
|
|
247
|
-
m && (m.querySelector(
|
|
251
|
+
m && (m.querySelector(fe) ?? m).focus({ preventScroll: !0 });
|
|
248
252
|
const A = (y) => {
|
|
249
253
|
if (y.key === "Escape") {
|
|
250
254
|
if (!s) return;
|
|
@@ -253,7 +257,7 @@ function at({
|
|
|
253
257
|
}
|
|
254
258
|
if (y.key !== "Tab" || !d.current) return;
|
|
255
259
|
const C = Array.from(
|
|
256
|
-
d.current.querySelectorAll(
|
|
260
|
+
d.current.querySelectorAll(fe)
|
|
257
261
|
).filter((R) => !R.hasAttribute("disabled") && R.tabIndex !== -1);
|
|
258
262
|
if (C.length === 0) {
|
|
259
263
|
y.preventDefault();
|
|
@@ -332,7 +336,7 @@ function at({
|
|
|
332
336
|
}
|
|
333
337
|
) : null;
|
|
334
338
|
}
|
|
335
|
-
function
|
|
339
|
+
function ct(r, e) {
|
|
336
340
|
switch (r) {
|
|
337
341
|
case "google":
|
|
338
342
|
return e("auth.continue_with_google", "Continue with Google");
|
|
@@ -344,7 +348,7 @@ function lt(r, e) {
|
|
|
344
348
|
return e("auth.continue_with_facebook", "Continue with Facebook");
|
|
345
349
|
}
|
|
346
350
|
}
|
|
347
|
-
function
|
|
351
|
+
function ge(r, e, t) {
|
|
348
352
|
const n = e === "signup" ? t("auth.signup_failed", "Sign-up failed") : t("auth.signin_failed", "Sign-in failed");
|
|
349
353
|
if (!(r instanceof L)) return n;
|
|
350
354
|
switch (r.code) {
|
|
@@ -378,14 +382,14 @@ function fe(r, e, t) {
|
|
|
378
382
|
return n;
|
|
379
383
|
}
|
|
380
384
|
}
|
|
381
|
-
function
|
|
385
|
+
function Be({ block: r, ctx: e }) {
|
|
382
386
|
const t = e.auth, n = e.authSession, i = r.allow_signup !== !1, s = r.allow_password_reset !== !1, a = r.hide_when_authenticated !== !1;
|
|
383
387
|
if (!t)
|
|
384
388
|
return typeof console < "u" && console.warn("[paywall] auth_panel rendered without AuthClient — pass `auth: true` to PaywallUI"), null;
|
|
385
389
|
const l = n && !n.user.is_anonymous ? n : null;
|
|
386
|
-
return l && a ? null : l ? /* @__PURE__ */ o(
|
|
390
|
+
return l && a ? null : l ? /* @__PURE__ */ o(ut, { email: l.user.email ?? "", onSignOut: () => t.signOut().catch(() => {
|
|
387
391
|
}) }) : /* @__PURE__ */ o(
|
|
388
|
-
|
|
392
|
+
dt,
|
|
389
393
|
{
|
|
390
394
|
block: r,
|
|
391
395
|
allowSignup: i,
|
|
@@ -394,7 +398,7 @@ function Me({ block: r, ctx: e }) {
|
|
|
394
398
|
}
|
|
395
399
|
);
|
|
396
400
|
}
|
|
397
|
-
function
|
|
401
|
+
function ut({ email: r, onSignOut: e }) {
|
|
398
402
|
const { t } = S();
|
|
399
403
|
return /* @__PURE__ */ u("div", { class: "flex items-center justify-between gap-3 rounded-2xl bg-gray-100 px-4 py-3", children: [
|
|
400
404
|
/* @__PURE__ */ u("div", { class: "flex flex-col", children: [
|
|
@@ -412,7 +416,7 @@ function ct({ email: r, onSignOut: e }) {
|
|
|
412
416
|
)
|
|
413
417
|
] });
|
|
414
418
|
}
|
|
415
|
-
function
|
|
419
|
+
function dt({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
416
420
|
const { t: i } = S(), s = n.auth, a = r.providers ?? [], l = n.initialAuthMode === "signup" && e ? "signup" : "signin", [c, h] = k(l), [d, g] = k(""), [_, p] = k(""), [v, m] = k(""), [A, b] = k(""), [y, C] = k(null), I = j(!1), [O, M] = k(null), [R, D] = k(null), [z, T] = k(!1), [E, q] = k(null);
|
|
417
421
|
P(() => {
|
|
418
422
|
if (typeof s.getLastLogin != "function") return;
|
|
@@ -429,7 +433,7 @@ function ut({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
|
429
433
|
}, [s]);
|
|
430
434
|
const U = (f) => {
|
|
431
435
|
h(f), M(null), D(null), T(!1);
|
|
432
|
-
},
|
|
436
|
+
}, K = async (f) => {
|
|
433
437
|
if (f.preventDefault(), !(I.current || y)) {
|
|
434
438
|
I.current = !0;
|
|
435
439
|
try {
|
|
@@ -450,7 +454,7 @@ function ut({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
|
450
454
|
type: _ ? "recovery" : "email"
|
|
451
455
|
}), _ && await s.updatePassword({ password: _ }));
|
|
452
456
|
} catch (w) {
|
|
453
|
-
M(
|
|
457
|
+
M(ge(w, c === "signup" ? "signup" : c === "signup_verify" || c === "reset_verify" ? "otp" : c === "forgot" ? "reset" : "signin", i));
|
|
454
458
|
} finally {
|
|
455
459
|
C(null);
|
|
456
460
|
}
|
|
@@ -458,7 +462,7 @@ function ut({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
|
458
462
|
I.current = !1;
|
|
459
463
|
}
|
|
460
464
|
}
|
|
461
|
-
},
|
|
465
|
+
}, H = async (f) => {
|
|
462
466
|
if (!(I.current || y)) {
|
|
463
467
|
I.current = !0, C(f), M(null), D(null);
|
|
464
468
|
try {
|
|
@@ -469,36 +473,36 @@ function ut({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
|
469
473
|
} catch (w) {
|
|
470
474
|
if (w instanceof L && (w.code === "oauth_cancelled" || w.code === "oauth_timeout"))
|
|
471
475
|
return;
|
|
472
|
-
M(
|
|
476
|
+
M(ge(w, "signin", i));
|
|
473
477
|
} finally {
|
|
474
478
|
I.current = !1, C(null);
|
|
475
479
|
}
|
|
476
480
|
}
|
|
477
|
-
},
|
|
478
|
-
return c === "reset_sent" ? /* @__PURE__ */ o(
|
|
479
|
-
/* @__PURE__ */ o(
|
|
480
|
-
|
|
481
|
+
}, X = a.length > 0 && (c === "signin" || c === "signup"), J = c === "signin" || c === "signup" || c === "forgot", x = c === "signin" || c === "signup" && z;
|
|
482
|
+
return c === "reset_sent" ? /* @__PURE__ */ o(_t, { email: d, onBack: () => U("signin"), t: i }) : /* @__PURE__ */ u("div", { class: "flex flex-col gap-5", children: [
|
|
483
|
+
/* @__PURE__ */ o(ht, { mode: c, customHeading: r.heading, customSubheading: r.subheading }),
|
|
484
|
+
X ? /* @__PURE__ */ u("div", { class: "flex flex-col gap-2.5", children: [
|
|
481
485
|
a.map((f) => /* @__PURE__ */ u("div", { class: "relative", children: [
|
|
482
486
|
/* @__PURE__ */ u(
|
|
483
487
|
"button",
|
|
484
488
|
{
|
|
485
489
|
type: "button",
|
|
486
|
-
onClick: () =>
|
|
490
|
+
onClick: () => H(f),
|
|
487
491
|
disabled: y !== null,
|
|
488
492
|
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)]",
|
|
489
493
|
children: [
|
|
490
|
-
y === f ? /* @__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(
|
|
491
|
-
/* @__PURE__ */ o("span", { children:
|
|
494
|
+
y === f ? /* @__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(vt, { provider: f }),
|
|
495
|
+
/* @__PURE__ */ o("span", { children: ct(f, i) })
|
|
492
496
|
]
|
|
493
497
|
}
|
|
494
498
|
),
|
|
495
|
-
E?.method === f ? /* @__PURE__ */ o(
|
|
499
|
+
E?.method === f ? /* @__PURE__ */ o(xt, { email: E.email }) : null
|
|
496
500
|
] }, f)),
|
|
497
|
-
/* @__PURE__ */ o(
|
|
501
|
+
/* @__PURE__ */ o(kt, {})
|
|
498
502
|
] }) : null,
|
|
499
|
-
/* @__PURE__ */ u("form", { onSubmit:
|
|
500
|
-
|
|
501
|
-
|
|
503
|
+
/* @__PURE__ */ u("form", { onSubmit: K, class: "flex flex-col gap-3", children: [
|
|
504
|
+
J && /* @__PURE__ */ o(
|
|
505
|
+
me,
|
|
502
506
|
{
|
|
503
507
|
type: "email",
|
|
504
508
|
placeholder: i("auth.email", "Email address"),
|
|
@@ -509,7 +513,7 @@ function ut({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
|
509
513
|
}
|
|
510
514
|
),
|
|
511
515
|
x && /* @__PURE__ */ o(
|
|
512
|
-
|
|
516
|
+
ne,
|
|
513
517
|
{
|
|
514
518
|
placeholder: i("auth.password", "Password"),
|
|
515
519
|
value: _,
|
|
@@ -519,7 +523,7 @@ function ut({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
|
519
523
|
}
|
|
520
524
|
),
|
|
521
525
|
c === "signup" && z && /* @__PURE__ */ o(
|
|
522
|
-
|
|
526
|
+
ne,
|
|
523
527
|
{
|
|
524
528
|
placeholder: i("auth.repeat_password", "Repeat password"),
|
|
525
529
|
value: v,
|
|
@@ -529,7 +533,7 @@ function ut({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
|
529
533
|
}
|
|
530
534
|
),
|
|
531
535
|
(c === "signup_verify" || c === "reset_verify") && /* @__PURE__ */ o(
|
|
532
|
-
|
|
536
|
+
me,
|
|
533
537
|
{
|
|
534
538
|
type: "text",
|
|
535
539
|
placeholder: i("auth.confirmation_code", "Confirmation code"),
|
|
@@ -541,7 +545,7 @@ function ut({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
|
541
545
|
}
|
|
542
546
|
),
|
|
543
547
|
c === "reset_verify" && /* @__PURE__ */ o(
|
|
544
|
-
|
|
548
|
+
ne,
|
|
545
549
|
{
|
|
546
550
|
placeholder: i(
|
|
547
551
|
"auth.new_password_optional",
|
|
@@ -552,19 +556,19 @@ function ut({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
|
552
556
|
autocomplete: "new-password"
|
|
553
557
|
}
|
|
554
558
|
),
|
|
555
|
-
c === "signin" && t && /* @__PURE__ */ o("div", { class: "flex justify-end text-sm", children: /* @__PURE__ */ o(
|
|
559
|
+
c === "signin" && t && /* @__PURE__ */ o("div", { class: "flex justify-end text-sm", children: /* @__PURE__ */ o(Y, { onClick: () => U("forgot"), children: i("auth.forgot_password", "Forgot password?") }) }),
|
|
556
560
|
O && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: O }),
|
|
557
561
|
R && /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: R }),
|
|
558
562
|
/* @__PURE__ */ o(
|
|
559
|
-
|
|
563
|
+
mt,
|
|
560
564
|
{
|
|
561
565
|
busy: y === "email",
|
|
562
|
-
label:
|
|
566
|
+
label: ft(c, z, r.submit_label ?? r.heading, i)
|
|
563
567
|
}
|
|
564
568
|
)
|
|
565
569
|
] }),
|
|
566
570
|
/* @__PURE__ */ o(
|
|
567
|
-
|
|
571
|
+
gt,
|
|
568
572
|
{
|
|
569
573
|
mode: c,
|
|
570
574
|
allowSignup: e,
|
|
@@ -573,18 +577,18 @@ function ut({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
|
573
577
|
)
|
|
574
578
|
] });
|
|
575
579
|
}
|
|
576
|
-
function
|
|
580
|
+
function ht({
|
|
577
581
|
mode: r,
|
|
578
582
|
customHeading: e,
|
|
579
583
|
customSubheading: t
|
|
580
584
|
}) {
|
|
581
|
-
const { t: n } = S(), i =
|
|
585
|
+
const { t: n } = S(), i = pt(r, n), s = r === "signin" || r === "signup", a = s && e ? e : i.title, l = s && t !== void 0 ? t || null : i.subtitle;
|
|
582
586
|
return /* @__PURE__ */ u("div", { class: "flex flex-col gap-2", children: [
|
|
583
587
|
/* @__PURE__ */ o("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: a }),
|
|
584
588
|
l ? /* @__PURE__ */ o("p", { class: "text-base leading-relaxed text-gray-600", children: l }) : null
|
|
585
589
|
] });
|
|
586
590
|
}
|
|
587
|
-
function
|
|
591
|
+
function pt(r, e) {
|
|
588
592
|
switch (r) {
|
|
589
593
|
case "signin":
|
|
590
594
|
return {
|
|
@@ -627,7 +631,7 @@ function ht(r, e) {
|
|
|
627
631
|
};
|
|
628
632
|
}
|
|
629
633
|
}
|
|
630
|
-
function
|
|
634
|
+
function ft(r, e, t, n) {
|
|
631
635
|
if (r === "signin" && t) return t;
|
|
632
636
|
switch (r) {
|
|
633
637
|
case "signin":
|
|
@@ -643,7 +647,7 @@ function pt(r, e, t, n) {
|
|
|
643
647
|
return n("cta.continue", "Continue");
|
|
644
648
|
}
|
|
645
649
|
}
|
|
646
|
-
function
|
|
650
|
+
function gt({
|
|
647
651
|
mode: r,
|
|
648
652
|
allowSignup: e,
|
|
649
653
|
onSwitch: t
|
|
@@ -652,18 +656,18 @@ function ft({
|
|
|
652
656
|
return r === "signin" && e ? /* @__PURE__ */ u("p", { class: "text-center text-sm text-gray-600", children: [
|
|
653
657
|
n("auth.no_account", "Don't have an account?"),
|
|
654
658
|
" ",
|
|
655
|
-
/* @__PURE__ */ o(
|
|
659
|
+
/* @__PURE__ */ o(Y, { onClick: () => t("signup"), children: n("auth.sign_up_link", "Sign Up") })
|
|
656
660
|
] }) : r === "signup" || r === "signup_verify" ? /* @__PURE__ */ u("p", { class: "text-center text-sm text-gray-600", children: [
|
|
657
661
|
n("auth.have_account", "Already have an account?"),
|
|
658
662
|
" ",
|
|
659
|
-
/* @__PURE__ */ o(
|
|
663
|
+
/* @__PURE__ */ o(Y, { onClick: () => t("signin"), children: n("auth.log_in_link", "Log In") })
|
|
660
664
|
] }) : r === "forgot" || r === "reset_sent" || r === "reset_verify" ? /* @__PURE__ */ u("p", { class: "text-center text-sm text-gray-600", children: [
|
|
661
665
|
n("auth.no_account", "Don't have an account?"),
|
|
662
666
|
" ",
|
|
663
|
-
/* @__PURE__ */ o(
|
|
667
|
+
/* @__PURE__ */ o(Y, { onClick: () => t("signup"), children: n("auth.sign_up_link", "Sign Up") })
|
|
664
668
|
] }) : null;
|
|
665
669
|
}
|
|
666
|
-
function
|
|
670
|
+
function Y({
|
|
667
671
|
onClick: r,
|
|
668
672
|
children: e
|
|
669
673
|
}) {
|
|
@@ -678,7 +682,7 @@ function Z({
|
|
|
678
682
|
}
|
|
679
683
|
);
|
|
680
684
|
}
|
|
681
|
-
function
|
|
685
|
+
function mt({ busy: r, label: e }) {
|
|
682
686
|
return /* @__PURE__ */ o(
|
|
683
687
|
"button",
|
|
684
688
|
{
|
|
@@ -693,7 +697,7 @@ function gt({ busy: r, label: e }) {
|
|
|
693
697
|
}
|
|
694
698
|
);
|
|
695
699
|
}
|
|
696
|
-
function
|
|
700
|
+
function me({ type: r, placeholder: e, value: t, onInput: n, autocomplete: i, inputMode: s, required: a }) {
|
|
697
701
|
return /* @__PURE__ */ o(
|
|
698
702
|
"input",
|
|
699
703
|
{
|
|
@@ -708,7 +712,7 @@ function ge({ type: r, placeholder: e, value: t, onInput: n, autocomplete: i, in
|
|
|
708
712
|
}
|
|
709
713
|
);
|
|
710
714
|
}
|
|
711
|
-
function
|
|
715
|
+
function ne({ placeholder: r, value: e, onInput: t, autocomplete: n, required: i }) {
|
|
712
716
|
const { t: s } = S(), [a, l] = k(!1), c = j(null);
|
|
713
717
|
P(() => {
|
|
714
718
|
const g = c.current;
|
|
@@ -737,12 +741,12 @@ function re({ placeholder: r, value: e, onInput: t, autocomplete: n, required: i
|
|
|
737
741
|
"aria-label": a ? d : h,
|
|
738
742
|
tabIndex: -1,
|
|
739
743
|
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)]",
|
|
740
|
-
children: a ? /* @__PURE__ */ o(
|
|
744
|
+
children: a ? /* @__PURE__ */ o(bt, {}) : /* @__PURE__ */ o(yt, {})
|
|
741
745
|
}
|
|
742
746
|
)
|
|
743
747
|
] });
|
|
744
748
|
}
|
|
745
|
-
function
|
|
749
|
+
function yt() {
|
|
746
750
|
return /* @__PURE__ */ u("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
747
751
|
/* @__PURE__ */ o(
|
|
748
752
|
"path",
|
|
@@ -757,7 +761,7 @@ function mt() {
|
|
|
757
761
|
/* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "2.5", stroke: "currentColor", "stroke-width": "1.5" })
|
|
758
762
|
] });
|
|
759
763
|
}
|
|
760
|
-
function
|
|
764
|
+
function bt() {
|
|
761
765
|
return /* @__PURE__ */ u("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
762
766
|
/* @__PURE__ */ o(
|
|
763
767
|
"path",
|
|
@@ -781,15 +785,15 @@ function yt() {
|
|
|
781
785
|
)
|
|
782
786
|
] });
|
|
783
787
|
}
|
|
784
|
-
function
|
|
785
|
-
const { t: e } = S(), t = r ? e("auth.last_used", "Last · {email}", { email:
|
|
788
|
+
function xt({ email: r }) {
|
|
789
|
+
const { t: e } = S(), t = r ? e("auth.last_used", "Last · {email}", { email: wt(r) }) : e("auth.last_used_no_email", "Last");
|
|
786
790
|
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 });
|
|
787
791
|
}
|
|
788
|
-
function
|
|
792
|
+
function wt(r) {
|
|
789
793
|
const [e, t] = r.split("@");
|
|
790
794
|
return t ? `${e.slice(0, 3)}*****@${t}` : r;
|
|
791
795
|
}
|
|
792
|
-
function
|
|
796
|
+
function kt() {
|
|
793
797
|
const { t: r } = S();
|
|
794
798
|
return /* @__PURE__ */ u("div", { class: "flex items-center gap-3 py-1 text-sm text-gray-400", children: [
|
|
795
799
|
/* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gray-200" }),
|
|
@@ -797,7 +801,7 @@ function wt() {
|
|
|
797
801
|
/* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gray-200" })
|
|
798
802
|
] });
|
|
799
803
|
}
|
|
800
|
-
function
|
|
804
|
+
function vt({ provider: r }) {
|
|
801
805
|
return r === "google" ? /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 18 18", "aria-hidden": "true", children: [
|
|
802
806
|
/* @__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" }),
|
|
803
807
|
/* @__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" }),
|
|
@@ -810,7 +814,7 @@ function kt({ provider: r }) {
|
|
|
810
814
|
/* @__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" }) })
|
|
811
815
|
) : 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" }) });
|
|
812
816
|
}
|
|
813
|
-
function
|
|
817
|
+
function _t({
|
|
814
818
|
email: r,
|
|
815
819
|
onBack: e,
|
|
816
820
|
t
|
|
@@ -860,7 +864,7 @@ function vt({
|
|
|
860
864
|
)
|
|
861
865
|
] });
|
|
862
866
|
}
|
|
863
|
-
function
|
|
867
|
+
function St({
|
|
864
868
|
block: r,
|
|
865
869
|
bootstrap: e,
|
|
866
870
|
auth: t,
|
|
@@ -901,11 +905,11 @@ function _t({
|
|
|
901
905
|
submit_label: c("auth.log_in", "Sign In")
|
|
902
906
|
} : r;
|
|
903
907
|
return /* @__PURE__ */ u("div", { class: "relative flex-1 min-h-0 overflow-y-auto p-6 sm:p-8", children: [
|
|
904
|
-
s ? /* @__PURE__ */ o(
|
|
905
|
-
/* @__PURE__ */ o(
|
|
908
|
+
s ? /* @__PURE__ */ o(Ct, { onClick: i, ariaLabel: c("nav.back_aria", "Back") }) : null,
|
|
909
|
+
/* @__PURE__ */ o(Be, { block: d, ctx: h })
|
|
906
910
|
] });
|
|
907
911
|
}
|
|
908
|
-
function
|
|
912
|
+
function Ct({ onClick: r, ariaLabel: e }) {
|
|
909
913
|
return /* @__PURE__ */ o(
|
|
910
914
|
"button",
|
|
911
915
|
{
|
|
@@ -938,8 +942,8 @@ function St({ onClick: r, ariaLabel: e }) {
|
|
|
938
942
|
}
|
|
939
943
|
);
|
|
940
944
|
}
|
|
941
|
-
const
|
|
942
|
-
function
|
|
945
|
+
const It = (r) => `pw-offer-${r}-start`;
|
|
946
|
+
function ie(r) {
|
|
943
947
|
const e = r - Date.now();
|
|
944
948
|
return e <= 0 ? { days: 0, hours: 0, minutes: 0, seconds: 0, expired: !0 } : {
|
|
945
949
|
days: Math.floor(e / (1e3 * 60 * 60 * 24)),
|
|
@@ -949,7 +953,7 @@ function ne(r) {
|
|
|
949
953
|
expired: !1
|
|
950
954
|
};
|
|
951
955
|
}
|
|
952
|
-
function
|
|
956
|
+
function At(r) {
|
|
953
957
|
if (r.expires_at) {
|
|
954
958
|
const e = Date.parse(r.expires_at);
|
|
955
959
|
return Number.isFinite(e) ? e : null;
|
|
@@ -957,7 +961,7 @@ function It(r) {
|
|
|
957
961
|
if (r.duration_minutes && r.duration_minutes > 0) {
|
|
958
962
|
if (typeof window > "u") return null;
|
|
959
963
|
try {
|
|
960
|
-
const e =
|
|
964
|
+
const e = It(r.id);
|
|
961
965
|
let t = window.localStorage.getItem(e);
|
|
962
966
|
return t || (t = (/* @__PURE__ */ new Date()).toISOString(), window.localStorage.setItem(e, t)), Date.parse(t) + r.duration_minutes * 6e4;
|
|
963
967
|
} catch {
|
|
@@ -966,7 +970,7 @@ function It(r) {
|
|
|
966
970
|
}
|
|
967
971
|
return null;
|
|
968
972
|
}
|
|
969
|
-
function
|
|
973
|
+
function Pe(r, e) {
|
|
970
974
|
if (!r || r.length === 0) return null;
|
|
971
975
|
if (e) {
|
|
972
976
|
const t = r.find((n) => n.id === e);
|
|
@@ -974,25 +978,25 @@ function Ee(r, e) {
|
|
|
974
978
|
}
|
|
975
979
|
return r.find((t) => t.expires_at || t.duration_minutes) ?? null;
|
|
976
980
|
}
|
|
977
|
-
function
|
|
978
|
-
const e = r ?
|
|
979
|
-
() => e !== null ?
|
|
981
|
+
function Oe(r) {
|
|
982
|
+
const e = r ? At(r) : null, [t, n] = k(
|
|
983
|
+
() => e !== null ? ie(e) : null
|
|
980
984
|
), i = j(e);
|
|
981
985
|
return i.current = e, P(() => {
|
|
982
986
|
if (e === null) {
|
|
983
987
|
n(null);
|
|
984
988
|
return;
|
|
985
989
|
}
|
|
986
|
-
n(
|
|
990
|
+
n(ie(e));
|
|
987
991
|
const s = setInterval(() => {
|
|
988
|
-
const a =
|
|
992
|
+
const a = ie(i.current ?? 0);
|
|
989
993
|
n(a), a.expired && clearInterval(s);
|
|
990
994
|
}, 1e3);
|
|
991
995
|
return () => clearInterval(s);
|
|
992
996
|
}, [e, r?.duration_minutes, r?.id]), t;
|
|
993
997
|
}
|
|
994
|
-
function
|
|
995
|
-
const { t } = S(), n =
|
|
998
|
+
function Lt({ block: r, ctx: e }) {
|
|
999
|
+
const { t } = S(), n = Pe(e.bootstrap.offers, r.offer_id), i = Oe(n);
|
|
996
1000
|
if (!n || i === null || i.expired && !r.force) return null;
|
|
997
1001
|
const s = r.title ?? n.label ?? t("offer.limited_time", "Limited-time offer"), a = n.discount_percent ? `${s} ${n.discount_percent}%` : s;
|
|
998
1002
|
return /* @__PURE__ */ u(
|
|
@@ -1005,32 +1009,32 @@ function At({ block: r, ctx: e }) {
|
|
|
1005
1009
|
},
|
|
1006
1010
|
role: "status",
|
|
1007
1011
|
children: [
|
|
1008
|
-
/* @__PURE__ */ o(
|
|
1012
|
+
/* @__PURE__ */ o(je, {}),
|
|
1009
1013
|
/* @__PURE__ */ o("span", { children: a }),
|
|
1010
|
-
/* @__PURE__ */ o(
|
|
1014
|
+
/* @__PURE__ */ o(Ue, { value: i, t })
|
|
1011
1015
|
]
|
|
1012
1016
|
}
|
|
1013
1017
|
);
|
|
1014
1018
|
}
|
|
1015
|
-
function
|
|
1019
|
+
function Ue({ value: r, t: e }) {
|
|
1016
1020
|
return /* @__PURE__ */ u("div", { class: "flex items-center gap-1 font-mono text-sm", children: [
|
|
1017
|
-
r.days > 0 ? /* @__PURE__ */ u(
|
|
1018
|
-
/* @__PURE__ */ o(
|
|
1021
|
+
r.days > 0 ? /* @__PURE__ */ u(le, { children: [
|
|
1022
|
+
/* @__PURE__ */ o(G, { children: String(r.days) }),
|
|
1019
1023
|
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.d", "d") })
|
|
1020
1024
|
] }) : null,
|
|
1021
|
-
/* @__PURE__ */ o(
|
|
1025
|
+
/* @__PURE__ */ o(G, { children: String(r.hours).padStart(2, "0") }),
|
|
1022
1026
|
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.h", "h") }),
|
|
1023
|
-
/* @__PURE__ */ o(
|
|
1027
|
+
/* @__PURE__ */ o(G, { children: String(r.minutes).padStart(2, "0") }),
|
|
1024
1028
|
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.m", "m") }),
|
|
1025
|
-
/* @__PURE__ */ o(
|
|
1029
|
+
/* @__PURE__ */ o(G, { children: String(r.seconds).padStart(2, "0") }),
|
|
1026
1030
|
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.s", "s") })
|
|
1027
1031
|
] });
|
|
1028
1032
|
}
|
|
1029
|
-
function
|
|
1033
|
+
function G({ children: r }) {
|
|
1030
1034
|
return /* @__PURE__ */ o("span", { class: "rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold", children: r });
|
|
1031
1035
|
}
|
|
1032
|
-
function
|
|
1033
|
-
const { t: e } = S(), t =
|
|
1036
|
+
function Mt({ offer: r }) {
|
|
1037
|
+
const { t: e } = S(), t = Oe(r);
|
|
1034
1038
|
if (t === null || t.expired) return null;
|
|
1035
1039
|
const n = r.label ?? e("offer.limited_time", "Limited-time offer"), i = r.discount_percent ? `${n} ${r.discount_percent}%` : n;
|
|
1036
1040
|
return /* @__PURE__ */ u(
|
|
@@ -1043,14 +1047,14 @@ function Lt({ offer: r }) {
|
|
|
1043
1047
|
},
|
|
1044
1048
|
role: "status",
|
|
1045
1049
|
children: [
|
|
1046
|
-
/* @__PURE__ */ o(
|
|
1050
|
+
/* @__PURE__ */ o(je, {}),
|
|
1047
1051
|
/* @__PURE__ */ o("span", { children: i }),
|
|
1048
|
-
/* @__PURE__ */ o(
|
|
1052
|
+
/* @__PURE__ */ o(Ue, { value: t, t: e })
|
|
1049
1053
|
]
|
|
1050
1054
|
}
|
|
1051
1055
|
);
|
|
1052
1056
|
}
|
|
1053
|
-
function
|
|
1057
|
+
function je() {
|
|
1054
1058
|
return /* @__PURE__ */ o(
|
|
1055
1059
|
"svg",
|
|
1056
1060
|
{
|
|
@@ -1069,16 +1073,16 @@ function Pe() {
|
|
|
1069
1073
|
}
|
|
1070
1074
|
);
|
|
1071
1075
|
}
|
|
1072
|
-
const
|
|
1073
|
-
function
|
|
1076
|
+
const ye = 3, be = 200, xe = 5e3, oe = 5, Et = 10 * 1024 * 1024, we = ["image/jpeg", "image/png", "image/webp"], Tt = /.+@.+\..+/;
|
|
1077
|
+
function Bt({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
1074
1078
|
const { t: i } = S(), s = e?.user.email ?? "", a = s || null, [l, c] = k(s), [h, d] = k(""), [g, _] = k(""), [p, v] = k([]), [m, A] = k(!1), [b, y] = k(null), [C, I] = k({}), O = () => {
|
|
1075
1079
|
const T = {}, E = (a ?? l).trim(), q = h.trim(), U = g.trim();
|
|
1076
|
-
return E ?
|
|
1077
|
-
min:
|
|
1078
|
-
max: ye
|
|
1079
|
-
})), (U.length < 1 || U.length > be) && (T.message = i("support.message_length", "{min}–{max} characters", {
|
|
1080
|
-
min: 1,
|
|
1080
|
+
return E ? Tt.test(E.toLowerCase()) || (T.email = i("support.invalid_email", "Invalid email")) : T.email = i("support.required", "Required"), (q.length < ye || q.length > be) && (T.subject = i("support.subject_length", "{min}–{max} characters", {
|
|
1081
|
+
min: ye,
|
|
1081
1082
|
max: be
|
|
1083
|
+
})), (U.length < 1 || U.length > xe) && (T.message = i("support.message_length", "{min}–{max} characters", {
|
|
1084
|
+
min: 1,
|
|
1085
|
+
max: xe
|
|
1082
1086
|
})), I(T), Object.keys(T).length === 0;
|
|
1083
1087
|
}, M = async (T) => {
|
|
1084
1088
|
if (T.preventDefault(), !m && O()) {
|
|
@@ -1158,7 +1162,7 @@ function Tt({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
|
1158
1162
|
)
|
|
1159
1163
|
] }) })
|
|
1160
1164
|
] }) : /* @__PURE__ */ u("form", { onSubmit: M, class: "relative flex-1 min-h-0 flex flex-col", children: [
|
|
1161
|
-
/* @__PURE__ */ o(
|
|
1165
|
+
/* @__PURE__ */ o(Pt, { onClick: n, ariaLabel: i("nav.back_aria", "Back") }),
|
|
1162
1166
|
/* @__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: [
|
|
1163
1167
|
/* @__PURE__ */ u("div", { class: "flex flex-col gap-2 pr-10", children: [
|
|
1164
1168
|
/* @__PURE__ */ o("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: i("support.heading", "Support") }),
|
|
@@ -1170,7 +1174,7 @@ function Tt({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
|
1170
1174
|
" ",
|
|
1171
1175
|
/* @__PURE__ */ o("b", { class: "font-medium text-gray-900", children: a })
|
|
1172
1176
|
] }) : /* @__PURE__ */ o(
|
|
1173
|
-
|
|
1177
|
+
ke,
|
|
1174
1178
|
{
|
|
1175
1179
|
type: "email",
|
|
1176
1180
|
placeholder: i("support.email_placeholder", "Enter your email *"),
|
|
@@ -1182,7 +1186,7 @@ function Tt({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
|
1182
1186
|
}
|
|
1183
1187
|
),
|
|
1184
1188
|
/* @__PURE__ */ o(
|
|
1185
|
-
|
|
1189
|
+
ke,
|
|
1186
1190
|
{
|
|
1187
1191
|
type: "text",
|
|
1188
1192
|
placeholder: i("support.subject_placeholder", "Enter your subject *"),
|
|
@@ -1193,7 +1197,7 @@ function Tt({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
|
1193
1197
|
}
|
|
1194
1198
|
),
|
|
1195
1199
|
/* @__PURE__ */ o(
|
|
1196
|
-
|
|
1200
|
+
Ot,
|
|
1197
1201
|
{
|
|
1198
1202
|
placeholder: i("support.message_placeholder", "Enter your message *"),
|
|
1199
1203
|
value: g,
|
|
@@ -1202,7 +1206,7 @@ function Tt({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
|
1202
1206
|
required: !0
|
|
1203
1207
|
}
|
|
1204
1208
|
),
|
|
1205
|
-
/* @__PURE__ */ o(
|
|
1209
|
+
/* @__PURE__ */ o(Ut, { files: p, onChange: v, disabled: m })
|
|
1206
1210
|
] })
|
|
1207
1211
|
] }) }),
|
|
1208
1212
|
/* @__PURE__ */ u("div", { class: D, style: z, children: [
|
|
@@ -1235,7 +1239,7 @@ function Tt({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
|
1235
1239
|
] })
|
|
1236
1240
|
] });
|
|
1237
1241
|
}
|
|
1238
|
-
function
|
|
1242
|
+
function Pt({ onClick: r, ariaLabel: e }) {
|
|
1239
1243
|
return /* @__PURE__ */ o(
|
|
1240
1244
|
"button",
|
|
1241
1245
|
{
|
|
@@ -1268,7 +1272,7 @@ function Bt({ onClick: r, ariaLabel: e }) {
|
|
|
1268
1272
|
}
|
|
1269
1273
|
);
|
|
1270
1274
|
}
|
|
1271
|
-
function
|
|
1275
|
+
function ke({
|
|
1272
1276
|
type: r,
|
|
1273
1277
|
placeholder: e,
|
|
1274
1278
|
value: t,
|
|
@@ -1293,7 +1297,7 @@ function we({
|
|
|
1293
1297
|
i && /* @__PURE__ */ o("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: i })
|
|
1294
1298
|
] });
|
|
1295
1299
|
}
|
|
1296
|
-
function
|
|
1300
|
+
function Ot({
|
|
1297
1301
|
placeholder: r,
|
|
1298
1302
|
value: e,
|
|
1299
1303
|
onInput: t,
|
|
@@ -1315,17 +1319,17 @@ function Pt({
|
|
|
1315
1319
|
n && /* @__PURE__ */ o("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: n })
|
|
1316
1320
|
] });
|
|
1317
1321
|
}
|
|
1318
|
-
function
|
|
1322
|
+
function Ut({ files: r, onChange: e, disabled: t }) {
|
|
1319
1323
|
const { t: n } = S(), i = j(null), [s, a] = k(!1), [l, c] = k(null), h = (d) => {
|
|
1320
1324
|
if (!d || t) return;
|
|
1321
1325
|
c(null);
|
|
1322
1326
|
const g = Array.from(d);
|
|
1323
|
-
if (r.length + g.length >
|
|
1324
|
-
c(n("support.too_many_files", "Up to {max} files", { max:
|
|
1327
|
+
if (r.length + g.length > oe) {
|
|
1328
|
+
c(n("support.too_many_files", "Up to {max} files", { max: oe }));
|
|
1325
1329
|
return;
|
|
1326
1330
|
}
|
|
1327
1331
|
const _ = g.filter(
|
|
1328
|
-
(p) =>
|
|
1332
|
+
(p) => we.includes(p.type) && p.size <= Et
|
|
1329
1333
|
);
|
|
1330
1334
|
if (_.length !== g.length) {
|
|
1331
1335
|
c(n("support.invalid_file", "Only JPEG/PNG/WebP, ≤ 10MB each"));
|
|
@@ -1353,7 +1357,7 @@ function Ot({ files: r, onChange: e, disabled: t }) {
|
|
|
1353
1357
|
children: [
|
|
1354
1358
|
/* @__PURE__ */ o("div", { class: "text-xs text-gray-500", children: n("support.dropzone_text", "Drop images here or click to select") }),
|
|
1355
1359
|
/* @__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", {
|
|
1356
|
-
max:
|
|
1360
|
+
max: oe
|
|
1357
1361
|
}) })
|
|
1358
1362
|
]
|
|
1359
1363
|
}
|
|
@@ -1364,7 +1368,7 @@ function Ot({ files: r, onChange: e, disabled: t }) {
|
|
|
1364
1368
|
ref: i,
|
|
1365
1369
|
type: "file",
|
|
1366
1370
|
multiple: !0,
|
|
1367
|
-
accept:
|
|
1371
|
+
accept: we.join(","),
|
|
1368
1372
|
class: "hidden",
|
|
1369
1373
|
onChange: (d) => {
|
|
1370
1374
|
h(d.target.files), d.currentTarget.value = "";
|
|
@@ -1398,34 +1402,34 @@ function Ot({ files: r, onChange: e, disabled: t }) {
|
|
|
1398
1402
|
)) })
|
|
1399
1403
|
] });
|
|
1400
1404
|
}
|
|
1401
|
-
const
|
|
1405
|
+
const jt = {
|
|
1402
1406
|
day: "cta.get_plan_daily",
|
|
1403
1407
|
week: "cta.get_plan_weekly",
|
|
1404
1408
|
month: "cta.get_plan_monthly",
|
|
1405
1409
|
year: "cta.get_plan_yearly"
|
|
1406
|
-
},
|
|
1410
|
+
}, Rt = {
|
|
1407
1411
|
day: "Get Daily Plan",
|
|
1408
1412
|
week: "Get Weekly Plan",
|
|
1409
1413
|
month: "Get Monthly Plan",
|
|
1410
1414
|
year: "Get Yearly Plan"
|
|
1411
1415
|
};
|
|
1412
|
-
function
|
|
1416
|
+
function Dt(r, e, t, n) {
|
|
1413
1417
|
if (e === "close") return n("cta.close", "Close");
|
|
1414
1418
|
if (!r) return n("cta.continue", "Continue");
|
|
1415
1419
|
if (!t && r.trial_days && r.interval && r.interval !== "lifetime")
|
|
1416
1420
|
return n("cta.start_trial", "Start {days}-Day Free Trial", { days: r.trial_days });
|
|
1417
1421
|
if (!r.interval || r.interval === "lifetime")
|
|
1418
1422
|
return n("cta.get_lifetime_access", "Get Lifetime Access");
|
|
1419
|
-
const i =
|
|
1420
|
-
return i ? n(i,
|
|
1421
|
-
interval:
|
|
1423
|
+
const i = jt[r.interval];
|
|
1424
|
+
return i ? n(i, Rt[r.interval]) : n("cta.get_plan_generic", "Get {interval} Plan", {
|
|
1425
|
+
interval: zt(r.interval)
|
|
1422
1426
|
});
|
|
1423
1427
|
}
|
|
1424
|
-
function
|
|
1428
|
+
function zt(r) {
|
|
1425
1429
|
return r.length ? r[0].toUpperCase() + r.slice(1) : r;
|
|
1426
1430
|
}
|
|
1427
|
-
function
|
|
1428
|
-
const { t } = S(), [n, i] = k(!1), s = r.priceId ?? e.selectedPriceId, a = n || r.action === "checkout" && !s, l = s ? e.bootstrap.prices.find((g) => g.id === s) ?? null : null, c = e.bootstrap.user?.had_previous_trial ?? !1, h = r.label ??
|
|
1431
|
+
function qt({ block: r, ctx: e }) {
|
|
1432
|
+
const { t } = S(), [n, i] = k(!1), s = r.priceId ?? e.selectedPriceId, a = n || r.action === "checkout" && !s, l = s ? e.bootstrap.prices.find((g) => g.id === s) ?? null : null, c = e.bootstrap.user?.had_previous_trial ?? !1, h = r.label ?? Dt(l, r.action, c, t);
|
|
1429
1433
|
return /* @__PURE__ */ u(
|
|
1430
1434
|
"button",
|
|
1431
1435
|
{
|
|
@@ -1462,7 +1466,7 @@ function zt({ block: r, ctx: e }) {
|
|
|
1462
1466
|
}
|
|
1463
1467
|
);
|
|
1464
1468
|
}
|
|
1465
|
-
function
|
|
1469
|
+
function Nt({ ctx: r }) {
|
|
1466
1470
|
const { t: e } = S(), t = r.authSession, n = r.auth, [i, s] = k(!1), a = () => r.onAction("support");
|
|
1467
1471
|
if (t && !t.user.is_anonymous) {
|
|
1468
1472
|
const l = async () => {
|
|
@@ -1483,19 +1487,19 @@ function qt({ ctx: r }) {
|
|
|
1483
1487
|
/* @__PURE__ */ o("b", { class: "font-medium text-gray-700", children: t.user.email })
|
|
1484
1488
|
] }),
|
|
1485
1489
|
/* @__PURE__ */ u("div", { class: "flex items-center justify-center gap-3", children: [
|
|
1486
|
-
/* @__PURE__ */ o(
|
|
1487
|
-
/* @__PURE__ */ o(
|
|
1488
|
-
/* @__PURE__ */ o(
|
|
1490
|
+
/* @__PURE__ */ o(W, { onClick: l, disabled: !n || i, children: i ? e("session.signing_out", "Signing out…") : e("session.sign_out", "Sign Out") }),
|
|
1491
|
+
/* @__PURE__ */ o(ve, {}),
|
|
1492
|
+
/* @__PURE__ */ o(W, { onClick: a, children: e("session.contact_support", "Contact Support") })
|
|
1489
1493
|
] })
|
|
1490
1494
|
] });
|
|
1491
1495
|
}
|
|
1492
1496
|
return /* @__PURE__ */ u("div", { class: "-mt-3 flex items-center justify-center gap-3 pt-1 text-center text-[13px]", children: [
|
|
1493
|
-
/* @__PURE__ */ o(
|
|
1494
|
-
/* @__PURE__ */ o(
|
|
1495
|
-
/* @__PURE__ */ o(
|
|
1497
|
+
/* @__PURE__ */ o(W, { onClick: () => r.onAction("restore"), children: e("session.restore_purchases", "Restore purchases") }),
|
|
1498
|
+
/* @__PURE__ */ o(ve, {}),
|
|
1499
|
+
/* @__PURE__ */ o(W, { onClick: a, children: e("session.contact_support", "Contact Support") })
|
|
1496
1500
|
] });
|
|
1497
1501
|
}
|
|
1498
|
-
function
|
|
1502
|
+
function W({
|
|
1499
1503
|
onClick: r,
|
|
1500
1504
|
disabled: e,
|
|
1501
1505
|
children: t
|
|
@@ -1512,10 +1516,10 @@ function G({
|
|
|
1512
1516
|
}
|
|
1513
1517
|
);
|
|
1514
1518
|
}
|
|
1515
|
-
function
|
|
1519
|
+
function ve() {
|
|
1516
1520
|
return /* @__PURE__ */ o("span", { class: "h-1 w-1 rounded-full bg-gray-300", "aria-hidden": "true" });
|
|
1517
1521
|
}
|
|
1518
|
-
function
|
|
1522
|
+
function Ft({ block: r }) {
|
|
1519
1523
|
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: [
|
|
1520
1524
|
/* @__PURE__ */ o(
|
|
1521
1525
|
"svg",
|
|
@@ -1544,11 +1548,11 @@ function Nt({ block: r }) {
|
|
|
1544
1548
|
] })
|
|
1545
1549
|
] }, e.id)) }) : null;
|
|
1546
1550
|
}
|
|
1547
|
-
function
|
|
1551
|
+
function Vt({ block: r }) {
|
|
1548
1552
|
const { t: e } = S(), t = r.title ?? e("pricing.money_back", "30-day money-back guarantee"), n = r.subtitle, i = (r.icon ?? "dollar_shield") !== "none", s = $t(t);
|
|
1549
1553
|
return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-1.5 border-b-1 pb-4 mb-1 border-gray-100", children: [
|
|
1550
1554
|
/* @__PURE__ */ u("div", { class: "inline-flex items-center gap-2 text-[12px] text-gray-700", children: [
|
|
1551
|
-
i ? /* @__PURE__ */ o(
|
|
1555
|
+
i ? /* @__PURE__ */ o(Ht, {}) : null,
|
|
1552
1556
|
s ? /* @__PURE__ */ u("span", { children: [
|
|
1553
1557
|
/* @__PURE__ */ o("b", { class: "font-bold text-gray-900", children: s.bold }),
|
|
1554
1558
|
" ",
|
|
@@ -1562,7 +1566,7 @@ function $t(r) {
|
|
|
1562
1566
|
const e = r.match(/^(\d+[-\s]?days?)\s+(.+)$/i);
|
|
1563
1567
|
return e ? { bold: e[1], rest: e[2] } : null;
|
|
1564
1568
|
}
|
|
1565
|
-
function
|
|
1569
|
+
function Ht() {
|
|
1566
1570
|
return /* @__PURE__ */ u(
|
|
1567
1571
|
"svg",
|
|
1568
1572
|
{
|
|
@@ -1597,22 +1601,22 @@ function Vt() {
|
|
|
1597
1601
|
}
|
|
1598
1602
|
);
|
|
1599
1603
|
}
|
|
1600
|
-
const
|
|
1601
|
-
function
|
|
1602
|
-
const t = e *
|
|
1603
|
-
let n =
|
|
1604
|
-
for (r.style.fontSize = `${n}px`; r.scrollHeight > t && n >
|
|
1604
|
+
const Re = 24, Gt = 16, Wt = 2;
|
|
1605
|
+
function Zt(r, e) {
|
|
1606
|
+
const t = e * Wt;
|
|
1607
|
+
let n = Re;
|
|
1608
|
+
for (r.style.fontSize = `${n}px`; r.scrollHeight > t && n > Gt; )
|
|
1605
1609
|
n -= 1, r.style.fontSize = `${n}px`;
|
|
1606
1610
|
}
|
|
1607
|
-
function
|
|
1611
|
+
function Yt({ block: r, ctx: e }) {
|
|
1608
1612
|
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 = j(null), a = t === 1 && !!e.bootstrap.settings.title_auto_fit;
|
|
1609
1613
|
return P(() => {
|
|
1610
1614
|
if (!a || !s.current) return;
|
|
1611
|
-
const l = getComputedStyle(s.current), c = parseFloat(l.lineHeight) ||
|
|
1612
|
-
|
|
1615
|
+
const l = getComputedStyle(s.current), c = parseFloat(l.lineHeight) || Re * 1.5;
|
|
1616
|
+
Zt(s.current, c);
|
|
1613
1617
|
}, [a, r.text]), /* @__PURE__ */ o(n, { ref: s, class: i, children: r.text });
|
|
1614
1618
|
}
|
|
1615
|
-
function
|
|
1619
|
+
function Kt(r) {
|
|
1616
1620
|
const e = r.local ?? { currency: r.currency, amount: r.amount };
|
|
1617
1621
|
if (r.interval === "year") {
|
|
1618
1622
|
const t = (r.interval_count ?? 1) * 12;
|
|
@@ -1620,7 +1624,7 @@ function Yt(r) {
|
|
|
1620
1624
|
}
|
|
1621
1625
|
return { amount: e.amount, currency: e.currency };
|
|
1622
1626
|
}
|
|
1623
|
-
function
|
|
1627
|
+
function se(r, e) {
|
|
1624
1628
|
const t = r % 1 !== 0 ? 2 : 0;
|
|
1625
1629
|
try {
|
|
1626
1630
|
const n = new Intl.NumberFormat(void 0, {
|
|
@@ -1638,20 +1642,20 @@ function oe(r, e) {
|
|
|
1638
1642
|
return { currency: e, amount: String(r) };
|
|
1639
1643
|
}
|
|
1640
1644
|
}
|
|
1641
|
-
function
|
|
1642
|
-
const { amount: t, currency: n } =
|
|
1645
|
+
function ce(r, e) {
|
|
1646
|
+
const { amount: t, currency: n } = Kt(r);
|
|
1643
1647
|
if (!e) {
|
|
1644
|
-
const { currency: l, amount: c } =
|
|
1648
|
+
const { currency: l, amount: c } = se(t, n);
|
|
1645
1649
|
return { currency: l, amount: c, originalAmount: null };
|
|
1646
1650
|
}
|
|
1647
|
-
const i = t * (1 - e / 100), s =
|
|
1651
|
+
const i = t * (1 - e / 100), s = se(i, n), a = se(t, n);
|
|
1648
1652
|
return {
|
|
1649
1653
|
currency: s.currency,
|
|
1650
1654
|
amount: s.amount,
|
|
1651
1655
|
originalAmount: `${a.currency}${a.amount}`
|
|
1652
1656
|
};
|
|
1653
1657
|
}
|
|
1654
|
-
function
|
|
1658
|
+
function De(r, e) {
|
|
1655
1659
|
if (r.label) return r.label.toUpperCase();
|
|
1656
1660
|
if (!r.interval || r.interval === "lifetime")
|
|
1657
1661
|
return e("pricing.plan_label.lifetime", "LIFETIME");
|
|
@@ -1663,14 +1667,14 @@ function Ue(r, e) {
|
|
|
1663
1667
|
}[r.interval];
|
|
1664
1668
|
return n ? e(n.key, n.fallback) : `${r.interval.toUpperCase()} PLAN`;
|
|
1665
1669
|
}
|
|
1666
|
-
function
|
|
1670
|
+
function ue(r, e) {
|
|
1667
1671
|
if (!r.interval || r.interval === "lifetime")
|
|
1668
1672
|
return e("pricing.interval.lifetime_short", "lifetime");
|
|
1669
1673
|
if (r.interval === "year") return e("pricing.interval.month", "month");
|
|
1670
1674
|
const t = r.interval_count ?? 1;
|
|
1671
1675
|
return t === 1 ? e(`pricing.interval.${r.interval}`, r.interval) : `${t} ${r.interval}s`;
|
|
1672
1676
|
}
|
|
1673
|
-
function
|
|
1677
|
+
function Xt({ block: r, ctx: e }) {
|
|
1674
1678
|
const { t } = S(), n = r.priceIds && r.priceIds.length > 0 ? new Set(r.priceIds) : null, i = e.bootstrap.prices.filter((a) => !n || n.has(a.id));
|
|
1675
1679
|
if (i.length === 0)
|
|
1676
1680
|
return /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: t("pricing.no_prices", "No prices available.") });
|
|
@@ -1683,13 +1687,13 @@ function Kt({ block: r, ctx: e }) {
|
|
|
1683
1687
|
role: "radiogroup",
|
|
1684
1688
|
"aria-label": t("pricing.plans_aria", "Plans"),
|
|
1685
1689
|
children: i.map((a, l) => /* @__PURE__ */ o(
|
|
1686
|
-
|
|
1690
|
+
Qt,
|
|
1687
1691
|
{
|
|
1688
1692
|
price: a,
|
|
1689
1693
|
isLast: l === i.length - 1,
|
|
1690
1694
|
isPopular: r.popular_price_id === a.id,
|
|
1691
1695
|
popularLabel: s,
|
|
1692
|
-
offer:
|
|
1696
|
+
offer: $(e.bootstrap.offers, a.id, { readStart: N }),
|
|
1693
1697
|
selected: e.selectedPriceId === a.id,
|
|
1694
1698
|
onSelect: () => {
|
|
1695
1699
|
e.setSelectedPriceId(a.id), e.onAction("price_selected", { priceId: a.id, price: a });
|
|
@@ -1702,7 +1706,7 @@ function Kt({ block: r, ctx: e }) {
|
|
|
1702
1706
|
);
|
|
1703
1707
|
if (r.view === "horizontal") {
|
|
1704
1708
|
const a = Math.min(i.length, 3), l = i.some(
|
|
1705
|
-
(c) => (
|
|
1709
|
+
(c) => ($(e.bootstrap.offers, c.id, { readStart: N })?.discount_percent ?? 0) > 0
|
|
1706
1710
|
);
|
|
1707
1711
|
return /* @__PURE__ */ o(
|
|
1708
1712
|
"div",
|
|
@@ -1712,12 +1716,12 @@ function Kt({ block: r, ctx: e }) {
|
|
|
1712
1716
|
role: "radiogroup",
|
|
1713
1717
|
"aria-label": t("pricing.plans_aria", "Plans"),
|
|
1714
1718
|
children: i.map((c) => /* @__PURE__ */ o(
|
|
1715
|
-
|
|
1719
|
+
er,
|
|
1716
1720
|
{
|
|
1717
1721
|
price: c,
|
|
1718
1722
|
isPopular: r.popular_price_id === c.id,
|
|
1719
1723
|
popularLabel: s,
|
|
1720
|
-
offer:
|
|
1724
|
+
offer: $(e.bootstrap.offers, c.id, { readStart: N }),
|
|
1721
1725
|
reserveStrikeRow: l,
|
|
1722
1726
|
selected: e.selectedPriceId === c.id,
|
|
1723
1727
|
onSelect: () => {
|
|
@@ -1737,7 +1741,7 @@ function Kt({ block: r, ctx: e }) {
|
|
|
1737
1741
|
role: "radiogroup",
|
|
1738
1742
|
"aria-label": t("pricing.plans_aria", "Plans"),
|
|
1739
1743
|
children: i.map((a) => {
|
|
1740
|
-
const l = e.selectedPriceId === a.id, c = r.popular_price_id === a.id, d =
|
|
1744
|
+
const l = e.selectedPriceId === a.id, c = r.popular_price_id === a.id, d = $(e.bootstrap.offers, a.id, { readStart: N })?.discount_percent ?? null, { currency: g, amount: _, originalAmount: p } = ce(a, d);
|
|
1741
1745
|
return /* @__PURE__ */ u(
|
|
1742
1746
|
"button",
|
|
1743
1747
|
{
|
|
@@ -1793,7 +1797,7 @@ function Kt({ block: r, ctx: e }) {
|
|
|
1793
1797
|
),
|
|
1794
1798
|
/* @__PURE__ */ u("div", { class: "flex flex-1 flex-col gap-0.5", children: [
|
|
1795
1799
|
/* @__PURE__ */ u("div", { class: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
|
|
1796
|
-
/* @__PURE__ */ o("span", { class: "text-xs font-normal uppercase tracking-normal text-gray-800/70", children:
|
|
1800
|
+
/* @__PURE__ */ o("span", { class: "text-xs font-normal uppercase tracking-normal text-gray-800/70", children: De(a, t) }),
|
|
1797
1801
|
p ? (
|
|
1798
1802
|
// opacity-60 приглушает strike: глаз сначала ловит label
|
|
1799
1803
|
// и discount-badge, потом main price; original «бывшая цена»
|
|
@@ -1816,7 +1820,7 @@ function Kt({ block: r, ctx: e }) {
|
|
|
1816
1820
|
/* @__PURE__ */ u("span", { class: "text-sm font-normal text-gray-500", children: [
|
|
1817
1821
|
" ",
|
|
1818
1822
|
"/ ",
|
|
1819
|
-
|
|
1823
|
+
ue(a, t)
|
|
1820
1824
|
] })
|
|
1821
1825
|
] }) }),
|
|
1822
1826
|
a.description ? /* @__PURE__ */ o("span", { class: "mt-1 text-xs leading-relaxed text-gray-500", children: a.description }) : null
|
|
@@ -1837,10 +1841,10 @@ function Kt({ block: r, ctx: e }) {
|
|
|
1837
1841
|
}
|
|
1838
1842
|
);
|
|
1839
1843
|
}
|
|
1840
|
-
function
|
|
1844
|
+
function Jt(r, e) {
|
|
1841
1845
|
return r.label ? r.label : !r.interval || r.interval === "lifetime" ? e("pricing.interval.lifetime_short", "lifetime") : e(`pricing.interval.${r.interval}`, r.interval);
|
|
1842
1846
|
}
|
|
1843
|
-
function
|
|
1847
|
+
function Qt({
|
|
1844
1848
|
price: r,
|
|
1845
1849
|
isLast: e,
|
|
1846
1850
|
isPopular: t,
|
|
@@ -1850,7 +1854,7 @@ function Jt({
|
|
|
1850
1854
|
onSelect: a,
|
|
1851
1855
|
t: l
|
|
1852
1856
|
}) {
|
|
1853
|
-
const c = i?.discount_percent ?? null, { currency: h, amount: d, originalAmount: g } =
|
|
1857
|
+
const c = i?.discount_percent ?? null, { currency: h, amount: d, originalAmount: g } = ce(r, c);
|
|
1854
1858
|
return /* @__PURE__ */ u(
|
|
1855
1859
|
"button",
|
|
1856
1860
|
{
|
|
@@ -1900,7 +1904,7 @@ function Jt({
|
|
|
1900
1904
|
].join(" "),
|
|
1901
1905
|
children: [
|
|
1902
1906
|
/* @__PURE__ */ u("div", { class: "flex flex-wrap items-center gap-1 gap-x-1.5", children: [
|
|
1903
|
-
/* @__PURE__ */ o("span", { class: "text-base font-normal capitalize text-gray-800", children:
|
|
1907
|
+
/* @__PURE__ */ o("span", { class: "text-base font-normal capitalize text-gray-800", children: Jt(r, l) }),
|
|
1904
1908
|
t ? (
|
|
1905
1909
|
// Pastel brand-mix pill — точно как `badge` в TelegramPricingRadio.
|
|
1906
1910
|
// Низкий visual weight: pill про "имя плана" (most popular), а не
|
|
@@ -1932,7 +1936,7 @@ function Jt({
|
|
|
1932
1936
|
/* @__PURE__ */ u("span", { class: "text-xs text-gray-400", children: [
|
|
1933
1937
|
" ",
|
|
1934
1938
|
"/ ",
|
|
1935
|
-
|
|
1939
|
+
ue(r, l)
|
|
1936
1940
|
] })
|
|
1937
1941
|
] })
|
|
1938
1942
|
] })
|
|
@@ -1943,7 +1947,7 @@ function Jt({
|
|
|
1943
1947
|
}
|
|
1944
1948
|
);
|
|
1945
1949
|
}
|
|
1946
|
-
function
|
|
1950
|
+
function er({
|
|
1947
1951
|
price: r,
|
|
1948
1952
|
isPopular: e,
|
|
1949
1953
|
popularLabel: t,
|
|
@@ -1953,7 +1957,7 @@ function Qt({
|
|
|
1953
1957
|
onSelect: a,
|
|
1954
1958
|
t: l
|
|
1955
1959
|
}) {
|
|
1956
|
-
const c = n?.discount_percent ?? null, { currency: h, amount: d, originalAmount: g } =
|
|
1960
|
+
const c = n?.discount_percent ?? null, { currency: h, amount: d, originalAmount: g } = ce(r, c);
|
|
1957
1961
|
return /* @__PURE__ */ u(
|
|
1958
1962
|
"button",
|
|
1959
1963
|
{
|
|
@@ -1967,7 +1971,7 @@ function Qt({
|
|
|
1967
1971
|
].join(" "),
|
|
1968
1972
|
style: s ? { background: "color-mix(in srgb, var(--pw-accent) 6%, transparent)" } : void 0,
|
|
1969
1973
|
children: [
|
|
1970
|
-
/* @__PURE__ */ o("span", { class: "flex min-h-[2.4em] items-center text-[10px] font-normal uppercase leading-tight text-gray-800/70", children:
|
|
1974
|
+
/* @__PURE__ */ o("span", { class: "flex min-h-[2.4em] items-center text-[10px] font-normal uppercase leading-tight text-gray-800/70", children: De(r, l) }),
|
|
1971
1975
|
i ? /* @__PURE__ */ u("div", { class: "flex h-[22px] items-center justify-center gap-1.5", children: [
|
|
1972
1976
|
g ? /* @__PURE__ */ o("span", { class: "text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: g }) : null,
|
|
1973
1977
|
c ? /* @__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: [
|
|
@@ -1982,7 +1986,7 @@ function Qt({
|
|
|
1982
1986
|
] }),
|
|
1983
1987
|
/* @__PURE__ */ u("span", { class: "text-xs font-normal text-gray-500", children: [
|
|
1984
1988
|
"/ ",
|
|
1985
|
-
|
|
1989
|
+
ue(r, l)
|
|
1986
1990
|
] }),
|
|
1987
1991
|
e ? /* @__PURE__ */ o(
|
|
1988
1992
|
"span",
|
|
@@ -1996,24 +2000,24 @@ function Qt({
|
|
|
1996
2000
|
}
|
|
1997
2001
|
);
|
|
1998
2002
|
}
|
|
1999
|
-
function
|
|
2003
|
+
function tr({ block: r }) {
|
|
2000
2004
|
return /* @__PURE__ */ o("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children: r.text });
|
|
2001
2005
|
}
|
|
2002
|
-
const
|
|
2006
|
+
const rr = {
|
|
2003
2007
|
week: 0.25,
|
|
2004
2008
|
month: 1,
|
|
2005
2009
|
year: 12
|
|
2006
2010
|
};
|
|
2007
|
-
function
|
|
2011
|
+
function nr(r, e) {
|
|
2008
2012
|
return r ? e(`pricing.interval.${r}`, r) : e("pricing.interval.period", "period");
|
|
2009
2013
|
}
|
|
2010
|
-
function
|
|
2014
|
+
function ir({ block: r, ctx: e }) {
|
|
2011
2015
|
const { t } = S();
|
|
2012
2016
|
if (!r.queries.length) return null;
|
|
2013
|
-
const i = e.bootstrap.prices.find((a) => a.id === e.selectedPriceId)?.interval ?? null, s = i ?
|
|
2017
|
+
const i = e.bootstrap.prices.find((a) => a.id === e.selectedPriceId)?.interval ?? null, s = i ? rr[i] : void 0;
|
|
2014
2018
|
return /* @__PURE__ */ u("div", { class: "flex flex-col gap-2", children: [
|
|
2015
2019
|
/* @__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}:", {
|
|
2016
|
-
interval:
|
|
2020
|
+
interval: nr(i, t)
|
|
2017
2021
|
}) }),
|
|
2018
2022
|
/* @__PURE__ */ o("ul", { class: "flex flex-col gap-2", role: "list", children: r.queries.map((a) => {
|
|
2019
2023
|
const l = Number.isFinite(a.count) ? a.count : 0, c = s !== void 0 ? Math.round(l * s) : l;
|
|
@@ -2043,7 +2047,7 @@ function nr({ block: r, ctx: e }) {
|
|
|
2043
2047
|
/* @__PURE__ */ o("span", { class: "font-semibold text-gray-900 text-sm", children: c }),
|
|
2044
2048
|
" ",
|
|
2045
2049
|
/* @__PURE__ */ o("span", { class: "text-sm text-gray-800", children: a.name }),
|
|
2046
|
-
a.desc ? /* @__PURE__ */ u(
|
|
2050
|
+
a.desc ? /* @__PURE__ */ u(le, { children: [
|
|
2047
2051
|
/* @__PURE__ */ o("br", {}),
|
|
2048
2052
|
/* @__PURE__ */ o("span", { class: "text-xs text-gray-400", children: a.desc })
|
|
2049
2053
|
] }) : null
|
|
@@ -2052,20 +2056,20 @@ function nr({ block: r, ctx: e }) {
|
|
|
2052
2056
|
}) })
|
|
2053
2057
|
] });
|
|
2054
2058
|
}
|
|
2055
|
-
const
|
|
2056
|
-
heading:
|
|
2057
|
-
text:
|
|
2058
|
-
price_grid:
|
|
2059
|
-
cta_button:
|
|
2060
|
-
auth_panel:
|
|
2061
|
-
current_session:
|
|
2062
|
-
features_list:
|
|
2063
|
-
tokenization_gate:
|
|
2064
|
-
guarantee_badge:
|
|
2065
|
-
offer_banner:
|
|
2059
|
+
const or = {
|
|
2060
|
+
heading: Yt,
|
|
2061
|
+
text: tr,
|
|
2062
|
+
price_grid: Xt,
|
|
2063
|
+
cta_button: qt,
|
|
2064
|
+
auth_panel: Be,
|
|
2065
|
+
current_session: Nt,
|
|
2066
|
+
features_list: Ft,
|
|
2067
|
+
tokenization_gate: ir,
|
|
2068
|
+
guarantee_badge: Vt,
|
|
2069
|
+
offer_banner: Lt
|
|
2066
2070
|
};
|
|
2067
|
-
function
|
|
2068
|
-
const a =
|
|
2071
|
+
function sr({ layout: r, bootstrap: e, onAction: t, auth: n, authSession: i, hasTopBanner: s }) {
|
|
2072
|
+
const a = Ze(() => {
|
|
2069
2073
|
for (const v of r.blocks)
|
|
2070
2074
|
if (v.type === "price_grid" && v.popular_price_id && e.prices.some((m) => m.id === v.popular_price_id))
|
|
2071
2075
|
return v.popular_price_id;
|
|
@@ -2078,10 +2082,10 @@ function or({ layout: r, bootstrap: e, onAction: t, auth: n, authSession: i, has
|
|
|
2078
2082
|
auth: n,
|
|
2079
2083
|
authSession: i
|
|
2080
2084
|
}, d = r.blocks.findIndex((v) => v.type === "cta_button"), g = d === -1 ? r.blocks : r.blocks.slice(0, d), _ = d === -1 ? [] : r.blocks.slice(d), p = (v, m) => {
|
|
2081
|
-
const A =
|
|
2085
|
+
const A = or[v.type];
|
|
2082
2086
|
return A ? /* @__PURE__ */ o(A, { block: v, ctx: h }, `${v.type}-${m}`) : (typeof console < "u" && console.warn(`[paywall] unknown block type: ${v.type}`), null);
|
|
2083
2087
|
};
|
|
2084
|
-
return /* @__PURE__ */ u(
|
|
2088
|
+
return /* @__PURE__ */ u(le, { children: [
|
|
2085
2089
|
/* @__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: g.map(p) }) }),
|
|
2086
2090
|
_.length > 0 ? (
|
|
2087
2091
|
// Тонкий shadow-top вместо border-t — создаёт depth, читается как
|
|
@@ -2098,13 +2102,13 @@ function or({ layout: r, bootstrap: e, onAction: t, auth: n, authSession: i, has
|
|
|
2098
2102
|
) : null
|
|
2099
2103
|
] });
|
|
2100
2104
|
}
|
|
2101
|
-
function
|
|
2105
|
+
function ar(r, e, t, n) {
|
|
2102
2106
|
return r ? n ? { open: !0, view: "purchased", error: null, processing: !1 } : e.status === "idle" || e.status === "loading" ? { open: !0, view: "loading", error: null, processing: !1 } : e.status === "error" ? { open: !0, view: "error", error: e.error, processing: !1 } : t.kind === "support" ? { open: !0, view: "support", error: null, processing: !1 } : t.kind === "auth_gate" ? { open: !0, view: "auth", error: null, processing: !1 } : t.kind === "awaiting_payment" ? { open: !0, view: "awaiting_payment", error: null, processing: !1 } : t.kind === "popup_blocked" ? { open: !0, view: "popup_blocked", error: null, processing: !1 } : t.kind === "purchase_success" ? { open: !0, view: "purchased", error: null, processing: !1 } : t.kind === "verifying" ? { open: !0, view: "loading", error: null, processing: !1 } : { open: !0, view: "layout", error: null, processing: !1 } : { open: !1, view: null, error: null, processing: !1 };
|
|
2103
2107
|
}
|
|
2104
|
-
function
|
|
2108
|
+
function lr(r, e) {
|
|
2105
2109
|
return r.open === e.open && r.view === e.view && r.error === e.error && r.processing === e.processing;
|
|
2106
2110
|
}
|
|
2107
|
-
function
|
|
2111
|
+
function cr({
|
|
2108
2112
|
client: r,
|
|
2109
2113
|
open: e,
|
|
2110
2114
|
onClose: t,
|
|
@@ -2137,8 +2141,8 @@ function lr({
|
|
|
2137
2141
|
} : { kind: "layout" }), C = i === "awaiting_payment" || i === "popup_blocked" || i === "auth" && !!a, I = j(!1), O = j(null);
|
|
2138
2142
|
P(() => {
|
|
2139
2143
|
if (!d) return;
|
|
2140
|
-
const x =
|
|
2141
|
-
f &&
|
|
2144
|
+
const x = ar(e, p, b, c), f = O.current;
|
|
2145
|
+
f && lr(f, x) || (O.current = x, d(x));
|
|
2142
2146
|
}, [e, p, b, c, d]), P(() => {
|
|
2143
2147
|
if (r.auth)
|
|
2144
2148
|
return r.auth.onAuthChange((x, f) => A(f));
|
|
@@ -2168,7 +2172,7 @@ function lr({
|
|
|
2168
2172
|
}), () => {
|
|
2169
2173
|
x = !0;
|
|
2170
2174
|
};
|
|
2171
|
-
}, [e, r]),
|
|
2175
|
+
}, [e, r]), Ye(() => {
|
|
2172
2176
|
if (!e) {
|
|
2173
2177
|
y({ kind: "layout" }), I.current = !1;
|
|
2174
2178
|
return;
|
|
@@ -2190,16 +2194,16 @@ function lr({
|
|
|
2190
2194
|
}, [e, i, a, l]);
|
|
2191
2195
|
const M = async (x) => {
|
|
2192
2196
|
try {
|
|
2193
|
-
const f = r.getCachedOffers?.() ?? null, w = f ?
|
|
2197
|
+
const f = r.getCachedOffers?.() ?? null, w = f ? $(f, x, { readStart: N }) : null, B = await r.createCheckout({
|
|
2194
2198
|
priceId: x,
|
|
2195
2199
|
offerId: w?.id,
|
|
2196
2200
|
ignoreActivePurchase: h === !0
|
|
2197
2201
|
});
|
|
2198
2202
|
if (n("checkout_started", { priceId: x, url: B.url, acquiring: B.acquiring }), typeof window > "u" || !B.url) return;
|
|
2199
|
-
const
|
|
2200
|
-
if (
|
|
2203
|
+
const V = window.open(B.url, "_blank");
|
|
2204
|
+
if (V) {
|
|
2201
2205
|
try {
|
|
2202
|
-
|
|
2206
|
+
V.opener = null;
|
|
2203
2207
|
} catch {
|
|
2204
2208
|
}
|
|
2205
2209
|
y({ kind: "awaiting_payment", priceId: x, url: B.url });
|
|
@@ -2280,14 +2284,14 @@ function lr({
|
|
|
2280
2284
|
n("error", new L("no_price", "No price selected"));
|
|
2281
2285
|
return;
|
|
2282
2286
|
}
|
|
2283
|
-
const B = p.data.settings.checkout_mode ?? "guest",
|
|
2284
|
-
if (B === "preauth" && !!r.auth && !
|
|
2287
|
+
const B = p.data.settings.checkout_mode ?? "guest", V = r.auth?.getCachedSession() ?? null, ze = !!V && !V.user.is_anonymous;
|
|
2288
|
+
if (B === "preauth" && !!r.auth && !ze) {
|
|
2285
2289
|
y({ kind: "auth_gate", pendingCheckout: { priceId: w } });
|
|
2286
2290
|
return;
|
|
2287
2291
|
}
|
|
2288
2292
|
await M(w);
|
|
2289
2293
|
}
|
|
2290
|
-
}, z = p.status === "ready" ? p.data.settings.brand_color : null, T = p.status === "ready" ? p.data.settings.allow_close !== !1 : !0, q = b.kind === "layout" && p.status === "ready" ?
|
|
2294
|
+
}, z = p.status === "ready" ? p.data.settings.brand_color : null, T = p.status === "ready" ? p.data.settings.allow_close !== !1 : !0, q = b.kind === "layout" && p.status === "ready" ? Pe(p.data.offers) : null, U = q ? /* @__PURE__ */ o(Mt, { offer: q }) : null, K = {
|
|
2291
2295
|
type: "auth_panel",
|
|
2292
2296
|
// Заголовок не задаём — AuthGate сам решит по intent'у (restore →
|
|
2293
2297
|
// "Restore Purchases", остальные → дефолтный "Welcome back!").
|
|
@@ -2297,8 +2301,8 @@ function lr({
|
|
|
2297
2301
|
// чем хотим показывать "Signed in as ..." промежуточным экраном.
|
|
2298
2302
|
hide_when_authenticated: !1,
|
|
2299
2303
|
providers: p.status === "ready" ? p.data.settings.auth_providers : void 0
|
|
2300
|
-
},
|
|
2301
|
-
|
|
2304
|
+
}, H = b.kind === "support" ? /* @__PURE__ */ o(
|
|
2305
|
+
Bt,
|
|
2302
2306
|
{
|
|
2303
2307
|
client: r,
|
|
2304
2308
|
authSession: m,
|
|
@@ -2307,22 +2311,22 @@ function lr({
|
|
|
2307
2311
|
b.origin === "standalone" ? t() : y({ kind: "layout" });
|
|
2308
2312
|
}
|
|
2309
2313
|
}
|
|
2310
|
-
) : null,
|
|
2311
|
-
return /* @__PURE__ */ o(
|
|
2312
|
-
|
|
2314
|
+
) : null, X = b.kind === "auth_gate" && b.origin !== "standalone" || b.kind === "support", J = p.status === "ready" ? p.data : null;
|
|
2315
|
+
return /* @__PURE__ */ o(at, { bootstrap: J, forceLocale: _, children: /* @__PURE__ */ o(
|
|
2316
|
+
lt,
|
|
2313
2317
|
{
|
|
2314
2318
|
open: e,
|
|
2315
2319
|
onClose: t,
|
|
2316
2320
|
brandColor: z,
|
|
2317
2321
|
topBanner: U,
|
|
2318
2322
|
allowClose: T,
|
|
2319
|
-
hideCloseButton:
|
|
2323
|
+
hideCloseButton: X,
|
|
2320
2324
|
inline: g,
|
|
2321
2325
|
labelledBy: "pw-title",
|
|
2322
|
-
children: c ? /* @__PURE__ */ o(
|
|
2323
|
-
|
|
2326
|
+
children: c ? /* @__PURE__ */ o(_e, { onContinue: t }) : b.kind === "purchase_success" ? /* @__PURE__ */ o(_e, { restored: b.restored, onContinue: t }) : H || (p.status === "loading" || p.status === "idle" || b.kind === "verifying" ? /* @__PURE__ */ o(ur, { verifying: b.kind === "verifying" }) : p.status === "error" ? /* @__PURE__ */ o(dr, { message: p.error.message }) : b.kind === "auth_gate" && r.auth ? /* @__PURE__ */ o(
|
|
2327
|
+
St,
|
|
2324
2328
|
{
|
|
2325
|
-
block:
|
|
2329
|
+
block: K,
|
|
2326
2330
|
bootstrap: p.data,
|
|
2327
2331
|
auth: r.auth,
|
|
2328
2332
|
authSession: m,
|
|
@@ -2334,7 +2338,7 @@ function lr({
|
|
|
2334
2338
|
}
|
|
2335
2339
|
}
|
|
2336
2340
|
) : b.kind === "awaiting_payment" ? /* @__PURE__ */ o(
|
|
2337
|
-
|
|
2341
|
+
pr,
|
|
2338
2342
|
{
|
|
2339
2343
|
client: r,
|
|
2340
2344
|
onBack: () => y({ kind: "layout" }),
|
|
@@ -2349,8 +2353,8 @@ function lr({
|
|
|
2349
2353
|
},
|
|
2350
2354
|
onRetry: () => M(b.priceId)
|
|
2351
2355
|
}
|
|
2352
|
-
) : b.kind === "popup_blocked" ? /* @__PURE__ */ o(
|
|
2353
|
-
|
|
2356
|
+
) : b.kind === "popup_blocked" ? /* @__PURE__ */ o(hr, { onReopen: () => R(b.priceId, b.url) }) : /* @__PURE__ */ o(
|
|
2357
|
+
sr,
|
|
2354
2358
|
{
|
|
2355
2359
|
layout: p.data.layout,
|
|
2356
2360
|
bootstrap: p.data,
|
|
@@ -2362,14 +2366,14 @@ function lr({
|
|
|
2362
2366
|
}
|
|
2363
2367
|
) });
|
|
2364
2368
|
}
|
|
2365
|
-
function
|
|
2369
|
+
function ur({ verifying: r }) {
|
|
2366
2370
|
const { t: e } = S();
|
|
2367
2371
|
return /* @__PURE__ */ u("div", { class: "flex flex-col items-center justify-center gap-3 py-12", children: [
|
|
2368
2372
|
/* @__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)]" }),
|
|
2369
2373
|
/* @__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…") })
|
|
2370
2374
|
] });
|
|
2371
2375
|
}
|
|
2372
|
-
function
|
|
2376
|
+
function dr({ message: r }) {
|
|
2373
2377
|
const { t: e } = S();
|
|
2374
2378
|
return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
|
|
2375
2379
|
/* @__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: [
|
|
@@ -2380,7 +2384,7 @@ function ur({ message: r }) {
|
|
|
2380
2384
|
/* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: r })
|
|
2381
2385
|
] });
|
|
2382
2386
|
}
|
|
2383
|
-
function
|
|
2387
|
+
function hr({ onReopen: r }) {
|
|
2384
2388
|
const { t: e } = S();
|
|
2385
2389
|
return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
|
|
2386
2390
|
/* @__PURE__ */ o(
|
|
@@ -2447,7 +2451,7 @@ function dr({ onReopen: r }) {
|
|
|
2447
2451
|
)
|
|
2448
2452
|
] });
|
|
2449
2453
|
}
|
|
2450
|
-
function
|
|
2454
|
+
function pr({
|
|
2451
2455
|
client: r,
|
|
2452
2456
|
onBack: e,
|
|
2453
2457
|
onReopen: t,
|
|
@@ -2548,20 +2552,19 @@ function hr({
|
|
|
2548
2552
|
)
|
|
2549
2553
|
] });
|
|
2550
2554
|
}
|
|
2551
|
-
function
|
|
2555
|
+
function _e({
|
|
2552
2556
|
onContinue: r,
|
|
2553
2557
|
restored: e = !1
|
|
2554
2558
|
}) {
|
|
2555
2559
|
const { t } = S();
|
|
2556
|
-
return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-
|
|
2560
|
+
return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-4 py-6 text-center", children: [
|
|
2557
2561
|
/* @__PURE__ */ o(
|
|
2558
2562
|
"div",
|
|
2559
2563
|
{
|
|
2560
|
-
class: "flex h-14 w-14 items-center justify-center rounded-full
|
|
2564
|
+
class: "flex h-14 w-14 items-center justify-center rounded-full",
|
|
2561
2565
|
style: {
|
|
2562
2566
|
background: "linear-gradient(135deg, #4ade80, #16a34a)",
|
|
2563
2567
|
color: "#fff",
|
|
2564
|
-
// emerald ring with low alpha for a halo effect
|
|
2565
2568
|
boxShadow: "0 0 0 8px rgba(74,222,128,0.12), 0 8px 20px -6px rgba(22,163,74,0.45)"
|
|
2566
2569
|
},
|
|
2567
2570
|
"aria-hidden": "true",
|
|
@@ -2577,8 +2580,8 @@ function ve({
|
|
|
2577
2580
|
) })
|
|
2578
2581
|
}
|
|
2579
2582
|
),
|
|
2580
|
-
/* @__PURE__ */ o("p", { id: "pw-title", class: "mt-1 text-
|
|
2581
|
-
/* @__PURE__ */ o("p", { class: "text-
|
|
2583
|
+
/* @__PURE__ */ o("p", { id: "pw-title", class: "mt-1 text-3xl font-bold tracking-tight text-gray-900", children: e ? t("modal.purchase_restored_title", "Subscription restored") : t("modal.purchase_success_title", "Payment received") }),
|
|
2584
|
+
/* @__PURE__ */ o("p", { class: "text-base leading-relaxed text-gray-600", children: e ? t(
|
|
2582
2585
|
"modal.purchase_restored_subtitle",
|
|
2583
2586
|
"Welcome back — your subscription is already active."
|
|
2584
2587
|
) : t("modal.purchase_success_subtitle", "Your subscription is now active.") }),
|
|
@@ -2587,27 +2590,27 @@ function ve({
|
|
|
2587
2590
|
{
|
|
2588
2591
|
type: "button",
|
|
2589
2592
|
onClick: r,
|
|
2590
|
-
class: "mt-
|
|
2593
|
+
class: "pw-cta-shimmer relative mt-2 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] focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
|
|
2591
2594
|
style: {
|
|
2592
|
-
background: "linear-gradient(
|
|
2593
|
-
boxShadow: "0
|
|
2595
|
+
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%)",
|
|
2596
|
+
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)"
|
|
2594
2597
|
},
|
|
2595
|
-
children: t("modal.continue", "Continue")
|
|
2598
|
+
children: /* @__PURE__ */ o("span", { class: "relative z-10", children: t("modal.continue", "Continue") })
|
|
2596
2599
|
}
|
|
2597
2600
|
)
|
|
2598
2601
|
] });
|
|
2599
2602
|
}
|
|
2600
|
-
const
|
|
2601
|
-
class
|
|
2603
|
+
const fr = 10 * 6e4, gr = 5e3, mr = 3e4;
|
|
2604
|
+
class yr {
|
|
2602
2605
|
constructor(e) {
|
|
2603
2606
|
this.timer = null, this.timeoutTimer = null, this.visibilityHandler = null, this.focusHandler = null, this.messageHandler = null, this.stopped = !1, this.checking = !1, this.opts = {
|
|
2604
2607
|
client: e.client,
|
|
2605
2608
|
onActive: e.onActive,
|
|
2606
2609
|
onTimeout: e.onTimeout ?? (() => {
|
|
2607
2610
|
}),
|
|
2608
|
-
timeoutMs: e.timeoutMs ??
|
|
2609
|
-
visibleIntervalMs: e.visibleIntervalMs ??
|
|
2610
|
-
hiddenIntervalMs: e.hiddenIntervalMs ??
|
|
2611
|
+
timeoutMs: e.timeoutMs ?? fr,
|
|
2612
|
+
visibleIntervalMs: e.visibleIntervalMs ?? gr,
|
|
2613
|
+
hiddenIntervalMs: e.hiddenIntervalMs ?? mr
|
|
2611
2614
|
};
|
|
2612
2615
|
}
|
|
2613
2616
|
start() {
|
|
@@ -2646,10 +2649,10 @@ class mr {
|
|
|
2646
2649
|
!t || typeof t != "object" || t.type === "paywall_purchase" && this.check();
|
|
2647
2650
|
}
|
|
2648
2651
|
}
|
|
2649
|
-
function
|
|
2652
|
+
function br() {
|
|
2650
2653
|
return !(typeof document > "u" || typeof window > "u" || typeof location < "u" && location.protocol === "chrome-extension:");
|
|
2651
2654
|
}
|
|
2652
|
-
const
|
|
2655
|
+
const ae = {
|
|
2653
2656
|
open: !1,
|
|
2654
2657
|
view: null,
|
|
2655
2658
|
error: null,
|
|
@@ -2659,11 +2662,11 @@ const se = {
|
|
|
2659
2662
|
priceId: "paywall_price_id",
|
|
2660
2663
|
sessionId: "paywall_session_id"
|
|
2661
2664
|
};
|
|
2662
|
-
let
|
|
2665
|
+
let xr = class {
|
|
2663
2666
|
constructor(e) {
|
|
2664
|
-
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 =
|
|
2665
|
-
const { auth: t, ownsAuth: n } =
|
|
2666
|
-
this.auth = t, this.ownsAuth = n, this.billing = e.client ?? new
|
|
2667
|
+
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.lastMountedView = null, this.trialStore = null, this.trialStoreConfig = null, this.lastTrialStatus = null, this.trialExpiredFired = !1, this.lastVisibility = null, this.currentState = ae, this.stateListeners = /* @__PURE__ */ new Set();
|
|
2668
|
+
const { auth: t, ownsAuth: n } = wr(e);
|
|
2669
|
+
this.auth = t, this.ownsAuth = n, this.billing = e.client ?? new qe({ ...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) => {
|
|
2667
2670
|
this.emit("userChange", i);
|
|
2668
2671
|
}), this.auth && (this.authUnsub = this.auth.onAuthChange((i, s) => {
|
|
2669
2672
|
this.emit("authChange", { event: i, session: s });
|
|
@@ -2674,7 +2677,7 @@ let br = class {
|
|
|
2674
2677
|
const t = typeof e == "object" && e !== null ? e : {};
|
|
2675
2678
|
if (t.enabled === !1) return;
|
|
2676
2679
|
const n = t.endpoint ?? `${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;
|
|
2677
|
-
this.tracker = new
|
|
2680
|
+
this.tracker = new Ne({
|
|
2678
2681
|
endpoint: n,
|
|
2679
2682
|
paywallId: this.billing.paywallId,
|
|
2680
2683
|
capabilities: this.billing.capabilities,
|
|
@@ -2685,14 +2688,15 @@ let br = class {
|
|
|
2685
2688
|
maxBufferSize: t.maxBufferSize,
|
|
2686
2689
|
fetch: t.fetch,
|
|
2687
2690
|
sendBeacon: t.sendBeacon
|
|
2688
|
-
}), this.on("open", () =>
|
|
2689
|
-
"
|
|
2690
|
-
|
|
2691
|
+
}), this.on("open", () => {
|
|
2692
|
+
this.lastMountedView === "layout" && this.tracker?.track("paywall_opened");
|
|
2693
|
+
}), this.on("ready", (i) => {
|
|
2694
|
+
this.lastMountedView === "layout" && this.tracker?.track("paywall_viewed", {
|
|
2691
2695
|
is_test_mode: i.settings.is_test_mode,
|
|
2692
2696
|
prices_count: i.prices.length,
|
|
2693
2697
|
offers_count: i.offers.length
|
|
2694
|
-
})
|
|
2695
|
-
), this.on(
|
|
2698
|
+
});
|
|
2699
|
+
}), this.on(
|
|
2696
2700
|
"price_selected",
|
|
2697
2701
|
(i) => this.tracker?.track("price_selected", { price_id: i.priceId })
|
|
2698
2702
|
), this.on(
|
|
@@ -2710,7 +2714,9 @@ let br = class {
|
|
|
2710
2714
|
), this.on(
|
|
2711
2715
|
"purchase_failed",
|
|
2712
2716
|
(i) => this.tracker?.track("purchase_failed", { reason: i.reason })
|
|
2713
|
-
), this.on("close", () =>
|
|
2717
|
+
), this.on("close", () => {
|
|
2718
|
+
this.lastMountedView === "layout" && this.tracker?.track("paywall_closed");
|
|
2719
|
+
}), this.on(
|
|
2714
2720
|
"trial_blocked",
|
|
2715
2721
|
(i) => this.tracker?.track("trial_blocked", {
|
|
2716
2722
|
mode: i.mode,
|
|
@@ -3156,13 +3162,14 @@ let br = class {
|
|
|
3156
3162
|
});
|
|
3157
3163
|
}
|
|
3158
3164
|
ensureTrialStore(e) {
|
|
3159
|
-
if (this.trialStore && this.trialStoreConfig &&
|
|
3165
|
+
if (this.trialStore && this.trialStoreConfig && _r(this.trialStoreConfig, e))
|
|
3160
3166
|
return this.trialStore;
|
|
3161
3167
|
this.trialStoreConfig = e;
|
|
3162
3168
|
const t = this.billing.createTrialStore;
|
|
3163
|
-
return this.trialStore = typeof t == "function" ? t.call(this.billing, e) :
|
|
3169
|
+
return this.trialStore = typeof t == "function" ? t.call(this.billing, e) : Fe(this.billing.getStorage(), this.billing.paywallId, e), this.trialStore;
|
|
3164
3170
|
}
|
|
3165
3171
|
mountAndShow(e, t = {}) {
|
|
3172
|
+
this.lastMountedView = e;
|
|
3166
3173
|
const n = t.renew === !0, i = t.authMode, a = e === "auth" || e === "awaiting_payment" || e === "popup_blocked" ? t.checkoutPriceId ?? null : null, l = e === "awaiting_payment" || e === "popup_blocked" ? t.checkoutUrl ?? null : null;
|
|
3167
3174
|
if (this.handle) {
|
|
3168
3175
|
this.isOpen = !0, this.handle.update({
|
|
@@ -3176,8 +3183,8 @@ let br = class {
|
|
|
3176
3183
|
}), this.emit("open");
|
|
3177
3184
|
return;
|
|
3178
3185
|
}
|
|
3179
|
-
this.isOpen = !0, this.handle =
|
|
3180
|
-
|
|
3186
|
+
this.isOpen = !0, this.handle = tt(
|
|
3187
|
+
cr,
|
|
3181
3188
|
{
|
|
3182
3189
|
client: this.billing,
|
|
3183
3190
|
open: !0,
|
|
@@ -3199,7 +3206,7 @@ let br = class {
|
|
|
3199
3206
|
), this.emit("open");
|
|
3200
3207
|
}
|
|
3201
3208
|
applyState(e) {
|
|
3202
|
-
if (!
|
|
3209
|
+
if (!vr(this.currentState, e)) {
|
|
3203
3210
|
this.currentState = e;
|
|
3204
3211
|
for (const t of this.stateListeners)
|
|
3205
3212
|
try {
|
|
@@ -3301,10 +3308,10 @@ let br = class {
|
|
|
3301
3308
|
getOfferForPrice(e) {
|
|
3302
3309
|
const t = this.billing.getCachedOffers();
|
|
3303
3310
|
if (!t) return null;
|
|
3304
|
-
const n =
|
|
3305
|
-
return n ?
|
|
3311
|
+
const n = Ce(t, e);
|
|
3312
|
+
return n ? Ie(n, {
|
|
3306
3313
|
now: Date.now(),
|
|
3307
|
-
readStart:
|
|
3314
|
+
readStart: N
|
|
3308
3315
|
}) : null;
|
|
3309
3316
|
}
|
|
3310
3317
|
/** Снимок текущего «языка юзера» — proxy над `billing.getUserLanguage()`.
|
|
@@ -3395,7 +3402,7 @@ let br = class {
|
|
|
3395
3402
|
// В extension popup runtime — no-op (popup не доживёт). Там полагаемся на
|
|
3396
3403
|
// bootstrap при следующем открытии.
|
|
3397
3404
|
startUserWatcher() {
|
|
3398
|
-
this.watcher ||
|
|
3405
|
+
this.watcher || br() && (this.watcher = new yr({
|
|
3399
3406
|
client: this.billing,
|
|
3400
3407
|
onActive: (e) => {
|
|
3401
3408
|
this.watcher = null, this.emit("purchase_completed", { priceId: null, sessionId: null });
|
|
@@ -3414,7 +3421,7 @@ let br = class {
|
|
|
3414
3421
|
}), this.watcher.start());
|
|
3415
3422
|
}
|
|
3416
3423
|
close() {
|
|
3417
|
-
!this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(
|
|
3424
|
+
!this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(ae), this.emit("close"));
|
|
3418
3425
|
}
|
|
3419
3426
|
/**
|
|
3420
3427
|
* Сканирует текущий URL на маркеры возврата с checkout и эмитит
|
|
@@ -3424,23 +3431,23 @@ let br = class {
|
|
|
3424
3431
|
*/
|
|
3425
3432
|
checkReturn() {
|
|
3426
3433
|
if (typeof window > "u") return;
|
|
3427
|
-
const e = new URL(window.location.href), t =
|
|
3434
|
+
const e = new URL(window.location.href), t = Se(e.hash.replace(/^#/, "")), n = Se(e.search.replace(/^\?/, "")), i = t ?? n;
|
|
3428
3435
|
i && (i.status === "paid" ? (this.emit("purchase_completed", {
|
|
3429
3436
|
priceId: i.priceId,
|
|
3430
3437
|
sessionId: i.sessionId
|
|
3431
|
-
}),
|
|
3438
|
+
}), Sr(i)) : (i.status === "failed" || i.status === "cancelled") && this.emit("purchase_failed", { reason: i.status }), Cr(e));
|
|
3432
3439
|
}
|
|
3433
3440
|
destroy() {
|
|
3434
|
-
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 =
|
|
3441
|
+
this.tracker?.destroy(), this.tracker = null, this.listeners.clear(), this.stateListeners.clear(), this.watcher?.stop(), this.watcher = null, this.userUnsub?.(), this.userUnsub = null, this.authUnsub?.(), this.authUnsub = null, this.ownsAuth && this.auth && this.auth.destroy?.(), this.ownsAuth = !1, this.billing.destroy?.(), this.handle?.unmount(), this.handle = null, this.isOpen = !1, this.currentState = ae;
|
|
3435
3442
|
}
|
|
3436
3443
|
};
|
|
3437
|
-
function
|
|
3444
|
+
function wr(r) {
|
|
3438
3445
|
if (!r.auth) return { auth: void 0, ownsAuth: !1 };
|
|
3439
|
-
if (r.auth instanceof
|
|
3446
|
+
if (r.auth instanceof de || kr(r.auth))
|
|
3440
3447
|
return { auth: r.auth, ownsAuth: !1 };
|
|
3441
3448
|
const e = r.auth === !0 ? {} : r.auth;
|
|
3442
3449
|
return {
|
|
3443
|
-
auth: new
|
|
3450
|
+
auth: new de({
|
|
3444
3451
|
paywallId: r.paywallId,
|
|
3445
3452
|
apiOrigin: e.apiOrigin ?? r.apiOrigin,
|
|
3446
3453
|
storage: e.storage ?? r.storage,
|
|
@@ -3450,18 +3457,18 @@ function xr(r) {
|
|
|
3450
3457
|
ownsAuth: !0
|
|
3451
3458
|
};
|
|
3452
3459
|
}
|
|
3453
|
-
function
|
|
3460
|
+
function kr(r) {
|
|
3454
3461
|
if (typeof r != "object" || r === null) return !1;
|
|
3455
3462
|
const e = r;
|
|
3456
3463
|
return typeof e.onAuthChange == "function" && typeof e.getCachedSession == "function" && typeof e.signOut == "function";
|
|
3457
3464
|
}
|
|
3458
|
-
function
|
|
3465
|
+
function vr(r, e) {
|
|
3459
3466
|
return r.open === e.open && r.view === e.view && r.error === e.error && r.processing === e.processing;
|
|
3460
3467
|
}
|
|
3461
|
-
function
|
|
3468
|
+
function _r(r, e) {
|
|
3462
3469
|
return r.mode === e.mode && r.payload === e.payload && r.storage === e.storage;
|
|
3463
3470
|
}
|
|
3464
|
-
function
|
|
3471
|
+
function Se(r) {
|
|
3465
3472
|
if (!r) return null;
|
|
3466
3473
|
const e = new URLSearchParams(r), t = e.get(F.status);
|
|
3467
3474
|
return t ? {
|
|
@@ -3470,7 +3477,7 @@ function _e(r) {
|
|
|
3470
3477
|
sessionId: e.get(F.sessionId)
|
|
3471
3478
|
} : null;
|
|
3472
3479
|
}
|
|
3473
|
-
function
|
|
3480
|
+
function Sr(r) {
|
|
3474
3481
|
if (!(typeof window > "u" || !window.opener))
|
|
3475
3482
|
try {
|
|
3476
3483
|
window.opener.postMessage(
|
|
@@ -3485,7 +3492,7 @@ function _r(r) {
|
|
|
3485
3492
|
} catch {
|
|
3486
3493
|
}
|
|
3487
3494
|
}
|
|
3488
|
-
function
|
|
3495
|
+
function Cr(r) {
|
|
3489
3496
|
const e = (n, i) => {
|
|
3490
3497
|
if (!n) return "";
|
|
3491
3498
|
const s = new URLSearchParams(n.replace(/^[?#]/, ""));
|
|
@@ -3495,7 +3502,7 @@ function Sr(r) {
|
|
|
3495
3502
|
}, t = r.pathname + e(r.search, "?") + e(r.hash, "#");
|
|
3496
3503
|
window.history.replaceState(null, "", t);
|
|
3497
3504
|
}
|
|
3498
|
-
class
|
|
3505
|
+
class Ir {
|
|
3499
3506
|
constructor(e, t, n) {
|
|
3500
3507
|
this.transport = e, this.paywallId = t, this.config = n;
|
|
3501
3508
|
}
|
|
@@ -3518,7 +3525,7 @@ class Cr {
|
|
|
3518
3525
|
});
|
|
3519
3526
|
}
|
|
3520
3527
|
}
|
|
3521
|
-
class
|
|
3528
|
+
class Ar {
|
|
3522
3529
|
constructor(e, t) {
|
|
3523
3530
|
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 = {
|
|
3524
3531
|
getItem: (n) => this.transport.request("storage.get", { key: n }),
|
|
@@ -3705,7 +3712,7 @@ class Ir {
|
|
|
3705
3712
|
* read-modify-write. PaywallUI duck-types этот метод и предпочитает его
|
|
3706
3713
|
* локальной фабрике, если он есть. */
|
|
3707
3714
|
createTrialStore(e) {
|
|
3708
|
-
return new
|
|
3715
|
+
return new Ir(this.transport, this.paywallId, e);
|
|
3709
3716
|
}
|
|
3710
3717
|
// === Identity ===
|
|
3711
3718
|
getIdentity() {
|
|
@@ -3738,10 +3745,10 @@ class Ir {
|
|
|
3738
3745
|
* broadcast'ов от offscreen — чтобы host'овский onUserChange handler
|
|
3739
3746
|
* получил signal независимо от того, кто триггернул обновление. */
|
|
3740
3747
|
applyUser(e) {
|
|
3741
|
-
|
|
3748
|
+
Lr(this.cachedUser, e) || (this.cachedUser = e, this.fireUserListeners(e));
|
|
3742
3749
|
}
|
|
3743
3750
|
applyBalances(e) {
|
|
3744
|
-
|
|
3751
|
+
Mr(this.cachedBalances, e) || (this.cachedBalances = e, this.fireBalanceListeners(e));
|
|
3745
3752
|
}
|
|
3746
3753
|
fireUserListeners(e) {
|
|
3747
3754
|
for (const t of [...this.userListeners])
|
|
@@ -3760,17 +3767,17 @@ class Ir {
|
|
|
3760
3767
|
}
|
|
3761
3768
|
}
|
|
3762
3769
|
}
|
|
3763
|
-
function
|
|
3770
|
+
function Lr(r, e) {
|
|
3764
3771
|
return r === e ? !0 : !r || !e ? !1 : r.has_active_subscription === e.has_active_subscription && (r.purchases?.length ?? 0) === (e.purchases?.length ?? 0);
|
|
3765
3772
|
}
|
|
3766
|
-
function
|
|
3773
|
+
function Mr(r, e) {
|
|
3767
3774
|
if (r === e) return !0;
|
|
3768
3775
|
if (!r || !e || r.length !== e.length) return !1;
|
|
3769
3776
|
for (let t = 0; t < r.length; t++)
|
|
3770
3777
|
if (r[t].type !== e[t].type || r[t].count !== e[t].count) return !1;
|
|
3771
3778
|
return !0;
|
|
3772
3779
|
}
|
|
3773
|
-
class
|
|
3780
|
+
class Er {
|
|
3774
3781
|
constructor(e, t) {
|
|
3775
3782
|
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 }) => {
|
|
3776
3783
|
this.applySession(n, i);
|
|
@@ -3888,7 +3895,7 @@ class Mr {
|
|
|
3888
3895
|
"popup_blocked",
|
|
3889
3896
|
"browser blocked auth popup — call from a user gesture"
|
|
3890
3897
|
);
|
|
3891
|
-
|
|
3898
|
+
Pr(n, e.provider);
|
|
3892
3899
|
try {
|
|
3893
3900
|
const { authorizeUrl: i, state: s } = await this.transport.request("auth.oauthStart", {
|
|
3894
3901
|
provider: e.provider,
|
|
@@ -3896,7 +3903,7 @@ class Mr {
|
|
|
3896
3903
|
userMeta: e.userMeta
|
|
3897
3904
|
});
|
|
3898
3905
|
n.name = `pw-oauth-${s}`, n.location.replace(i), e.onPopupOpened?.();
|
|
3899
|
-
const a = await
|
|
3906
|
+
const a = await Ve(n, s), l = await this.transport.request("auth.oauthExchange", { state: s, code: a });
|
|
3900
3907
|
return this.applySession("SIGNED_IN", l), l;
|
|
3901
3908
|
} catch (i) {
|
|
3902
3909
|
try {
|
|
@@ -3910,7 +3917,7 @@ class Mr {
|
|
|
3910
3917
|
this.unsubBroadcast?.(), this.unsubBroadcast = null, this.listeners.clear(), this.session = null;
|
|
3911
3918
|
}
|
|
3912
3919
|
applySession(e, t) {
|
|
3913
|
-
if (!
|
|
3920
|
+
if (!Tr(this.session, t)) {
|
|
3914
3921
|
this.session = t;
|
|
3915
3922
|
for (const n of [...this.listeners])
|
|
3916
3923
|
try {
|
|
@@ -3921,17 +3928,17 @@ class Mr {
|
|
|
3921
3928
|
}
|
|
3922
3929
|
}
|
|
3923
3930
|
}
|
|
3924
|
-
function
|
|
3931
|
+
function Tr(r, e) {
|
|
3925
3932
|
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;
|
|
3926
3933
|
}
|
|
3927
|
-
const
|
|
3934
|
+
const Br = {
|
|
3928
3935
|
google: "Google",
|
|
3929
3936
|
apple: "Apple",
|
|
3930
3937
|
github: "GitHub",
|
|
3931
3938
|
facebook: "Facebook"
|
|
3932
3939
|
};
|
|
3933
|
-
function
|
|
3934
|
-
const t =
|
|
3940
|
+
function Pr(r, e) {
|
|
3941
|
+
const t = Br[e] ?? e;
|
|
3935
3942
|
try {
|
|
3936
3943
|
const n = r.document;
|
|
3937
3944
|
n.title = `Sign in with ${t}`;
|
|
@@ -3946,7 +3953,7 @@ function Br(r, e) {
|
|
|
3946
3953
|
} catch {
|
|
3947
3954
|
}
|
|
3948
3955
|
}
|
|
3949
|
-
class
|
|
3956
|
+
class Or {
|
|
3950
3957
|
constructor(e) {
|
|
3951
3958
|
this.transport = e;
|
|
3952
3959
|
}
|
|
@@ -3958,7 +3965,7 @@ class Pr {
|
|
|
3958
3965
|
});
|
|
3959
3966
|
}
|
|
3960
3967
|
}
|
|
3961
|
-
class
|
|
3968
|
+
class Ur {
|
|
3962
3969
|
constructor(e) {
|
|
3963
3970
|
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)}`;
|
|
3964
3971
|
}
|
|
@@ -3972,21 +3979,21 @@ class Or {
|
|
|
3972
3979
|
this.channel = e;
|
|
3973
3980
|
const t = e.onMessage((i) => this.handleMessage(i)), n = e.onDisconnect(() => this.handleDisconnect());
|
|
3974
3981
|
return this.channelDisposers = [t, n], this.request("handshake", {
|
|
3975
|
-
protocolVersion:
|
|
3982
|
+
protocolVersion: Q,
|
|
3976
3983
|
clientId: this.clientId
|
|
3977
3984
|
}).then((i) => {
|
|
3978
|
-
i.protocolVersion !==
|
|
3979
|
-
`[sdk-extension] protocol version mismatch: client=${
|
|
3985
|
+
i.protocolVersion !== Q && console.warn(
|
|
3986
|
+
`[sdk-extension] protocol version mismatch: client=${Q}, offscreen=${i.protocolVersion}. Update host's @monetize.software/sdk-extension.`
|
|
3980
3987
|
);
|
|
3981
3988
|
}).catch(() => {
|
|
3982
3989
|
}), e;
|
|
3983
3990
|
}
|
|
3984
3991
|
handleMessage(e) {
|
|
3985
|
-
if (
|
|
3992
|
+
if (Rr(e)) {
|
|
3986
3993
|
if (e.type === "response") {
|
|
3987
3994
|
const t = this.pending.get(e.id);
|
|
3988
3995
|
if (!t) return;
|
|
3989
|
-
this.pending.delete(e.id), t.signal?.removeEventListener("abort", t.abortListener), e.ok ? t.resolve(e.result) : t.reject(
|
|
3996
|
+
this.pending.delete(e.id), t.signal?.removeEventListener("abort", t.abortListener), e.ok ? t.resolve(e.result) : t.reject($e(e.error));
|
|
3990
3997
|
return;
|
|
3991
3998
|
}
|
|
3992
3999
|
if (e.type === "event") {
|
|
@@ -4007,7 +4014,7 @@ class Or {
|
|
|
4007
4014
|
const e = Array.from(this.pending.values());
|
|
4008
4015
|
this.pending.clear();
|
|
4009
4016
|
for (const t of e)
|
|
4010
|
-
t.signal?.removeEventListener("abort", t.abortListener), t.reject(new
|
|
4017
|
+
t.signal?.removeEventListener("abort", t.abortListener), t.reject(new jr());
|
|
4011
4018
|
}
|
|
4012
4019
|
request(e, t, n = {}) {
|
|
4013
4020
|
if (this.destroyed)
|
|
@@ -4063,28 +4070,28 @@ class Or {
|
|
|
4063
4070
|
this.channel?.close(), this.channel = null;
|
|
4064
4071
|
}
|
|
4065
4072
|
}
|
|
4066
|
-
class
|
|
4073
|
+
class jr extends Error {
|
|
4067
4074
|
constructor() {
|
|
4068
4075
|
super("Transport channel disconnected mid-request"), this.code = "transport_disconnected", this.name = "TransportDisconnectedError";
|
|
4069
4076
|
}
|
|
4070
4077
|
}
|
|
4071
|
-
function
|
|
4078
|
+
function Rr(r) {
|
|
4072
4079
|
if (typeof r != "object" || r === null) return !1;
|
|
4073
4080
|
const e = r.type;
|
|
4074
4081
|
return e === "request" || e === "response" || e === "event";
|
|
4075
4082
|
}
|
|
4076
|
-
let
|
|
4077
|
-
function
|
|
4078
|
-
return
|
|
4083
|
+
let Z = null;
|
|
4084
|
+
function Dr() {
|
|
4085
|
+
return Z || (Z = new Ur(() => He(Ke)), Z);
|
|
4079
4086
|
}
|
|
4080
|
-
class
|
|
4087
|
+
class Gr extends xr {
|
|
4081
4088
|
constructor(e) {
|
|
4082
|
-
const t =
|
|
4089
|
+
const t = Dr(), n = new Ar(t, {
|
|
4083
4090
|
paywallId: e.paywallId,
|
|
4084
4091
|
apiOrigin: e.apiOrigin
|
|
4085
4092
|
});
|
|
4086
4093
|
let i;
|
|
4087
|
-
e.auth === !0 ? i = new
|
|
4094
|
+
e.auth === !0 ? i = new Er(t, {
|
|
4088
4095
|
paywallId: e.paywallId,
|
|
4089
4096
|
apiOrigin: e.apiOrigin
|
|
4090
4097
|
}) : e.auth && console.warn(
|
|
@@ -4100,7 +4107,7 @@ class Hr extends br {
|
|
|
4100
4107
|
// Внутренний EventTracker отключаем — единственный tracker живёт в
|
|
4101
4108
|
// offscreen'е. Манчиально подписываемся ниже.
|
|
4102
4109
|
analytics: !1
|
|
4103
|
-
}), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new
|
|
4110
|
+
}), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new Or(t), this.bindAnalytics());
|
|
4104
4111
|
}
|
|
4105
4112
|
/** Зеркало sdk/PaywallUI.initTracker'овских биндингов, но с RemoteEventTracker.
|
|
4106
4113
|
* Когда @monetize.software/sdk экспоузнет публичный hook для inject'а tracker'а,
|
|
@@ -4158,11 +4165,11 @@ class Hr extends br {
|
|
|
4158
4165
|
}
|
|
4159
4166
|
}
|
|
4160
4167
|
export {
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4168
|
+
Q as PROTOCOL_VERSION,
|
|
4169
|
+
Gr as PaywallUI,
|
|
4170
|
+
Er as RemoteAuthClient,
|
|
4171
|
+
Ar as RemoteBillingClient,
|
|
4172
|
+
Or as RemoteEventTracker,
|
|
4173
|
+
Dr as getContentTransport
|
|
4167
4174
|
};
|
|
4168
4175
|
//# sourceMappingURL=content.js.map
|