@monetize.software/sdk-extension 3.0.0-alpha.3 → 3.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/chunks/{chrome-port-DPFUj1MP.js → chrome-port-rPi6zrjD.js} +169 -122
- package/dist/chunks/chrome-port-rPi6zrjD.js.map +1 -0
- package/dist/chunks/chrome-port-vdrVaWql.js +2 -0
- package/dist/chunks/chrome-port-vdrVaWql.js.map +1 -0
- package/dist/content/RemoteAuthClient.d.ts +2 -2
- package/dist/content/RemoteAuthClient.d.ts.map +1 -1
- package/dist/content.cjs +3 -3
- package/dist/content.cjs.map +1 -1
- package/dist/content.js +515 -470
- package/dist/content.js.map +1 -1
- package/dist/offscreen/server.d.ts.map +1 -1
- package/dist/offscreen.cjs +1 -1
- package/dist/offscreen.cjs.map +1 -1
- package/dist/offscreen.js +6 -6
- package/dist/offscreen.js.map +1 -1
- package/dist/shared/messages.d.ts +5 -2
- package/dist/shared/messages.d.ts.map +1 -1
- package/package.json +35 -18
- package/dist/chunks/chrome-port-DPFUj1MP.js.map +0 -1
- package/dist/chunks/chrome-port-MoMohiHB.js +0 -2
- package/dist/chunks/chrome-port-MoMohiHB.js.map +0 -1
package/dist/content.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { P as
|
|
2
|
-
import { render as
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { P as
|
|
6
|
-
const oe = '@layer theme,base,components,utilities;@layer theme{@theme default{ --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; --color-red-50: oklch(97.1% .013 17.38); --color-red-100: oklch(93.6% .032 17.717); --color-red-200: oklch(88.5% .062 18.334); --color-red-300: oklch(80.8% .114 19.571); --color-red-400: oklch(70.4% .191 22.216); --color-red-500: oklch(63.7% .237 25.331); --color-red-600: oklch(57.7% .245 27.325); --color-red-700: oklch(50.5% .213 27.518); --color-red-800: oklch(44.4% .177 26.899); --color-red-900: oklch(39.6% .141 25.723); --color-red-950: oklch(25.8% .092 26.042); --color-orange-50: oklch(98% .016 73.684); --color-orange-100: oklch(95.4% .038 75.164); --color-orange-200: oklch(90.1% .076 70.697); --color-orange-300: oklch(83.7% .128 66.29); --color-orange-400: oklch(75% .183 55.934); --color-orange-500: oklch(70.5% .213 47.604); --color-orange-600: oklch(64.6% .222 41.116); --color-orange-700: oklch(55.3% .195 38.402); --color-orange-800: oklch(47% .157 37.304); --color-orange-900: oklch(40.8% .123 38.172); --color-orange-950: oklch(26.6% .079 36.259); --color-amber-50: oklch(98.7% .022 95.277); --color-amber-100: oklch(96.2% .059 95.617); --color-amber-200: oklch(92.4% .12 95.746); --color-amber-300: oklch(87.9% .169 91.605); --color-amber-400: oklch(82.8% .189 84.429); --color-amber-500: oklch(76.9% .188 70.08); --color-amber-600: oklch(66.6% .179 58.318); --color-amber-700: oklch(55.5% .163 48.998); --color-amber-800: oklch(47.3% .137 46.201); --color-amber-900: oklch(41.4% .112 45.904); --color-amber-950: oklch(27.9% .077 45.635); --color-yellow-50: oklch(98.7% .026 102.212); --color-yellow-100: oklch(97.3% .071 103.193); --color-yellow-200: oklch(94.5% .129 101.54); --color-yellow-300: oklch(90.5% .182 98.111); --color-yellow-400: oklch(85.2% .199 91.936); --color-yellow-500: oklch(79.5% .184 86.047); --color-yellow-600: oklch(68.1% .162 75.834); --color-yellow-700: oklch(55.4% .135 66.442); --color-yellow-800: oklch(47.6% .114 61.907); --color-yellow-900: oklch(42.1% .095 57.708); --color-yellow-950: oklch(28.6% .066 53.813); --color-lime-50: oklch(98.6% .031 120.757); --color-lime-100: oklch(96.7% .067 122.328); --color-lime-200: oklch(93.8% .127 124.321); --color-lime-300: oklch(89.7% .196 126.665); --color-lime-400: oklch(84.1% .238 128.85); --color-lime-500: oklch(76.8% .233 130.85); --color-lime-600: oklch(64.8% .2 131.684); --color-lime-700: oklch(53.2% .157 131.589); --color-lime-800: oklch(45.3% .124 130.933); --color-lime-900: oklch(40.5% .101 131.063); --color-lime-950: oklch(27.4% .072 132.109); --color-green-50: oklch(98.2% .018 155.826); --color-green-100: oklch(96.2% .044 156.743); --color-green-200: oklch(92.5% .084 155.995); --color-green-300: oklch(87.1% .15 154.449); --color-green-400: oklch(79.2% .209 151.711); --color-green-500: oklch(72.3% .219 149.579); --color-green-600: oklch(62.7% .194 149.214); --color-green-700: oklch(52.7% .154 150.069); --color-green-800: oklch(44.8% .119 151.328); --color-green-900: oklch(39.3% .095 152.535); --color-green-950: oklch(26.6% .065 152.934); --color-emerald-50: oklch(97.9% .021 166.113); --color-emerald-100: oklch(95% .052 163.051); --color-emerald-200: oklch(90.5% .093 164.15); --color-emerald-300: oklch(84.5% .143 164.978); --color-emerald-400: oklch(76.5% .177 163.223); --color-emerald-500: oklch(69.6% .17 162.48); --color-emerald-600: oklch(59.6% .145 163.225); --color-emerald-700: oklch(50.8% .118 165.612); --color-emerald-800: oklch(43.2% .095 166.913); --color-emerald-900: oklch(37.8% .077 168.94); --color-emerald-950: oklch(26.2% .051 172.552); --color-teal-50: oklch(98.4% .014 180.72); --color-teal-100: oklch(95.3% .051 180.801); --color-teal-200: oklch(91% .096 180.426); --color-teal-300: oklch(85.5% .138 181.071); --color-teal-400: oklch(77.7% .152 181.912); --color-teal-500: oklch(70.4% .14 182.503); --color-teal-600: oklch(60% .118 184.704); --color-teal-700: oklch(51.1% .096 186.391); --color-teal-800: oklch(43.7% .078 188.216); --color-teal-900: oklch(38.6% .063 188.416); --color-teal-950: oklch(27.7% .046 192.524); --color-cyan-50: oklch(98.4% .019 200.873); --color-cyan-100: oklch(95.6% .045 203.388); --color-cyan-200: oklch(91.7% .08 205.041); --color-cyan-300: oklch(86.5% .127 207.078); --color-cyan-400: oklch(78.9% .154 211.53); --color-cyan-500: oklch(71.5% .143 215.221); --color-cyan-600: oklch(60.9% .126 221.723); --color-cyan-700: oklch(52% .105 223.128); --color-cyan-800: oklch(45% .085 224.283); --color-cyan-900: oklch(39.8% .07 227.392); --color-cyan-950: oklch(30.2% .056 229.695); --color-sky-50: oklch(97.7% .013 236.62); --color-sky-100: oklch(95.1% .026 236.824); --color-sky-200: oklch(90.1% .058 230.902); --color-sky-300: oklch(82.8% .111 230.318); --color-sky-400: oklch(74.6% .16 232.661); --color-sky-500: oklch(68.5% .169 237.323); --color-sky-600: oklch(58.8% .158 241.966); --color-sky-700: oklch(50% .134 242.749); --color-sky-800: oklch(44.3% .11 240.79); --color-sky-900: oklch(39.1% .09 240.876); --color-sky-950: oklch(29.3% .066 243.157); --color-blue-50: oklch(97% .014 254.604); --color-blue-100: oklch(93.2% .032 255.585); --color-blue-200: oklch(88.2% .059 254.128); --color-blue-300: oklch(80.9% .105 251.813); --color-blue-400: oklch(70.7% .165 254.624); --color-blue-500: oklch(62.3% .214 259.815); --color-blue-600: oklch(54.6% .245 262.881); --color-blue-700: oklch(48.8% .243 264.376); --color-blue-800: oklch(42.4% .199 265.638); --color-blue-900: oklch(37.9% .146 265.522); --color-blue-950: oklch(28.2% .091 267.935); --color-indigo-50: oklch(96.2% .018 272.314); --color-indigo-100: oklch(93% .034 272.788); --color-indigo-200: oklch(87% .065 274.039); --color-indigo-300: oklch(78.5% .115 274.713); --color-indigo-400: oklch(67.3% .182 276.935); --color-indigo-500: oklch(58.5% .233 277.117); --color-indigo-600: oklch(51.1% .262 276.966); --color-indigo-700: oklch(45.7% .24 277.023); --color-indigo-800: oklch(39.8% .195 277.366); --color-indigo-900: oklch(35.9% .144 278.697); --color-indigo-950: oklch(25.7% .09 281.288); --color-violet-50: oklch(96.9% .016 293.756); --color-violet-100: oklch(94.3% .029 294.588); --color-violet-200: oklch(89.4% .057 293.283); --color-violet-300: oklch(81.1% .111 293.571); --color-violet-400: oklch(70.2% .183 293.541); --color-violet-500: oklch(60.6% .25 292.717); --color-violet-600: oklch(54.1% .281 293.009); --color-violet-700: oklch(49.1% .27 292.581); --color-violet-800: oklch(43.2% .232 292.759); --color-violet-900: oklch(38% .189 293.745); --color-violet-950: oklch(28.3% .141 291.089); --color-purple-50: oklch(97.7% .014 308.299); --color-purple-100: oklch(94.6% .033 307.174); --color-purple-200: oklch(90.2% .063 306.703); --color-purple-300: oklch(82.7% .119 306.383); --color-purple-400: oklch(71.4% .203 305.504); --color-purple-500: oklch(62.7% .265 303.9); --color-purple-600: oklch(55.8% .288 302.321); --color-purple-700: oklch(49.6% .265 301.924); --color-purple-800: oklch(43.8% .218 303.724); --color-purple-900: oklch(38.1% .176 304.987); --color-purple-950: oklch(29.1% .149 302.717); --color-fuchsia-50: oklch(97.7% .017 320.058); --color-fuchsia-100: oklch(95.2% .037 318.852); --color-fuchsia-200: oklch(90.3% .076 319.62); --color-fuchsia-300: oklch(83.3% .145 321.434); --color-fuchsia-400: oklch(74% .238 322.16); --color-fuchsia-500: oklch(66.7% .295 322.15); --color-fuchsia-600: oklch(59.1% .293 322.896); --color-fuchsia-700: oklch(51.8% .253 323.949); --color-fuchsia-800: oklch(45.2% .211 324.591); --color-fuchsia-900: oklch(40.1% .17 325.612); --color-fuchsia-950: oklch(29.3% .136 325.661); --color-pink-50: oklch(97.1% .014 343.198); --color-pink-100: oklch(94.8% .028 342.258); --color-pink-200: oklch(89.9% .061 343.231); --color-pink-300: oklch(82.3% .12 346.018); --color-pink-400: oklch(71.8% .202 349.761); --color-pink-500: oklch(65.6% .241 354.308); --color-pink-600: oklch(59.2% .249 .584); --color-pink-700: oklch(52.5% .223 3.958); --color-pink-800: oklch(45.9% .187 3.815); --color-pink-900: oklch(40.8% .153 2.432); --color-pink-950: oklch(28.4% .109 3.907); --color-rose-50: oklch(96.9% .015 12.422); --color-rose-100: oklch(94.1% .03 12.58); --color-rose-200: oklch(89.2% .058 10.001); --color-rose-300: oklch(81% .117 11.638); --color-rose-400: oklch(71.2% .194 13.428); --color-rose-500: oklch(64.5% .246 16.439); --color-rose-600: oklch(58.6% .253 17.585); --color-rose-700: oklch(51.4% .222 16.935); --color-rose-800: oklch(45.5% .188 13.697); --color-rose-900: oklch(41% .159 10.272); --color-rose-950: oklch(27.1% .105 12.094); --color-slate-50: oklch(98.4% .003 247.858); --color-slate-100: oklch(96.8% .007 247.896); --color-slate-200: oklch(92.9% .013 255.508); --color-slate-300: oklch(86.9% .022 252.894); --color-slate-400: oklch(70.4% .04 256.788); --color-slate-500: oklch(55.4% .046 257.417); --color-slate-600: oklch(44.6% .043 257.281); --color-slate-700: oklch(37.2% .044 257.287); --color-slate-800: oklch(27.9% .041 260.031); --color-slate-900: oklch(20.8% .042 265.755); --color-slate-950: oklch(12.9% .042 264.695); --color-gray-50: oklch(98.5% .002 247.839); --color-gray-100: oklch(96.7% .003 264.542); --color-gray-200: oklch(92.8% .006 264.531); --color-gray-300: oklch(87.2% .01 258.338); --color-gray-400: oklch(70.7% .022 261.325); --color-gray-500: oklch(55.1% .027 264.364); --color-gray-600: oklch(44.6% .03 256.802); --color-gray-700: oklch(37.3% .034 259.733); --color-gray-800: oklch(27.8% .033 256.848); --color-gray-900: oklch(21% .034 264.665); --color-gray-950: oklch(13% .028 261.692); --color-zinc-50: oklch(98.5% 0 0); --color-zinc-100: oklch(96.7% .001 286.375); --color-zinc-200: oklch(92% .004 286.32); --color-zinc-300: oklch(87.1% .006 286.286); --color-zinc-400: oklch(70.5% .015 286.067); --color-zinc-500: oklch(55.2% .016 285.938); --color-zinc-600: oklch(44.2% .017 285.786); --color-zinc-700: oklch(37% .013 285.805); --color-zinc-800: oklch(27.4% .006 286.033); --color-zinc-900: oklch(21% .006 285.885); --color-zinc-950: oklch(14.1% .005 285.823); --color-neutral-50: oklch(98.5% 0 0); --color-neutral-100: oklch(97% 0 0); --color-neutral-200: oklch(92.2% 0 0); --color-neutral-300: oklch(87% 0 0); --color-neutral-400: oklch(70.8% 0 0); --color-neutral-500: oklch(55.6% 0 0); --color-neutral-600: oklch(43.9% 0 0); --color-neutral-700: oklch(37.1% 0 0); --color-neutral-800: oklch(26.9% 0 0); --color-neutral-900: oklch(20.5% 0 0); --color-neutral-950: oklch(14.5% 0 0); --color-stone-50: oklch(98.5% .001 106.423); --color-stone-100: oklch(97% .001 106.424); --color-stone-200: oklch(92.3% .003 48.717); --color-stone-300: oklch(86.9% .005 56.366); --color-stone-400: oklch(70.9% .01 56.259); --color-stone-500: oklch(55.3% .013 58.071); --color-stone-600: oklch(44.4% .011 73.639); --color-stone-700: oklch(37.4% .01 67.558); --color-stone-800: oklch(26.8% .007 34.298); --color-stone-900: oklch(21.6% .006 56.043); --color-stone-950: oklch(14.7% .004 49.25); --color-mauve-50: oklch(98.5% 0 0); --color-mauve-100: oklch(96% .003 325.6); --color-mauve-200: oklch(92.2% .005 325.62); --color-mauve-300: oklch(86.5% .012 325.68); --color-mauve-400: oklch(71.1% .019 323.02); --color-mauve-500: oklch(54.2% .034 322.5); --color-mauve-600: oklch(43.5% .029 321.78); --color-mauve-700: oklch(36.4% .029 323.89); --color-mauve-800: oklch(26.3% .024 320.12); --color-mauve-900: oklch(21.2% .019 322.12); --color-mauve-950: oklch(14.5% .008 326); --color-olive-50: oklch(98.8% .003 106.5); --color-olive-100: oklch(96.6% .005 106.5); --color-olive-200: oklch(93% .007 106.5); --color-olive-300: oklch(88% .011 106.6); --color-olive-400: oklch(73.7% .021 106.9); --color-olive-500: oklch(58% .031 107.3); --color-olive-600: oklch(46.6% .025 107.3); --color-olive-700: oklch(39.4% .023 107.4); --color-olive-800: oklch(28.6% .016 107.4); --color-olive-900: oklch(22.8% .013 107.4); --color-olive-950: oklch(15.3% .006 107.1); --color-mist-50: oklch(98.7% .002 197.1); --color-mist-100: oklch(96.3% .002 197.1); --color-mist-200: oklch(92.5% .005 214.3); --color-mist-300: oklch(87.2% .007 219.6); --color-mist-400: oklch(72.3% .014 214.4); --color-mist-500: oklch(56% .021 213.5); --color-mist-600: oklch(45% .017 213.2); --color-mist-700: oklch(37.8% .015 216); --color-mist-800: oklch(27.5% .011 216.9); --color-mist-900: oklch(21.8% .008 223.9); --color-mist-950: oklch(14.8% .004 228.8); --color-taupe-50: oklch(98.6% .002 67.8); --color-taupe-100: oklch(96% .002 17.2); --color-taupe-200: oklch(92.2% .005 34.3); --color-taupe-300: oklch(86.8% .007 39.5); --color-taupe-400: oklch(71.4% .014 41.2); --color-taupe-500: oklch(54.7% .021 43.1); --color-taupe-600: oklch(43.8% .017 39.3); --color-taupe-700: oklch(36.7% .016 35.7); --color-taupe-800: oklch(26.8% .011 36.5); --color-taupe-900: oklch(21.4% .009 43.1); --color-taupe-950: oklch(14.7% .004 49.3); --color-black: #000; --color-white: #fff; --spacing: .25rem; --breakpoint-sm: 40rem; --breakpoint-md: 48rem; --breakpoint-lg: 64rem; --breakpoint-xl: 80rem; --breakpoint-2xl: 96rem; --container-3xs: 16rem; --container-2xs: 18rem; --container-xs: 20rem; --container-sm: 24rem; --container-md: 28rem; --container-lg: 32rem; --container-xl: 36rem; --container-2xl: 42rem; --container-3xl: 48rem; --container-4xl: 56rem; --container-5xl: 64rem; --container-6xl: 72rem; --container-7xl: 80rem; --text-xs: .75rem; --text-xs--line-height: calc(1 / .75); --text-sm: .875rem; --text-sm--line-height: calc(1.25 / .875); --text-base: 1rem; --text-base--line-height: 1.5 ; --text-lg: 1.125rem; --text-lg--line-height: calc(1.75 / 1.125); --text-xl: 1.25rem; --text-xl--line-height: calc(1.75 / 1.25); --text-2xl: 1.5rem; --text-2xl--line-height: calc(2 / 1.5); --text-3xl: 1.875rem; --text-3xl--line-height: 1.2 ; --text-4xl: 2.25rem; --text-4xl--line-height: calc(2.5 / 2.25); --text-5xl: 3rem; --text-5xl--line-height: 1; --text-6xl: 3.75rem; --text-6xl--line-height: 1; --text-7xl: 4.5rem; --text-7xl--line-height: 1; --text-8xl: 6rem; --text-8xl--line-height: 1; --text-9xl: 8rem; --text-9xl--line-height: 1; --font-weight-thin: 100; --font-weight-extralight: 200; --font-weight-light: 300; --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700; --font-weight-extrabold: 800; --font-weight-black: 900; --tracking-tighter: -.05em; --tracking-tight: -.025em; --tracking-normal: 0em; --tracking-wide: .025em; --tracking-wider: .05em; --tracking-widest: .1em; --leading-tight: 1.25; --leading-snug: 1.375; --leading-normal: 1.5; --leading-relaxed: 1.625; --leading-loose: 2; --radius-xs: .125rem; --radius-sm: .25rem; --radius-md: .375rem; --radius-lg: .5rem; --radius-xl: .75rem; --radius-2xl: 1rem; --radius-3xl: 1.5rem; --radius-4xl: 2rem; --shadow-2xs: 0 1px rgb(0 0 0 / .05); --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05); --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1); --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1); --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25); --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / .05); --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / .05); --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / .05); --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / .05); --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / .15); --drop-shadow-md: 0 3px 3px rgb(0 0 0 / .12); --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / .15); --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / .1); --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / .15); --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / .15); --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / .2); --text-shadow-sm: 0px 1px 0px rgb(0 0 0 / .075), 0px 1px 1px rgb(0 0 0 / .075), 0px 2px 2px rgb(0 0 0 / .075); --text-shadow-md: 0px 1px 1px rgb(0 0 0 / .1), 0px 1px 2px rgb(0 0 0 / .1), 0px 2px 4px rgb(0 0 0 / .1); --text-shadow-lg: 0px 1px 2px rgb(0 0 0 / .1), 0px 3px 2px rgb(0 0 0 / .1), 0px 4px 8px rgb(0 0 0 / .1); --ease-in: cubic-bezier(.4, 0, 1, 1); --ease-out: cubic-bezier(0, 0, .2, 1); --ease-in-out: cubic-bezier(.4, 0, .2, 1); --animate-spin: spin 1s linear infinite; --animate-ping: ping 1s cubic-bezier(0, 0, .2, 1) infinite; --animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; --animate-bounce: bounce 1s infinite; @keyframes spin { to { transform: rotate(360deg); } } @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } } @keyframes pulse { 50% { opacity: .5; } } @keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); } 50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); } } --blur-xs: 4px; --blur-sm: 8px; --blur-md: 12px; --blur-lg: 16px; --blur-xl: 24px; --blur-2xl: 40px; --blur-3xl: 64px; --perspective-dramatic: 100px; --perspective-near: 300px; --perspective-normal: 500px; --perspective-midrange: 800px; --perspective-distant: 1200px; --aspect-video: 16 / 9; --default-transition-duration: .15s; --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1); --default-font-family: --theme(--font-sans, initial); --default-font-feature-settings: --theme( --font-sans--font-feature-settings, initial ); --default-font-variation-settings: --theme( --font-sans--font-variation-settings, initial ); --default-mono-font-family: --theme(--font-mono, initial); --default-mono-font-feature-settings: --theme( --font-mono--font-feature-settings, initial ); --default-mono-font-variation-settings: --theme( --font-mono--font-variation-settings, initial ); }@theme default inline reference{ --blur: 8px; --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / .05); --drop-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 1px 1px rgb(0 0 0 / .06); --radius: .25rem; --max-width-prose: 65ch; }}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:--theme(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:--theme(--default-font-feature-settings,normal);font-variation-settings:--theme(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:--theme(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:--theme(--default-mono-font-feature-settings,normal);font-variation-settings:--theme(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{@tailwind utilities;}@source "../**/*.{ts,tsx,js,jsx}";@layer base{:host{all:initial;color-scheme:light;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}*,*:before,*:after{box-sizing:border-box}button{font-family:inherit;cursor:pointer}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}';
|
|
7
|
-
let
|
|
8
|
-
function
|
|
9
|
-
if (
|
|
1
|
+
import { P as T, B as le, E as ae, c as ce, A as G, w as ue, a as N, r as he, b as de } from "./chunks/chrome-port-rPi6zrjD.js";
|
|
2
|
+
import { render as q, h as W } from "preact";
|
|
3
|
+
import { jsxs as c, jsx as o, Fragment as re } from "preact/jsx-runtime";
|
|
4
|
+
import { useRef as P, useEffect as M, useState as y, useMemo as ne } from "preact/hooks";
|
|
5
|
+
import { P as pe } from "./chunks/port-name-BPfQKtdb.js";
|
|
6
|
+
const ie = '@layer theme,base,components,utilities;@layer theme{@theme default{ --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; --color-red-50: oklch(97.1% .013 17.38); --color-red-100: oklch(93.6% .032 17.717); --color-red-200: oklch(88.5% .062 18.334); --color-red-300: oklch(80.8% .114 19.571); --color-red-400: oklch(70.4% .191 22.216); --color-red-500: oklch(63.7% .237 25.331); --color-red-600: oklch(57.7% .245 27.325); --color-red-700: oklch(50.5% .213 27.518); --color-red-800: oklch(44.4% .177 26.899); --color-red-900: oklch(39.6% .141 25.723); --color-red-950: oklch(25.8% .092 26.042); --color-orange-50: oklch(98% .016 73.684); --color-orange-100: oklch(95.4% .038 75.164); --color-orange-200: oklch(90.1% .076 70.697); --color-orange-300: oklch(83.7% .128 66.29); --color-orange-400: oklch(75% .183 55.934); --color-orange-500: oklch(70.5% .213 47.604); --color-orange-600: oklch(64.6% .222 41.116); --color-orange-700: oklch(55.3% .195 38.402); --color-orange-800: oklch(47% .157 37.304); --color-orange-900: oklch(40.8% .123 38.172); --color-orange-950: oklch(26.6% .079 36.259); --color-amber-50: oklch(98.7% .022 95.277); --color-amber-100: oklch(96.2% .059 95.617); --color-amber-200: oklch(92.4% .12 95.746); --color-amber-300: oklch(87.9% .169 91.605); --color-amber-400: oklch(82.8% .189 84.429); --color-amber-500: oklch(76.9% .188 70.08); --color-amber-600: oklch(66.6% .179 58.318); --color-amber-700: oklch(55.5% .163 48.998); --color-amber-800: oklch(47.3% .137 46.201); --color-amber-900: oklch(41.4% .112 45.904); --color-amber-950: oklch(27.9% .077 45.635); --color-yellow-50: oklch(98.7% .026 102.212); --color-yellow-100: oklch(97.3% .071 103.193); --color-yellow-200: oklch(94.5% .129 101.54); --color-yellow-300: oklch(90.5% .182 98.111); --color-yellow-400: oklch(85.2% .199 91.936); --color-yellow-500: oklch(79.5% .184 86.047); --color-yellow-600: oklch(68.1% .162 75.834); --color-yellow-700: oklch(55.4% .135 66.442); --color-yellow-800: oklch(47.6% .114 61.907); --color-yellow-900: oklch(42.1% .095 57.708); --color-yellow-950: oklch(28.6% .066 53.813); --color-lime-50: oklch(98.6% .031 120.757); --color-lime-100: oklch(96.7% .067 122.328); --color-lime-200: oklch(93.8% .127 124.321); --color-lime-300: oklch(89.7% .196 126.665); --color-lime-400: oklch(84.1% .238 128.85); --color-lime-500: oklch(76.8% .233 130.85); --color-lime-600: oklch(64.8% .2 131.684); --color-lime-700: oklch(53.2% .157 131.589); --color-lime-800: oklch(45.3% .124 130.933); --color-lime-900: oklch(40.5% .101 131.063); --color-lime-950: oklch(27.4% .072 132.109); --color-green-50: oklch(98.2% .018 155.826); --color-green-100: oklch(96.2% .044 156.743); --color-green-200: oklch(92.5% .084 155.995); --color-green-300: oklch(87.1% .15 154.449); --color-green-400: oklch(79.2% .209 151.711); --color-green-500: oklch(72.3% .219 149.579); --color-green-600: oklch(62.7% .194 149.214); --color-green-700: oklch(52.7% .154 150.069); --color-green-800: oklch(44.8% .119 151.328); --color-green-900: oklch(39.3% .095 152.535); --color-green-950: oklch(26.6% .065 152.934); --color-emerald-50: oklch(97.9% .021 166.113); --color-emerald-100: oklch(95% .052 163.051); --color-emerald-200: oklch(90.5% .093 164.15); --color-emerald-300: oklch(84.5% .143 164.978); --color-emerald-400: oklch(76.5% .177 163.223); --color-emerald-500: oklch(69.6% .17 162.48); --color-emerald-600: oklch(59.6% .145 163.225); --color-emerald-700: oklch(50.8% .118 165.612); --color-emerald-800: oklch(43.2% .095 166.913); --color-emerald-900: oklch(37.8% .077 168.94); --color-emerald-950: oklch(26.2% .051 172.552); --color-teal-50: oklch(98.4% .014 180.72); --color-teal-100: oklch(95.3% .051 180.801); --color-teal-200: oklch(91% .096 180.426); --color-teal-300: oklch(85.5% .138 181.071); --color-teal-400: oklch(77.7% .152 181.912); --color-teal-500: oklch(70.4% .14 182.503); --color-teal-600: oklch(60% .118 184.704); --color-teal-700: oklch(51.1% .096 186.391); --color-teal-800: oklch(43.7% .078 188.216); --color-teal-900: oklch(38.6% .063 188.416); --color-teal-950: oklch(27.7% .046 192.524); --color-cyan-50: oklch(98.4% .019 200.873); --color-cyan-100: oklch(95.6% .045 203.388); --color-cyan-200: oklch(91.7% .08 205.041); --color-cyan-300: oklch(86.5% .127 207.078); --color-cyan-400: oklch(78.9% .154 211.53); --color-cyan-500: oklch(71.5% .143 215.221); --color-cyan-600: oklch(60.9% .126 221.723); --color-cyan-700: oklch(52% .105 223.128); --color-cyan-800: oklch(45% .085 224.283); --color-cyan-900: oklch(39.8% .07 227.392); --color-cyan-950: oklch(30.2% .056 229.695); --color-sky-50: oklch(97.7% .013 236.62); --color-sky-100: oklch(95.1% .026 236.824); --color-sky-200: oklch(90.1% .058 230.902); --color-sky-300: oklch(82.8% .111 230.318); --color-sky-400: oklch(74.6% .16 232.661); --color-sky-500: oklch(68.5% .169 237.323); --color-sky-600: oklch(58.8% .158 241.966); --color-sky-700: oklch(50% .134 242.749); --color-sky-800: oklch(44.3% .11 240.79); --color-sky-900: oklch(39.1% .09 240.876); --color-sky-950: oklch(29.3% .066 243.157); --color-blue-50: oklch(97% .014 254.604); --color-blue-100: oklch(93.2% .032 255.585); --color-blue-200: oklch(88.2% .059 254.128); --color-blue-300: oklch(80.9% .105 251.813); --color-blue-400: oklch(70.7% .165 254.624); --color-blue-500: oklch(62.3% .214 259.815); --color-blue-600: oklch(54.6% .245 262.881); --color-blue-700: oklch(48.8% .243 264.376); --color-blue-800: oklch(42.4% .199 265.638); --color-blue-900: oklch(37.9% .146 265.522); --color-blue-950: oklch(28.2% .091 267.935); --color-indigo-50: oklch(96.2% .018 272.314); --color-indigo-100: oklch(93% .034 272.788); --color-indigo-200: oklch(87% .065 274.039); --color-indigo-300: oklch(78.5% .115 274.713); --color-indigo-400: oklch(67.3% .182 276.935); --color-indigo-500: oklch(58.5% .233 277.117); --color-indigo-600: oklch(51.1% .262 276.966); --color-indigo-700: oklch(45.7% .24 277.023); --color-indigo-800: oklch(39.8% .195 277.366); --color-indigo-900: oklch(35.9% .144 278.697); --color-indigo-950: oklch(25.7% .09 281.288); --color-violet-50: oklch(96.9% .016 293.756); --color-violet-100: oklch(94.3% .029 294.588); --color-violet-200: oklch(89.4% .057 293.283); --color-violet-300: oklch(81.1% .111 293.571); --color-violet-400: oklch(70.2% .183 293.541); --color-violet-500: oklch(60.6% .25 292.717); --color-violet-600: oklch(54.1% .281 293.009); --color-violet-700: oklch(49.1% .27 292.581); --color-violet-800: oklch(43.2% .232 292.759); --color-violet-900: oklch(38% .189 293.745); --color-violet-950: oklch(28.3% .141 291.089); --color-purple-50: oklch(97.7% .014 308.299); --color-purple-100: oklch(94.6% .033 307.174); --color-purple-200: oklch(90.2% .063 306.703); --color-purple-300: oklch(82.7% .119 306.383); --color-purple-400: oklch(71.4% .203 305.504); --color-purple-500: oklch(62.7% .265 303.9); --color-purple-600: oklch(55.8% .288 302.321); --color-purple-700: oklch(49.6% .265 301.924); --color-purple-800: oklch(43.8% .218 303.724); --color-purple-900: oklch(38.1% .176 304.987); --color-purple-950: oklch(29.1% .149 302.717); --color-fuchsia-50: oklch(97.7% .017 320.058); --color-fuchsia-100: oklch(95.2% .037 318.852); --color-fuchsia-200: oklch(90.3% .076 319.62); --color-fuchsia-300: oklch(83.3% .145 321.434); --color-fuchsia-400: oklch(74% .238 322.16); --color-fuchsia-500: oklch(66.7% .295 322.15); --color-fuchsia-600: oklch(59.1% .293 322.896); --color-fuchsia-700: oklch(51.8% .253 323.949); --color-fuchsia-800: oklch(45.2% .211 324.591); --color-fuchsia-900: oklch(40.1% .17 325.612); --color-fuchsia-950: oklch(29.3% .136 325.661); --color-pink-50: oklch(97.1% .014 343.198); --color-pink-100: oklch(94.8% .028 342.258); --color-pink-200: oklch(89.9% .061 343.231); --color-pink-300: oklch(82.3% .12 346.018); --color-pink-400: oklch(71.8% .202 349.761); --color-pink-500: oklch(65.6% .241 354.308); --color-pink-600: oklch(59.2% .249 .584); --color-pink-700: oklch(52.5% .223 3.958); --color-pink-800: oklch(45.9% .187 3.815); --color-pink-900: oklch(40.8% .153 2.432); --color-pink-950: oklch(28.4% .109 3.907); --color-rose-50: oklch(96.9% .015 12.422); --color-rose-100: oklch(94.1% .03 12.58); --color-rose-200: oklch(89.2% .058 10.001); --color-rose-300: oklch(81% .117 11.638); --color-rose-400: oklch(71.2% .194 13.428); --color-rose-500: oklch(64.5% .246 16.439); --color-rose-600: oklch(58.6% .253 17.585); --color-rose-700: oklch(51.4% .222 16.935); --color-rose-800: oklch(45.5% .188 13.697); --color-rose-900: oklch(41% .159 10.272); --color-rose-950: oklch(27.1% .105 12.094); --color-slate-50: oklch(98.4% .003 247.858); --color-slate-100: oklch(96.8% .007 247.896); --color-slate-200: oklch(92.9% .013 255.508); --color-slate-300: oklch(86.9% .022 252.894); --color-slate-400: oklch(70.4% .04 256.788); --color-slate-500: oklch(55.4% .046 257.417); --color-slate-600: oklch(44.6% .043 257.281); --color-slate-700: oklch(37.2% .044 257.287); --color-slate-800: oklch(27.9% .041 260.031); --color-slate-900: oklch(20.8% .042 265.755); --color-slate-950: oklch(12.9% .042 264.695); --color-gray-50: oklch(98.5% .002 247.839); --color-gray-100: oklch(96.7% .003 264.542); --color-gray-200: oklch(92.8% .006 264.531); --color-gray-300: oklch(87.2% .01 258.338); --color-gray-400: oklch(70.7% .022 261.325); --color-gray-500: oklch(55.1% .027 264.364); --color-gray-600: oklch(44.6% .03 256.802); --color-gray-700: oklch(37.3% .034 259.733); --color-gray-800: oklch(27.8% .033 256.848); --color-gray-900: oklch(21% .034 264.665); --color-gray-950: oklch(13% .028 261.692); --color-zinc-50: oklch(98.5% 0 0); --color-zinc-100: oklch(96.7% .001 286.375); --color-zinc-200: oklch(92% .004 286.32); --color-zinc-300: oklch(87.1% .006 286.286); --color-zinc-400: oklch(70.5% .015 286.067); --color-zinc-500: oklch(55.2% .016 285.938); --color-zinc-600: oklch(44.2% .017 285.786); --color-zinc-700: oklch(37% .013 285.805); --color-zinc-800: oklch(27.4% .006 286.033); --color-zinc-900: oklch(21% .006 285.885); --color-zinc-950: oklch(14.1% .005 285.823); --color-neutral-50: oklch(98.5% 0 0); --color-neutral-100: oklch(97% 0 0); --color-neutral-200: oklch(92.2% 0 0); --color-neutral-300: oklch(87% 0 0); --color-neutral-400: oklch(70.8% 0 0); --color-neutral-500: oklch(55.6% 0 0); --color-neutral-600: oklch(43.9% 0 0); --color-neutral-700: oklch(37.1% 0 0); --color-neutral-800: oklch(26.9% 0 0); --color-neutral-900: oklch(20.5% 0 0); --color-neutral-950: oklch(14.5% 0 0); --color-stone-50: oklch(98.5% .001 106.423); --color-stone-100: oklch(97% .001 106.424); --color-stone-200: oklch(92.3% .003 48.717); --color-stone-300: oklch(86.9% .005 56.366); --color-stone-400: oklch(70.9% .01 56.259); --color-stone-500: oklch(55.3% .013 58.071); --color-stone-600: oklch(44.4% .011 73.639); --color-stone-700: oklch(37.4% .01 67.558); --color-stone-800: oklch(26.8% .007 34.298); --color-stone-900: oklch(21.6% .006 56.043); --color-stone-950: oklch(14.7% .004 49.25); --color-mauve-50: oklch(98.5% 0 0); --color-mauve-100: oklch(96% .003 325.6); --color-mauve-200: oklch(92.2% .005 325.62); --color-mauve-300: oklch(86.5% .012 325.68); --color-mauve-400: oklch(71.1% .019 323.02); --color-mauve-500: oklch(54.2% .034 322.5); --color-mauve-600: oklch(43.5% .029 321.78); --color-mauve-700: oklch(36.4% .029 323.89); --color-mauve-800: oklch(26.3% .024 320.12); --color-mauve-900: oklch(21.2% .019 322.12); --color-mauve-950: oklch(14.5% .008 326); --color-olive-50: oklch(98.8% .003 106.5); --color-olive-100: oklch(96.6% .005 106.5); --color-olive-200: oklch(93% .007 106.5); --color-olive-300: oklch(88% .011 106.6); --color-olive-400: oklch(73.7% .021 106.9); --color-olive-500: oklch(58% .031 107.3); --color-olive-600: oklch(46.6% .025 107.3); --color-olive-700: oklch(39.4% .023 107.4); --color-olive-800: oklch(28.6% .016 107.4); --color-olive-900: oklch(22.8% .013 107.4); --color-olive-950: oklch(15.3% .006 107.1); --color-mist-50: oklch(98.7% .002 197.1); --color-mist-100: oklch(96.3% .002 197.1); --color-mist-200: oklch(92.5% .005 214.3); --color-mist-300: oklch(87.2% .007 219.6); --color-mist-400: oklch(72.3% .014 214.4); --color-mist-500: oklch(56% .021 213.5); --color-mist-600: oklch(45% .017 213.2); --color-mist-700: oklch(37.8% .015 216); --color-mist-800: oklch(27.5% .011 216.9); --color-mist-900: oklch(21.8% .008 223.9); --color-mist-950: oklch(14.8% .004 228.8); --color-taupe-50: oklch(98.6% .002 67.8); --color-taupe-100: oklch(96% .002 17.2); --color-taupe-200: oklch(92.2% .005 34.3); --color-taupe-300: oklch(86.8% .007 39.5); --color-taupe-400: oklch(71.4% .014 41.2); --color-taupe-500: oklch(54.7% .021 43.1); --color-taupe-600: oklch(43.8% .017 39.3); --color-taupe-700: oklch(36.7% .016 35.7); --color-taupe-800: oklch(26.8% .011 36.5); --color-taupe-900: oklch(21.4% .009 43.1); --color-taupe-950: oklch(14.7% .004 49.3); --color-black: #000; --color-white: #fff; --spacing: .25rem; --breakpoint-sm: 40rem; --breakpoint-md: 48rem; --breakpoint-lg: 64rem; --breakpoint-xl: 80rem; --breakpoint-2xl: 96rem; --container-3xs: 16rem; --container-2xs: 18rem; --container-xs: 20rem; --container-sm: 24rem; --container-md: 28rem; --container-lg: 32rem; --container-xl: 36rem; --container-2xl: 42rem; --container-3xl: 48rem; --container-4xl: 56rem; --container-5xl: 64rem; --container-6xl: 72rem; --container-7xl: 80rem; --text-xs: .75rem; --text-xs--line-height: calc(1 / .75); --text-sm: .875rem; --text-sm--line-height: calc(1.25 / .875); --text-base: 1rem; --text-base--line-height: 1.5 ; --text-lg: 1.125rem; --text-lg--line-height: calc(1.75 / 1.125); --text-xl: 1.25rem; --text-xl--line-height: calc(1.75 / 1.25); --text-2xl: 1.5rem; --text-2xl--line-height: calc(2 / 1.5); --text-3xl: 1.875rem; --text-3xl--line-height: 1.2 ; --text-4xl: 2.25rem; --text-4xl--line-height: calc(2.5 / 2.25); --text-5xl: 3rem; --text-5xl--line-height: 1; --text-6xl: 3.75rem; --text-6xl--line-height: 1; --text-7xl: 4.5rem; --text-7xl--line-height: 1; --text-8xl: 6rem; --text-8xl--line-height: 1; --text-9xl: 8rem; --text-9xl--line-height: 1; --font-weight-thin: 100; --font-weight-extralight: 200; --font-weight-light: 300; --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700; --font-weight-extrabold: 800; --font-weight-black: 900; --tracking-tighter: -.05em; --tracking-tight: -.025em; --tracking-normal: 0em; --tracking-wide: .025em; --tracking-wider: .05em; --tracking-widest: .1em; --leading-tight: 1.25; --leading-snug: 1.375; --leading-normal: 1.5; --leading-relaxed: 1.625; --leading-loose: 2; --radius-xs: .125rem; --radius-sm: .25rem; --radius-md: .375rem; --radius-lg: .5rem; --radius-xl: .75rem; --radius-2xl: 1rem; --radius-3xl: 1.5rem; --radius-4xl: 2rem; --shadow-2xs: 0 1px rgb(0 0 0 / .05); --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05); --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1); --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1); --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25); --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / .05); --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / .05); --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / .05); --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / .05); --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / .15); --drop-shadow-md: 0 3px 3px rgb(0 0 0 / .12); --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / .15); --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / .1); --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / .15); --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / .15); --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / .2); --text-shadow-sm: 0px 1px 0px rgb(0 0 0 / .075), 0px 1px 1px rgb(0 0 0 / .075), 0px 2px 2px rgb(0 0 0 / .075); --text-shadow-md: 0px 1px 1px rgb(0 0 0 / .1), 0px 1px 2px rgb(0 0 0 / .1), 0px 2px 4px rgb(0 0 0 / .1); --text-shadow-lg: 0px 1px 2px rgb(0 0 0 / .1), 0px 3px 2px rgb(0 0 0 / .1), 0px 4px 8px rgb(0 0 0 / .1); --ease-in: cubic-bezier(.4, 0, 1, 1); --ease-out: cubic-bezier(0, 0, .2, 1); --ease-in-out: cubic-bezier(.4, 0, .2, 1); --animate-spin: spin 1s linear infinite; --animate-ping: ping 1s cubic-bezier(0, 0, .2, 1) infinite; --animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; --animate-bounce: bounce 1s infinite; @keyframes spin { to { transform: rotate(360deg); } } @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } } @keyframes pulse { 50% { opacity: .5; } } @keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); } 50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); } } --blur-xs: 4px; --blur-sm: 8px; --blur-md: 12px; --blur-lg: 16px; --blur-xl: 24px; --blur-2xl: 40px; --blur-3xl: 64px; --perspective-dramatic: 100px; --perspective-near: 300px; --perspective-normal: 500px; --perspective-midrange: 800px; --perspective-distant: 1200px; --aspect-video: 16 / 9; --default-transition-duration: .15s; --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1); --default-font-family: --theme(--font-sans, initial); --default-font-feature-settings: --theme( --font-sans--font-feature-settings, initial ); --default-font-variation-settings: --theme( --font-sans--font-variation-settings, initial ); --default-mono-font-family: --theme(--font-mono, initial); --default-mono-font-feature-settings: --theme( --font-mono--font-feature-settings, initial ); --default-mono-font-variation-settings: --theme( --font-mono--font-variation-settings, initial ); }@theme default inline reference{ --blur: 8px; --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / .05); --drop-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 1px 1px rgb(0 0 0 / .06); --radius: .25rem; --max-width-prose: 65ch; }}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:--theme(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:--theme(--default-font-feature-settings,normal);font-variation-settings:--theme(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:--theme(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:--theme(--default-mono-font-feature-settings,normal);font-variation-settings:--theme(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{@tailwind utilities;}@source "../**/*.{ts,tsx,js,jsx}";@layer base{:host{all:initial;color-scheme:light;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}*,*:before,*:after{box-sizing:border-box}button{font-family:inherit;cursor:pointer}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}.pw-cta-shimmer:before{content:"";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.35) 50%,transparent);animation:pw-cta-shimmer 3s infinite;z-index:1}@keyframes pw-cta-shimmer{0%{left:-100%}to{left:100%}}';
|
|
7
|
+
let Z = !1;
|
|
8
|
+
function fe() {
|
|
9
|
+
if (Z || (Z = !0, typeof CSS > "u" || typeof CSS.registerProperty != "function")) return;
|
|
10
10
|
let r;
|
|
11
11
|
try {
|
|
12
12
|
const e = new CSSStyleSheet();
|
|
13
|
-
e.replaceSync(
|
|
13
|
+
e.replaceSync(ie), r = e.cssRules;
|
|
14
14
|
} catch {
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
@@ -28,10 +28,10 @@ function ge() {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function ge(r, e, t = {}) {
|
|
32
32
|
if (typeof document > "u")
|
|
33
33
|
throw new Error("mountShadow called in non-DOM environment");
|
|
34
|
-
|
|
34
|
+
fe();
|
|
35
35
|
const n = t.host ?? document.createElement("div");
|
|
36
36
|
n.setAttribute("data-paywall-host", ""), n.style.cssText = t.inline ? "all: initial; position: absolute; inset: 0; z-index: 1; pointer-events: none;" : "all: initial; position: fixed; inset: 0; z-index: 2147483647; pointer-events: none;", !n.isConnected && !t.inline && document.body.appendChild(n);
|
|
37
37
|
const i = n.attachShadow({ mode: t.shadowMode ?? "closed" }), s = `
|
|
@@ -53,22 +53,22 @@ function me(r, e, t = {}) {
|
|
|
53
53
|
visibility: visible !important;
|
|
54
54
|
}
|
|
55
55
|
`, l = document.createElement("style");
|
|
56
|
-
l.textContent = s +
|
|
56
|
+
l.textContent = s + ie + (t.injectCss ?? ""), i.appendChild(l);
|
|
57
57
|
const a = document.createElement("div");
|
|
58
58
|
a.style.pointerEvents = "auto", i.appendChild(a);
|
|
59
59
|
let h = e;
|
|
60
|
-
return
|
|
60
|
+
return q(W(r, h), a), {
|
|
61
61
|
shadowRoot: i,
|
|
62
|
-
update(
|
|
63
|
-
h = { ...h, ...
|
|
62
|
+
update(u) {
|
|
63
|
+
h = { ...h, ...u }, q(W(r, h), a);
|
|
64
64
|
},
|
|
65
65
|
unmount() {
|
|
66
|
-
|
|
66
|
+
q(null, a), n.remove();
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
function
|
|
70
|
+
const Y = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
71
|
+
function me({
|
|
72
72
|
open: r,
|
|
73
73
|
onClose: e,
|
|
74
74
|
labelledBy: t,
|
|
@@ -78,12 +78,12 @@ function ye({
|
|
|
78
78
|
inline: l = !1,
|
|
79
79
|
children: a
|
|
80
80
|
}) {
|
|
81
|
-
const h =
|
|
82
|
-
return
|
|
81
|
+
const h = P(null), u = P(null);
|
|
82
|
+
return M(() => {
|
|
83
83
|
if (!r) return;
|
|
84
|
-
|
|
84
|
+
u.current = document.activeElement ?? null;
|
|
85
85
|
const f = h.current;
|
|
86
|
-
f && (f.querySelector(
|
|
86
|
+
f && (f.querySelector(Y) ?? f).focus({ preventScroll: !0 });
|
|
87
87
|
const g = (v) => {
|
|
88
88
|
if (v.key === "Escape") {
|
|
89
89
|
if (!s) return;
|
|
@@ -91,22 +91,22 @@ function ye({
|
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
93
|
if (v.key !== "Tab" || !h.current) return;
|
|
94
|
-
const
|
|
95
|
-
h.current.querySelectorAll(
|
|
96
|
-
).filter((
|
|
97
|
-
if (
|
|
94
|
+
const b = Array.from(
|
|
95
|
+
h.current.querySelectorAll(Y)
|
|
96
|
+
).filter((L) => !L.hasAttribute("disabled") && L.tabIndex !== -1);
|
|
97
|
+
if (b.length === 0) {
|
|
98
98
|
v.preventDefault();
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
const S =
|
|
102
|
-
v.shiftKey &&
|
|
101
|
+
const S = b[0], w = b[b.length - 1], B = document.activeElement;
|
|
102
|
+
v.shiftKey && B === S ? (v.preventDefault(), w.focus()) : !v.shiftKey && B === w && (v.preventDefault(), S.focus());
|
|
103
103
|
};
|
|
104
104
|
document.addEventListener("keydown", g, !0);
|
|
105
105
|
const _ = document.body.style.overflow;
|
|
106
106
|
return l || (document.body.style.overflow = "hidden"), () => {
|
|
107
|
-
document.removeEventListener("keydown", g, !0), l || (document.body.style.overflow = _),
|
|
107
|
+
document.removeEventListener("keydown", g, !0), l || (document.body.style.overflow = _), u.current?.focus?.({ preventScroll: !0 });
|
|
108
108
|
};
|
|
109
|
-
}, [r, e, s, l]), r ? /* @__PURE__ */
|
|
109
|
+
}, [r, e, s, l]), r ? /* @__PURE__ */ c(
|
|
110
110
|
"div",
|
|
111
111
|
{
|
|
112
112
|
class: `${l ? "absolute z-[1]" : "fixed z-[2147483647]"} inset-0 flex items-center justify-center bg-slate-950/50 p-2 sm:p-4 backdrop-blur-md animate-[pw-fade-in_180ms_ease-out]`,
|
|
@@ -115,65 +115,67 @@ function ye({
|
|
|
115
115
|
},
|
|
116
116
|
"data-pw-root": !0,
|
|
117
117
|
children: [
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
style: {
|
|
128
|
-
"--pw-accent": n ?? "#3b82f6",
|
|
129
|
-
boxShadow: "0 1px 2px rgba(15,23,42,0.04), 0 12px 32px -8px rgba(15,23,42,0.18), 0 24px 64px -16px rgba(15,23,42,0.22)"
|
|
130
|
-
},
|
|
131
|
-
children: [
|
|
132
|
-
i && /* @__PURE__ */ u(
|
|
133
|
-
"div",
|
|
134
|
-
{
|
|
135
|
-
class: "flex items-center justify-center gap-1.5 bg-gradient-to-r from-amber-300 to-amber-400 px-3 py-1.5 text-[11px] font-semibold uppercase tracking-wider text-amber-950",
|
|
136
|
-
role: "status",
|
|
137
|
-
children: [
|
|
138
|
-
/* @__PURE__ */ u("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
|
|
139
|
-
/* @__PURE__ */ o(
|
|
140
|
-
"path",
|
|
141
|
-
{
|
|
142
|
-
d: "M8 1L15 14H1L8 1Z",
|
|
143
|
-
stroke: "currentColor",
|
|
144
|
-
"stroke-width": "1.5",
|
|
145
|
-
"stroke-linejoin": "round"
|
|
146
|
-
}
|
|
147
|
-
),
|
|
148
|
-
/* @__PURE__ */ o("path", { d: "M8 6v3", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round" }),
|
|
149
|
-
/* @__PURE__ */ o("circle", { cx: "8", cy: "11.5", r: "0.5", fill: "currentColor" })
|
|
150
|
-
] }),
|
|
151
|
-
"Test mode — no real charge"
|
|
152
|
-
]
|
|
153
|
-
}
|
|
154
|
-
),
|
|
155
|
-
/* @__PURE__ */ o("div", { class: "flex-1 overflow-y-auto p-7", children: a }),
|
|
156
|
-
s ? /* @__PURE__ */ o(
|
|
157
|
-
"button",
|
|
158
|
-
{
|
|
159
|
-
type: "button",
|
|
160
|
-
onClick: e,
|
|
161
|
-
"aria-label": "Close",
|
|
162
|
-
class: `absolute right-3 ${i ? "top-10" : "top-3"} z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white/80 text-gray-400 backdrop-blur-sm transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]`,
|
|
163
|
-
children: /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o(
|
|
118
|
+
/* @__PURE__ */ c("div", { class: "relative w-full max-w-md animate-[pw-scale-in_220ms_cubic-bezier(0.16,1,0.3,1)]", children: [
|
|
119
|
+
i && /* @__PURE__ */ c(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
class: "absolute right-3 top-0 z-20 flex -translate-y-[calc(100%+6px)] items-center gap-1.5 rounded-full bg-gradient-to-r from-amber-300 to-amber-400 px-3 py-1 text-[11px] font-semibold uppercase tracking-wider text-amber-950 shadow-[0_4px_12px_-2px_rgba(245,158,11,0.45),0_0_0_1px_rgba(255,255,255,0.6)]",
|
|
123
|
+
role: "status",
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ c("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
|
|
126
|
+
/* @__PURE__ */ o(
|
|
164
127
|
"path",
|
|
165
128
|
{
|
|
166
|
-
d: "
|
|
129
|
+
d: "M8 1L15 14H1L8 1Z",
|
|
167
130
|
stroke: "currentColor",
|
|
168
|
-
"stroke-width": "1.
|
|
169
|
-
"stroke-
|
|
131
|
+
"stroke-width": "1.5",
|
|
132
|
+
"stroke-linejoin": "round"
|
|
170
133
|
}
|
|
171
|
-
)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
134
|
+
),
|
|
135
|
+
/* @__PURE__ */ o("path", { d: "M8 6v3", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round" }),
|
|
136
|
+
/* @__PURE__ */ o("circle", { cx: "8", cy: "11.5", r: "0.5", fill: "currentColor" })
|
|
137
|
+
] }),
|
|
138
|
+
"Test mode — no real charge"
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
/* @__PURE__ */ c(
|
|
143
|
+
"div",
|
|
144
|
+
{
|
|
145
|
+
ref: h,
|
|
146
|
+
role: "dialog",
|
|
147
|
+
"aria-modal": "true",
|
|
148
|
+
"aria-labelledby": t,
|
|
149
|
+
tabIndex: -1,
|
|
150
|
+
class: "relative flex max-h-[calc(100dvh-1rem)] sm:max-h-[calc(100dvh-2rem)] w-full flex-col overflow-hidden rounded-3xl bg-white outline-none ring-1 ring-black/5",
|
|
151
|
+
style: {
|
|
152
|
+
"--pw-accent": n ?? "#3b82f6",
|
|
153
|
+
boxShadow: "0 1px 2px rgba(15,23,42,0.04), 0 12px 32px -8px rgba(15,23,42,0.18), 0 24px 64px -16px rgba(15,23,42,0.22)"
|
|
154
|
+
},
|
|
155
|
+
children: [
|
|
156
|
+
/* @__PURE__ */ o("div", { class: "flex-1 overflow-y-auto p-8", children: a }),
|
|
157
|
+
s ? /* @__PURE__ */ o(
|
|
158
|
+
"button",
|
|
159
|
+
{
|
|
160
|
+
type: "button",
|
|
161
|
+
onClick: e,
|
|
162
|
+
"aria-label": "Close",
|
|
163
|
+
class: "absolute right-3 top-3 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white/80 text-gray-400 backdrop-blur-sm transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
|
|
164
|
+
children: /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o(
|
|
165
|
+
"path",
|
|
166
|
+
{
|
|
167
|
+
d: "M3 3l10 10M13 3L3 13",
|
|
168
|
+
stroke: "currentColor",
|
|
169
|
+
"stroke-width": "1.75",
|
|
170
|
+
"stroke-linecap": "round"
|
|
171
|
+
}
|
|
172
|
+
) })
|
|
173
|
+
}
|
|
174
|
+
) : null
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
] }),
|
|
177
179
|
/* @__PURE__ */ o("style", { children: `
|
|
178
180
|
@keyframes pw-fade-in { from { opacity: 0 } to { opacity: 1 } }
|
|
179
181
|
@keyframes pw-scale-in {
|
|
@@ -185,20 +187,20 @@ function ye({
|
|
|
185
187
|
}
|
|
186
188
|
) : null;
|
|
187
189
|
}
|
|
188
|
-
const
|
|
190
|
+
const ye = {
|
|
189
191
|
google: "Continue with Google",
|
|
190
192
|
apple: "Continue with Apple",
|
|
191
193
|
github: "Continue with GitHub",
|
|
192
194
|
facebook: "Continue with Facebook"
|
|
193
195
|
};
|
|
194
|
-
function
|
|
196
|
+
function oe({ block: r, ctx: e }) {
|
|
195
197
|
const t = e.auth, n = e.authSession, i = r.allow_signup !== !1, s = r.allow_password_reset !== !1, l = r.hide_when_authenticated !== !1;
|
|
196
198
|
if (!t)
|
|
197
199
|
return typeof console < "u" && console.warn("[paywall] auth_panel rendered without AuthClient — pass `auth: true` to PaywallUI"), null;
|
|
198
200
|
const a = n && !n.user.is_anonymous ? n : null;
|
|
199
201
|
return a && l ? null : a ? /* @__PURE__ */ o(xe, { email: a.user.email ?? "", onSignOut: () => t.signOut().catch(() => {
|
|
200
202
|
}) }) : /* @__PURE__ */ o(
|
|
201
|
-
|
|
203
|
+
be,
|
|
202
204
|
{
|
|
203
205
|
block: r,
|
|
204
206
|
allowSignup: i,
|
|
@@ -208,8 +210,8 @@ function se({ block: r, ctx: e }) {
|
|
|
208
210
|
);
|
|
209
211
|
}
|
|
210
212
|
function xe({ email: r, onSignOut: e }) {
|
|
211
|
-
return /* @__PURE__ */
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
+
return /* @__PURE__ */ c("div", { class: "flex items-center justify-between gap-3 rounded-2xl border border-gray-200 bg-gray-50/60 px-4 py-3", children: [
|
|
214
|
+
/* @__PURE__ */ c("div", { class: "flex flex-col", children: [
|
|
213
215
|
/* @__PURE__ */ o("span", { class: "text-[10px] font-semibold uppercase tracking-wider text-gray-500", children: "Signed in" }),
|
|
214
216
|
/* @__PURE__ */ o("span", { class: "text-sm font-medium text-gray-900", children: r })
|
|
215
217
|
] }),
|
|
@@ -224,69 +226,69 @@ function xe({ email: r, onSignOut: e }) {
|
|
|
224
226
|
)
|
|
225
227
|
] });
|
|
226
228
|
}
|
|
227
|
-
function
|
|
228
|
-
const i = n.auth, s = r.providers ?? [], [l, a] = y("signin"), [h,
|
|
229
|
+
function be({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
230
|
+
const i = n.auth, s = r.providers ?? [], [l, a] = y("signin"), [h, u] = y(""), [m, x] = y(""), [A, f] = y(""), [g, _] = y(null), [v, b] = y(null), [S, w] = y(null), B = async (I) => {
|
|
229
231
|
if (I.preventDefault(), !g) {
|
|
230
|
-
_("email"),
|
|
232
|
+
_("email"), b(null), w(null);
|
|
231
233
|
try {
|
|
232
234
|
l === "signin" ? await i.signInWithEmail({ email: h, password: m }) : l === "signup" ? (await i.signUp({ email: h, password: m })).kind === "confirmation_required" && (a("reset_verify"), w("Check your email for a confirmation code.")) : l === "forgot" ? (await i.requestPasswordReset({ email: h }), a("reset_sent"), w("If that email exists, a reset code has been sent.")) : l === "reset_verify" && (await i.verifyOtp({
|
|
233
235
|
email: h,
|
|
234
236
|
token: A,
|
|
235
237
|
type: m ? "recovery" : "email"
|
|
236
238
|
}), m && await i.updatePassword({ password: m }));
|
|
237
|
-
} catch (
|
|
238
|
-
const C =
|
|
239
|
-
|
|
239
|
+
} catch (E) {
|
|
240
|
+
const C = E instanceof T ? E.message : "Something went wrong";
|
|
241
|
+
b(C);
|
|
240
242
|
} finally {
|
|
241
243
|
_(null);
|
|
242
244
|
}
|
|
243
245
|
}
|
|
244
|
-
},
|
|
246
|
+
}, L = async (I) => {
|
|
245
247
|
if (!g) {
|
|
246
|
-
_(I),
|
|
248
|
+
_(I), b(null), w(null);
|
|
247
249
|
try {
|
|
248
250
|
await i.signInWithOAuth({
|
|
249
251
|
provider: I,
|
|
250
252
|
onPopupOpened: () => _(null)
|
|
251
253
|
});
|
|
252
|
-
} catch (
|
|
253
|
-
if (
|
|
254
|
-
if (
|
|
255
|
-
|
|
254
|
+
} catch (E) {
|
|
255
|
+
if (E instanceof T) {
|
|
256
|
+
if (E.code === "oauth_cancelled" || E.code === "oauth_timeout") return;
|
|
257
|
+
b(E.message);
|
|
256
258
|
} else
|
|
257
|
-
|
|
259
|
+
b("Sign-in failed");
|
|
258
260
|
} finally {
|
|
259
261
|
_(null);
|
|
260
262
|
}
|
|
261
263
|
}
|
|
262
264
|
};
|
|
263
|
-
return /* @__PURE__ */
|
|
265
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
|
|
264
266
|
r.heading ? /* @__PURE__ */ o("h2", { class: "text-lg font-semibold tracking-tight text-gray-900", children: r.heading }) : null,
|
|
265
|
-
s.length > 0 && (l === "signin" || l === "signup") ? /* @__PURE__ */
|
|
266
|
-
s.map((I) => /* @__PURE__ */
|
|
267
|
+
s.length > 0 && (l === "signin" || l === "signup") ? /* @__PURE__ */ c("div", { class: "flex flex-col gap-2", children: [
|
|
268
|
+
s.map((I) => /* @__PURE__ */ c(
|
|
267
269
|
"button",
|
|
268
270
|
{
|
|
269
271
|
type: "button",
|
|
270
|
-
onClick: () =>
|
|
272
|
+
onClick: () => L(I),
|
|
271
273
|
disabled: g !== null,
|
|
272
274
|
class: "flex h-11 w-full items-center justify-center gap-2 rounded-xl border border-gray-200 bg-white px-4 text-sm font-medium text-gray-900 shadow-[0_1px_0_rgba(15,23,42,0.04)] transition-all hover:-translate-y-px hover:border-gray-300 hover:bg-gray-50 hover:shadow-sm disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 disabled:hover:shadow-[0_1px_0_rgba(15,23,42,0.04)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
|
|
273
275
|
children: [
|
|
274
|
-
g === I ? /* @__PURE__ */ o("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700" }) : /* @__PURE__ */ o(
|
|
275
|
-
/* @__PURE__ */ o("span", { children:
|
|
276
|
+
g === I ? /* @__PURE__ */ o("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700" }) : /* @__PURE__ */ o(ve, { provider: I }),
|
|
277
|
+
/* @__PURE__ */ o("span", { children: ye[I] })
|
|
276
278
|
]
|
|
277
279
|
},
|
|
278
280
|
I
|
|
279
281
|
)),
|
|
280
|
-
/* @__PURE__ */ o(
|
|
282
|
+
/* @__PURE__ */ o(we, {})
|
|
281
283
|
] }) : null,
|
|
282
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ c("form", { onSubmit: B, class: "flex flex-col gap-2", children: [
|
|
283
285
|
(l === "signin" || l === "signup" || l === "forgot") && /* @__PURE__ */ o(
|
|
284
286
|
j,
|
|
285
287
|
{
|
|
286
288
|
type: "email",
|
|
287
289
|
label: "Email",
|
|
288
290
|
value: h,
|
|
289
|
-
onInput:
|
|
291
|
+
onInput: u,
|
|
290
292
|
autocomplete: "email",
|
|
291
293
|
required: !0
|
|
292
294
|
}
|
|
@@ -297,12 +299,12 @@ function ke({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
|
297
299
|
type: "password",
|
|
298
300
|
label: "Password",
|
|
299
301
|
value: m,
|
|
300
|
-
onInput:
|
|
302
|
+
onInput: x,
|
|
301
303
|
autocomplete: l === "signin" ? "current-password" : "new-password",
|
|
302
304
|
required: !0
|
|
303
305
|
}
|
|
304
306
|
),
|
|
305
|
-
l === "reset_verify" && /* @__PURE__ */
|
|
307
|
+
l === "reset_verify" && /* @__PURE__ */ c(re, { children: [
|
|
306
308
|
/* @__PURE__ */ o(
|
|
307
309
|
j,
|
|
308
310
|
{
|
|
@@ -321,7 +323,7 @@ function ke({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
|
321
323
|
type: "password",
|
|
322
324
|
label: "New password (optional — only for password reset)",
|
|
323
325
|
value: m,
|
|
324
|
-
onInput:
|
|
326
|
+
onInput: x,
|
|
325
327
|
autocomplete: "new-password"
|
|
326
328
|
}
|
|
327
329
|
)
|
|
@@ -339,20 +341,20 @@ function ke({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
|
339
341
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
340
342
|
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
341
343
|
},
|
|
342
|
-
children: g === "email" ? /* @__PURE__ */ o("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) :
|
|
344
|
+
children: g === "email" ? /* @__PURE__ */ o("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : ke(l)
|
|
343
345
|
}
|
|
344
346
|
)
|
|
345
347
|
] }),
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
l === "signin" && e && /* @__PURE__ */ o("button", { type: "button", onClick: () => O(a,
|
|
348
|
-
l === "signup" && /* @__PURE__ */ o("button", { type: "button", onClick: () => O(a,
|
|
349
|
-
l === "signin" && t && /* @__PURE__ */ o("button", { type: "button", onClick: () => O(a,
|
|
350
|
-
(l === "forgot" || l === "reset_sent" || l === "reset_verify") && /* @__PURE__ */ o("button", { type: "button", onClick: () => O(a,
|
|
351
|
-
l === "reset_sent" && /* @__PURE__ */ o("button", { type: "button", onClick: () => O(a,
|
|
348
|
+
/* @__PURE__ */ c("div", { class: "flex flex-wrap items-center justify-between gap-x-3 gap-y-1 text-xs text-gray-500", children: [
|
|
349
|
+
l === "signin" && e && /* @__PURE__ */ o("button", { type: "button", onClick: () => O(a, b, w, "signup"), class: "font-medium text-gray-700 hover:underline", children: "Create account" }),
|
|
350
|
+
l === "signup" && /* @__PURE__ */ o("button", { type: "button", onClick: () => O(a, b, w, "signin"), class: "font-medium text-gray-700 hover:underline", children: "I already have an account" }),
|
|
351
|
+
l === "signin" && t && /* @__PURE__ */ o("button", { type: "button", onClick: () => O(a, b, w, "forgot"), class: "hover:underline", children: "Forgot password?" }),
|
|
352
|
+
(l === "forgot" || l === "reset_sent" || l === "reset_verify") && /* @__PURE__ */ o("button", { type: "button", onClick: () => O(a, b, w, "signin"), class: "hover:underline", children: "Back to sign in" }),
|
|
353
|
+
l === "reset_sent" && /* @__PURE__ */ o("button", { type: "button", onClick: () => O(a, b, w, "reset_verify"), class: "font-medium text-gray-700 hover:underline", children: "I have a code" })
|
|
352
354
|
] })
|
|
353
355
|
] });
|
|
354
356
|
}
|
|
355
|
-
function
|
|
357
|
+
function ke(r) {
|
|
356
358
|
switch (r) {
|
|
357
359
|
case "signin":
|
|
358
360
|
return "Sign in";
|
|
@@ -370,7 +372,7 @@ function O(r, e, t, n) {
|
|
|
370
372
|
r(n), e(null), t(null);
|
|
371
373
|
}
|
|
372
374
|
function j({ type: r, label: e, value: t, onInput: n, autocomplete: i, inputMode: s, required: l }) {
|
|
373
|
-
return /* @__PURE__ */
|
|
375
|
+
return /* @__PURE__ */ c("label", { class: "flex flex-col gap-1.5", children: [
|
|
374
376
|
/* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: e }),
|
|
375
377
|
/* @__PURE__ */ o(
|
|
376
378
|
"input",
|
|
@@ -386,22 +388,22 @@ function j({ type: r, label: e, value: t, onInput: n, autocomplete: i, inputMode
|
|
|
386
388
|
)
|
|
387
389
|
] });
|
|
388
390
|
}
|
|
389
|
-
function
|
|
390
|
-
return /* @__PURE__ */
|
|
391
|
+
function we() {
|
|
392
|
+
return /* @__PURE__ */ c("div", { class: "flex items-center gap-2 py-1 text-[10px] uppercase tracking-[0.14em] text-gray-400", children: [
|
|
391
393
|
/* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gradient-to-r from-gray-200 to-transparent" }),
|
|
392
394
|
/* @__PURE__ */ o("span", { children: "or" }),
|
|
393
395
|
/* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gradient-to-r from-transparent to-gray-200" })
|
|
394
396
|
] });
|
|
395
397
|
}
|
|
396
|
-
function
|
|
397
|
-
return r === "google" ? /* @__PURE__ */
|
|
398
|
+
function ve({ provider: r }) {
|
|
399
|
+
return r === "google" ? /* @__PURE__ */ c("svg", { width: "16", height: "16", viewBox: "0 0 18 18", "aria-hidden": "true", children: [
|
|
398
400
|
/* @__PURE__ */ o("path", { fill: "#4285F4", d: "M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.49h4.84a4.14 4.14 0 0 1-1.79 2.71v2.26h2.9c1.7-1.56 2.69-3.87 2.69-6.62Z" }),
|
|
399
401
|
/* @__PURE__ */ o("path", { fill: "#34A853", d: "M9 18c2.43 0 4.47-.8 5.96-2.18l-2.9-2.26c-.8.54-1.83.86-3.06.86-2.36 0-4.36-1.59-5.07-3.74H.92v2.33A9 9 0 0 0 9 18Z" }),
|
|
400
402
|
/* @__PURE__ */ o("path", { fill: "#FBBC05", d: "M3.93 10.68a5.4 5.4 0 0 1 0-3.36V4.99H.92a9 9 0 0 0 0 8.02l3-2.33Z" }),
|
|
401
403
|
/* @__PURE__ */ o("path", { fill: "#EA4335", d: "M9 3.58c1.32 0 2.5.45 3.44 1.34l2.58-2.58A9 9 0 0 0 .92 4.99l3.01 2.33C4.64 5.17 6.64 3.58 9 3.58Z" })
|
|
402
404
|
] }) : r === "apple" ? /* @__PURE__ */ o("svg", { width: "14", height: "16", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("path", { d: "M11.4 8.5c0-2 1.6-3 1.7-3-.9-1.3-2.4-1.5-2.9-1.5-1.2-.1-2.4.7-3 .7-.6 0-1.6-.7-2.6-.7-1.3 0-2.6.8-3.3 2C-.4 8.4.7 12.5 2.2 14.7c.7 1.1 1.6 2.3 2.7 2.3 1.1 0 1.5-.7 2.8-.7 1.3 0 1.7.7 2.8.7 1.2 0 1.9-1.1 2.6-2.2.6-.9 1-1.8 1.1-2.7-1.4-.5-2.8-1.7-2.8-3.6Zm-2-6.5C10 1.3 10.4.4 10.3 0c-.7 0-1.6.5-2.1 1.1-.5.5-1 1.4-.9 2.2.7 0 1.5-.4 2.1-1.3Z" }) }) : r === "github" ? /* @__PURE__ */ o("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("path", { d: "M8 0C3.6 0 0 3.6 0 8a8 8 0 0 0 5.5 7.6c.4.1.5-.2.5-.4v-1.5c-2.2.5-2.7-1-2.7-1-.4-.9-.9-1.2-.9-1.2-.7-.5.1-.5.1-.5.8.1 1.2.8 1.2.8.7 1.2 1.9.9 2.4.7 0-.5.3-.9.5-1.1-1.8-.2-3.6-.9-3.6-4 0-.9.3-1.6.8-2.1-.1-.2-.4-1 .1-2.1 0 0 .7-.2 2.2.8a7.6 7.6 0 0 1 4 0c1.5-1 2.2-.8 2.2-.8.4 1.1.2 1.9.1 2.1.5.5.8 1.2.8 2.1 0 3.1-1.9 3.7-3.6 3.9.3.3.6.8.6 1.6V15c0 .2.1.5.6.4A8 8 0 0 0 16 8c0-4.4-3.6-8-8-8Z" }) }) : /* @__PURE__ */ o("svg", { width: "14", height: "16", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("path", { d: "M14 2.7C14 1.2 12.8 0 11.3 0H2.7C1.2 0 0 1.2 0 2.7v10.6C0 14.8 1.2 16 2.7 16h4V9.8H4.7v-2H6.7V6.4c0-2 1.2-3.1 3-3.1.9 0 1.7.1 2 .2V5h-1.4c-.8 0-1 .4-1 1v1.5h2.4l-.3 2H9.3V16h2c1.5 0 2.7-1.2 2.7-2.7V2.7Z" }) });
|
|
403
405
|
}
|
|
404
|
-
function
|
|
406
|
+
function _e({
|
|
405
407
|
block: r,
|
|
406
408
|
bootstrap: e,
|
|
407
409
|
auth: t,
|
|
@@ -409,7 +411,7 @@ function Se({
|
|
|
409
411
|
onBack: i,
|
|
410
412
|
showBack: s = !0
|
|
411
413
|
}) {
|
|
412
|
-
return /* @__PURE__ */
|
|
414
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
|
|
413
415
|
s ? /* @__PURE__ */ o(
|
|
414
416
|
"button",
|
|
415
417
|
{
|
|
@@ -419,7 +421,7 @@ function Se({
|
|
|
419
421
|
children: "← Back"
|
|
420
422
|
}
|
|
421
423
|
) : null,
|
|
422
|
-
/* @__PURE__ */ o(
|
|
424
|
+
/* @__PURE__ */ o(oe, { block: r, ctx: {
|
|
423
425
|
bootstrap: e,
|
|
424
426
|
selectedPriceId: null,
|
|
425
427
|
setSelectedPriceId: () => {
|
|
@@ -431,35 +433,35 @@ function Se({
|
|
|
431
433
|
} })
|
|
432
434
|
] });
|
|
433
435
|
}
|
|
434
|
-
function
|
|
436
|
+
function Se({
|
|
435
437
|
auth: r,
|
|
436
438
|
onSuccess: e,
|
|
437
439
|
onBack: t,
|
|
438
440
|
heading: n = "Continue as guest",
|
|
439
441
|
description: i = "Setting up your guest session…"
|
|
440
442
|
}) {
|
|
441
|
-
const [s, l] = y({ kind: "signing-in" }), a =
|
|
442
|
-
|
|
443
|
+
const [s, l] = y({ kind: "signing-in" }), a = P(!0);
|
|
444
|
+
M(() => () => {
|
|
443
445
|
a.current = !1;
|
|
444
446
|
}, []);
|
|
445
447
|
const h = () => {
|
|
446
448
|
l({ kind: "signing-in" }), (async () => {
|
|
447
449
|
try {
|
|
448
|
-
const
|
|
450
|
+
const u = await r.signInAnonymously();
|
|
449
451
|
if (!a.current) return;
|
|
450
|
-
e(
|
|
451
|
-
} catch (
|
|
452
|
+
e(u);
|
|
453
|
+
} catch (u) {
|
|
452
454
|
if (!a.current) return;
|
|
453
455
|
l({
|
|
454
456
|
kind: "error",
|
|
455
|
-
message:
|
|
457
|
+
message: u instanceof Error ? u.message : "Anonymous sign-in failed"
|
|
456
458
|
});
|
|
457
459
|
}
|
|
458
460
|
})();
|
|
459
461
|
};
|
|
460
|
-
return
|
|
462
|
+
return M(() => {
|
|
461
463
|
h();
|
|
462
|
-
}, []), /* @__PURE__ */
|
|
464
|
+
}, []), /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
|
|
463
465
|
t ? /* @__PURE__ */ o(
|
|
464
466
|
"button",
|
|
465
467
|
{
|
|
@@ -469,12 +471,12 @@ function Ce({
|
|
|
469
471
|
children: "← Back"
|
|
470
472
|
}
|
|
471
473
|
) : null,
|
|
472
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ c("div", { class: "flex flex-col gap-1", children: [
|
|
473
475
|
/* @__PURE__ */ o("h2", { class: "text-xl font-semibold text-gray-900", children: n }),
|
|
474
476
|
/* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: i })
|
|
475
477
|
] }),
|
|
476
|
-
s.kind === "signing-in" ? /* @__PURE__ */ o("div", { class: "flex items-center justify-center py-6", children: /* @__PURE__ */ o(
|
|
477
|
-
s.kind === "error" ? /* @__PURE__ */
|
|
478
|
+
s.kind === "signing-in" ? /* @__PURE__ */ o("div", { class: "flex items-center justify-center py-6", children: /* @__PURE__ */ o(Ce, {}) }) : null,
|
|
479
|
+
s.kind === "error" ? /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
|
|
478
480
|
/* @__PURE__ */ o("div", { class: "rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700", children: s.message }),
|
|
479
481
|
/* @__PURE__ */ o(
|
|
480
482
|
"button",
|
|
@@ -488,22 +490,22 @@ function Ce({
|
|
|
488
490
|
] }) : null
|
|
489
491
|
] });
|
|
490
492
|
}
|
|
491
|
-
function
|
|
492
|
-
return /* @__PURE__ */
|
|
493
|
+
function Ce() {
|
|
494
|
+
return /* @__PURE__ */ c("svg", { class: "h-5 w-5 animate-spin text-[var(--pw-accent)]", viewBox: "0 0 24 24", fill: "none", children: [
|
|
493
495
|
/* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "3", "stroke-opacity": "0.2" }),
|
|
494
496
|
/* @__PURE__ */ o("path", { d: "M22 12a10 10 0 0 0-10-10", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round" })
|
|
495
497
|
] });
|
|
496
498
|
}
|
|
497
|
-
const D = 3, F = 200, V = 5e3,
|
|
498
|
-
function
|
|
499
|
-
const i = e?.user.email ?? "", s = i || null, [l, a] = y(i), [h,
|
|
499
|
+
const D = 3, F = 200, V = 5e3, H = 5, Ie = 10 * 1024 * 1024, X = ["image/jpeg", "image/png", "image/webp"], K = /.+@.+\..+/;
|
|
500
|
+
function Ae({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
501
|
+
const i = e?.user.email ?? "", s = i || null, [l, a] = y(i), [h, u] = y(""), [m, x] = y(""), [A, f] = y([]), [g, _] = y(!1), [v, b] = y(null), [S, w] = y({}), B = ne(() => {
|
|
500
502
|
const C = (s ?? l).trim().toLowerCase(), d = h.trim(), p = m.trim();
|
|
501
|
-
return
|
|
502
|
-
}, [s, l, h, m]),
|
|
503
|
+
return K.test(C) && d.length >= D && d.length <= F && p.length >= 1 && p.length <= V;
|
|
504
|
+
}, [s, l, h, m]), L = () => {
|
|
503
505
|
const C = {}, d = (s ?? l).trim(), p = h.trim(), k = m.trim();
|
|
504
|
-
return d ?
|
|
506
|
+
return d ? K.test(d.toLowerCase()) || (C.email = "Invalid email") : C.email = "Required", (p.length < D || p.length > F) && (C.subject = `${D}–${F} characters`), (k.length < 1 || k.length > V) && (C.message = `1–${V} characters`), w(C), Object.keys(C).length === 0;
|
|
505
507
|
}, I = async (C) => {
|
|
506
|
-
if (C.preventDefault(), !g &&
|
|
508
|
+
if (C.preventDefault(), !g && L()) {
|
|
507
509
|
_(!0), w((d) => ({ ...d, submit: void 0 }));
|
|
508
510
|
try {
|
|
509
511
|
const d = (s ?? l).trim();
|
|
@@ -512,18 +514,18 @@ function Te({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
|
512
514
|
content: m.trim(),
|
|
513
515
|
email: d || void 0,
|
|
514
516
|
files: A.length > 0 ? A : void 0
|
|
515
|
-
}),
|
|
517
|
+
}), b(d);
|
|
516
518
|
} catch (d) {
|
|
517
|
-
const p = d instanceof
|
|
519
|
+
const p = d instanceof T && d.message || "Failed to send. Please try again.";
|
|
518
520
|
w((k) => ({ ...k, submit: p }));
|
|
519
521
|
} finally {
|
|
520
522
|
_(!1);
|
|
521
523
|
}
|
|
522
524
|
}
|
|
523
|
-
},
|
|
524
|
-
|
|
525
|
+
}, E = () => {
|
|
526
|
+
u(""), x(""), f([]), w({}), b(null);
|
|
525
527
|
};
|
|
526
|
-
return v ? /* @__PURE__ */
|
|
528
|
+
return v ? /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-4 py-2 text-center", children: [
|
|
527
529
|
/* @__PURE__ */ o(
|
|
528
530
|
"div",
|
|
529
531
|
{
|
|
@@ -544,13 +546,13 @@ function Te({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
|
544
546
|
}
|
|
545
547
|
),
|
|
546
548
|
/* @__PURE__ */ o("div", { class: "text-lg font-semibold tracking-tight text-gray-900", children: "Request submitted" }),
|
|
547
|
-
/* @__PURE__ */
|
|
549
|
+
/* @__PURE__ */ c("div", { class: "max-w-[320px] text-sm leading-relaxed text-gray-500", children: [
|
|
548
550
|
"We've received your message and will respond to",
|
|
549
551
|
" ",
|
|
550
552
|
/* @__PURE__ */ o("b", { class: "text-gray-700", children: v }),
|
|
551
553
|
"."
|
|
552
554
|
] }),
|
|
553
|
-
/* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ c("div", { class: "mt-2 flex items-center justify-center gap-3", children: [
|
|
554
556
|
/* @__PURE__ */ o(
|
|
555
557
|
"button",
|
|
556
558
|
{
|
|
@@ -564,7 +566,7 @@ function Te({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
|
564
566
|
"button",
|
|
565
567
|
{
|
|
566
568
|
type: "button",
|
|
567
|
-
onClick:
|
|
569
|
+
onClick: E,
|
|
568
570
|
class: "flex h-10 items-center justify-center rounded-xl px-4 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
|
|
569
571
|
style: {
|
|
570
572
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
@@ -574,8 +576,8 @@ function Te({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
|
574
576
|
}
|
|
575
577
|
)
|
|
576
578
|
] })
|
|
577
|
-
] }) : /* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */ o("div", { class: "flex items-center justify-between", children: /* @__PURE__ */
|
|
579
|
+
] }) : /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
|
|
580
|
+
/* @__PURE__ */ o("div", { class: "flex items-center justify-between", children: /* @__PURE__ */ c(
|
|
579
581
|
"button",
|
|
580
582
|
{
|
|
581
583
|
type: "button",
|
|
@@ -589,8 +591,8 @@ function Te({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
|
589
591
|
) }),
|
|
590
592
|
/* @__PURE__ */ o("h2", { class: "text-lg font-semibold tracking-tight text-gray-900", children: "Contact Support" }),
|
|
591
593
|
/* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: "Fill out the form below and we'll get back to you." }),
|
|
592
|
-
/* @__PURE__ */
|
|
593
|
-
s ? /* @__PURE__ */
|
|
594
|
+
/* @__PURE__ */ c("form", { onSubmit: I, class: "flex flex-col gap-3", children: [
|
|
595
|
+
s ? /* @__PURE__ */ c("div", { class: "rounded-xl border border-gray-200 bg-gray-50/60 px-3 py-2 text-xs text-gray-500", children: [
|
|
594
596
|
"Sending as ",
|
|
595
597
|
/* @__PURE__ */ o("b", { class: "font-medium text-gray-700", children: s })
|
|
596
598
|
] }) : /* @__PURE__ */ o(
|
|
@@ -611,24 +613,24 @@ function Te({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
|
611
613
|
type: "text",
|
|
612
614
|
label: "Subject",
|
|
613
615
|
value: h,
|
|
614
|
-
onInput:
|
|
616
|
+
onInput: u,
|
|
615
617
|
error: S.subject,
|
|
616
618
|
required: !0
|
|
617
619
|
}
|
|
618
620
|
),
|
|
619
621
|
/* @__PURE__ */ o(
|
|
620
|
-
|
|
622
|
+
Ee,
|
|
621
623
|
{
|
|
622
624
|
label: "Message",
|
|
623
625
|
value: m,
|
|
624
|
-
onInput:
|
|
626
|
+
onInput: x,
|
|
625
627
|
error: S.message,
|
|
626
628
|
required: !0
|
|
627
629
|
}
|
|
628
630
|
),
|
|
629
|
-
/* @__PURE__ */ o(
|
|
631
|
+
/* @__PURE__ */ o(Te, { files: A, onChange: f, disabled: g }),
|
|
630
632
|
S.submit && /* @__PURE__ */ o("p", { class: "text-xs text-red-600", children: S.submit }),
|
|
631
|
-
/* @__PURE__ */
|
|
633
|
+
/* @__PURE__ */ c("div", { class: "mt-1 flex items-center justify-end gap-2", children: [
|
|
632
634
|
/* @__PURE__ */ o(
|
|
633
635
|
"button",
|
|
634
636
|
{
|
|
@@ -643,7 +645,7 @@ function Te({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
|
643
645
|
"button",
|
|
644
646
|
{
|
|
645
647
|
type: "submit",
|
|
646
|
-
disabled: !
|
|
648
|
+
disabled: !B || g,
|
|
647
649
|
class: "flex h-10 items-center justify-center rounded-xl px-4 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 disabled:hover:brightness-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
|
|
648
650
|
style: {
|
|
649
651
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
@@ -657,7 +659,7 @@ function Te({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
|
657
659
|
] });
|
|
658
660
|
}
|
|
659
661
|
function J({ type: r, label: e, value: t, onInput: n, error: i, autocomplete: s, required: l }) {
|
|
660
|
-
return /* @__PURE__ */
|
|
662
|
+
return /* @__PURE__ */ c("label", { class: "flex flex-col gap-1.5", children: [
|
|
661
663
|
/* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: e }),
|
|
662
664
|
/* @__PURE__ */ o(
|
|
663
665
|
"input",
|
|
@@ -673,8 +675,8 @@ function J({ type: r, label: e, value: t, onInput: n, error: i, autocomplete: s,
|
|
|
673
675
|
i && /* @__PURE__ */ o("span", { class: "text-xs text-red-600", children: i })
|
|
674
676
|
] });
|
|
675
677
|
}
|
|
676
|
-
function
|
|
677
|
-
return /* @__PURE__ */
|
|
678
|
+
function Ee({ label: r, value: e, onInput: t, error: n, required: i }) {
|
|
679
|
+
return /* @__PURE__ */ c("label", { class: "flex flex-col gap-1.5", children: [
|
|
678
680
|
/* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: r }),
|
|
679
681
|
/* @__PURE__ */ o(
|
|
680
682
|
"textarea",
|
|
@@ -689,46 +691,46 @@ function Me({ label: r, value: e, onInput: t, error: n, required: i }) {
|
|
|
689
691
|
n && /* @__PURE__ */ o("span", { class: "text-xs text-red-600", children: n })
|
|
690
692
|
] });
|
|
691
693
|
}
|
|
692
|
-
function
|
|
693
|
-
const n =
|
|
694
|
-
if (!
|
|
694
|
+
function Te({ files: r, onChange: e, disabled: t }) {
|
|
695
|
+
const n = P(null), [i, s] = y(!1), [l, a] = y(null), h = (u) => {
|
|
696
|
+
if (!u || t) return;
|
|
695
697
|
a(null);
|
|
696
|
-
const m = Array.from(
|
|
697
|
-
if (r.length + m.length >
|
|
698
|
-
a(`Up to ${
|
|
698
|
+
const m = Array.from(u);
|
|
699
|
+
if (r.length + m.length > H) {
|
|
700
|
+
a(`Up to ${H} files`);
|
|
699
701
|
return;
|
|
700
702
|
}
|
|
701
|
-
const
|
|
702
|
-
(A) => X.includes(A.type) && A.size <=
|
|
703
|
+
const x = m.filter(
|
|
704
|
+
(A) => X.includes(A.type) && A.size <= Ie
|
|
703
705
|
);
|
|
704
|
-
if (
|
|
706
|
+
if (x.length !== m.length) {
|
|
705
707
|
a("Only JPEG/PNG/WebP, ≤ 10MB each");
|
|
706
708
|
return;
|
|
707
709
|
}
|
|
708
|
-
e([...r, ...
|
|
710
|
+
e([...r, ...x]);
|
|
709
711
|
};
|
|
710
|
-
return /* @__PURE__ */
|
|
712
|
+
return /* @__PURE__ */ c("div", { children: [
|
|
711
713
|
/* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: "Attachments (optional)" }),
|
|
712
|
-
/* @__PURE__ */
|
|
714
|
+
/* @__PURE__ */ c(
|
|
713
715
|
"div",
|
|
714
716
|
{
|
|
715
717
|
role: "button",
|
|
716
718
|
tabIndex: 0,
|
|
717
719
|
"aria-label": "Attachments upload",
|
|
718
720
|
onClick: () => !t && n.current?.click(),
|
|
719
|
-
onDragOver: (
|
|
720
|
-
|
|
721
|
+
onDragOver: (u) => {
|
|
722
|
+
u.preventDefault(), t || s(!0);
|
|
721
723
|
},
|
|
722
724
|
onDragLeave: () => s(!1),
|
|
723
|
-
onDrop: (
|
|
724
|
-
|
|
725
|
+
onDrop: (u) => {
|
|
726
|
+
u.preventDefault(), s(!1), h(u.dataTransfer?.files ?? null);
|
|
725
727
|
},
|
|
726
728
|
class: `mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${i ? "border-[var(--pw-accent)] bg-[color-mix(in_srgb,var(--pw-accent)_6%,white)]" : "border-gray-300 hover:border-gray-400 hover:bg-gray-50/60"} ${t ? "cursor-not-allowed opacity-60" : ""}`,
|
|
727
729
|
children: [
|
|
728
730
|
/* @__PURE__ */ o("div", { class: "text-xs text-gray-500", children: "Drop images here or click to select" }),
|
|
729
|
-
/* @__PURE__ */
|
|
731
|
+
/* @__PURE__ */ c("div", { class: "mt-0.5 text-[11px] text-gray-400", children: [
|
|
730
732
|
"JPEG/PNG/WebP, up to ",
|
|
731
|
-
|
|
733
|
+
H,
|
|
732
734
|
" files, ≤ 10MB each"
|
|
733
735
|
] })
|
|
734
736
|
]
|
|
@@ -742,39 +744,39 @@ function Be({ files: r, onChange: e, disabled: t }) {
|
|
|
742
744
|
multiple: !0,
|
|
743
745
|
accept: X.join(","),
|
|
744
746
|
class: "hidden",
|
|
745
|
-
onChange: (
|
|
746
|
-
h(
|
|
747
|
+
onChange: (u) => {
|
|
748
|
+
h(u.target.files), u.currentTarget.value = "";
|
|
747
749
|
}
|
|
748
750
|
}
|
|
749
751
|
),
|
|
750
752
|
l && /* @__PURE__ */ o("p", { class: "mt-1 text-xs text-red-600", children: l }),
|
|
751
|
-
r.length > 0 && /* @__PURE__ */ o("ul", { class: "mt-2 flex flex-col gap-1", children: r.map((
|
|
753
|
+
r.length > 0 && /* @__PURE__ */ o("ul", { class: "mt-2 flex flex-col gap-1", children: r.map((u, m) => /* @__PURE__ */ c(
|
|
752
754
|
"li",
|
|
753
755
|
{
|
|
754
756
|
class: "flex items-center justify-between gap-2 rounded bg-gray-50 px-2 py-1 text-xs",
|
|
755
757
|
children: [
|
|
756
|
-
/* @__PURE__ */ o("span", { class: "truncate text-gray-700", children:
|
|
758
|
+
/* @__PURE__ */ o("span", { class: "truncate text-gray-700", children: u.name }),
|
|
757
759
|
/* @__PURE__ */ o(
|
|
758
760
|
"button",
|
|
759
761
|
{
|
|
760
762
|
type: "button",
|
|
761
763
|
onClick: () => {
|
|
762
|
-
const
|
|
763
|
-
|
|
764
|
+
const x = [...r];
|
|
765
|
+
x.splice(m, 1), e(x);
|
|
764
766
|
},
|
|
765
767
|
disabled: t,
|
|
766
768
|
class: "text-gray-500 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-60",
|
|
767
|
-
"aria-label": `Remove ${
|
|
769
|
+
"aria-label": `Remove ${u.name}`,
|
|
768
770
|
children: "✕"
|
|
769
771
|
}
|
|
770
772
|
)
|
|
771
773
|
]
|
|
772
774
|
},
|
|
773
|
-
`${
|
|
775
|
+
`${u.name}-${u.size}-${m}`
|
|
774
776
|
)) })
|
|
775
777
|
] });
|
|
776
778
|
}
|
|
777
|
-
function
|
|
779
|
+
function Me({ block: r, ctx: e }) {
|
|
778
780
|
const [t, n] = y(!1), i = r.priceId ?? e.selectedPriceId, s = t || r.action === "checkout" && !i;
|
|
779
781
|
return /* @__PURE__ */ o(
|
|
780
782
|
"button",
|
|
@@ -791,16 +793,16 @@ function Ee({ block: r, ctx: e }) {
|
|
|
791
793
|
}
|
|
792
794
|
}
|
|
793
795
|
},
|
|
794
|
-
class: "relative flex h-
|
|
796
|
+
class: "pw-cta-shimmer relative mt-1 flex h-14 w-full items-center justify-center overflow-hidden rounded-full px-6 text-base font-semibold tracking-tight text-white transition-transform duration-150 hover:-translate-y-px active:scale-[0.98] active:translate-y-0 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
|
|
795
797
|
style: {
|
|
796
|
-
background: "linear-gradient(
|
|
797
|
-
boxShadow: "0
|
|
798
|
+
background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",
|
|
799
|
+
boxShadow: "0 0 24px 0 color-mix(in srgb, var(--pw-accent) 35%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent), 0 1px 2px rgba(15,23,42,0.08)"
|
|
798
800
|
},
|
|
799
|
-
children: t ? /* @__PURE__ */ o("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : r.label
|
|
801
|
+
children: t ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: r.label })
|
|
800
802
|
}
|
|
801
803
|
);
|
|
802
804
|
}
|
|
803
|
-
function
|
|
805
|
+
function Be({ ctx: r }) {
|
|
804
806
|
const e = r.authSession, t = r.auth, [n, i] = y(!1), s = () => r.onAction("support");
|
|
805
807
|
if (e && !e.user.is_anonymous) {
|
|
806
808
|
const l = async () => {
|
|
@@ -814,47 +816,39 @@ function Pe({ ctx: r }) {
|
|
|
814
816
|
}
|
|
815
817
|
}
|
|
816
818
|
};
|
|
817
|
-
return /* @__PURE__ */
|
|
818
|
-
/* @__PURE__ */
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
/* @__PURE__ */ o(
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
onClick: l,
|
|
826
|
-
disabled: !t || n,
|
|
827
|
-
class: "font-medium text-gray-600 underline-offset-2 hover:underline disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:underline",
|
|
828
|
-
children: n ? "Signing out…" : "Sign out"
|
|
829
|
-
}
|
|
830
|
-
),
|
|
819
|
+
return /* @__PURE__ */ c("div", { class: "-mt-3 flex flex-col items-center gap-1.5 pt-1 text-center text-[13px] text-gray-500", children: [
|
|
820
|
+
/* @__PURE__ */ c("span", { children: [
|
|
821
|
+
"Signed in as",
|
|
822
|
+
" ",
|
|
823
|
+
/* @__PURE__ */ o("b", { class: "font-medium text-gray-700", children: e.user.email })
|
|
824
|
+
] }),
|
|
825
|
+
/* @__PURE__ */ c("div", { class: "flex items-center justify-center gap-3", children: [
|
|
826
|
+
/* @__PURE__ */ o(z, { onClick: l, disabled: !t || n, children: n ? "Signing out…" : "Sign Out" }),
|
|
831
827
|
/* @__PURE__ */ o(Q, {}),
|
|
832
|
-
/* @__PURE__ */ o(
|
|
828
|
+
/* @__PURE__ */ o(z, { onClick: s, children: "Contact Support" })
|
|
833
829
|
] })
|
|
834
830
|
] });
|
|
835
831
|
}
|
|
836
|
-
return /* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */ o(
|
|
838
|
-
"button",
|
|
839
|
-
{
|
|
840
|
-
type: "button",
|
|
841
|
-
onClick: () => r.onAction("restore"),
|
|
842
|
-
class: "font-medium text-gray-600 underline-offset-2 hover:underline focus:outline-none focus-visible:underline",
|
|
843
|
-
children: "Restore purchases"
|
|
844
|
-
}
|
|
845
|
-
),
|
|
832
|
+
return /* @__PURE__ */ c("div", { class: "-mt-3 flex items-center justify-center gap-3 pt-1 text-center text-[13px]", children: [
|
|
833
|
+
/* @__PURE__ */ o(z, { onClick: () => r.onAction("restore"), children: "Restore purchases" }),
|
|
846
834
|
/* @__PURE__ */ o(Q, {}),
|
|
847
|
-
/* @__PURE__ */ o(
|
|
835
|
+
/* @__PURE__ */ o(z, { onClick: s, children: "Contact Support" })
|
|
848
836
|
] });
|
|
849
837
|
}
|
|
850
|
-
function
|
|
838
|
+
function z({
|
|
839
|
+
onClick: r,
|
|
840
|
+
disabled: e,
|
|
841
|
+
children: t
|
|
842
|
+
}) {
|
|
851
843
|
return /* @__PURE__ */ o(
|
|
852
844
|
"button",
|
|
853
845
|
{
|
|
854
846
|
type: "button",
|
|
855
847
|
onClick: r,
|
|
856
|
-
|
|
857
|
-
|
|
848
|
+
disabled: e,
|
|
849
|
+
class: "font-semibold underline underline-offset-2 transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:opacity-80",
|
|
850
|
+
style: { color: "var(--pw-accent)" },
|
|
851
|
+
children: t
|
|
858
852
|
}
|
|
859
853
|
);
|
|
860
854
|
}
|
|
@@ -862,7 +856,7 @@ function Q() {
|
|
|
862
856
|
return /* @__PURE__ */ o("span", { class: "h-1 w-1 rounded-full bg-gray-300", "aria-hidden": "true" });
|
|
863
857
|
}
|
|
864
858
|
function Le({ block: r }) {
|
|
865
|
-
return r.items.length ? /* @__PURE__ */ o("ul", { class: "flex flex-col gap-2.5", role: "list", children: r.items.map((e) => /* @__PURE__ */
|
|
859
|
+
return r.items.length ? /* @__PURE__ */ o("ul", { class: "flex flex-col gap-2.5", role: "list", children: r.items.map((e) => /* @__PURE__ */ c("li", { class: "flex items-start gap-3 text-sm text-gray-700", children: [
|
|
866
860
|
/* @__PURE__ */ o(
|
|
867
861
|
"span",
|
|
868
862
|
{
|
|
@@ -884,45 +878,84 @@ function Le({ block: r }) {
|
|
|
884
878
|
) })
|
|
885
879
|
}
|
|
886
880
|
),
|
|
887
|
-
/* @__PURE__ */
|
|
881
|
+
/* @__PURE__ */ c("div", { class: "flex flex-col gap-0.5", children: [
|
|
888
882
|
/* @__PURE__ */ o("span", { class: "font-medium leading-snug text-gray-900", children: e.name }),
|
|
889
883
|
e.desc ? /* @__PURE__ */ o("span", { class: "text-xs leading-relaxed text-gray-500", children: e.desc }) : null
|
|
890
884
|
] })
|
|
891
885
|
] }, e.id)) }) : null;
|
|
892
886
|
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
887
|
+
function Pe({ block: r }) {
|
|
888
|
+
const e = r.title ?? "100% Money-Back Guarantee", t = r.subtitle ?? "Not satisfied? We'll refund you — no questions asked.", n = (r.icon ?? "dollar_shield") !== "none";
|
|
889
|
+
return /* @__PURE__ */ c("div", { class: "-mt-1 flex flex-col items-center gap-1 border-b border-gray-200 pb-4 text-center", children: [
|
|
890
|
+
/* @__PURE__ */ c("div", { class: "flex items-center justify-center gap-1.5", children: [
|
|
891
|
+
n ? /* @__PURE__ */ o(Ue, {}) : null,
|
|
892
|
+
/* @__PURE__ */ o("b", { class: "text-[14px] font-semibold text-gray-700", children: e })
|
|
893
|
+
] }),
|
|
894
|
+
t ? /* @__PURE__ */ o("span", { class: "text-[12px] leading-relaxed text-gray-500", children: t }) : null
|
|
895
|
+
] });
|
|
896
|
+
}
|
|
897
|
+
function Ue() {
|
|
898
|
+
return /* @__PURE__ */ o(
|
|
899
|
+
"svg",
|
|
900
|
+
{
|
|
901
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
902
|
+
viewBox: "0 0 512 512",
|
|
903
|
+
fill: "currentColor",
|
|
904
|
+
width: "18",
|
|
905
|
+
height: "18",
|
|
906
|
+
class: "text-emerald-500",
|
|
907
|
+
"aria-hidden": "true",
|
|
908
|
+
children: /* @__PURE__ */ o("path", { d: "M257.5 .1l3.1 .4 192 42.7c4.3 1 8.2 3.2 11.2 6.5s4.8 7.4 5.3 11.8l.2 2.5 0 234.7C469.3 416.5 373.8 512 256 512C140.1 512 45.9 419.7 42.7 304.6l-.1-6L42.7 64c0-4.4 1.4-8.8 3.9-12.4s6.2-6.3 10.4-7.8l2.4-.7L251.4 .5c2-.4 4.1-.6 6.2-.4zM256 85.3c-12.8 0-21.3 8.5-21.3 21.3l0 23.5c-36.3 4.3-64 34.1-64 72.5c0 44.8 34.1 61.9 64 70.4l0 66.1c-11.9-4-20.1-15.3-21.2-27.1l-.1-2.7c0-12.8-8.5-21.3-21.3-21.3s-21.3 8.5-21.3 21.3c0 38.4 27.7 68.3 64 72.5l0 23.5c0 12.8 8.5 21.3 21.3 21.3s21.3-8.5 21.3-21.3l0-23.5c36.3-4.3 64-36.3 64-72.5c0-44.8-34.1-61.9-64-70.4l0-66.1c11.9 4 20.1 15.3 21.2 27.1l.1 2.7c0 12.8 8.5 21.3 21.3 21.3s21.3-8.5 21.3-21.3c0-38.4-27.7-68.3-64-72.5l0-23.5c0-12.8-8.5-21.3-21.3-21.3zm21.3 198.4c14.9 6.4 21.3 12.8 21.3 25.6c0 14.9-8.5 25.6-21.3 29.9l0-55.5zM234.7 172.8l0 55.5c-14.9-6.4-21.3-12.8-21.3-25.6c0-14.9 8.5-25.6 21.3-29.9z" })
|
|
909
|
+
}
|
|
910
|
+
);
|
|
911
|
+
}
|
|
912
|
+
const se = 30, Oe = 16, je = 2;
|
|
913
|
+
function ze(r, e) {
|
|
914
|
+
const t = e * je;
|
|
915
|
+
let n = se;
|
|
916
|
+
for (r.style.fontSize = `${n}px`; r.scrollHeight > t && n > Oe; )
|
|
898
917
|
n -= 1, r.style.fontSize = `${n}px`;
|
|
899
918
|
}
|
|
900
|
-
function
|
|
901
|
-
const t = r.level ?? 1, n = `h${t}`, i = t === 1 ? "text-[1.
|
|
902
|
-
return
|
|
919
|
+
function Re({ block: r, ctx: e }) {
|
|
920
|
+
const t = r.level ?? 1, n = `h${t}`, i = t === 1 ? "text-[1.875rem] font-bold leading-[1.15] text-center text-balance text-gray-900 tracking-[-0.02em]" : t === 2 ? "text-xl font-semibold leading-snug text-gray-900 tracking-tight" : "text-base font-medium text-gray-900", s = P(null), l = t === 1 && !!e.bootstrap.settings.title_auto_fit;
|
|
921
|
+
return M(() => {
|
|
903
922
|
if (!l || !s.current) return;
|
|
904
|
-
const a = getComputedStyle(s.current), h = parseFloat(a.lineHeight) ||
|
|
905
|
-
|
|
923
|
+
const a = getComputedStyle(s.current), h = parseFloat(a.lineHeight) || se * 1.5;
|
|
924
|
+
ze(s.current, h);
|
|
906
925
|
}, [l, r.text]), /* @__PURE__ */ o(n, { ref: s, class: i, children: r.text });
|
|
907
926
|
}
|
|
908
|
-
function
|
|
927
|
+
function Ne(r) {
|
|
909
928
|
const e = r.local ?? { currency: r.currency, amount: r.amount };
|
|
910
929
|
try {
|
|
911
|
-
|
|
930
|
+
const t = new Intl.NumberFormat(void 0, {
|
|
912
931
|
style: "currency",
|
|
913
932
|
currency: e.currency,
|
|
914
|
-
|
|
915
|
-
|
|
933
|
+
currencyDisplay: "narrowSymbol",
|
|
934
|
+
maximumFractionDigits: e.amount % 1 === 0 ? 0 : 2,
|
|
935
|
+
minimumFractionDigits: e.amount % 1 === 0 ? 0 : 2
|
|
936
|
+
}).formatToParts(e.amount);
|
|
937
|
+
let n = "", i = "";
|
|
938
|
+
for (const s of t)
|
|
939
|
+
s.type === "currency" ? n = s.value : s.type !== "literal" && (i += s.value);
|
|
940
|
+
return { currency: n || e.currency, amount: i.trim() };
|
|
916
941
|
} catch {
|
|
917
|
-
return
|
|
942
|
+
return { currency: e.currency, amount: String(e.amount) };
|
|
918
943
|
}
|
|
919
944
|
}
|
|
920
|
-
function
|
|
921
|
-
|
|
945
|
+
function qe(r) {
|
|
946
|
+
return r.label ? r.label.toUpperCase() : !r.interval || r.interval === "lifetime" ? "LIFETIME" : {
|
|
947
|
+
day: "DAILY PLAN",
|
|
948
|
+
week: "WEEKLY PLAN",
|
|
949
|
+
month: "MONTHLY PLAN",
|
|
950
|
+
year: "YEARLY PLAN"
|
|
951
|
+
}[r.interval] ?? `${r.interval.toUpperCase()} PLAN`;
|
|
952
|
+
}
|
|
953
|
+
function De(r) {
|
|
954
|
+
if (!r.interval || r.interval === "lifetime") return "lifetime";
|
|
922
955
|
const e = r.interval_count ?? 1;
|
|
923
|
-
return e === 1 ?
|
|
956
|
+
return e === 1 ? r.interval : `${e} ${r.interval}s`;
|
|
924
957
|
}
|
|
925
|
-
function
|
|
958
|
+
function Fe({ block: r, ctx: e }) {
|
|
926
959
|
const t = r.priceIds && r.priceIds.length > 0 ? new Set(r.priceIds) : null, n = e.bootstrap.prices.filter((a) => !t || t.has(a.id));
|
|
927
960
|
if (n.length === 0)
|
|
928
961
|
return /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: "No prices available." });
|
|
@@ -935,8 +968,8 @@ function ze({ block: r, ctx: e }) {
|
|
|
935
968
|
role: "radiogroup",
|
|
936
969
|
"aria-label": "Plans",
|
|
937
970
|
children: n.map((a) => {
|
|
938
|
-
const h = e.selectedPriceId === a.id,
|
|
939
|
-
return /* @__PURE__ */
|
|
971
|
+
const h = e.selectedPriceId === a.id, u = r.popular_price_id === a.id, { currency: m, amount: x } = Ne(a);
|
|
972
|
+
return /* @__PURE__ */ c(
|
|
940
973
|
"button",
|
|
941
974
|
{
|
|
942
975
|
type: "button",
|
|
@@ -946,13 +979,12 @@ function ze({ block: r, ctx: e }) {
|
|
|
946
979
|
e.setSelectedPriceId(a.id), e.onAction("price_selected", { priceId: a.id, price: a });
|
|
947
980
|
},
|
|
948
981
|
class: [
|
|
949
|
-
"group relative rounded-2xl border px-4 py-3
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
c ? "mt-2.5" : ""
|
|
982
|
+
"group relative flex w-full items-center gap-3 rounded-2xl border px-4 py-3 text-left transition-all duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
|
|
983
|
+
h ? "border-[var(--pw-accent)] shadow-[0_0_0_1px_var(--pw-accent)]" : "border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm",
|
|
984
|
+
u ? "mt-2.5" : ""
|
|
953
985
|
].join(" "),
|
|
954
986
|
children: [
|
|
955
|
-
|
|
987
|
+
u ? /* @__PURE__ */ o(
|
|
956
988
|
"span",
|
|
957
989
|
{
|
|
958
990
|
class: "absolute -top-2.5 left-4 rounded-full px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white shadow-sm",
|
|
@@ -962,31 +994,42 @@ function ze({ block: r, ctx: e }) {
|
|
|
962
994
|
children: s
|
|
963
995
|
}
|
|
964
996
|
) : null,
|
|
965
|
-
/* @__PURE__ */
|
|
966
|
-
/* @__PURE__ */ o(
|
|
967
|
-
|
|
968
|
-
{
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
),
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
a.trial_days ? /* @__PURE__ */ u("span", { class: "text-xs font-medium text-[var(--pw-accent)]", children: [
|
|
981
|
-
a.trial_days,
|
|
982
|
-
"-day free trial"
|
|
983
|
-
] }) : null
|
|
984
|
-
] })
|
|
997
|
+
/* @__PURE__ */ c("div", { class: "flex flex-1 flex-col gap-0.5", children: [
|
|
998
|
+
/* @__PURE__ */ o("span", { class: "text-[11px] font-medium uppercase tracking-[0.08em] text-gray-500", children: qe(a) }),
|
|
999
|
+
/* @__PURE__ */ c("div", { class: "flex items-baseline gap-1.5 leading-none", children: [
|
|
1000
|
+
/* @__PURE__ */ o("span", { class: "text-[24px] font-normal text-gray-400", children: m }),
|
|
1001
|
+
/* @__PURE__ */ o("span", { class: "text-[34px] font-semibold tracking-tight text-gray-900", children: x }),
|
|
1002
|
+
/* @__PURE__ */ c("span", { class: "ml-1 text-sm font-medium text-gray-400", children: [
|
|
1003
|
+
"/ ",
|
|
1004
|
+
De(a)
|
|
1005
|
+
] })
|
|
1006
|
+
] }),
|
|
1007
|
+
a.description ? /* @__PURE__ */ o("span", { class: "mt-1 text-xs leading-relaxed text-gray-500", children: a.description }) : null,
|
|
1008
|
+
a.trial_days ? /* @__PURE__ */ c("span", { class: "mt-1 text-xs font-medium text-[var(--pw-accent)]", children: [
|
|
1009
|
+
a.trial_days,
|
|
1010
|
+
"-day free trial"
|
|
1011
|
+
] }) : null
|
|
985
1012
|
] }),
|
|
986
|
-
/* @__PURE__ */
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
1013
|
+
/* @__PURE__ */ o(
|
|
1014
|
+
"span",
|
|
1015
|
+
{
|
|
1016
|
+
class: [
|
|
1017
|
+
"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border transition-colors",
|
|
1018
|
+
h ? "border-[var(--pw-accent)] bg-[var(--pw-accent)] text-white" : "border-gray-300 bg-white text-transparent group-hover:border-gray-400"
|
|
1019
|
+
].join(" "),
|
|
1020
|
+
"aria-hidden": "true",
|
|
1021
|
+
children: /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ o(
|
|
1022
|
+
"path",
|
|
1023
|
+
{
|
|
1024
|
+
d: "M3.5 8.5l3 3 6-7",
|
|
1025
|
+
stroke: "currentColor",
|
|
1026
|
+
"stroke-width": "2",
|
|
1027
|
+
"stroke-linecap": "round",
|
|
1028
|
+
"stroke-linejoin": "round"
|
|
1029
|
+
}
|
|
1030
|
+
) })
|
|
1031
|
+
}
|
|
1032
|
+
)
|
|
990
1033
|
]
|
|
991
1034
|
},
|
|
992
1035
|
a.id
|
|
@@ -995,36 +1038,36 @@ function ze({ block: r, ctx: e }) {
|
|
|
995
1038
|
}
|
|
996
1039
|
);
|
|
997
1040
|
}
|
|
998
|
-
function
|
|
1041
|
+
function Ve({ block: r }) {
|
|
999
1042
|
return /* @__PURE__ */ o("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children: r.text });
|
|
1000
1043
|
}
|
|
1001
|
-
const
|
|
1044
|
+
const He = {
|
|
1002
1045
|
week: 0.25,
|
|
1003
1046
|
month: 1,
|
|
1004
1047
|
year: 12
|
|
1005
1048
|
};
|
|
1006
|
-
function
|
|
1049
|
+
function $e(r) {
|
|
1007
1050
|
return r || "period";
|
|
1008
1051
|
}
|
|
1009
|
-
function
|
|
1052
|
+
function Ge({ block: r, ctx: e }) {
|
|
1010
1053
|
if (!r.queries.length) return null;
|
|
1011
|
-
const n = e.bootstrap.prices.find((s) => s.id === e.selectedPriceId)?.interval ?? null, i = n ?
|
|
1012
|
-
return /* @__PURE__ */
|
|
1013
|
-
/* @__PURE__ */
|
|
1054
|
+
const n = e.bootstrap.prices.find((s) => s.id === e.selectedPriceId)?.interval ?? null, i = n ? He[n] : void 0;
|
|
1055
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col gap-2", children: [
|
|
1056
|
+
/* @__PURE__ */ c("div", { class: "text-sm font-semibold text-gray-800", children: [
|
|
1014
1057
|
"Included per ",
|
|
1015
|
-
/* @__PURE__ */ o("span", { children:
|
|
1058
|
+
/* @__PURE__ */ o("span", { children: $e(n) }),
|
|
1016
1059
|
":"
|
|
1017
1060
|
] }),
|
|
1018
1061
|
/* @__PURE__ */ o("ul", { class: "flex flex-col gap-2", role: "list", children: r.queries.map((s) => {
|
|
1019
1062
|
const l = Number.isFinite(s.count) ? s.count : 0, a = i !== void 0 ? Math.round(l * i) : l;
|
|
1020
|
-
return /* @__PURE__ */
|
|
1063
|
+
return /* @__PURE__ */ c("li", { class: `flex gap-2 ${s.desc ? "" : "items-center"}`, children: [
|
|
1021
1064
|
/* @__PURE__ */ o(
|
|
1022
1065
|
"span",
|
|
1023
1066
|
{
|
|
1024
1067
|
class: `flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full ${s.desc ? "mt-0.5" : ""}`,
|
|
1025
1068
|
style: {
|
|
1026
|
-
background: "
|
|
1027
|
-
color: "
|
|
1069
|
+
background: "var(--pw-accent)",
|
|
1070
|
+
color: "#ffffff"
|
|
1028
1071
|
},
|
|
1029
1072
|
"aria-hidden": "true",
|
|
1030
1073
|
children: /* @__PURE__ */ o("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ o(
|
|
@@ -1032,18 +1075,18 @@ function $e({ block: r, ctx: e }) {
|
|
|
1032
1075
|
{
|
|
1033
1076
|
d: "M5 10l3 3 7-7",
|
|
1034
1077
|
stroke: "currentColor",
|
|
1035
|
-
"stroke-width": "2.
|
|
1078
|
+
"stroke-width": "2.75",
|
|
1036
1079
|
"stroke-linecap": "round",
|
|
1037
1080
|
"stroke-linejoin": "round"
|
|
1038
1081
|
}
|
|
1039
1082
|
) })
|
|
1040
1083
|
}
|
|
1041
1084
|
),
|
|
1042
|
-
/* @__PURE__ */
|
|
1085
|
+
/* @__PURE__ */ c("div", { children: [
|
|
1043
1086
|
/* @__PURE__ */ o("span", { class: "font-semibold text-gray-900 text-sm", children: a }),
|
|
1044
1087
|
" ",
|
|
1045
1088
|
/* @__PURE__ */ o("span", { class: "text-sm text-gray-800", children: s.name }),
|
|
1046
|
-
s.desc ? /* @__PURE__ */
|
|
1089
|
+
s.desc ? /* @__PURE__ */ c(re, { children: [
|
|
1047
1090
|
/* @__PURE__ */ o("br", {}),
|
|
1048
1091
|
/* @__PURE__ */ o("span", { class: "text-xs text-gray-500", children: s.desc })
|
|
1049
1092
|
] }) : null
|
|
@@ -1052,18 +1095,19 @@ function $e({ block: r, ctx: e }) {
|
|
|
1052
1095
|
}) })
|
|
1053
1096
|
] });
|
|
1054
1097
|
}
|
|
1055
|
-
const
|
|
1056
|
-
heading:
|
|
1057
|
-
text:
|
|
1058
|
-
price_grid:
|
|
1059
|
-
cta_button:
|
|
1060
|
-
auth_panel:
|
|
1061
|
-
current_session:
|
|
1098
|
+
const We = {
|
|
1099
|
+
heading: Re,
|
|
1100
|
+
text: Ve,
|
|
1101
|
+
price_grid: Fe,
|
|
1102
|
+
cta_button: Me,
|
|
1103
|
+
auth_panel: oe,
|
|
1104
|
+
current_session: Be,
|
|
1062
1105
|
features_list: Le,
|
|
1063
|
-
tokenization_gate:
|
|
1106
|
+
tokenization_gate: Ge,
|
|
1107
|
+
guarantee_badge: Pe
|
|
1064
1108
|
};
|
|
1065
|
-
function
|
|
1066
|
-
const s =
|
|
1109
|
+
function Ze({ layout: r, bootstrap: e, onAction: t, auth: n, authSession: i }) {
|
|
1110
|
+
const s = ne(() => e.prices[0]?.id ?? null, [e.prices]), [l, a] = y(s), h = {
|
|
1067
1111
|
bootstrap: e,
|
|
1068
1112
|
selectedPriceId: l,
|
|
1069
1113
|
setSelectedPriceId: a,
|
|
@@ -1071,18 +1115,18 @@ function He({ layout: r, bootstrap: e, onAction: t, auth: n, authSession: i }) {
|
|
|
1071
1115
|
auth: n,
|
|
1072
1116
|
authSession: i
|
|
1073
1117
|
};
|
|
1074
|
-
return /* @__PURE__ */ o("div", { class: "flex flex-col gap-4", children: r.blocks.map((
|
|
1075
|
-
const
|
|
1076
|
-
return
|
|
1118
|
+
return /* @__PURE__ */ o("div", { class: "flex flex-col gap-4", children: r.blocks.map((u, m) => {
|
|
1119
|
+
const x = We[u.type];
|
|
1120
|
+
return x ? /* @__PURE__ */ o(x, { block: u, ctx: h }, m) : (typeof console < "u" && console.warn(`[paywall] unknown block type: ${u.type}`), null);
|
|
1077
1121
|
}) });
|
|
1078
1122
|
}
|
|
1079
|
-
function
|
|
1123
|
+
function Ye(r, e, t, n) {
|
|
1080
1124
|
return r ? n ? { open: !0, view: "purchased", error: null } : e.status === "idle" || e.status === "loading" ? { open: !0, view: "loading", error: null } : e.status === "error" ? { open: !0, view: "error", error: e.error } : t.kind === "support" ? { open: !0, view: "support", error: null } : t.kind === "auth_gate" ? { open: !0, view: "auth", error: null } : t.kind === "anon_gate" ? { open: !0, view: "anon", error: null } : t.kind === "awaiting_payment" ? { open: !0, view: "awaiting_payment", error: null } : t.kind === "popup_blocked" ? { open: !0, view: "popup_blocked", error: null } : t.kind === "purchase_success" ? { open: !0, view: "purchased", error: null } : t.kind === "verifying" ? { open: !0, view: "loading", error: null } : { open: !0, view: "layout", error: null } : { open: !1, view: null, error: null };
|
|
1081
1125
|
}
|
|
1082
|
-
function
|
|
1126
|
+
function Xe(r, e) {
|
|
1083
1127
|
return r.open === e.open && r.view === e.view && r.error === e.error;
|
|
1084
1128
|
}
|
|
1085
|
-
function
|
|
1129
|
+
function Ke({
|
|
1086
1130
|
client: r,
|
|
1087
1131
|
open: e,
|
|
1088
1132
|
onClose: t,
|
|
@@ -1093,25 +1137,25 @@ function Ze({
|
|
|
1093
1137
|
onState: a,
|
|
1094
1138
|
inline: h
|
|
1095
1139
|
}) {
|
|
1096
|
-
const [
|
|
1140
|
+
const [u, m] = y({ status: "idle" }), [x, A] = y(
|
|
1097
1141
|
() => r.auth?.getCachedSession() ?? null
|
|
1098
|
-
), [f, g] = y(() => i === "support" ? { kind: "support", origin: "standalone" } : i === "auth" ? { kind: "auth_gate", origin: "standalone" } : i === "anon" ? { kind: "anon_gate", origin: "standalone" } : { kind: "layout" }), _ =
|
|
1099
|
-
|
|
1142
|
+
), [f, g] = y(() => i === "support" ? { kind: "support", origin: "standalone" } : i === "auth" ? { kind: "auth_gate", origin: "standalone" } : i === "anon" ? { kind: "anon_gate", origin: "standalone" } : { kind: "layout" }), _ = P(!1), v = P(null);
|
|
1143
|
+
M(() => {
|
|
1100
1144
|
if (!a) return;
|
|
1101
|
-
const d =
|
|
1102
|
-
p &&
|
|
1103
|
-
}, [e,
|
|
1145
|
+
const d = Ye(e, u, f, s), p = v.current;
|
|
1146
|
+
p && Xe(p, d) || (v.current = d, a(d));
|
|
1147
|
+
}, [e, u, f, s, a]), M(() => {
|
|
1104
1148
|
if (r.auth)
|
|
1105
|
-
return r.auth.onAuthChange((d) => A(
|
|
1106
|
-
}, [r.auth]),
|
|
1149
|
+
return r.auth.onAuthChange((d, p) => A(p));
|
|
1150
|
+
}, [r.auth]), M(() => {
|
|
1107
1151
|
if (typeof r.onBootstrapChange == "function")
|
|
1108
1152
|
return r.onBootstrapChange((d) => {
|
|
1109
1153
|
m(
|
|
1110
1154
|
(p) => p.status === "ready" ? { status: "ready", data: d } : p
|
|
1111
1155
|
);
|
|
1112
1156
|
});
|
|
1113
|
-
}, [r]),
|
|
1114
|
-
if (!e ||
|
|
1157
|
+
}, [r]), M(() => {
|
|
1158
|
+
if (!e || u.status === "ready" || u.status === "loading") return;
|
|
1115
1159
|
let d = !1;
|
|
1116
1160
|
return m({ status: "loading" }), r.bootstrap().then((p) => {
|
|
1117
1161
|
d || (m({ status: "ready", data: p }), n("ready", p), p.user?.has_active_subscription && !l && (n("purchase_completed", {
|
|
@@ -1121,19 +1165,19 @@ function Ze({
|
|
|
1121
1165
|
}), g({ kind: "purchase_success", restored: !0 })));
|
|
1122
1166
|
}).catch((p) => {
|
|
1123
1167
|
if (d) return;
|
|
1124
|
-
const k = p instanceof
|
|
1168
|
+
const k = p instanceof T ? p : new T("unknown", "Failed to load paywall", { cause: p });
|
|
1125
1169
|
m({ status: "error", error: k }), n("error", k);
|
|
1126
1170
|
}), () => {
|
|
1127
1171
|
d = !0;
|
|
1128
1172
|
};
|
|
1129
|
-
}, [e, r]),
|
|
1173
|
+
}, [e, r]), M(() => {
|
|
1130
1174
|
if (!e) {
|
|
1131
1175
|
g({ kind: "layout" }), _.current = !1;
|
|
1132
1176
|
return;
|
|
1133
1177
|
}
|
|
1134
1178
|
i === "support" ? g({ kind: "support", origin: "standalone" }) : i === "auth" ? g({ kind: "auth_gate", origin: "standalone" }) : i === "anon" && g({ kind: "anon_gate", origin: "standalone" });
|
|
1135
1179
|
}, [e, i]);
|
|
1136
|
-
const
|
|
1180
|
+
const b = async (d) => {
|
|
1137
1181
|
try {
|
|
1138
1182
|
const p = await r.createCheckout({
|
|
1139
1183
|
priceId: d,
|
|
@@ -1150,7 +1194,7 @@ function Ze({
|
|
|
1150
1194
|
} else
|
|
1151
1195
|
g({ kind: "popup_blocked", priceId: d, url: p.url });
|
|
1152
1196
|
} catch (p) {
|
|
1153
|
-
if (p instanceof
|
|
1197
|
+
if (p instanceof T && p.code === "already_purchased") {
|
|
1154
1198
|
try {
|
|
1155
1199
|
await r.getUser({ force: !0 });
|
|
1156
1200
|
} catch {
|
|
@@ -1158,7 +1202,7 @@ function Ze({
|
|
|
1158
1202
|
n("purchase_completed", { priceId: d, sessionId: null, restored: !0 }), g({ kind: "purchase_success", restored: !0 });
|
|
1159
1203
|
return;
|
|
1160
1204
|
}
|
|
1161
|
-
const k = p instanceof
|
|
1205
|
+
const k = p instanceof T ? p : new T("checkout_failed", "Checkout failed", { cause: p });
|
|
1162
1206
|
n("error", k), g({ kind: "layout" });
|
|
1163
1207
|
}
|
|
1164
1208
|
}, S = (d, p) => {
|
|
@@ -1172,8 +1216,8 @@ function Ze({
|
|
|
1172
1216
|
g({ kind: "awaiting_payment", priceId: d, url: p });
|
|
1173
1217
|
}
|
|
1174
1218
|
};
|
|
1175
|
-
|
|
1176
|
-
if (f.kind !== "auth_gate" || !
|
|
1219
|
+
M(() => {
|
|
1220
|
+
if (f.kind !== "auth_gate" || !x || x.user.is_anonymous || _.current) return;
|
|
1177
1221
|
_.current = !0;
|
|
1178
1222
|
const d = f.pendingCheckout, p = f.origin;
|
|
1179
1223
|
g({ kind: "verifying" }), (async () => {
|
|
@@ -1193,11 +1237,11 @@ function Ze({
|
|
|
1193
1237
|
p === "standalone" ? t() : g({ kind: "layout" });
|
|
1194
1238
|
return;
|
|
1195
1239
|
}
|
|
1196
|
-
await
|
|
1240
|
+
await b(d.priceId);
|
|
1197
1241
|
})().finally(() => {
|
|
1198
1242
|
_.current = !1;
|
|
1199
1243
|
});
|
|
1200
|
-
}, [
|
|
1244
|
+
}, [x, f]);
|
|
1201
1245
|
const w = async (d, p) => {
|
|
1202
1246
|
if (d === "close") {
|
|
1203
1247
|
t();
|
|
@@ -1216,19 +1260,19 @@ function Ze({
|
|
|
1216
1260
|
g({ kind: "support", origin: "layout" });
|
|
1217
1261
|
return;
|
|
1218
1262
|
}
|
|
1219
|
-
if (d === "checkout" &&
|
|
1263
|
+
if (d === "checkout" && u.status === "ready") {
|
|
1220
1264
|
const k = p?.priceId;
|
|
1221
1265
|
if (!k) {
|
|
1222
|
-
n("error", new
|
|
1266
|
+
n("error", new T("no_price", "No price selected"));
|
|
1223
1267
|
return;
|
|
1224
1268
|
}
|
|
1225
|
-
if ((
|
|
1269
|
+
if ((u.data.settings.checkout_mode ?? "guest") === "preauth" && !!r.auth && !r.auth.getCachedSession()) {
|
|
1226
1270
|
g({ kind: "auth_gate", pendingCheckout: { priceId: k } });
|
|
1227
1271
|
return;
|
|
1228
1272
|
}
|
|
1229
|
-
await
|
|
1273
|
+
await b(k);
|
|
1230
1274
|
}
|
|
1231
|
-
},
|
|
1275
|
+
}, B = u.status === "ready" ? u.data.settings.brand_color : null, L = u.status === "ready" ? !!u.data.settings.is_test_mode : !1, I = u.status === "ready" ? u.data.settings.allow_close !== !1 : !0, E = {
|
|
1232
1276
|
type: "auth_panel",
|
|
1233
1277
|
heading: "Sign in to continue",
|
|
1234
1278
|
allow_signup: !0,
|
|
@@ -1236,12 +1280,12 @@ function Ze({
|
|
|
1236
1280
|
// Не скрываем при наличии сессии — auto-resume useEffect отрабатывает быстрее,
|
|
1237
1281
|
// чем хотим показывать "Signed in as ..." промежуточным экраном.
|
|
1238
1282
|
hide_when_authenticated: !1,
|
|
1239
|
-
providers:
|
|
1283
|
+
providers: u.status === "ready" ? u.data.settings.auth_providers : void 0
|
|
1240
1284
|
}, C = f.kind === "support" ? /* @__PURE__ */ o(
|
|
1241
|
-
|
|
1285
|
+
Ae,
|
|
1242
1286
|
{
|
|
1243
1287
|
client: r,
|
|
1244
|
-
authSession:
|
|
1288
|
+
authSession: x,
|
|
1245
1289
|
origin: f.origin,
|
|
1246
1290
|
onBack: () => {
|
|
1247
1291
|
f.origin === "standalone" ? t() : g({ kind: "layout" });
|
|
@@ -1249,20 +1293,20 @@ function Ze({
|
|
|
1249
1293
|
}
|
|
1250
1294
|
) : null;
|
|
1251
1295
|
return /* @__PURE__ */ o(
|
|
1252
|
-
|
|
1296
|
+
me,
|
|
1253
1297
|
{
|
|
1254
1298
|
open: e,
|
|
1255
1299
|
onClose: t,
|
|
1256
|
-
brandColor:
|
|
1257
|
-
testMode:
|
|
1300
|
+
brandColor: B,
|
|
1301
|
+
testMode: L,
|
|
1258
1302
|
allowClose: I,
|
|
1259
1303
|
inline: h,
|
|
1260
1304
|
labelledBy: "pw-title",
|
|
1261
|
-
children: s ? /* @__PURE__ */ o(
|
|
1305
|
+
children: s ? /* @__PURE__ */ o(ee, { onContinue: t }) : f.kind === "purchase_success" ? /* @__PURE__ */ o(ee, { restored: f.restored, onContinue: t }) : C || (u.status === "loading" || u.status === "idle" || f.kind === "verifying" ? /* @__PURE__ */ c("div", { class: "flex flex-col items-center justify-center gap-3 py-12", children: [
|
|
1262
1306
|
/* @__PURE__ */ o("span", { class: "inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]" }),
|
|
1263
1307
|
/* @__PURE__ */ o("span", { class: "text-xs font-medium tracking-wide text-gray-500", children: f.kind === "verifying" ? "Checking your subscription…" : "Loading…" })
|
|
1264
|
-
] }) :
|
|
1265
|
-
/* @__PURE__ */ o("div", { class: "flex h-11 w-11 items-center justify-center rounded-full bg-red-50", children: /* @__PURE__ */
|
|
1308
|
+
] }) : u.status === "error" ? /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
|
|
1309
|
+
/* @__PURE__ */ o("div", { class: "flex h-11 w-11 items-center justify-center rounded-full bg-red-50", children: /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1266
1310
|
/* @__PURE__ */ o(
|
|
1267
1311
|
"path",
|
|
1268
1312
|
{
|
|
@@ -1275,21 +1319,21 @@ function Ze({
|
|
|
1275
1319
|
/* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "8", stroke: "#dc2626", "stroke-width": "1.75" })
|
|
1276
1320
|
] }) }),
|
|
1277
1321
|
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: "Something went wrong" }),
|
|
1278
|
-
/* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children:
|
|
1322
|
+
/* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: u.error.message })
|
|
1279
1323
|
] }) : f.kind === "auth_gate" && r.auth ? /* @__PURE__ */ o(
|
|
1280
|
-
|
|
1324
|
+
_e,
|
|
1281
1325
|
{
|
|
1282
|
-
block:
|
|
1283
|
-
bootstrap:
|
|
1326
|
+
block: E,
|
|
1327
|
+
bootstrap: u.data,
|
|
1284
1328
|
auth: r.auth,
|
|
1285
|
-
authSession:
|
|
1329
|
+
authSession: x,
|
|
1286
1330
|
showBack: f.origin !== "standalone",
|
|
1287
1331
|
onBack: () => {
|
|
1288
1332
|
f.origin === "standalone" ? t() : g({ kind: "layout" });
|
|
1289
1333
|
}
|
|
1290
1334
|
}
|
|
1291
1335
|
) : f.kind === "anon_gate" && r.auth ? /* @__PURE__ */ o(
|
|
1292
|
-
|
|
1336
|
+
Se,
|
|
1293
1337
|
{
|
|
1294
1338
|
auth: r.auth,
|
|
1295
1339
|
onSuccess: () => {
|
|
@@ -1298,7 +1342,7 @@ function Ze({
|
|
|
1298
1342
|
onBack: f.origin === "standalone" ? void 0 : () => g({ kind: "layout" })
|
|
1299
1343
|
}
|
|
1300
1344
|
) : f.kind === "awaiting_payment" ? /* @__PURE__ */ o(
|
|
1301
|
-
|
|
1345
|
+
Je,
|
|
1302
1346
|
{
|
|
1303
1347
|
client: r,
|
|
1304
1348
|
onBack: () => g({ kind: "layout" }),
|
|
@@ -1311,16 +1355,16 @@ function Ze({
|
|
|
1311
1355
|
} catch {
|
|
1312
1356
|
}
|
|
1313
1357
|
},
|
|
1314
|
-
onRetry: () =>
|
|
1358
|
+
onRetry: () => b(f.priceId)
|
|
1315
1359
|
}
|
|
1316
|
-
) : f.kind === "popup_blocked" ? /* @__PURE__ */
|
|
1360
|
+
) : f.kind === "popup_blocked" ? /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
|
|
1317
1361
|
/* @__PURE__ */ o(
|
|
1318
1362
|
"div",
|
|
1319
1363
|
{
|
|
1320
1364
|
class: "flex h-11 w-11 items-center justify-center rounded-full",
|
|
1321
1365
|
style: { background: "color-mix(in srgb, var(--pw-accent) 12%, white)", color: "var(--pw-accent)" },
|
|
1322
1366
|
"aria-hidden": "true",
|
|
1323
|
-
children: /* @__PURE__ */
|
|
1367
|
+
children: /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
|
|
1324
1368
|
/* @__PURE__ */ o(
|
|
1325
1369
|
"path",
|
|
1326
1370
|
{
|
|
@@ -1350,28 +1394,28 @@ function Ze({
|
|
|
1350
1394
|
}
|
|
1351
1395
|
)
|
|
1352
1396
|
] }) : /* @__PURE__ */ o(
|
|
1353
|
-
|
|
1397
|
+
Ze,
|
|
1354
1398
|
{
|
|
1355
|
-
layout:
|
|
1356
|
-
bootstrap:
|
|
1399
|
+
layout: u.data.layout,
|
|
1400
|
+
bootstrap: u.data,
|
|
1357
1401
|
onAction: w,
|
|
1358
1402
|
auth: r.auth,
|
|
1359
|
-
authSession:
|
|
1403
|
+
authSession: x
|
|
1360
1404
|
}
|
|
1361
1405
|
))
|
|
1362
1406
|
}
|
|
1363
1407
|
);
|
|
1364
1408
|
}
|
|
1365
|
-
function
|
|
1409
|
+
function Je({
|
|
1366
1410
|
client: r,
|
|
1367
1411
|
onBack: e,
|
|
1368
1412
|
onReopen: t,
|
|
1369
1413
|
onRetry: n
|
|
1370
1414
|
}) {
|
|
1371
|
-
const [i, s] = y(!1), [l, a] = y(!1), h =
|
|
1372
|
-
return
|
|
1415
|
+
const [i, s] = y(!1), [l, a] = y(!1), h = P(null);
|
|
1416
|
+
return M(() => () => {
|
|
1373
1417
|
h.current !== null && clearTimeout(h.current);
|
|
1374
|
-
}, []), /* @__PURE__ */
|
|
1418
|
+
}, []), /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
|
|
1375
1419
|
/* @__PURE__ */ o(
|
|
1376
1420
|
"button",
|
|
1377
1421
|
{
|
|
@@ -1381,8 +1425,8 @@ function Xe({
|
|
|
1381
1425
|
children: "← Back"
|
|
1382
1426
|
}
|
|
1383
1427
|
),
|
|
1384
|
-
/* @__PURE__ */
|
|
1385
|
-
/* @__PURE__ */
|
|
1428
|
+
/* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-6 text-center", children: [
|
|
1429
|
+
/* @__PURE__ */ c("div", { class: "relative flex h-12 w-12 items-center justify-center", children: [
|
|
1386
1430
|
/* @__PURE__ */ o(
|
|
1387
1431
|
"span",
|
|
1388
1432
|
{
|
|
@@ -1428,7 +1472,7 @@ function Xe({
|
|
|
1428
1472
|
),
|
|
1429
1473
|
l ? /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: "Payment is still being processed. Please try again in a moment." }) : null
|
|
1430
1474
|
] }),
|
|
1431
|
-
/* @__PURE__ */
|
|
1475
|
+
/* @__PURE__ */ c("div", { class: "rounded-2xl border border-gray-200 bg-gray-50/60 p-3.5", children: [
|
|
1432
1476
|
/* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-600", children: "Checkout window didn't open or got blocked? Click here to open it again." }),
|
|
1433
1477
|
/* @__PURE__ */ o(
|
|
1434
1478
|
"button",
|
|
@@ -1451,11 +1495,11 @@ function Xe({
|
|
|
1451
1495
|
)
|
|
1452
1496
|
] });
|
|
1453
1497
|
}
|
|
1454
|
-
function
|
|
1498
|
+
function ee({
|
|
1455
1499
|
onContinue: r,
|
|
1456
1500
|
restored: e = !1
|
|
1457
1501
|
}) {
|
|
1458
|
-
return /* @__PURE__ */
|
|
1502
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
|
|
1459
1503
|
/* @__PURE__ */ o(
|
|
1460
1504
|
"div",
|
|
1461
1505
|
{
|
|
@@ -1496,17 +1540,17 @@ function te({
|
|
|
1496
1540
|
)
|
|
1497
1541
|
] });
|
|
1498
1542
|
}
|
|
1499
|
-
const
|
|
1500
|
-
class
|
|
1543
|
+
const Qe = 10 * 6e4, et = 5e3, tt = 3e4;
|
|
1544
|
+
class rt {
|
|
1501
1545
|
constructor(e) {
|
|
1502
1546
|
this.timer = null, this.timeoutTimer = null, this.visibilityHandler = null, this.focusHandler = null, this.messageHandler = null, this.stopped = !1, this.checking = !1, this.opts = {
|
|
1503
1547
|
client: e.client,
|
|
1504
1548
|
onActive: e.onActive,
|
|
1505
1549
|
onTimeout: e.onTimeout ?? (() => {
|
|
1506
1550
|
}),
|
|
1507
|
-
timeoutMs: e.timeoutMs ??
|
|
1508
|
-
visibleIntervalMs: e.visibleIntervalMs ??
|
|
1509
|
-
hiddenIntervalMs: e.hiddenIntervalMs ??
|
|
1551
|
+
timeoutMs: e.timeoutMs ?? Qe,
|
|
1552
|
+
visibleIntervalMs: e.visibleIntervalMs ?? et,
|
|
1553
|
+
hiddenIntervalMs: e.hiddenIntervalMs ?? tt
|
|
1510
1554
|
};
|
|
1511
1555
|
}
|
|
1512
1556
|
start() {
|
|
@@ -1545,22 +1589,22 @@ class Qe {
|
|
|
1545
1589
|
!t || typeof t != "object" || t.type === "paywall_purchase" && this.check();
|
|
1546
1590
|
}
|
|
1547
1591
|
}
|
|
1548
|
-
function
|
|
1592
|
+
function nt() {
|
|
1549
1593
|
return !(typeof document > "u" || typeof window > "u" || typeof location < "u" && location.protocol === "chrome-extension:");
|
|
1550
1594
|
}
|
|
1551
|
-
const
|
|
1595
|
+
const $ = { open: !1, view: null, error: null }, U = {
|
|
1552
1596
|
status: "paywall_status",
|
|
1553
1597
|
priceId: "paywall_price_id",
|
|
1554
1598
|
sessionId: "paywall_session_id"
|
|
1555
1599
|
};
|
|
1556
|
-
let
|
|
1600
|
+
let it = class {
|
|
1557
1601
|
constructor(e) {
|
|
1558
|
-
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 =
|
|
1559
|
-
const { auth: t, ownsAuth: n } =
|
|
1560
|
-
this.auth = t, this.ownsAuth = n, this.billing = e.client ?? new
|
|
1602
|
+
this.handle = null, this.isOpen = !1, this.listeners = /* @__PURE__ */ new Map(), this.userUnsub = null, this.authUnsub = null, this.watcher = null, this.tracker = null, this.purchased = !1, this.trialStore = null, this.trialStoreConfig = null, this.lastTrialStatus = null, this.trialExpiredFired = !1, this.lastVisibility = null, this.currentState = $, this.stateListeners = /* @__PURE__ */ new Set();
|
|
1603
|
+
const { auth: t, ownsAuth: n } = ot(e);
|
|
1604
|
+
this.auth = t, this.ownsAuth = n, this.billing = e.client ?? new le({ ...e, auth: this.auth }), this.host = e.host, this.shadowMode = e.shadowMode ?? "closed", this.mountThenLoad = e.mountThenLoad ?? !0, this.inline = e.inline === !0, this.userUnsub = this.billing.onUserChange((i) => {
|
|
1561
1605
|
this.emit("userChange", i);
|
|
1562
|
-
}), this.auth && (this.authUnsub = this.auth.onAuthChange((i) => {
|
|
1563
|
-
this.emit("authChange", i);
|
|
1606
|
+
}), this.auth && (this.authUnsub = this.auth.onAuthChange((i, s) => {
|
|
1607
|
+
this.emit("authChange", { event: i, session: s });
|
|
1564
1608
|
})), this.initTracker(e.analytics), e.autoDetectReturn !== !1 && typeof window < "u" && queueMicrotask(() => this.checkReturn());
|
|
1565
1609
|
}
|
|
1566
1610
|
initTracker(e) {
|
|
@@ -1568,7 +1612,7 @@ let tt = class {
|
|
|
1568
1612
|
const t = typeof e == "object" && e !== null ? e : {};
|
|
1569
1613
|
if (t.enabled === !1) return;
|
|
1570
1614
|
const n = t.endpoint ?? `${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;
|
|
1571
|
-
this.tracker = new
|
|
1615
|
+
this.tracker = new ae({
|
|
1572
1616
|
endpoint: n,
|
|
1573
1617
|
paywallId: this.billing.paywallId,
|
|
1574
1618
|
capabilities: this.billing.capabilities,
|
|
@@ -1834,11 +1878,11 @@ let tt = class {
|
|
|
1834
1878
|
});
|
|
1835
1879
|
}
|
|
1836
1880
|
ensureTrialStore(e) {
|
|
1837
|
-
if (this.trialStore && this.trialStoreConfig &&
|
|
1881
|
+
if (this.trialStore && this.trialStoreConfig && at(this.trialStoreConfig, e))
|
|
1838
1882
|
return this.trialStore;
|
|
1839
1883
|
this.trialStoreConfig = e;
|
|
1840
1884
|
const t = this.billing.createTrialStore;
|
|
1841
|
-
return this.trialStore = typeof t == "function" ? t.call(this.billing, e) :
|
|
1885
|
+
return this.trialStore = typeof t == "function" ? t.call(this.billing, e) : ce(this.billing.getStorage(), this.billing.paywallId, e), this.trialStore;
|
|
1842
1886
|
}
|
|
1843
1887
|
mountAndShow(e, t = {}) {
|
|
1844
1888
|
const n = t.renew === !0;
|
|
@@ -1846,8 +1890,8 @@ let tt = class {
|
|
|
1846
1890
|
this.isOpen = !0, this.handle.update({ open: !0, initialView: e, purchased: !1, renew: n }), this.emit("open");
|
|
1847
1891
|
return;
|
|
1848
1892
|
}
|
|
1849
|
-
this.isOpen = !0, this.handle =
|
|
1850
|
-
|
|
1893
|
+
this.isOpen = !0, this.handle = ge(
|
|
1894
|
+
Ke,
|
|
1851
1895
|
{
|
|
1852
1896
|
client: this.billing,
|
|
1853
1897
|
open: !0,
|
|
@@ -1865,7 +1909,7 @@ let tt = class {
|
|
|
1865
1909
|
), this.emit("open");
|
|
1866
1910
|
}
|
|
1867
1911
|
applyState(e) {
|
|
1868
|
-
if (!
|
|
1912
|
+
if (!lt(this.currentState, e)) {
|
|
1869
1913
|
this.currentState = e;
|
|
1870
1914
|
for (const t of this.stateListeners)
|
|
1871
1915
|
try {
|
|
@@ -2031,7 +2075,7 @@ let tt = class {
|
|
|
2031
2075
|
// В extension popup runtime — no-op (popup не доживёт). Там полагаемся на
|
|
2032
2076
|
// bootstrap при следующем открытии.
|
|
2033
2077
|
startUserWatcher() {
|
|
2034
|
-
this.watcher ||
|
|
2078
|
+
this.watcher || nt() && (this.watcher = new rt({
|
|
2035
2079
|
client: this.billing,
|
|
2036
2080
|
onActive: (e) => {
|
|
2037
2081
|
this.watcher = null, this.emit("purchase_completed", { priceId: null, sessionId: null });
|
|
@@ -2050,7 +2094,7 @@ let tt = class {
|
|
|
2050
2094
|
}), this.watcher.start());
|
|
2051
2095
|
}
|
|
2052
2096
|
close() {
|
|
2053
|
-
!this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(
|
|
2097
|
+
!this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState($), this.emit("close"));
|
|
2054
2098
|
}
|
|
2055
2099
|
/**
|
|
2056
2100
|
* Сканирует текущий URL на маркеры возврата с checkout и эмитит
|
|
@@ -2060,23 +2104,23 @@ let tt = class {
|
|
|
2060
2104
|
*/
|
|
2061
2105
|
checkReturn() {
|
|
2062
2106
|
if (typeof window > "u") return;
|
|
2063
|
-
const e = new URL(window.location.href), t =
|
|
2107
|
+
const e = new URL(window.location.href), t = te(e.hash.replace(/^#/, "")), n = te(e.search.replace(/^\?/, "")), i = t ?? n;
|
|
2064
2108
|
i && (i.status === "paid" ? (this.emit("purchase_completed", {
|
|
2065
2109
|
priceId: i.priceId,
|
|
2066
2110
|
sessionId: i.sessionId
|
|
2067
|
-
}),
|
|
2111
|
+
}), ct(i)) : (i.status === "failed" || i.status === "cancelled") && this.emit("purchase_failed", { reason: i.status }), ut(e));
|
|
2068
2112
|
}
|
|
2069
2113
|
destroy() {
|
|
2070
|
-
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 =
|
|
2114
|
+
this.tracker?.destroy(), this.tracker = null, this.listeners.clear(), this.stateListeners.clear(), this.watcher?.stop(), this.watcher = null, this.userUnsub?.(), this.userUnsub = null, this.authUnsub?.(), this.authUnsub = null, this.ownsAuth && this.auth && this.auth.destroy?.(), this.ownsAuth = !1, this.billing.destroy?.(), this.handle?.unmount(), this.handle = null, this.isOpen = !1, this.currentState = $;
|
|
2071
2115
|
}
|
|
2072
2116
|
};
|
|
2073
|
-
function
|
|
2117
|
+
function ot(r) {
|
|
2074
2118
|
if (!r.auth) return { auth: void 0, ownsAuth: !1 };
|
|
2075
|
-
if (r.auth instanceof
|
|
2119
|
+
if (r.auth instanceof G || st(r.auth))
|
|
2076
2120
|
return { auth: r.auth, ownsAuth: !1 };
|
|
2077
2121
|
const e = r.auth === !0 ? {} : r.auth;
|
|
2078
2122
|
return {
|
|
2079
|
-
auth: new
|
|
2123
|
+
auth: new G({
|
|
2080
2124
|
paywallId: r.paywallId,
|
|
2081
2125
|
apiOrigin: e.apiOrigin ?? r.apiOrigin,
|
|
2082
2126
|
storage: e.storage ?? r.storage,
|
|
@@ -2086,18 +2130,18 @@ function rt(r) {
|
|
|
2086
2130
|
ownsAuth: !0
|
|
2087
2131
|
};
|
|
2088
2132
|
}
|
|
2089
|
-
function
|
|
2133
|
+
function st(r) {
|
|
2090
2134
|
if (typeof r != "object" || r === null) return !1;
|
|
2091
2135
|
const e = r;
|
|
2092
2136
|
return typeof e.onAuthChange == "function" && typeof e.getCachedSession == "function" && typeof e.signOut == "function";
|
|
2093
2137
|
}
|
|
2094
|
-
function
|
|
2138
|
+
function lt(r, e) {
|
|
2095
2139
|
return r.open === e.open && r.view === e.view && r.error === e.error;
|
|
2096
2140
|
}
|
|
2097
|
-
function
|
|
2141
|
+
function at(r, e) {
|
|
2098
2142
|
return r.mode === e.mode && r.payload === e.payload && r.storage === e.storage;
|
|
2099
2143
|
}
|
|
2100
|
-
function
|
|
2144
|
+
function te(r) {
|
|
2101
2145
|
if (!r) return null;
|
|
2102
2146
|
const e = new URLSearchParams(r), t = e.get(U.status);
|
|
2103
2147
|
return t ? {
|
|
@@ -2106,7 +2150,7 @@ function re(r) {
|
|
|
2106
2150
|
sessionId: e.get(U.sessionId)
|
|
2107
2151
|
} : null;
|
|
2108
2152
|
}
|
|
2109
|
-
function
|
|
2153
|
+
function ct(r) {
|
|
2110
2154
|
if (!(typeof window > "u" || !window.opener))
|
|
2111
2155
|
try {
|
|
2112
2156
|
window.opener.postMessage(
|
|
@@ -2121,7 +2165,7 @@ function st(r) {
|
|
|
2121
2165
|
} catch {
|
|
2122
2166
|
}
|
|
2123
2167
|
}
|
|
2124
|
-
function
|
|
2168
|
+
function ut(r) {
|
|
2125
2169
|
const e = (n, i) => {
|
|
2126
2170
|
if (!n) return "";
|
|
2127
2171
|
const s = new URLSearchParams(n.replace(/^[?#]/, ""));
|
|
@@ -2131,7 +2175,7 @@ function lt(r) {
|
|
|
2131
2175
|
}, t = r.pathname + e(r.search, "?") + e(r.hash, "#");
|
|
2132
2176
|
window.history.replaceState(null, "", t);
|
|
2133
2177
|
}
|
|
2134
|
-
class
|
|
2178
|
+
class ht {
|
|
2135
2179
|
constructor(e, t, n) {
|
|
2136
2180
|
this.transport = e, this.paywallId = t, this.config = n;
|
|
2137
2181
|
}
|
|
@@ -2154,7 +2198,7 @@ class at {
|
|
|
2154
2198
|
});
|
|
2155
2199
|
}
|
|
2156
2200
|
}
|
|
2157
|
-
class
|
|
2201
|
+
class dt {
|
|
2158
2202
|
constructor(e, t) {
|
|
2159
2203
|
this.transport = e, this.cachedBootstrap = null, this.cachedUser = null, this.cachedBalances = null, this.identity = null, this.userListeners = /* @__PURE__ */ new Set(), this.balanceListeners = /* @__PURE__ */ new Set(), this.unsubUserBroadcast = null, this.unsubBalancesBroadcast = null, this.paywallId = t.paywallId, this.apiOrigin = t.apiOrigin, this.remoteStorageAdapter = {
|
|
2160
2204
|
getItem: (n) => this.transport.request("storage.get", { key: n }),
|
|
@@ -2300,7 +2344,7 @@ class ct {
|
|
|
2300
2344
|
* read-modify-write. PaywallUI duck-types этот метод и предпочитает его
|
|
2301
2345
|
* локальной фабрике, если он есть. */
|
|
2302
2346
|
createTrialStore(e) {
|
|
2303
|
-
return new
|
|
2347
|
+
return new ht(this.transport, this.paywallId, e);
|
|
2304
2348
|
}
|
|
2305
2349
|
// === Identity ===
|
|
2306
2350
|
getIdentity() {
|
|
@@ -2324,10 +2368,10 @@ class ct {
|
|
|
2324
2368
|
* broadcast'ов от offscreen — чтобы host'овский onUserChange handler
|
|
2325
2369
|
* получил signal независимо от того, кто триггернул обновление. */
|
|
2326
2370
|
applyUser(e) {
|
|
2327
|
-
|
|
2371
|
+
pt(this.cachedUser, e) || (this.cachedUser = e, this.fireUserListeners(e));
|
|
2328
2372
|
}
|
|
2329
2373
|
applyBalances(e) {
|
|
2330
|
-
|
|
2374
|
+
ft(this.cachedBalances, e) || (this.cachedBalances = e, this.fireBalanceListeners(e));
|
|
2331
2375
|
}
|
|
2332
2376
|
fireUserListeners(e) {
|
|
2333
2377
|
for (const t of [...this.userListeners])
|
|
@@ -2346,22 +2390,22 @@ class ct {
|
|
|
2346
2390
|
}
|
|
2347
2391
|
}
|
|
2348
2392
|
}
|
|
2349
|
-
function
|
|
2393
|
+
function pt(r, e) {
|
|
2350
2394
|
return r === e ? !0 : !r || !e ? !1 : r.has_active_subscription === e.has_active_subscription && (r.purchases?.length ?? 0) === (e.purchases?.length ?? 0);
|
|
2351
2395
|
}
|
|
2352
|
-
function
|
|
2396
|
+
function ft(r, e) {
|
|
2353
2397
|
if (r === e) return !0;
|
|
2354
2398
|
if (!r || !e || r.length !== e.length) return !1;
|
|
2355
2399
|
for (let t = 0; t < r.length; t++)
|
|
2356
2400
|
if (r[t].type !== e[t].type || r[t].count !== e[t].count) return !1;
|
|
2357
2401
|
return !0;
|
|
2358
2402
|
}
|
|
2359
|
-
class
|
|
2403
|
+
class gt {
|
|
2360
2404
|
constructor(e, t) {
|
|
2361
|
-
this.transport = e, this.session = null, this.listeners = /* @__PURE__ */ new Set(), this.unsubBroadcast = null, this.paywallId = t.paywallId, this.apiOrigin = t.apiOrigin, this.unsubBroadcast = this.transport.on("authChange", (n) => {
|
|
2362
|
-
this.applySession(n);
|
|
2405
|
+
this.transport = e, this.session = null, this.listeners = /* @__PURE__ */ new Set(), this.unsubBroadcast = null, this.paywallId = t.paywallId, this.apiOrigin = t.apiOrigin, this.unsubBroadcast = this.transport.on("authChange", ({ event: n, session: i }) => {
|
|
2406
|
+
this.applySession(n, i);
|
|
2363
2407
|
}), this.hydrated = this.transport.request("auth.getCachedSession", void 0).then((n) => {
|
|
2364
|
-
this.session === null && n !== null && this.
|
|
2408
|
+
this.session === null && n !== null && (this.session = n);
|
|
2365
2409
|
}).catch(() => {
|
|
2366
2410
|
});
|
|
2367
2411
|
}
|
|
@@ -2377,31 +2421,32 @@ class dt {
|
|
|
2377
2421
|
return this.session?.user ?? null;
|
|
2378
2422
|
}
|
|
2379
2423
|
onAuthChange(e) {
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2424
|
+
return this.listeners.add(e), this.hydrated.then(() => {
|
|
2425
|
+
if (this.listeners.has(e))
|
|
2426
|
+
try {
|
|
2427
|
+
e("INITIAL_SESSION", this.session);
|
|
2428
|
+
} catch (t) {
|
|
2429
|
+
console.warn("[paywall] onAuthChange INITIAL_SESSION threw", t);
|
|
2430
|
+
}
|
|
2431
|
+
}), () => {
|
|
2387
2432
|
this.listeners.delete(e);
|
|
2388
2433
|
};
|
|
2389
2434
|
}
|
|
2390
2435
|
// === Email/password ===
|
|
2391
2436
|
async signInWithEmail(e) {
|
|
2392
2437
|
const t = await this.transport.request("auth.signInWithEmail", e);
|
|
2393
|
-
return this.applySession(t), t;
|
|
2438
|
+
return this.applySession("SIGNED_IN", t), t;
|
|
2394
2439
|
}
|
|
2395
2440
|
async signUp(e) {
|
|
2396
2441
|
const t = await this.transport.request("auth.signUp", e);
|
|
2397
|
-
return t.kind === "signed_in" && this.applySession(t.session), t;
|
|
2442
|
+
return t.kind === "signed_in" && this.applySession("SIGNED_IN", t.session), t;
|
|
2398
2443
|
}
|
|
2399
2444
|
async signOut() {
|
|
2400
2445
|
await this.transport.request("auth.signOut", void 0);
|
|
2401
2446
|
}
|
|
2402
2447
|
async refresh() {
|
|
2403
2448
|
const e = await this.transport.request("auth.refresh", void 0);
|
|
2404
|
-
return this.applySession(e), e;
|
|
2449
|
+
return this.applySession(e ? "TOKEN_REFRESHED" : "SIGNED_OUT", e), e;
|
|
2405
2450
|
}
|
|
2406
2451
|
// === OTP / password reset / confirmation ===
|
|
2407
2452
|
async sendOtp(e) {
|
|
@@ -2409,7 +2454,7 @@ class dt {
|
|
|
2409
2454
|
}
|
|
2410
2455
|
async verifyOtp(e) {
|
|
2411
2456
|
const t = await this.transport.request("auth.verifyOtp", e);
|
|
2412
|
-
return this.applySession(t), t;
|
|
2457
|
+
return this.applySession(e.type === "recovery" ? "PASSWORD_RECOVERY" : "SIGNED_IN", t), t;
|
|
2413
2458
|
}
|
|
2414
2459
|
async resendConfirmation(e) {
|
|
2415
2460
|
await this.transport.request("auth.resendConfirmation", e);
|
|
@@ -2434,7 +2479,7 @@ class dt {
|
|
|
2434
2479
|
userMeta: e.userMeta,
|
|
2435
2480
|
forceCaptcha: e.forceCaptcha
|
|
2436
2481
|
});
|
|
2437
|
-
return this.applySession(t), t;
|
|
2482
|
+
return this.applySession("SIGNED_IN", t), t;
|
|
2438
2483
|
}
|
|
2439
2484
|
/** Текущий access token (lazy-refreshable в offscreen'е). content/popup
|
|
2440
2485
|
* использует для Bearer'а в внешние fetch'и — ApiGatewayClient в
|
|
@@ -2460,14 +2505,14 @@ class dt {
|
|
|
2460
2505
|
*/
|
|
2461
2506
|
async signInWithOAuth(e) {
|
|
2462
2507
|
if (typeof window > "u")
|
|
2463
|
-
throw new
|
|
2508
|
+
throw new T("oauth_unavailable", "window is required for OAuth");
|
|
2464
2509
|
const t = `pw-oauth-pending-${Math.random().toString(36).slice(2, 10)}`, n = window.open("about:blank", t, "width=480,height=640,popup=yes");
|
|
2465
2510
|
if (!n)
|
|
2466
|
-
throw new
|
|
2511
|
+
throw new T(
|
|
2467
2512
|
"popup_blocked",
|
|
2468
2513
|
"browser blocked auth popup — call from a user gesture"
|
|
2469
2514
|
);
|
|
2470
|
-
|
|
2515
|
+
xt(n, e.provider);
|
|
2471
2516
|
try {
|
|
2472
2517
|
const { authorizeUrl: i, state: s } = await this.transport.request("auth.oauthStart", {
|
|
2473
2518
|
provider: e.provider,
|
|
@@ -2475,8 +2520,8 @@ class dt {
|
|
|
2475
2520
|
userMeta: e.userMeta
|
|
2476
2521
|
});
|
|
2477
2522
|
n.name = `pw-oauth-${s}`, n.location.replace(i), e.onPopupOpened?.();
|
|
2478
|
-
const l = await
|
|
2479
|
-
return this.applySession(a), a;
|
|
2523
|
+
const l = await ue(n, s), a = await this.transport.request("auth.oauthExchange", { state: s, code: l });
|
|
2524
|
+
return this.applySession("SIGNED_IN", a), a;
|
|
2480
2525
|
} catch (i) {
|
|
2481
2526
|
try {
|
|
2482
2527
|
n.close();
|
|
@@ -2488,29 +2533,29 @@ class dt {
|
|
|
2488
2533
|
destroy() {
|
|
2489
2534
|
this.unsubBroadcast?.(), this.unsubBroadcast = null, this.listeners.clear(), this.session = null;
|
|
2490
2535
|
}
|
|
2491
|
-
applySession(e) {
|
|
2492
|
-
if (!
|
|
2493
|
-
this.session =
|
|
2494
|
-
for (const
|
|
2536
|
+
applySession(e, t) {
|
|
2537
|
+
if (!mt(this.session, t)) {
|
|
2538
|
+
this.session = t;
|
|
2539
|
+
for (const n of [...this.listeners])
|
|
2495
2540
|
try {
|
|
2496
|
-
|
|
2497
|
-
} catch (
|
|
2498
|
-
console.warn("[paywall] onAuthChange listener threw",
|
|
2541
|
+
n(e, t);
|
|
2542
|
+
} catch (i) {
|
|
2543
|
+
console.warn("[paywall] onAuthChange listener threw", i);
|
|
2499
2544
|
}
|
|
2500
2545
|
}
|
|
2501
2546
|
}
|
|
2502
2547
|
}
|
|
2503
|
-
function
|
|
2548
|
+
function mt(r, e) {
|
|
2504
2549
|
return r === e ? !0 : !r || !e ? !1 : r.access_token === e.access_token && r.refresh_token === e.refresh_token && r.expires_at === e.expires_at && r.user.id === e.user.id;
|
|
2505
2550
|
}
|
|
2506
|
-
const
|
|
2551
|
+
const yt = {
|
|
2507
2552
|
google: "Google",
|
|
2508
2553
|
apple: "Apple",
|
|
2509
2554
|
github: "GitHub",
|
|
2510
2555
|
facebook: "Facebook"
|
|
2511
2556
|
};
|
|
2512
|
-
function
|
|
2513
|
-
const t =
|
|
2557
|
+
function xt(r, e) {
|
|
2558
|
+
const t = yt[e] ?? e;
|
|
2514
2559
|
try {
|
|
2515
2560
|
const n = r.document;
|
|
2516
2561
|
n.title = `Sign in with ${t}`;
|
|
@@ -2525,7 +2570,7 @@ function gt(r, e) {
|
|
|
2525
2570
|
} catch {
|
|
2526
2571
|
}
|
|
2527
2572
|
}
|
|
2528
|
-
class
|
|
2573
|
+
class bt {
|
|
2529
2574
|
constructor(e) {
|
|
2530
2575
|
this.transport = e;
|
|
2531
2576
|
}
|
|
@@ -2537,7 +2582,7 @@ class mt {
|
|
|
2537
2582
|
});
|
|
2538
2583
|
}
|
|
2539
2584
|
}
|
|
2540
|
-
class
|
|
2585
|
+
class kt {
|
|
2541
2586
|
constructor(e) {
|
|
2542
2587
|
this.factory = e, this.channel = null, this.channelDisposers = [], this.pending = /* @__PURE__ */ new Map(), this.listeners = /* @__PURE__ */ new Map(), this.destroyed = !1, this.nextId = 0, this.clientId = `c-${Math.random().toString(36).slice(2, 10)}`;
|
|
2543
2588
|
}
|
|
@@ -2551,21 +2596,21 @@ class yt {
|
|
|
2551
2596
|
this.channel = e;
|
|
2552
2597
|
const t = e.onMessage((i) => this.handleMessage(i)), n = e.onDisconnect(() => this.handleDisconnect());
|
|
2553
2598
|
return this.channelDisposers = [t, n], this.request("handshake", {
|
|
2554
|
-
protocolVersion:
|
|
2599
|
+
protocolVersion: N,
|
|
2555
2600
|
clientId: this.clientId
|
|
2556
2601
|
}).then((i) => {
|
|
2557
|
-
i.protocolVersion !==
|
|
2558
|
-
`[sdk-extension] protocol version mismatch: client=${
|
|
2602
|
+
i.protocolVersion !== N && console.warn(
|
|
2603
|
+
`[sdk-extension] protocol version mismatch: client=${N}, offscreen=${i.protocolVersion}. Update host's @monetize.software/sdk-extension.`
|
|
2559
2604
|
);
|
|
2560
2605
|
}).catch(() => {
|
|
2561
2606
|
}), e;
|
|
2562
2607
|
}
|
|
2563
2608
|
handleMessage(e) {
|
|
2564
|
-
if (
|
|
2609
|
+
if (vt(e)) {
|
|
2565
2610
|
if (e.type === "response") {
|
|
2566
2611
|
const t = this.pending.get(e.id);
|
|
2567
2612
|
if (!t) return;
|
|
2568
|
-
this.pending.delete(e.id), t.signal?.removeEventListener("abort", t.abortListener), e.ok ? t.resolve(e.result) : t.reject(
|
|
2613
|
+
this.pending.delete(e.id), t.signal?.removeEventListener("abort", t.abortListener), e.ok ? t.resolve(e.result) : t.reject(he(e.error));
|
|
2569
2614
|
return;
|
|
2570
2615
|
}
|
|
2571
2616
|
if (e.type === "event") {
|
|
@@ -2586,7 +2631,7 @@ class yt {
|
|
|
2586
2631
|
const e = Array.from(this.pending.values());
|
|
2587
2632
|
this.pending.clear();
|
|
2588
2633
|
for (const t of e)
|
|
2589
|
-
t.signal?.removeEventListener("abort", t.abortListener), t.reject(new
|
|
2634
|
+
t.signal?.removeEventListener("abort", t.abortListener), t.reject(new wt());
|
|
2590
2635
|
}
|
|
2591
2636
|
request(e, t, n = {}) {
|
|
2592
2637
|
if (this.destroyed)
|
|
@@ -2609,14 +2654,14 @@ class yt {
|
|
|
2609
2654
|
}
|
|
2610
2655
|
}
|
|
2611
2656
|
}, n.signal.addEventListener("abort", h.abortListener)), this.pending.set(s, h);
|
|
2612
|
-
const
|
|
2657
|
+
const u = {
|
|
2613
2658
|
type: "request",
|
|
2614
2659
|
id: s,
|
|
2615
2660
|
kind: e,
|
|
2616
2661
|
params: t
|
|
2617
2662
|
};
|
|
2618
2663
|
try {
|
|
2619
|
-
i.send(
|
|
2664
|
+
i.send(u);
|
|
2620
2665
|
} catch (m) {
|
|
2621
2666
|
this.pending.delete(s), n.signal?.removeEventListener("abort", h.abortListener), a(m);
|
|
2622
2667
|
}
|
|
@@ -2642,28 +2687,28 @@ class yt {
|
|
|
2642
2687
|
this.channel?.close(), this.channel = null;
|
|
2643
2688
|
}
|
|
2644
2689
|
}
|
|
2645
|
-
class
|
|
2690
|
+
class wt extends Error {
|
|
2646
2691
|
constructor() {
|
|
2647
2692
|
super("Transport channel disconnected mid-request"), this.code = "transport_disconnected", this.name = "TransportDisconnectedError";
|
|
2648
2693
|
}
|
|
2649
2694
|
}
|
|
2650
|
-
function
|
|
2695
|
+
function vt(r) {
|
|
2651
2696
|
if (typeof r != "object" || r === null) return !1;
|
|
2652
2697
|
const e = r.type;
|
|
2653
2698
|
return e === "request" || e === "response" || e === "event";
|
|
2654
2699
|
}
|
|
2655
|
-
let
|
|
2656
|
-
function
|
|
2657
|
-
return
|
|
2700
|
+
let R = null;
|
|
2701
|
+
function _t() {
|
|
2702
|
+
return R || (R = new kt(() => de(pe)), R);
|
|
2658
2703
|
}
|
|
2659
|
-
class
|
|
2704
|
+
class Lt extends it {
|
|
2660
2705
|
constructor(e) {
|
|
2661
|
-
const t =
|
|
2706
|
+
const t = _t(), n = new dt(t, {
|
|
2662
2707
|
paywallId: e.paywallId,
|
|
2663
2708
|
apiOrigin: e.apiOrigin
|
|
2664
2709
|
});
|
|
2665
2710
|
let i;
|
|
2666
|
-
e.auth === !0 ? i = new
|
|
2711
|
+
e.auth === !0 ? i = new gt(t, {
|
|
2667
2712
|
paywallId: e.paywallId,
|
|
2668
2713
|
apiOrigin: e.apiOrigin
|
|
2669
2714
|
}) : e.auth && console.warn(
|
|
@@ -2679,7 +2724,7 @@ class Mt extends tt {
|
|
|
2679
2724
|
// Внутренний EventTracker отключаем — единственный tracker живёт в
|
|
2680
2725
|
// offscreen'е. Манчиально подписываемся ниже.
|
|
2681
2726
|
analytics: !1
|
|
2682
|
-
}), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new
|
|
2727
|
+
}), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new bt(t), this.bindAnalytics());
|
|
2683
2728
|
}
|
|
2684
2729
|
/** Зеркало sdk/PaywallUI.initTracker'овских биндингов, но с RemoteEventTracker.
|
|
2685
2730
|
* Когда @monetize.software/sdk экспоузнет публичный hook для inject'а tracker'а,
|
|
@@ -2737,11 +2782,11 @@ class Mt extends tt {
|
|
|
2737
2782
|
}
|
|
2738
2783
|
}
|
|
2739
2784
|
export {
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2785
|
+
N as PROTOCOL_VERSION,
|
|
2786
|
+
Lt as PaywallUI,
|
|
2787
|
+
gt as RemoteAuthClient,
|
|
2788
|
+
dt as RemoteBillingClient,
|
|
2789
|
+
bt as RemoteEventTracker,
|
|
2790
|
+
_t as getContentTransport
|
|
2746
2791
|
};
|
|
2747
2792
|
//# sourceMappingURL=content.js.map
|