{"version":3,"file":"DownloadForm.Dfp7e8v7.mjs","names":["React.useState","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","_e","p","addPropertyControls","init_framer_BWFVvmND","ControlType","sourceFromUrl","k","DownloadForm","props","m","MATERIAL","material","email","setEmail","consent","setConsent","website","setWebsite","state","setState","ready","submit","endpoint","label","FONT","TIEFSEE","field","root","PETROL","SERIE","GRAU","privacyLink","init_DownloadForm","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/jHv11lGBxVZpuyNxcgJi/IG4yB1ApwUELZfkMAlOF/DownloadForm.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Downloads Funk-Merkzettel und Gezeiten-Schema: E-Mail, freiwilliges Häkchen für die Serie; sendet an die Apps-Script-Web-App.\n// Die PDF kommt per E-Mail, die Serie nur nach Bestätigung (Double-Opt-in). Keine Cookies, kein lokaler Speicher.\nconst TIEFSEE=\"#083141\";const PETROL=\"#114C5F\";const GRAU=\"#59747C\";const LINE=\"#D6E2E6\";const FONT=\"Inter, sans-serif\";const MATERIAL={funk:{name:\"Funk-Merkzettel\",art:\"den\"},gezeiten:{name:\"Gezeiten-Schema\",art:\"das\"}};const SERIE=\"Ich m\\xf6chte zus\\xe4tzlich „7 Wochen zur sicheren Saison“ erhalten: 7 Wochen lang einmal pro Woche eine Aufgabe per E-Mail, danach jeden Donnerstag die neue Fallanalyse. Abmeldung jederzeit \\xfcber den Link in jeder E-Mail.\";function sourceFromUrl(){if(typeof window===\"undefined\")return\"\";const p=new URLSearchParams(window.location.search);return[\"utm_source\",\"utm_medium\",\"utm_campaign\"].map(k=>p.get(k)).filter(Boolean).join(\" / \");}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function DownloadForm(props){const{material,endpoint,privacyLink}=props;const m=MATERIAL[material]||MATERIAL.funk;const[email,setEmail]=React.useState(\"\");const[consent,setConsent]=React.useState(false);const[website,setWebsite]=React.useState(\"\");const[state,setState]=React.useState(\"idle\");const emailOk=/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email.trim());const ready=emailOk&&state!==\"sending\";const submit=async e=>{e.preventDefault();if(!ready)return;if(!endpoint){setState(\"error\");return;}setState(\"sending\");try{await fetch(endpoint,{method:\"POST\",mode:\"no-cors\",headers:{\"Content-Type\":\"text/plain;charset=utf-8\"},body:JSON.stringify({typ:\"download\",material,email:email.trim(),consent,website,quelle:sourceFromUrl()})});setState(\"done\");}catch{setState(\"error\");}};const label={display:\"block\",font:\"600 14px/1.4 \"+FONT,color:TIEFSEE,marginBottom:6};const field={width:\"100%\",boxSizing:\"border-box\",padding:\"12px 14px\",borderRadius:10,border:\"1.5px solid \"+LINE,background:\"#FFFFFF\",color:TIEFSEE,font:\"400 16px/1.35 \"+FONT,marginBottom:16};const root={width:\"100%\",fontFamily:FONT,color:TIEFSEE,...props.style||{}};if(state===\"done\"){return /*#__PURE__*/_jsxs(\"div\",{style:root,role:\"status\",children:[/*#__PURE__*/_jsx(\"p\",{style:{font:\"800 20px/1.3 \"+FONT,margin:\"0 0 8px\"},children:\"Ist unterwegs.\"}),/*#__PURE__*/_jsxs(\"p\",{style:{font:\"400 16px/1.5 \"+FONT,margin:0},children:[\"Der Link zu \",m.art,\" \",m.name,\" kommt in wenigen Minuten an \",email.trim(),\". Schau notfalls im Spam-Ordner nach.\",consent?\" F\\xfcr die Serie bekommst du zus\\xe4tzlich eine E-Mail mit einem Best\\xe4tigungslink.\":\"\"]})]});}return /*#__PURE__*/_jsxs(\"form\",{onSubmit:submit,style:root,noValidate:true,children:[/*#__PURE__*/_jsx(\"label\",{style:label,htmlFor:\"dl-email-\"+material,children:\"E-Mail\"}),/*#__PURE__*/_jsx(\"input\",{id:\"dl-email-\"+material,type:\"email\",autoComplete:\"email\",required:true,value:email,onChange:e=>setEmail(e.target.value),placeholder:\"du@beispiel.de\",style:field}),/*#__PURE__*/_jsx(\"input\",{type:\"text\",tabIndex:-1,autoComplete:\"off\",\"aria-hidden\":\"true\",value:website,onChange:e=>setWebsite(e.target.value),style:{position:\"absolute\",left:-9999,width:1,height:1,opacity:0}}),/*#__PURE__*/_jsxs(\"label\",{style:{display:\"flex\",gap:10,alignItems:\"flex-start\",font:\"400 14px/1.45 \"+FONT,color:TIEFSEE,marginBottom:16,cursor:\"pointer\"},children:[/*#__PURE__*/_jsx(\"input\",{type:\"checkbox\",checked:consent,onChange:e=>setConsent(e.target.checked),style:{marginTop:3,accentColor:PETROL}}),/*#__PURE__*/_jsxs(\"span\",{children:[SERIE,\" (freiwillig)\"]})]}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",disabled:!ready,style:{width:\"100%\",padding:\"14px 18px\",borderRadius:10,border:\"none\",background:PETROL,color:\"#FFFFFF\",font:\"600 16px/1.2 \"+FONT,cursor:ready?\"pointer\":\"not-allowed\",opacity:ready?1:.55},children:state===\"sending\"?\"Wird gesendet …\":m.name+\" per E-Mail schicken\"}),state===\"error\"&&/*#__PURE__*/_jsx(\"p\",{style:{color:\"#B42318\",font:\"500 14px/1.4 \"+FONT,margin:\"10px 0 0\"},children:\"Das hat leider nicht geklappt. Versuch es bitte noch einmal oder schreib an info@seasafetylab.com.\"}),/*#__PURE__*/_jsxs(\"p\",{style:{font:\"400 13px/1.5 \"+FONT,color:GRAU,margin:\"12px 0 0\"},children:[\"Kostenlos. Deine Adresse nutzen wir nur f\\xfcr diesen Versand und, wenn du das H\\xe4kchen setzt und best\\xe4tigst, f\\xfcr die Serie. Details in der \",/*#__PURE__*/_jsx(\"a\",{href:privacyLink,style:{color:PETROL},children:\"Datenschutzerkl\\xe4rung\"}),\".\"]})]});}DownloadForm.defaultProps={material:\"funk\",endpoint:\"\",privacyLink:\"/datenschutz\"};addPropertyControls(DownloadForm,{material:{type:ControlType.Enum,title:\"Material\",options:[\"funk\",\"gezeiten\"],optionTitles:[\"Funk-Merkzettel\",\"Gezeiten-Schema\"],defaultValue:\"funk\"},endpoint:{type:ControlType.String,title:\"Web-App-URL\",defaultValue:\"\"},privacyLink:{type:ControlType.String,title:\"Datenschutz\",defaultValue:\"/datenschutz\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DownloadForm\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DownloadForm.map"],"mappings":"A,qLAE4c,SAASU,GAAe,CAAC,GAAUN,IAAS,OAAY,MAAM,GAAG,IAAME,EAAE,IAAI,gBAAgBF,EAAO,SAAS,MAAM,EAAE,MAAM,CAAC,aAAa,aAAa,cAAc,CAAC,CAAC,IAAI,GAAGE,EAAE,IAAIK,CAAC,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,KAAK,CAAE,CAG5pB,SAAwBC,EAAa,EAAM,CAAC,GAAK,CAAC,WAAS,WAAS,eAAaC,EAAYC,EAAEC,EAASC,IAAWD,EAAS,KAAU,CAACE,EAAMC,GAAUlB,EAAe,EAAE,EAAO,CAACmB,EAAQC,GAAYpB,EAAe,EAAK,EAAO,CAACqB,EAAQC,GAAYtB,EAAe,EAAE,EAAO,CAACuB,EAAMC,GAAUxB,EAAe,MAAM,EAAsEyB,EAAtD,6BAA6B,KAAKR,EAAM,KAAK,CAAqB,GAAGM,IAAQ,UAAgBG,EAAO,KAAM,IAAG,CAAoB,GAAnB,EAAE,eAAe,EAAMD,EAAa,IAAG,CAACE,EAAUH,EAAS,OAAO,MAAU,GAAS,SAAS,EAAE,GAAG,CAAC,MAAM,MAAMG,EAAS,CAAC,OAAO,OAAO,KAAK,UAAU,QAAQ,CAAC,eAAe,0BAA0B,EAAE,KAAK,KAAK,UAAU,CAAC,IAAI,WAAW,WAAS,MAAMV,EAAM,KAAK,EAAE,UAAQ,UAAQ,OAAO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