PageSourceSearch

https://fieldbook.xyz/assets/reset-password-confirm-Dys1jRdj.js

js fieldbook.xyz collected 2026-09-24 15:15:05 UTC 4,357 bytes, 2 lines download raw bytes

1import{w as o,v as e,x as b,T as x,B as k,S as T}from"./index-D-WC9wNa.js";import{u as v}from"./useConfirmationUrl-BiFXNHhx.js";try{let r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new r.Error().stack;c&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[c]="f78834df-1b26-48ef-b91b-781c8392a7c0",r._sentryDebugIdIdentifier="sentry-dbid-f78834df-1b26-48ef-b91b-781c8392a7c0")}catch{}const p='script[data-fieldbook-turnstile="true"]',S="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit";let m;const j=()=>window.turnstile?Promise.resolve(window.turnstile):(m||(m=new Promise((c,s)=>{const a=document.querySelector(p),i=a??document.createElement("script"),l=()=>{window.turnstile?c(window.turnstile):s(new Error("Cloudflare Turnstile did not initialise"))};i.addEventListener("load",l,{once:!0}),i.addEventListener("error",()=>s(new Error("Turnstile failed to load")),{once:!0}),a?window.turnstile&&l():(i.async=!0,i.defer=!0,i.src=S,i.dataset.fieldbookTurnstile="true",document.head.appendChild(i))}).catch(c=>{var s;throw(s=document.querySelector(p))==null||s.remove(),m=void 0,c})),m),P=({siteKey:r,resetKey:c=0,onTokenChange:s,onError:a})=>{const i=o.useRef(null),l=o.useRef(null),d=o.useRef(s),t=o.useRef(a);return o.useEffect(()=>{d.current=s,t.current=a},[a,s]),o.useEffect(()=>{let f=!0;return d.current(null),j().then(h=>{!f||!i.current||(l.current=h.render(i.current,{sitekey:r,action:"password-reset",callback:n=>d.current(n),"error-callback":()=>{var n;d.current(null),(n=t.current)==null||n.call(t,"Security check failed. Please try again.")},"expired-callback":()=>{var n;d.current(null),(n=t.current)==null||n.call(t,"Security check expired. Please complete it again.")},"timeout-callback":()=>{var n;d.current(null),(n=t.current)==null||n.call(t,"Security check timed out. Please try again.")},"refresh-expired":"auto"}))}).catch(h=>{var n;f&&(d.current(null),(n=t.current)==null||n.call(t,h instanceof Error?h.message:"Unable to load the security check."))}),()=>{f=!1,l.current&&window.turnstile&&(window.turnstile.remove(l.current),l.current=null)}},[c,r]),e.jsx("div",{ref:i})},R=()=>{const r=v({redirectPath:"/auth/reset-password"}),c="0x4AAAAAADlnIWGZ0BquoKFm".trim(),[s,a]=o.useState(null),[i,l]=o.useState(null),[d,t]=o.useState(0),[f,h]=o.use
1State(!1),n=o.useCallback(u=>{a(u),u&&l(null)},[]),w=o.useCallback(async()=>{if(!(!r||!s||f)){h(!0),l(null);try{const{data:u,error:g}=await b.functions.invoke("verify_turnstile",{body:{token:s}});if(g||!(u!=null&&u.success)){l((u==null?void 0:u.error)??"We could not verify the security check. Please try again."),a(null),t(y=>y+1);return}window.location.replace(r)}catch{l("We could not verify the security check. Please try again."),a(null),t(u=>u+1)}finally{h(!1)}}},[r,f,s]);return r?e.jsxs("div",{className:"mt-6 flex flex-col gap-4 pb-6 sm:w-full md:w-1/2 lg:w-1/3",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"mb-2 text-xl font-bold",children:"Verify password reset"}),e.jsx("p",{children:"Complete the security check to continue resetting your password."})]}),!c&&e.jsx("div",{className:"align-right flex rounded-md border bg-orange-200 p-2 text-xs text-orange-800",children:"The security check is not configured. Please request a new link later or contact support."}),c&&e.jsxs(e.Fragment,{children:[e.jsx(P,{siteKey:c,resetKey:d,onTokenChange:n,onError:l}),i&&e.jsx("div",{className:"align-right flex rounded-md border bg-orange-200 p-2 text-xs text-orange-800",children:i}),e.jsx(k,{onClick:w,disabled:!s||f,type:"button",children:f?e.jsx(T,{}):"Continue"})]}),e.jsx(x,{to:"/auth/reset-password-request",className:"w-full",children:"Request a new link"})]}):e.jsxs("div",{className:"mt-6 flex flex-col gap-4 pb-6 sm:w-full md:w-1/2 lg:w-1/3",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"mb-2 text-xl font-bold",children:"Link expired"}),e.jsx("p",{children:"This link is invalid or has expired."})]}),e.jsx("div",{className:"align-right flex rounded-md border bg-orange-200 p-2 text-xs text-orange-800",children:"Password links can only be used once. Please request a new one."}),e.jsx(x,{to:"/auth/reset-password-request",className:"w-full",children:"Request a new link"})]})};export{R as component};
2//# sourceMappingURL=reset-password-confirm-Dys1jRdj.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.