1import{r as o,j as e,L as X}from"./index-BS9BDVSE.js";import"./paypal-billing-help-Bjm1N9Rr.js";const W=new Map,B="data-zship-paypal-sdk-key";function de(t){const a=z(t),n=z(a?.data)||a,r=z(n?.paypal);if(!n||!r||n.provider!==void 0&&n.provider!=="paypal")return null;const i=D(n.checkout_id),c=D(n.provider_order_id),l=D(r.client_id),g=r.environment==="live"||r.environment==="test"?r.environment:"",h=fe(n.checkout_url,g,c),d=D(r.currency).toUpperCase(),v=r.intent==="capture"||r.intent==="subscription"?r.intent:"";return!i||!h||!c||!l||!g||!/^[A-Z]{3}$/.test(d)||!v?null:{checkoutId:i,checkoutUrl:h,providerOrderId:c,clientId:l,environment:g,currency:d,intent:v}}function ue(t){const a=new URL("https://www.paypal.com/sdk/js");return a.searchParams.set("client-id",t.clientId),a.searchParams.set("currency",t.currency),a.searchParams.set("intent",t.intent),t.intent==="subscription"&&a.searchParams.set("vault","true"),a.searchParams.set("components","buttons"),a.searchParams.set("commit","true"),a.toString()}async function pe(t){if(typeof window>"u"||typeof document>"u")throw new Error("PayPal checkout is only available in the browser.");const a=`${t.clientId}:${t.currency}:${t.intent}`,n=W.get(a);if(n)return n;const r=document.querySelector(`script[${B}]`);if(r&&r.getAttribute(B)!==a)throw new Error("A different PayPal merchant configuration is already loaded on this page.");const i=ee();if(i&&r)return i;if(i)throw new Error("PayPal SDK was loaded outside the ZShip payment module.");const c=new Promise((l,g)=>{const h=r||document.createElement("script"),d=()=>{const m=ee();m?l(m):g(new Error("PayPal SDK loaded without the Buttons component."))},v=()=>g(new Error("PayPal SDK failed to load."));h.addEventListener("load",d,{once:!0}),h.addEventListener("error",v,{once:!0}),r||(h.src=ue(t),h.async=!0,h.setAttribute(B,a),h.setAttribute("data-page-type","checkout"),document.head.append(h))}).catch(l=>{throw W.delete(a),l});return W.set(a,c),c}async function he(t,a=fetch){if(me(t.endpoint,"PayPal capture endpoint"),!t.checkoutId||!t.providerOrderId)throw new Error("PayPal payment confirmation identifiers are missing.");const n=await a(t.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({checkout_id:t.checkoutId,paypal_order_id:t.providerOrderId})}),r=await n.json().catch(()=>null);if(!n.ok)throw new Error(typeof r?.message=="string"&&r.message?r.message:"PayPal payment confirmation is still pending.");return r}function ee(){const t=window.paypal;return t?.Buttons?t:null}function fe(t,a,n){try{const r=new URL(D(t));if(r.protocol!=="https:")return"";const i=r.hostname==="sandbox.paypal.com"||r.hostname.endsWith(".sandbox.paypal.com"),c=r.hostname==="paypal.com"||r.hostname.endsWith(".paypal.com");return!a||!n||!c||a==="test"&&!i||a==="live"&&i?"":r.pathname==="/checkoutnow"?r.searchParams.get("token")!==n?"":r.toString():(r.pathname==="/webapps/billing/subscriptions"||r.pathname==="/billing/subscriptions")&&r.searchParams.get("ba_token")?r.toString():""}catch{return""}}function me(t,a){if(!t.startsWith("/")||t.startsWith("//"))throw new Error(`${a} must be a same-origin path.`)}function z(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function D(t){return typeof t=="string"?t.trim():""}function ye({session:t,onApprove:a,onCancel:n,onError:r,className:i,fallbackClassName:c,fallbackLabel:l="Open secure PayPal checkout instead"}){const g=o.useRef(null),h=o.useRef(a),d=o.useRef(n),v=o.useRef(r),[m,f]=o.useState("loading"),[E,j]=o.useState("");h.current=a,d.current=n,v.current=r,o.useEffect(()=>{const b=g.current;if(!b)return;let P=!0,k=null;return b.replaceChildren(),f("loading"),j(""),pe(t).then(async I=>{if(P){if(k=I.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},...t.intent==="subscription"?{createSubscription:()=>t.providerOrderId}:{createOrder:()=>t.providerOrderId},onApprove:async x=>{const u=String(t.intent==="subscription"?x.subscriptionID:x.orderID||"");if(u!==t.providerOrderId){const p=new Error("PayPal approval returned a different order ID.");throw f("error"),j(p.message),v.current?.(p),p}f("approving");try{await h.current({checkoutId:t.checkoutId,providerOrderId:u})}catch(p){const _=K(p,"PayPal payment confirmation failed.");throw P&&(f("error"),j(_.message)),v.current?.(_),_}},onCancel:()=>{P&&f("ready"),d.current?.()},onError:x=>{const u=K(x,"PayPal checkout could not be opened.");P&&(f("error"),j(u.message)),v.current?.(u)}}),k.isEligible&&!k.isEligible()){f("ineligible");return}await k.render(b),P&&f("ready")}}).catch(I=>{const x=K(I,"PayPal checkout could not load.");P&&(f("error"),j(x.message)),v.current?.(x)}),()=>{P=!1,k?.close?.(),b.replaceChildren()}},[t.checkoutId,t.clientId,t.currency,t.environment,t.intent,t.providerOrderId]);const T=m==="error"||m==="ineligible";return e.jsxs("div",{className:i,"data-paypal-environment":t.environment,children:[e.jsx("div",{ref:g,"aria-busy":m==="loading"||m==="approving"}),m==="loading"?e.jsx("p",{role:"status",children:"Loading secure PayPal checkoutâ¦"}):null,m==="approving"?e.jsx("p",{role:"status",children:"PayPal approved. Confirming billing and deliveryâ¦"}):null,E?e.jsxs("p",{role:"alert",children:[E," No second order will be created."]}):null,e.jsx("a",{className:c,"data-prominent":T?"true":"false",href:t.checkoutUrl,children:T?"Continue with secure PayPal checkout":l})]})}function K(t,a){return t instanceof Error&&t.message?t:new Error(a)}const ge=he;function ve(t){if(be(t.pathname,"PayPal return path"),!t.reportId||!t.session.checkoutId||!t.session.providerOrderId)throw new Error("PayPal return identifiers are missing.");const a=new URLSearchParams({provider:"paypal",report_id:t.reportId,checkout_id:t.session.checkoutId,token:t.session.providerOrderId,payment:"success"});return`${t.pathname}?${a.toString()}`}function be(t,a){if(!t.startsWith("/")||t.startsWith("//"))throw new Error(`${a} must be a same-origin path.`)}const xe=800,we="zship_purchase_tracked:",ne=new Set;function J(){return globalThis.window}function je(){const t=J()?.gtag;return typeof t=="function"?t:void 0}function re(t,a,n){const r=n?.onSent;try{const i=je();if(typeof i!="function")return!1;if(typeof r!="function")return i("event",t,a),!0;const c=typeof n?.timeoutMs=="number"&&Number.isFinite(n.timeoutMs)&&n.timeoutMs>=0?n.timeoutMs:xe;let l=!1;const g=()=>{if(!l){l=!0;try{r()}catch{}}},h=setTimeout(g,c);return i("event",t,{...a,event_callback:()=>{clearTimeout(h),g()}}),!0}catch{return!1}}function Ke(t,a){if(!t)return!1;const n=`${we}${t}`;return ke(n)?!0:re("purchase",a)?(Pe(n),!0):!1}function ke(t){try{if(J()?.sessionStorage?.getItem(t)==="1")return!0}catch{}return ne.has(t)}function Pe(t){ne.add(t);try{J()?.sessionStorage?.setItem(t,"1")}catch{}}function _e({idPrefix:t,onFileChange:a}){const[n,r]=o.useState(!1),[i,c]=o.useState(null),[l,g]=o.useState(""),[h,d]=o.use
1State(""),[v,m]=o.useState(!1),f=o.useRef(null),E=o.useRef(null),j=o.useRef(null);o.useEffect(()=>{const u=()=>te(E,f);return window.addEventListener("pagehide",u),()=>{window.removeEventListener("pagehide",u),u()}},[]),o.useEffect(()=>()=>{l&&URL.revokeObjectURL(l)},[l]);async function T(){if(!navigator.mediaDevices?.getUserMedia){d("Live camera is not supported here. Choose a photo instead."),j.current?.click();return}m(!0),d("");try{const u=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user",width:{ideal:1280},height:{ideal:1280}},audio:!1});E.current=u,f.current&&(f.current.srcObject=u,await f.current.play()),r(!0)}catch{d("Camera access was unavailable. You can choose a photo or continue without one.")}finally{m(!1)}}async function b(){const u=f.current;if(!u||u.videoWidth===0||u.videoHeight===0){d("The camera is still starting. Try capture again.");return}m(!0);try{const p=document.createElement("canvas"),_=Math.min(1,1280/Math.max(u.videoWidth,u.videoHeight));p.width=Math.max(1,Math.round(u.videoWidth*_)),p.height=Math.max(1,Math.round(u.videoHeight*_));const O=p.getContext("2d");if(!O)throw new Error("Camera capture is unavailable.");O.drawImage(u,0,0,p.width,p.height);const R=await Y(p,.82);await k(new File([R],"selfie.jpg",{type:"image/jpeg"})),x()}catch(p){d(p instanceof Error?p.message:"The photo could not be prepared.")}finally{m(!1)}}async function P(u){if(u){m(!0),d("");try{await k(u)}catch(p){d(p instanceof Error?p.message:"The photo could not be prepared.")}finally{m(!1),j.current&&(j.current.value="")}}}async function k(u){const p=await Ne(u);l&&URL.revokeObjectURL(l);const _=URL.createObjectURL(p);g(_),c(p),a(p),d("Photo prepared in this browser. It will be uploaded only when you submit.")}function I(){l&&URL.revokeObjectURL(l),g(""),c(null),a(null),d("Photo removed. You can continue without one.")}function x(){te(E,f),r(!1)}return e.jsxs("div",{className:"selfie-control",children:[e.jsxs("div",{className:"selfie-actions",children:[e.jsx("button",{className:"btn btn-secondary",type:"button",onClick:T,disabled:v,children:v?"Preparingâ¦":i?"Retake selfie":"Take a selfie"}),e.jsx("button",{className:"btn btn-quiet",type:"button",onClick:()=>j.current?.click(),disabled:v,children:"Choose a photo"}),e.jsx("input",{ref:j,id:`${t}-photo`,className:"file-input",type:"file",accept:"image/jpeg,image/png,image/webp",capture:"user",onChange:u=>P(u.currentTarget.files?.[0]||null)})]}),e.jsxs("div",{className:"camera-panel",hidden:!n,children:[e.jsx("video",{ref:f,muted:!0,playsInline:!0,"aria-label":"Live front camera preview"}),e.jsxs("div",{className:"camera-panel-actions",children:[e.jsx("button",{className:"btn btn-primary",type:"button",onClick:b,disabled:v,children:"Capture"}),e.jsx("button",{className:"btn btn-quiet",type:"button",onClick:x,children:"Cancel camera"})]})]}),i&&l?e.jsxs("div",{className:"attachment selfie-preview",children:[e.jsx("img",{src:l,alt:"Prepared selfie preview"}),e.jsxs("span",{className:"attachment-name",children:["Prepared selfie · ",Se(i.size)]}),e.jsx("button",{className:"remove-file",type:"button",onClick:I,"aria-label":"Remove selfie",children:"Ã"})]}):null,e.jsx("p",{className:"field-help selfie-message",role:"status","aria-live":"polite",children:h})]})}async function Ne(t){if(!["image/jpeg","image/png","image/webp"].includes(t.type))throw new Error("Choose a JPEG, PNG, or WebP image.");if(t.size>8e6)throw new Error("Choose an image smaller than 8 MB.");const a=await Ce(t);try{const r=Math.min(1,1280/Math.max(a.width,a.height)),i=document.createElement("canvas");i.width=Math.max(1,Math.round(a.width*r)),i.height=Math.max(1,Math.round(a.height*r));const c=i.getContext("2d");if(!c)throw new Error("Image processing is unavailable in this browser.");c.drawImage(a.image,0,0,i.width,i.height);let l=await Y(i,.82);if(l.size>18e5&&(l=await Y(i,.66)),l.size>18e5)throw new Error("The processed photo is still too large. Choose a smaller image.");return new File([l],"selfie.jpg",{type:"image/jpeg",lastModified:Date.now()})}finally{a.close()}}async function Ce(t){if("createImageBitmap"in window)try{const r=await createImageBitmap(t,{imageOrientation:"from-image"});return{image:r,width:r.width,height:r.height,close:()=>r.close()}}catch{}const a=URL.createObjectURL(t),n=new Image;
1try{return await new Promise((r,i)=>{n.onload=()=>r(),n.onerror=()=>i(new Error("The image could not be opened.")),n.src=a}),{image:n,width:n.naturalWidth,height:n.naturalHeight,close:()=>URL.revokeObjectURL(a)}}catch(r){throw URL.revokeObjectURL(a),r}}function Y(t,a){return new Promise((n,r)=>{t.toBlob(i=>i?n(i):r(new Error("The photo could not be compressed.")),"image/jpeg",a)})}function te(t,a){t.current?.getTracks().forEach(n=>n.stop()),t.current=null,a.current&&(a.current.srcObject=null)}function Se(t){return t<1e6?`${Math.round(t/1e3)} KB`:`${(t/1e6).toFixed(1)} MB`}const Ee={notConfigured:"Security verification is enabled but not configured.",expired:"Verification expired. Please try again.",failed:"Verification failed. Please try again.",loadError:"Security verification could not load. Please refresh and try again.",retry:"Try again"};let q=null;function Ie(){return typeof window<"u"&&window.turnstile?Promise.resolve(window.turnstile):q||(q=new Promise((t,a)=>{const n=document.querySelector('script[data-zship-turnstile="true"]');if(n){n.addEventListener("load",()=>ae(t,a,n),{once:!0}),n.addEventListener("error",()=>H(a,n),{once:!0});return}const r=document.createElement("script");r.src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",r.defer=!0,r.async=!0,r.dataset.zshipTurnstile="true",r.onload=()=>ae(t,a,r),r.onerror=()=>H(a,r),document.head.appendChild(r)}),q)}function ae(t,a,n){const r=typeof window<"u"?window.turnstile:void 0;r?t(r):H(a,n)}function H(t,a){a.remove(),q=null,t(new Error("Turnstile script failed to load."))}function Re(t){const{container:a,callbacks:n}=t;let r=!1,i=null;function c(){if(typeof window<"u"&&window.turnstile&&i!==null)try{window.turnstile.remove(i)}catch{}i=null}return{async run(){if(!(typeof window>"u"))try{const l=await Ie();if(r||i!==null)return;i=l.render(a,{sitekey:t.siteKey,action:t.action,theme:t.theme,size:"flexible",callback:g=>{n.onToken(typeof g=="string"?g:"")},"expired-callback":()=>{n.onExpired()},"error-callback":()=>{n.onChallengeError()}}),i!==null&&n.onRendered()}catch(l){if(r)return;throw c(),l}},cancel(){r=!0,c()},reset(){if(!(typeof window>"u"||!window.turnstile||i===null))try{window.turnstile.reset(i)}catch{i=null}}}}const se=o.forwardRef(({siteKey:t,token:a,onTokenChange:n,required:r=!0,configured:i=!0,action:c="ai_provider_generate",theme:l="auto",resetSignal:g,retryable:h=!1,className:d,header:v,containerClassName:m,messageClassName:f,retryClassName:E,copy:j},T)=>{const b={...Ee,...j},P=o.useRef(null),k=o.useRef(null),[I,x]=o.useState(""),[u,p]=o.useState(!1),[_,O]=o.useState(0);function R(){n(""),x(""),p(!1),k.current?.reset()}o.useImperativeHandle(T,()=>({reset:R}));const w=r&&i&&!!t;return o.useEffect(()=>{const M=P.current;if(!w||!M||typeof window>"u"){k.current?.cancel(),k.current=null,n("");return}let F=!1;const L=Re({siteKey:t,action:c,theme:l,container:M,callbacks:{onToken:$=>{p(!1),x(""),n($)},onExpired:()=>{n(""),!h&&x(b.expired)},onChallengeError:()=>{n(""),p(!0),h||x(b.failed)},onRendered:()=>{p(!1)}}});return k.current=L,n(""),x(""),L.run().catch(()=>{F||(n(""),p(!0),h||x(b.loadError))}),()=>{F=!0,L.cancel(),k.current===L&&(k.current=null)}},[w,t,c,l,g,_,h,n]),r?e.jsxs("div",{className:d,children:[v,w?e.jsx("div",{ref:P,className:m}):e.jsx("p",{className:f,children:b.notConfigured}),h?u?e.jsxs("p",{role:"alert",className:f,children:[b.loadError," ",e.jsx("button",{type:"button",className:E,onClick:()=>{p(!1),O(M=>M+1)},children:b.retry})]}):null:I&&i&&!a?e.jsx("p",{className:f,children:I}):null]}):null});se.displayName="TurnstileGate";const Te={loaded:!1,required:!1,configured:!1,siteKey:""};function Oe(t){const a=t||{},n=a.required;return{required:typeof n=="boolean"?n:a.enabled===!0,configured:a.configured===!0,siteKey:typeof a.site_key=="string"?a.site_key:""}}function Me(t){return{loaded:!0,required:t??!1,configured:!1,siteKey:""}}function Le(t,a){const[n,r]=o.useState(Te);return o.useEffect(()=>{let i=!1;return fetch(t,{headers:{Accept:"application/json"}}).then(async c=>{const l=await c.json().catch(()=>null);if(!c.ok)throw new Error("security config unavailable");return l}).then(c=>{if(i)return;const l=c?.data||c||{};r({loaded:!0,...Oe(l)})}).catch(()=>{i||r(Me(a?.requiredOnError))}),()=>{i=!0}},[t]),n}const Ue="/api/debloat-face/security-config";function Ae(){return Le(Ue,{requiredOnError:!0})}const ie=o.forwardRef((t,a)=>e.jsx(se,{ref:a,...t,className:"turnstile-gate",header:e.jsxs("div",{children:[e.jsx("strong",{children:"Security verification"}),e.jsx("span",{children:"Complete the check before sending the optional selfie for AI analysis."})]}),messageClassName:"field-help",copy:{notConfigured:"Security verification is enabled but not configured. Continue without the selfie or try again later.",loadError:"Security verification could not load. Continue without the selfie or refresh the page."}}));
1ie.displayName="TurnstileGate";const De={age_confirmed:!1,safety_status:"",goal:"",event_date:"",effort_minutes:"",noticed:"",pattern:"",perceived_focus:"",contexts:[],sleep:"",hydration:"",late_meals:"",alcohol:"",salty_meals:"",morning_minutes:"",evening_minutes:"",has_cool_compress:"",ordinary_meals_available:"",sensitivities:"",avoid_steps:""},U=["Safety & goal","Pattern & context","Recent routine","Practical fit"];function Ge(){const[t,a]=o.useState(0),[n,r]=o.useState(De),[i,c]=o.useState(null),[l,g]=o.useState(!1),[h,d]=o.useState(""),[v,m]=o.useState(!1),[f,E]=o.useState(""),[j,T]=o.useState(null),b=Ae(),[P,k]=o.useState(""),I=o.useRef(null),x=o.useRef(null),u=o.useRef(t),p=o.useRef(null);o.useEffect(()=>{const s=new URLSearchParams(window.location.search);s.get("payment")==="cancelled"&&(E(s.get("report_id")||""),d("Payment was cancelled. Nothing was charged, and your saved draft can be reopened from this browser."))},[]),o.useEffect(()=>{if(u.current===t)return;u.current=t;const s=window.requestAnimationFrame(()=>{const y=window.matchMedia("(prefers-reduced-motion: reduce)").matches;I.current?.scrollIntoView({behavior:y?"auto":"smooth",block:"start"}),x.current?.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(s)},[t]);const _=n.safety_status==="stop"||n.safety_status==="uncertain",O=(t+1)/U.length*100,R=o.useMemo(()=>Fe(t,n,i,l,b,P),[t,n,i,l,b,P]);function w(s,y){r(N=>({...N,[s]:y})),d("")}function M(s){r(y=>({...y,contexts:y.contexts.includes(s)?y.contexts.filter(N=>N!==s):[...y.contexts,s]}))}function F(s){c(s),s||g(!1),k(""),p.current?.reset()}function L(){if(R){d(R);return}a(s=>Math.min(U.length-1,s+1))}function $(){a(s=>Math.max(0,s-1))}async function oe(s){if(s.preventDefault(),R){d(R);return}m(!0),d("Saving your private report draftâ¦");try{const y={...n,age_confirmed:!0,effort_minutes:Number(n.effort_minutes),morning_minutes:Number(n.morning_minutes),evening_minutes:Number(n.evening_minutes),has_cool_compress:n.has_cool_compress==="yes",ordinary_meals_available:n.ordinary_meals_available==="yes"},N=new FormData;N.set("intake",JSON.stringify(y)),i&&N.set("selfie",i,"selfie.jpg"),i&&b.required&&N.set("turnstile_token",P);const A=await fetch("/api/debloat-face/report-drafts",{method:"POST",body:N}),S=await A.json().catch(()=>null);if(!A.ok||!S?.report_id||!S?.access_token)throw new Error(S?.message||"The report draft could not be created.");$e(S.report_id,S.access_token),d(S.photo_warning||"Opening secure checkoutâ¦");const V=await fetch("/api/debloat-face/report-checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({report_id:S.report_id,access_token:S.access_token})}),Q=await V.json().catch(()=>null);if(!V.ok)throw new Error(Q?.message||"Secure checkout is temporarily unavailable.");Z(Q,S.report_id)}catch(y){d(y instanceof Error?y.message:"The report checkout could not be started."),i&&b.required&&p.current?.reset(),m(!1)}}async function le(){const s=We(f);if(!f||!s){d("This browser no longer has the saved private draft. Complete the questionnaire again.");return}m(!0);try{const y=await fetch("/api/debloat-face/report-checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({report_id:f,access_token:s})}),N=await y.json().catch(()=>null);if(!y.ok)throw new Error(N?.message||"Checkout could not be reopened.");Z(N,f)}catch(y){d(y instanceof Error?y.message:"Checkout could not be reopened."),m(!1)}}function Z(s,y){re("begin_checkout",{report_id:y,currency:"USD",value:9.99,items:[{item_id:"personalized_7_day_plan",item_name:"Personalized 7-Day Plan",quantity:1}]});const N=de(s);if(N){T({reportId:y,session:N}),E(""),d("Your private draft is saved. Complete the one-time payment with PayPal."),m(!1);return}const A=s&&typeof s=="object"?s:null,S=A?.checkout_url||A?.data?.checkout_url;if(!S)throw new Error("Secure checkout did not return a usable payment method.");window.location.assign(S)}async function ce(s){if(!j)throw new Error("PayPal checkout state is missing.");d("Payment approved. Confirming payment and report deliveryâ¦"),await ge({endpoint:"/api/debloat-face/report-capture",checkoutId:s.checkoutId,providerOrderId:s.providerOrderId}),window.location.assign(ve({pathname:"/report-return",reportId:j.reportId,session:j.session}))}return j?e.jsx("main",{className:"paid-page",id:"content",children:e.jsxs("div",{className:"paid-shell paid-paypal-shell",children:[e.jsxs("div",{className:"paid-topbar",children:[e.jsx(X,{className:"back-link",to:"/",children:"â Back to the free plan"}),e.jsx("span",{className:"paid-price",children:"$9.99 one-time · no subscription"})]}),e.jsxs("header",{className:"paid-header paid-paypal-header",children:[e.jsx("p",{className:"eyebrow",children:"Secure checkout"}),e.jsx("h1",{children:"Complete your personalized 7-day plan."}),e.jsx("p",{className:"lead",children:"Your private draft is saved. PayPal approves the one-time $9.99 payment here; ZShip confirms payment and queues delivery before opening the report."})]}),e.jsxs("section",{className:"paid-paypal-card","aria-labelledby":"paypal-checkout-heading",children:[e.jsx("h2",{id:"paypal-checkout-heading",children:"Pay securely with PayPal"}),e.jsx("p",{children:"No account or subscription. Your PayPal email is used only for the receipt and private report delivery."}),e.jsx(ye,{className:"paid-paypal-checkout",fallbackClassName:"paid-paypal-fallback",session:j.session,onApprove:ce,onCancel:()=>d("PayPal checkout was closed. Nothing was charged; you can try again below."),onError:s=>d(s.message)}),h?e.jsx("p",{className:"paid-paypal-message",role:"status","aria-live":"polite",children:h}):null]})]})}):e.jsx("main",{className:"paid-page",id:"content",children:e.jsxs("div",{className:"paid-shell",children:[e.jsxs("div",{className:"paid-topbar",children:[e.jsx(X,{className:"back-link",to:"/",children:"â Back to the free plan"}),e.jsx("span",{className:"paid-price",children:"$9.99 one-time"})]}),e.jsxs("header",{className:"paid-header",children:[e.jsx("p",{className:"eyebrow",children:"AI-Personalized 7-Day Plan"}),e.jsx("h1",{children:"A practical week, shaped around your answers."}),e.jsx("p",{className:"lead",children:"Complete four short sections so AI can shape the week around your timing and routine. Payment c
1omes last, after the safety check and full questionnaire. No account or subscription."})]}),e.jsxs("section",{className:"paid-value","aria-labelledby":"paid-value-heading",children:[e.jsxs("div",{className:"paid-value-intro",children:[e.jsx("h2",{id:"paid-value-heading",children:"How AI shapes the plan"}),e.jsx("p",{children:"AI combines your questionnaire and optional selfie analysis within an approved wellness framework."})]}),e.jsxs("ul",{className:"paid-value-list",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Daily priorities"}),e.jsx("span",{children:"Morning and evening actions matched to your timing and available minutes."})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Personalized adjustments"}),e.jsx("span",{children:"What to change when sleep, meals, hydration, or your schedule varies."})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"A report you can keep"}),e.jsx("span",{children:"Private Web access for 30 days, plus PDF download and email delivery."})]})]}),e.jsx("p",{className:"paid-ai-boundary",children:"AI organizes approved wellness guidance. It does not diagnose causes or score your appearance."})]}),f?e.jsxs("div",{className:"paid-notice",role:"status",children:[e.jsx("strong",{children:"Payment cancelled"}),e.jsx("p",{children:"Nothing was charged. You can reopen the saved checkout or start a fresh questionnaire."}),e.jsx("button",{className:"btn btn-secondary",type:"button",onClick:le,disabled:v,children:"Reopen checkout"})]}):null,e.jsxs("div",{ref:I,className:"paid-progress","aria-label":`Questionnaire step ${t+1} of ${U.length}`,children:[e.jsxs("div",{className:"paid-progress-copy",children:[e.jsxs("span",{children:["Step ",t+1," of ",U.length]}),e.jsx("strong",{children:U[t]})]}),e.jsx("div",{className:"paid-progress-track",children:e.jsx("span",{style:{width:`${O}%`}})})]}),e.jsxs("form",{className:"paid-form",onSubmit:oe,noValidate:!0,children:[t===0?e.jsxs("section",{className:"paid-step","aria-labelledby":"paid-step-1",children:[e.jsxs("div",{className:"paid-step-heading",children:[e.jsx("p",{className:"meta",children:"Eligibility and safety"}),e.jsx("h2",{ref:x,tabIndex:-1,id:"paid-step-1",children:"First, make sure this ordinary wellness plan fits."})]}),e.jsxs("label",{className:"paid-check",children:[e.jsx("input",{type:"checkbox",checked:n.age_confirmed,onChange:s=>w("age_confirmed",s.target.checked)}),e.jsx("span",{children:"I confirm that I am 18 or older."})]}),e.jsx(C,{label:"Which safety choice fits?",name:"safety",value:n.safety_status,onChange:s=>w("safety_status",s),options:[["clear","Mild or temporary"],["uncertain","Not sure"],["stop","Sudden, severe, painful, or rapidly worse"]]}),_?e.jsx(qe,{}):null,_?null:e.jsxs(e.Fragment,{children:[e.jsx(C,{label:"What is your main timing goal?",name:"goal",value:n.goal,onChange:s=>w("goal",s),options:[["now","Right now"],["tonight","Tonight"],["event","An event or date"],["seven_days","The next 7 days"]]}),n.goal==="event"?e.jsxs("label",{className:"paid-field",children:[e.jsx("span",{children:"Event date"}),e.jsx("input",{type:"date",value:n.event_date,onChange:s=>w("event_date",s.target.value)})]}):null,e.jsx(C,{label:"How much time can one routine take?",name:"effort",value:n.effort_minutes,onChange:s=>w("effort_minutes",s),options:[["5","5 minutes"],["10","10 minutes"],["15","15 minutes"]]})]})]}):null,t===1?e.jsxs("section",{className:"paid-step","aria-labelledby":"paid-step-2",children:[e.jsxs("div",{className:"paid-step-heading",children:[e.jsx("p",{className:"meta",children:"Pattern and context"}),e.jsx("h2",{ref:x,tabIndex:-1,id:"paid-step-2",children:"Describe what you have noticed, without guessing a diagnosis."})]}),e.jsx(C,{label:"When did you first notice it?",name:"noticed",value:n.noticed,onChange:s=>w("noticed",s),options:[["today","Today"],["two_to_seven_days","2 to 7 days ago"],["longer","Longer"],["not_sure","Not sure"]]}),e.jsx(C,{label:"When is it most noticeable?",name:"pattern",value:n.pattern,onChange:s=>w("pattern",s),options:[["morning","Morning"],["later","Later in the day"],["all_day","All day"],["variable","It varies"],["not_sure","Not sure"]]}),e.jsx(C,{label:"Where do you notice it most?",name:"focus",value:n.perceived_focus,onChange:s=>w("perceived_focus",s),options:[["under_eyes","Under eyes"],["cheeks","Cheeks"],["jawline","Jawline"],["general","General"],["unknown","Not sure"]]}),e.jsxs("fieldset",{className:"paid-group",children:[e.jsx("legend",{children:"Which recent contexts may be relevant?"}),e.jsx("p",{className:"field-help",children:"Choose any that fit. These are possibilities, not causes."}),e.jsx("div",{className:"paid-options paid-options-wrap",children:[["poor_sleep","Poor sleep"],["salty_food","Salty food"],["alcohol","Alcohol"],["late_eating","Late eating"],["travel","Travel"],["period","Period"],["known_mild_allergies","Known mild allergies"],["not_sure","Not sure what changed"]].map(([s,y])=>e.jsxs("label",{className:"paid-option",children:[e.jsx("input",{type:"checkbox",checked:n.contexts.includes(s),onChange:()=>M(s)}),e.jsx("span",{children:y})]},s))})]})]}):null,t===2?e.jsxs("section",{className:"paid-step","aria-labelledby":"paid-step-3",children:[e.jsxs("div",{className:"paid-step-heading",children:[e.jsx("p",{className:"meta",children:"Three-day snapshot"}),e.jsx("h2",{ref:x,tabIndex:-1,id:"paid-step-3",children:"Use broad ranges, not a detailed health diary."})]}),e.jsx(C,{label:"Sleep compared with usual",name:"sleep",value:n.sleep,onChange:s=>w("sleep",s),options:[["less","Less"],["usual","About usual"],["more","More"],["not_sure","Not sure"]]}),e.jsx(C,{label:"Drinking compared with usual",name:"hydration",value:n.hydration,onChange:s=>w("hydration",s),options:[["less","Less"],["usual","About usual"],["more","More"],["not_sure","Not sure"]]}),e.jsx(G,{label:"Late meals in the last 3 days",name:"late-meals",value:n.late_meals,onChange:s=>w("late_meals",s)}),e.jsx(G,{label:"Alcohol in the last 3 days",name:"alcohol-snapshot",value:n.alcohol,onChange:s=>w("alcohol",s)}),e.jsx(G,{label:"Salty meals in the last 3 days",name:"salty-meals",value:n.salty_meals,onChange:s=>w("salty_meals",s)})]}):null,t===3?e.jsxs("section",{className:"paid-step","aria-labelledby":"paid-step-4",children:[e.jsxs("div",{className:"paid-step-heading",children:[e.jsx("p",{className:"meta",children:"Practical fit"}),e.jsx("h2",{ref:x,tabIndex:-1,id:"paid-step-4",children:"Make the plan realistic for your mornings and evenings."})]}),e.jsx(C,{label:"Morning time available",name:"morning",value:n.morning_minutes,onChange:s=>w("morning_minutes",s),options:[["0","None"],["5","5 minutes"],["10","10 minutes"],["15","15 minutes"]]}),e.jsx(C,{label:"Evening time available",name:"evening",value:n.evening_minutes,onChange:s=>w("evening_minutes",s),options:[["0","None"],["5","5 minutes"],["10","10 minutes"],["15","15 minutes"]]}),e.jsx(C,{label:"Do you have a clean, cool compress?",name:"compress",value:n.has_cool_compress,onChange:s=>w("has_cool_compress",s),options:[["yes","Yes"],["no","No"]]}),e.jsx(C,{label:"Are ordinary, familiar meals available?",name:"meals",value:n.ordinary_meals_available,onChange:s=>w("ordinary_meals_available",s),options:[["yes","Yes"],["no","No"]]}),e.jsxs("div",{className:"paid-fields-two",children:[e.jsxs("label",{className:"paid-field",children:[e.jsxs("span",{children:["Known personal sensitivities ",e.jsx("small",{children:"Optional"})]}),e.jsx("textarea",{maxLength:180,value:n.sensitivities,onChange:s=>w("sensitivities",s.target.value),placeholder:"For example, cool
1compresses feel uncomfortable"})]}),e.jsxs("label",{className:"paid-field",children:[e.jsxs("span",{children:["Steps you will not follow ",e.jsx("small",{children:"Optional"})]}),e.jsx("textarea",{maxLength:180,value:n.avoid_steps,onChange:s=>w("avoid_steps",s.target.value),placeholder:"For example, no morning routine"})]})]}),e.jsxs("div",{className:"paid-photo-block",children:[e.jsxs("div",{children:[e.jsx("h3",{children:"Optional selfie"}),e.jsx("p",{children:"Use it only for a limited visible-focus note. It cannot identify a cause. The processed image is deleted after AI analysis."})]}),e.jsx(_e,{idPrefix:"paid",onFileChange:F}),i?e.jsxs("label",{className:"paid-check",children:[e.jsx("input",{type:"checkbox",checked:l,onChange:s=>g(s.target.checked)}),e.jsx("span",{children:"I consent to secure temporary storage and AI analysis for this report. The processed image is deleted after analysis and is not placed in the report or PDF."})]}):null,i&&!b.loaded?e.jsx("div",{className:"turnstile-gate",children:e.jsxs("div",{children:[e.jsx("strong",{children:"Security verification"}),e.jsx("span",{children:"Loading verificationâ¦"})]})}):null,i&&b.loaded?e.jsx(ie,{ref:p,required:b.required,configured:b.configured,siteKey:b.siteKey,token:P,onTokenChange:k}):null]}),e.jsxs("div",{className:"checkout-summary",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Personalized 7-Day Plan"}),e.jsx("span",{children:"Private Web report · PDF · email delivery · 30-day access"})]}),e.jsx("strong",{children:"$9.99 USD"})]}),e.jsx("p",{className:"checkout-retention",children:"Private online access lasts 30 days. Downloaded PDFs are yours to keep."}),e.jsx("p",{className:"field-help",children:"PayPal provides the verified payer email for delivery of the private report link and PDF. Payment is one-time, with no account, credits, or subscription on Debloat Face."})]}):null,e.jsx("p",{className:"paid-message",role:h&&R?"alert":"status","aria-live":"polite",children:h}),e.jsxs("div",{className:"paid-form-actions",children:[t>0?e.jsx("button",{className:"btn btn-quiet",type:"button",onClick:$,disabled:v,children:"Back"}):e.jsx("span",{}),t<U.length-1?e.jsx("button",{className:"btn btn-primary",type:"button",onClick:L,disabled:v||_,children:"Continue"}):e.jsx("button",{className:"btn btn-primary",type:"submit",disabled:v,children:v?"Preparing secure checkoutâ¦":"Continue to secure payment"})]})]})]})})}function C({label:t,name:a,value:n,options:r,onChange:i}){return e.jsxs("fieldset",{className:"paid-group",children:[e.jsx("legend",{children:t}),e.jsx("div",{className:"paid-options",children:r.map(([c,l])=>e.jsxs("label",{className:"paid-option",children:[e.jsx("input",{type:"radio",name:a,value:c,checked:n===c,onChange:()=>i(c)}),e.jsx("span",{children:l})]},c))})]})}function G({label:t,name:a,value:n,onChange:r}){return e.jsx(C,{label:t,name:a,value:n,onChange:r,options:[["none","None"],["once","Once"],["multiple","More than once"],["not_sure","Not sure"]]})}function qe(){return e.jsxs("div",{className:"paid-safety-stop",role:"alert",children:[e.jsx("strong",{children:"Do not continue to payment."}),e.jsx("p",{children:"This product is only for mild, temporary puffiness. Seek appropriate professional or emergency care for sudden, severe, painful, rapidly worsening, or uncertain swelling, especially with breathing or swallowing trouble, fever, hives, injury, or significant redness."})]})}function Fe(t,a,n,r,i,c){if(t===0){if(!a.age_confirmed)return"Confirm that you are 18 or older.";if(!a.safety_status)return"Choose the safety option that fits.";if(a.safety_status!=="clear")return"This safety choice cannot continue to an ordinary wellness plan or payment.";if(!a.goal)return"Choose your timing goal.";if(a.goal==="event"&&!a.event_date)return"Choose the event date.";if(!a.effort_minutes)return"Choose the time available for one routine."}if(t===1&&(!a.noticed||!a.pattern||!a.perceived_focus))return"Complete the timing and focus choices.";if(t===2&&(!a.sleep||!a.hydration||!a.late_meals||!a.alcohol||!a.salty_meals))return"Complete each three-day snapshot choice.";if(t===3){if(!a.morning_minutes||!a.evening_minutes||!a.has_cool_compress||!a.ordinary_meals_available)return"Complete each practical-fit choice.";if(n&&!r)return"Confirm temporary selfie processing or remove the selfie.";if(n&&!i.loaded)return"Security verification is still loading. Try again in a moment or continue without the selfie.";if(n&&i.required&&!i.configured)return"Security verification is unavailable. Continue without the selfie or try again later.";if(n&&i.required&&!c)return"Complete the security verification or continue without the selfie."}return""}function $e(t,a){try{localStorage.setItem(`debloat-report:${t}`,a),sessionStorage.setItem(`debloat-report:${t}`,a)}catch{}}function We(t){try{return sessionStorage.getItem(`debloat-report:${t}`)||localStorage.getItem(`debloat-report:${t}`)||""}catch{return""}}export{Ge as P,ge as c,We as r,Ke as t};
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.