1import { 2 n as n3 3} from "./chunk-Y6YANJ2R.js"; 4import { 5 a 6} from "./chunk-4KLBVKRC.js"; 7import { 8 n as n2 9} from "./chunk-YCYYQRQ6.js"; 10import { 11 o 12} from "./chunk-GCD6STSW.js"; 13import { 14 EnvelopeIcon_default 15} from "./chunk-JCTPOFOD.js"; 16import { 17 PhoneIcon_default 18} from "./chunk-NAPCM6ZT.js"; 19import "./chunk-VQYZO3XL.js"; 20import "./chunk-ARTDLMGJ.js"; 21import "./chunk-XKUWNRAU.js"; 22import "./chunk-BI6FLLBF.js"; 23import "./chunk-GWTLZPQW.js"; 24import "./chunk-TUIXK4GB.js"; 25import "./chunk-2SIOJVPY.js"; 26import "./chunk-DELSWSYH.js"; 27import "./chunk-F6HKBNBJ.js"; 28import "./chunk-EFX7LFQF.js"; 29import { 30 I, 31 M2 as M, 32 P2 as P, 33 S2 as S, 34 dt, 35 g, 36 le, 37 n3 as n, 38 require_lib, 39 u3 as u 40} from "./chunk-GW6OWVAS.js"; 41import { 42 require_jsx_runtime 43} from "./chunk-V3VQYMUU.js"; 44import "./chunk-WAY6HQ7C.js"; 45import "./chunk-KAIIOKO3.js"; 46import "./chunk-F7LOI2M5.js"; 47import "./chunk-GWCOH4DF.js"; 48import "./chunk-FUATFXFK.js"; 49import "./chunk-55ARO2SJ.js"; 50import "./chunk-J46SIAYM.js"; 51import "./chunk-EUVCRAFR.js"; 52import "./chunk-5HUKUZMX.js"; 53import "./chunk-DRQXJS52.js"; 54import "./chunk-EKGTQN7B.js"; 55import "./chunk-57LJOLTQ.js"; 56import "./chunk-QOAWOBZZ.js"; 57import "./chunk-CXC3RFJP.js"; 58import "./chunk-LOYGATPO.js"; 59import "./chunk-MWZBDUVS.js"; 60import "./chunk-IVTAVDWF.js"; 61import { 62 require_react 63} from "./chunk-2TKNTQO7.js"; 64import { 65 __toESM, 66 init_buffer_shim 67} from "./chunk-DMHST2WB.js"; 68
vendor: 178 bytes, lines 69-72
69// ../node_modules/@privy-io/react-auth/dist/esm/AwaitingPasswordlessCodeScreen-Dd7TblcM.mjs 70init_buffer_shim(); 71var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); 72
vendor: 941 bytes, lines 73-99
73// ../node_modules/@heroicons/react/20/solid/esm/CheckIcon.js 74init_buffer_shim(); 75var React = __toESM(require_react(), 1); 76function CheckIcon({ 77 title, 78 titleId, 79 ...props 80}, svgRef) { 81 return /* @__PURE__ */ React.createElement("svg", Object.assign({ 82 xmlns: "http://www.w3.org/2000/svg", 83 viewBox: "0 0 20 20", 84 fill: "currentColor", 85 "aria-hidden": "true", 86 "data-slot": "icon", 87 ref: svgRef, 88 "aria-labelledby": titleId 89 }, props), title ? /* @__PURE__ */ React.createElement("title", { 90 id: titleId 91 }, title) : null, /* @__PURE__ */ React.createElement("path", { 92 fillRule: "evenodd", 93 d: "M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z", 94 clipRule: "evenodd" 95 })); 96} 97var ForwardRef = /* @__PURE__ */ React.forwardRef(CheckIcon); 98var CheckIcon_default = ForwardRef; 99
vendor: 10,647 bytes, lines 100-219
100// ../node_modules/@privy-io/react-auth/dist/esm/AwaitingPasswordlessCodeScreen-Dd7TblcM.mjs 101var import_react = __toESM(require_react(), 1); 102var import_react_device_detect = __toESM(require_lib(), 1); 103var C = ({ contactMethod: c, authFlow: p, appName: m = "Privy", whatsAppEnabled: u2 = false, onBack: f, onCodeSubmit: v, onResend: h, errorMessage: y, success: g2 = false, resendCountdown: b = 0, onInvalidInput: C2, onClearError: S3 }) => { 104 let [A2, I3] = (0, import_react.useState)(w); 105 (0, import_react.useEffect)((() => { 106 y || I3(w); 107 }), [y]); 108 let N2 = async (e2) => { 109 e2.preventDefault(); 110 let r2 = e2.currentTarget.value.replace(" ", ""); 111 if ("" === r2) return; 112 if (isNaN(Number(r2))) return void C2?.("Code should be numeric"); 113 S3?.(); 114 let o2 = Number(e2.currentTarget.name?.charAt(5)), t = [...r2 || [""]].slice(0, E - o2), i = [...A2.slice(0, o2), ...t, ...A2.slice(o2 + t.length)]; 115 I3(i); 116 let n5 = Math.min(Math.max(o2 + t.length, 0), E - 1); 117 if (!isNaN(Number(e2.currentTarget.value))) { 118 let e3 = document.querySelector(`input[name=code-${n5}]`); 119 e3?.focus(); 120 } 121 if (i.every(((e3) => e3 && !isNaN(+e3)))) { 122 let e3 = document.querySelector(`input[name=code-${n5}]`); 123 e3?.blur(), await v?.(i.join("")); 124 } 125 }; 126 return (0, import_jsx_runtime.jsx)(n2, { title: "Enter confirmation code", subtitle: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", "email" === p ? { children: ["Please check ", /* @__PURE__ */ (0, import_jsx_runtime.jsx)(R, { children: c }), " for an email from privy.io and enter your code below."] } : { children: ["Please check ", /* @__PURE__ */ (0, import_jsx_runtime.jsx)(R, { children: c }), " for a", u2 ? " WhatsApp" : "", " message from ", m, " and enter your code below."] }), icon: "email" === p ? EnvelopeIcon_default : PhoneIcon_default, onBack: f, showBack: true, helpText: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(L, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: ["Didn't get ", "email" === p ? "an email" : "a message", "?"] }), b ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(M2, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckIcon_default, { color: "var(--privy-color-foreground)", strokeWidth: 1.33, height: "12px", width: "12px" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Code sent" })] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(n3, { as: "button", size: "sm", onClick: h, children: "Resend code" })] }), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(k, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(o, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(_, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: A2.map(((r2, o2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { name: `code-${o2}`, type: "text", value: A2[o2], onChange: N2, onKeyUp: (e2) => { 127 "Backspace" === e2.key && ((e3) => { 128 if (S3?.(), I3([...A2.slice(0, e3), "", ...A2.slice(e3 + 1)]), e3 > 0) { 129 let r3 = document.querySelector(`input[name=code-${e3 - 1}]`); 130 r3?.focus(); 131 } 132 })(o2); 133 }, inputMode: "numeric", autoFocus: 0 === o2, pattern: "[0-9]", className: `${g2 ? "success" : ""} ${y ? "fail" : ""}`, autoComplete: import_react_device_detect.isMobile ? "one-time-code" : "off" }, o2))) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(j, { $fail: !!y, $success: g2, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Invalid or expired verification code" === y ? "Incorrect code" : y || (g2 ? "Success!" : "") }) })] }) }) }) }); 134}; 135var E = 6; 136var w = Array(6).fill(""); 137var S2; 138var A; 139var I2 = ((S2 = I2 || {})[S2.RESET_AFTER_DELAY = 0] = "RESET_AFTER_DELAY", S2[S2.CLEAR_ON_NEXT_VALID_INPUT = 1] = "CLEAR_ON_NEXT_VALID_INPUT", S2); 140var N = ((A = N || {})[A.EMAIL = 0] = "EMAIL", A[A.SMS = 1] = "SMS", A); 141var T = { component: () => { 142 let { navigate: r2, lastScreen: o2, navigateBack: t, setModalData: i, onUserCloseViaDialogOrKeybindRef: s2 } = P(), c = le(), { closePrivyModal: l, resendEmailCode: d, resendSmsCode: x, getAuthMeta: E2, loginWithCode: w2, updateWallets: S3, createAnalyticsEvent: A2 } = I(), { authenticated: I3, logout: N2, user: T2 } = M(), { whatsAppEnabled: k2 } = le(), [_2, j2] = (0, import_react.useState)(false), [L2, M3] = (0, import_react.useState)(null), [R2, D] = (0, import_react.useState)(null), [O, P2] = (0, import_react.useState)(0); 143 s2.current = () => null; 144 let W = E2()?.email ? 0 : 1, U = 0 === W ? E2()?.email || "" : E2()?.phoneNumber || "", F = g - 500; 145 (0, import_react.useEffect)((() => { 146 if (O) { 147 let e2 = setTimeout((() => { 148 P2(O - 1); 149 }), 1e3); 150 return () => clearTimeout(e2); 151 } 152 }), [O]), (0, import_react.useEffect)((() => { 153 if (I3 && _2 && T2) { 154 if (c?.legal.requireUsersAcceptTerms && !T2.hasAcceptedTerms) { 155 let e2 = setTimeout((() => { 156 r2("AffirmativeConsentScreen"); 157 }), F); 158 return () => clearTimeout(e2); 159 } 160 if (a(T2, c.embeddedWallets)) { 161 let e2 = setTimeout((() => { 162 i({ createWallet: { onSuccess: () => { 163 }, onFailure: (e3) => { 164 console.error(e3), A2({ eventName: "embedded_wallet_creation_failure_logout", payload: { error: e3, screen: "AwaitingPasswordlessCodeScreen" } }), N2(); 165 }, callAuthOnSuccessOnClose: true } }), r2("EmbeddedWalletOnAccountCreateScreen"); 166 }), F); 167 return () => clearTimeout(e2); 168 } 169 { 170 S3(); 171 let e2 = setTimeout((() => l({ shouldCallAuthOnSuccess: true, isSuccess: true })), g); 172 return () => clearTimeout(e2); 173 } 174 } 175 }), [I3, _2, T2]), (0, import_react.useEffect)((() => { 176 if (L2 && 0 === R2) { 177 let e2 = setTimeout((() => { 178 M3(null), D(null); 179 let e3 = document.querySelector("input[name=code-0]"); 180 e3?.focus(); 181 }), 1400); 182 return () => clearTimeout(e2); 183 } 184 }), [L2, R2]); 185 return (0, import_jsx_runtime.jsx)(C, { contactMethod: U, authFlow: 0 === W ? "email" : "sms", appName: c?.name, whatsAppEnabled: k2, onBack: () => t(), onCodeSubmit: async (e2) => { 186 try { 187 await w2(e2), j2(true); 188 } catch (e3) { 189 if (e3 instanceof n && e3.privyErrorCode === u.INVALID_CREDENTIALS) M3("Invalid or expired verification code"), D(0); 190 else if (e3 instanceof n && e3.privyErrorCode === u.CANNOT_LINK_MORE_OF_TYPE) M3(e3.message); 191 else { 192 if (e3 instanceof n && e3.privyErrorCode === u.USER_LIMIT_REACHED) return console.error(new S(e3).toString()), void r2("UserLimitReachedScreen"); 193 if (e3 instanceof n && e3.privyErrorCode === u.USER_DOES_NOT_EXIST) return void r2("AccountNotFoundScreen"); 194 if (e3 instanceof n && e3.privyErrorCode === u.LINKED_TO_ANOTHER_USER) return i({ errorModalData: { error: e3, previousScreen: o2 ?? "AwaitingPasswordlessCodeScreen" } }), void r2("ErrorScreen", false); 195 if (e3 instanceof n && e3.privyErrorCode === u.DISALLOWED_PLUS_EMAIL) return i({ inlineError: { error: e3 } }), void r2("ConnectOrCreateScreen", false); 196 if (e3 instanceof n && e3.privyErrorCode === u.ACCOUNT_TRANSFER_REQUIRED && e3.data?.data?.nonce) return i({ accountTransfer: { nonce: e3.data?.data?.nonce, account: U, displayName: e3.data?.data?.account?.displayName, linkMethod: 0 === W ? "email" : "sms", embeddedWalletAddress: e3.data?.data?.otherUser?.embeddedWalletAddress } }), void r2("LinkConflictScreen"); 197 M3("Issue verifying code"), D(0); 198 } 199 } 200 }, onResend: async () => { 201 P2(30), 0 === W ? await d() : await x(); 202 }, errorMessage: L2 || void 0, success: _2, resendCountdown: O, onInvalidInput: (e2) => { 203 M3(e2), D(1); 204 }, onClearError: () => { 205 1 === R2 && (M3(null), D(null)); 206 } }); 207} }; 208var k = /* @__PURE__ */ dt.div.withConfig({ displayName: "PasswordlessCodeContainer", componentId: "sc-6187bfee-0" })(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin:auto;gap:16px;flex-grow:1;width:100%;"]); 209var _ = /* @__PURE__ */ dt.div.withConfig({ displayName: "CodeInput", componentId: "sc-6187bfee-1" })(["display:flex;flex-direction:column;width:100%;gap:12px;> div:first-child{display:flex;justify-content:center;gap:0.5rem;width:100%;border-radius:var(--privy-border-radius-sm);> input{border:1px solid var(--privy-color-foreground-4);background:var(--privy-color-background);border-radius:var(--privy-border-radius-sm);padding:8px 10px;height:48px;width:40px;text-align:center;font-size:18px;font-weight:600;color:var(--privy-color-foreground);transition:all 0.2s ease;}> input:focus{border:1px solid var(--privy-color-foreground);box-shadow:0 0 0 1px var(--privy-color-foreground);}> input:invalid{border:1px solid var(--privy-color-error);}> input.success{border:1px solid var(--privy-color-border-success);background:var(--privy-color-success-bg);}> input.fail{border:1px solid var(--privy-color-border-error);background:var(--privy-color-error-bg);animation:shake 180ms;animation-iteration-count:2;}}@keyframes shake{0%{transform:translate(1px,0px);}33%{transform:translate(-1px,0px);}67%{transform:translate(-1px,0px);}100%{transform:translate(1px,0px);}}"]); 210var j = /* @__PURE__ */ dt.div.withConfig({ displayName: "InputHelp", componentId: "sc-6187bfee-2" })(["line-height:20px;min-height:20px;font-size:14px;font-weight:400;color:", ";display:flex;justify-content:center;width:100%;text-align:center;"], ((e2) => e2.$success ? "var(--privy-color-success-dark)" : e2.$fail ? "var(--privy-color-error-dark)" : "transparent")); 211var L = /* @__PURE__ */ dt.div.withConfig({ displayName: "HelpTextContainer", componentId: "sc-6187bfee-3" })(["display:flex;gap:8px;align-items:center;justify-content:center;width:100%;color:var(--privy-color-foreground-2);"]); 212var M2 = /* @__PURE__ */ dt.div.withConfig({ displayName: "Badge", componentId: "sc-6187bfee-4" })(["display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-sm);padding:2px 8px;gap:4px;background:var(--privy-color-background-2);color:var(--privy-color-foreground-2);"]); 213var R = /* @__PURE__ */ dt.span.withConfig({ displayName: "BoldWrappingSpan", componentId: "sc-6187bfee-5" })(["font-weight:500;word-break:break-all;color:var(--privy-color-foreground);"]); 214export { 215 T as AwaitingPasswordlessCodeScreen, 216 C as AwaitingPasswordlessCodeScreenView, 217 T as default 218}; 219//# sourceMappingURL=AwaitingPasswordlessCodeScreen-Dd7TblcM-YCF6WFEB.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.