!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f4a21902-e2bb-5768-b26e-50974a6fcd7e")}catch(e){}}(); import{j as a}from"./jsx-runtime-D_zvdyIk.js";import{r as v,M as be,P as K,g as we,u as Te,a as ke}from"./index-DwaoyV61.js";import{z as oe}from"./index-zIQsbCyv.js";import{S as Ce}from"./StatusInputs-1bAxfxmQ.js";import{u as Ee,a as Se,L as je}from"./local_storage-DRhS2b1Z.js";import{u as ce,d as Re,c as Be}from"./components-DhFN5rxT.js";import{c as Pe,a as Ie}from"./_commonjs-dynamic-modules-BHkRu4p0.js";import{u as ue}from"./useNonRevalidatingFetcher-FBRWXSpc.js";import{u as Ne}from"./useToast-B6f2NDmM.js";import{u as X}from"./useTranslation-CqXWvxCZ.js";import{c as F}from"./index-Bc72ctNv.js";import{u as M}from"./useWebThemeContext-CQEkZKXw.js";function Ae(){return()=>{}}function Fe(){return v.useSyncExternalStore(Ae,()=>!0,()=>!1)}function Oe({children:e,fallback:r=null}){return Fe()?v.createElement(v.Fragment,null,e()):v.createElement(v.Fragment,null,r)}const Ue="bhba",jt=.17,De=e=>{const[r]=ce(),s=r.get("_bhba")||void 0;return e||s},Le=(e,r)=>{const s=r.split(";").map(i=>i.trim());for(const i of s){const[p,c]=i.split("=").map(d=>d.trim());if(p===e)return c}return null};var q={exports:{}},z={exports:{}};const He={},Ve=Object.freeze(Object.defineProperty({__proto__:null,default:He},Symbol.toStringTag,{value:"Module"})),qe=be(Ve);var ze=z.exports,se;function Me(){return se||(se=1,function(e,r){(function(s,i){e.exports=i()})(ze,function(){var s=s||function(i,p){var c;if(typeof window<"u"&&window.crypto&&(c=window.crypto),typeof self<"u"&&self.crypto&&(c=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(c=globalThis.crypto),!c&&typeof window<"u"&&window.msCrypto&&(c=window.msCrypto),!c&&typeof K<"u"&&K.crypto&&(c=K.crypto),!c&&typeof Pe=="function")try{c=qe}catch{}var d=function(){if(c){if(typeof c.getRandomValues=="function")try{return c.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof c.randomBytes=="function")try{return c.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},h=Object.create||function(){function t(){}return function(n){var u;return t.prototype=n,u=new t,t.prototype=null,u}}(),g={},y=g.lib={},m=y.Base=function(){return{extend:function(t){var n=h(this);return t&&n.mixIn(t),(!n.hasOwnProperty("init")||this.init===n.init)&&(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),_=y.WordArray=m.extend({init:function(t,n){t=this.words=t||[],n!=p?this.sigBytes=n:this.sigBytes=t.length*4},toString:function(t){return(t||b).stringify(this)},concat:function(t){var n=this.words,u=t.words,f=this.sigBytes,C=t.sigBytes;if(this.clamp(),f%4)for(var T=0;T>>2]>>>24-T%4*8&255;n[f+T>>>2]|=l<<24-(f+T)%4*8}else for(var w=0;w>>2]=u[w>>>2];return this.sigBytes+=C,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=i.ceil(n/4)},clone:function(){var t=m.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var n=[],u=0;u>>2]>>>24-C%4*8&255;f.push((T>>>4).toString(16)),f.push((T&15).toString(16))}return f.join("")},parse:function(t){for(var n=t.length,u=[],f=0;f>>3]|=parseInt(t.substr(f,2),16)<<24-f%8*4;return new _.init(u,n/2)}},k=j.Latin1={stringify:function(t){for(var n=t.words,u=t.sigBytes,f=[],C=0;C>>2]>>>24-C%4*8&255;f.push(String.fromCharCode(T))}return f.join("")},parse:function(t){for(var n=t.length,u=[],f=0;f>>2]|=(t.charCodeAt(f)&255)<<24-f%4*8;return new _.init(u,n)}},o=j.Utf8={stringify:function(t){try{return decodeURIComponent(escape(k.stringify(t)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(t){return k.parse(unescape(encodeURIComponent(t)))}},x=y.BufferedBlockAlgorithm=m.extend({reset:function(){this._data=new _.init,this._nDataBytes=0},_append:function(t){typeof t=="string"&&(t=o.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var n,u=this._data,f=u.words,C=u.sigBytes,T=this.blockSize,l=T*4,w=C/l;t?w=i.ceil(w):w=i.max((w|0)-this._minBufferSize,0);var E=w*T,B=i.min(E*4,C);if(E){for(var N=0;N>>7)^(w<<14|w>>>18)^w>>>3,B=_[l-2],N=(B<<15|B>>>17)^(B<<13|B>>>19)^B>>>10;_[l]=E+_[l-7]+N+_[l-16]}var A=u&f^~u&C,I=x&S^x&t^S&t,U=(x<<30|x>>>2)^(x<<19|x>>>13)^(x<<10|x>>>22),W=(u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25),D=T+W+A+m[l]+_[l],$=U+I;T=C,C=f,f=u,u=n+D|0,n=t,t=S,S=x,x=D+$|0}o[0]=o[0]+x|0,o[1]=o[1]+S|0,o[2]=o[2]+t|0,o[3]=o[3]+n|0,o[4]=o[4]+u|0,o[5]=o[5]+f|0,o[6]=o[6]+C|0,o[7]=o[7]+T|0},_doFinalize:function(){var b=this._data,k=b.words,o=this._nDataBytes*8,x=b.sigBytes*8;return k[x>>>5]|=128<<24-x%32,k[(x+64>>>9<<4)+14]=i.floor(o/4294967296),k[(x+64>>>9<<4)+15]=o,b.sigBytes=k.length*4,this._process(),this._hash},clone:function(){var b=h.clone.call(this);return b._hash=this._hash.clone(),b}});p.SHA256=h._createHelper(j),p.HmacSHA256=h._createHmacHelper(j)}(Math),s.SHA256})}(q)),q.exports}var Ke=$e();const Qe=we(Ke);class ie extends Error{}function Ye(e){if(!e||typeof e!="string")throw new ie("Invalid input: must be a non-empty string");try{const r=e.trim();return Qe(r).toString()}catch(r){throw Ie(r,{extra:{input_length:e.length,input_preview:e.substring(0,100)}}),new ie("Failed to hash input")}}function Y(){if(typeof crypto<"u"&&crypto.randomUUID)try{return crypto.randomUUID()}catch(e){console.warn("crypto.randomUUID failed, falling back to alternative method:",e)}if(typeof crypto<"u"&&crypto.getRandomValues)try{const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;const r=Array.from(e,s=>s.toString(16).padStart(2,"0")).join("");return[r.slice(0,8),r.slice(8,12),r.slice(12,16),r.slice(16,20),r.slice(20,32)].join("-")}catch(e){console.warn("crypto.getRandomValues failed, falling back to Math.random:",e)}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const r=Math.random()*16|0;return(e==="x"?r:r&3|8).toString(16)})}const J="visitTokenReady",Rt=({shouldCreateVisitToken:e,setCookie:r})=>{const[s]=ce(),i=ue(),p=i.data;v.useEffect(()=>{if(e){const c=document.referrer,d=new FormData;d.append("referrer",c),d.append("landing_page",window.location.href);const g="/visit_token"+(s.toString()?`?${s.toString()}`:"");i.submit(d,{method:"post",action:g})}},[e]),v.useEffect(()=>{p?.visitToken&&e&&(r({name:"visit_token",value:p?.visitToken,days:.16666666666666666}),typeof window<"u"&&window.dispatchEvent(new CustomEvent(J)))},[p])},Je=e=>{if(e)try{return Ye(e.toLowerCase())}catch{return}},Ge=e=>{try{const r=new URL(e);return r.searchParams.has("jwt_token")&&r.searchParams.set("jwt_token","REDACTED"),r.toString()}catch{return e}};let Q=null;const G=()=>{const e="beehiiv_anonymous_user_id";try{let r=localStorage.getItem(e);return r||(r=Y(),localStorage.setItem(e,r)),r}catch{return Q||(Q=Y()),Q}},Bt=({nectarId:e,enabled:r,publicationId:s,postId:i,subscriptionId:p,email:c,settings:d})=>{const h=v.useRef(""),g=v.useRef([]),y=v.useRef([]),m=v.useRef(null),_=v.useRef(!1),j=ue(),b=v.useCallback(()=>typeof document>"u"?null:Le("visit_token",document.cookie),[]),k=v.useCallback(l=>{j.submit(JSON.stringify({events:l,settings:d}),{method:"post",action:"/nectar_analytics",encType:"application/json"})},[j,d]),o=v.useCallback(()=>{if(_.current||g.current.length===0)return;_.current=!0;const l=g.current.splice(0,d.batchSize);if(l.length===0){_.current=!1;return}k(l),_.current=!1,g.current.length>0&&(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{o()},d.batchTimeoutMs))},[d.batchSize,d.batchTimeoutMs,k]),x=v.useCallback(()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{o()},d.batchTimeoutMs)},[o,d.batchTimeoutMs]),S=v.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),o()},[o]),t=v.useCallback(l=>{g.current.push(l),g.current.length>=d.batchSize?(m.current&&(clearTimeout(m.current),m.current=null),o()):x()},[o,x,d.batchSize]),n=v.useCallback(()=>{if(y.current.length===0)return;const l=b();if(!l)return;y.current.splice(0).forEach(E=>{E.visit_token=l,t(E)})},[b,t]),u=v.useCallback(l=>({user_agent:navigator.userAgent,url:Ge(window.location.href),event:l.event_type,client_timestamp:Date.now(),event_id:Y(),nectar_id:e,publication_id:s,visit_token:b()||"",ip:"",store_ip:d.ipTracking,url_referrer:document.referrer||void 0,sendable_id:i,sendable_type:i?"post":void 0,subscription_id:p,email_hash_sha256:Je(c),anonymous_user_id:G(),click_type:l.click_type,click_url:l.click_url,click_raw_tag_name:l.click_raw_tag_name}),[b,e,s,d.ipTracking,i,p,c]),f=v.useCallback(l=>{y.current.push(l)},[]),C=v.useCallback(()=>{if(!d.pageViewTracking)return;const l=window.location.href;if(l===h.current)return;h.current=l;const w=u({event_type:"pageview"});w.visit_token?t(w):f(w)},[u,t,d.pageViewTracking,f]),T=v.useCallback(({clickType:l,clickUrl:w,clickRawTagName:E})=>{if(!d.clickTracking)return;const B=u({event_type:"click",click_type:l,click_url:w,click_raw_tag_name:E});B.visit_token?t(B):f(B)},[u,t,d.clickTracking,f]);return v.useEffect(()=>{const l=()=>{n()};return window.addEventListener(J,l),()=>{window.removeEventListener(J,l)}},[n]),v.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),v.useEffect(()=>{const l=()=>{S()};return window.addEventListener("beforeunload",l),()=>{window.removeEventListener("beforeunload",l)}},[S]),r?{trackPageView:C,trackClick:T}:{trackPageView:()=>{},trackClick:()=>{}}},Xe=({name:e,category:r,action:s,label:i=window.location.href,value:p=0,data:c={}})=>{const h={event:e,eventProps:{category:r,action:s,label:i,value:p,timestamp:new Date().toISOString(),...c}};typeof window.dataLayer<"u"&&window.dataLayer.push(h)},Ze={pushEvent:Xe},et=e=>e.match(/(iPad|iPhone|iPod)/g)!==null;var O=(e=>(e.POPUP="popup",e.GATED="gated",e.FORM="form",e.NONE="none",e))(O||{});const le=v.createContext(void 0),tt=({children:e,email:r,setEmail:s,onEmailChange:i,isSubmitting:p,autoFocus:c})=>a.jsx(le.Provider,{value:{email:r,setEmail:s,onEmailChange:i,isSubmitting:p,autoFocus:c},children:e}),rt=({visitToken:e,referralId:r,boostAffiliateRecommendingPublicationId:s})=>a.jsx(Oe,{fallback:null,children:()=>a.jsxs(a.Fragment,{children:[a.jsx("input",{hidden:!0,name:"ref",value:r||"",onChange:()=>null}),a.jsx("input",{hidden:!0,name:"bhba",value:s||"",onChange:()=>null}),a.jsx("input",{hidden:!0,name:"visit_token",value:e||"",onChange:()=>null})]})}),nt=({type:e=O.NONE,onEmailChange:r,onSuccess:s,autoFocus:i=!1,premiumOfferId:p,children:c,bodyTextColor:d})=>{const{t:h}=X(),g=Te(),{publication:y}=Re("root"),{setCookie:m,cookies:_,visitToken:j,referralId:b,currentPath:k,postId:o}=Ee(),x=De(_[Ue]||void 0),{pathname:S}=ke(),[t,n]=Se(),u=v.useRef(null),[f,C]=v.useState(!1),[T,l]=v.useState({signupUrl:"",anonymousUserId:"",sendableId:"",sendableType:""});v.useEffect(()=>{typeof window>"u"||l({signupUrl:window.location.href,anonymousUserId:G(),sendableId:o??"",sendableType:o?"post":""})},[o]);const w=Be(),E=w.data,B=w.state==="submitting",A=y.web_template.signup_flow.filter(({enabled:P})=>P),I=A[0],U=A.length>0&&A?.[0]?.managed_type!=="custom",W=!!I&&!I.full_url.startsWith(y.url),D=e===O.POPUP,$=e===O.GATED,de=e===O.FORM,L=D||$||de,fe=v.useMemo(()=>{if(L)return S;if(I){const P=I.href.split("?"),H=P[0],R=P[1]||"",V=new URLSearchParams(R);return V.set("email",t),`${H}?${V.toString()}`}return"/"},[I,S,t,L]),{double_opt_required:pe,has_referral_program:me,private:he,require_subscriber_approval:ve}=y,xe=!!(pe||me&&b);Ne(E?.toast),v.useEffect(()=>{if(E?.toast?.status==="success"&&(m({name:"email_capture_disabled",value:"true",days:30}),u?.current?.reset()),E?.dataLayerEvent&&Ze.pushEvent(E.dataLayerEvent),!L&&E?.redirectTo&&U){const P={startedAt:new Date().toISOString(),currentIndex:0,nextIndex:1,redirects:A};localStorage.setItem(je.SIGNUP_REDIRECTS,JSON.stringify(P))}!L&&E?.redirectTo&&(I&&W?setTimeout(()=>{if(et(navigator.userAgent))try{window.location=E?.redirectTo}catch{window.location=E?.redirectTo}else window.open(E?.redirectTo,"_blank"),g("/")},1e3):g(E?.redirectTo)),E?.redirectTo&&s&&s()},[E]);const ge=()=>y.require_subscriber_approval?h("notifications.subscribe.require_approval"):y.double_opt_required?h("notifications.subscribe.confirm"):h("notifications.subscribe.subscribed"),ye=(P,H)=>{if(P.preventDefault(),y?.enable_signup_confirmation&&!f){oe.error("Accept ToU & Privacy Policy.");return}const R=new FormData(P.currentTarget),V=R.get("visit_token"),_e=R.get("ref"),ne=t?.trim();if(R.set("is_js_enabled","true"),R.set("accepted_tos",String(f)),R.set("email",ne),!ne){oe.error("Please enter a valid email address");return}!V&&j&&R.set("visit_token",j),!_e&&b&&R.set("ref",b),H&&R.set("premium_offer_id",H),typeof window<"u"&&(R.set("nectar_signup_url",window.location.href),R.set("nectar_anonymous_user_id",G()),o&&(R.set("nectar_sendable_id",o),R.set("nectar_sendable_type","post"))),w.submit(R,{method:"post",action:"/create"})};return he&&!ve?null:a.jsx("div",{className:"flex flex-col items-center w-full",children:a.jsxs(w.Form,{ref:u,method:"post",action:"/create",className:"w-full bg-transparent group rounded-wt",onSubmit:P=>ye(P,p),children:[a.jsx(rt,{visitToken:j,referralId:b,boostAffiliateRecommendingPublicationId:x}),a.jsx("input",{name:"redirect_path",type:"hidden",value:fe}),a.jsx("input",{name:"sent_from_orchid",type:"hidden",value:"true"}),a.jsx("input",{name:"fallback_path",type:"hidden",value:k}),a.jsx("input",{name:"nectar_signup_url",type:"hidden",value:T.signupUrl}),a.jsx("input",{name:"nectar_anonymous_user_id",type:"hidden",value:T.anonymousUserId}),T.sendableId?a.jsxs(a.Fragment,{children:[a.jsx("input",{name:"nectar_sendable_id",type:"hidden",value:T.sendableId}),a.jsx("input",{name:"nectar_sendable_type",type:"hidden",value:T.sendableType})]}):null,a.jsx("input",{name:"double_opt",type:"hidden",value:xe.toString()}),a.jsx("input",{name:"trigger_redirect",type:"hidden",value:U.toString()}),a.jsx(Ce,{name:"subscribe",successMessage:ge(),errorMessage:h("errors.default")}),a.jsxs("div",{className:"flex flex-col",children:[a.jsx(tt,{email:t,setEmail:n,onEmailChange:r,isSubmitting:B,autoFocus:i,children:c}),y?.enable_signup_confirmation&&a.jsxs("div",{className:"flex flex-row mt-3 space-x-2",children:[a.jsx("input",{type:"checkbox",className:"w-4 h-4 border-gray-300 rounded text-lp-main-signup-cta-color focus:ring-indigo-500",checked:f,onChange:()=>C(!f)}),!y?.terms_of_service||y?.terms_of_service.length===0?a.jsxs("p",{className:"text-xs font-medium",style:{color:d},children:[h("shared.cta.gdpr_signup_consent")," ",a.jsx("a",{href:"https://www.beehiiv.com/tou",target:"_blank",className:"underline underline-offset-1 hover:opacity-80",rel:"noreferrer",children:h("footer.terms_of_use")})," ",h("shared.cta.and")," ",a.jsx("a",{href:"https://www.beehiiv.com/privacy",target:"_blank",className:"underline underline-offset-1 hover:opacity-80",rel:"noreferrer",children:h("footer.privacy_policy")}),"."]}):a.jsxs("p",{className:"text-xs font-medium",style:{color:d},children:[h("shared.cta.gdpr_signup_consent")," ",h("shared.cta.sign_up")," ",a.jsx("a",{href:"/tos",target:"_blank",className:"underline underline-offset-1 hover:opacity-80",rel:"noreferrer",children:h("meta.titles.tos")}),"."]})]})]})]})})},ot=()=>{const e=v.useContext(le);if(!e)throw new Error("useSignup must be used within a SignupProvider");return e};function st({title:e,titleId:r,...s},i){return v.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":r},s),e?v.createElement("title",{id:r},e):null,v.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"}))}const at=v.forwardRef(st),Z=({color:e,children:r,iconEnabled:s,className:i,style:p={}})=>a.jsxs("div",{className:F("flex w-full items-center",i),style:p,children:[s&&a.jsx("div",{className:"pl-2",style:{color:e},children:a.jsx(at,{className:"h-6 w-6"})}),r]}),ee=({backgroundColor:e,fontFamily:r,fontSize:s,textColor:i,autoFocus:p,placeholderText:c,setEmail:d,onEmailChange:h,className:g})=>{const{t:y}=X();return a.jsx("input",{type:"email",name:"email",autoComplete:"email",autoFocus:p,required:!0,style:{...e&&{borderColor:e},...r&&{fontFamily:r},color:"#111827"},className:F("wt-button-font z-10 w-full border-none bg-transparent placeholder-shown:text-ellipsis",{"text-lg focus:text-lg active:text-lg sm:text-lg":!s||s==="lg"},{"text-sm focus:text-sm active:text-sm":s==="sm"},g),onChange:m=>{d(m.target.value),h&&h(m.target.value)},placeholder:c||y("subscribe.email_placeholder")||""})},te=({className:e,children:r,style:s={}})=>{const{classes:i}=M();return a.jsx("div",{style:s,className:F("flex w-full flex-col items-center sm:flex-row",e,i.radius),children:r})},it=e=>{switch(e){case"rounded-none":return"rounded-none";case"rounded-sm":return"rounded-xs";case"rounded-md":return"rounded-sm";case"rounded-lg":return"rounded-md";case"rounded-xl":return"rounded-lg";case"rounded-2xl":return"rounded-xl";case"rounded-3xl":return"rounded-2xl";default:return"rounded-none"}},re=({isSubmitting:e,ctaText:r,backgroundColor:s,fontFamily:i,fontSize:p,textColor:c,className:d,borderColor:h,shouldAdjustRadius:g=!1})=>{const{t:y}=X(),{classes:m}=M(),_=r||y("shared.cta.subscribe");return a.jsx("input",{type:"submit",value:e?`${y("shared.actions.submitting")}...`:_,style:{...s&&{backgroundColor:s},...c&&{color:c},...i&&{fontFamily:i},...h&&{borderColor:h}},className:F("cursor-pointer px-5 py-3 font-semibold","w-full sm:w-auto",{"text-lg focus:text-lg active:text-lg sm:text-lg":!p||p==="lg"},{"text-sm focus:text-sm active:text-sm":p==="sm"},g?m.radius:it(m.radius),d),disabled:e})},ct=({signupStyles:e,isSubmitting:r,autoFocus:s,setEmail:i,onEmailChange:p})=>{const{fontFamily:c,fontSize:d,buttonFontFamily:h,buttonBgColor:g,buttonTextColor:y,placeholderBgColor:m,placeholderTextColor:_,buttonText:j,placeholderText:b,borderEnabled:k,borderColor:o,emailIconEnabled:x}=e;return a.jsxs(te,{style:{backgroundColor:m,border:k?`2px solid ${o}`:"none"},className:"overflow-hidden p-1",children:[a.jsx(Z,{color:g||"",style:{backgroundColor:m},iconEnabled:x,children:a.jsx(ee,{fontFamily:c,fontSize:d,autoFocus:s,setEmail:i,onEmailChange:p,placeholderText:b,textColor:_})}),a.jsx(re,{isSubmitting:r,fontFamily:h,fontSize:d,ctaText:j,backgroundColor:g,textColor:y})]})},ut=e=>{switch(e){case"none":return"rounded-none sm:rounded-r-none";case"sm":return"rounded-none sm:rounded-sm-r";case"md":return"rounded-none sm:rounded-md-r";case"lg":return"rounded-none sm:rounded-lg-r";case"xl":return"rounded-none sm:rounded-xl-r";case"2xl":return"rounded-none sm:rounded-2xl-r";case"3xl":return"rounded-none sm:rounded-3xl-r";default:return"rounded-none"}},lt=({signupStyles:e,isSubmitting:r,autoFocus:s,setEmail:i,onEmailChange:p})=>{const{webTheme:c}=M(),{fontFamily:d,buttonFontFamily:h,buttonBgColor:g,buttonTextColor:y,placeholderBgColor:m,placeholderTextColor:_,buttonText:j,placeholderText:b,borderEnabled:k,borderColor:o,emailIconEnabled:x}=e,S=ut(c.radius);return a.jsxs(te,{style:{backgroundColor:m,border:k?`2px solid ${o}`:"none"},className:"overflow-hidden",children:[a.jsx(Z,{color:g||"",style:{backgroundColor:m},iconEnabled:x,children:a.jsx(ee,{fontFamily:d,autoFocus:s,setEmail:i,onEmailChange:p,placeholderText:b,textColor:_})}),a.jsx(re,{isSubmitting:r,fontFamily:h,ctaText:j,backgroundColor:g,textColor:y,className:S,shouldAdjustRadius:!0})]})},dt=({signupStyles:e,isSubmitting:r,autoFocus:s,setEmail:i,onEmailChange:p})=>{const{classes:c}=M(),{fontFamily:d,buttonFontFamily:h,buttonBgColor:g,buttonTextColor:y,placeholderBgColor:m,placeholderTextColor:_,buttonText:j,placeholderText:b,borderEnabled:k,borderColor:o,emailIconEnabled:x}=e;return a.jsxs(te,{className:"gap-2 overflow-hidden",children:[a.jsx(Z,{color:g,iconEnabled:x,className:F(c.radius),style:{backgroundColor:m,border:k?`2px solid ${o}`:"none"},children:a.jsx(ee,{fontFamily:d,autoFocus:s,setEmail:i,onEmailChange:p,placeholderText:b,textColor:_,className:"py-3"})}),a.jsx("div",{className:F("w-full sm:w-auto",c.radius),style:{backgroundColor:k?g:"",border:k?`2px solid ${g}`:"none"},children:a.jsx(re,{isSubmitting:r,fontFamily:h,ctaText:j,backgroundColor:g,textColor:y})})]})},ft=e=>!e||!["template-1","template-2","template-3"].includes(e)?"template-1":e,pt=({signupStyles:e})=>{const r=ft(e?.template),s={"template-1":ct,"template-2":lt,"template-3":dt}[r],{isSubmitting:i,autoFocus:p,email:c,setEmail:d,onEmailChange:h}=ot();return a.jsx(s,{signupStyles:e,autoFocus:p,isSubmitting:i,email:c,setEmail:d,onEmailChange:h})},Pt=({signupStyles:e,type:r,premiumOfferId:s,onEmailChange:i,onSuccess:p,autoFocus:c})=>e?a.jsx(nt,{type:r,premiumOfferId:s,onEmailChange:i,onSuccess:p,autoFocus:c,bodyTextColor:e.bodyTextColor,children:a.jsx(pt,{signupStyles:e})}):null;var mt=(e=>(e.POPUP="popup",e.GATED="gated",e.FORM="form",e.NONE="none",e))(mt||{}),ht=(e=>(e.INLINE="inline",e.BOTTOM="bottom",e))(ht||{});export{Ue as B,Oe as C,Ze as D,Pt as S,mt as a,ht as b,jt as c,Bt as d,Rt as e,G as g,et as i,De as u}; //# sourceMappingURL=types-B2R9qSlm.js.map //# debugId=f4a21902-e2bb-5768-b26e-50974a6fcd7e