@monetize.software/sdk 3.0.0-alpha.12 → 3.0.0-alpha.13

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.
@@ -1,17 +1,17 @@
1
- import { PaywallError as O, findApplicableOffer as H, BillingClient as Dt, EventTracker as Nt, resolveOffer as $t, readBrowserOfferStart as Ht, AuthClient as ct } from "../core.js";
2
- import { render as Y, h as dt, createContext as Vt } from "preact";
3
- import { jsx as a, jsxs as d, Fragment as ot } from "preact/jsx-runtime";
4
- import { useContext as Gt, useState as x, useEffect as T, useRef as F, useMemo as qt, useLayoutEffect as Wt } from "preact/hooks";
5
- const ut = 3600 * 1e3;
6
- function X(e) {
7
- return `paywall-${e}-trial-time-first-open`;
1
+ import { PaywallError as L, findApplicableOffer as N, BillingClient as Ne, EventTracker as He, resolveOffer as $e, readBrowserOfferStart as Ve, AuthClient as de } from "../core.js";
2
+ import { render as X, h as ue, createContext as qe } from "preact";
3
+ import { jsx as a, jsxs as d, Fragment as se } from "preact/jsx-runtime";
4
+ import { useContext as Ge, useState as v, useEffect as j, useRef as F, useMemo as We, useLayoutEffect as Ze } from "preact/hooks";
5
+ const pe = 3600 * 1e3;
6
+ function J(t) {
7
+ return `paywall-${t}-trial-time-first-open`;
8
8
  }
9
- function J(e) {
10
- return `paywall-${e}-skip-times`;
9
+ function Q(t) {
10
+ return `paywall-${t}-skip-times`;
11
11
  }
12
- class Ct {
13
- constructor(t, r, i) {
14
- this.storage = t, this.paywallId = r, this.config = i;
12
+ class Ie {
13
+ constructor(e, r, i) {
14
+ this.storage = e, this.paywallId = r, this.config = i;
15
15
  }
16
16
  async check() {
17
17
  return this.config.mode === "time" ? this.checkTime() : this.checkOpens();
@@ -20,70 +20,70 @@ class Ct {
20
20
  return this.config.mode === "time" ? this.recordTime() : this.recordOpens();
21
21
  }
22
22
  async reset() {
23
- await this.storage.removeItem(this.config.mode === "time" ? X(this.paywallId) : J(this.paywallId));
23
+ await this.storage.removeItem(this.config.mode === "time" ? J(this.paywallId) : Q(this.paywallId));
24
24
  }
25
25
  async checkTime() {
26
- const t = this.config.payload * ut, r = await this.storage.getItem(X(this.paywallId)), i = r ? Number(r) : null;
26
+ const e = this.config.payload * pe, r = await this.storage.getItem(J(this.paywallId)), i = r ? Number(r) : null;
27
27
  if (!i || !Number.isFinite(i))
28
28
  return {
29
29
  mode: "time",
30
30
  blocked: !0,
31
31
  startedAt: null,
32
32
  expiresAt: null,
33
- remainingMs: t,
34
- totalMs: t
33
+ remainingMs: e,
34
+ totalMs: e
35
35
  };
36
- const n = i + t, o = Math.max(0, n - Date.now());
36
+ const n = i + e, s = Math.max(0, n - Date.now());
37
37
  return {
38
38
  mode: "time",
39
- blocked: o > 0,
39
+ blocked: s > 0,
40
40
  startedAt: i,
41
41
  expiresAt: n,
42
- remainingMs: o,
43
- totalMs: t
42
+ remainingMs: s,
43
+ totalMs: e
44
44
  };
45
45
  }
46
46
  async checkOpens() {
47
- const t = this.config.payload, r = await this.storage.getItem(J(this.paywallId)), i = r ? Number(r) : 0, n = Number.isFinite(i) ? i : 0, o = n < t, s = Math.max(0, t - n);
47
+ const e = this.config.payload, r = await this.storage.getItem(Q(this.paywallId)), i = r ? Number(r) : 0, n = Number.isFinite(i) ? i : 0, s = n < e, o = Math.max(0, e - n);
48
48
  return {
49
49
  mode: "opens",
50
- blocked: o,
51
- remainingActions: s,
52
- totalActions: t
50
+ blocked: s,
51
+ remainingActions: o,
52
+ totalActions: e
53
53
  };
54
54
  }
55
55
  async recordTime() {
56
- const t = this.config.payload * ut, r = X(this.paywallId), i = await this.storage.getItem(r);
56
+ const e = this.config.payload * pe, r = J(this.paywallId), i = await this.storage.getItem(r);
57
57
  let n = i ? Number(i) : null;
58
58
  (!n || !Number.isFinite(n)) && (n = Date.now(), await this.storage.setItem(r, String(n)));
59
- const o = n + t, s = Math.max(0, o - Date.now());
59
+ const s = n + e, o = Math.max(0, s - Date.now());
60
60
  return {
61
61
  mode: "time",
62
- blocked: s > 0,
62
+ blocked: o > 0,
63
63
  startedAt: n,
64
- expiresAt: o,
65
- remainingMs: s,
66
- totalMs: t
64
+ expiresAt: s,
65
+ remainingMs: o,
66
+ totalMs: e
67
67
  };
68
68
  }
69
69
  async recordOpens() {
70
- const t = this.config.payload, r = J(this.paywallId), i = await this.storage.getItem(r), n = i ? Number(i) : 0, o = Number.isFinite(n) ? n : 0, s = Math.min(t, o + 1);
71
- await this.storage.setItem(r, String(s));
72
- const c = Math.max(0, t - s);
70
+ const e = this.config.payload, r = Q(this.paywallId), i = await this.storage.getItem(r), n = i ? Number(i) : 0, s = Number.isFinite(n) ? n : 0, o = Math.min(e, s + 1);
71
+ await this.storage.setItem(r, String(o));
72
+ const c = Math.max(0, e - o);
73
73
  return {
74
74
  mode: "opens",
75
- blocked: s < t,
75
+ blocked: o < e,
76
76
  remainingActions: c,
77
- totalActions: t
77
+ totalActions: e
78
78
  };
79
79
  }
80
80
  }
81
- let pt = !1;
82
- class Zt {
83
- constructor(t, r, i) {
84
- pt || (pt = !0, console.warn(
81
+ let he = !1;
82
+ class Ke {
83
+ constructor(e, r, i) {
84
+ he || (he = !0, console.warn(
85
85
  '[paywall] trial.storage="server" is not implemented yet — falling back to client storage. State lives in localStorage; users can reset trial by clearing site data.'
86
- )), this.fallback = new Ct(t, r, i);
86
+ )), this.fallback = new Ie(e, r, i);
87
87
  }
88
88
  check() {
89
89
  return this.fallback.check();
@@ -95,23 +95,23 @@ class Zt {
95
95
  return this.fallback.reset();
96
96
  }
97
97
  }
98
- function Kt(e, t, r) {
99
- return r.storage === "server" ? new Zt(e, t, r) : new Ct(e, t, r);
98
+ function Ye(t, e, r) {
99
+ return r.storage === "server" ? new Ke(t, e, r) : new Ie(t, e, r);
100
100
  }
101
- const It = '/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--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-600:oklch(57.7% .245 27.325);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--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-black:#000;--color-white:#fff;--spacing:.25rem;--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 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-md:.375rem;--radius-xl:.75rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--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:var(--default-font-feature-settings,normal);font-variation-settings:var(--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:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}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{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}: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:currentColor}@supports (color:color-mix(in lab,red,red)){::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{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-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]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{all:initial;color-scheme:light;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}*,:before,:after{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box}button{cursor:pointer;font-family:inherit}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.-top-2{top:calc(var(--spacing) * -2)}.-top-\\[9px\\]{top:-9px}.-top-\\[10px\\]{top:-10px}.top-1\\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.-right-\\[6px\\]{right:-6px}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.left-1\\/2{left:50%}.z-10{z-index:10}.z-\\[1\\]{z-index:1}.z-\\[2147483647\\]{z-index:2147483647}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.-mt-3{margin-top:calc(var(--spacing) * -3)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.-mb-2{margin-bottom:calc(var(--spacing) * -2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-1{height:calc(var(--spacing) * 1)}.h-4{height:calc(var(--spacing) * 4)}.h-6{height:calc(var(--spacing) * 6)}.h-6\\.5{height:calc(var(--spacing) * 6.5)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-\\[22px\\]{height:22px}.h-full{height:100%}.h-px{height:1px}.max-h-\\[calc\\(100dvh-1rem\\)\\]{max-height:calc(100dvh - 1rem)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-12{min-height:calc(var(--spacing) * 12)}.min-h-\\[2\\.4em\\]{min-height:2.4em}.min-h-\\[120px\\]{min-height:120px}.w-1{width:calc(var(--spacing) * 1)}.w-4{width:calc(var(--spacing) * 4)}.w-6{width:calc(var(--spacing) * 6)}.w-6\\.5{width:calc(var(--spacing) * 6.5)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-full{width:100%}.max-w-\\[18rem\\]{max-width:18rem}.max-w-\\[20rem\\]{max-width:20rem}.max-w-\\[75\\%\\]{max-width:75%}.max-w-\\[320px\\]{max-width:320px}.max-w-\\[360px\\]{max-width:360px}.max-w-\\[400px\\]{max-width:400px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[pw-fade-in_180ms_ease-out\\]{animation:.18s ease-out pw-fade-in}.animate-\\[pw-scale-in_220ms_cubic-bezier\\(0\\.16\\,1\\,0\\.3\\,1\\)\\]{animation:.22s cubic-bezier(.16,1,.3,1) pw-scale-in}.animate-ping{animation:var(--animate-ping)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-1\\.5{column-gap:calc(var(--spacing) * 1.5)}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.self-center{align-self:center}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\\[9px\\]{border-radius:9px}.rounded-\\[11px\\]{border-radius:11px}.rounded-full{border-radius:3.40282e38px}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-xl{border-top-left-radius:var(--radius-xl);border-top-right-radius:var(--radius-xl)}.rounded-tl-xl{border-top-left-radius:var(--radius-xl)}.rounded-tr-xl{border-top-right-radius:var(--radius-xl)}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.border,.border-1{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[2\\.5px\\]{border-style:var(--tw-border-style);border-width:2.5px}.border-\\[3px\\]{border-style:var(--tw-border-style);border-width:3px}.border-\\[5px\\]{border-style:var(--tw-border-style);border-width:5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b,.border-b-1{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\\[var\\(--pw-accent\\)\\]{border-color:var(--pw-accent)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-white{border-color:var(--color-white)}.border-white\\/40{border-color:#fff6}@supports (color:color-mix(in lab,red,red)){.border-white\\/40{border-color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.border-t-\\[var\\(--pw-accent\\)\\]{border-top-color:var(--pw-accent)}.border-t-gray-700{border-top-color:var(--color-gray-700)}.border-t-white{border-top-color:var(--color-white)}.bg-\\[color-mix\\(in_srgb\\,var\\(--pw-accent\\)_6\\%\\,white\\)\\]{background-color:var(--pw-accent)}@supports (color:color-mix(in lab,red,red)){.bg-\\[color-mix\\(in_srgb\\,var\\(--pw-accent\\)_6\\%\\,white\\)\\]{background-color:color-mix(in srgb,var(--pw-accent) 6%,white)}}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\\/60{background-color:#f9fafb99}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\\/60{background-color:color-mix(in oklab,var(--color-gray-50) 60%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-red-50{background-color:var(--color-red-50)}.bg-slate-950\\/50{background-color:#02061880}@supports (color:color-mix(in lab,red,red)){.bg-slate-950\\/50{background-color:color-mix(in oklab,var(--color-slate-950) 50%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\\/80{background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.p-2{padding:calc(var(--spacing) * 2)}.p-3\\.5{padding:calc(var(--spacing) * 3.5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-3\\.5{padding-top:calc(var(--spacing) * 3.5)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pr-12{padding-right:calc(var(--spacing) * 12)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-3\\.5{padding-bottom:calc(var(--spacing) * 3.5)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.9375rem\\]{font-size:.9375rem}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[15px\\]{font-size:15px}.text-\\[22px\\]{font-size:22px}.text-\\[26px\\]{font-size:26px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-700{color:var(--color-emerald-700)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-800\\/70{color:#1e2939b3}@supports (color:color-mix(in lab,red,red)){.text-gray-800\\/70{color:color-mix(in oklab,var(--color-gray-800) 70%,transparent)}}.text-gray-900{color:var(--color-gray-900)}.text-red-600{color:var(--color-red-600)}.text-transparent{color:#0000}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.decoration-gray-400{-webkit-text-decoration-color:var(--color-gray-400);text-decoration-color:var(--color-gray-400)}.decoration-\\[1\\.5px\\]{text-decoration-thickness:1.5px}.underline-offset-2{text-underline-offset:2px}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_0_2px_rgba\\(239\\,68\\,68\\,0\\.5\\)\\]{--tw-shadow:0 0 0 2px var(--tw-shadow-color,#ef444480);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-8{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(8px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.\\!filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.placeholder\\:text-gray-500::placeholder{color:var(--color-gray-500)}@media(hover:hover){.hover\\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\\:border-gray-300:hover{border-color:var(--color-gray-300)}.hover\\:border-gray-400:hover{border-color:var(--color-gray-400)}.hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\\:bg-gray-50\\/60:hover{background-color:#f9fafb99}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-gray-50\\/60:hover{background-color:color-mix(in oklab,var(--color-gray-50) 60%,transparent)}}.hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\\:bg-gray-200\\/60:hover{background-color:#e5e7eb99}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-gray-200\\/60:hover{background-color:color-mix(in oklab,var(--color-gray-200) 60%,transparent)}}.hover\\:bg-white:hover{background-color:var(--color-white)}.hover\\:text-gray-700:hover{color:var(--color-gray-700)}.hover\\:text-gray-900:hover{color:var(--color-gray-900)}.hover\\:text-red-600:hover{color:var(--color-red-600)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-80:hover{opacity:.8}.hover\\:brightness-105:hover{--tw-brightness:brightness(105%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\\:bg-gray-200\\/60:focus{background-color:#e5e7eb99}@supports (color:color-mix(in lab,red,red)){.focus\\:bg-gray-200\\/60:focus{background-color:color-mix(in oklab,var(--color-gray-200) 60%,transparent)}}.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{--tw-shadow:0 0 0 2px var(--tw-shadow-color,var(--pw-accent))}@supports (color:color-mix(in lab,red,red)){.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{--tw-shadow:0 0 0 2px var(--tw-shadow-color,color-mix(in srgb,var(--pw-accent) 30%,transparent))}}.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:opacity-80:focus-visible{opacity:.8}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-\\[var\\(--pw-accent\\)\\]:focus-visible{--tw-ring-color:var(--pw-accent)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:scale-\\[0\\.98\\]:active{scale:.98}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-60:disabled{opacity:.6}@media(hover:hover){.disabled\\:hover\\:translate-y-0:disabled:hover{--tw-translate-y:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\\:hover\\:brightness-100:disabled:hover{--tw-brightness:brightness(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}@media(min-width:40rem){.sm\\:max-h-\\[calc\\(100dvh-2rem\\)\\]{max-height:calc(100dvh - 2rem)}.sm\\:p-4{padding:calc(var(--spacing) * 4)}.sm\\:p-8{padding:calc(var(--spacing) * 8)}.sm\\:px-8{padding-inline:calc(var(--spacing) * 8)}.sm\\:pt-5{padding-top:calc(var(--spacing) * 5)}.sm\\:pt-8{padding-top:calc(var(--spacing) * 8)}.sm\\:pb-4{padding-bottom:calc(var(--spacing) * 4)}.sm\\:pb-8{padding-bottom:calc(var(--spacing) * 8)}.sm\\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}}.pw-cta-shimmer:before{content:"";z-index:1;background:linear-gradient(90deg,#0000,#ffffff59 50%,#0000);width:100%;height:100%;animation:3s infinite pw-cta-shimmer;position:absolute;top:0;left:-100%}@keyframes pw-cta-shimmer{0%{left:-100%}to{left:100%}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}';
102
- let ht = !1;
103
- function Yt() {
104
- if (ht || (ht = !0, typeof CSS > "u" || typeof CSS.registerProperty != "function")) return;
105
- let e;
101
+ const Ae = '/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--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-600:oklch(57.7% .245 27.325);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--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-black:#000;--color-white:#fff;--spacing:.25rem;--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 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-md:.375rem;--radius-xl:.75rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--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:var(--default-font-feature-settings,normal);font-variation-settings:var(--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:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}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{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}: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:currentColor}@supports (color:color-mix(in lab,red,red)){::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{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-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]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{all:initial;color-scheme:light;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}*,:before,:after{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box}button{cursor:pointer;font-family:inherit}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.-top-2{top:calc(var(--spacing) * -2)}.-top-\\[9px\\]{top:-9px}.-top-\\[10px\\]{top:-10px}.top-1\\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.-right-\\[6px\\]{right:-6px}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.left-1\\/2{left:50%}.z-10{z-index:10}.z-\\[1\\]{z-index:1}.z-\\[2147483647\\]{z-index:2147483647}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.-mt-3{margin-top:calc(var(--spacing) * -3)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.-mb-2{margin-bottom:calc(var(--spacing) * -2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-1{height:calc(var(--spacing) * 1)}.h-4{height:calc(var(--spacing) * 4)}.h-6{height:calc(var(--spacing) * 6)}.h-6\\.5{height:calc(var(--spacing) * 6.5)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-\\[22px\\]{height:22px}.h-full{height:100%}.h-px{height:1px}.max-h-\\[calc\\(100dvh-1rem\\)\\]{max-height:calc(100dvh - 1rem)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-12{min-height:calc(var(--spacing) * 12)}.min-h-\\[2\\.4em\\]{min-height:2.4em}.min-h-\\[120px\\]{min-height:120px}.w-1{width:calc(var(--spacing) * 1)}.w-4{width:calc(var(--spacing) * 4)}.w-6{width:calc(var(--spacing) * 6)}.w-6\\.5{width:calc(var(--spacing) * 6.5)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-full{width:100%}.max-w-\\[18rem\\]{max-width:18rem}.max-w-\\[20rem\\]{max-width:20rem}.max-w-\\[75\\%\\]{max-width:75%}.max-w-\\[320px\\]{max-width:320px}.max-w-\\[360px\\]{max-width:360px}.max-w-\\[400px\\]{max-width:400px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[pw-fade-in_180ms_ease-out\\]{animation:.18s ease-out pw-fade-in}.animate-\\[pw-scale-in_220ms_cubic-bezier\\(0\\.16\\,1\\,0\\.3\\,1\\)\\]{animation:.22s cubic-bezier(.16,1,.3,1) pw-scale-in}.animate-ping{animation:var(--animate-ping)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-1\\.5{column-gap:calc(var(--spacing) * 1.5)}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.self-center{align-self:center}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\\[9px\\]{border-radius:9px}.rounded-\\[11px\\]{border-radius:11px}.rounded-full{border-radius:3.40282e38px}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-xl{border-top-left-radius:var(--radius-xl);border-top-right-radius:var(--radius-xl)}.rounded-tl-xl{border-top-left-radius:var(--radius-xl)}.rounded-tr-xl{border-top-right-radius:var(--radius-xl)}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.border,.border-1{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[2\\.5px\\]{border-style:var(--tw-border-style);border-width:2.5px}.border-\\[3px\\]{border-style:var(--tw-border-style);border-width:3px}.border-\\[5px\\]{border-style:var(--tw-border-style);border-width:5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b,.border-b-1{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\\[var\\(--pw-accent\\)\\]{border-color:var(--pw-accent)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-white{border-color:var(--color-white)}.border-white\\/40{border-color:#fff6}@supports (color:color-mix(in lab,red,red)){.border-white\\/40{border-color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.border-t-\\[var\\(--pw-accent\\)\\]{border-top-color:var(--pw-accent)}.border-t-gray-700{border-top-color:var(--color-gray-700)}.border-t-white{border-top-color:var(--color-white)}.bg-\\[color-mix\\(in_srgb\\,var\\(--pw-accent\\)_6\\%\\,white\\)\\]{background-color:var(--pw-accent)}@supports (color:color-mix(in lab,red,red)){.bg-\\[color-mix\\(in_srgb\\,var\\(--pw-accent\\)_6\\%\\,white\\)\\]{background-color:color-mix(in srgb,var(--pw-accent) 6%,white)}}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\\/60{background-color:#f9fafb99}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\\/60{background-color:color-mix(in oklab,var(--color-gray-50) 60%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-red-50{background-color:var(--color-red-50)}.bg-slate-950\\/50{background-color:#02061880}@supports (color:color-mix(in lab,red,red)){.bg-slate-950\\/50{background-color:color-mix(in oklab,var(--color-slate-950) 50%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\\/80{background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.p-2{padding:calc(var(--spacing) * 2)}.p-3\\.5{padding:calc(var(--spacing) * 3.5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-3\\.5{padding-top:calc(var(--spacing) * 3.5)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pr-12{padding-right:calc(var(--spacing) * 12)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-3\\.5{padding-bottom:calc(var(--spacing) * 3.5)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.9375rem\\]{font-size:.9375rem}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[15px\\]{font-size:15px}.text-\\[22px\\]{font-size:22px}.text-\\[26px\\]{font-size:26px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-700{color:var(--color-emerald-700)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-800\\/70{color:#1e2939b3}@supports (color:color-mix(in lab,red,red)){.text-gray-800\\/70{color:color-mix(in oklab,var(--color-gray-800) 70%,transparent)}}.text-gray-900{color:var(--color-gray-900)}.text-red-600{color:var(--color-red-600)}.text-transparent{color:#0000}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.decoration-gray-400{-webkit-text-decoration-color:var(--color-gray-400);text-decoration-color:var(--color-gray-400)}.decoration-\\[1\\.5px\\]{text-decoration-thickness:1.5px}.underline-offset-2{text-underline-offset:2px}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_0_2px_rgba\\(239\\,68\\,68\\,0\\.5\\)\\]{--tw-shadow:0 0 0 2px var(--tw-shadow-color,#ef444480);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-8{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(8px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.\\!filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.placeholder\\:text-gray-500::placeholder{color:var(--color-gray-500)}@media(hover:hover){.hover\\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\\:border-gray-300:hover{border-color:var(--color-gray-300)}.hover\\:border-gray-400:hover{border-color:var(--color-gray-400)}.hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\\:bg-gray-50\\/60:hover{background-color:#f9fafb99}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-gray-50\\/60:hover{background-color:color-mix(in oklab,var(--color-gray-50) 60%,transparent)}}.hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\\:bg-gray-200\\/60:hover{background-color:#e5e7eb99}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-gray-200\\/60:hover{background-color:color-mix(in oklab,var(--color-gray-200) 60%,transparent)}}.hover\\:bg-white:hover{background-color:var(--color-white)}.hover\\:text-gray-700:hover{color:var(--color-gray-700)}.hover\\:text-gray-900:hover{color:var(--color-gray-900)}.hover\\:text-red-600:hover{color:var(--color-red-600)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-80:hover{opacity:.8}.hover\\:brightness-105:hover{--tw-brightness:brightness(105%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\\:bg-gray-200\\/60:focus{background-color:#e5e7eb99}@supports (color:color-mix(in lab,red,red)){.focus\\:bg-gray-200\\/60:focus{background-color:color-mix(in oklab,var(--color-gray-200) 60%,transparent)}}.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{--tw-shadow:0 0 0 2px var(--tw-shadow-color,var(--pw-accent))}@supports (color:color-mix(in lab,red,red)){.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{--tw-shadow:0 0 0 2px var(--tw-shadow-color,color-mix(in srgb,var(--pw-accent) 30%,transparent))}}.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:opacity-80:focus-visible{opacity:.8}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-\\[var\\(--pw-accent\\)\\]:focus-visible{--tw-ring-color:var(--pw-accent)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:scale-\\[0\\.98\\]:active{scale:.98}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-60:disabled{opacity:.6}@media(hover:hover){.disabled\\:hover\\:translate-y-0:disabled:hover{--tw-translate-y:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\\:hover\\:brightness-100:disabled:hover{--tw-brightness:brightness(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}@media(min-width:40rem){.sm\\:max-h-\\[calc\\(100dvh-2rem\\)\\]{max-height:calc(100dvh - 2rem)}.sm\\:p-4{padding:calc(var(--spacing) * 4)}.sm\\:p-8{padding:calc(var(--spacing) * 8)}.sm\\:px-8{padding-inline:calc(var(--spacing) * 8)}.sm\\:pt-5{padding-top:calc(var(--spacing) * 5)}.sm\\:pt-8{padding-top:calc(var(--spacing) * 8)}.sm\\:pb-4{padding-bottom:calc(var(--spacing) * 4)}.sm\\:pb-8{padding-bottom:calc(var(--spacing) * 8)}.sm\\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}}.pw-cta-shimmer:before{content:"";z-index:1;background:linear-gradient(90deg,#0000,#ffffff59 50%,#0000);width:100%;height:100%;animation:3s infinite pw-cta-shimmer;position:absolute;top:0;left:-100%}@keyframes pw-cta-shimmer{0%{left:-100%}to{left:100%}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}';
102
+ let ge = !1;
103
+ function Xe() {
104
+ if (ge || (ge = !0, typeof CSS > "u" || typeof CSS.registerProperty != "function")) return;
105
+ let t;
106
106
  try {
107
- const t = new CSSStyleSheet();
108
- t.replaceSync(It), e = t.cssRules;
107
+ const e = new CSSStyleSheet();
108
+ e.replaceSync(Ae), t = e.cssRules;
109
109
  } catch {
110
110
  return;
111
111
  }
112
- for (const t of e) {
113
- if (t.constructor.name !== "CSSPropertyRule") continue;
114
- const r = t;
112
+ for (const e of t) {
113
+ if (e.constructor.name !== "CSSPropertyRule") continue;
114
+ const r = e;
115
115
  try {
116
116
  CSS.registerProperty({
117
117
  name: r.name,
@@ -123,13 +123,13 @@ function Yt() {
123
123
  }
124
124
  }
125
125
  }
126
- function Xt(e, t, r = {}) {
126
+ function Je(t, e, r = {}) {
127
127
  if (typeof document > "u")
128
128
  throw new Error("mountShadow called in non-DOM environment");
129
- Yt();
129
+ Xe();
130
130
  const i = r.host ?? document.createElement("div");
131
131
  i.setAttribute("data-paywall-host", ""), i.style.cssText = r.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;", !i.isConnected && !r.inline && document.body.appendChild(i);
132
- const n = i.attachShadow({ mode: r.shadowMode ?? "closed" }), o = `
132
+ const n = i.attachShadow({ mode: r.shadowMode ?? "closed" }), s = `
133
133
  :host {
134
134
  all: initial !important;
135
135
  display: block !important;
@@ -147,34 +147,34 @@ function Xt(e, t, r = {}) {
147
147
  cursor: auto !important;
148
148
  visibility: visible !important;
149
149
  }
150
- `, s = document.createElement("style");
151
- s.textContent = o + It + (r.injectCss ?? ""), n.appendChild(s);
150
+ `, o = document.createElement("style");
151
+ o.textContent = s + Ae + (r.injectCss ?? ""), n.appendChild(o);
152
152
  const c = document.createElement("div");
153
153
  c.style.pointerEvents = "auto", n.appendChild(c);
154
- let l = t;
155
- return Y(dt(e, l), c), {
154
+ let l = e;
155
+ return X(ue(t, l), c), {
156
156
  shadowRoot: n,
157
- update(f) {
158
- l = { ...l, ...f }, Y(dt(e, l), c);
157
+ update(p) {
158
+ l = { ...l, ...p }, X(ue(t, l), c);
159
159
  },
160
160
  unmount() {
161
- Y(null, c), i.remove();
161
+ X(null, c), i.remove();
162
162
  }
163
163
  };
164
164
  }
165
- const Jt = (e, t, r) => {
166
- const i = e[t];
167
- return i ? typeof i == "function" ? i() : Promise.resolve(i) : new Promise((n, o) => {
165
+ const Qe = (t, e, r) => {
166
+ const i = t[e];
167
+ return i ? typeof i == "function" ? i() : Promise.resolve(i) : new Promise((n, s) => {
168
168
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
169
- o.bind(
169
+ s.bind(
170
170
  null,
171
171
  new Error(
172
- "Unknown variable dynamic import: " + t + (t.split("/").length !== r ? ". Note that variables only represent file names one level deep." : "")
172
+ "Unknown variable dynamic import: " + e + (e.split("/").length !== r ? ". Note that variables only represent file names one level deep." : "")
173
173
  )
174
174
  )
175
175
  );
176
176
  });
177
- }, Qt = [
177
+ }, et = [
178
178
  "ru",
179
179
  "uk",
180
180
  "de",
@@ -202,130 +202,130 @@ const Jt = (e, t, r) => {
202
202
  "th",
203
203
  "vi",
204
204
  "he"
205
- ], At = (e, t, r) => Lt(t, r), Mt = Vt({ t: At, locale: "en" });
206
- function Lt(e, t) {
207
- if (!t) return e;
208
- let r = e;
209
- for (const [i, n] of Object.entries(t))
205
+ ], Me = (t, e, r) => Te(e, r), Le = qe({ t: Me, locale: "en" });
206
+ function Te(t, e) {
207
+ if (!e) return t;
208
+ let r = t;
209
+ for (const [i, n] of Object.entries(e))
210
210
  r = r.split(`{${i}}`).join(String(n));
211
211
  return r;
212
212
  }
213
- const Q = /* @__PURE__ */ new Map(), tt = /* @__PURE__ */ new Map();
214
- function Pt(e) {
215
- return Qt.includes(e);
213
+ const ee = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ new Map();
214
+ function Pe(t) {
215
+ return et.includes(t);
216
216
  }
217
- function te(e) {
218
- const t = [];
217
+ function tt(t) {
218
+ const e = [];
219
219
  if (typeof navigator < "u" && navigator.language) {
220
- t.push(navigator.language);
220
+ e.push(navigator.language);
221
221
  const i = navigator.language.split("-")[0];
222
- i && i !== navigator.language && t.push(i);
222
+ i && i !== navigator.language && e.push(i);
223
223
  }
224
- const r = e.settings.locale_default;
224
+ const r = t.settings.locale_default;
225
225
  if (r) {
226
- t.push(r);
226
+ e.push(r);
227
227
  const i = r.split("-")[0];
228
- i && i !== r && t.push(i);
228
+ i && i !== r && e.push(i);
229
229
  }
230
- for (const i of t)
231
- if (Pt(i)) return i;
230
+ for (const i of e)
231
+ if (Pe(i)) return i;
232
232
  return null;
233
233
  }
234
- function ee(e, t) {
235
- return !!e.locales && e.locales[t] !== void 0;
234
+ function rt(t, e) {
235
+ return !!t.locales && t.locales[e] !== void 0;
236
236
  }
237
- async function re(e) {
238
- const t = Q.get(e);
239
- if (t) return t;
240
- const r = tt.get(e);
237
+ async function it(t) {
238
+ const e = ee.get(t);
239
+ if (e) return e;
240
+ const r = te.get(t);
241
241
  if (r) return r;
242
- const i = Jt(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./ar-B2Wg_IrC.js"), "./locales/cs.ts": () => import("./cs-BNo9Dx0Q.js"), "./locales/da.ts": () => import("./da-Do9Lq6En.js"), "./locales/de.ts": () => import("./de-C8pDZNvx.js"), "./locales/el.ts": () => import("./el-DzMNX-_P.js"), "./locales/es.ts": () => import("./es-YrKt-q4w.js"), "./locales/fi.ts": () => import("./fi-Bh44pwZ4.js"), "./locales/fr.ts": () => import("./fr-Bc0pw4ws.js"), "./locales/he.ts": () => import("./he-Bfm-bhe3.js"), "./locales/hi.ts": () => import("./hi-D-O-B9Dn.js"), "./locales/hu.ts": () => import("./hu-CmIuAbLL.js"), "./locales/id.ts": () => import("./id-DN7IES-A.js"), "./locales/it.ts": () => import("./it-Cz5Nmqx5.js"), "./locales/ja.ts": () => import("./ja-BH9BlBh2.js"), "./locales/ko.ts": () => import("./ko-CYV9QuYs.js"), "./locales/nl.ts": () => import("./nl-BvkB900D.js"), "./locales/no.ts": () => import("./no-3s9_ormb.js"), "./locales/pl.ts": () => import("./pl-C9WTGQtb.js"), "./locales/pt.ts": () => import("./pt-uFVUv_Op.js"), "./locales/ro.ts": () => import("./ro-BrqQ8Au-.js"), "./locales/ru.ts": () => import("./ru-DK594dA8.js"), "./locales/sv.ts": () => import("./sv-CHNH8-mq.js"), "./locales/th.ts": () => import("./th-l24Pm5q-.js"), "./locales/tr.ts": () => import("./tr-ADpigSY5.js"), "./locales/uk.ts": () => import("./uk-CGqo4jek.js"), "./locales/vi.ts": () => import("./vi-Dk9bTu6f.js"), "./locales/zh.ts": () => import("./zh-LDkEV2D9.js") }), `./locales/${e}.ts`, 3).then((n) => {
243
- const o = n.default ?? {};
244
- return Q.set(e, o), o;
242
+ const i = Qe(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./ar-B2Wg_IrC.js"), "./locales/cs.ts": () => import("./cs-BNo9Dx0Q.js"), "./locales/da.ts": () => import("./da-Do9Lq6En.js"), "./locales/de.ts": () => import("./de-C8pDZNvx.js"), "./locales/el.ts": () => import("./el-DzMNX-_P.js"), "./locales/es.ts": () => import("./es-YrKt-q4w.js"), "./locales/fi.ts": () => import("./fi-Bh44pwZ4.js"), "./locales/fr.ts": () => import("./fr-Bc0pw4ws.js"), "./locales/he.ts": () => import("./he-Bfm-bhe3.js"), "./locales/hi.ts": () => import("./hi-D-O-B9Dn.js"), "./locales/hu.ts": () => import("./hu-CmIuAbLL.js"), "./locales/id.ts": () => import("./id-DN7IES-A.js"), "./locales/it.ts": () => import("./it-Cz5Nmqx5.js"), "./locales/ja.ts": () => import("./ja-BH9BlBh2.js"), "./locales/ko.ts": () => import("./ko-CYV9QuYs.js"), "./locales/nl.ts": () => import("./nl-BvkB900D.js"), "./locales/no.ts": () => import("./no-3s9_ormb.js"), "./locales/pl.ts": () => import("./pl-C9WTGQtb.js"), "./locales/pt.ts": () => import("./pt-uFVUv_Op.js"), "./locales/ro.ts": () => import("./ro-BrqQ8Au-.js"), "./locales/ru.ts": () => import("./ru-DK594dA8.js"), "./locales/sv.ts": () => import("./sv-CHNH8-mq.js"), "./locales/th.ts": () => import("./th-l24Pm5q-.js"), "./locales/tr.ts": () => import("./tr-ADpigSY5.js"), "./locales/uk.ts": () => import("./uk-CGqo4jek.js"), "./locales/vi.ts": () => import("./vi-Dk9bTu6f.js"), "./locales/zh.ts": () => import("./zh-LDkEV2D9.js") }), `./locales/${t}.ts`, 3).then((n) => {
243
+ const s = n.default ?? {};
244
+ return ee.set(t, s), s;
245
245
  }).catch((n) => {
246
- console.warn(`[paywall] failed to load locale chunk "${e}"`, n);
247
- const o = {};
248
- return Q.set(e, o), o;
246
+ console.warn(`[paywall] failed to load locale chunk "${t}"`, n);
247
+ const s = {};
248
+ return ee.set(t, s), s;
249
249
  }).finally(() => {
250
- tt.delete(e);
250
+ te.delete(t);
251
251
  });
252
- return tt.set(e, i), i;
253
- }
254
- function ie({ bootstrap: e, forceLocale: t, children: r }) {
255
- const [i, n] = x("en"), [o, s] = x(null);
256
- T(() => {
257
- const f = (t && Pt(t) ? t : null) ?? (() => {
258
- if (!e) return null;
259
- const h = te(e);
260
- return !h || !ee(e, h) ? null : h;
252
+ return te.set(t, i), i;
253
+ }
254
+ function nt({ bootstrap: t, forceLocale: e, children: r }) {
255
+ const [i, n] = v("en"), [s, o] = v(null);
256
+ j(() => {
257
+ const p = (e && Pe(e) ? e : null) ?? (() => {
258
+ if (!t) return null;
259
+ const f = tt(t);
260
+ return !f || !rt(t, f) ? null : f;
261
261
  })();
262
- if (!f) {
263
- (o !== null || i !== "en") && (n("en"), s(null));
262
+ if (!p) {
263
+ (s !== null || i !== "en") && (n("en"), o(null));
264
264
  return;
265
265
  }
266
- if (f === i && o) return;
266
+ if (p === i && s) return;
267
267
  let u = !1;
268
- return re(f).then((h) => {
269
- u || (n(f), s(h));
268
+ return it(p).then((f) => {
269
+ u || (n(p), o(f));
270
270
  }), () => {
271
271
  u = !0;
272
272
  };
273
- }, [e, t]);
273
+ }, [t, e]);
274
274
  const c = {
275
275
  locale: i,
276
- t: o ? (l, f, u) => Lt(o[l] ?? f, u) : At
276
+ t: s ? (l, p, u) => Te(s[l] ?? p, u) : Me
277
277
  };
278
- return /* @__PURE__ */ a(Mt.Provider, { value: c, children: r });
278
+ return /* @__PURE__ */ a(Le.Provider, { value: c, children: r });
279
279
  }
280
- function k() {
281
- return Gt(Mt);
280
+ function S() {
281
+ return Ge(Le);
282
282
  }
283
- const gt = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
284
- function ne({
285
- open: e,
286
- onClose: t,
283
+ const fe = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
284
+ function at({
285
+ open: t,
286
+ onClose: e,
287
287
  labelledBy: r,
288
288
  brandColor: i,
289
289
  topBanner: n,
290
- allowClose: o = !0,
291
- hideCloseButton: s = !1,
290
+ allowClose: s = !0,
291
+ hideCloseButton: o = !1,
292
292
  inline: c = !1,
293
293
  children: l
294
294
  }) {
295
- const { t: f } = k(), u = F(null), h = F(null);
296
- return T(() => {
297
- if (!e) return;
298
- h.current = document.activeElement ?? null;
299
- const S = u.current;
300
- S && (S.querySelector(gt) ?? S).focus({ preventScroll: !0 });
301
- const g = (C) => {
302
- if (C.key === "Escape") {
303
- if (!o) return;
304
- C.stopPropagation(), t();
295
+ const { t: p } = S(), u = F(null), f = F(null);
296
+ return j(() => {
297
+ if (!t) return;
298
+ f.current = document.activeElement ?? null;
299
+ const w = u.current;
300
+ w && (w.querySelector(fe) ?? w).focus({ preventScroll: !0 });
301
+ const A = (m) => {
302
+ if (m.key === "Escape") {
303
+ if (!s) return;
304
+ m.stopPropagation(), e();
305
305
  return;
306
306
  }
307
- if (C.key !== "Tab" || !u.current) return;
308
- const I = Array.from(
309
- u.current.querySelectorAll(gt)
307
+ if (m.key !== "Tab" || !u.current) return;
308
+ const C = Array.from(
309
+ u.current.querySelectorAll(fe)
310
310
  ).filter((z) => !z.hasAttribute("disabled") && z.tabIndex !== -1);
311
- if (I.length === 0) {
312
- C.preventDefault();
311
+ if (C.length === 0) {
312
+ m.preventDefault();
313
313
  return;
314
314
  }
315
- const A = I[0], E = I[I.length - 1], P = document.activeElement;
316
- C.shiftKey && P === A ? (C.preventDefault(), E.focus()) : !C.shiftKey && P === E && (C.preventDefault(), A.focus());
315
+ const I = C[0], B = C[C.length - 1], M = document.activeElement;
316
+ m.shiftKey && M === I ? (m.preventDefault(), B.focus()) : !m.shiftKey && M === B && (m.preventDefault(), I.focus());
317
317
  };
318
- document.addEventListener("keydown", g, !0);
319
- const v = document.body.style.overflow;
318
+ document.addEventListener("keydown", A, !0);
319
+ const b = document.body.style.overflow;
320
320
  return c || (document.body.style.overflow = "hidden"), () => {
321
- document.removeEventListener("keydown", g, !0), c || (document.body.style.overflow = v), h.current?.focus?.({ preventScroll: !0 });
321
+ document.removeEventListener("keydown", A, !0), c || (document.body.style.overflow = b), f.current?.focus?.({ preventScroll: !0 });
322
322
  };
323
- }, [e, t, o, c]), e ? /* @__PURE__ */ d(
323
+ }, [t, e, s, c]), t ? /* @__PURE__ */ d(
324
324
  "div",
325
325
  {
326
326
  class: `${c ? "absolute z-[1]" : "fixed z-[2147483647]"} inset-0 flex items-center justify-center bg-slate-950/50 p-2 sm:p-4 backdrop-blur-md animate-[pw-fade-in_180ms_ease-out]`,
327
- onClick: (S) => {
328
- o && S.target === S.currentTarget && t();
327
+ onClick: (w) => {
328
+ s && w.target === w.currentTarget && e();
329
329
  },
330
330
  "data-pw-root": !0,
331
331
  children: [
@@ -350,12 +350,12 @@ function ne({
350
350
  },
351
351
  children: [
352
352
  l,
353
- o && !s ? /* @__PURE__ */ a(
353
+ s && !o ? /* @__PURE__ */ a(
354
354
  "button",
355
355
  {
356
356
  type: "button",
357
- onClick: t,
358
- "aria-label": f("modal.close_aria", "Close"),
357
+ onClick: e,
358
+ "aria-label": p("modal.close_aria", "Close"),
359
359
  class: "absolute right-3 top-3 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white/80 text-gray-500 backdrop-blur-sm transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
360
360
  children: /* @__PURE__ */ a("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ a(
361
361
  "path",
@@ -385,22 +385,22 @@ function ne({
385
385
  }
386
386
  ) : null;
387
387
  }
388
- function ae(e, t) {
389
- switch (e) {
388
+ function ot(t, e) {
389
+ switch (t) {
390
390
  case "google":
391
- return t("auth.continue_with_google", "Continue with Google");
391
+ return e("auth.continue_with_google", "Continue with Google");
392
392
  case "apple":
393
- return t("auth.continue_with_apple", "Continue with Apple");
393
+ return e("auth.continue_with_apple", "Continue with Apple");
394
394
  case "github":
395
- return t("auth.continue_with_github", "Continue with GitHub");
395
+ return e("auth.continue_with_github", "Continue with GitHub");
396
396
  case "facebook":
397
- return t("auth.continue_with_facebook", "Continue with Facebook");
397
+ return e("auth.continue_with_facebook", "Continue with Facebook");
398
398
  }
399
399
  }
400
- function ft(e, t, r) {
401
- const i = t === "signup" ? r("auth.signup_failed", "Sign-up failed") : r("auth.signin_failed", "Sign-in failed");
402
- if (!(e instanceof O)) return i;
403
- switch (e.code) {
400
+ function we(t, e, r) {
401
+ const i = e === "signup" ? r("auth.signup_failed", "Sign-up failed") : r("auth.signin_failed", "Sign-in failed");
402
+ if (!(t instanceof L)) return i;
403
+ switch (t.code) {
404
404
  case "invalid_credentials":
405
405
  return r("auth.invalid_credentials", "Invalid email or password");
406
406
  case "email_not_confirmed":
@@ -431,265 +431,265 @@ function ft(e, t, r) {
431
431
  return i;
432
432
  }
433
433
  }
434
- function Tt({ block: e, ctx: t }) {
435
- const r = t.auth, i = t.authSession, n = e.allow_signup !== !1, o = e.allow_password_reset !== !1, s = e.hide_when_authenticated !== !1;
434
+ function Ee({ block: t, ctx: e }) {
435
+ const r = e.auth, i = e.authSession, n = t.allow_signup !== !1, s = t.allow_password_reset !== !1, o = t.hide_when_authenticated !== !1;
436
436
  if (!r)
437
437
  return typeof console < "u" && console.warn("[paywall] auth_panel rendered without AuthClient — pass `auth: true` to PaywallUI"), null;
438
438
  const c = i && !i.user.is_anonymous ? i : null;
439
- return c && s ? null : c ? /* @__PURE__ */ a(oe, { email: c.user.email ?? "", onSignOut: () => r.signOut().catch(() => {
439
+ return c && o ? null : c ? /* @__PURE__ */ a(st, { email: c.user.email ?? "", onSignOut: () => r.signOut().catch(() => {
440
440
  }) }) : /* @__PURE__ */ a(
441
- se,
441
+ lt,
442
442
  {
443
- block: e,
443
+ block: t,
444
444
  allowSignup: n,
445
- allowReset: o,
446
- ctx: t
445
+ allowReset: s,
446
+ ctx: e
447
447
  }
448
448
  );
449
449
  }
450
- function oe({ email: e, onSignOut: t }) {
451
- const { t: r } = k();
450
+ function st({ email: t, onSignOut: e }) {
451
+ const { t: r } = S();
452
452
  return /* @__PURE__ */ d("div", { class: "flex items-center justify-between gap-3 rounded-2xl bg-gray-100 px-4 py-3", children: [
453
453
  /* @__PURE__ */ d("div", { class: "flex flex-col", children: [
454
454
  /* @__PURE__ */ a("span", { class: "text-[10px] font-semibold uppercase tracking-wider text-gray-500", children: r("auth.signed_in", "Signed in") }),
455
- /* @__PURE__ */ a("span", { class: "text-sm font-medium text-gray-900", children: e })
455
+ /* @__PURE__ */ a("span", { class: "text-sm font-medium text-gray-900", children: t })
456
456
  ] }),
457
457
  /* @__PURE__ */ a(
458
458
  "button",
459
459
  {
460
460
  type: "button",
461
- onClick: t,
461
+ onClick: e,
462
462
  class: "rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-600 transition-colors hover:bg-white hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
463
463
  children: r("auth.sign_out", "Sign out")
464
464
  }
465
465
  )
466
466
  ] });
467
467
  }
468
- function se({ block: e, allowSignup: t, allowReset: r, ctx: i }) {
469
- const { t: n } = k(), o = i.auth, s = e.providers ?? [], c = i.initialAuthMode === "signup" && t ? "signup" : "signin", [l, f] = x(c), [u, h] = x(""), [p, _] = x(""), [y, S] = x(""), [g, v] = x(""), [C, I] = x(null), A = F(!1), [E, P] = x(null), [z, B] = x(null), [R, j] = x(!1), [M, D] = x(null);
470
- T(() => {
471
- if (typeof o.getLastLogin != "function") return;
472
- let m = !1;
473
- return o.getLastLogin().then(
474
- (L) => {
475
- m || !L || (D(L), L.email && h((N) => N === "" ? L.email : N));
468
+ function lt({ block: t, allowSignup: e, allowReset: r, ctx: i }) {
469
+ const { t: n } = S(), s = i.auth, o = t.providers ?? [], c = i.initialAuthMode === "signup" && e ? "signup" : "signin", [l, p] = v(c), [u, f] = v(""), [_, h] = v(""), [k, w] = v(""), [A, b] = v(""), [m, C] = v(null), I = F(!1), [B, M] = v(null), [z, O] = v(null), [R, P] = v(!1), [T, U] = v(null);
470
+ j(() => {
471
+ if (typeof s.getLastLogin != "function") return;
472
+ let g = !1;
473
+ return s.getLastLogin().then(
474
+ (x) => {
475
+ g || !x || (U(x), x.email && f((E) => E === "" ? x.email : E));
476
476
  },
477
477
  () => {
478
478
  }
479
479
  ), () => {
480
- m = !0;
480
+ g = !0;
481
481
  };
482
- }, [o]);
483
- const U = (m) => {
484
- f(m), P(null), B(null), j(!1);
485
- }, V = async (m) => {
486
- if (m.preventDefault(), !(A.current || C)) {
487
- A.current = !0;
482
+ }, [s]);
483
+ const D = (g) => {
484
+ p(g), M(null), O(null), P(!1);
485
+ }, Z = async (g) => {
486
+ if (g.preventDefault(), !(I.current || m)) {
487
+ I.current = !0;
488
488
  try {
489
- if (P(null), B(null), l === "signup" && !R) {
489
+ if (M(null), O(null), l === "signup" && !R) {
490
490
  if (!u.trim()) return;
491
- j(!0);
491
+ P(!0);
492
492
  return;
493
493
  }
494
- if (l === "signup" && p !== y) {
495
- P(n("auth.passwords_mismatch", "Passwords don't match"));
494
+ if (l === "signup" && _ !== k) {
495
+ M(n("auth.passwords_mismatch", "Passwords don't match"));
496
496
  return;
497
497
  }
498
- I("email");
498
+ C("email");
499
499
  try {
500
- l === "signin" ? await o.signInWithEmail({ email: u, password: p }) : l === "signup" ? (await o.signUp({ email: u, password: p })).kind === "confirmation_required" && (_(""), f("signup_verify"), B(n("auth.check_email_message", "Check your email for a confirmation code."))) : l === "forgot" ? (await o.requestPasswordReset({ email: u }), f("reset_sent"), B(
500
+ l === "signin" ? await s.signInWithEmail({ email: u, password: _ }) : l === "signup" ? (await s.signUp({ email: u, password: _ })).kind === "confirmation_required" && (h(""), p("signup_verify"), O(n("auth.check_email_message", "Check your email for a confirmation code."))) : l === "forgot" ? (await s.requestPasswordReset({ email: u }), p("reset_sent"), O(
501
501
  n("auth.reset_sent_message", "If that email exists, a reset code has been sent.")
502
- )) : l === "signup_verify" ? await o.verifyOtp({ email: u, token: g, type: "email" }) : l === "reset_verify" && (await o.verifyOtp({
502
+ )) : l === "signup_verify" ? await s.verifyOtp({ email: u, token: A, type: "email" }) : l === "reset_verify" && (await s.verifyOtp({
503
503
  email: u,
504
- token: g,
505
- type: p ? "recovery" : "email"
506
- }), p && await o.updatePassword({ password: p }));
507
- } catch (L) {
508
- P(ft(L, l === "signup" ? "signup" : l === "signup_verify" || l === "reset_verify" ? "otp" : l === "forgot" ? "reset" : "signin", n));
504
+ token: A,
505
+ type: _ ? "recovery" : "email"
506
+ }), _ && await s.updatePassword({ password: _ }));
507
+ } catch (x) {
508
+ M(we(x, l === "signup" ? "signup" : l === "signup_verify" || l === "reset_verify" ? "otp" : l === "forgot" ? "reset" : "signin", n));
509
509
  } finally {
510
- I(null);
510
+ C(null);
511
511
  }
512
512
  } finally {
513
- A.current = !1;
513
+ I.current = !1;
514
514
  }
515
515
  }
516
- }, Z = async (m) => {
517
- if (!(A.current || C)) {
518
- A.current = !0, I(m), P(null), B(null);
516
+ }, V = async (g) => {
517
+ if (!(I.current || m)) {
518
+ I.current = !0, C(g), M(null), O(null);
519
519
  try {
520
- await o.signInWithOAuth({
521
- provider: m,
522
- onPopupOpened: () => I(null)
520
+ await s.signInWithOAuth({
521
+ provider: g,
522
+ onPopupOpened: () => C(null)
523
523
  });
524
- } catch (L) {
525
- if (L instanceof O && (L.code === "oauth_cancelled" || L.code === "oauth_timeout"))
524
+ } catch (x) {
525
+ if (x instanceof L && (x.code === "oauth_cancelled" || x.code === "oauth_timeout"))
526
526
  return;
527
- P(ft(L, "signin", n));
527
+ M(we(x, "signin", n));
528
528
  } finally {
529
- A.current = !1, I(null);
529
+ I.current = !1, C(null);
530
530
  }
531
531
  }
532
- }, K = s.length > 0 && (l === "signin" || l === "signup"), b = l === "signin" || l === "signup" || l === "forgot", w = l === "signin" || l === "signup" && R;
532
+ }, K = o.length > 0 && (l === "signin" || l === "signup"), Y = l === "signin" || l === "signup" || l === "forgot", y = l === "signin" || l === "signup" && R;
533
533
  return /* @__PURE__ */ d("div", { class: "flex flex-col gap-5", children: [
534
- /* @__PURE__ */ a(le, { mode: l, customHeading: e.heading, customSubheading: e.subheading }),
534
+ /* @__PURE__ */ a(ct, { mode: l, customHeading: t.heading, customSubheading: t.subheading }),
535
535
  K ? /* @__PURE__ */ d("div", { class: "flex flex-col gap-2.5", children: [
536
- s.map((m) => /* @__PURE__ */ d("div", { class: "relative", children: [
536
+ o.map((g) => /* @__PURE__ */ d("div", { class: "relative", children: [
537
537
  /* @__PURE__ */ d(
538
538
  "button",
539
539
  {
540
540
  type: "button",
541
- onClick: () => Z(m),
542
- disabled: C !== null,
541
+ onClick: () => V(g),
542
+ disabled: m !== null,
543
543
  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)]",
544
544
  children: [
545
- C === m ? /* @__PURE__ */ a("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700" }) : /* @__PURE__ */ a(be, { provider: m }),
546
- /* @__PURE__ */ a("span", { children: ae(m, n) })
545
+ m === g ? /* @__PURE__ */ a("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700" }) : /* @__PURE__ */ a(yt, { provider: g }),
546
+ /* @__PURE__ */ a("span", { children: ot(g, n) })
547
547
  ]
548
548
  }
549
549
  ),
550
- M?.method === m ? /* @__PURE__ */ a(fe, { email: M.email }) : null
551
- ] }, m)),
552
- /* @__PURE__ */ a(me, {})
550
+ T?.method === g ? /* @__PURE__ */ a(wt, { email: T.email }) : null
551
+ ] }, g)),
552
+ /* @__PURE__ */ a(bt, {})
553
553
  ] }) : null,
554
- /* @__PURE__ */ d("form", { onSubmit: V, class: "flex flex-col gap-3", children: [
555
- b && /* @__PURE__ */ a(
556
- wt,
554
+ /* @__PURE__ */ d("form", { onSubmit: Z, class: "flex flex-col gap-3", children: [
555
+ Y && /* @__PURE__ */ a(
556
+ me,
557
557
  {
558
558
  type: "email",
559
559
  placeholder: n("auth.email", "Email address"),
560
560
  value: u,
561
- onInput: h,
561
+ onInput: f,
562
562
  autocomplete: "email",
563
563
  required: !0
564
564
  }
565
565
  ),
566
- w && /* @__PURE__ */ a(
567
- et,
566
+ y && /* @__PURE__ */ a(
567
+ re,
568
568
  {
569
569
  placeholder: n("auth.password", "Password"),
570
- value: p,
571
- onInput: _,
570
+ value: _,
571
+ onInput: h,
572
572
  autocomplete: l === "signin" ? "current-password" : "new-password",
573
573
  required: !0
574
574
  }
575
575
  ),
576
576
  l === "signup" && R && /* @__PURE__ */ a(
577
- et,
577
+ re,
578
578
  {
579
579
  placeholder: n("auth.repeat_password", "Repeat password"),
580
- value: y,
581
- onInput: S,
580
+ value: k,
581
+ onInput: w,
582
582
  autocomplete: "new-password",
583
583
  required: !0
584
584
  }
585
585
  ),
586
586
  (l === "signup_verify" || l === "reset_verify") && /* @__PURE__ */ a(
587
- wt,
587
+ me,
588
588
  {
589
589
  type: "text",
590
590
  placeholder: n("auth.confirmation_code", "Confirmation code"),
591
- value: g,
592
- onInput: v,
591
+ value: A,
592
+ onInput: b,
593
593
  autocomplete: "one-time-code",
594
594
  inputMode: "numeric",
595
595
  required: !0
596
596
  }
597
597
  ),
598
598
  l === "reset_verify" && /* @__PURE__ */ a(
599
- et,
599
+ re,
600
600
  {
601
601
  placeholder: n(
602
602
  "auth.new_password_optional",
603
603
  "New password (optional — only for password reset)"
604
604
  ),
605
- value: p,
606
- onInput: _,
605
+ value: _,
606
+ onInput: h,
607
607
  autocomplete: "new-password"
608
608
  }
609
609
  ),
610
610
  l === "reset_sent" && z && /* @__PURE__ */ a("p", { class: "rounded-2xl bg-gray-100 px-4 py-3 text-sm text-gray-600", children: z }),
611
- l === "signin" && r && /* @__PURE__ */ a("div", { class: "flex justify-end text-sm", children: /* @__PURE__ */ a(W, { onClick: () => U("forgot"), children: n("auth.forgot_password", "Forgot password?") }) }),
612
- E && /* @__PURE__ */ a("p", { class: "text-sm text-red-600", children: E }),
611
+ l === "signin" && r && /* @__PURE__ */ a("div", { class: "flex justify-end text-sm", children: /* @__PURE__ */ a(W, { onClick: () => D("forgot"), children: n("auth.forgot_password", "Forgot password?") }) }),
612
+ B && /* @__PURE__ */ a("p", { class: "text-sm text-red-600", children: B }),
613
613
  z && l !== "reset_sent" && /* @__PURE__ */ a("p", { class: "text-sm text-gray-500", children: z }),
614
614
  l !== "reset_sent" && /* @__PURE__ */ a(
615
- pe,
615
+ ht,
616
616
  {
617
- busy: C === "email",
618
- label: de(l, R, e.submit_label ?? e.heading, n)
617
+ busy: m === "email",
618
+ label: ut(l, R, t.submit_label ?? t.heading, n)
619
619
  }
620
620
  )
621
621
  ] }),
622
622
  /* @__PURE__ */ a(
623
- ue,
623
+ pt,
624
624
  {
625
625
  mode: l,
626
- allowSignup: t,
627
- onSwitch: U
626
+ allowSignup: e,
627
+ onSwitch: D
628
628
  }
629
629
  )
630
630
  ] });
631
631
  }
632
- function le({
633
- mode: e,
634
- customHeading: t,
632
+ function ct({
633
+ mode: t,
634
+ customHeading: e,
635
635
  customSubheading: r
636
636
  }) {
637
- const { t: i } = k(), n = ce(e, i), o = e === "signin" || e === "signup", s = o && t ? t : n.title, c = o && r !== void 0 ? r || null : n.subtitle;
637
+ const { t: i } = S(), n = dt(t, i), s = t === "signin" || t === "signup", o = s && e ? e : n.title, c = s && r !== void 0 ? r || null : n.subtitle;
638
638
  return /* @__PURE__ */ d("div", { class: "flex flex-col gap-2", children: [
639
- /* @__PURE__ */ a("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: s }),
639
+ /* @__PURE__ */ a("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: o }),
640
640
  c ? /* @__PURE__ */ a("p", { class: "text-base leading-relaxed text-gray-600", children: c }) : null
641
641
  ] });
642
642
  }
643
- function ce(e, t) {
644
- switch (e) {
643
+ function dt(t, e) {
644
+ switch (t) {
645
645
  case "signin":
646
646
  return {
647
- title: t("auth.welcome", "Welcome back!"),
648
- subtitle: t("auth.default_subtitle", "Sign in to access all features and sync your data.")
647
+ title: e("auth.welcome", "Welcome back!"),
648
+ subtitle: e("auth.default_subtitle", "Sign in to access all features and sync your data.")
649
649
  };
650
650
  case "signup":
651
651
  return {
652
- title: t("auth.welcome_signup", "Welcome!"),
653
- subtitle: t("auth.default_subtitle", "Sign in to access all features and sync your data.")
652
+ title: e("auth.welcome_signup", "Welcome!"),
653
+ subtitle: e("auth.default_subtitle", "Sign in to access all features and sync your data.")
654
654
  };
655
655
  case "forgot":
656
656
  return {
657
- title: t("auth.forgot_password_title", "Forgot password?"),
658
- subtitle: t(
657
+ title: e("auth.forgot_password_title", "Forgot password?"),
658
+ subtitle: e(
659
659
  "auth.forgot_subtitle",
660
660
  "Enter your email and we'll send you a password reset link."
661
661
  )
662
662
  };
663
663
  case "reset_sent":
664
664
  return {
665
- title: t("auth.check_email_title", "Check your email"),
665
+ title: e("auth.check_email_title", "Check your email"),
666
666
  subtitle: null
667
667
  };
668
668
  case "reset_verify":
669
669
  return {
670
- title: t("auth.reset_password_title", "Reset password"),
671
- subtitle: t(
670
+ title: e("auth.reset_password_title", "Reset password"),
671
+ subtitle: e(
672
672
  "auth.reset_password_subtitle",
673
673
  "Enter the code from your email and a new password."
674
674
  )
675
675
  };
676
676
  case "signup_verify":
677
677
  return {
678
- title: t("auth.confirm_email_title", "Confirm your email"),
679
- subtitle: t(
678
+ title: e("auth.confirm_email_title", "Confirm your email"),
679
+ subtitle: e(
680
680
  "auth.confirm_email_subtitle",
681
681
  "Enter the code we sent to your email to finish creating your account."
682
682
  )
683
683
  };
684
684
  }
685
685
  }
686
- function de(e, t, r, i) {
687
- if (e === "signin" && r) return r;
688
- switch (e) {
686
+ function ut(t, e, r, i) {
687
+ if (t === "signin" && r) return r;
688
+ switch (t) {
689
689
  case "signin":
690
690
  return i("auth.log_in", "Sign In");
691
691
  case "signup":
692
- return t ? i("auth.create_account", "Create Account") : i("auth.sign_up", "Sign Up");
692
+ return e ? i("auth.create_account", "Create Account") : i("auth.sign_up", "Sign Up");
693
693
  case "forgot":
694
694
  return i("auth.send_reset", "Send Reset Email");
695
695
  case "signup_verify":
@@ -699,87 +699,87 @@ function de(e, t, r, i) {
699
699
  return i("cta.continue", "Continue");
700
700
  }
701
701
  }
702
- function ue({
703
- mode: e,
704
- allowSignup: t,
702
+ function pt({
703
+ mode: t,
704
+ allowSignup: e,
705
705
  onSwitch: r
706
706
  }) {
707
- const { t: i } = k();
708
- return e === "signin" && t ? /* @__PURE__ */ d("p", { class: "text-center text-sm text-gray-600", children: [
707
+ const { t: i } = S();
708
+ return t === "signin" && e ? /* @__PURE__ */ d("p", { class: "text-center text-sm text-gray-600", children: [
709
709
  i("auth.no_account", "Don't have an account?"),
710
710
  " ",
711
711
  /* @__PURE__ */ a(W, { onClick: () => r("signup"), children: i("auth.sign_up_link", "Sign Up") })
712
- ] }) : e === "signup" || e === "signup_verify" ? /* @__PURE__ */ d("p", { class: "text-center text-sm text-gray-600", children: [
712
+ ] }) : t === "signup" || t === "signup_verify" ? /* @__PURE__ */ d("p", { class: "text-center text-sm text-gray-600", children: [
713
713
  i("auth.have_account", "Already have an account?"),
714
714
  " ",
715
715
  /* @__PURE__ */ a(W, { onClick: () => r("signin"), children: i("auth.log_in_link", "Log In") })
716
- ] }) : e === "forgot" || e === "reset_sent" || e === "reset_verify" ? /* @__PURE__ */ d("p", { class: "text-center text-sm text-gray-600", children: [
716
+ ] }) : t === "forgot" || t === "reset_sent" || t === "reset_verify" ? /* @__PURE__ */ d("p", { class: "text-center text-sm text-gray-600", children: [
717
717
  i("auth.no_account", "Don't have an account?"),
718
718
  " ",
719
719
  /* @__PURE__ */ a(W, { onClick: () => r("signup"), children: i("auth.sign_up_link", "Sign Up") })
720
720
  ] }) : null;
721
721
  }
722
722
  function W({
723
- onClick: e,
724
- children: t
723
+ onClick: t,
724
+ children: e
725
725
  }) {
726
726
  return /* @__PURE__ */ a(
727
727
  "button",
728
728
  {
729
729
  type: "button",
730
- onClick: e,
730
+ onClick: t,
731
731
  class: "font-semibold transition-opacity hover:opacity-80 focus:outline-none focus-visible:opacity-80",
732
732
  style: { color: "var(--pw-accent)" },
733
- children: t
733
+ children: e
734
734
  }
735
735
  );
736
736
  }
737
- function pe({ busy: e, label: t }) {
737
+ function ht({ busy: t, label: e }) {
738
738
  return /* @__PURE__ */ a(
739
739
  "button",
740
740
  {
741
741
  type: "submit",
742
- disabled: e,
742
+ disabled: t,
743
743
  class: "pw-cta-shimmer relative mt-1 flex min-h-12 w-full items-center justify-center overflow-hidden rounded-3xl px-5 py-2 text-center text-base font-semibold leading-tight text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
744
744
  style: {
745
745
  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%)",
746
746
  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)"
747
747
  },
748
- children: e ? /* @__PURE__ */ a("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ a("span", { class: "relative z-10", children: t })
748
+ children: t ? /* @__PURE__ */ a("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ a("span", { class: "relative z-10", children: e })
749
749
  }
750
750
  );
751
751
  }
752
- function wt({ type: e, placeholder: t, value: r, onInput: i, autocomplete: n, inputMode: o, required: s }) {
752
+ function me({ type: t, placeholder: e, value: r, onInput: i, autocomplete: n, inputMode: s, required: o }) {
753
753
  return /* @__PURE__ */ a(
754
754
  "input",
755
755
  {
756
- type: e,
756
+ type: t,
757
757
  value: r,
758
- placeholder: t,
758
+ placeholder: e,
759
759
  onInput: (c) => i(c.target.value),
760
760
  autocomplete: n,
761
- inputMode: o,
762
- required: s,
761
+ inputMode: s,
762
+ required: o,
763
763
  class: "h-14 w-full rounded-2xl bg-gray-100 px-5 text-base text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"
764
764
  }
765
765
  );
766
766
  }
767
- function et({ placeholder: e, value: t, onInput: r, autocomplete: i, required: n }) {
768
- const { t: o } = k(), [s, c] = x(!1), l = F(null);
769
- T(() => {
770
- const h = l.current;
771
- h && h.value !== t && (h.value = t);
772
- }, [s, t]);
773
- const f = o("auth.show_password", "Show password"), u = o("auth.hide_password", "Hide password");
767
+ function re({ placeholder: t, value: e, onInput: r, autocomplete: i, required: n }) {
768
+ const { t: s } = S(), [o, c] = v(!1), l = F(null);
769
+ j(() => {
770
+ const f = l.current;
771
+ f && f.value !== e && (f.value = e);
772
+ }, [o, e]);
773
+ const p = s("auth.show_password", "Show password"), u = s("auth.hide_password", "Hide password");
774
774
  return /* @__PURE__ */ d("div", { class: "relative", children: [
775
775
  /* @__PURE__ */ a(
776
776
  "input",
777
777
  {
778
778
  ref: l,
779
- type: s ? "text" : "password",
780
- value: t,
781
- placeholder: e,
782
- onInput: (h) => r(h.target.value),
779
+ type: o ? "text" : "password",
780
+ value: e,
781
+ placeholder: t,
782
+ onInput: (f) => r(f.target.value),
783
783
  autocomplete: i,
784
784
  required: n,
785
785
  class: "h-14 w-full rounded-2xl bg-gray-100 pl-5 pr-12 text-base text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"
@@ -789,16 +789,16 @@ function et({ placeholder: e, value: t, onInput: r, autocomplete: i, required: n
789
789
  "button",
790
790
  {
791
791
  type: "button",
792
- onClick: () => c((h) => !h),
793
- "aria-label": s ? u : f,
792
+ onClick: () => c((f) => !f),
793
+ "aria-label": o ? u : p,
794
794
  tabIndex: -1,
795
795
  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)]",
796
- children: s ? /* @__PURE__ */ a(ge, {}) : /* @__PURE__ */ a(he, {})
796
+ children: o ? /* @__PURE__ */ a(ft, {}) : /* @__PURE__ */ a(gt, {})
797
797
  }
798
798
  )
799
799
  ] });
800
800
  }
801
- function he() {
801
+ function gt() {
802
802
  return /* @__PURE__ */ d("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
803
803
  /* @__PURE__ */ a(
804
804
  "path",
@@ -813,7 +813,7 @@ function he() {
813
813
  /* @__PURE__ */ a("circle", { cx: "10", cy: "10", r: "2.5", stroke: "currentColor", "stroke-width": "1.5" })
814
814
  ] });
815
815
  }
816
- function ge() {
816
+ function ft() {
817
817
  return /* @__PURE__ */ d("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
818
818
  /* @__PURE__ */ a(
819
819
  "path",
@@ -837,47 +837,47 @@ function ge() {
837
837
  )
838
838
  ] });
839
839
  }
840
- function fe({ email: e }) {
841
- const { t } = k(), r = e ? t("auth.last_used", "Last · {email}", { email: we(e) }) : t("auth.last_used_no_email", "Last");
840
+ function wt({ email: t }) {
841
+ const { t: e } = S(), r = t ? e("auth.last_used", "Last · {email}", { email: mt(t) }) : e("auth.last_used_no_email", "Last");
842
842
  return /* @__PURE__ */ a("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: r });
843
843
  }
844
- function we(e) {
845
- const [t, r] = e.split("@");
846
- return r ? `${t.slice(0, 3)}*****@${r}` : e;
844
+ function mt(t) {
845
+ const [e, r] = t.split("@");
846
+ return r ? `${e.slice(0, 3)}*****@${r}` : t;
847
847
  }
848
- function me() {
849
- const { t: e } = k();
848
+ function bt() {
849
+ const { t } = S();
850
850
  return /* @__PURE__ */ d("div", { class: "flex items-center gap-3 py-1 text-sm text-gray-400", children: [
851
851
  /* @__PURE__ */ a("div", { class: "h-px flex-1 bg-gray-200" }),
852
- /* @__PURE__ */ a("span", { children: e("auth.or", "or") }),
852
+ /* @__PURE__ */ a("span", { children: t("auth.or", "or") }),
853
853
  /* @__PURE__ */ a("div", { class: "h-px flex-1 bg-gray-200" })
854
854
  ] });
855
855
  }
856
- function be({ provider: e }) {
857
- return e === "google" ? /* @__PURE__ */ d("svg", { width: "20", height: "20", viewBox: "0 0 18 18", "aria-hidden": "true", children: [
856
+ function yt({ provider: t }) {
857
+ return t === "google" ? /* @__PURE__ */ d("svg", { width: "20", height: "20", viewBox: "0 0 18 18", "aria-hidden": "true", children: [
858
858
  /* @__PURE__ */ a("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" }),
859
859
  /* @__PURE__ */ a("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" }),
860
860
  /* @__PURE__ */ a("path", { fill: "#FBBC05", d: "M3.93 10.68a5.4 5.4 0 0 1 0-3.36V4.99H.92a9 9 0 0 0 0 8.02l3-2.33Z" }),
861
861
  /* @__PURE__ */ a("path", { fill: "#EA4335", d: "M9 3.58c1.32 0 2.5.45 3.44 1.34l2.58-2.58A9 9 0 0 0 .92 4.99l3.01 2.33C4.64 5.17 6.64 3.58 9 3.58Z" })
862
- ] }) : e === "apple" ? (
862
+ ] }) : t === "apple" ? (
863
863
  // viewBox 0 0 24 24 даёт воздух сверху/снизу пути, поэтому визуально
864
864
  // Apple-яблоко выглядит меньше Google. Компенсируем увеличенным
865
865
  // width/height — 26×26 даёт примерно equal optical size с Google 20×20.
866
866
  /* @__PURE__ */ a("svg", { width: "26", height: "26", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ a("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" }) })
867
- ) : e === "github" ? /* @__PURE__ */ a("svg", { width: "20", height: "20", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ a("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__ */ a("svg", { width: "18", height: "20", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ a("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" }) });
867
+ ) : t === "github" ? /* @__PURE__ */ a("svg", { width: "20", height: "20", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ a("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__ */ a("svg", { width: "18", height: "20", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ a("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" }) });
868
868
  }
869
- function xe({
870
- block: e,
871
- bootstrap: t,
869
+ function xt({
870
+ block: t,
871
+ bootstrap: e,
872
872
  auth: r,
873
873
  authSession: i,
874
874
  onBack: n,
875
- showBack: o = !0,
876
- intent: s = "preauth",
875
+ showBack: s = !0,
876
+ intent: o = "preauth",
877
877
  initialMode: c
878
878
  }) {
879
- const { t: l } = k(), f = {
880
- bootstrap: t,
879
+ const { t: l } = S(), p = {
880
+ bootstrap: e,
881
881
  selectedPriceId: null,
882
882
  setSelectedPriceId: () => {
883
883
  },
@@ -886,15 +886,15 @@ function xe({
886
886
  auth: r,
887
887
  authSession: i,
888
888
  initialAuthMode: c
889
- }, u = s === "restore" ? {
890
- ...e,
889
+ }, u = o === "restore" ? {
890
+ ...t,
891
891
  heading: l("auth.restore_purchases_heading", "Restore Purchases"),
892
892
  subheading: l(
893
893
  "auth.restore_purchases_subheading",
894
894
  "Please sign in to restore your purchases."
895
895
  )
896
- } : s === "preauth" ? {
897
- ...e,
896
+ } : o === "preauth" ? {
897
+ ...t,
898
898
  heading: l("auth.login_continue_purchase", "Log in to continue your purchase"),
899
899
  subheading: l(
900
900
  "auth.link_purchase_subheading",
@@ -905,19 +905,19 @@ function xe({
905
905
  // чтобы продолжить покупку") в pill-кнопку h-12 не помещаются и
906
906
  // переносятся на 2 строки. Явный короткий submit_label решает.
907
907
  submit_label: l("auth.log_in", "Sign In")
908
- } : e;
908
+ } : t;
909
909
  return /* @__PURE__ */ d("div", { class: "relative flex-1 min-h-0 overflow-y-auto p-6 sm:p-8", children: [
910
- o ? /* @__PURE__ */ a(ye, { onClick: n, ariaLabel: l("nav.back_aria", "Back") }) : null,
911
- /* @__PURE__ */ a(Tt, { block: u, ctx: f })
910
+ s ? /* @__PURE__ */ a(vt, { onClick: n, ariaLabel: l("nav.back_aria", "Back") }) : null,
911
+ /* @__PURE__ */ a(Ee, { block: u, ctx: p })
912
912
  ] });
913
913
  }
914
- function ye({ onClick: e, ariaLabel: t }) {
914
+ function vt({ onClick: t, ariaLabel: e }) {
915
915
  return /* @__PURE__ */ a(
916
916
  "button",
917
917
  {
918
918
  type: "button",
919
- onClick: e,
920
- "aria-label": t,
919
+ onClick: t,
920
+ "aria-label": e,
921
921
  class: "absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
922
922
  children: /* @__PURE__ */ d("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
923
923
  /* @__PURE__ */ a(
@@ -944,67 +944,67 @@ function ye({ onClick: e, ariaLabel: t }) {
944
944
  }
945
945
  );
946
946
  }
947
- const Et = (e) => `pw-offer-${e}-start`;
948
- function rt(e) {
949
- const t = e - Date.now();
950
- return t <= 0 ? { days: 0, hours: 0, minutes: 0, seconds: 0, expired: !0 } : {
951
- days: Math.floor(t / (1e3 * 60 * 60 * 24)),
952
- hours: Math.floor(t % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)),
953
- minutes: Math.floor(t % (1e3 * 60 * 60) / (1e3 * 60)),
954
- seconds: Math.floor(t % (1e3 * 60) / 1e3),
947
+ const je = (t) => `pw-offer-${t}-start`;
948
+ function ie(t) {
949
+ const e = t - Date.now();
950
+ return e <= 0 ? { days: 0, hours: 0, minutes: 0, seconds: 0, expired: !0 } : {
951
+ days: Math.floor(e / (1e3 * 60 * 60 * 24)),
952
+ hours: Math.floor(e % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)),
953
+ minutes: Math.floor(e % (1e3 * 60 * 60) / (1e3 * 60)),
954
+ seconds: Math.floor(e % (1e3 * 60) / 1e3),
955
955
  expired: !1
956
956
  };
957
957
  }
958
- function ve(e) {
959
- if (e.expires_at) {
960
- const t = Date.parse(e.expires_at);
961
- return Number.isFinite(t) ? t : null;
958
+ function kt(t) {
959
+ if (t.expires_at) {
960
+ const e = Date.parse(t.expires_at);
961
+ return Number.isFinite(e) ? e : null;
962
962
  }
963
- if (e.duration_minutes && e.duration_minutes > 0) {
963
+ if (t.duration_minutes && t.duration_minutes > 0) {
964
964
  if (typeof window > "u") return null;
965
965
  try {
966
- const t = Et(e.id);
967
- let r = window.localStorage.getItem(t);
968
- return r || (r = (/* @__PURE__ */ new Date()).toISOString(), window.localStorage.setItem(t, r)), Date.parse(r) + e.duration_minutes * 6e4;
966
+ const e = je(t.id);
967
+ let r = window.localStorage.getItem(e);
968
+ return r || (r = (/* @__PURE__ */ new Date()).toISOString(), window.localStorage.setItem(e, r)), Date.parse(r) + t.duration_minutes * 6e4;
969
969
  } catch {
970
970
  return null;
971
971
  }
972
972
  }
973
973
  return null;
974
974
  }
975
- function jt(e, t) {
976
- if (!e || e.length === 0) return null;
977
- if (t) {
978
- const r = e.find((i) => i.id === t);
975
+ function ze(t, e) {
976
+ if (!t || t.length === 0) return null;
977
+ if (e) {
978
+ const r = t.find((i) => i.id === e);
979
979
  if (r) return r;
980
980
  }
981
- return e.find((r) => r.expires_at || r.duration_minutes) ?? null;
981
+ return t.find((r) => r.expires_at || r.duration_minutes) ?? null;
982
982
  }
983
- function zt(e) {
984
- const t = e ? ve(e) : null, [r, i] = x(
985
- () => t !== null ? rt(t) : null
986
- ), n = F(t);
987
- return n.current = t, T(() => {
988
- if (t === null) {
983
+ function Be(t) {
984
+ const e = t ? kt(t) : null, [r, i] = v(
985
+ () => e !== null ? ie(e) : null
986
+ ), n = F(e);
987
+ return n.current = e, j(() => {
988
+ if (e === null) {
989
989
  i(null);
990
990
  return;
991
991
  }
992
- i(rt(t));
993
- const o = setInterval(() => {
994
- const s = rt(n.current ?? 0);
995
- if (i(s), s.expired && (clearInterval(o), e?.duration_minutes && typeof window < "u"))
992
+ i(ie(e));
993
+ const s = setInterval(() => {
994
+ const o = ie(n.current ?? 0);
995
+ if (i(o), o.expired && (clearInterval(s), t?.duration_minutes && typeof window < "u"))
996
996
  try {
997
- window.localStorage.removeItem(Et(e.id));
997
+ window.localStorage.removeItem(je(t.id));
998
998
  } catch {
999
999
  }
1000
1000
  }, 1e3);
1001
- return () => clearInterval(o);
1002
- }, [t, e?.duration_minutes, e?.id]), r;
1001
+ return () => clearInterval(s);
1002
+ }, [e, t?.duration_minutes, t?.id]), r;
1003
1003
  }
1004
- function ke({ block: e, ctx: t }) {
1005
- const { t: r } = k(), i = jt(t.bootstrap.offers, e.offer_id), n = zt(i);
1006
- if (!i || n === null || n.expired && !e.force) return null;
1007
- const o = e.title ?? i.label ?? r("offer.limited_time", "Limited-time offer"), s = i.discount_percent ? `${o} ${i.discount_percent}%` : o;
1004
+ function _t({ block: t, ctx: e }) {
1005
+ const { t: r } = S(), i = ze(e.bootstrap.offers, t.offer_id), n = Be(i);
1006
+ if (!i || n === null || n.expired && !t.force) return null;
1007
+ const s = t.title ?? i.label ?? r("offer.limited_time", "Limited-time offer"), o = i.discount_percent ? `${s} ${i.discount_percent}%` : s;
1008
1008
  return /* @__PURE__ */ d(
1009
1009
  "div",
1010
1010
  {
@@ -1015,34 +1015,34 @@ function ke({ block: e, ctx: t }) {
1015
1015
  },
1016
1016
  role: "status",
1017
1017
  children: [
1018
- /* @__PURE__ */ a(Ot, {}),
1019
- /* @__PURE__ */ a("span", { children: s }),
1020
- /* @__PURE__ */ a(Bt, { value: n, t: r })
1018
+ /* @__PURE__ */ a(Fe, {}),
1019
+ /* @__PURE__ */ a("span", { children: o }),
1020
+ /* @__PURE__ */ a(Oe, { value: n, t: r })
1021
1021
  ]
1022
1022
  }
1023
1023
  );
1024
1024
  }
1025
- function Bt({ value: e, t }) {
1025
+ function Oe({ value: t, t: e }) {
1026
1026
  return /* @__PURE__ */ d("div", { class: "flex items-center gap-1 font-mono text-sm", children: [
1027
- e.days > 0 ? /* @__PURE__ */ d(ot, { children: [
1028
- /* @__PURE__ */ a(G, { children: String(e.days) }),
1029
- /* @__PURE__ */ a("span", { class: "text-xs", children: t("countdown.d", "d") })
1027
+ t.days > 0 ? /* @__PURE__ */ d(se, { children: [
1028
+ /* @__PURE__ */ a(q, { children: String(t.days) }),
1029
+ /* @__PURE__ */ a("span", { class: "text-xs", children: e("countdown.d", "d") })
1030
1030
  ] }) : null,
1031
- /* @__PURE__ */ a(G, { children: String(e.hours).padStart(2, "0") }),
1032
- /* @__PURE__ */ a("span", { class: "text-xs", children: t("countdown.h", "h") }),
1033
- /* @__PURE__ */ a(G, { children: String(e.minutes).padStart(2, "0") }),
1034
- /* @__PURE__ */ a("span", { class: "text-xs", children: t("countdown.m", "m") }),
1035
- /* @__PURE__ */ a(G, { children: String(e.seconds).padStart(2, "0") }),
1036
- /* @__PURE__ */ a("span", { class: "text-xs", children: t("countdown.s", "s") })
1031
+ /* @__PURE__ */ a(q, { children: String(t.hours).padStart(2, "0") }),
1032
+ /* @__PURE__ */ a("span", { class: "text-xs", children: e("countdown.h", "h") }),
1033
+ /* @__PURE__ */ a(q, { children: String(t.minutes).padStart(2, "0") }),
1034
+ /* @__PURE__ */ a("span", { class: "text-xs", children: e("countdown.m", "m") }),
1035
+ /* @__PURE__ */ a(q, { children: String(t.seconds).padStart(2, "0") }),
1036
+ /* @__PURE__ */ a("span", { class: "text-xs", children: e("countdown.s", "s") })
1037
1037
  ] });
1038
1038
  }
1039
- function G({ children: e }) {
1040
- return /* @__PURE__ */ a("span", { class: "rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold", children: e });
1039
+ function q({ children: t }) {
1040
+ return /* @__PURE__ */ a("span", { class: "rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold", children: t });
1041
1041
  }
1042
- function _e({ offer: e }) {
1043
- const { t } = k(), r = zt(e);
1042
+ function St({ offer: t }) {
1043
+ const { t: e } = S(), r = Be(t);
1044
1044
  if (r === null || r.expired) return null;
1045
- const i = e.label ?? t("offer.limited_time", "Limited-time offer"), n = e.discount_percent ? `${i} ${e.discount_percent}%` : i;
1045
+ const i = t.label ?? e("offer.limited_time", "Limited-time offer"), n = t.discount_percent ? `${i} ${t.discount_percent}%` : i;
1046
1046
  return /* @__PURE__ */ d(
1047
1047
  "div",
1048
1048
  {
@@ -1053,14 +1053,14 @@ function _e({ offer: e }) {
1053
1053
  },
1054
1054
  role: "status",
1055
1055
  children: [
1056
- /* @__PURE__ */ a(Ot, {}),
1056
+ /* @__PURE__ */ a(Fe, {}),
1057
1057
  /* @__PURE__ */ a("span", { children: n }),
1058
- /* @__PURE__ */ a(Bt, { value: r, t })
1058
+ /* @__PURE__ */ a(Oe, { value: r, t: e })
1059
1059
  ]
1060
1060
  }
1061
1061
  );
1062
1062
  }
1063
- function Ot() {
1063
+ function Fe() {
1064
1064
  return /* @__PURE__ */ a(
1065
1065
  "svg",
1066
1066
  {
@@ -1079,39 +1079,39 @@ function Ot() {
1079
1079
  }
1080
1080
  );
1081
1081
  }
1082
- const mt = 3, bt = 200, xt = 5e3, it = 5, Se = 10 * 1024 * 1024, yt = ["image/jpeg", "image/png", "image/webp"], Ce = /.+@.+\..+/;
1083
- function Ie({ client: e, authSession: t, origin: r, onBack: i }) {
1084
- const { t: n } = k(), o = t?.user.email ?? "", s = o || null, [c, l] = x(o), [f, u] = x(""), [h, p] = x(""), [_, y] = x([]), [S, g] = x(!1), [v, C] = x(null), [I, A] = x({}), E = () => {
1085
- const j = {}, M = (s ?? c).trim(), D = f.trim(), U = h.trim();
1086
- return M ? Ce.test(M.toLowerCase()) || (j.email = n("support.invalid_email", "Invalid email")) : j.email = n("support.required", "Required"), (D.length < mt || D.length > bt) && (j.subject = n("support.subject_length", "{min}–{max} characters", {
1087
- min: mt,
1088
- max: bt
1089
- })), (U.length < 1 || U.length > xt) && (j.message = n("support.message_length", "{min}–{max} characters", {
1082
+ const be = 3, ye = 200, xe = 5e3, ne = 5, Ct = 10 * 1024 * 1024, ve = ["image/jpeg", "image/png", "image/webp"], It = /.+@.+\..+/;
1083
+ function At({ client: t, authSession: e, origin: r, onBack: i }) {
1084
+ const { t: n } = S(), s = e?.user.email ?? "", o = s || null, [c, l] = v(s), [p, u] = v(""), [f, _] = v(""), [h, k] = v([]), [w, A] = v(!1), [b, m] = v(null), [C, I] = v({}), B = () => {
1085
+ const P = {}, T = (o ?? c).trim(), U = p.trim(), D = f.trim();
1086
+ return T ? It.test(T.toLowerCase()) || (P.email = n("support.invalid_email", "Invalid email")) : P.email = n("support.required", "Required"), (U.length < be || U.length > ye) && (P.subject = n("support.subject_length", "{min}–{max} characters", {
1087
+ min: be,
1088
+ max: ye
1089
+ })), (D.length < 1 || D.length > xe) && (P.message = n("support.message_length", "{min}–{max} characters", {
1090
1090
  min: 1,
1091
- max: xt
1092
- })), A(j), Object.keys(j).length === 0;
1093
- }, P = async (j) => {
1094
- if (j.preventDefault(), !S && E()) {
1095
- g(!0), A((M) => ({ ...M, submit: void 0 }));
1091
+ max: xe
1092
+ })), I(P), Object.keys(P).length === 0;
1093
+ }, M = async (P) => {
1094
+ if (P.preventDefault(), !w && B()) {
1095
+ A(!0), I((T) => ({ ...T, submit: void 0 }));
1096
1096
  try {
1097
- const M = (s ?? c).trim();
1098
- await e.createSupportTicket({
1099
- subject: f.trim(),
1100
- content: h.trim(),
1101
- email: M || void 0,
1102
- files: _.length > 0 ? _ : void 0
1103
- }), C(M);
1104
- } catch (M) {
1105
- const D = M instanceof O && M.message || "Failed to send. Please try again.";
1106
- A((U) => ({ ...U, submit: D }));
1097
+ const T = (o ?? c).trim();
1098
+ await t.createSupportTicket({
1099
+ subject: p.trim(),
1100
+ content: f.trim(),
1101
+ email: T || void 0,
1102
+ files: h.length > 0 ? h : void 0
1103
+ }), m(T);
1104
+ } catch (T) {
1105
+ const U = T instanceof L && T.message || "Failed to send. Please try again.";
1106
+ I((D) => ({ ...D, submit: U }));
1107
1107
  } finally {
1108
- g(!1);
1108
+ A(!1);
1109
1109
  }
1110
1110
  }
1111
1111
  }, z = () => {
1112
- u(""), p(""), y([]), A({}), C(null);
1113
- }, B = "flex flex-col gap-3 bg-white px-6 pb-6 pt-3 sm:px-8", R = { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" };
1114
- return v ? /* @__PURE__ */ d("div", { class: "relative flex-1 min-h-0 flex flex-col", children: [
1112
+ u(""), _(""), k([]), I({}), m(null);
1113
+ }, O = "flex flex-col gap-3 bg-white px-6 pb-6 pt-3 sm:px-8", R = { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" };
1114
+ return b ? /* @__PURE__ */ d("div", { class: "relative flex-1 min-h-0 flex flex-col", children: [
1115
1115
  /* @__PURE__ */ d("div", { class: "flex-1 min-h-0 overflow-y-auto flex flex-col items-center gap-4 px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8 text-center", children: [
1116
1116
  /* @__PURE__ */ a(
1117
1117
  "div",
@@ -1139,11 +1139,11 @@ function Ie({ client: e, authSession: t, origin: r, onBack: i }) {
1139
1139
  "We've received your message and will respond to"
1140
1140
  ),
1141
1141
  " ",
1142
- /* @__PURE__ */ a("b", { class: "text-gray-700", children: v }),
1142
+ /* @__PURE__ */ a("b", { class: "text-gray-700", children: b }),
1143
1143
  "."
1144
1144
  ] })
1145
1145
  ] }),
1146
- /* @__PURE__ */ a("div", { class: B, style: R, children: /* @__PURE__ */ d("div", { class: "flex items-center justify-center gap-3", children: [
1146
+ /* @__PURE__ */ a("div", { class: O, style: R, children: /* @__PURE__ */ d("div", { class: "flex items-center justify-center gap-3", children: [
1147
1147
  /* @__PURE__ */ a(
1148
1148
  "button",
1149
1149
  {
@@ -1167,63 +1167,63 @@ function Ie({ client: e, authSession: t, origin: r, onBack: i }) {
1167
1167
  }
1168
1168
  )
1169
1169
  ] }) })
1170
- ] }) : /* @__PURE__ */ d("form", { onSubmit: P, class: "relative flex-1 min-h-0 flex flex-col", children: [
1171
- /* @__PURE__ */ a(Ae, { onClick: i, ariaLabel: n("nav.back_aria", "Back") }),
1170
+ ] }) : /* @__PURE__ */ d("form", { onSubmit: M, class: "relative flex-1 min-h-0 flex flex-col", children: [
1171
+ /* @__PURE__ */ a(Mt, { onClick: i, ariaLabel: n("nav.back_aria", "Back") }),
1172
1172
  /* @__PURE__ */ a("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__ */ d("div", { class: "flex flex-col gap-5", children: [
1173
1173
  /* @__PURE__ */ d("div", { class: "flex flex-col gap-2 pr-10", children: [
1174
1174
  /* @__PURE__ */ a("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: n("support.heading", "Support") }),
1175
1175
  /* @__PURE__ */ a("p", { class: "text-base leading-relaxed text-gray-600", children: n("support.instruction", "Please fill out the form below to submit your support request.") })
1176
1176
  ] }),
1177
1177
  /* @__PURE__ */ d("div", { class: "flex flex-col gap-3", children: [
1178
- s ? /* @__PURE__ */ d("div", { class: "rounded-2xl bg-gray-100 px-5 py-3 text-sm text-gray-600", children: [
1178
+ o ? /* @__PURE__ */ d("div", { class: "rounded-2xl bg-gray-100 px-5 py-3 text-sm text-gray-600", children: [
1179
1179
  n("support.sending_as", "Sending as"),
1180
1180
  " ",
1181
- /* @__PURE__ */ a("b", { class: "font-medium text-gray-900", children: s })
1181
+ /* @__PURE__ */ a("b", { class: "font-medium text-gray-900", children: o })
1182
1182
  ] }) : /* @__PURE__ */ a(
1183
- vt,
1183
+ ke,
1184
1184
  {
1185
1185
  type: "email",
1186
1186
  placeholder: n("support.email_placeholder", "Enter your email *"),
1187
1187
  value: c,
1188
1188
  onInput: l,
1189
- error: I.email,
1189
+ error: C.email,
1190
1190
  autocomplete: "email",
1191
1191
  required: !0
1192
1192
  }
1193
1193
  ),
1194
1194
  /* @__PURE__ */ a(
1195
- vt,
1195
+ ke,
1196
1196
  {
1197
1197
  type: "text",
1198
1198
  placeholder: n("support.subject_placeholder", "Enter your subject *"),
1199
- value: f,
1199
+ value: p,
1200
1200
  onInput: u,
1201
- error: I.subject,
1201
+ error: C.subject,
1202
1202
  required: !0
1203
1203
  }
1204
1204
  ),
1205
1205
  /* @__PURE__ */ a(
1206
- Me,
1206
+ Lt,
1207
1207
  {
1208
1208
  placeholder: n("support.message_placeholder", "Enter your message *"),
1209
- value: h,
1210
- onInput: p,
1211
- error: I.message,
1209
+ value: f,
1210
+ onInput: _,
1211
+ error: C.message,
1212
1212
  required: !0
1213
1213
  }
1214
1214
  ),
1215
- /* @__PURE__ */ a(Le, { files: _, onChange: y, disabled: S })
1215
+ /* @__PURE__ */ a(Tt, { files: h, onChange: k, disabled: w })
1216
1216
  ] })
1217
1217
  ] }) }),
1218
- /* @__PURE__ */ d("div", { class: B, style: R, children: [
1219
- I.submit && /* @__PURE__ */ a("p", { class: "text-sm text-red-600", children: I.submit }),
1218
+ /* @__PURE__ */ d("div", { class: O, style: R, children: [
1219
+ C.submit && /* @__PURE__ */ a("p", { class: "text-sm text-red-600", children: C.submit }),
1220
1220
  /* @__PURE__ */ d("div", { class: "flex items-center justify-end gap-3", children: [
1221
1221
  /* @__PURE__ */ a(
1222
1222
  "button",
1223
1223
  {
1224
1224
  type: "button",
1225
1225
  onClick: i,
1226
- disabled: S,
1226
+ disabled: w,
1227
1227
  class: "rounded-full px-4 py-2 text-base font-medium text-gray-700 transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
1228
1228
  children: r === "standalone" ? n("support.close_button", "Close") : n("nav.back_aria", "Back")
1229
1229
  }
@@ -1232,26 +1232,26 @@ function Ie({ client: e, authSession: t, origin: r, onBack: i }) {
1232
1232
  "button",
1233
1233
  {
1234
1234
  type: "submit",
1235
- disabled: S,
1235
+ disabled: w,
1236
1236
  class: "pw-cta-shimmer relative flex h-12 items-center justify-center overflow-hidden rounded-full px-8 text-base font-semibold text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
1237
1237
  style: {
1238
1238
  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%)",
1239
1239
  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)"
1240
1240
  },
1241
- children: S ? /* @__PURE__ */ a("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ a("span", { class: "relative z-10", children: n("support.send_button", "Send") })
1241
+ children: w ? /* @__PURE__ */ a("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ a("span", { class: "relative z-10", children: n("support.send_button", "Send") })
1242
1242
  }
1243
1243
  )
1244
1244
  ] })
1245
1245
  ] })
1246
1246
  ] });
1247
1247
  }
1248
- function Ae({ onClick: e, ariaLabel: t }) {
1248
+ function Mt({ onClick: t, ariaLabel: e }) {
1249
1249
  return /* @__PURE__ */ a(
1250
1250
  "button",
1251
1251
  {
1252
1252
  type: "button",
1253
- onClick: e,
1254
- "aria-label": t,
1253
+ onClick: t,
1254
+ "aria-label": e,
1255
1255
  class: "absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
1256
1256
  children: /* @__PURE__ */ d("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
1257
1257
  /* @__PURE__ */ a(
@@ -1278,34 +1278,34 @@ function Ae({ onClick: e, ariaLabel: t }) {
1278
1278
  }
1279
1279
  );
1280
1280
  }
1281
- function vt({
1282
- type: e,
1283
- placeholder: t,
1281
+ function ke({
1282
+ type: t,
1283
+ placeholder: e,
1284
1284
  value: r,
1285
1285
  onInput: i,
1286
1286
  error: n,
1287
- autocomplete: o,
1288
- required: s
1287
+ autocomplete: s,
1288
+ required: o
1289
1289
  }) {
1290
1290
  return /* @__PURE__ */ d("div", { children: [
1291
1291
  /* @__PURE__ */ a(
1292
1292
  "input",
1293
1293
  {
1294
- type: e,
1294
+ type: t,
1295
1295
  value: r,
1296
- placeholder: t,
1296
+ placeholder: e,
1297
1297
  onInput: (c) => i(c.target.value),
1298
- autocomplete: o,
1299
- required: s,
1298
+ autocomplete: s,
1299
+ required: o,
1300
1300
  class: `h-14 w-full rounded-2xl bg-gray-100 px-5 text-base text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 ${n ? "shadow-[0_0_0_2px_rgba(239,68,68,0.5)]" : "focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"}`
1301
1301
  }
1302
1302
  ),
1303
1303
  n && /* @__PURE__ */ a("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: n })
1304
1304
  ] });
1305
1305
  }
1306
- function Me({
1307
- placeholder: e,
1308
- value: t,
1306
+ function Lt({
1307
+ placeholder: t,
1308
+ value: e,
1309
1309
  onInput: r,
1310
1310
  error: i,
1311
1311
  required: n
@@ -1314,9 +1314,9 @@ function Me({
1314
1314
  /* @__PURE__ */ a(
1315
1315
  "textarea",
1316
1316
  {
1317
- value: t,
1318
- placeholder: e,
1319
- onInput: (o) => r(o.target.value),
1317
+ value: e,
1318
+ placeholder: t,
1319
+ onInput: (s) => r(s.target.value),
1320
1320
  required: n,
1321
1321
  rows: 5,
1322
1322
  class: `min-h-[120px] w-full rounded-2xl bg-gray-100 px-5 py-3.5 text-base leading-relaxed text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 ${i ? "shadow-[0_0_0_2px_rgba(239,68,68,0.5)]" : "focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"}`
@@ -1325,23 +1325,23 @@ function Me({
1325
1325
  i && /* @__PURE__ */ a("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: i })
1326
1326
  ] });
1327
1327
  }
1328
- function Le({ files: e, onChange: t, disabled: r }) {
1329
- const { t: i } = k(), n = F(null), [o, s] = x(!1), [c, l] = x(null), f = (u) => {
1328
+ function Tt({ files: t, onChange: e, disabled: r }) {
1329
+ const { t: i } = S(), n = F(null), [s, o] = v(!1), [c, l] = v(null), p = (u) => {
1330
1330
  if (!u || r) return;
1331
1331
  l(null);
1332
- const h = Array.from(u);
1333
- if (e.length + h.length > it) {
1334
- l(i("support.too_many_files", "Up to {max} files", { max: it }));
1332
+ const f = Array.from(u);
1333
+ if (t.length + f.length > ne) {
1334
+ l(i("support.too_many_files", "Up to {max} files", { max: ne }));
1335
1335
  return;
1336
1336
  }
1337
- const p = h.filter(
1338
- (_) => yt.includes(_.type) && _.size <= Se
1337
+ const _ = f.filter(
1338
+ (h) => ve.includes(h.type) && h.size <= Ct
1339
1339
  );
1340
- if (p.length !== h.length) {
1340
+ if (_.length !== f.length) {
1341
1341
  l(i("support.invalid_file", "Only JPEG/PNG/WebP, ≤ 10MB each"));
1342
1342
  return;
1343
1343
  }
1344
- t([...e, ...p]);
1344
+ e([...t, ..._]);
1345
1345
  };
1346
1346
  return /* @__PURE__ */ d("div", { children: [
1347
1347
  /* @__PURE__ */ a("span", { class: "text-xs font-medium text-gray-700", children: i("support.attachments_label", "Attachments (optional)") }),
@@ -1353,17 +1353,17 @@ function Le({ files: e, onChange: t, disabled: r }) {
1353
1353
  "aria-label": i("support.attachments_aria", "Attachments upload"),
1354
1354
  onClick: () => !r && n.current?.click(),
1355
1355
  onDragOver: (u) => {
1356
- u.preventDefault(), r || s(!0);
1356
+ u.preventDefault(), r || o(!0);
1357
1357
  },
1358
- onDragLeave: () => s(!1),
1358
+ onDragLeave: () => o(!1),
1359
1359
  onDrop: (u) => {
1360
- u.preventDefault(), s(!1), f(u.dataTransfer?.files ?? null);
1360
+ u.preventDefault(), o(!1), p(u.dataTransfer?.files ?? null);
1361
1361
  },
1362
- class: `mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${o ? "border-[var(--pw-accent)] bg-[color-mix(in_srgb,var(--pw-accent)_6%,white)]" : "border-gray-300 hover:border-gray-400 hover:bg-gray-50/60"} ${r ? "cursor-not-allowed opacity-60" : ""}`,
1362
+ class: `mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${s ? "border-[var(--pw-accent)] bg-[color-mix(in_srgb,var(--pw-accent)_6%,white)]" : "border-gray-300 hover:border-gray-400 hover:bg-gray-50/60"} ${r ? "cursor-not-allowed opacity-60" : ""}`,
1363
1363
  children: [
1364
1364
  /* @__PURE__ */ a("div", { class: "text-xs text-gray-500", children: i("support.dropzone_text", "Drop images here or click to select") }),
1365
1365
  /* @__PURE__ */ a("div", { class: "mt-0.5 text-[11px] text-gray-400", children: i("support.file_requirements", "JPEG/PNG/WebP, up to {max} files, ≤ 10MB each", {
1366
- max: it
1366
+ max: ne
1367
1367
  }) })
1368
1368
  ]
1369
1369
  }
@@ -1374,15 +1374,15 @@ function Le({ files: e, onChange: t, disabled: r }) {
1374
1374
  ref: n,
1375
1375
  type: "file",
1376
1376
  multiple: !0,
1377
- accept: yt.join(","),
1377
+ accept: ve.join(","),
1378
1378
  class: "hidden",
1379
1379
  onChange: (u) => {
1380
- f(u.target.files), u.currentTarget.value = "";
1380
+ p(u.target.files), u.currentTarget.value = "";
1381
1381
  }
1382
1382
  }
1383
1383
  ),
1384
1384
  c && /* @__PURE__ */ a("p", { class: "mt-1 text-xs text-red-600", children: c }),
1385
- e.length > 0 && /* @__PURE__ */ a("ul", { class: "mt-2 flex flex-col gap-1", children: e.map((u, h) => /* @__PURE__ */ d(
1385
+ t.length > 0 && /* @__PURE__ */ a("ul", { class: "mt-2 flex flex-col gap-1", children: t.map((u, f) => /* @__PURE__ */ d(
1386
1386
  "li",
1387
1387
  {
1388
1388
  class: "flex items-center justify-between gap-2 rounded bg-gray-50 px-2 py-1 text-xs",
@@ -1393,8 +1393,8 @@ function Le({ files: e, onChange: t, disabled: r }) {
1393
1393
  {
1394
1394
  type: "button",
1395
1395
  onClick: () => {
1396
- const p = [...e];
1397
- p.splice(h, 1), t(p);
1396
+ const _ = [...t];
1397
+ _.splice(f, 1), e(_);
1398
1398
  },
1399
1399
  disabled: r,
1400
1400
  class: "text-gray-500 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-60",
@@ -1404,48 +1404,48 @@ function Le({ files: e, onChange: t, disabled: r }) {
1404
1404
  )
1405
1405
  ]
1406
1406
  },
1407
- `${u.name}-${u.size}-${h}`
1407
+ `${u.name}-${u.size}-${f}`
1408
1408
  )) })
1409
1409
  ] });
1410
1410
  }
1411
- const Pe = {
1411
+ const Pt = {
1412
1412
  day: "cta.get_plan_daily",
1413
1413
  week: "cta.get_plan_weekly",
1414
1414
  month: "cta.get_plan_monthly",
1415
1415
  year: "cta.get_plan_yearly"
1416
- }, Te = {
1416
+ }, Et = {
1417
1417
  day: "Get Daily Plan",
1418
1418
  week: "Get Weekly Plan",
1419
1419
  month: "Get Monthly Plan",
1420
1420
  year: "Get Yearly Plan"
1421
1421
  };
1422
- function Ee(e, t, r, i) {
1423
- if (t === "close") return i("cta.close", "Close");
1424
- if (!e) return i("cta.continue", "Continue");
1425
- if (!r && e.trial_days && e.interval && e.interval !== "lifetime")
1426
- return i("cta.start_trial", "Start {days}-Day Free Trial", { days: e.trial_days });
1427
- if (!e.interval || e.interval === "lifetime")
1422
+ function jt(t, e, r, i) {
1423
+ if (e === "close") return i("cta.close", "Close");
1424
+ if (!t) return i("cta.continue", "Continue");
1425
+ if (!r && t.trial_days && t.interval && t.interval !== "lifetime")
1426
+ return i("cta.start_trial", "Start {days}-Day Free Trial", { days: t.trial_days });
1427
+ if (!t.interval || t.interval === "lifetime")
1428
1428
  return i("cta.get_lifetime_access", "Get Lifetime Access");
1429
- const n = Pe[e.interval];
1430
- return n ? i(n, Te[e.interval]) : i("cta.get_plan_generic", "Get {interval} Plan", {
1431
- interval: je(e.interval)
1429
+ const n = Pt[t.interval];
1430
+ return n ? i(n, Et[t.interval]) : i("cta.get_plan_generic", "Get {interval} Plan", {
1431
+ interval: zt(t.interval)
1432
1432
  });
1433
1433
  }
1434
- function je(e) {
1435
- return e.length ? e[0].toUpperCase() + e.slice(1) : e;
1434
+ function zt(t) {
1435
+ return t.length ? t[0].toUpperCase() + t.slice(1) : t;
1436
1436
  }
1437
- function ze({ block: e, ctx: t }) {
1438
- const { t: r } = k(), [i, n] = x(!1), o = e.priceId ?? t.selectedPriceId, s = i || e.action === "checkout" && !o, c = o ? t.bootstrap.prices.find((h) => h.id === o) ?? null : null, l = t.bootstrap.user?.had_previous_trial ?? !1, f = e.label ?? Ee(c, e.action, l, r);
1437
+ function Bt({ block: t, ctx: e }) {
1438
+ const { t: r } = S(), [i, n] = v(!1), s = t.priceId ?? e.selectedPriceId, o = i || t.action === "checkout" && !s, c = s ? e.bootstrap.prices.find((f) => f.id === s) ?? null : null, l = e.bootstrap.user?.had_previous_trial ?? !1, p = t.label ?? jt(c, t.action, l, r);
1439
1439
  return /* @__PURE__ */ d(
1440
1440
  "button",
1441
1441
  {
1442
1442
  type: "button",
1443
- disabled: s,
1443
+ disabled: o,
1444
1444
  onClick: async () => {
1445
- if (!s) {
1445
+ if (!o) {
1446
1446
  n(!0);
1447
1447
  try {
1448
- await t.onAction(e.action, { priceId: o });
1448
+ await e.onAction(t.action, { priceId: s });
1449
1449
  } finally {
1450
1450
  n(!1);
1451
1451
  }
@@ -1467,66 +1467,66 @@ function ze({ block: e, ctx: t }) {
1467
1467
  "aria-hidden": "true"
1468
1468
  }
1469
1469
  ),
1470
- i ? /* @__PURE__ */ a("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ a("span", { class: "relative z-10", children: f })
1470
+ i ? /* @__PURE__ */ a("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ a("span", { class: "relative z-10", children: p })
1471
1471
  ]
1472
1472
  }
1473
1473
  );
1474
1474
  }
1475
- function Be({ ctx: e }) {
1476
- const { t } = k(), r = e.authSession, i = e.auth, [n, o] = x(!1), s = () => e.onAction("support");
1475
+ function Ot({ ctx: t }) {
1476
+ const { t: e } = S(), r = t.authSession, i = t.auth, [n, s] = v(!1), o = () => t.onAction("support");
1477
1477
  if (r && !r.user.is_anonymous) {
1478
1478
  const c = async () => {
1479
1479
  if (!(!i || n)) {
1480
- o(!0);
1480
+ s(!0);
1481
1481
  try {
1482
1482
  await i.signOut();
1483
1483
  } catch {
1484
1484
  } finally {
1485
- o(!1);
1485
+ s(!1);
1486
1486
  }
1487
1487
  }
1488
1488
  };
1489
1489
  return /* @__PURE__ */ d("div", { class: "-mt-3 flex flex-col items-center gap-1.5 pt-1 text-center text-[13px] text-gray-500", children: [
1490
1490
  /* @__PURE__ */ d("span", { children: [
1491
- t("session.signed_in_as_prefix", "Signed in as"),
1491
+ e("session.signed_in_as_prefix", "Signed in as"),
1492
1492
  " ",
1493
1493
  /* @__PURE__ */ a("b", { class: "font-medium text-gray-700", children: r.user.email })
1494
1494
  ] }),
1495
1495
  /* @__PURE__ */ d("div", { class: "flex items-center justify-center gap-3", children: [
1496
- /* @__PURE__ */ a(q, { onClick: c, disabled: !i || n, children: n ? t("session.signing_out", "Signing out…") : t("session.sign_out", "Sign Out") }),
1497
- /* @__PURE__ */ a(kt, {}),
1498
- /* @__PURE__ */ a(q, { onClick: s, children: t("session.contact_support", "Contact Support") })
1496
+ /* @__PURE__ */ a(G, { onClick: c, disabled: !i || n, children: n ? e("session.signing_out", "Signing out…") : e("session.sign_out", "Sign Out") }),
1497
+ /* @__PURE__ */ a(_e, {}),
1498
+ /* @__PURE__ */ a(G, { onClick: o, children: e("session.contact_support", "Contact Support") })
1499
1499
  ] })
1500
1500
  ] });
1501
1501
  }
1502
1502
  return /* @__PURE__ */ d("div", { class: "-mt-3 flex items-center justify-center gap-3 pt-1 text-center text-[13px]", children: [
1503
- /* @__PURE__ */ a(q, { onClick: () => e.onAction("restore"), children: t("session.restore_purchases", "Restore purchases") }),
1504
- /* @__PURE__ */ a(kt, {}),
1505
- /* @__PURE__ */ a(q, { onClick: s, children: t("session.contact_support", "Contact Support") })
1503
+ /* @__PURE__ */ a(G, { onClick: () => t.onAction("restore"), children: e("session.restore_purchases", "Restore purchases") }),
1504
+ /* @__PURE__ */ a(_e, {}),
1505
+ /* @__PURE__ */ a(G, { onClick: o, children: e("session.contact_support", "Contact Support") })
1506
1506
  ] });
1507
1507
  }
1508
- function q({
1509
- onClick: e,
1510
- disabled: t,
1508
+ function G({
1509
+ onClick: t,
1510
+ disabled: e,
1511
1511
  children: r
1512
1512
  }) {
1513
1513
  return /* @__PURE__ */ a(
1514
1514
  "button",
1515
1515
  {
1516
1516
  type: "button",
1517
- onClick: e,
1518
- disabled: t,
1517
+ onClick: t,
1518
+ disabled: e,
1519
1519
  class: "font-semibold transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:opacity-80",
1520
1520
  style: { color: "var(--pw-accent)" },
1521
1521
  children: r
1522
1522
  }
1523
1523
  );
1524
1524
  }
1525
- function kt() {
1525
+ function _e() {
1526
1526
  return /* @__PURE__ */ a("span", { class: "h-1 w-1 rounded-full bg-gray-300", "aria-hidden": "true" });
1527
1527
  }
1528
- function Oe({ block: e }) {
1529
- return e.items.length ? /* @__PURE__ */ a("ul", { class: "flex flex-col gap-2.5", role: "list", children: e.items.map((t) => /* @__PURE__ */ d("li", { class: "flex items-start gap-3 text-sm text-gray-700", children: [
1528
+ function Ft({ block: t }) {
1529
+ return t.items.length ? /* @__PURE__ */ a("ul", { class: "flex flex-col gap-2.5", role: "list", children: t.items.map((e) => /* @__PURE__ */ d("li", { class: "flex items-start gap-3 text-sm text-gray-700", children: [
1530
1530
  /* @__PURE__ */ a(
1531
1531
  "svg",
1532
1532
  {
@@ -1549,30 +1549,30 @@ function Oe({ block: e }) {
1549
1549
  }
1550
1550
  ),
1551
1551
  /* @__PURE__ */ d("div", { class: "flex flex-col gap-0.5", children: [
1552
- /* @__PURE__ */ a("span", { class: "font-medium leading-snug text-gray-900", children: t.name }),
1553
- t.desc ? /* @__PURE__ */ a("span", { class: "text-xs leading-relaxed text-gray-400", children: t.desc }) : null
1552
+ /* @__PURE__ */ a("span", { class: "font-medium leading-snug text-gray-900", children: e.name }),
1553
+ e.desc ? /* @__PURE__ */ a("span", { class: "text-xs leading-relaxed text-gray-400", children: e.desc }) : null
1554
1554
  ] })
1555
- ] }, t.id)) }) : null;
1555
+ ] }, e.id)) }) : null;
1556
1556
  }
1557
- function Fe({ block: e }) {
1558
- const { t } = k(), r = e.title ?? t("pricing.money_back", "30-day money-back guarantee"), i = e.subtitle, n = (e.icon ?? "dollar_shield") !== "none", o = Re(r);
1557
+ function Rt({ block: t }) {
1558
+ const { t: e } = S(), r = t.title ?? e("pricing.money_back", "30-day money-back guarantee"), i = t.subtitle, n = (t.icon ?? "dollar_shield") !== "none", s = Ut(r);
1559
1559
  return /* @__PURE__ */ d("div", { class: "flex flex-col items-center gap-1.5 border-b-1 pb-4 mb-1 border-gray-100", children: [
1560
1560
  /* @__PURE__ */ d("div", { class: "inline-flex items-center gap-2 text-[12px] text-gray-700", children: [
1561
- n ? /* @__PURE__ */ a(Ue, {}) : null,
1562
- o ? /* @__PURE__ */ d("span", { children: [
1563
- /* @__PURE__ */ a("b", { class: "font-bold text-gray-900", children: o.bold }),
1561
+ n ? /* @__PURE__ */ a(Dt, {}) : null,
1562
+ s ? /* @__PURE__ */ d("span", { children: [
1563
+ /* @__PURE__ */ a("b", { class: "font-bold text-gray-900", children: s.bold }),
1564
1564
  " ",
1565
- /* @__PURE__ */ a("span", { class: "font-medium", children: o.rest })
1565
+ /* @__PURE__ */ a("span", { class: "font-medium", children: s.rest })
1566
1566
  ] }) : /* @__PURE__ */ a("span", { class: "font-medium", children: r })
1567
1567
  ] }),
1568
1568
  i ? /* @__PURE__ */ a("span", { class: "text-center text-xs leading-relaxed text-gray-500", children: i }) : null
1569
1569
  ] });
1570
1570
  }
1571
- function Re(e) {
1572
- const t = e.match(/^(\d+[-\s]?days?)\s+(.+)$/i);
1573
- return t ? { bold: t[1], rest: t[2] } : null;
1571
+ function Ut(t) {
1572
+ const e = t.match(/^(\d+[-\s]?days?)\s+(.+)$/i);
1573
+ return e ? { bold: e[1], rest: e[2] } : null;
1574
1574
  }
1575
- function Ue() {
1575
+ function Dt() {
1576
1576
  return /* @__PURE__ */ d(
1577
1577
  "svg",
1578
1578
  {
@@ -1607,131 +1607,131 @@ function Ue() {
1607
1607
  }
1608
1608
  );
1609
1609
  }
1610
- const Ft = 24, De = 16, Ne = 2;
1611
- function $e(e, t) {
1612
- const r = t * Ne;
1613
- let i = Ft;
1614
- for (e.style.fontSize = `${i}px`; e.scrollHeight > r && i > De; )
1615
- i -= 1, e.style.fontSize = `${i}px`;
1616
- }
1617
- function He({ block: e, ctx: t }) {
1618
- const r = e.level ?? 1, i = `h${r}`, n = r === 1 ? "text-[22px] sm:text-2xl font-semibold leading-tight text-center text-balance text-gray-800" : r === 2 ? "text-xl font-semibold leading-snug text-gray-900 tracking-tight" : "text-base font-medium text-gray-900", o = F(null), s = r === 1 && !!t.bootstrap.settings.title_auto_fit;
1619
- return T(() => {
1620
- if (!s || !o.current) return;
1621
- const c = getComputedStyle(o.current), l = parseFloat(c.lineHeight) || Ft * 1.5;
1622
- $e(o.current, l);
1623
- }, [s, e.text]), /* @__PURE__ */ a(i, { ref: o, class: n, children: e.text });
1624
- }
1625
- function Ve(e) {
1626
- const t = e.local ?? { currency: e.currency, amount: e.amount };
1627
- if (e.interval === "year") {
1628
- const r = (e.interval_count ?? 1) * 12;
1629
- return { amount: t.amount / r, currency: t.currency };
1630
- }
1631
- return { amount: t.amount, currency: t.currency };
1632
- }
1633
- function nt(e, t) {
1634
- const r = e % 1 !== 0 ? 2 : 0;
1610
+ const Re = 24, Nt = 16, Ht = 2;
1611
+ function $t(t, e) {
1612
+ const r = e * Ht;
1613
+ let i = Re;
1614
+ for (t.style.fontSize = `${i}px`; t.scrollHeight > r && i > Nt; )
1615
+ i -= 1, t.style.fontSize = `${i}px`;
1616
+ }
1617
+ function Vt({ block: t, ctx: e }) {
1618
+ const r = t.level ?? 1, i = `h${r}`, n = r === 1 ? "text-[22px] sm:text-2xl font-semibold leading-tight text-center text-balance text-gray-800" : r === 2 ? "text-xl font-semibold leading-snug text-gray-900 tracking-tight" : "text-base font-medium text-gray-900", s = F(null), o = r === 1 && !!e.bootstrap.settings.title_auto_fit;
1619
+ return j(() => {
1620
+ if (!o || !s.current) return;
1621
+ const c = getComputedStyle(s.current), l = parseFloat(c.lineHeight) || Re * 1.5;
1622
+ $t(s.current, l);
1623
+ }, [o, t.text]), /* @__PURE__ */ a(i, { ref: s, class: n, children: t.text });
1624
+ }
1625
+ function qt(t) {
1626
+ const e = t.local ?? { currency: t.currency, amount: t.amount };
1627
+ if (t.interval === "year") {
1628
+ const r = (t.interval_count ?? 1) * 12;
1629
+ return { amount: e.amount / r, currency: e.currency };
1630
+ }
1631
+ return { amount: e.amount, currency: e.currency };
1632
+ }
1633
+ function ae(t, e) {
1634
+ const r = t % 1 !== 0 ? 2 : 0;
1635
1635
  try {
1636
1636
  const i = new Intl.NumberFormat(void 0, {
1637
1637
  style: "currency",
1638
- currency: t,
1638
+ currency: e,
1639
1639
  currencyDisplay: "narrowSymbol",
1640
1640
  maximumFractionDigits: r,
1641
1641
  minimumFractionDigits: r
1642
- }).formatToParts(e);
1643
- let n = "", o = "";
1644
- for (const s of i)
1645
- s.type === "currency" ? n = s.value : s.type !== "literal" && (o += s.value);
1646
- return { currency: n || t, amount: o.trim() };
1642
+ }).formatToParts(t);
1643
+ let n = "", s = "";
1644
+ for (const o of i)
1645
+ o.type === "currency" ? n = o.value : o.type !== "literal" && (s += o.value);
1646
+ return { currency: n || e, amount: s.trim() };
1647
1647
  } catch {
1648
- return { currency: t, amount: String(e) };
1648
+ return { currency: e, amount: String(t) };
1649
1649
  }
1650
1650
  }
1651
- function st(e, t) {
1652
- const { amount: r, currency: i } = Ve(e);
1653
- if (!t) {
1654
- const { currency: c, amount: l } = nt(r, i);
1651
+ function le(t, e) {
1652
+ const { amount: r, currency: i } = qt(t);
1653
+ if (!e) {
1654
+ const { currency: c, amount: l } = ae(r, i);
1655
1655
  return { currency: c, amount: l, originalAmount: null };
1656
1656
  }
1657
- const n = r * (1 - t / 100), o = nt(n, i), s = nt(r, i);
1657
+ const n = r * (1 - e / 100), s = ae(n, i), o = ae(r, i);
1658
1658
  return {
1659
- currency: o.currency,
1660
- amount: o.amount,
1661
- originalAmount: `${s.currency}${s.amount}`
1659
+ currency: s.currency,
1660
+ amount: s.amount,
1661
+ originalAmount: `${o.currency}${o.amount}`
1662
1662
  };
1663
1663
  }
1664
- function Rt(e, t) {
1665
- if (e.label) return e.label.toUpperCase();
1666
- if (!e.interval || e.interval === "lifetime")
1667
- return t("pricing.plan_label.lifetime", "LIFETIME");
1664
+ function Ue(t, e) {
1665
+ if (t.label) return t.label.toUpperCase();
1666
+ if (!t.interval || t.interval === "lifetime")
1667
+ return e("pricing.plan_label.lifetime", "LIFETIME");
1668
1668
  const i = {
1669
1669
  day: { key: "pricing.plan_label.daily", fallback: "DAILY PLAN" },
1670
1670
  week: { key: "pricing.plan_label.weekly", fallback: "WEEKLY PLAN" },
1671
1671
  month: { key: "pricing.plan_label.monthly", fallback: "MONTHLY PLAN" },
1672
1672
  year: { key: "pricing.plan_label.yearly", fallback: "YEARLY PLAN" }
1673
- }[e.interval];
1674
- return i ? t(i.key, i.fallback) : `${e.interval.toUpperCase()} PLAN`;
1675
- }
1676
- function lt(e, t) {
1677
- if (!e.interval || e.interval === "lifetime")
1678
- return t("pricing.interval.lifetime_short", "lifetime");
1679
- if (e.interval === "year") return t("pricing.interval.month", "month");
1680
- const r = e.interval_count ?? 1;
1681
- return r === 1 ? t(`pricing.interval.${e.interval}`, e.interval) : `${r} ${e.interval}s`;
1682
- }
1683
- function Ge({ block: e, ctx: t }) {
1684
- const { t: r } = k(), i = e.priceIds && e.priceIds.length > 0 ? new Set(e.priceIds) : null, n = t.bootstrap.prices.filter((s) => !i || i.has(s.id));
1673
+ }[t.interval];
1674
+ return i ? e(i.key, i.fallback) : `${t.interval.toUpperCase()} PLAN`;
1675
+ }
1676
+ function ce(t, e) {
1677
+ if (!t.interval || t.interval === "lifetime")
1678
+ return e("pricing.interval.lifetime_short", "lifetime");
1679
+ if (t.interval === "year") return e("pricing.interval.month", "month");
1680
+ const r = t.interval_count ?? 1;
1681
+ return r === 1 ? e(`pricing.interval.${t.interval}`, t.interval) : `${r} ${t.interval}s`;
1682
+ }
1683
+ function Gt({ block: t, ctx: e }) {
1684
+ const { t: r } = S(), i = t.priceIds && t.priceIds.length > 0 ? new Set(t.priceIds) : null, n = e.bootstrap.prices.filter((o) => !i || i.has(o.id));
1685
1685
  if (n.length === 0)
1686
1686
  return /* @__PURE__ */ a("p", { class: "text-sm text-gray-500", children: r("pricing.no_prices", "No prices available.") });
1687
- const o = e.popular_label ?? r("pricing.most_popular", "Most popular");
1688
- if (e.view === "compact")
1687
+ const s = t.popular_label ?? r("pricing.most_popular", "Most popular");
1688
+ if (t.view === "compact")
1689
1689
  return /* @__PURE__ */ a(
1690
1690
  "div",
1691
1691
  {
1692
1692
  class: "flex w-full flex-col rounded-xl border border-gray-200 bg-gray-50",
1693
1693
  role: "radiogroup",
1694
1694
  "aria-label": r("pricing.plans_aria", "Plans"),
1695
- children: n.map((s, c) => /* @__PURE__ */ a(
1696
- We,
1695
+ children: n.map((o, c) => /* @__PURE__ */ a(
1696
+ Zt,
1697
1697
  {
1698
- price: s,
1698
+ price: o,
1699
1699
  isLast: c === n.length - 1,
1700
- isPopular: e.popular_price_id === s.id,
1701
- popularLabel: o,
1702
- offer: H(t.bootstrap.offers, s.id),
1703
- selected: t.selectedPriceId === s.id,
1700
+ isPopular: t.popular_price_id === o.id,
1701
+ popularLabel: s,
1702
+ offer: N(e.bootstrap.offers, o.id),
1703
+ selected: e.selectedPriceId === o.id,
1704
1704
  onSelect: () => {
1705
- t.setSelectedPriceId(s.id), t.onAction("price_selected", { priceId: s.id, price: s });
1705
+ e.setSelectedPriceId(o.id), e.onAction("price_selected", { priceId: o.id, price: o });
1706
1706
  },
1707
1707
  t: r
1708
1708
  },
1709
- s.id
1709
+ o.id
1710
1710
  ))
1711
1711
  }
1712
1712
  );
1713
- if (e.view === "horizontal") {
1714
- const s = Math.min(n.length, 3), c = n.some(
1715
- (l) => (H(t.bootstrap.offers, l.id)?.discount_percent ?? 0) > 0
1713
+ if (t.view === "horizontal") {
1714
+ const o = Math.min(n.length, 3), c = n.some(
1715
+ (l) => (N(e.bootstrap.offers, l.id)?.discount_percent ?? 0) > 0
1716
1716
  );
1717
1717
  return /* @__PURE__ */ a(
1718
1718
  "div",
1719
1719
  {
1720
1720
  class: "grid items-stretch gap-2",
1721
- style: { gridTemplateColumns: `repeat(${s}, minmax(0, 1fr))` },
1721
+ style: { gridTemplateColumns: `repeat(${o}, minmax(0, 1fr))` },
1722
1722
  role: "radiogroup",
1723
1723
  "aria-label": r("pricing.plans_aria", "Plans"),
1724
1724
  children: n.map((l) => /* @__PURE__ */ a(
1725
- Ze,
1725
+ Kt,
1726
1726
  {
1727
1727
  price: l,
1728
- isPopular: e.popular_price_id === l.id,
1729
- popularLabel: o,
1730
- offer: H(t.bootstrap.offers, l.id),
1728
+ isPopular: t.popular_price_id === l.id,
1729
+ popularLabel: s,
1730
+ offer: N(e.bootstrap.offers, l.id),
1731
1731
  reserveStrikeRow: c,
1732
- selected: t.selectedPriceId === l.id,
1732
+ selected: e.selectedPriceId === l.id,
1733
1733
  onSelect: () => {
1734
- t.setSelectedPriceId(l.id), t.onAction("price_selected", { priceId: l.id, price: l });
1734
+ e.setSelectedPriceId(l.id), e.onAction("price_selected", { priceId: l.id, price: l });
1735
1735
  },
1736
1736
  t: r
1737
1737
  },
@@ -1746,8 +1746,8 @@ function Ge({ block: e, ctx: t }) {
1746
1746
  class: "flex flex-col gap-2",
1747
1747
  role: "radiogroup",
1748
1748
  "aria-label": r("pricing.plans_aria", "Plans"),
1749
- children: n.map((s) => {
1750
- const c = t.selectedPriceId === s.id, l = e.popular_price_id === s.id, u = H(t.bootstrap.offers, s.id)?.discount_percent ?? null, { currency: h, amount: p, originalAmount: _ } = st(s, u);
1749
+ children: n.map((o) => {
1750
+ const c = e.selectedPriceId === o.id, l = t.popular_price_id === o.id, u = N(e.bootstrap.offers, o.id)?.discount_percent ?? null, { currency: f, amount: _, originalAmount: h } = le(o, u);
1751
1751
  return /* @__PURE__ */ d(
1752
1752
  "button",
1753
1753
  {
@@ -1755,7 +1755,7 @@ function Ge({ block: e, ctx: t }) {
1755
1755
  role: "radio",
1756
1756
  "aria-checked": c,
1757
1757
  onClick: () => {
1758
- t.setSelectedPriceId(s.id), t.onAction("price_selected", { priceId: s.id, price: s });
1758
+ e.setSelectedPriceId(o.id), e.onAction("price_selected", { priceId: o.id, price: o });
1759
1759
  },
1760
1760
  class: [
1761
1761
  "group relative inline-flex w-full mx-auto items-center justify-between flex-row-reverse gap-4 rounded-2xl border-2 px-4 py-3.5 text-left transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
@@ -1803,12 +1803,12 @@ function Ge({ block: e, ctx: t }) {
1803
1803
  ),
1804
1804
  /* @__PURE__ */ d("div", { class: "flex flex-1 flex-col gap-0.5", children: [
1805
1805
  /* @__PURE__ */ d("div", { class: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
1806
- /* @__PURE__ */ a("span", { class: "text-xs font-normal uppercase tracking-normal text-gray-800/70", children: Rt(s, r) }),
1807
- _ ? (
1806
+ /* @__PURE__ */ a("span", { class: "text-xs font-normal uppercase tracking-normal text-gray-800/70", children: Ue(o, r) }),
1807
+ h ? (
1808
1808
  // opacity-60 приглушает strike: глаз сначала ловит label
1809
1809
  // и discount-badge, потом main price; original «бывшая цена»
1810
1810
  // — третичная информация, не должна конкурировать с label.
1811
- /* @__PURE__ */ a("span", { class: "text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]", children: _ })
1811
+ /* @__PURE__ */ a("span", { class: "text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]", children: h })
1812
1812
  ) : null,
1813
1813
  u ? (
1814
1814
  // Emerald pill — фиксированный «успех/выгода», не зависит от
@@ -1821,53 +1821,53 @@ function Ge({ block: e, ctx: t }) {
1821
1821
  ) : null
1822
1822
  ] }),
1823
1823
  /* @__PURE__ */ a("div", { class: "flex items-baseline gap-2 flex-wrap", children: /* @__PURE__ */ d("span", { class: "text-[26px] leading-tight whitespace-nowrap text-gray-800 font-medium", children: [
1824
- /* @__PURE__ */ a("span", { class: "opacity-90", children: h }),
1825
- p,
1824
+ /* @__PURE__ */ a("span", { class: "opacity-90", children: f }),
1825
+ _,
1826
1826
  /* @__PURE__ */ d("span", { class: "text-sm font-normal text-gray-500", children: [
1827
1827
  " ",
1828
1828
  "/ ",
1829
- lt(s, r)
1829
+ ce(o, r)
1830
1830
  ] })
1831
1831
  ] }) }),
1832
- s.description ? /* @__PURE__ */ a("span", { class: "mt-1 text-xs leading-relaxed text-gray-500", children: s.description }) : null
1832
+ o.description ? /* @__PURE__ */ a("span", { class: "mt-1 text-xs leading-relaxed text-gray-500", children: o.description }) : null
1833
1833
  ] }),
1834
1834
  l ? /* @__PURE__ */ a(
1835
1835
  "span",
1836
1836
  {
1837
1837
  class: "absolute -top-[9px] -right-[6px] rounded-[11px] border-[5px] border-white px-2 py-1 text-[12px] font-semibold text-white",
1838
1838
  style: { background: "var(--pw-accent)" },
1839
- children: o
1839
+ children: s
1840
1840
  }
1841
1841
  ) : null
1842
1842
  ]
1843
1843
  },
1844
- s.id
1844
+ o.id
1845
1845
  );
1846
1846
  })
1847
1847
  }
1848
1848
  );
1849
1849
  }
1850
- function qe(e, t) {
1851
- return e.label ? e.label : !e.interval || e.interval === "lifetime" ? t("pricing.interval.lifetime_short", "lifetime") : t(`pricing.interval.${e.interval}`, e.interval);
1850
+ function Wt(t, e) {
1851
+ return t.label ? t.label : !t.interval || t.interval === "lifetime" ? e("pricing.interval.lifetime_short", "lifetime") : e(`pricing.interval.${t.interval}`, t.interval);
1852
1852
  }
1853
- function We({
1854
- price: e,
1855
- isLast: t,
1853
+ function Zt({
1854
+ price: t,
1855
+ isLast: e,
1856
1856
  isPopular: r,
1857
1857
  popularLabel: i,
1858
1858
  offer: n,
1859
- selected: o,
1860
- onSelect: s,
1859
+ selected: s,
1860
+ onSelect: o,
1861
1861
  t: c
1862
1862
  }) {
1863
- const l = n?.discount_percent ?? null, { currency: f, amount: u, originalAmount: h } = st(e, l);
1863
+ const l = n?.discount_percent ?? null, { currency: p, amount: u, originalAmount: f } = le(t, l);
1864
1864
  return /* @__PURE__ */ d(
1865
1865
  "button",
1866
1866
  {
1867
1867
  type: "button",
1868
1868
  role: "radio",
1869
- "aria-checked": o,
1870
- onClick: s,
1869
+ "aria-checked": s,
1870
+ onClick: o,
1871
1871
  class: "group relative inline-flex w-full max-w-[360px] mx-auto items-center justify-between gap-4 px-4 pt-3.5 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--pw-accent)]",
1872
1872
  children: [
1873
1873
  /* @__PURE__ */ a(
@@ -1875,9 +1875,9 @@ function We({
1875
1875
  {
1876
1876
  class: [
1877
1877
  "flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border transition-colors mb-3",
1878
- o ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent"
1878
+ s ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent"
1879
1879
  ].join(" "),
1880
- style: o ? {
1880
+ style: s ? {
1881
1881
  background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 70%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)"
1882
1882
  } : void 0,
1883
1883
  "aria-hidden": "true",
@@ -1889,7 +1889,7 @@ function We({
1889
1889
  viewBox: "0 0 17 12",
1890
1890
  fill: "none",
1891
1891
  xmlns: "http://www.w3.org/2000/svg",
1892
- class: o ? "opacity-100" : "opacity-0",
1892
+ class: s ? "opacity-100" : "opacity-0",
1893
1893
  children: /* @__PURE__ */ a(
1894
1894
  "path",
1895
1895
  {
@@ -1906,11 +1906,11 @@ function We({
1906
1906
  {
1907
1907
  class: [
1908
1908
  "flex flex-1 items-center gap-1.5 pb-3.5",
1909
- t ? "" : "border-b border-gray-200"
1909
+ e ? "" : "border-b border-gray-200"
1910
1910
  ].join(" "),
1911
1911
  children: [
1912
1912
  /* @__PURE__ */ d("div", { class: "flex flex-wrap items-center gap-1 gap-x-1.5", children: [
1913
- /* @__PURE__ */ a("span", { class: "text-base font-normal capitalize text-gray-800", children: qe(e, c) }),
1913
+ /* @__PURE__ */ a("span", { class: "text-base font-normal capitalize text-gray-800", children: Wt(t, c) }),
1914
1914
  r ? (
1915
1915
  // Pastel brand-mix pill — точно как `badge` в TelegramPricingRadio.
1916
1916
  // Низкий visual weight: pill про "имя плана" (most popular), а не
@@ -1935,14 +1935,14 @@ function We({
1935
1935
  ] }),
1936
1936
  /* @__PURE__ */ a("div", { class: "flex-1" }),
1937
1937
  /* @__PURE__ */ d("span", { class: "flex items-baseline gap-1.5 text-base font-normal text-gray-600", children: [
1938
- h ? /* @__PURE__ */ a("span", { class: "text-xs text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: h }) : null,
1938
+ f ? /* @__PURE__ */ a("span", { class: "text-xs text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: f }) : null,
1939
1939
  /* @__PURE__ */ d("span", { class: "whitespace-nowrap", children: [
1940
- /* @__PURE__ */ a("span", { class: "opacity-90", children: f }),
1940
+ /* @__PURE__ */ a("span", { class: "opacity-90", children: p }),
1941
1941
  u,
1942
1942
  /* @__PURE__ */ d("span", { class: "text-xs text-gray-400", children: [
1943
1943
  " ",
1944
1944
  "/ ",
1945
- lt(e, c)
1945
+ ce(t, c)
1946
1946
  ] })
1947
1947
  ] })
1948
1948
  ] })
@@ -1953,33 +1953,33 @@ function We({
1953
1953
  }
1954
1954
  );
1955
1955
  }
1956
- function Ze({
1957
- price: e,
1958
- isPopular: t,
1956
+ function Kt({
1957
+ price: t,
1958
+ isPopular: e,
1959
1959
  popularLabel: r,
1960
1960
  offer: i,
1961
1961
  reserveStrikeRow: n,
1962
- selected: o,
1963
- onSelect: s,
1962
+ selected: s,
1963
+ onSelect: o,
1964
1964
  t: c
1965
1965
  }) {
1966
- const l = i?.discount_percent ?? null, { currency: f, amount: u, originalAmount: h } = st(e, l);
1966
+ const l = i?.discount_percent ?? null, { currency: p, amount: u, originalAmount: f } = le(t, l);
1967
1967
  return /* @__PURE__ */ d(
1968
1968
  "button",
1969
1969
  {
1970
1970
  type: "button",
1971
1971
  role: "radio",
1972
- "aria-checked": o,
1973
- onClick: s,
1972
+ "aria-checked": s,
1973
+ onClick: o,
1974
1974
  class: [
1975
1975
  "group relative flex h-full flex-col items-center justify-start gap-1 rounded-2xl border-2 px-3 pb-4 pt-3.5 text-center transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
1976
- o ? "border-[var(--pw-accent)]" : "border-gray-200 hover:bg-gray-50"
1976
+ s ? "border-[var(--pw-accent)]" : "border-gray-200 hover:bg-gray-50"
1977
1977
  ].join(" "),
1978
- style: o ? { background: "color-mix(in srgb, var(--pw-accent) 6%, transparent)" } : void 0,
1978
+ style: s ? { background: "color-mix(in srgb, var(--pw-accent) 6%, transparent)" } : void 0,
1979
1979
  children: [
1980
- /* @__PURE__ */ a("span", { class: "flex min-h-[2.4em] items-center text-[10px] font-normal uppercase leading-tight text-gray-800/70", children: Rt(e, c) }),
1980
+ /* @__PURE__ */ a("span", { class: "flex min-h-[2.4em] items-center text-[10px] font-normal uppercase leading-tight text-gray-800/70", children: Ue(t, c) }),
1981
1981
  n ? /* @__PURE__ */ d("div", { class: "flex h-[22px] items-center justify-center gap-1.5", children: [
1982
- h ? /* @__PURE__ */ a("span", { class: "text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: h }) : null,
1982
+ f ? /* @__PURE__ */ a("span", { class: "text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: f }) : null,
1983
1983
  l ? /* @__PURE__ */ d("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
1984
1984
  "-",
1985
1985
  l,
@@ -1987,14 +1987,14 @@ function Ze({
1987
1987
  ] }) : null
1988
1988
  ] }) : null,
1989
1989
  /* @__PURE__ */ d("span", { class: "text-[26px] leading-none whitespace-nowrap text-gray-800 font-medium", children: [
1990
- /* @__PURE__ */ a("span", { class: "opacity-90", children: f }),
1990
+ /* @__PURE__ */ a("span", { class: "opacity-90", children: p }),
1991
1991
  u
1992
1992
  ] }),
1993
1993
  /* @__PURE__ */ d("span", { class: "text-xs font-normal text-gray-500", children: [
1994
1994
  "/ ",
1995
- lt(e, c)
1995
+ ce(t, c)
1996
1996
  ] }),
1997
- t ? /* @__PURE__ */ a(
1997
+ e ? /* @__PURE__ */ a(
1998
1998
  "span",
1999
1999
  {
2000
2000
  class: "absolute -top-[10px] left-1/2 -translate-x-1/2 whitespace-nowrap rounded-[11px] border-[3px] border-white px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",
@@ -2006,28 +2006,28 @@ function Ze({
2006
2006
  }
2007
2007
  );
2008
2008
  }
2009
- function Ke({ block: e }) {
2010
- return /* @__PURE__ */ a("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children: e.text });
2009
+ function Yt({ block: t }) {
2010
+ return /* @__PURE__ */ a("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children: t.text });
2011
2011
  }
2012
- const Ye = {
2012
+ const Xt = {
2013
2013
  week: 0.25,
2014
2014
  month: 1,
2015
2015
  year: 12
2016
2016
  };
2017
- function Xe(e, t) {
2018
- return e ? t(`pricing.interval.${e}`, e) : t("pricing.interval.period", "period");
2017
+ function Jt(t, e) {
2018
+ return t ? e(`pricing.interval.${t}`, t) : e("pricing.interval.period", "period");
2019
2019
  }
2020
- function Je({ block: e, ctx: t }) {
2021
- const { t: r } = k();
2022
- if (!e.queries.length) return null;
2023
- const n = t.bootstrap.prices.find((s) => s.id === t.selectedPriceId)?.interval ?? null, o = n ? Ye[n] : void 0;
2020
+ function Qt({ block: t, ctx: e }) {
2021
+ const { t: r } = S();
2022
+ if (!t.queries.length) return null;
2023
+ const n = e.bootstrap.prices.find((o) => o.id === e.selectedPriceId)?.interval ?? null, s = n ? Xt[n] : void 0;
2024
2024
  return /* @__PURE__ */ d("div", { class: "flex flex-col gap-2", children: [
2025
2025
  /* @__PURE__ */ a("div", { class: "text-sm font-semibold text-gray-800", children: !n || n === "lifetime" ? r("pricing.included_total", "Included for lifetime:") : r("pricing.included_per", "Included per {interval}:", {
2026
- interval: Xe(n, r)
2026
+ interval: Jt(n, r)
2027
2027
  }) }),
2028
- /* @__PURE__ */ a("ul", { class: "flex flex-col gap-2", role: "list", children: e.queries.map((s) => {
2029
- const c = Number.isFinite(s.count) ? s.count : 0, l = o !== void 0 ? Math.round(c * o) : c;
2030
- return /* @__PURE__ */ d("li", { class: `flex gap-3 ${s.desc ? "items-start" : "items-center"}`, children: [
2028
+ /* @__PURE__ */ a("ul", { class: "flex flex-col gap-2", role: "list", children: t.queries.map((o) => {
2029
+ const c = Number.isFinite(o.count) ? o.count : 0, l = s !== void 0 ? Math.round(c * s) : c;
2030
+ return /* @__PURE__ */ d("li", { class: `flex gap-3 ${o.desc ? "items-start" : "items-center"}`, children: [
2031
2031
  /* @__PURE__ */ a(
2032
2032
  "svg",
2033
2033
  {
@@ -2035,7 +2035,7 @@ function Je({ block: e, ctx: t }) {
2035
2035
  height: "18",
2036
2036
  viewBox: "0 0 20 20",
2037
2037
  fill: "none",
2038
- class: `flex-shrink-0 text-emerald-500 ${s.desc ? "mt-0.5" : ""}`,
2038
+ class: `flex-shrink-0 text-emerald-500 ${o.desc ? "mt-0.5" : ""}`,
2039
2039
  "aria-hidden": "true",
2040
2040
  children: /* @__PURE__ */ a(
2041
2041
  "path",
@@ -2052,48 +2052,48 @@ function Je({ block: e, ctx: t }) {
2052
2052
  /* @__PURE__ */ d("div", { children: [
2053
2053
  /* @__PURE__ */ a("span", { class: "font-semibold text-gray-900 text-sm", children: l }),
2054
2054
  " ",
2055
- /* @__PURE__ */ a("span", { class: "text-sm text-gray-800", children: s.name }),
2056
- s.desc ? /* @__PURE__ */ d(ot, { children: [
2055
+ /* @__PURE__ */ a("span", { class: "text-sm text-gray-800", children: o.name }),
2056
+ o.desc ? /* @__PURE__ */ d(se, { children: [
2057
2057
  /* @__PURE__ */ a("br", {}),
2058
- /* @__PURE__ */ a("span", { class: "text-xs text-gray-400", children: s.desc })
2058
+ /* @__PURE__ */ a("span", { class: "text-xs text-gray-400", children: o.desc })
2059
2059
  ] }) : null
2060
2060
  ] })
2061
- ] }, s.id);
2061
+ ] }, o.id);
2062
2062
  }) })
2063
2063
  ] });
2064
2064
  }
2065
- const Qe = {
2066
- heading: He,
2067
- text: Ke,
2068
- price_grid: Ge,
2069
- cta_button: ze,
2070
- auth_panel: Tt,
2071
- current_session: Be,
2072
- features_list: Oe,
2073
- tokenization_gate: Je,
2074
- guarantee_badge: Fe,
2075
- offer_banner: ke
2065
+ const er = {
2066
+ heading: Vt,
2067
+ text: Yt,
2068
+ price_grid: Gt,
2069
+ cta_button: Bt,
2070
+ auth_panel: Ee,
2071
+ current_session: Ot,
2072
+ features_list: Ft,
2073
+ tokenization_gate: Qt,
2074
+ guarantee_badge: Rt,
2075
+ offer_banner: _t
2076
2076
  };
2077
- function tr({ layout: e, bootstrap: t, onAction: r, auth: i, authSession: n, hasTopBanner: o }) {
2078
- const s = qt(() => {
2079
- for (const y of e.blocks)
2080
- if (y.type === "price_grid" && y.popular_price_id && t.prices.some((S) => S.id === y.popular_price_id))
2081
- return y.popular_price_id;
2082
- return t.prices[0]?.id ?? null;
2083
- }, [e.blocks, t.prices]), [c, l] = x(s), f = {
2084
- bootstrap: t,
2077
+ function tr({ layout: t, bootstrap: e, onAction: r, auth: i, authSession: n, hasTopBanner: s }) {
2078
+ const o = We(() => {
2079
+ for (const k of t.blocks)
2080
+ if (k.type === "price_grid" && k.popular_price_id && e.prices.some((w) => w.id === k.popular_price_id))
2081
+ return k.popular_price_id;
2082
+ return e.prices[0]?.id ?? null;
2083
+ }, [t.blocks, e.prices]), [c, l] = v(o), p = {
2084
+ bootstrap: e,
2085
2085
  selectedPriceId: c,
2086
2086
  setSelectedPriceId: l,
2087
2087
  onAction: r,
2088
2088
  auth: i,
2089
2089
  authSession: n
2090
- }, u = e.blocks.findIndex((y) => y.type === "cta_button"), h = u === -1 ? e.blocks : e.blocks.slice(0, u), p = u === -1 ? [] : e.blocks.slice(u), _ = (y, S) => {
2091
- const g = Qe[y.type];
2092
- return g ? /* @__PURE__ */ a(g, { block: y, ctx: f }, `${y.type}-${S}`) : (typeof console < "u" && console.warn(`[paywall] unknown block type: ${y.type}`), null);
2090
+ }, u = t.blocks.findIndex((k) => k.type === "cta_button"), f = u === -1 ? t.blocks : t.blocks.slice(0, u), _ = u === -1 ? [] : t.blocks.slice(u), h = (k, w) => {
2091
+ const A = er[k.type];
2092
+ return A ? /* @__PURE__ */ a(A, { block: k, ctx: p }, `${k.type}-${w}`) : (typeof console < "u" && console.warn(`[paywall] unknown block type: ${k.type}`), null);
2093
2093
  };
2094
- return /* @__PURE__ */ d(ot, { children: [
2095
- /* @__PURE__ */ a("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__ */ a("div", { class: "flex flex-col gap-6", children: h.map(_) }) }),
2096
- p.length > 0 ? (
2094
+ return /* @__PURE__ */ d(se, { children: [
2095
+ /* @__PURE__ */ a("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__ */ a("div", { class: "flex flex-col gap-6", children: f.map(h) }) }),
2096
+ _.length > 0 ? (
2097
2097
  // Тонкий shadow-top вместо border-t — создаёт depth, читается как
2098
2098
  // «footer закреплён к низу dialog'а». Линия выглядела как divider
2099
2099
  // в обычном flow, не передавала sticky-character.
@@ -2102,182 +2102,202 @@ function tr({ layout: e, bootstrap: t, onAction: r, auth: i, authSession: n, has
2102
2102
  {
2103
2103
  class: "flex flex-col gap-4 bg-white px-6 pb-6 pt-3 sm:px-8",
2104
2104
  style: { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" },
2105
- children: p.map((y, S) => _(y, h.length + S))
2105
+ children: _.map((k, w) => h(k, f.length + w))
2106
2106
  }
2107
2107
  )
2108
2108
  ) : null
2109
2109
  ] });
2110
2110
  }
2111
- function er(e, t, r, i) {
2112
- return e ? i ? { open: !0, view: "purchased", error: null } : t.status === "idle" || t.status === "loading" ? { open: !0, view: "loading", error: null } : t.status === "error" ? { open: !0, view: "error", error: t.error } : r.kind === "support" ? { open: !0, view: "support", error: null } : r.kind === "auth_gate" ? { open: !0, view: "auth", error: null } : r.kind === "awaiting_payment" ? { open: !0, view: "awaiting_payment", error: null } : r.kind === "popup_blocked" ? { open: !0, view: "popup_blocked", error: null } : r.kind === "purchase_success" ? { open: !0, view: "purchased", error: null } : r.kind === "verifying" || r.kind === "direct_checkout_pending" ? { open: !0, view: "loading", error: null } : { open: !0, view: "layout", error: null } : { open: !1, view: null, error: null };
2111
+ function rr(t, e, r, i) {
2112
+ return t ? i ? { 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 } : r.kind === "support" ? { open: !0, view: "support", error: null, processing: !1 } : r.kind === "auth_gate" ? { open: !0, view: "auth", error: null, processing: !1 } : r.kind === "awaiting_payment" ? { open: !0, view: "awaiting_payment", error: null, processing: !1 } : r.kind === "popup_blocked" ? { open: !0, view: "popup_blocked", error: null, processing: !1 } : r.kind === "purchase_success" ? { open: !0, view: "purchased", error: null, processing: !1 } : r.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 };
2113
2113
  }
2114
- function rr(e, t) {
2115
- return e.open === t.open && e.view === t.view && e.error === t.error;
2114
+ function ir(t, e) {
2115
+ return t.open === e.open && t.view === e.view && t.error === e.error && t.processing === e.processing;
2116
2116
  }
2117
- function ir({
2118
- client: e,
2119
- open: t,
2117
+ function nr({
2118
+ client: t,
2119
+ open: e,
2120
2120
  onClose: r,
2121
2121
  onEvent: i,
2122
2122
  initialView: n,
2123
- initialAuthMode: o,
2124
- initialCheckoutPriceId: s,
2125
- purchased: c,
2126
- renew: l,
2127
- onState: f,
2128
- inline: u,
2129
- locale: h
2123
+ initialAuthMode: s,
2124
+ initialCheckoutPriceId: o,
2125
+ initialCheckoutUrl: c,
2126
+ purchased: l,
2127
+ renew: p,
2128
+ onState: u,
2129
+ inline: f,
2130
+ locale: _
2130
2131
  }) {
2131
- const [p, _] = x({ status: "idle" }), [y, S] = x(
2132
- () => e.auth?.getCachedSession() ?? null
2133
- ), [g, v] = x(() => n === "support" ? { kind: "support", origin: "standalone" } : n === "auth" ? { kind: "auth_gate", origin: "standalone" } : n === "checkout" && s ? { kind: "direct_checkout_pending", priceId: s } : { kind: "layout" }), C = n === "checkout", I = F(!1), A = F(null);
2134
- T(() => {
2135
- if (!f) return;
2136
- const b = er(t, p, g, c), w = A.current;
2137
- w && rr(w, b) || (A.current = b, f(b));
2138
- }, [t, p, g, c, f]), T(() => {
2139
- if (e.auth)
2140
- return e.auth.onAuthChange((b, w) => S(w));
2141
- }, [e.auth]), T(() => {
2142
- if (typeof e.onBootstrapChange == "function")
2143
- return e.onBootstrapChange((b) => {
2144
- _(
2145
- (w) => w.status === "ready" ? { status: "ready", data: b } : w
2132
+ const [h, k] = v({ status: "idle" }), [w, A] = v(
2133
+ () => t.auth?.getCachedSession() ?? null
2134
+ ), [b, m] = v(() => n === "support" ? { kind: "support", origin: "standalone" } : n === "auth" ? o ? {
2135
+ kind: "auth_gate",
2136
+ pendingCheckout: { priceId: o, direct: !0 },
2137
+ origin: "standalone",
2138
+ intent: "preauth"
2139
+ } : { kind: "auth_gate", origin: "standalone" } : n === "awaiting_payment" && o && c ? {
2140
+ kind: "awaiting_payment",
2141
+ priceId: o,
2142
+ url: c
2143
+ } : n === "popup_blocked" && o && c ? {
2144
+ kind: "popup_blocked",
2145
+ priceId: o,
2146
+ url: c
2147
+ } : { kind: "layout" }), C = n === "awaiting_payment" || n === "popup_blocked" || n === "auth" && !!o, I = F(!1), B = F(null);
2148
+ j(() => {
2149
+ if (!u) return;
2150
+ const y = rr(e, h, b, l), g = B.current;
2151
+ g && ir(g, y) || (B.current = y, u(y));
2152
+ }, [e, h, b, l, u]), j(() => {
2153
+ if (t.auth)
2154
+ return t.auth.onAuthChange((y, g) => A(g));
2155
+ }, [t.auth]), j(() => {
2156
+ if (typeof t.onBootstrapChange == "function")
2157
+ return t.onBootstrapChange((y) => {
2158
+ k(
2159
+ (g) => g.status === "ready" ? { status: "ready", data: y } : g
2146
2160
  );
2147
2161
  });
2148
- }, [e]), T(() => {
2149
- if (!t || p.status === "ready" || p.status === "loading") return;
2150
- let b = !1;
2151
- return _({ status: "loading" }), e.bootstrap().then((w) => {
2152
- if (b) return;
2153
- _({ status: "ready", data: w }), i("ready", w);
2154
- const m = n === "support" || n === "auth";
2155
- w.user?.has_active_subscription && !l && !m && (i("purchase_completed", {
2156
- priceId: s ?? null,
2162
+ }, [t]), j(() => {
2163
+ if (!e || h.status === "ready" || h.status === "loading") return;
2164
+ let y = !1;
2165
+ return k({ status: "loading" }), t.bootstrap().then((g) => {
2166
+ if (y) return;
2167
+ k({ status: "ready", data: g }), i("ready", g);
2168
+ const x = n === "support" || n === "auth" || C;
2169
+ g.user?.has_active_subscription && !p && !x && (i("purchase_completed", {
2170
+ priceId: o ?? null,
2157
2171
  sessionId: null,
2158
2172
  restored: !0
2159
- }), C ? r() : v({ kind: "purchase_success", restored: !0 }));
2160
- }).catch((w) => {
2161
- if (b) return;
2162
- const m = w instanceof O ? w : new O("unknown", "Failed to load paywall", { cause: w });
2163
- _({ status: "error", error: m }), i("error", m);
2173
+ }), m({ kind: "purchase_success", restored: !0 }));
2174
+ }).catch((g) => {
2175
+ if (y) return;
2176
+ const x = g instanceof L ? g : new L("unknown", "Failed to load paywall", { cause: g });
2177
+ k({ status: "error", error: x }), i("error", x);
2164
2178
  }), () => {
2165
- b = !0;
2179
+ y = !0;
2166
2180
  };
2167
- }, [t, e]), Wt(() => {
2168
- if (!t) {
2169
- v({ kind: "layout" }), I.current = !1;
2181
+ }, [e, t]), Ze(() => {
2182
+ if (!e) {
2183
+ m({ kind: "layout" }), I.current = !1;
2170
2184
  return;
2171
2185
  }
2172
- n === "support" ? v({ kind: "support", origin: "standalone" }) : n === "auth" ? v({ kind: "auth_gate", origin: "standalone" }) : n === "checkout" && s && v({ kind: "direct_checkout_pending", priceId: s });
2173
- }, [t, n, s]);
2174
- const E = async (b) => {
2186
+ n === "support" ? m({ kind: "support", origin: "standalone" }) : n === "auth" ? m(o ? {
2187
+ kind: "auth_gate",
2188
+ pendingCheckout: { priceId: o, direct: !0 },
2189
+ origin: "standalone",
2190
+ intent: "preauth"
2191
+ } : { kind: "auth_gate", origin: "standalone" }) : n === "awaiting_payment" && o && c ? m({
2192
+ kind: "awaiting_payment",
2193
+ priceId: o,
2194
+ url: c
2195
+ }) : n === "popup_blocked" && o && c && m({
2196
+ kind: "popup_blocked",
2197
+ priceId: o,
2198
+ url: c
2199
+ });
2200
+ }, [e, n, o, c]);
2201
+ const M = async (y) => {
2175
2202
  try {
2176
- const w = await e.createCheckout({
2177
- priceId: b,
2178
- ignoreActivePurchase: l === !0
2203
+ const g = t.getCachedOffers?.() ?? null, x = g ? N(g, y) : null, E = await t.createCheckout({
2204
+ priceId: y,
2205
+ offerId: x?.id,
2206
+ ignoreActivePurchase: p === !0
2179
2207
  });
2180
- if (i("checkout_started", { priceId: b, url: w.url, acquiring: w.acquiring }), typeof window > "u" || !w.url) return;
2181
- const m = window.open(w.url, "_blank");
2182
- if (m) {
2208
+ if (i("checkout_started", { priceId: y, url: E.url, acquiring: E.acquiring }), typeof window > "u" || !E.url) return;
2209
+ const $ = window.open(E.url, "_blank");
2210
+ if ($) {
2183
2211
  try {
2184
- m.opener = null;
2212
+ $.opener = null;
2185
2213
  } catch {
2186
2214
  }
2187
- v({ kind: "awaiting_payment", priceId: b, url: w.url });
2215
+ m({ kind: "awaiting_payment", priceId: y, url: E.url });
2188
2216
  } else
2189
- v({ kind: "popup_blocked", priceId: b, url: w.url });
2190
- } catch (w) {
2191
- if (w instanceof O && w.code === "already_purchased") {
2217
+ m({ kind: "popup_blocked", priceId: y, url: E.url });
2218
+ } catch (g) {
2219
+ if (g instanceof L && g.code === "already_purchased") {
2192
2220
  try {
2193
- await e.getUser({ force: !0 });
2221
+ await t.getUser({ force: !0 });
2194
2222
  } catch {
2195
2223
  }
2196
- i("purchase_completed", { priceId: b, sessionId: null, restored: !0 }), C ? r() : v({ kind: "purchase_success", restored: !0 });
2224
+ i("purchase_completed", { priceId: y, sessionId: null, restored: !0 }), C ? r() : m({ kind: "purchase_success", restored: !0 });
2197
2225
  return;
2198
2226
  }
2199
- const m = w instanceof O ? w : new O("checkout_failed", "Checkout failed", { cause: w });
2200
- i("error", m), C ? r() : v({ kind: "layout" });
2227
+ const x = g instanceof L ? g : new L("checkout_failed", "Checkout failed", { cause: g });
2228
+ i("error", x), C ? r() : m({ kind: "layout" });
2201
2229
  }
2202
- }, P = (b, w) => {
2230
+ }, z = (y, g) => {
2203
2231
  if (typeof window > "u") return;
2204
- const m = window.open(w, "_blank");
2205
- if (m) {
2232
+ const x = window.open(g, "_blank");
2233
+ if (x) {
2206
2234
  try {
2207
- m.opener = null;
2235
+ x.opener = null;
2208
2236
  } catch {
2209
2237
  }
2210
- v({ kind: "awaiting_payment", priceId: b, url: w });
2238
+ m({ kind: "awaiting_payment", priceId: y, url: g });
2211
2239
  }
2212
2240
  };
2213
- T(() => {
2214
- if (g.kind !== "auth_gate" || !y || y.user.is_anonymous || I.current) return;
2241
+ j(() => {
2242
+ if (b.kind !== "auth_gate" || !w || w.user.is_anonymous || I.current) return;
2215
2243
  I.current = !0;
2216
- const b = g.pendingCheckout, w = g.origin;
2217
- v({ kind: "verifying" }), (async () => {
2218
- if (!l)
2244
+ const y = b.pendingCheckout, g = b.origin;
2245
+ m({ kind: "verifying" }), (async () => {
2246
+ if (!p)
2219
2247
  try {
2220
- if ((await e.getUser({ force: !0 })).has_active_subscription) {
2248
+ if ((await t.getUser({ force: !0 })).has_active_subscription) {
2221
2249
  i("purchase_completed", {
2222
- priceId: b?.priceId ?? null,
2250
+ priceId: y?.priceId ?? null,
2223
2251
  sessionId: null,
2224
2252
  restored: !0
2225
- }), b?.direct ? r() : v({ kind: "purchase_success", restored: !0 });
2253
+ }), y?.direct ? r() : m({ kind: "purchase_success", restored: !0 });
2226
2254
  return;
2227
2255
  }
2228
2256
  } catch {
2229
2257
  }
2230
- if (!b) {
2231
- w === "standalone" ? r() : v({ kind: "layout" });
2258
+ if (!y) {
2259
+ g === "standalone" ? r() : m({ kind: "layout" });
2232
2260
  return;
2233
2261
  }
2234
- await E(b.priceId);
2262
+ await M(y.priceId);
2235
2263
  })().finally(() => {
2236
2264
  I.current = !1;
2237
2265
  });
2238
- }, [y, g]), T(() => {
2239
- if (p.status !== "ready" || g.kind !== "direct_checkout_pending") return;
2240
- const b = g.priceId, w = p.data.settings.checkout_mode ?? "guest", m = e.auth?.getCachedSession() ?? null, L = !!m && !m.user.is_anonymous;
2241
- if (w === "preauth" && !!e.auth && !L) {
2242
- v({ kind: "auth_gate", pendingCheckout: { priceId: b, direct: !0 } });
2243
- return;
2244
- }
2245
- E(b);
2246
- }, [p, g]);
2247
- const z = async (b, w) => {
2248
- if (b === "close") {
2266
+ }, [w, b]);
2267
+ const O = async (y, g) => {
2268
+ if (y === "close") {
2249
2269
  r();
2250
2270
  return;
2251
2271
  }
2252
- if (b === "price_selected") {
2253
- i("price_selected", w);
2272
+ if (y === "price_selected") {
2273
+ i("price_selected", g);
2254
2274
  return;
2255
2275
  }
2256
- if (b === "restore") {
2257
- if (!e.auth) return;
2258
- const m = e.auth.getCachedSession();
2259
- if (m && !m.user.is_anonymous) return;
2260
- v({ kind: "auth_gate", intent: "restore" });
2276
+ if (y === "restore") {
2277
+ if (!t.auth) return;
2278
+ const x = t.auth.getCachedSession();
2279
+ if (x && !x.user.is_anonymous) return;
2280
+ m({ kind: "auth_gate", intent: "restore" });
2261
2281
  return;
2262
2282
  }
2263
- if (b === "support") {
2264
- v({ kind: "support", origin: "layout" });
2283
+ if (y === "support") {
2284
+ m({ kind: "support", origin: "layout" });
2265
2285
  return;
2266
2286
  }
2267
- if (b === "checkout" && p.status === "ready") {
2268
- const m = w?.priceId;
2269
- if (!m) {
2270
- i("error", new O("no_price", "No price selected"));
2287
+ if (y === "checkout" && h.status === "ready") {
2288
+ const x = g?.priceId;
2289
+ if (!x) {
2290
+ i("error", new L("no_price", "No price selected"));
2271
2291
  return;
2272
2292
  }
2273
- const L = p.data.settings.checkout_mode ?? "guest", N = e.auth?.getCachedSession() ?? null, Ut = !!N && !N.user.is_anonymous;
2274
- if (L === "preauth" && !!e.auth && !Ut) {
2275
- v({ kind: "auth_gate", pendingCheckout: { priceId: m } });
2293
+ const E = h.data.settings.checkout_mode ?? "guest", $ = t.auth?.getCachedSession() ?? null, De = !!$ && !$.user.is_anonymous;
2294
+ if (E === "preauth" && !!t.auth && !De) {
2295
+ m({ kind: "auth_gate", pendingCheckout: { priceId: x } });
2276
2296
  return;
2277
2297
  }
2278
- await E(m);
2298
+ await M(x);
2279
2299
  }
2280
- }, B = p.status === "ready" ? p.data.settings.brand_color : null, R = p.status === "ready" ? p.data.settings.allow_close !== !1 : !0, M = g.kind === "layout" && p.status === "ready" ? jt(p.data.offers) : null, D = M ? /* @__PURE__ */ a(_e, { offer: M }) : null, U = {
2300
+ }, R = h.status === "ready" ? h.data.settings.brand_color : null, P = h.status === "ready" ? h.data.settings.allow_close !== !1 : !0, U = b.kind === "layout" && h.status === "ready" ? ze(h.data.offers) : null, D = U ? /* @__PURE__ */ a(St, { offer: U }) : null, Z = {
2281
2301
  type: "auth_panel",
2282
2302
  // Заголовок не задаём — AuthGate сам решит по intent'у (restore →
2283
2303
  // "Restore Purchases", остальные → дефолтный "Welcome back!").
@@ -2286,92 +2306,92 @@ function ir({
2286
2306
  // Не скрываем при наличии сессии — auto-resume useEffect отрабатывает быстрее,
2287
2307
  // чем хотим показывать "Signed in as ..." промежуточным экраном.
2288
2308
  hide_when_authenticated: !1,
2289
- providers: p.status === "ready" ? p.data.settings.auth_providers : void 0
2290
- }, V = g.kind === "support" ? /* @__PURE__ */ a(
2291
- Ie,
2309
+ providers: h.status === "ready" ? h.data.settings.auth_providers : void 0
2310
+ }, V = b.kind === "support" ? /* @__PURE__ */ a(
2311
+ At,
2292
2312
  {
2293
- client: e,
2294
- authSession: y,
2295
- origin: g.origin,
2313
+ client: t,
2314
+ authSession: w,
2315
+ origin: b.origin,
2296
2316
  onBack: () => {
2297
- g.origin === "standalone" ? r() : v({ kind: "layout" });
2317
+ b.origin === "standalone" ? r() : m({ kind: "layout" });
2298
2318
  }
2299
2319
  }
2300
- ) : null, Z = g.kind === "auth_gate" && g.origin !== "standalone" || g.kind === "support", K = p.status === "ready" ? p.data : null;
2301
- return /* @__PURE__ */ a(ie, { bootstrap: K, forceLocale: h, children: /* @__PURE__ */ a(
2302
- ne,
2320
+ ) : null, K = b.kind === "auth_gate" && b.origin !== "standalone" || b.kind === "support", Y = h.status === "ready" ? h.data : null;
2321
+ return /* @__PURE__ */ a(nt, { bootstrap: Y, forceLocale: _, children: /* @__PURE__ */ a(
2322
+ at,
2303
2323
  {
2304
- open: t,
2324
+ open: e,
2305
2325
  onClose: r,
2306
- brandColor: B,
2326
+ brandColor: R,
2307
2327
  topBanner: D,
2308
- allowClose: R,
2309
- hideCloseButton: Z,
2310
- inline: u,
2328
+ allowClose: P,
2329
+ hideCloseButton: K,
2330
+ inline: f,
2311
2331
  labelledBy: "pw-title",
2312
- children: c ? /* @__PURE__ */ a(_t, { onContinue: r }) : g.kind === "purchase_success" ? /* @__PURE__ */ a(_t, { restored: g.restored, onContinue: r }) : V || (p.status === "loading" || p.status === "idle" || g.kind === "verifying" || g.kind === "direct_checkout_pending" ? /* @__PURE__ */ a(nr, { verifying: g.kind === "verifying" }) : p.status === "error" ? /* @__PURE__ */ a(ar, { message: p.error.message }) : g.kind === "auth_gate" && e.auth ? /* @__PURE__ */ a(
2313
- xe,
2332
+ children: l ? /* @__PURE__ */ a(Se, { onContinue: r }) : b.kind === "purchase_success" ? /* @__PURE__ */ a(Se, { restored: b.restored, onContinue: r }) : V || (h.status === "loading" || h.status === "idle" || b.kind === "verifying" ? /* @__PURE__ */ a(ar, { verifying: b.kind === "verifying" }) : h.status === "error" ? /* @__PURE__ */ a(or, { message: h.error.message }) : b.kind === "auth_gate" && t.auth ? /* @__PURE__ */ a(
2333
+ xt,
2314
2334
  {
2315
- block: U,
2316
- bootstrap: p.data,
2317
- auth: e.auth,
2318
- authSession: y,
2319
- showBack: g.origin !== "standalone",
2320
- intent: g.intent ?? (g.origin === "standalone" ? "standalone" : "preauth"),
2321
- initialMode: g.origin === "standalone" ? o : void 0,
2335
+ block: Z,
2336
+ bootstrap: h.data,
2337
+ auth: t.auth,
2338
+ authSession: w,
2339
+ showBack: b.origin !== "standalone",
2340
+ intent: b.intent ?? (b.origin === "standalone" ? "standalone" : "preauth"),
2341
+ initialMode: b.origin === "standalone" ? s : void 0,
2322
2342
  onBack: () => {
2323
- g.origin === "standalone" ? r() : v({ kind: "layout" });
2343
+ b.origin === "standalone" ? r() : m({ kind: "layout" });
2324
2344
  }
2325
2345
  }
2326
- ) : g.kind === "awaiting_payment" ? /* @__PURE__ */ a(
2327
- sr,
2346
+ ) : b.kind === "awaiting_payment" ? /* @__PURE__ */ a(
2347
+ lr,
2328
2348
  {
2329
- client: e,
2330
- onBack: () => v({ kind: "layout" }),
2349
+ client: t,
2350
+ onBack: () => m({ kind: "layout" }),
2331
2351
  onReopen: () => {
2332
2352
  if (typeof window > "u") return;
2333
- const b = window.open(g.url, "_blank");
2334
- if (b)
2353
+ const y = window.open(b.url, "_blank");
2354
+ if (y)
2335
2355
  try {
2336
- b.opener = null;
2356
+ y.opener = null;
2337
2357
  } catch {
2338
2358
  }
2339
2359
  },
2340
- onRetry: () => E(g.priceId)
2360
+ onRetry: () => M(b.priceId)
2341
2361
  }
2342
- ) : g.kind === "popup_blocked" ? /* @__PURE__ */ a(or, { onReopen: () => P(g.priceId, g.url) }) : /* @__PURE__ */ a(
2362
+ ) : b.kind === "popup_blocked" ? /* @__PURE__ */ a(sr, { onReopen: () => z(b.priceId, b.url) }) : /* @__PURE__ */ a(
2343
2363
  tr,
2344
2364
  {
2345
- layout: p.data.layout,
2346
- bootstrap: p.data,
2347
- onAction: z,
2348
- auth: e.auth,
2349
- authSession: y
2365
+ layout: h.data.layout,
2366
+ bootstrap: h.data,
2367
+ onAction: O,
2368
+ auth: t.auth,
2369
+ authSession: w
2350
2370
  }
2351
2371
  ))
2352
2372
  }
2353
2373
  ) });
2354
2374
  }
2355
- function nr({ verifying: e }) {
2356
- const { t } = k();
2375
+ function ar({ verifying: t }) {
2376
+ const { t: e } = S();
2357
2377
  return /* @__PURE__ */ d("div", { class: "flex flex-col items-center justify-center gap-3 py-12", children: [
2358
2378
  /* @__PURE__ */ a("span", { class: "inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]" }),
2359
- /* @__PURE__ */ a("span", { class: "text-xs font-medium tracking-wide text-gray-500", children: e ? t("modal.verifying_subscription", "Checking your subscription…") : t("modal.loading", "Loading…") })
2379
+ /* @__PURE__ */ a("span", { class: "text-xs font-medium tracking-wide text-gray-500", children: t ? e("modal.verifying_subscription", "Checking your subscription…") : e("modal.loading", "Loading…") })
2360
2380
  ] });
2361
2381
  }
2362
- function ar({ message: e }) {
2363
- const { t } = k();
2382
+ function or({ message: t }) {
2383
+ const { t: e } = S();
2364
2384
  return /* @__PURE__ */ d("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
2365
2385
  /* @__PURE__ */ a("div", { class: "flex h-11 w-11 items-center justify-center rounded-full bg-red-50", children: /* @__PURE__ */ d("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
2366
2386
  /* @__PURE__ */ a("path", { d: "M10 6v5M10 14h.01", stroke: "#dc2626", "stroke-width": "2", "stroke-linecap": "round" }),
2367
2387
  /* @__PURE__ */ a("circle", { cx: "10", cy: "10", r: "8", stroke: "#dc2626", "stroke-width": "1.75" })
2368
2388
  ] }) }),
2369
- /* @__PURE__ */ a("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: t("modal.error_generic", "Something went wrong") }),
2370
- /* @__PURE__ */ a("p", { class: "text-xs leading-relaxed text-gray-500", children: e })
2389
+ /* @__PURE__ */ a("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: e("modal.error_generic", "Something went wrong") }),
2390
+ /* @__PURE__ */ a("p", { class: "text-xs leading-relaxed text-gray-500", children: t })
2371
2391
  ] });
2372
2392
  }
2373
- function or({ onReopen: e }) {
2374
- const { t } = k();
2393
+ function sr({ onReopen: t }) {
2394
+ const { t: e } = S();
2375
2395
  return /* @__PURE__ */ d("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
2376
2396
  /* @__PURE__ */ a(
2377
2397
  "div",
@@ -2385,48 +2405,48 @@ function or({ onReopen: e }) {
2385
2405
  ] })
2386
2406
  }
2387
2407
  ),
2388
- /* @__PURE__ */ a("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: t("payment.popup_blocked_title", "Allow popups to continue") }),
2389
- /* @__PURE__ */ a("p", { class: "max-w-[18rem] text-xs leading-relaxed text-gray-500", children: t("payment.popup_blocked_message", "Your browser blocked the checkout tab. Click below to open it.") }),
2408
+ /* @__PURE__ */ a("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: e("payment.popup_blocked_title", "Allow popups to continue") }),
2409
+ /* @__PURE__ */ a("p", { class: "max-w-[18rem] text-xs leading-relaxed text-gray-500", children: e("payment.popup_blocked_message", "Your browser blocked the checkout tab. Click below to open it.") }),
2390
2410
  /* @__PURE__ */ a(
2391
2411
  "button",
2392
2412
  {
2393
2413
  type: "button",
2394
- onClick: e,
2414
+ onClick: t,
2395
2415
  class: "mt-1 rounded-xl px-4 py-2 text-xs font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
2396
2416
  style: {
2397
2417
  background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
2398
2418
  boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
2399
2419
  },
2400
- children: t("payment.open_checkout_button", "Open checkout")
2420
+ children: e("payment.open_checkout_button", "Open checkout")
2401
2421
  }
2402
2422
  )
2403
2423
  ] });
2404
2424
  }
2405
- function sr({
2406
- client: e,
2407
- onBack: t,
2425
+ function lr({
2426
+ client: t,
2427
+ onBack: e,
2408
2428
  onReopen: r,
2409
2429
  onRetry: i
2410
2430
  }) {
2411
- const { t: n } = k(), [o, s] = x(!1), [c, l] = x(!1), f = F(null);
2412
- T(() => () => {
2413
- f.current !== null && clearTimeout(f.current);
2431
+ const { t: n } = S(), [s, o] = v(!1), [c, l] = v(!1), p = F(null);
2432
+ j(() => () => {
2433
+ p.current !== null && clearTimeout(p.current);
2414
2434
  }, []);
2415
2435
  const u = async () => {
2416
- if (!o) {
2417
- s(!0), l(!1);
2436
+ if (!s) {
2437
+ o(!0), l(!1);
2418
2438
  try {
2419
- if ((await e.getUser({ force: !0 })).has_active_subscription) {
2439
+ if ((await t.getUser({ force: !0 })).has_active_subscription) {
2420
2440
  typeof window < "u" && window.postMessage({ type: "paywall_purchase" }, "*");
2421
2441
  return;
2422
2442
  }
2423
- l(!0), f.current !== null && clearTimeout(f.current), f.current = setTimeout(() => {
2424
- l(!1), f.current = null;
2443
+ l(!0), p.current !== null && clearTimeout(p.current), p.current = setTimeout(() => {
2444
+ l(!1), p.current = null;
2425
2445
  }, 5e3);
2426
2446
  } catch {
2427
2447
  l(!0);
2428
2448
  } finally {
2429
- s(!1);
2449
+ o(!1);
2430
2450
  }
2431
2451
  }
2432
2452
  };
@@ -2435,7 +2455,7 @@ function sr({
2435
2455
  "button",
2436
2456
  {
2437
2457
  type: "button",
2438
- onClick: t,
2458
+ onClick: e,
2439
2459
  class: "-ml-1 self-start rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
2440
2460
  children: n("nav.back", "← Back")
2441
2461
  }
@@ -2462,13 +2482,13 @@ function sr({
2462
2482
  {
2463
2483
  type: "button",
2464
2484
  onClick: u,
2465
- disabled: o,
2485
+ disabled: s,
2466
2486
  class: "mt-1 rounded-xl px-5 py-2.5 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 disabled:hover:brightness-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
2467
2487
  style: {
2468
2488
  background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
2469
2489
  boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
2470
2490
  },
2471
- children: o ? n("payment.checking", "Checking…") : n("payment.ive_paid", "I've paid")
2491
+ children: s ? n("payment.checking", "Checking…") : n("payment.ive_paid", "I've paid")
2472
2492
  }
2473
2493
  ),
2474
2494
  c ? /* @__PURE__ */ a("p", { class: "text-xs leading-relaxed text-gray-500", children: n("payment.still_processing", "Payment is still being processed. Please try again in a moment.") }) : null
@@ -2496,11 +2516,11 @@ function sr({
2496
2516
  )
2497
2517
  ] });
2498
2518
  }
2499
- function _t({
2500
- onContinue: e,
2501
- restored: t = !1
2519
+ function Se({
2520
+ onContinue: t,
2521
+ restored: e = !1
2502
2522
  }) {
2503
- const { t: r } = k();
2523
+ const { t: r } = S();
2504
2524
  return /* @__PURE__ */ d("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
2505
2525
  /* @__PURE__ */ a(
2506
2526
  "div",
@@ -2525,8 +2545,8 @@ function _t({
2525
2545
  ) })
2526
2546
  }
2527
2547
  ),
2528
- /* @__PURE__ */ a("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children: t ? r("modal.purchase_restored_title", "Subscription restored") : r("modal.purchase_success_title", "Payment received") }),
2529
- /* @__PURE__ */ a("p", { class: "text-sm leading-relaxed text-gray-500", children: t ? r(
2548
+ /* @__PURE__ */ a("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children: e ? r("modal.purchase_restored_title", "Subscription restored") : r("modal.purchase_success_title", "Payment received") }),
2549
+ /* @__PURE__ */ a("p", { class: "text-sm leading-relaxed text-gray-500", children: e ? r(
2530
2550
  "modal.purchase_restored_subtitle",
2531
2551
  "Welcome back — your subscription is already active."
2532
2552
  ) : r("modal.purchase_success_subtitle", "Your subscription is now active.") }),
@@ -2534,7 +2554,7 @@ function _t({
2534
2554
  "button",
2535
2555
  {
2536
2556
  type: "button",
2537
- onClick: e,
2557
+ onClick: t,
2538
2558
  class: "mt-3 rounded-xl px-5 py-2.5 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
2539
2559
  style: {
2540
2560
  background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
@@ -2545,21 +2565,21 @@ function _t({
2545
2565
  )
2546
2566
  ] });
2547
2567
  }
2548
- const lr = 10 * 6e4, cr = 5e3, dr = 3e4;
2549
- class ur {
2550
- constructor(t) {
2568
+ const cr = 10 * 6e4, dr = 5e3, ur = 3e4;
2569
+ class pr {
2570
+ constructor(e) {
2551
2571
  this.timer = null, this.timeoutTimer = null, this.visibilityHandler = null, this.focusHandler = null, this.messageHandler = null, this.stopped = !1, this.checking = !1, this.opts = {
2552
- client: t.client,
2553
- onActive: t.onActive,
2554
- onTimeout: t.onTimeout ?? (() => {
2572
+ client: e.client,
2573
+ onActive: e.onActive,
2574
+ onTimeout: e.onTimeout ?? (() => {
2555
2575
  }),
2556
- timeoutMs: t.timeoutMs ?? lr,
2557
- visibleIntervalMs: t.visibleIntervalMs ?? cr,
2558
- hiddenIntervalMs: t.hiddenIntervalMs ?? dr
2576
+ timeoutMs: e.timeoutMs ?? cr,
2577
+ visibleIntervalMs: e.visibleIntervalMs ?? dr,
2578
+ hiddenIntervalMs: e.hiddenIntervalMs ?? ur
2559
2579
  };
2560
2580
  }
2561
2581
  start() {
2562
- this.stopped || typeof document > "u" || typeof window > "u" || (this.check(), this.scheduleNext(), this.visibilityHandler = () => this.handleVisibilityChange(), document.addEventListener("visibilitychange", this.visibilityHandler), this.focusHandler = () => void this.check(), window.addEventListener("focus", this.focusHandler), this.messageHandler = (t) => this.handleMessage(t), window.addEventListener("message", this.messageHandler), this.timeoutTimer = setTimeout(() => {
2582
+ this.stopped || typeof document > "u" || typeof window > "u" || (this.check(), this.scheduleNext(), this.visibilityHandler = () => this.handleVisibilityChange(), document.addEventListener("visibilitychange", this.visibilityHandler), this.focusHandler = () => void this.check(), window.addEventListener("focus", this.focusHandler), this.messageHandler = (e) => this.handleMessage(e), window.addEventListener("message", this.messageHandler), this.timeoutTimer = setTimeout(() => {
2563
2583
  this.stopped || (this.stop(), this.opts.onTimeout());
2564
2584
  }, this.opts.timeoutMs));
2565
2585
  }
@@ -2570,9 +2590,9 @@ class ur {
2570
2590
  if (!(this.stopped || this.checking)) {
2571
2591
  this.checking = !0;
2572
2592
  try {
2573
- const t = await this.opts.client.getUser({ force: !0 });
2593
+ const e = await this.opts.client.getUser({ force: !0 });
2574
2594
  if (this.stopped) return;
2575
- t.has_active_subscription && (this.stop(), this.opts.onActive(t));
2595
+ e.has_active_subscription && (this.stop(), this.opts.onActive(e));
2576
2596
  } catch {
2577
2597
  } finally {
2578
2598
  this.checking = !1;
@@ -2589,35 +2609,40 @@ class ur {
2589
2609
  handleVisibilityChange() {
2590
2610
  typeof document > "u" || (document.visibilityState === "visible" && this.check(), this.timer !== null && (clearTimeout(this.timer), this.timer = null), this.scheduleNext());
2591
2611
  }
2592
- handleMessage(t) {
2593
- const r = t.data;
2612
+ handleMessage(e) {
2613
+ const r = e.data;
2594
2614
  !r || typeof r != "object" || r.type === "paywall_purchase" && this.check();
2595
2615
  }
2596
2616
  }
2597
- function pr() {
2617
+ function hr() {
2598
2618
  return !(typeof document > "u" || typeof window > "u" || typeof location < "u" && location.protocol === "chrome-extension:");
2599
2619
  }
2600
- const at = { open: !1, view: null, error: null }, $ = {
2620
+ const oe = {
2621
+ open: !1,
2622
+ view: null,
2623
+ error: null,
2624
+ processing: !1
2625
+ }, H = {
2601
2626
  status: "paywall_status",
2602
2627
  priceId: "paywall_price_id",
2603
2628
  sessionId: "paywall_session_id"
2604
2629
  };
2605
- class Sr {
2606
- constructor(t) {
2607
- 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 = at, this.stateListeners = /* @__PURE__ */ new Set();
2608
- const { auth: r, ownsAuth: i } = hr(t);
2609
- this.auth = r, this.ownsAuth = i, this.billing = t.client ?? new Dt({ ...t, auth: this.auth }), this.host = t.host, this.shadowMode = t.shadowMode ?? "closed", this.mountThenLoad = t.mountThenLoad ?? !0, this.inline = t.inline === !0, this.forceLocale = t.locale ?? null, this.userUnsub = this.billing.onUserChange((n) => {
2630
+ class Cr {
2631
+ constructor(e) {
2632
+ this.handle = null, this.isOpen = !1, this.listeners = /* @__PURE__ */ new Map(), this.userUnsub = null, this.authUnsub = null, this.watcher = null, this.tracker = null, this.purchased = !1, this.trialStore = null, this.trialStoreConfig = null, this.lastTrialStatus = null, this.trialExpiredFired = !1, this.lastVisibility = null, this.currentState = oe, this.stateListeners = /* @__PURE__ */ new Set();
2633
+ const { auth: r, ownsAuth: i } = gr(e);
2634
+ this.auth = r, this.ownsAuth = i, this.billing = e.client ?? new Ne({ ...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((n) => {
2610
2635
  this.emit("userChange", n);
2611
- }), this.auth && (this.authUnsub = this.auth.onAuthChange((n, o) => {
2612
- this.emit("authChange", { event: n, session: o });
2613
- })), this.initTracker(t.analytics), t.autoDetectReturn !== !1 && typeof window < "u" && queueMicrotask(() => this.checkReturn());
2636
+ }), this.auth && (this.authUnsub = this.auth.onAuthChange((n, s) => {
2637
+ this.emit("authChange", { event: n, session: s });
2638
+ })), this.initTracker(e.analytics), e.autoDetectReturn !== !1 && typeof window < "u" && queueMicrotask(() => this.checkReturn());
2614
2639
  }
2615
- initTracker(t) {
2616
- if (t === !1) return;
2617
- const r = typeof t == "object" && t !== null ? t : {};
2640
+ initTracker(e) {
2641
+ if (e === !1) return;
2642
+ const r = typeof e == "object" && e !== null ? e : {};
2618
2643
  if (r.enabled === !1) return;
2619
2644
  const i = r.endpoint ?? `${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;
2620
- this.tracker = new Nt({
2645
+ this.tracker = new He({
2621
2646
  endpoint: i,
2622
2647
  paywallId: this.billing.paywallId,
2623
2648
  capabilities: this.billing.capabilities,
@@ -2680,16 +2705,16 @@ class Sr {
2680
2705
  * Самый частый кейс — `track('app_opened')` от хоста сразу после загрузки
2681
2706
  * приложения, чтобы зафиксировать воронку до открытия пейвола.
2682
2707
  */
2683
- track(t, r) {
2684
- this.tracker?.track(t, r);
2708
+ track(e, r) {
2709
+ this.tracker?.track(e, r);
2685
2710
  }
2686
2711
  /**
2687
2712
  * Удобный шорткат вместо `paywall.on('userChange', cb)` — самый частый
2688
2713
  * паттерн в host-коде, поэтому отдельный named метод. Колбек получает
2689
2714
  * last-known user из кеша синхронно через microtask, если он есть.
2690
2715
  */
2691
- onUserChange(t) {
2692
- return this.on("userChange", t);
2716
+ onUserChange(e) {
2717
+ return this.on("userChange", e);
2693
2718
  }
2694
2719
  /**
2695
2720
  * Заменить cachedBootstrap живыми данными — для preview-режима в редакторе
@@ -2701,8 +2726,8 @@ class Sr {
2701
2726
  * работает и в production-режиме, но конкуренция с revalidate'ом из сети
2702
2727
  * почти всегда нежелательна.
2703
2728
  */
2704
- setBootstrap(t) {
2705
- this.billing.setBootstrap(t);
2729
+ setBootstrap(e) {
2730
+ this.billing.setBootstrap(e);
2706
2731
  }
2707
2732
  /**
2708
2733
  * Сменить force-locale на лету — для live-preview редактора админки, когда
@@ -2712,30 +2737,30 @@ class Sr {
2712
2737
  * Передай `null`/`undefined`, чтобы вернуть автоматическую резолв-логику
2713
2738
  * (navigator.language → locale_default).
2714
2739
  */
2715
- setLocale(t) {
2716
- const r = t ?? null;
2740
+ setLocale(e) {
2741
+ const r = e ?? null;
2717
2742
  r !== this.forceLocale && (this.forceLocale = r, this.handle && this.handle.update({ locale: r }));
2718
2743
  }
2719
- on(t, r) {
2720
- let i = this.listeners.get(t);
2721
- return i || (i = /* @__PURE__ */ new Set(), this.listeners.set(t, i)), i.add(r), () => i.delete(r);
2744
+ on(e, r) {
2745
+ let i = this.listeners.get(e);
2746
+ return i || (i = /* @__PURE__ */ new Set(), this.listeners.set(e, i)), i.add(r), () => i.delete(r);
2722
2747
  }
2723
- off(t, r) {
2724
- this.listeners.get(t)?.delete(r);
2748
+ off(e, r) {
2749
+ this.listeners.get(e)?.delete(r);
2725
2750
  }
2726
- emit(t, ...r) {
2727
- const i = this.listeners.get(t);
2751
+ emit(e, ...r) {
2752
+ const i = this.listeners.get(e);
2728
2753
  if (!i) return;
2729
2754
  const n = r[0];
2730
- for (const o of i)
2755
+ for (const s of i)
2731
2756
  try {
2732
- o(n);
2733
- } catch (s) {
2734
- typeof console < "u" && console.error("[paywall] listener error", s);
2757
+ s(n);
2758
+ } catch (o) {
2759
+ typeof console < "u" && console.error("[paywall] listener error", o);
2735
2760
  }
2736
2761
  }
2737
- open(t = {}) {
2738
- this.openInternal("layout", t);
2762
+ open(e = {}) {
2763
+ this.openInternal("layout", e);
2739
2764
  }
2740
2765
  /**
2741
2766
  * Прогревает bootstrap-кеш и balance-кеш заранее, без открытия модалки.
@@ -2749,9 +2774,9 @@ class Sr {
2749
2774
  * Вызывать можно сколько угодно раз — последующие вызовы возвращают cached
2750
2775
  * Promise (BillingClient уже дедуплицирует).
2751
2776
  */
2752
- async preload(t = {}) {
2777
+ async preload(e = {}) {
2753
2778
  try {
2754
- await this.billing.bootstrap({ signal: t.signal }), this.billing.auth && await this.billing.getBalances({ signal: t.signal });
2779
+ await this.billing.bootstrap({ signal: e.signal }), this.billing.auth && await this.billing.getBalances({ signal: e.signal });
2755
2780
  } catch {
2756
2781
  }
2757
2782
  }
@@ -2765,8 +2790,8 @@ class Sr {
2765
2790
  * Contact Support-ссылку в `current_session`-блоке (там Back возвращает
2766
2791
  * к layout).
2767
2792
  */
2768
- openSupport(t = {}) {
2769
- this.openInternal("support", t);
2793
+ openSupport(e = {}) {
2794
+ this.openInternal("support", e);
2770
2795
  }
2771
2796
  /**
2772
2797
  * Открывает модалку сразу с auth-gate (логин/регистрация), без layout с
@@ -2780,8 +2805,8 @@ class Sr {
2780
2805
  *
2781
2806
  * Триал не блокирует этот флоу — auth не connect'ится с trial-механикой.
2782
2807
  */
2783
- openAuth(t = {}) {
2784
- this.auth && this.openInternal("auth", { ...t, skipTrial: !0 });
2808
+ openAuth(e = {}) {
2809
+ this.auth && this.openInternal("auth", { ...e, skipTrial: !0 });
2785
2810
  }
2786
2811
  /**
2787
2812
  * Шорткат над `openAuth()` — открывает модалку сразу на signin-форме.
@@ -2791,8 +2816,8 @@ class Sr {
2791
2816
  * - `paywall.openSignup()` — «новая регистрация»
2792
2817
  * Без managed-auth — no-op.
2793
2818
  */
2794
- openSignin(t = {}) {
2795
- this.auth && this.openInternal("auth", { ...t, skipTrial: !0, authMode: "signin" });
2819
+ openSignin(e = {}) {
2820
+ this.auth && this.openInternal("auth", { ...e, skipTrial: !0, authMode: "signin" });
2796
2821
  }
2797
2822
  /**
2798
2823
  * Открывает модалку с auth-gate сразу в режиме регистрации (signup-mode
@@ -2801,30 +2826,43 @@ class Sr {
2801
2826
  * соблюдается admin-конфиг.
2802
2827
  * Без managed-auth — no-op.
2803
2828
  */
2804
- openSignup(t = {}) {
2805
- this.auth && this.openInternal("auth", { ...t, skipTrial: !0, authMode: "signup" });
2829
+ openSignup(e = {}) {
2830
+ this.auth && this.openInternal("auth", { ...e, skipTrial: !0, authMode: "signup" });
2806
2831
  }
2807
2832
  /**
2808
- * Direct-checkout: открыть модалку и сразу перейти к /start-checkout по
2809
- * конкретной цене, минуя layout с тарифами. Полезно когда host-приложение
2810
- * рендерит pricing-карточки/таблицу собственным UI и хочет, чтобы клик по
2811
- * «Buy / Get this plan» вёл прямо в платёжного провайдера, без второго
2812
- * выбора плана в модалке SDK.
2833
+ * Direct-checkout: создать checkout-URL по конкретной цене и сразу открыть
2834
+ * платёжного провайдера, минуя layout с тарифами. Полезно когда
2835
+ * host-приложение рендерит pricing-карточки/таблицу собственным UI и
2836
+ * хочет, чтобы клик по «Buy / Get this plan» вёл прямо в Stripe/Paddle.
2813
2837
  *
2814
- * Что переиспользуется из обычного `open()`-flow:
2815
- * - `checkout_mode='preauth'` + managed-auth auth-gate (форма signin'а),
2816
- * после успеха auto-resume в createCheckout;
2817
- * - popup_blocked / awaiting_payment / purchase_success views;
2818
- * - UserWatcher polling после `checkout_started`;
2819
- * - аналитика `checkout_started`/`purchase_completed`/`purchase_failed`.
2838
+ * **Late-mount UX.** В отличие от `open()`, модалка не появляется во время
2839
+ * фоновой работы (bootstrap + visibility/trial gates + createCheckout).
2840
+ * Хост на этой фазе показывает busy-state прямо на своей кнопке (через
2841
+ * `state.processing === true` из `paywall.getState()` — или автоматически
2842
+ * через `<PaywallButton priceId>` в sdk-react). Модалка монтируется
2843
+ * ТОЛЬКО когда реально нужна UI:
2844
+ * - `checkout_mode='preauth'` + managed-auth + не залогинен → auth-gate
2845
+ * (форма signin'а); после успеха auto-resume в createCheckout.
2846
+ * - popup провайдера заблокирован браузером → popup_blocked view с
2847
+ * retry-кнопкой под fresh user gesture.
2848
+ * - popup открылся успешно → awaiting_payment view (индикатор «оплати
2849
+ * в новой вкладке» + I've paid).
2820
2850
  *
2821
- * Что отличается от `open()`:
2822
- * - layout с тарифами не показывается ни на один кадр (включая откат после
2823
- * ошибки модалка закрывается, эмитится `error`);
2824
- * - already-paid сценарий (cached user, fresh bootstrap, preauth-resume,
2825
- * 409 hasActivePurchase от бэка) НЕ показывает restored success-view,
2826
- * эмитит `purchase_completed{restored:true}` и закрывает/не открывает
2827
- * модалку. Host сам решает как сообщить юзеру.
2851
+ * Что эмитится без модалки:
2852
+ * - `purchase_completed{restored:true, priceId}` когда юзер уже подписан
2853
+ * (cached user, fresh bootstrap, или 409 hasActivePurchase от бэка)
2854
+ * headless reject;
2855
+ * - `error` когда createCheckout упал или identity.email отсутствует;
2856
+ * - `visibility_blocked` / `trial_blocked` — стандартные gate-эвенты.
2857
+ *
2858
+ * Что эмитится одновременно с модалкой:
2859
+ * - `checkout_started{priceId, url, acquiring}` ровно когда headless URL
2860
+ * получен, ДО mount'а awaiting_payment/popup_blocked.
2861
+ *
2862
+ * Offer (countdown-скидка) автоматически резолвится из cached offers'ов
2863
+ * через `getOfferForPrice(priceId)` и передаётся в createCheckout как
2864
+ * `offerId` — чтобы duration_minutes-офферы тоже применились на бэке
2865
+ * (для них нет server-side таймера, без явного offer-id скидка теряется).
2828
2866
  *
2829
2867
  * Требования:
2830
2868
  * - `identity.email` должен быть выставлен (через `opts.identity`, либо
@@ -2833,21 +2871,145 @@ class Sr {
2833
2871
  * - В `checkout_mode='preauth'` без managed-auth — backend требует
2834
2872
  * email-юзера; убедись что `identity.email` явно задан.
2835
2873
  *
2836
- * Без модалки/полностью headless (когда host рендерит свой checkout-UI и
2837
- * хочет только URL) — используй `paywall.billing.createCheckout({priceId})`
2838
- * напрямую, но тогда auth-gate / popup_blocked / awaiting_payment придётся
2839
- * рисовать самостоятельно.
2874
+ * Без модалки совсем (когда host рендерит свой awaiting-payment экран) —
2875
+ * используй `paywall.billing.createCheckout({priceId, offerId})` напрямую,
2876
+ * но тогда auth-gate / popup_blocked / awaiting_payment придётся рисовать
2877
+ * самостоятельно.
2840
2878
  */
2841
- checkout(t, r = {}) {
2842
- if (r.renew !== !0 && this.billing.getCachedUser()?.has_active_subscription) {
2879
+ checkout(e, r = {}) {
2880
+ if (r.identity && this.billing.setIdentity(r.identity), r.renew !== !0 && this.billing.getCachedUser()?.has_active_subscription) {
2843
2881
  this.emit("purchase_completed", {
2844
- priceId: t,
2882
+ priceId: e,
2845
2883
  sessionId: null,
2846
2884
  restored: !0
2847
2885
  });
2848
2886
  return;
2849
2887
  }
2850
- this.openInternal("checkout", { ...r, checkoutPriceId: t });
2888
+ this.runDirectCheckout(e, r);
2889
+ }
2890
+ /** Headless prep-work для `checkout(priceId, opts)`: bootstrap → gates →
2891
+ * preauth check → createCheckout → mount модалки с финальным view.
2892
+ * Вынесено отдельным методом ради чистого async/await flow вместо вложенных
2893
+ * then-chain'ов (5+ ветвей). Любая ошибка не пробрасывается наружу: эмитим
2894
+ * через `paywall.emit('error')` и выходим — host подписан на `error`-event. */
2895
+ async runDirectCheckout(e, r) {
2896
+ const i = r.renew === !0, n = r.skipTrial === !0, s = r.skipVisibility === !0;
2897
+ this.applyProcessing(!0);
2898
+ const o = () => {
2899
+ this.applyProcessing(!1);
2900
+ };
2901
+ let c;
2902
+ try {
2903
+ c = await this.billing.bootstrap();
2904
+ } catch (w) {
2905
+ const A = w instanceof L ? w : new L("unknown", "Failed to load paywall", { cause: w });
2906
+ this.emit("error", A), o();
2907
+ return;
2908
+ }
2909
+ if (!s) {
2910
+ const w = c.settings.visibility;
2911
+ if (w && (this.lastVisibility = w, !w.visible)) {
2912
+ this.emit("visibility_blocked", w), o();
2913
+ return;
2914
+ }
2915
+ }
2916
+ if (!n && await this.checkTrialBeforeCheckout(c)) {
2917
+ o();
2918
+ return;
2919
+ }
2920
+ if (!i && c.user?.has_active_subscription) {
2921
+ this.emit("purchase_completed", {
2922
+ priceId: e,
2923
+ sessionId: null,
2924
+ restored: !0
2925
+ }), o();
2926
+ return;
2927
+ }
2928
+ const l = c.settings.checkout_mode ?? "guest", p = this.auth?.getCachedSession() ?? null, u = !!p && !p.user.is_anonymous;
2929
+ if (l === "preauth" && !!this.auth && !u) {
2930
+ this.purchased = !1, this.mountAndShow("auth", {
2931
+ renew: i,
2932
+ authMode: "signin",
2933
+ checkoutPriceId: e
2934
+ });
2935
+ return;
2936
+ }
2937
+ const _ = this.getOfferForPrice(e);
2938
+ let h;
2939
+ try {
2940
+ h = await this.billing.createCheckout({
2941
+ priceId: e,
2942
+ offerId: _?.offer.id,
2943
+ ignoreActivePurchase: i
2944
+ });
2945
+ } catch (w) {
2946
+ if (w instanceof L && w.code === "already_purchased") {
2947
+ try {
2948
+ await this.billing.getUser({ force: !0 });
2949
+ } catch {
2950
+ }
2951
+ this.emit("purchase_completed", {
2952
+ priceId: e,
2953
+ sessionId: null,
2954
+ restored: !0
2955
+ }), o();
2956
+ return;
2957
+ }
2958
+ const A = w instanceof L ? w : new L("checkout_failed", "Checkout failed", { cause: w });
2959
+ this.emit("error", A), o();
2960
+ return;
2961
+ }
2962
+ if (this.emit("checkout_started", {
2963
+ priceId: e,
2964
+ url: h.url,
2965
+ acquiring: h.acquiring
2966
+ }), this.startUserWatcher(), typeof window > "u" || !h.url) {
2967
+ this.mountAndShow("awaiting_payment", {
2968
+ renew: i,
2969
+ checkoutPriceId: e,
2970
+ checkoutUrl: h.url
2971
+ });
2972
+ return;
2973
+ }
2974
+ const k = window.open(h.url, "_blank");
2975
+ if (this.purchased = !1, k) {
2976
+ try {
2977
+ k.opener = null;
2978
+ } catch {
2979
+ }
2980
+ this.mountAndShow("awaiting_payment", {
2981
+ renew: i,
2982
+ checkoutPriceId: e,
2983
+ checkoutUrl: h.url
2984
+ });
2985
+ } else
2986
+ this.mountAndShow("popup_blocked", {
2987
+ renew: i,
2988
+ checkoutPriceId: e,
2989
+ checkoutUrl: h.url
2990
+ });
2991
+ }
2992
+ /** Trial-check без mount'а (для late-mount direct-checkout). Возвращает
2993
+ * true если trial заблокировал — caller должен прекратить flow. На любой
2994
+ * storage-ошибке log+продолжаем (не блокируем продажу). */
2995
+ async checkTrialBeforeCheckout(e) {
2996
+ const r = e.settings.trial;
2997
+ if (!r) return !1;
2998
+ const i = this.ensureTrialStore(r);
2999
+ try {
3000
+ const n = await i.check();
3001
+ if (this.lastTrialStatus = n, n.mode === "none") return !1;
3002
+ if (n.blocked) {
3003
+ const s = await i.recordBlock();
3004
+ return this.lastTrialStatus = s, this.emit("trial_blocked", s), !0;
3005
+ }
3006
+ return this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), !1;
3007
+ } catch (n) {
3008
+ return typeof console < "u" && console.warn("[paywall] trial check failed", n), !1;
3009
+ }
3010
+ }
3011
+ applyProcessing(e) {
3012
+ this.currentState.processing !== e && this.applyState({ ...this.currentState, processing: e });
2851
3013
  }
2852
3014
  /**
2853
3015
  * Headless anonymous signin без открытия модалки. Внутри:
@@ -2862,70 +3024,70 @@ class Sr {
2862
3024
  */
2863
3025
  signInAnonymously() {
2864
3026
  return this.auth ? this.auth.signInAnonymously() : Promise.reject(
2865
- new O(
3027
+ new L(
2866
3028
  "invalid_config",
2867
3029
  "signInAnonymously requires managed-auth. Pass `auth: true` to PaywallUI."
2868
3030
  )
2869
3031
  );
2870
3032
  }
2871
- openInternal(t, r) {
3033
+ openInternal(e, r) {
2872
3034
  r.identity && this.billing.setIdentity(r.identity), this.purchased = !1;
2873
- const i = r.skipTrial === !0 || t === "support", n = r.skipVisibility === !0 || t === "support" || t === "auth", o = r.renew === !0, s = r.checkoutPriceId;
3035
+ const i = r.skipTrial === !0 || e === "support", n = r.skipVisibility === !0 || e === "support" || e === "auth", s = r.renew === !0;
2874
3036
  if (i && n) {
2875
- this.mountAndShow(t, { renew: o, authMode: r.authMode, checkoutPriceId: s });
3037
+ this.mountAndShow(e, { renew: s, authMode: r.authMode });
2876
3038
  return;
2877
3039
  }
2878
- const c = this.billing.getCachedBootstrap();
2879
- if (c) {
2880
- this.runOpenGates(t, c, { skipTrial: i, skipVisibility: n, renew: o, checkoutPriceId: s });
3040
+ const o = this.billing.getCachedBootstrap();
3041
+ if (o) {
3042
+ this.runOpenGates(e, o, { skipTrial: i, skipVisibility: n, renew: s });
2881
3043
  return;
2882
3044
  }
2883
3045
  if (this.mountThenLoad) {
2884
- this.mountAndShow(t, { renew: o, checkoutPriceId: s }), this.billing.bootstrap().then((l) => this.runDelayedGates(l, { skipTrial: i, skipVisibility: n })).catch(() => {
3046
+ this.mountAndShow(e, { renew: s }), this.billing.bootstrap().then((c) => this.runDelayedGates(c, { skipTrial: i, skipVisibility: n })).catch(() => {
2885
3047
  });
2886
3048
  return;
2887
3049
  }
2888
3050
  this.billing.bootstrap().then(
2889
- (l) => this.runOpenGates(t, l, { skipTrial: i, skipVisibility: n, renew: o, checkoutPriceId: s })
3051
+ (c) => this.runOpenGates(e, c, { skipTrial: i, skipVisibility: n, renew: s })
2890
3052
  ).catch(() => {
2891
- this.mountAndShow(t, { renew: o, checkoutPriceId: s });
3053
+ this.mountAndShow(e, { renew: s });
2892
3054
  });
2893
3055
  }
2894
3056
  /** Применить gates ПОСЛЕ того, как модалка уже смонтирована (mount-then-load
2895
3057
  * путь). Если gate блокирует — close() + emit. Если юзер уже сам закрыл
2896
3058
  * модалку до резолва bootstrap'а — no-op (isOpen=false). */
2897
- runDelayedGates(t, r) {
3059
+ runDelayedGates(e, r) {
2898
3060
  if (!this.isOpen) return;
2899
3061
  if (!r.skipVisibility) {
2900
- const o = t.settings.visibility;
2901
- if (o && (this.lastVisibility = o, !o.visible)) {
2902
- this.close(), this.emit("visibility_blocked", o);
3062
+ const s = e.settings.visibility;
3063
+ if (s && (this.lastVisibility = s, !s.visible)) {
3064
+ this.close(), this.emit("visibility_blocked", s);
2903
3065
  return;
2904
3066
  }
2905
3067
  }
2906
3068
  if (r.skipTrial) return;
2907
- const i = t.settings.trial;
3069
+ const i = e.settings.trial;
2908
3070
  if (!i) return;
2909
3071
  const n = this.ensureTrialStore(i);
2910
- n.check().then(async (o) => {
2911
- if (this.isOpen && (this.lastTrialStatus = o, o.mode !== "none")) {
2912
- if (o.blocked) {
2913
- const s = await n.recordBlock();
2914
- if (this.lastTrialStatus = s, !this.isOpen) return;
2915
- this.close(), this.emit("trial_blocked", s);
3072
+ n.check().then(async (s) => {
3073
+ if (this.isOpen && (this.lastTrialStatus = s, s.mode !== "none")) {
3074
+ if (s.blocked) {
3075
+ const o = await n.recordBlock();
3076
+ if (this.lastTrialStatus = o, !this.isOpen) return;
3077
+ this.close(), this.emit("trial_blocked", o);
2916
3078
  return;
2917
3079
  }
2918
3080
  this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired"));
2919
3081
  }
2920
- }).catch((o) => {
2921
- typeof console < "u" && console.warn("[paywall] trial check failed", o);
3082
+ }).catch((s) => {
3083
+ typeof console < "u" && console.warn("[paywall] trial check failed", s);
2922
3084
  });
2923
3085
  }
2924
3086
  // Порядок гейтов: visibility → trial. Country-mismatch ≠ trial-block, и
2925
3087
  // вести trial-стейт «осталось N показов» под юзером, который вообще не
2926
3088
  // должен увидеть пейвол по таргетингу — бессмысленно: при возврате в
2927
3089
  // правильную страну он окажется со «слипшимся» триал-счётчиком.
2928
- runOpenGates(t, r, i) {
3090
+ runOpenGates(e, r, i) {
2929
3091
  if (!i.skipVisibility) {
2930
3092
  const n = r.settings.visibility;
2931
3093
  if (n && (this.lastVisibility = n, !n.visible)) {
@@ -2934,80 +3096,82 @@ class Sr {
2934
3096
  }
2935
3097
  }
2936
3098
  if (i.skipTrial) {
2937
- this.mountAndShow(t, { renew: i.renew, checkoutPriceId: i.checkoutPriceId });
3099
+ this.mountAndShow(e, { renew: i.renew });
2938
3100
  return;
2939
3101
  }
2940
- this.gateThroughTrial(t, r, i.renew, i.checkoutPriceId);
3102
+ this.gateThroughTrial(e, r, i.renew);
2941
3103
  }
2942
- gateThroughTrial(t, r, i, n) {
2943
- const o = r.settings.trial;
2944
- if (!o) {
2945
- this.mountAndShow(t, { renew: i, checkoutPriceId: n });
3104
+ gateThroughTrial(e, r, i) {
3105
+ const n = r.settings.trial;
3106
+ if (!n) {
3107
+ this.mountAndShow(e, { renew: i });
2946
3108
  return;
2947
3109
  }
2948
- const s = this.ensureTrialStore(o);
2949
- s.check().then(async (c) => {
2950
- if (this.lastTrialStatus = c, c.mode === "none") {
2951
- this.mountAndShow(t, { renew: i, checkoutPriceId: n });
3110
+ const s = this.ensureTrialStore(n);
3111
+ s.check().then(async (o) => {
3112
+ if (this.lastTrialStatus = o, o.mode === "none") {
3113
+ this.mountAndShow(e, { renew: i });
2952
3114
  return;
2953
3115
  }
2954
- if (c.blocked) {
2955
- const l = await s.recordBlock();
2956
- this.lastTrialStatus = l, this.emit("trial_blocked", l);
3116
+ if (o.blocked) {
3117
+ const c = await s.recordBlock();
3118
+ this.lastTrialStatus = c, this.emit("trial_blocked", c);
2957
3119
  return;
2958
3120
  }
2959
- this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(t, { renew: i, checkoutPriceId: n });
2960
- }).catch((c) => {
2961
- typeof console < "u" && console.warn("[paywall] trial check failed", c), this.mountAndShow(t, { renew: i, checkoutPriceId: n });
3121
+ this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(e, { renew: i });
3122
+ }).catch((o) => {
3123
+ typeof console < "u" && console.warn("[paywall] trial check failed", o), this.mountAndShow(e, { renew: i });
2962
3124
  });
2963
3125
  }
2964
- ensureTrialStore(t) {
2965
- if (this.trialStore && this.trialStoreConfig && wr(this.trialStoreConfig, t))
3126
+ ensureTrialStore(e) {
3127
+ if (this.trialStore && this.trialStoreConfig && mr(this.trialStoreConfig, e))
2966
3128
  return this.trialStore;
2967
- this.trialStoreConfig = t;
3129
+ this.trialStoreConfig = e;
2968
3130
  const r = this.billing.createTrialStore;
2969
- return this.trialStore = typeof r == "function" ? r.call(this.billing, t) : Kt(this.billing.getStorage(), this.billing.paywallId, t), this.trialStore;
3131
+ return this.trialStore = typeof r == "function" ? r.call(this.billing, e) : Ye(this.billing.getStorage(), this.billing.paywallId, e), this.trialStore;
2970
3132
  }
2971
- mountAndShow(t, r = {}) {
2972
- const i = r.renew === !0, n = r.authMode, o = t === "checkout" ? r.checkoutPriceId ?? null : null;
3133
+ mountAndShow(e, r = {}) {
3134
+ const i = r.renew === !0, n = r.authMode, o = e === "auth" || e === "awaiting_payment" || e === "popup_blocked" ? r.checkoutPriceId ?? null : null, c = e === "awaiting_payment" || e === "popup_blocked" ? r.checkoutUrl ?? null : null;
2973
3135
  if (this.handle) {
2974
3136
  this.isOpen = !0, this.handle.update({
2975
3137
  open: !0,
2976
- initialView: t,
3138
+ initialView: e,
2977
3139
  initialAuthMode: n,
2978
3140
  initialCheckoutPriceId: o,
3141
+ initialCheckoutUrl: c,
2979
3142
  purchased: !1,
2980
3143
  renew: i
2981
3144
  }), this.emit("open");
2982
3145
  return;
2983
3146
  }
2984
- this.isOpen = !0, this.handle = Xt(
2985
- ir,
3147
+ this.isOpen = !0, this.handle = Je(
3148
+ nr,
2986
3149
  {
2987
3150
  client: this.billing,
2988
3151
  open: !0,
2989
- initialView: t,
3152
+ initialView: e,
2990
3153
  initialAuthMode: n,
2991
3154
  initialCheckoutPriceId: o,
3155
+ initialCheckoutUrl: c,
2992
3156
  purchased: !1,
2993
3157
  renew: i,
2994
3158
  onClose: () => this.close(),
2995
- onEvent: (s, c) => {
2996
- this.emit(s, c), s === "checkout_started" && this.startUserWatcher();
3159
+ onEvent: (l, p) => {
3160
+ this.emit(l, p), l === "checkout_started" && this.startUserWatcher();
2997
3161
  },
2998
- onState: (s) => this.applyState(s),
3162
+ onState: (l) => this.applyState(l),
2999
3163
  inline: this.inline,
3000
3164
  locale: this.forceLocale
3001
3165
  },
3002
3166
  { host: this.host, shadowMode: this.shadowMode, inline: this.inline }
3003
3167
  ), this.emit("open");
3004
3168
  }
3005
- applyState(t) {
3006
- if (!fr(this.currentState, t)) {
3007
- this.currentState = t;
3169
+ applyState(e) {
3170
+ if (!wr(this.currentState, e)) {
3171
+ this.currentState = e;
3008
3172
  for (const r of this.stateListeners)
3009
3173
  try {
3010
- r(t);
3174
+ r(e);
3011
3175
  } catch (i) {
3012
3176
  console.warn("[paywall] onStateChange listener threw", i);
3013
3177
  }
@@ -3034,24 +3198,24 @@ class Sr {
3034
3198
  *
3035
3199
  * Возвращает unsubscribe.
3036
3200
  */
3037
- onStateChange(t, r = {}) {
3038
- this.stateListeners.add(t);
3201
+ onStateChange(e, r = {}) {
3202
+ this.stateListeners.add(e);
3039
3203
  const i = r.immediate ?? "microtask";
3040
3204
  if (i !== "none") {
3041
3205
  const n = this.currentState;
3042
3206
  if (i === "sync")
3043
3207
  try {
3044
- t(n);
3045
- } catch (o) {
3046
- console.warn("[paywall] onStateChange initial sync threw", o);
3208
+ e(n);
3209
+ } catch (s) {
3210
+ console.warn("[paywall] onStateChange initial sync threw", s);
3047
3211
  }
3048
3212
  else
3049
3213
  queueMicrotask(() => {
3050
- this.stateListeners.has(t) && t(n);
3214
+ this.stateListeners.has(e) && e(n);
3051
3215
  });
3052
3216
  }
3053
3217
  return () => {
3054
- this.stateListeners.delete(t);
3218
+ this.stateListeners.delete(e);
3055
3219
  };
3056
3220
  }
3057
3221
  /** Sync-доступ к последнему известному статусу триала. null — `paywall.open()`
@@ -3074,8 +3238,8 @@ class Sr {
3074
3238
  * pricing-страниц/карточек на сайте, где host хочет показать те же цены,
3075
3239
  * что и в модалке, не вытаскивая bootstrap руками.
3076
3240
  */
3077
- getPrices(t = {}) {
3078
- return this.billing.getPrices(t);
3241
+ getPrices(e = {}) {
3242
+ return this.billing.getPrices(e);
3079
3243
  }
3080
3244
  /** Sync-снимок цен. null — bootstrap ещё не загружали. */
3081
3245
  getCachedPrices() {
@@ -3102,13 +3266,13 @@ class Sr {
3102
3266
  * этого использовать React-хук `usePaywallOffer(priceId)` из sdk-react
3103
3267
  * либо обёртку поверх `setInterval(1000)` + повторный вызов этого метода.
3104
3268
  */
3105
- getOfferForPrice(t) {
3269
+ getOfferForPrice(e) {
3106
3270
  const r = this.billing.getCachedOffers();
3107
3271
  if (!r) return null;
3108
- const i = H(r, t);
3109
- return i ? $t(i, {
3272
+ const i = N(r, e);
3273
+ return i ? $e(i, {
3110
3274
  now: Date.now(),
3111
- readStart: Ht
3275
+ readStart: Ve
3112
3276
  }) : null;
3113
3277
  }
3114
3278
  /** Снимок текущего «языка юзера» — proxy над `billing.getUserLanguage()`.
@@ -3138,25 +3302,25 @@ class Sr {
3138
3302
  * `getVisibility()` / `getTrialStatus()` видели свежие данные после первого
3139
3303
  * `getAccess()`, а не только после первого `open()`.
3140
3304
  */
3141
- async getAccess(t = {}) {
3305
+ async getAccess(e = {}) {
3142
3306
  let r = this.billing.getCachedBootstrap();
3143
3307
  if (!r)
3144
3308
  try {
3145
- r = await this.billing.bootstrap({ signal: t.signal });
3309
+ r = await this.billing.bootstrap({ signal: e.signal });
3146
3310
  } catch {
3147
- const s = this.billing.getCachedUser();
3148
- return s?.has_active_subscription ? {
3311
+ const o = this.billing.getCachedUser();
3312
+ return o?.has_active_subscription ? {
3149
3313
  access: "granted",
3150
3314
  reason: "has_subscription",
3151
3315
  visibility: null,
3152
3316
  trial: null,
3153
- user: s
3317
+ user: o
3154
3318
  } : {
3155
3319
  access: "blocked",
3156
3320
  reason: "no_subscription",
3157
3321
  visibility: null,
3158
3322
  trial: null,
3159
- user: s
3323
+ user: o
3160
3324
  };
3161
3325
  }
3162
3326
  const i = r.user ?? null;
@@ -3169,23 +3333,23 @@ class Sr {
3169
3333
  user: i
3170
3334
  };
3171
3335
  let n = null;
3172
- if (!t.skipVisibility) {
3173
- const s = r.settings.visibility;
3174
- if (s && (n = s, this.lastVisibility = s, !s.visible))
3336
+ if (!e.skipVisibility) {
3337
+ const o = r.settings.visibility;
3338
+ if (o && (n = o, this.lastVisibility = o, !o.visible))
3175
3339
  return { access: "granted", reason: "visibility_blocked", visibility: n, trial: null, user: i };
3176
3340
  }
3177
- let o = null;
3178
- if (!t.skipTrial) {
3179
- const s = r.settings.trial;
3180
- if (s)
3341
+ let s = null;
3342
+ if (!e.skipTrial) {
3343
+ const o = r.settings.trial;
3344
+ if (o)
3181
3345
  try {
3182
- if (o = await this.ensureTrialStore(s).check(), this.lastTrialStatus = o, o.blocked)
3183
- return { access: "granted", reason: "trial_blocked", visibility: n, trial: o, user: i };
3346
+ if (s = await this.ensureTrialStore(o).check(), this.lastTrialStatus = s, s.blocked)
3347
+ return { access: "granted", reason: "trial_blocked", visibility: n, trial: s, user: i };
3184
3348
  } catch (c) {
3185
3349
  typeof console < "u" && console.warn("[paywall] getAccess: trial check failed", c);
3186
3350
  }
3187
3351
  }
3188
- return { access: "blocked", reason: "no_subscription", visibility: n, trial: o, user: i };
3352
+ return { access: "blocked", reason: "no_subscription", visibility: n, trial: s, user: i };
3189
3353
  }
3190
3354
  /** Сбросить состояние триала в storage. Полезно для дев-режима / админ-кнопки
3191
3355
  * «прогнать сценарий заново». В проде хост обычно не дёргает. */
@@ -3199,9 +3363,9 @@ class Sr {
3199
3363
  // В extension popup runtime — no-op (popup не доживёт). Там полагаемся на
3200
3364
  // bootstrap при следующем открытии.
3201
3365
  startUserWatcher() {
3202
- this.watcher || pr() && (this.watcher = new ur({
3366
+ this.watcher || hr() && (this.watcher = new pr({
3203
3367
  client: this.billing,
3204
- onActive: (t) => {
3368
+ onActive: (e) => {
3205
3369
  this.watcher = null, this.emit("purchase_completed", { priceId: null, sessionId: null });
3206
3370
  const r = this.billing.getCachedBootstrap()?.settings.success_redirect_url;
3207
3371
  if (r && typeof window < "u")
@@ -3218,7 +3382,7 @@ class Sr {
3218
3382
  }), this.watcher.start());
3219
3383
  }
3220
3384
  close() {
3221
- !this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(at), this.emit("close"));
3385
+ !this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(oe), this.emit("close"));
3222
3386
  }
3223
3387
  /**
3224
3388
  * Сканирует текущий URL на маркеры возврата с checkout и эмитит
@@ -3228,79 +3392,79 @@ class Sr {
3228
3392
  */
3229
3393
  checkReturn() {
3230
3394
  if (typeof window > "u") return;
3231
- const t = new URL(window.location.href), r = St(t.hash.replace(/^#/, "")), i = St(t.search.replace(/^\?/, "")), n = r ?? i;
3395
+ const e = new URL(window.location.href), r = Ce(e.hash.replace(/^#/, "")), i = Ce(e.search.replace(/^\?/, "")), n = r ?? i;
3232
3396
  n && (n.status === "paid" ? (this.emit("purchase_completed", {
3233
3397
  priceId: n.priceId,
3234
3398
  sessionId: n.sessionId
3235
- }), mr(n)) : (n.status === "failed" || n.status === "cancelled") && this.emit("purchase_failed", { reason: n.status }), br(t));
3399
+ }), br(n)) : (n.status === "failed" || n.status === "cancelled") && this.emit("purchase_failed", { reason: n.status }), yr(e));
3236
3400
  }
3237
3401
  destroy() {
3238
- 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 = at;
3402
+ this.tracker?.destroy(), this.tracker = null, this.listeners.clear(), this.stateListeners.clear(), this.watcher?.stop(), this.watcher = null, this.userUnsub?.(), this.userUnsub = null, this.authUnsub?.(), this.authUnsub = null, this.ownsAuth && this.auth && this.auth.destroy?.(), this.ownsAuth = !1, this.billing.destroy?.(), this.handle?.unmount(), this.handle = null, this.isOpen = !1, this.currentState = oe;
3239
3403
  }
3240
3404
  }
3241
- function hr(e) {
3242
- if (!e.auth) return { auth: void 0, ownsAuth: !1 };
3243
- if (e.auth instanceof ct || gr(e.auth))
3244
- return { auth: e.auth, ownsAuth: !1 };
3245
- const t = e.auth === !0 ? {} : e.auth;
3405
+ function gr(t) {
3406
+ if (!t.auth) return { auth: void 0, ownsAuth: !1 };
3407
+ if (t.auth instanceof de || fr(t.auth))
3408
+ return { auth: t.auth, ownsAuth: !1 };
3409
+ const e = t.auth === !0 ? {} : t.auth;
3246
3410
  return {
3247
- auth: new ct({
3248
- paywallId: e.paywallId,
3249
- apiOrigin: t.apiOrigin ?? e.apiOrigin,
3250
- storage: t.storage ?? e.storage,
3251
- fetch: t.fetch ?? e.fetch,
3252
- openPopup: t.openPopup
3411
+ auth: new de({
3412
+ paywallId: t.paywallId,
3413
+ apiOrigin: e.apiOrigin ?? t.apiOrigin,
3414
+ storage: e.storage ?? t.storage,
3415
+ fetch: e.fetch ?? t.fetch,
3416
+ openPopup: e.openPopup
3253
3417
  }),
3254
3418
  ownsAuth: !0
3255
3419
  };
3256
3420
  }
3257
- function gr(e) {
3258
- if (typeof e != "object" || e === null) return !1;
3259
- const t = e;
3260
- return typeof t.onAuthChange == "function" && typeof t.getCachedSession == "function" && typeof t.signOut == "function";
3421
+ function fr(t) {
3422
+ if (typeof t != "object" || t === null) return !1;
3423
+ const e = t;
3424
+ return typeof e.onAuthChange == "function" && typeof e.getCachedSession == "function" && typeof e.signOut == "function";
3261
3425
  }
3262
- function fr(e, t) {
3263
- return e.open === t.open && e.view === t.view && e.error === t.error;
3426
+ function wr(t, e) {
3427
+ return t.open === e.open && t.view === e.view && t.error === e.error && t.processing === e.processing;
3264
3428
  }
3265
- function wr(e, t) {
3266
- return e.mode === t.mode && e.payload === t.payload && e.storage === t.storage;
3429
+ function mr(t, e) {
3430
+ return t.mode === e.mode && t.payload === e.payload && t.storage === e.storage;
3267
3431
  }
3268
- function St(e) {
3269
- if (!e) return null;
3270
- const t = new URLSearchParams(e), r = t.get($.status);
3432
+ function Ce(t) {
3433
+ if (!t) return null;
3434
+ const e = new URLSearchParams(t), r = e.get(H.status);
3271
3435
  return r ? {
3272
3436
  status: r,
3273
- priceId: t.get($.priceId),
3274
- sessionId: t.get($.sessionId)
3437
+ priceId: e.get(H.priceId),
3438
+ sessionId: e.get(H.sessionId)
3275
3439
  } : null;
3276
3440
  }
3277
- function mr(e) {
3441
+ function br(t) {
3278
3442
  if (!(typeof window > "u" || !window.opener))
3279
3443
  try {
3280
3444
  window.opener.postMessage(
3281
3445
  {
3282
3446
  type: "paywall_purchase",
3283
- status: e.status,
3284
- priceId: e.priceId,
3285
- sessionId: e.sessionId
3447
+ status: t.status,
3448
+ priceId: t.priceId,
3449
+ sessionId: t.sessionId
3286
3450
  },
3287
3451
  "*"
3288
3452
  );
3289
3453
  } catch {
3290
3454
  }
3291
3455
  }
3292
- function br(e) {
3293
- const t = (i, n) => {
3456
+ function yr(t) {
3457
+ const e = (i, n) => {
3294
3458
  if (!i) return "";
3295
- const o = new URLSearchParams(i.replace(/^[?#]/, ""));
3296
- o.delete($.status), o.delete($.priceId), o.delete($.sessionId);
3297
- const s = o.toString();
3298
- return s ? n + s : "";
3299
- }, r = e.pathname + t(e.search, "?") + t(e.hash, "#");
3459
+ const s = new URLSearchParams(i.replace(/^[?#]/, ""));
3460
+ s.delete(H.status), s.delete(H.priceId), s.delete(H.sessionId);
3461
+ const o = s.toString();
3462
+ return o ? n + o : "";
3463
+ }, r = t.pathname + e(t.search, "?") + e(t.hash, "#");
3300
3464
  window.history.replaceState(null, "", r);
3301
3465
  }
3302
3466
  export {
3303
- Sr as P,
3304
- Qe as b
3467
+ Cr as P,
3468
+ er as b
3305
3469
  };
3306
- //# sourceMappingURL=PaywallUI-pb7JpLr6.js.map
3470
+ //# sourceMappingURL=PaywallUI-vv6Hw8su.js.map