@hook-sdk/template 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -55,7 +55,7 @@ __export(index_exports, {
55
55
  module.exports = __toCommonJS(index_exports);
56
56
 
57
57
  // src/AppRoot.tsx
58
- var import_react16 = require("react");
58
+ var import_react15 = require("react");
59
59
  var import_sdk9 = require("@hook-sdk/sdk");
60
60
 
61
61
  // src/internal/TemplateConfigContext.tsx
@@ -221,7 +221,7 @@ function PushPrompt() {
221
221
  }
222
222
 
223
223
  // src/components/InstallGate/InstallGate.tsx
224
- var import_react8 = require("react");
224
+ var import_react7 = require("react");
225
225
 
226
226
  // src/hooks/useInstallPrompt.ts
227
227
  var import_react5 = require("react");
@@ -458,9 +458,6 @@ function useInstallPrompt(slug) {
458
458
  setIsDismissedPermanent(true);
459
459
  track("pwa_install_permanent_dismiss", { slug, platform, prior_skip_count: skipCount });
460
460
  }, [slug, platform, skipCount]);
461
- const showIOSOtherHelp = (0, import_react5.useCallback)(() => {
462
- track("pwa_install_ios_other_help_shown", { slug });
463
- }, [slug]);
464
461
  const copyLink = (0, import_react5.useCallback)(async () => {
465
462
  if (typeof navigator === "undefined" || typeof location === "undefined") return;
466
463
  try {
@@ -499,7 +496,6 @@ function useInstallPrompt(slug) {
499
496
  promptInstall,
500
497
  dismissSession,
501
498
  dismissPermanent,
502
- showIOSOtherHelp,
503
499
  copyLink,
504
500
  reset
505
501
  };
@@ -559,23 +555,22 @@ var INSTALL_COPY = {
559
555
  skipPermanent: "N\xE3o me pergunte mais"
560
556
  },
561
557
  iosOther: {
562
- title: "Abra no Safari pra instalar",
563
- subtitle: "No Chrome/Firefox/Edge do iPhone n\xE3o d\xE1 pra instalar PWA. Abra o link no Safari.",
564
- ctaPrimary: "Abrir no Safari",
565
- ctaSecondary: "Copiar link",
566
- copiedToast: "Link copiado. Cole no Safari.",
567
- skip: "Continuar mesmo assim",
568
- skipPermanent: "N\xE3o me pergunte mais",
569
- help: {
570
- step1: {
571
- title: "Toque em \u22EF ou no bot\xE3o compartilhar",
572
- subtitle: "Na barra inferior ou superior do navegador"
573
- },
574
- step2: {
575
- title: 'Escolha "Abrir no Safari"',
576
- subtitle: "O app vai abrir direto no Safari"
577
- }
578
- }
558
+ title: "Adicione \xE0 sua Tela de In\xEDcio",
559
+ subtitle: "Siga os 3 passos",
560
+ step1: {
561
+ title: "Toque em Compartilhar",
562
+ subtitle: "Geralmente no topo ou no menu do navegador"
563
+ },
564
+ step2: {
565
+ title: 'Role e toque em "Adicionar \xE0 Tela de In\xEDcio"',
566
+ iconLabel: "Adicionar \xE0 Tela de In\xEDcio"
567
+ },
568
+ step3: {
569
+ title: 'Toque em "Adicionar" pra confirmar',
570
+ buttonLabel: "Adicionar"
571
+ },
572
+ skip: "Continuar no navegador",
573
+ skipPermanent: "N\xE3o me pergunte mais"
579
574
  },
580
575
  inApp: {
581
576
  instagram: {
@@ -710,18 +705,6 @@ var primaryButtonStyle = {
710
705
  cursor: "pointer",
711
706
  marginBottom: 12
712
707
  };
713
- var secondaryButtonStyle = {
714
- width: "100%",
715
- padding: "12px 20px",
716
- background: "transparent",
717
- color: "var(--hook-color-primary)",
718
- border: "1px solid var(--hook-color-primary)",
719
- borderRadius: 999,
720
- fontSize: 15,
721
- fontWeight: 500,
722
- cursor: "pointer",
723
- marginBottom: 12
724
- };
725
708
  var skipLinkStyle = {
726
709
  display: "block",
727
710
  width: "100%",
@@ -1128,7 +1111,6 @@ function IOSafariVariant({
1128
1111
  }
1129
1112
 
1130
1113
  // src/components/InstallGate/variants/IOSOtherVariant.tsx
1131
- var import_react6 = require("react");
1132
1114
  var import_jsx_runtime13 = require("react/jsx-runtime");
1133
1115
  function IOSOtherVariant({
1134
1116
  state,
@@ -1136,101 +1118,84 @@ function IOSOtherVariant({
1136
1118
  }) {
1137
1119
  const copy = INSTALL_COPY.iosOther;
1138
1120
  const showPermanent = shouldShowPermanentOption(state);
1139
- const [copied, setCopied] = (0, import_react6.useState)(false);
1140
- const [helpOpen, setHelpOpen] = (0, import_react6.useState)(false);
1141
- const handleCopy = async () => {
1142
- await actions.copyLink();
1143
- setCopied(true);
1144
- setTimeout(() => setCopied(false), 2e3);
1145
- };
1146
- const handleShowHelp = () => {
1147
- if (!helpOpen) actions.showIOSOtherHelp();
1148
- setHelpOpen(true);
1149
- };
1150
1121
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(InstallSplash, { title: copy.title, subtitle: copy.subtitle, children: [
1151
1122
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1152
- "button",
1123
+ Step2,
1153
1124
  {
1154
- "data-testid": "install-prompt-cta-ios-other-primary",
1155
- type: "button",
1156
- onClick: handleShowHelp,
1157
- "aria-expanded": helpOpen,
1158
- style: primaryButtonStyle,
1159
- children: copy.ctaPrimary
1125
+ n: 1,
1126
+ title: copy.step1.title,
1127
+ subtitle: copy.step1.subtitle,
1128
+ visual: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1129
+ "div",
1130
+ {
1131
+ style: {
1132
+ display: "flex",
1133
+ justifyContent: "center",
1134
+ alignItems: "center",
1135
+ background: "#f5f5f7",
1136
+ borderRadius: 12,
1137
+ padding: "12px 0",
1138
+ marginTop: 8
1139
+ },
1140
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ShareIconIOS, { size: 32, style: { color: "var(--hook-color-primary)" } })
1141
+ }
1142
+ )
1160
1143
  }
1161
1144
  ),
1162
1145
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1163
- "button",
1146
+ Step2,
1164
1147
  {
1165
- "data-testid": "install-prompt-cta-ios-other-secondary",
1166
- type: "button",
1167
- onClick: () => void handleCopy(),
1168
- style: secondaryButtonStyle,
1169
- children: copied ? copy.copiedToast : copy.ctaSecondary
1148
+ n: 2,
1149
+ title: copy.step2.title,
1150
+ visual: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1151
+ "div",
1152
+ {
1153
+ style: {
1154
+ display: "flex",
1155
+ alignItems: "center",
1156
+ gap: 10,
1157
+ background: "#f5f5f7",
1158
+ borderRadius: 12,
1159
+ padding: "12px 14px",
1160
+ marginTop: 8
1161
+ },
1162
+ children: [
1163
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SquarePlusIcon, { size: 22, style: { color: "#555" } }),
1164
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 14, color: "#333" }, children: copy.step2.iconLabel })
1165
+ ]
1166
+ }
1167
+ )
1170
1168
  }
1171
1169
  ),
1172
- helpOpen && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1173
- "div",
1170
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1171
+ Step2,
1174
1172
  {
1175
- "data-testid": "install-prompt-ios-other-help",
1176
- style: { marginTop: 20, textAlign: "left" },
1177
- children: [
1178
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1179
- Step2,
1180
- {
1181
- n: 1,
1182
- title: copy.help.step1.title,
1183
- subtitle: copy.help.step1.subtitle,
1184
- visual: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1185
- "div",
1186
- {
1187
- style: {
1188
- display: "flex",
1189
- justifyContent: "center",
1190
- alignItems: "center",
1191
- background: "#f5f5f7",
1192
- borderRadius: 12,
1193
- padding: "12px 0",
1194
- marginTop: 8
1195
- },
1196
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1197
- MenuDotsHorizontalIcon,
1198
- {
1199
- size: 28,
1200
- style: { color: "var(--hook-color-primary)" }
1201
- }
1202
- )
1203
- }
1204
- )
1205
- }
1206
- ),
1207
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1208
- Step2,
1209
- {
1210
- n: 2,
1211
- title: copy.help.step2.title,
1212
- subtitle: copy.help.step2.subtitle,
1213
- visual: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1214
- "div",
1215
- {
1216
- style: {
1217
- display: "flex",
1218
- alignItems: "center",
1219
- gap: 10,
1220
- background: "#f5f5f7",
1221
- borderRadius: 12,
1222
- padding: "12px 14px",
1223
- marginTop: 8
1224
- },
1225
- children: [
1226
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ExternalLinkIcon, { size: 22, style: { color: "#555" } }),
1227
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 14, color: "#333" }, children: "Abrir no Safari" })
1228
- ]
1229
- }
1230
- )
1231
- }
1232
- )
1233
- ]
1173
+ n: 3,
1174
+ title: copy.step3.title,
1175
+ visual: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1176
+ "div",
1177
+ {
1178
+ style: {
1179
+ display: "flex",
1180
+ justifyContent: "flex-end",
1181
+ background: "#f5f5f7",
1182
+ borderRadius: 12,
1183
+ padding: "10px 14px",
1184
+ marginTop: 8
1185
+ },
1186
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1187
+ "span",
1188
+ {
1189
+ style: {
1190
+ color: "var(--hook-color-primary)",
1191
+ fontSize: 15,
1192
+ fontWeight: 600
1193
+ },
1194
+ children: copy.step3.buttonLabel
1195
+ }
1196
+ )
1197
+ }
1198
+ )
1234
1199
  }
