1import{U as e}from"./B5ce_kJx.js";import{Kt as t,V as n,Yt as r,_t as i,d as a,m as o,p as s,r as c,st as l,u,x as d}from"./yj6t9HLz.js";import{o as f}from"./CGU6j-mv.js";import{n as p}from"./PKT9i7AF.js";var m=()=>{let t=e();return{executeRecaptcha:()=>new Promise(e=>{if(typeof window>`u`||!window.grecaptcha){e({success:!1,score:0});return}let n=t.public.recaptchaSiteKey;if(!n){e({success:!1,score:0});return}window.grecaptcha.ready(()=>{window.grecaptcha.execute(n,{action:`submit`}).then(t=>{fetch(`/api/recaptcha`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:t})}).then(e=>e.json()).then(t=>{e(t)}).catch(()=>{e({success:!1,score:0})})}).catch(()=>{e({success:!1,score:0})})})})}},h=`/api/forms/l/263392/2018-09-22/9dngq`,g=()=>({submitForm:async(e,t,n,r,i,a)=>{try{return await(await fetch(h,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({fname:e,lname:t,email:n,zip:r,tracer:i,score:a})})).json()}catch(e){return console.error(`Footer newsletter form submission error:`,e),{status:`error`}}}}),_={class:`newsletter-form-header`},v={key:0,class:`h5`},y={key:1,class:`h4`},b={key:0,class:`alert alert-danger fade show`},x={key:1,class:`alert alert-danger fade show`,role:`alert`},S={class:`newsletter-fill-width`},C=[`value`],w={key:0,class:`edreports-logo`},T=Object.assign(d({__name:`Newsletter`,props:{type:{default:`default`}},setup(d){p({script:[{src:`https://www.google.com/recaptcha/api.js?render=${e().public.recaptchaSiteKey}`,defer:!0}]});let{executeRecaptcha:h}=m(),T=g(),E=i(``),D=i(``),O=i(``),k=i(``),A=i(!1),j=i(!1),M=i(!1),N=i(!1),P=i(``),F=u(()=>d.type==="default"),I=u(()=>d.type===`footer`),L=u(()=>d.type===`page`),R=u(()=>I.value?`Sign Up`:`Submit`),z=u(()=>N.value?`You're Signed-up!`:I.value?`Email Sign-Up`:`Stay in the Loop`),B=u(()=>N.value?`You'll be the first to know when we release a new report.`:`Be the first to know when we release new reports, resources, and guidance on how to select quality instructional materials for your community.`),V=u(()=>A.value&&!E.value),H=u(()=>A.value&&!D.value),U=u(()=>A.value&&!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(O.value).toLowerCase())),W=e=>{e.preventDefault(),j.value=!1,A.value=!0,U.value||V.value||H.value?M.value=!0:(M.value=!1,G(e))},G=async e=>{e.preventDefault();let t=await h();if(t.success){let e=t.score;try{(await T.submitForm(E.value,D.value,O.value,k.value,P.value,e)).status===`success`?N.value=!0:j.value=!0}catch(e){console.error(`Error submitting newsletter form:`,e),j.value=!0}}else j.value=!0};return(e,i)=>(n(),o(`div`,{class:t([`newsletter-form`,{"footer-newsletter":I.value,"default-newsletter":F.value,"page-newsletter":L.value}])},[a(`div`,_,[I.value?(n(),o(`h2`,v,r(z.value),1)):(n(),o(`h2`,y,r(z.value),1)),a(`p`,null,r(B.value),1)]),N.value?s(``,!0):(n(),o(c,{key:0},[j.value?(n(),o(`div`,b,` An error occurred while submitting the form. Please check all fields and try again. `)):s(``,!0),M.value?(n(),o(`div`,x,[...i[4]||=[a(`b`,null,`Please enter your information for all required fields.`,-1)]])):s(``,!0)],64)),a(`form`,{method:`post`,onSubmit:W},[N.value?s(``,!0):(n(),o(c,{key:0},[a(`div`,null,[l(a(`input`,{"onUpdate:modelValue":i[0]||=e=>E.value=e,name:`first-name`,class:t([`input-firstName`,{"has-error":V.value}]),required:``,"aria-required":`true`,type:`text`,placeholder:`First Name *`,"aria-label":`First Name`,autocomplete:`given-name`},null,2),[[f,E.value]]),l(a(`input`,{"onUpdate:modelValue":i[1]||=e=>D.value=e,name:`last-name`,class:t([`input-lastName`,{"has-error":H.value}]),required:``,"aria-required":`true`,type:`text`,placeholder:`Last Name *`,"aria-label":`Last Name`,autocomplete:`family-name`},null,2),[[f,D.value]])]),a(`div`,null,[l(a(`input`,{"onUpdate:modelValue":i[2]||=e=>O.value=e,name:`email`,class:t({"has-error":U.value}),required:``,"aria-required":`true`,type:`email`,placeholder:`Email Address *`,"aria-label":`Email Address`,autocomplete:`email`},null,2),[[f,O.value]]),F.value?s(``,!0):l((n(),o(`input`,{key:0,"onUpdate:modelValue":i[3]||=e=>k.value=e,name:`zip`,class:`input-email`,type:`text`,placeholder:`School Zip Code`,"aria-label":`School Zip Code`},null,512)),[[f,k.value]])]),a(`div`,S,[a(`input`,{type:`submit`,value:R.value},null,8,C)]),F.value?(n(),o(`div`,w)):s(``,!0)],64))],32)],2))}}),{__name:`Newsletter`});export{T 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.