PageSourceSearch

https://www.scientificamerican.com/static/entry/success.BB2pkFp8.js

js scientificamerican.com collected 2026-10-01 07:49:54 UTC 2,619 bytes, 1 lines download raw bytes

1import{j as t,r as a}from"../chunks/vendor-react-DdEP1kCQ.js";import{g as b,y as w,F as v,j as S,S as m,p as T,P as E}from"../chunks/core-DTFOJR-b.js";import"../chunks/sciam-DxVNerXk.js";import"../chunks/vendor-shared-ShLQKC4n.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new s.Error().stack;n&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[n]="001cc7f6-896c-473a-8fc5-e1f642f26168",s._sentryDebugIdIdentifier="sentry-dbid-001cc7f6-896c-473a-8fc5-e1f642f26168")}catch{}})();const I="layout-5sQnt",C={layout:I};function D({children:s}){return t.jsx("div",{className:C.layout,children:t.jsx("main",{children:s})})}const P="content-XpOy8",N="prompt-T7sGN",k="redirectMessage-6N1Zn",d={content:P,prompt:N,redirectMessage:k};function A({action:s,headline:n,description:r,returnTo:i}){const{payload:u,updating:l,update:p,changed:f}=b(),{plan:o}=w(),{countEvent:y}=v(),{consent:g}=S(),h=!!g.analytics,x=s==="welcome"&&!!o,_=o&&u?.subscriptions?.some?.(c=>c.price_id===o?.default_price_id),[e,j]=a.useState();return a.useEffect(()=>{const c="checkout_success_data";j(m.getObject(c)),m.removeItem(c)},[]),a.useEffect(()=>{e&&T({event:"checkoutSuccess",checkout:{planId:e.planId,product:e.product,amountPaidNoTax:e.amountPaidNoTax/100,totalTax:e.totalTax/100,totalDiscount:e.totalDiscount/100}})},[!!e]),a.useEffect(()=>{!e||!h||y("checkout_success",e.planId,!1,{context_plan_id:e.planId,context_product:e.product,context_amount_paid_no_tax:e.amountPaidNoTax/100,context_total_tax:e.totalTax/100,context_total_discount:e.totalDiscount/100})},[!!e,h]),a.useEffect(()=>{f&&setTimeout(()=>{const c=new URL(window.location.href).origin;window.location.href=c+(i.path||"/")},2e3)},[f]),t.jsx("div",{className:d.content,children:t.jsxs("div",{className:d.prompt,children:[t.jsx("h1",{children:n}),t.jsx("hr",{}),!x&&t.jsx("p",{children:r}),x&&(_?t.jsxs("p",{children:["Your ",o.name," subscription is now active."]}):l?t.jsxs("p",{children:["Activating your ",o.name," subscription..."]}):t.jsx("p",{children:t.jsx("strong",{children:"There was an error activating your subscription."})})),t.jsxs("small",{className:d.redirectMessage,children:["You will be redirected shortly. ",t.jsx("br",{}),t.jsx("a",{href:i?.path||"/",children:"Click here if you are not redirected automatically."})]})]})})}function Y({action:s,returnTo:n,planId:r,giftId:i,priceId:u,headline:l,description:p}){return t.jsx(E,{planId:r||i||u,children:t.jsx(D,{action:s,children:t.jsx(A,{action:s,headline:l,description:p,returnTo:n})})})}export{Y as default};

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.