1235
1200
  ),
1236
1201
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
@@ -1239,7 +1204,7 @@ function IOSOtherVariant({
1239
1204
  "data-testid": "install-prompt-skip-session",
1240
1205
  type: "button",
1241
1206
  onClick: actions.dismissSession,
1242
- style: skipLinkStyle,
1207
+ style: { ...skipLinkStyle, marginTop: 16 },
1243
1208
  children: copy.skip
1244
1209
  }
1245
1210
  ),
@@ -1257,7 +1222,7 @@ function IOSOtherVariant({
1257
1222
  }
1258
1223
 
1259
1224
  // src/components/InstallGate/variants/InAppBrowserVariant.tsx
1260
- var import_react7 = require("react");
1225
+ var import_react6 = require("react");
1261
1226
  var import_jsx_runtime14 = require("react/jsx-runtime");
1262
1227
  function InAppBrowserVariant({
1263
1228
  state,
@@ -1267,7 +1232,7 @@ function InAppBrowserVariant({
1267
1232
  const appCopy = INSTALL_COPY.inApp[app] ?? INSTALL_COPY.inApp.other;
1268
1233
  const copy = INSTALL_COPY.inApp;
1269
1234
  const showPermanent = shouldShowPermanentOption(state);
1270
- const [copied, setCopied] = (0, import_react7.useState)(false);
1235
+ const [copied, setCopied] = (0, import_react6.useState)(false);
1271
1236
  const handleCopy = async () => {
1272
1237
  await actions.copyLink();
1273
1238
  setCopied(true);
@@ -1472,8 +1437,8 @@ function InstallGate({ children }) {
1472
1437
  const enabled = features_enabled.includes("install_prompt");
1473
1438
  const installState = useInstallPrompt(slug);
1474
1439
  const shouldBlock = enabled && shouldBlockInstall(installState);
1475
- const trackedRef = (0, import_react8.useRef)(null);
1476
- (0, import_react8.useEffect)(() => {
1440
+ const trackedRef = (0, import_react7.useRef)(null);
1441
+ (0, import_react7.useEffect)(() => {
1477
1442
  if (!shouldBlock) return;
1478
1443
  if (typeof window === "undefined") return;
1479
1444
  const variantKey = `${slug}:${installState.variant}`;
@@ -1514,9 +1479,9 @@ function InstallGate({ children }) {
1514
1479
  }
1515
1480
 
1516
1481
  // src/defaults/ErrorBoundary.tsx
1517
- var import_react9 = require("react");
1482
+ var import_react8 = require("react");
1518
1483
  var import_jsx_runtime17 = require("react/jsx-runtime");
1519
- var ErrorBoundary = class extends import_react9.Component {
1484
+ var ErrorBoundary = class extends import_react8.Component {
1520
1485
  state = { error: null };
1521
1486
  static getDerivedStateFromError(error) {
1522
1487
  return { error };
@@ -1536,7 +1501,7 @@ var ErrorBoundary = class extends import_react9.Component {
1536
1501
  };
1537
1502
 
1538
1503
  // src/hooks/useLoginForm.ts
1539
- var import_react10 = require("react");
1504
+ var import_react9 = require("react");
1540
1505
  var import_sdk5 = require("@hook-sdk/sdk");
1541
1506
 
1542
1507
  // src/errors.ts
@@ -1573,22 +1538,22 @@ var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
1573
1538
  var MIN_PASSWORD = 8;
1574
1539
  function useLoginForm() {
1575
1540
  const { auth } = (0, import_sdk5.useHook)();
1576
- const [email, setEmail] = (0, import_react10.useState)("");
1577
- const [password, setPassword] = (0, import_react10.useState)("");
1578
- const [submitting, setSubmitting] = (0, import_react10.useState)(false);
1579
- const [error, setError] = (0, import_react10.useState)(null);
1580
- const emailError = (0, import_react10.useMemo)(() => {
1541
+ const [email, setEmail] = (0, import_react9.useState)("");
1542
+ const [password, setPassword] = (0, import_react9.useState)("");
1543
+ const [submitting, setSubmitting] = (0, import_react9.useState)(false);
1544
+ const [error, setError] = (0, import_react9.useState)(null);
1545
+ const emailError = (0, import_react9.useMemo)(() => {
1581
1546
  if (email.length === 0) return null;
1582
1547
  if (!EMAIL_RE.test(email)) return "Formato de e-mail inv\xE1lido.";
1583
1548
  return null;
1584
1549
  }, [email]);
1585
- const passwordError = (0, import_react10.useMemo)(() => {
1550
+ const passwordError = (0, import_react9.useMemo)(() => {
1586
1551
  if (password.length === 0) return null;
1587
1552
  if (password.length < MIN_PASSWORD) return `M\xEDnimo de ${MIN_PASSWORD} caracteres.`;
1588
1553
  return null;
1589
1554
  }, [password]);
1590
1555
  const canSubmit = email.length > 0 && password.length >= MIN_PASSWORD && emailError === null && passwordError === null && !submitting;
1591
- const submit = (0, import_react10.useCallback)(async () => {
1556
+ const submit = (0, import_react9.useCallback)(async () => {
1592
1557
  if (!canSubmit) return false;
1593
1558
  setSubmitting(true);
1594
1559
  setError(null);
@@ -1687,7 +1652,7 @@ function GoogleGlyph() {
1687
1652
  }
1688
1653
 
1689
1654
  // src/internal/OAuthErrorBanner.tsx
1690
- var import_react11 = require("react");
1655
+ var import_react10 = require("react");
1691
1656
  var import_jsx_runtime19 = require("react/jsx-runtime");
1692
1657
  var ERROR_MESSAGES = {
1693
1658
  invalid_state: "Sess\xE3o expirou, tente de novo.",
@@ -1708,8 +1673,8 @@ function stripErrorFromUrl() {
1708
1673
  window.history.replaceState({}, "", url.toString());
1709
1674
  }
1710
1675
  function OAuthErrorBanner() {
1711
- const [code, setCode] = (0, import_react11.useState)(() => readErrorCode());
1712
- (0, import_react11.useEffect)(() => {
1676
+ const [code, setCode] = (0, import_react10.useState)(() => readErrorCode());
1677
+ (0, import_react10.useEffect)(() => {
1713
1678
  if (code !== null) stripErrorFromUrl();
1714
1679
  }, [code]);
1715
1680
  if (!code) return null;
@@ -1842,34 +1807,34 @@ function DefaultLoginScreen({ onNavigate }) {
1842
1807
  }
1843
1808
 
1844
1809
  // src/hooks/useSignupForm.ts
1845
- var import_react12 = require("react");
1810
+ var import_react11 = require("react");
1846
1811
  var import_sdk6 = require("@hook-sdk/sdk");
1847
1812
  var EMAIL_RE2 = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
1848
1813
  var MIN_PASSWORD2 = 8;
1849
1814
  function useSignupForm() {
1850
1815
  const { auth } = (0, import_sdk6.useHook)();
1851
- const [name, setName] = (0, import_react12.useState)("");
1852
- const [email, setEmail] = (0, import_react12.useState)("");
1853
- const [password, setPassword] = (0, import_react12.useState)("");
1854
- const [submitting, setSubmitting] = (0, import_react12.useState)(false);
1855
- const [error, setError] = (0, import_react12.useState)(null);
1856
- const nameError = (0, import_react12.useMemo)(() => {
1816
+ const [name, setName] = (0, import_react11.useState)("");
1817
+ const [email, setEmail] = (0, import_react11.useState)("");
1818
+ const [password, setPassword] = (0, import_react11.useState)("");
1819
+ const [submitting, setSubmitting] = (0, import_react11.useState)(false);
1820
+ const [error, setError] = (0, import_react11.useState)(null);
1821
+ const nameError = (0, import_react11.useMemo)(() => {
1857
1822
  if (name.length === 0) return null;
1858
1823
  if (name.trim().length < 2) return "Nome muito curto.";
1859
1824
  return null;
1860
1825
  }, [name]);
1861
- const emailError = (0, import_react12.useMemo)(() => {
1826
+ const emailError = (0, import_react11.useMemo)(() => {
1862
1827
  if (email.length === 0) return null;
1863
1828
  if (!EMAIL_RE2.test(email)) return "Formato de e-mail inv\xE1lido.";
1864
1829
  return null;
1865
1830
  }, [email]);
1866
- const passwordError = (0, import_react12.useMemo)(() => {
1831
+ const passwordError = (0, import_react11.useMemo)(() => {
1867
1832
  if (password.length === 0) return null;
1868
1833
  if (password.length < MIN_PASSWORD2) return `M\xEDnimo de ${MIN_PASSWORD2} caracteres.`;
1869
1834
  return null;
1870
1835
  }, [password]);
1871
1836
  const canSubmit = name.trim().length >= 2 && email.length > 0 && password.length >= MIN_PASSWORD2 && nameError === null && emailError === null && passwordError === null && !submitting;
1872
- const submit = (0, import_react12.useCallback)(async () => {
1837
+ const submit = (0, import_react11.useCallback)(async () => {
1873
1838
  if (!canSubmit) return false;
1874
1839
  setSubmitting(true);
1875
1840
  setError(null);
@@ -1957,22 +1922,22 @@ function DefaultSignupScreen({ onNavigate }) {
1957
1922
  }
1958
1923
 
1959
1924
  // src/hooks/useForgotForm.ts
1960
- var import_react13 = require("react");
1925
+ var import_react12 = require("react");
1961
1926
  var import_sdk7 = require("@hook-sdk/sdk");
1962
1927
  var EMAIL_RE3 = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
1963
1928
  function useForgotForm() {
1964
1929
  const { auth } = (0, import_sdk7.useHook)();
1965
- const [email, setEmail] = (0, import_react13.useState)("");
1966
- const [submitting, setSubmitting] = (0, import_react13.useState)(false);
1967
- const [sent, setSent] = (0, import_react13.useState)(false);
1968
- const [error, setError] = (0, import_react13.useState)(null);
1969
- const emailError = (0, import_react13.useMemo)(() => {
1930
+ const [email, setEmail] = (0, import_react12.useState)("");
1931
+ const [submitting, setSubmitting] = (0, import_react12.useState)(false);
1932
+ const [sent, setSent] = (0, import_react12.useState)(false);
1933
+ const [error, setError] = (0, import_react12.useState)(null);
1934
+ const emailError = (0, import_react12.useMemo)(() => {
1970
1935
  if (email.length === 0) return null;
1971
1936
  if (!EMAIL_RE3.test(email)) return "Formato de e-mail inv\xE1lido.";
1972
1937
  return null;
1973
1938
  }, [email]);
1974
1939
  const canSubmit = email.length > 0 && emailError === null && !submitting;
1975
- const submit = (0, import_react13.useCallback)(async () => {
1940
+ const submit = (0, import_react12.useCallback)(async () => {
1976
1941
  if (!canSubmit) return false;
1977
1942
  setSubmitting(true);
1978
1943
  setError(null);
@@ -2031,35 +1996,35 @@ function DefaultForgotScreen({ onNavigate }) {
2031
1996
  }
2032
1997
 
2033
1998
  // src/hooks/useResetForm.ts
2034
- var import_react14 = require("react");
1999
+ var import_react13 = require("react");
2035
2000
  var import_sdk8 = require("@hook-sdk/sdk");
2036
2001
  var MIN_PASSWORD3 = 12;
2037
2002
  function useResetForm() {
2038
2003
  const { auth } = (0, import_sdk8.useHook)();
2039
- const [token, setToken] = (0, import_react14.useState)(null);
2040
- const [password, setPassword] = (0, import_react14.useState)("");
2041
- const [confirm, setConfirm] = (0, import_react14.useState)("");
2042
- const [submitting, setSubmitting] = (0, import_react14.useState)(false);
2043
- const [done, setDone] = (0, import_react14.useState)(false);
2044
- const [error, setError] = (0, import_react14.useState)(null);
2045
- (0, import_react14.useEffect)(() => {
2004
+ const [token, setToken] = (0, import_react13.useState)(null);
2005
+ const [password, setPassword] = (0, import_react13.useState)("");
2006
+ const [confirm, setConfirm] = (0, import_react13.useState)("");
2007
+ const [submitting, setSubmitting] = (0, import_react13.useState)(false);
2008
+ const [done, setDone] = (0, import_react13.useState)(false);
2009
+ const [error, setError] = (0, import_react13.useState)(null);
2010
+ (0, import_react13.useEffect)(() => {
2046
2011
  if (typeof window === "undefined") return;
2047
2012
  const params = new URLSearchParams(window.location.search);
2048
2013
  const t = params.get("token");
2049
2014
  setToken(t && t.length > 0 ? t : null);
2050
2015
  }, []);
2051
- const passwordError = (0, import_react14.useMemo)(() => {
2016
+ const passwordError = (0, import_react13.useMemo)(() => {
2052
2017
  if (password.length === 0) return null;
2053
2018
  if (password.length < MIN_PASSWORD3) return `M\xEDnimo de ${MIN_PASSWORD3} caracteres.`;
2054
2019
  return null;
2055
2020
  }, [password]);
2056
- const confirmError = (0, import_react14.useMemo)(() => {
2021
+ const confirmError = (0, import_react13.useMemo)(() => {
2057
2022
  if (confirm.length === 0) return null;
2058
2023
  if (confirm !== password) return "Senhas n\xE3o coincidem.";
2059
2024
  return null;
2060
2025
  }, [confirm, password]);
2061
2026
  const canSubmit = token !== null && password.length >= MIN_PASSWORD3 && confirm === password && passwordError === null && confirmError === null && !submitting && !done;
2062
- const submit = (0, import_react14.useCallback)(async () => {
2027
+ const submit = (0, import_react13.useCallback)(async () => {
2063
2028
  if (!canSubmit || token === null) return;
2064
2029
  setSubmitting(true);
2065
2030
  setError(null);
@@ -2137,13 +2102,13 @@ function DefaultResetScreen({ onNavigate }) {
2137
2102
  }
2138
2103
 
2139
2104
  // src/defaults/DefaultPaywall.tsx
2140
- var import_react15 = require("react");
2105
+ var import_react14 = require("react");
2141
2106
  var import_jsx_runtime24 = require("react/jsx-runtime");
2142
2107
  function DefaultPaywall() {
2143
2108
  const config = useTemplateConfig();
2144
2109
  const { checkout, opening, error } = usePaywallState();
2145
2110
  const p = config.subscription.paywall_config;
2146
- const [cpf, setCpf] = (0, import_react15.useState)("");
2111
+ const [cpf, setCpf] = (0, import_react14.useState)("");
2147
2112
  const cpfDigits = cpf.replace(/\D/g, "");
2148
2113
  const canCheckout = cpfDigits.length === 11 && !opening;
2149
2114
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("main", { style: { padding: 24, maxWidth: 440, margin: "0 auto", textAlign: "center" }, children: [
@@ -2200,11 +2165,11 @@ var import_jsx_runtime25 = require("react/jsx-runtime");
2200
2165
  var BACKOFF_MS = [2e3, 5e3, 1e4, 2e4, 4e4];
2201
2166
  function PaymentReturnHandler({ children }) {
2202
2167
  const { subscription } = (0, import_sdk9.useHook)();
2203
- const subRef = (0, import_react16.useRef)(subscription);
2168
+ const subRef = (0, import_react15.useRef)(subscription);
2204
2169
  subRef.current = subscription;
2205
- const runIdRef = (0, import_react16.useRef)(0);
2206
- const [state, setState] = (0, import_react16.useState)("idle");
2207
- const runPoll = (0, import_react16.useCallback)(() => {
2170
+ const runIdRef = (0, import_react15.useRef)(0);
2171
+ const [state, setState] = (0, import_react15.useState)("idle");
2172
+ const runPoll = (0, import_react15.useCallback)(() => {
2208
2173
  const runId = ++runIdRef.current;
2209
2174
  setState("confirming");
2210
2175
  let attempts = 0;
@@ -2233,7 +2198,7 @@ function PaymentReturnHandler({ children }) {
2233
2198
  };
2234
2199
  void tick();
2235
2200
  }, []);
2236
- (0, import_react16.useEffect)(() => {
2201
+ (0, import_react15.useEffect)(() => {
2237
2202
  if (typeof window === "undefined") return;
2238
2203
  const url = new URL(window.location.href);
2239
2204
  if (url.searchParams.get("paymentReturn") !== "1") return;
@@ -2307,7 +2272,7 @@ function AppRoot({
2307
2272
  }
2308
2273
 
2309
2274
  // src/hooks/usePush.ts
2310
- var import_react17 = require("react");
2275
+ var import_react16 = require("react");
2311
2276
  var import_sdk10 = require("@hook-sdk/sdk");
2312
2277
  function detectIosNeedsInstall() {
2313
2278
  if (typeof navigator === "undefined" || typeof window === "undefined") return false;
@@ -2335,11 +2300,11 @@ function deriveState(push) {
2335
2300
  }
2336
2301
  function usePush() {
2337
2302
  const { push } = (0, import_sdk10.useHook)();
2338
- const [state, setState] = (0, import_react17.useState)(() => deriveState(push));
2339
- (0, import_react17.useEffect)(() => {
2303
+ const [state, setState] = (0, import_react16.useState)(() => deriveState(push));
2304
+ (0, import_react16.useEffect)(() => {
2340
2305
  setState(deriveState(push));
2341
2306
  }, [push]);
2342
- const subscribe = (0, import_react17.useCallback)(async () => {
2307
+ const subscribe = (0, import_react16.useCallback)(async () => {
2343
2308
  try {
2344
2309
  await push.subscribe();
2345
2310
  setState({ kind: "subscribed" });
@@ -2351,7 +2316,7 @@ function usePush() {
2351
2316
  throw e;
2352
2317
  }
2353
2318
  }, [push]);
2354
- const unsubscribe = (0, import_react17.useCallback)(async () => {
2319
+ const unsubscribe = (0, import_react16.useCallback)(async () => {
2355
2320
  try {
2356
2321
  await push.unsubscribe();
2357
2322
  setState({ kind: "prompt" });
@@ -2417,12 +2382,12 @@ function EmptyState({ title, description, action }) {
2417
2382
  }
2418
2383
 
2419
2384
  // src/hooks/useAuthPrimitives.ts
2420
- var import_react18 = require("react");
2385
+ var import_react17 = require("react");
2421
2386
  var import_sdk11 = require("@hook-sdk/sdk");
2422
2387
  var warned = false;
2423
2388
  function useAuthPrimitives() {
2424
2389
  const { auth } = (0, import_sdk11.useHook)();
2425
- (0, import_react18.useEffect)(() => {
2390
+ (0, import_react17.useEffect)(() => {
2426
2391
  if (!warned && process.env.NODE_ENV !== "production") {
2427
2392
  warned = true;
2428
2393
  console.warn(
@@ -2453,14 +2418,14 @@ function useSubscription() {
2453
2418
  }
2454
2419
 
2455
2420
  // src/hooks/useReminders.ts
2456
- var import_react19 = require("react");
2421
+ var import_react18 = require("react");
2457
2422
  var import_sdk13 = require("@hook-sdk/sdk");
2458
2423
  function useReminders() {
2459
2424
  const { push } = (0, import_sdk13.useHook)();
2460
2425
  const r = push.reminders;
2461
- const [reminders, setReminders] = (0, import_react19.useState)([]);
2462
- const [loading, setLoading] = (0, import_react19.useState)(true);
2463
- const reload = (0, import_react19.useCallback)(async () => {
2426
+ const [reminders, setReminders] = (0, import_react18.useState)([]);
2427
+ const [loading, setLoading] = (0, import_react18.useState)(true);
2428
+ const reload = (0, import_react18.useCallback)(async () => {
2464
2429
  setLoading(true);
2465
2430
  try {
2466
2431
  const next = await r.list();
@@ -2469,38 +2434,38 @@ function useReminders() {
2469
2434
  setLoading(false);
2470
2435
  }
2471
2436
  }, [r]);
2472
- (0, import_react19.useEffect)(() => {
2437
+ (0, import_react18.useEffect)(() => {
2473
2438
  void reload();
2474
2439
  }, [reload]);
2475
- const setReminder = (0, import_react19.useCallback)(async (input) => {
2440
+ const setReminder = (0, import_react18.useCallback)(async (input) => {
2476
2441
  await r.set(input);
2477
2442
  await reload();
2478
2443
  }, [r, reload]);
2479
- const deleteReminder = (0, import_react19.useCallback)(async (slot) => {
2444
+ const deleteReminder = (0, import_react18.useCallback)(async (slot) => {
2480
2445
  await r.delete(slot);
2481
2446
  await reload();
2482
2447
  }, [r, reload]);
2483
- const schedule = (0, import_react19.useCallback)(async (items) => {
2448
+ const schedule = (0, import_react18.useCallback)(async (items) => {
2484
2449
  return r.schedule(items);
2485
2450
  }, [r]);
2486
- const setFallbacks = (0, import_react19.useCallback)(async (items) => {
2451
+ const setFallbacks = (0, import_react18.useCallback)(async (items) => {
2487
2452
  return r.setFallbacks(items);
2488
2453
  }, [r]);
2489
2454
  return { reminders, loading, setReminder, deleteReminder, schedule, setFallbacks };
2490
2455
  }
2491
2456
 
2492
2457
  // src/hooks/useToast.ts
2493
- var import_react20 = require("react");
2458
+ var import_react19 = require("react");
2494
2459
  function useToast() {
2495
- const [items, setItems] = (0, import_react20.useState)([]);
2496
- const show = (0, import_react20.useCallback)((message, kind = "info") => {
2460
+ const [items, setItems] = (0, import_react19.useState)([]);
2461
+ const show = (0, import_react19.useCallback)((message, kind = "info") => {
2497
2462
  const id = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
2498
2463
  setItems((prev) => [...prev, { id, message, kind }]);
2499
2464
  setTimeout(() => {
2500
2465
  setItems((prev) => prev.filter((t) => t.id !== id));
2501
2466
  }, 4e3);
2502
2467
  }, []);
2503
- const dismiss = (0, import_react20.useCallback)((id) => {
2468
+ const dismiss = (0, import_react19.useCallback)((id) => {
2504
2469
  setItems((prev) => prev.filter((t) => t.id !== id));
2505
2470
  }, []);
2506
2471
  return { items, show, dismiss };