1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5237],{96446:function(e,t,n){n.d(t,{Z:function(){return d}});var r=n(85893),i=n(67294),s=n(95574),a=n(12073),o=n(47212),c=n(68935),l=n.n(c);function d(e){let{amount:t,complete:n,change:c,label:d="One-time donation",buttonLabel:u,renewal:m,email:p,collectAddress:h=!0}=e,y=(0,s.B3)(),[b,f]=(0,i.useState)(null),[v,j]=(0,i.useState)(!1),[g,x]=(0,i.useState)(!1),S=(0,i.useRef)(!1);async function J(e){if("success"===y.type&&!S.current){S.current=!0,j(!0),f(null);try{let t=await y.checkout.confirm({redirect:"if_required",...e?{expressCheckoutConfirmEvent:e}:{}});"error"===t.type?f(t.error.message||"Please check your payment details and try again."):n()}catch(e){f("Your payment could not be confirmed. Check your connection and try again. Retrying this checkout will not submit a second payment.")}finally{S.current=!1,j(!1)}}}return"loading"===y.type?(0,r.jsx)("p",{className:l().loading,role:"status",children:"Loading secure payment optionsâ¦"}):"error"===y.type?(0,r.jsxs)("div",{role:"alert",children:[(0,r.jsx)("p",{children:"Payment options could not be loaded. Please try again."}),(0,r.jsx)("button",{className:l().textButton,onClick:c,children:"Return to selection"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:l().summary,children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{children:d}),(0,r.jsxs)("strong",{children:[(0,a.YC)(t)," ",(0,r.jsx)("small",{children:"USD"})]})]}),(0,r.jsx)("button",{type:"button",className:l().textButton,disabled:v,onClick:c,children:m?"Change plan":"Change amount"})]}),(0,r.jsxs)("div",{className:l().wallets,children:[(0,r.jsx)(s.IM,{options:{layout:{maxColumns:1,maxRows:0,overflow:"never"},buttonHeight:48,buttonTheme:void 0,buttonType:void 0,paymentMethodOrder:void 0,paymentMethods:void 0},onReady:e=>{let{availablePaymentMethods:t}=e;return x(!!(t&&Object.values(t).some(Boolean)))},onConfirm:J}),g&&(0,r.jsx)("div",{className:l().divider,children:"or pay with your details"})]}),(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),J()},children:[(0,r.jsx)("div",{className:l().paymentSection,children:p?(0,r.jsxs)("p",{className:l().small,children:["Membership account: ",p]}):(0,r.jsx)(s.eg,{})}),h&&(0,r.jsx)("div",{className:l().paymentSection,children:(0,r.jsx)(s.R7,{})}),(0,r.jsx)("div",{className:l().paymentSection,children:(0,r.jsx)(s.Hn,{options:{layout:"accordion"}})}),m&&(0,r.jsxs)("p",{className:l().renewal,children:[m," ",(0,r.jsx)("a",{href:"/tos",target:"_blank",rel:"noreferrer",children:"Terms"})]}),b&&(0,r.jsx)("p",{className:l().error,role:"alert",children:b}),(0,r.jsxs)("button",{type:"submit",className:l().primary,disabled:v,children:[v?"Confirming paymentâ¦":u||"Donate ".concat((0,a.YC)(t))," ",!v&&(0,r.jsx)(o.ol,{size:18})]}),(0,r.jsxs)("p",{className:l().secure,children:[(0,r.jsx)(o.di,{size:16})," Secure payment processed by Stripe"]})]})]})}},45237:function(e,t,n){n.r(t),n.d(t,{default:function(){return p}});var r=n(85893),i=n(67294),s=n(2859),a=n(95574),o=n(171),c=n(89332),l=n(12073),d=n(96446),u=n(68935),m=n.n(u);function p(e){let{publishableKey:t,email:n,userId:u,initialTier:p,initialBillingPeriod:h}=e,y=(0,i.useMemo)(()=>(0,s.J)(t),[t]),[b,f]=(0,i.useState)(p),[v,j]=(0,i.useState)(h),[g,x]=(0,i.useState)(null),[S,J]=(0,i.useState)(!1),[k,C]=(0,i.useState)(!0),[N,A]=(0,i.useState)(null),M=(0,i.useRef)(null),w=(0,i.useRef)(!1),I="asa_membership_checkout_v1_".concat(u),_=c.gL.find(e=>e.id===b),O=(0,o.ZU)(v,b).unitAmountCents;function P(){try{sessionStorage.setItem(I,JSON.stringify(M.current))}catch(e){}}async function B(e){let t=await fetch("/api/stripe/embedded-membership?id=".concat(encodeURIComponent(e)),{cache:"no-store"});if(!t.ok)throw Error("Unable to check membership status. Please sign in again if your session expired.");let n=await t.json();return x(n),f(n.tier),j(n.billingPeriod),n}async function D(){if(!w.current){w.current=!0,C(!0),A(null);try{var e,t;let n={};try{n=JSON.parse(sessionStorage.getItem("asa_membership_attribution")||"{}")}catch(e){}M.current&&M.current.tier===b&&M.current.billingPeriod===v&&(null==g?void 0:g.state)!=="expired"||(M.current={attempt:crypto.randomUUID(),tier:b,billingPeriod:v,...(null==g?void 0:g.id)||(null===(e=M.current)||void 0===e?void 0:e.id)?{previousId:(null==g?void 0:g.id)||(null===(t=M.current)||void 0===t?void 0:t.id)}:{},...n}),P();let{id:r,...i}=M.current,s=await fetch("/api/stripe/embedded-membership",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),a=await s.json();if(!s.ok)throw Error(a.error||"Checkout is unavailable. Please try again.");x(a),J(!1),M.current={...M.current,id:a.id},P()}catch(e){A(e.message)}finally{w.current=!1,C(!1)}}}(0,i.useEffect)(()=>{(async function(){let e=null;try{e=JSON.parse(sessionStorage.getItem(I)||"null")}catch(e){}(null==e?void 0:e.attempt)&&(M.current=e);let t=new URLSearchParams(location.search).get("session_id")||(null==e?void 0:e.id);try{t&&await B(t)}catch(e){A(e.message)}finally{C(!1)}})()},[I]),(0,i.useEffect)(()=>
1{if(!g||!["paid","processing"].includes(g.state)||g.activated)return;let e=setInterval(()=>{B(g.id).catch(()=>{})},5e3);return()=>clearInterval(e)},[g]);let Y=g&&["paid","processing","failed","ended"].includes(g.state);return(0,r.jsxs)("section",{className:m().card,"aria-busy":k,"aria-labelledby":"membership-checkout-title",children:[(0,r.jsx)("p",{className:m().eyebrow,children:"YOUR MEMBERSHIP"}),(0,r.jsx)("h2",{id:"membership-checkout-title",children:(null==g?void 0:g.activated)?"Welcome to the community.":(null==g?void 0:g.state)==="ended"?"Your membership has ended.":(null==g?void 0:g.state)==="failed"?"Your payment needs attention.":Y?"Thank you for joining ASA.":"Be part of the work."}),Y?(0,r.jsxs)("div",{className:m().confirmation,role:"status",children:[(0,r.jsx)("p",{children:g.activated?"Your ".concat(_.name," membership is active."):"ended"===g.state?"This subscription has ended. You can review your account or choose a new membership.":"failed"===g.state?"Your payment provider could not complete this payment. Please use your account to manage payment details, or contact [email protected] for help. Your membership has not been activated by this checkout.":"paid"===g.state?"Your payment is confirmed. Weâre finishing activation of your membership benefits.":"Your payment is processing. Your benefits will become available once payment and activation are confirmed."}),(0,r.jsx)("p",{className:m().small,children:"ended"===g.state?"Your previous payment remains in your billing history.":"Please do not submit another payment. Manage your membership, billing, and benefits from your account."}),(0,r.jsx)("a",{className:m().primary,href:"/account",children:"Go to my account"}),"ended"===g.state&&(0,r.jsx)("button",{className:m().secondary,onClick:()=>{try{sessionStorage.removeItem(I)}catch(e){}window.location.assign("/membership/checkout?tier=".concat(b,"&period=").concat(v))},children:"Choose a new membership"})]}):k&&!g?(0,r.jsx)("p",{role:"status",className:m().loading,children:"Preparing your membership checkoutâ¦"}):(null==g?void 0:g.state)==="open"&&g.clientSecret&&!S?(0,r.jsx)(a.l4,{stripe:y,options:{clientSecret:g.clientSecret,elementsOptions:{appearance:{theme:"stripe",variables:{colorPrimary:"#1a6dc1",colorText:"#002f57",borderRadius:"6px",fontFamily:"Arial, sans-serif"}}}},children:(0,r.jsx)(d.Z,{amount:g.amount,email:n,collectAddress:!1,label:"".concat(_.name," \xb7 ").concat("yearly"===v?"Annual":"Monthly"," membership"),buttonLabel:"Join for ".concat((0,l.YC)(g.amount)," / ").concat("yearly"===v?"year":"month"),renewal:"Youâll pay ".concat((0,l.YC)(g.amount)," today and automatically every ").concat("yearly"===v?"year":"month"," until canceled. Manage or cancel your subscription in your account."),change:()=>J(!0),complete:()=>{B(g.id).catch(e=>A(e.message))}})},g.id):(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),D()},children:[(0,r.jsx)("p",{className:m().intro,children:"Choose your membership and billing period."}),(0,r.jsx)("label",{className:m().selectLabel,htmlFor:"membership-tier",children:"Membership level"}),(0,r.jsx)("select",{id:"membership-tier",className:m().select,value:b,onChange:e=>f(e.target.value),children:c.gL.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,r.jsxs)("fieldset",{className:m().amounts,children:[(0,r.jsx)("legend",{children:"Billing period"}),(0,r.jsx)("div",{className:m().periods,children:["monthly","yearly"].map(e=>(0,r.jsx)("button",{type:"button","aria-pressed":v===e,onClick:()=>j(e),children:"monthly"===e?"Monthly":"Annually"},e))})]}),(0,r.jsx)("div",{className:m().summary,children:(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{children:[_.name," membership"]}),(0,r.jsxs)("strong",{children:[(0,l.YC)(O)," ",(0,r.jsxs)("small",{children:["/ ","yearly"===v?"year":"month"]})]})]})}),(0,r.jsx)("ul",{className:m().benefits,children:_.benefits.map(e=>(0,r.jsx)("li",{children:e},e))}),(0,r.jsxs)("p",{className:m().small,children:["* Annual perk. ",(0,r.jsx)("a",{href:"/membership-benefits",children:"See all membership benefits."})]}),(0,r.jsx)("button",{className:m().primary,type:"submit",disabled:k,children:k?"Preparing paymentâ¦":"Continue to payment"}),(0,r.jsx)("p",{className:m().secure,children:"Secure payment processed by Stripe"})]}),N&&(0,r.jsxs)("div",{className:m().error,role:"alert",children:[N," ",(0,r.jsx)("a",{href:"/account",children:"My account"})]}),(0,r.jsxs)("div",{className:m().cardFooter,children:["Americans for Safe Aerospace ",(0,r.jsx)("span",{children:"501(c)(3) nonprofit"})]})]})}},89332:function(e,t,n){n.d(t,{Rt:function(){return i},gL:function(){return r},ut:function(){return s}});
1let r=[{id:"observer",name:"Observer",buttonId:"join-obs",description:"Stay informed and support the mission.",benefits:["All Ground Crew benefits","UAP reports, maps & white papers","10% store discount","One-time decal*"]},{id:"supporter",name:"Supporter",buttonId:"join-sup",description:"Go deeper with briefings and member Q&As.",benefits:["Observer content and access benefits","Member briefings & AMAs","15% store discount","One-time T-shirt*"]},{id:"advocate",name:"Advocate",buttonId:"join-adv",description:"Priority access to key events and perks.",favorite:!0,benefits:["Supporter content and access benefits","Priority registration for ASA events","20% store discount","One-time embroidered flight patch*"]},{id:"mission_builder",name:"Mission Builder",buttonId:"join-mb",description:"Help shape strategy through exclusive sessions.",benefits:["Advocate content and access benefits","Guaranteed access to ASA-hosted events","Mission Builder strategy events","30% store discount","One-time Mission Builder hat*"]}],i=["Ground Crew",...r.map(e=>e.name)],s=[{label:"Monthly Dispatch Newsletter",included:[!0,!0,!0,!0,!0]},{label:"Access to Reports",included:[!0,!0,!0,!0,!0]},{label:"Content Archive",included:[!0,!0,!0,!0,!0]},{label:"One-time Decal*",included:[!1,!0,!1,!1,!1]},{label:"Store Discount",values:[null,"10%","15%","20%","30%"]},{label:"One-time T-Shirt*",included:[!1,!1,!0,!1,!1]},{label:"Briefings and AMAs",included:[!1,!1,!0,!0,!0]},{label:"Priority Event Registration",included:[!1,!1,!1,!0,!0]},{label:"One-time Embroidered Flight Patch*",included:[!1,!1,!1,!0,!1]},{label:"Guaranteed Event Access",included:[!1,!1,!1,!1,!0]},{label:"Mission Builder Strategy Events",included:[!1,!1,!1,!1,!0]},{label:"Exclusive Mission Builder Hat*",included:[!1,!1,!1,!1,!0]}]},171:function(e,t,n){n.d(t,{ZU:function(){return s},aq:function(){return a},gR:function(){return i}});let r={monthly:{observer:{prod:"price_1S8tCCI6J2MkdJJjwZ7O65dc",dev:"price_1SBht8I6J2MkdJJjbPku3TDP",unitAmountCents:800,currency:"USD"},supporter:{prod:"price_1SAGY5I6J2MkdJJjQS2qXQZa",dev:"price_1SBht8I6J2MkdJJjkLstoFLl",unitAmountCents:2e3,currency:"USD"},advocate:{prod:"price_1SAGbXI6J2MkdJJj2d70FJRD",dev:"price_1SBht7I6J2MkdJJjcQQ65EDq",unitAmountCents:5e3,currency:"USD"},mission_builder:{prod:"price_1SAGe5I6J2MkdJJjFl0k69js",dev:"price_1SBht6I6J2MkdJJjJJLcRhF7",unitAmountCents:1e4,currency:"USD"}},yearly:{observer:{prod:"price_1S8tCCI6J2MkdJJjbVpxaY1X",dev:"price_1SBht9I6J2MkdJJj15dz8znp",unitAmountCents:8e3,currency:"USD"},supporter:{prod:"price_1SAGY5I6J2MkdJJjVrza1Hyf",dev:"price_1SBht8I6J2MkdJJjomi3VgC2",unitAmountCents:2e4,currency:"USD"},advocate:{prod:"price_1SAGbXI6J2MkdJJjfZOJNjFt",dev:"price_1SBht7I6J2MkdJJjLqLESsdw",unitAmountCents:5e4,currency:"USD"},mission_builder:{prod:"price_1SAGdjI6J2MkdJJjPbqRoenr",dev:"price_1SBht6I6J2MkdJJjvHoVm0in",unitAmountCents:1e5,currency:"USD"}}};Object.keys(r),Object.keys(r.monthly);let i=(e,t)=>r[e][t].prod,s=(e,t)=>({billingPeriod:e,tier:t,unitAmountCents:r[e][t].unitAmountCents,currency:r[e][t].currency}),a=e=>e?({observer:"Observer",supporter:"Supporter",advocate:"Advocate",mission_builder:"Mission Builder"})[e]||e:"Free"},12073:function(e,t,n){n.d(t,{Jd:function(){return i},Jg:function(){return r},YC:function(){return s}});let r=[25,50,100,250];function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:99999999;if(!/^\d{1,6}(?:\.\d{1,2})?$/.test(e.trim()))return null;let r=Math.round(100*Number(e));return Number.isSafeInteger(r)&&r>=t&&r<=n?r:null}function s(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:e%100?2:0,maximumFractionDigits:2}).format(e/100)}}}]);
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.