{"version":3,"file":"MailerLiteIntegrationControl.DuO6_PwQ.mjs","names":["useMemo","useState","useRef","useRef","useState","useMemo","useCallback","_Fragment"],"sources":["https:/framerusercontent.com/modules/0JuNU6vRZh5f2pfy5Xql/AOYmaVy75OxtRNtJELHN/SourceTrackerControl.js","https:/framerusercontent.com/modules/SZzIlDitetshHWRUGcTe/a3lAlACxNwdbm5ZKFzca/MailerLiteIntegrationControl.js"],"sourcesContent":["/**\n * SourceTrackerControl — Hidden form field that captures visitor-source\n * data from the URL and submits it alongside the rest of the form.\n *\n * Capture modes (one mode per instance):\n *   - currentUrl      → current page URL (window.location.href)\n *   - referrerUrl     → previous page the visitor came from (document.referrer)\n *   - utmTags         → all utm_* params + optional ad-click IDs (gclid, fbclid, …)\n *   - urlParameter    → single named query param the user provides\n *   - customValue     → literal value baked into the component\n *\n * Enterprise differentiator: first-touch persistence via localStorage.\n * When enabled (utmTags / referrerUrl only), the value captured on the\n * first visit is stored and re-submitted on later visits — preserving\n * attribution across internal navigation and return visits.\n *\n * Renders nothing visible on the published site. Shows a labelled pill\n * on the Framer canvas so designers can see and select it.\n */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useMemo,useRef,useState}from\"react\";// ─── Constants ──────────────────────────────────────────────\nconst STORAGE_PREFIX=\"fm_src_\";/** Standard UTM keys captured whenever mode = \"utmTags\". */const UTM_KEYS=[\"utm_source\",\"utm_medium\",\"utm_campaign\",\"utm_content\",\"utm_term\"];/**\n * Ad-platform click IDs. Optional per-platform toggles on the\n * utmTags mode so the designer only emits what their stack cares\n * about. Each maps to the param name the platform sets on its URLs.\n */const AD_CLICK_GROUPS={google:[\"gclid\",\"gad_source\",\"gclsrc\",\"dclid\",\"gbraid\",\"wbraid\"],facebook:[\"fbclid\"],microsoft:[\"msclkid\"],linkedin:[\"li_fat_id\"],tiktok:[\"ttclid\"],twitter:[\"twclid\"]};// ─── Helpers ────────────────────────────────────────────────\n/**\n * Reads the requested params from the current URL. Empty values are\n * dropped so we don't emit `<input value=\"\">` for absent params.\n */function readParams(keys){if(typeof window===\"undefined\")return{};try{const search=new URLSearchParams(window.location.search);const out={};for(const key of keys){const value=search.get(key);if(value!==null&&value!==\"\"){out[key]=value;}}return out;}catch{return{};}}/**\n * Safely reads a persisted first-touch payload from localStorage.\n * Returns null if storage is unavailable or the value is malformed.\n */function readStorage(key){if(typeof localStorage===\"undefined\")return null;try{const raw=localStorage.getItem(key);if(!raw)return null;return JSON.parse(raw);}catch{return null;}}function writeStorage(key,value){if(typeof localStorage===\"undefined\")return;try{localStorage.setItem(key,JSON.stringify(value));}catch{/* swallow — storage quota or private mode, values just won't persist */}}// ─── Component ──────────────────────────────────────────────\n/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 220\n * @framerIntrinsicHeight 40\n * @framerDisableUnlink\n */export default function SourceTrackerControl(props){const{mode=\"utmTags\",fieldName=\"source\",urlParameter=\"\",customValue=\"\",fallback=\"\",persistFirstTouch=true,includeGclid=true,includeFbclid=true,includeMsclkid=false,includeLinkedIn=false,includeTikTok=false,includeTwitter=false,style}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;/**\n     * Build the list of extra query keys to harvest when mode is\n     * `utmTags`. Memoised so the effect below doesn't re-run on every\n     * unrelated prop change.\n     */const extraKeys=useMemo(()=>{if(mode!==\"utmTags\")return[];const keys=[];if(includeGclid)keys.push(...AD_CLICK_GROUPS.google);if(includeFbclid)keys.push(...AD_CLICK_GROUPS.facebook);if(includeMsclkid)keys.push(...AD_CLICK_GROUPS.microsoft);if(includeLinkedIn)keys.push(...AD_CLICK_GROUPS.linkedin);if(includeTikTok)keys.push(...AD_CLICK_GROUPS.tiktok);if(includeTwitter)keys.push(...AD_CLICK_GROUPS.twitter);return keys;},[mode,includeGclid,includeFbclid,includeMsclkid,includeLinkedIn,includeTikTok,includeTwitter]);/**\n     * Captured payload. Shape depends on mode:\n     *   - string         → single value (currentUrl, referrerUrl, urlParameter, customValue)\n     *   - object         → multiple key/value pairs (utmTags)\n     */const[captured,setCaptured]=useState(\"\");const containerRef=useRef(null);// Dispatch native change event on each emitted hidden input so conditional\n// logic watchers detect the captured value(s).\nuseEffect(()=>{const root=containerRef.current;if(!root)return;const nativeInputValueSetter=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,\"value\")?.set;const nodes=root.querySelectorAll('input[data-source-tracker=\"true\"]');nodes.forEach(el=>{nativeInputValueSetter?.call(el,el.value);el.dispatchEvent(new Event(\"change\",{bubbles:true}));});},[captured]);useEffect(()=>{if(isCanvas)return;const storageKey=STORAGE_PREFIX+mode;// ── Capture ─────────────────────────────────────────\nlet value=\"\";switch(mode){case\"currentUrl\":value=typeof window!==\"undefined\"?window.location.href:\"\";break;case\"referrerUrl\":value=typeof document!==\"undefined\"?document.referrer:\"\";break;case\"utmTags\":{const keys=[...UTM_KEYS,...extraKeys];value=readParams(keys);break;}case\"urlParameter\":value=urlParameter&&typeof window!==\"undefined\"?new URLSearchParams(window.location.search).get(urlParameter)||\"\":\"\";break;case\"customValue\":value=customValue;break;}// ── First-touch persistence ─────────────────────────\n// Only applies to modes that can be empty AND where the value\n// represents a marketing touch we want to preserve. Custom\n// values and the current URL are deterministic (not persisted).\nif(persistFirstTouch&&(mode===\"utmTags\"||mode===\"referrerUrl\")){const stored=readStorage(storageKey);const hasStoredValue=stored!==null&&(typeof stored===\"string\"?stored.length>0:Object.keys(stored).length>0);const hasCurrentValue=typeof value===\"string\"?value.length>0:Object.keys(value).length>0;if(hasStoredValue){// First-touch wins — re-use persisted value.\nvalue=stored;}else if(hasCurrentValue){// First visit with a meaningful value — persist it.\nwriteStorage(storageKey,value);}}// ── Fallback ────────────────────────────────────────\nif(fallback){if(typeof value===\"string\"&&!value){value=fallback;}else if(typeof value===\"object\"&&Object.keys(value).length===0){// For utmTags with no params and a fallback, emit a single\n// `utm_source=<fallback>` entry — aligns with the common\n// \"direct\" attribution convention.\nvalue={utm_source:fallback};}}setCaptured(value);},[isCanvas,mode,urlParameter,customValue,fallback,persistFirstTouch,extraKeys]);// ─── Canvas Label ───────────────────────────────────────\nif(isCanvas){const label=(()=>{switch(mode){case\"currentUrl\":return\"Current URL\";case\"referrerUrl\":return\"Referrer URL\";case\"utmTags\":return\"UTM Tags\";case\"urlParameter\":return`URL Param \\xb7 ${urlParameter||\"(unset)\"}`;case\"customValue\":return`Custom \\xb7 ${customValue||\"(empty)\"}`;default:return\"Source Tracker\";}})();return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:8,padding:\"8px 12px\",background:\"rgba(158, 232, 111, 0.12)\",border:\"1px dashed rgba(158, 232, 111, 0.6)\",borderRadius:8,fontFamily:\"Inter, system-ui, sans-serif\",fontSize:11,fontWeight:500,color:\"#0f172a\",width:\"100%\",boxSizing:\"border-box\",...style},children:[/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{display:\"inline-flex\",width:16,height:16,alignItems:\"center\",justifyContent:\"center\",borderRadius:4,background:\"#9EE86F\",color:\"#0f172a\",fontWeight:700,fontSize:10},children:\"S\"}),/*#__PURE__*/_jsx(\"span\",{style:{fontWeight:600},children:\"Source Tracker\"}),/*#__PURE__*/_jsxs(\"span\",{style:{opacity:.65,overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\"},children:[\"\\xb7 \",label]})]});}// ─── Published Render — hidden inputs only ───────────────\n/** Common props on every emitted hidden <input>. */const commonAttrs={type:\"hidden\",tabIndex:-1,\"data-source-tracker\":\"true\",\"data-framerforms-no-prefill\":\"true\"};const inputs=[];if(mode===\"utmTags\"&&typeof captured===\"object\"){// One hidden input per captured param — keeps the submit\n// payload flat and matches downstream analytics conventions.\nfor(const[key,value]of Object.entries(captured)){inputs.push(/*#__PURE__*/_jsx(\"input\",{...commonAttrs,name:key,value:value,readOnly:true},key));}}else if(fieldName){const value=typeof captured===\"string\"?captured:\"\";// Emit even when value is empty so the field always exists in\n// the submission — backends can distinguish \"visited but had\n// no source\" from \"tracker not installed at all\".\ninputs.push(/*#__PURE__*/_jsx(\"input\",{...commonAttrs,name:fieldName,value:value,readOnly:true}));}return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{position:\"absolute\",width:0,height:0,overflow:\"hidden\",pointerEvents:\"none\",...style},\"aria-hidden\":\"true\",children:inputs});}SourceTrackerControl.displayName=\"URL Source Collector\";SourceTrackerControl.defaultProps={mode:\"utmTags\",fieldName:\"source\",urlParameter:\"\",customValue:\"\",fallback:\"\",persistFirstTouch:true,includeGclid:true,includeFbclid:true,includeMsclkid:false,includeLinkedIn:false,includeTikTok:false,includeTwitter:false,_meta:\"\",style:{}};addPropertyControls(SourceTrackerControl,{mode:{type:ControlType.Enum,title:\"Capture\",defaultValue:\"utmTags\",options:[\"utmTags\",\"currentUrl\",\"referrerUrl\",\"urlParameter\",\"customValue\"],optionTitles:[\"UTM Tags\",\"Current URL\",\"Referrer URL\",\"URL Parameter\",\"Custom Value\"],description:\"What to capture from the visitor's URL and submit alongside the form.\"},fieldName:{type:ControlType.String,title:\"Field Name\",defaultValue:\"source\",placeholder:\"e.g. page_url\",description:\"Form field name this value submits as. Hidden in UTM Tags mode because every UTM key becomes its own field.\",hidden(props){return props.mode===\"utmTags\";}},urlParameter:{type:ControlType.String,title:\"Parameter\",defaultValue:\"\",placeholder:\"e.g. promo\",description:\"Query-string parameter name to read from the URL.\",hidden(props){return props.mode!==\"urlParameter\";}},customValue:{type:ControlType.String,title:\"Value\",defaultValue:\"\",placeholder:\"e.g. Homepage Hero\",description:\"Literal value submitted as-is. Useful for per-page source tags.\",hidden(props){return props.mode!==\"customValue\";}},fallback:{type:ControlType.String,title:\"Fallback\",defaultValue:\"\",placeholder:\"e.g. direct\",description:\"Value submitted when the URL/referrer has nothing to capture.\",hidden(props){return props.mode===\"customValue\";}},persistFirstTouch:{type:ControlType.Boolean,title:\"First-Touch\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\",description:\"Remember the value captured on the visitor's first visit so attribution survives internal navigation and return visits.\",hidden(props){return props.mode!==\"utmTags\"&&props.mode!==\"referrerUrl\";}},includeGclid:{type:ControlType.Boolean,title:\"Google Ads\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\",description:\"Include gclid, gad_source, gbraid, wbraid, dclid.\",hidden(props){return props.mode!==\"utmTags\";}},includeFbclid:{type:ControlType.Boolean,title:\"Meta (Facebook)\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\",description:\"Include fbclid.\",hidden(props){return props.mode!==\"utmTags\";}},includeMsclkid:{type:ControlType.Boolean,title:\"Microsoft Ads\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\",description:\"Include msclkid (Bing/Microsoft Ads click ID).\",hidden(props){return props.mode!==\"utmTags\";}},includeLinkedIn:{type:ControlType.Boolean,title:\"LinkedIn\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\",description:\"Include li_fat_id (LinkedIn Ads click ID).\",hidden(props){return props.mode!==\"utmTags\";}},includeTikTok:{type:ControlType.Boolean,title:\"TikTok\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\",description:\"Include ttclid (TikTok Ads click ID).\",hidden(props){return props.mode!==\"utmTags\";}},includeTwitter:{type:ControlType.Boolean,title:\"X (Twitter)\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\",description:\"Include twclid (X/Twitter Ads click ID).\",hidden(props){return props.mode!==\"utmTags\";}},_meta:{type:ControlType.String,defaultValue:\"\",description:\"by [Forms Plugin](https://formsplugin.com/?ref=source-tracker)\",hidden(){return true;}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SourceTrackerControl\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"40\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"220\",\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SourceTrackerControl.map","import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useCallback,useEffect,useMemo,useRef,useState}from\"react\";// ---------------------------------------------------------------------------\n// Defaults\n// ---------------------------------------------------------------------------\nconst DEFAULT_API_CONFIG={apiKey:\"\",updateEnabled:true,groupIds:[]};const DEFAULT_FIELDS_CONFIG={mappings:[{formFieldName:\"email\",mailerliteField:\"email\"}]};const BASE_URL=\"https://api.framergeeks.com/plugin/api/v1\";// Shared encryption key (must match server INTEGRATION_ENCRYPT_KEY)\nconst ENCRYPT_KEY_HEX=\"a3f2b8c1d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1\";/**\n * AES-256-GCM encrypt using Web Crypto API.\n * Output: base64( IV 12 bytes + ciphertext + authTag 16 bytes )\n */async function encryptPayload(data){const iv=crypto.getRandomValues(new Uint8Array(12));const keyBytes=new Uint8Array(ENCRYPT_KEY_HEX.match(/.{2}/g).map(b=>parseInt(b,16)));const cryptoKey=await crypto.subtle.importKey(\"raw\",keyBytes,\"AES-GCM\",false,[\"encrypt\"]);const encoded=new TextEncoder().encode(JSON.stringify(data));const encrypted=await crypto.subtle.encrypt({name:\"AES-GCM\",iv},cryptoKey,encoded);// GCM appends 16-byte auth tag to ciphertext automatically\nconst result=new Uint8Array(iv.length+encrypted.byteLength);result.set(iv,0);result.set(new Uint8Array(encrypted),iv.length);// Base64 encode\nlet binary=\"\";for(let i=0;i<result.length;i++){binary+=String.fromCharCode(result[i]);}return btoa(binary);}// ---------------------------------------------------------------------------\n// Canvas badge\n// ---------------------------------------------------------------------------\nfunction MailerLiteLogo(){return /*#__PURE__*/_jsxs(\"svg\",{width:\"40\",height:\"40\",viewBox:\"0 0 40 40\",fill:\"none\",children:[/*#__PURE__*/_jsx(\"rect\",{width:\"40\",height:\"40\",rx:\"12\",fill:\"#09C269\",fillOpacity:\"0.1\"}),/*#__PURE__*/_jsx(\"g\",{clipPath:\"url(#mailerlite_clip)\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M5.37157 17.6068L3.33488 18.8148C3.05859 18.9965 3.18484 19.3088 3.33488 19.3717L11.2447 23.8037C11.7119 24.0655 12.2875 24.0655 12.7548 23.8037L20.7693 19.313C21.0122 19.1692 20.9723 18.8769 20.7693 18.7782L18.6159 17.6147C18.4341 17.4947 18.0288 17.5346 17.8852 17.6323L12.7548 20.5069C12.2875 20.7687 11.7119 20.7687 11.2447 20.5069L6.06883 17.6068C5.87588 17.4881 5.57023 17.4949 5.37157 17.6068ZM11.245 0.196342C11.7123 -0.0654475 12.2878 -0.0654475 12.7551 0.196342L19.1247 3.7653C19.379 3.89395 19.402 4.23934 19.1247 4.39509C18.7048 4.62951 18.1416 4.94364 17.6743 5.20425C17.1283 5.50871 16.4637 5.50782 15.9184 5.20224L12.7551 3.42984C12.2878 3.16805 11.7123 3.16805 11.245 3.42984L8.07802 5.20434C7.53225 5.51011 6.86706 5.51068 6.32075 5.20597C5.83492 4.935 5.24556 4.60646 4.82087 4.37031C4.5853 4.26914 4.53626 3.96882 4.82087 3.79583L11.245 0.196342ZM21.9691 5.56843C22.4363 5.83022 22.7241 6.31404 22.7241 6.8376V17.1629C22.7241 17.6739 22.4041 17.7692 22.0627 17.5907L19.7039 16.3176V9.37593L12.7551 13.2694C12.2879 13.5312 11.7123 13.5312 11.2451 13.2694L4.29629 9.37593V16.3167L2.15291 17.5892C1.89746 17.7516 1.27612 17.8028 1.27612 17.1629V6.8376C1.27612 6.31404 1.56394 5.83021 2.03116 5.56843C2.7829 5.17477 3.55965 5.56843 3.55965 5.56843L12.0001 10.308L20.4273 5.56843C20.4273 5.56843 21.1757 5.11706 21.9691 5.56843Z\",fill:\"#09C269\",transform:\"translate(8 8)\"})}),/*#__PURE__*/_jsx(\"defs\",{children:/*#__PURE__*/_jsx(\"clipPath\",{id:\"mailerlite_clip\",children:/*#__PURE__*/_jsx(\"rect\",{width:\"24\",height:\"24\",fill:\"white\",transform:\"translate(8 8)\"})})})]});}function StatusIcon({connected}){if(connected){return /*#__PURE__*/_jsxs(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"none\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\",stroke:\"#10B77F\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M9 12L11 14L15 10\",stroke:\"#10B77F\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})]});}return /*#__PURE__*/_jsxs(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"none\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\",stroke:\"#6B7280\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M12 16V12\",stroke:\"#6B7280\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M12 8H12.01\",stroke:\"#6B7280\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})]});}function CanvasBadge({configured,error}){const subtitle=error?error:configured?\"Integration active\":\"Connect API key\";const subtitleColor=error?\"#dc2626\":configured?\"#10B77F\":\"#6B7280\";return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:\"12px\",padding:\"10px 14px\",background:\"#FFFFFF\",border:`1px solid ${error?\"rgba(220,38,38,0.15)\":\"rgba(0,0,0,0.06)\"}`,borderRadius:\"12px\",fontFamily:\"system-ui, -apple-system, sans-serif\",userSelect:\"none\",boxShadow:\"0 1px 3px rgba(0,0,0,0.04)\"},children:[/*#__PURE__*/_jsx(MailerLiteLogo,{}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:\"2px\",flex:1,minWidth:0},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontSize:\"14px\",fontWeight:600,color:\"#111827\",lineHeight:1.3},children:\"MailerLite\"}),/*#__PURE__*/_jsx(\"span\",{style:{fontSize:\"12px\",fontWeight:400,color:subtitleColor,lineHeight:1.3},children:subtitle})]}),/*#__PURE__*/_jsx(StatusIcon,{connected:configured&&!error})]});}// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 220\n * @framerIntrinsicHeight 40\n * @framerDisableUnlink\n */export default function MailerLiteIntegrationControl(props){const{apiConfig,fieldsConfig,_meta,style}=props;const apiCfg={...DEFAULT_API_CONFIG,...apiConfig||{}};const fieldsCfg={...DEFAULT_FIELDS_CONFIG,...fieldsConfig||{}};const isCanvas=RenderTarget.current()===RenderTarget.canvas;const containerRef=useRef(null);const formRef=useRef(null);const pendingRef=useRef(false);const[status,setStatus]=useState(\"idle\");const[statusMessage,setStatusMessage]=useState(\"\");const[setupDone,setSetupDone]=useState(false);const parsedMeta=useMemo(()=>{if(!_meta)return null;try{return JSON.parse(_meta);}catch{return null;}},[_meta]);const userId=parsedMeta?.userId;const projectId=parsedMeta?.projectId;// --- Upsert integration setup on API key change ---\nuseEffect(()=>{if(!apiCfg.apiKey){setSetupDone(false);return;}if(!userId||!projectId)return;fetch(`${BASE_URL}/integration/setup/mailerlite`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({int_user_fk_user_id:userId,int_fk_project_id:projectId,int_tp_api_key:apiCfg.apiKey,int_domain_prod:parsedMeta?.publishInfo?.production||\"\",int_domain_test:parsedMeta?.publishInfo?.staging||\"\",int_config:{}})}).then(async res=>{const data=await res.json();if(res.ok&&(data.status===true||data.success!==false)){setSetupDone(true);setStatus(\"success\");setStatusMessage(\"Integration active\");}else{setSetupDone(false);setStatus(\"error\");setStatusMessage(data.message||data.error?.[0]||\"Setup failed\");}}).catch(()=>{setSetupDone(false);setStatus(\"error\");setStatusMessage(\"Connection error\");});},[apiCfg.apiKey,userId,projectId]);// --- Find parent form ---\nconst findParentForm=useCallback(()=>{let el=containerRef.current;while(el){if(el.tagName===\"FORM\")return el;el=el.parentElement;}return null;},[]);// --- Collect form data & map to payload ---\nconst buildPayload=useCallback(form=>{const formData=new FormData(form);const dataObj={};formData.forEach((val,key)=>{if(typeof val===\"string\")dataObj[key]=val;});let email=\"\";const attributes={};const mappings=fieldsCfg.mappings||[];for(const mapping of mappings){const formField=mapping.formFieldName?.trim();const mlField=mapping.mailerliteField?.trim().toLowerCase();if(!formField||!mlField)continue;// Case-insensitive lookup\nlet formValue=\"\";for(const[key,value]of Object.entries(dataObj)){if(key.toLowerCase()===formField.toLowerCase()){formValue=value;break;}}if(!formValue)continue;if(mlField===\"email\"){email=formValue;}else{attributes[mlField]=formValue;}}if(!email)return null;// Only include groupIds when the user actually configured any,\n// so old integrations without this field send an identical\n// payload and server behavior is unchanged.\nconst cleanGroupIds=(apiCfg.groupIds||[]).map(g=>String(g).trim()).filter(Boolean);return{int_user_fk_user_id:userId||\"\",int_fk_project_id:projectId||\"\",email,attributes:Object.keys(attributes).length>0?attributes:undefined,config:{updateEnabled:apiCfg.updateEnabled,...cleanGroupIds.length>0?{groupIds:cleanGroupIds}:{}}};},[fieldsCfg.mappings,userId,projectId,apiCfg.updateEnabled,apiCfg.groupIds]);// --- Submit handler (calls our server, not MailerLite directly) ---\nconst handleSubmit=useCallback(async()=>{// Guard: prevent double-fire from submit + Enter\nif(pendingRef.current)return;if(!setupDone)return;const form=formRef.current;if(!form)return;pendingRef.current=true;const payload=buildPayload(form);if(!payload){setStatus(\"error\");setStatusMessage(\"No email field mapped\");pendingRef.current=false;return;}setStatus(\"sending\");setStatusMessage(\"\");// Encrypt entire payload so nothing is visible in network tab\nconst encrypted=await encryptPayload(payload);// Use keepalive so the request completes even if the page\n// navigates away (external redirect after form submit).\ntry{const response=await fetch(`${BASE_URL}/integration/use/mailerlite`,{method:\"POST\",keepalive:true,headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({data:encrypted})});const data=await response.json().catch(()=>({status:false,message:\"Unknown error\"}));if(data.status===true){setStatus(\"success\");setStatusMessage(\"Subscriber synced\");}else{setStatus(\"error\");setStatusMessage(data.message||`Error ${response.status}`);}}catch(err){if(err instanceof TypeError&&err.message.includes(\"abort\")){pendingRef.current=false;return;}setStatus(\"error\");setStatusMessage(\"Network error\");}finally{pendingRef.current=false;}},[setupDone,buildPayload]);// --- Attach to parent form ---\nuseEffect(()=>{if(isCanvas)return;const form=findParentForm();formRef.current=form;if(!form)return;const onKeydown=e=>{if(e.key!==\"Enter\"||e.shiftKey)return;const tag=e.target?.tagName;if(tag===\"TEXTAREA\"||tag===\"SELECT\")return;handleSubmit();};form.addEventListener(\"submit\",handleSubmit);form.addEventListener(\"keydown\",onKeydown);return()=>{form.removeEventListener(\"submit\",handleSubmit);form.removeEventListener(\"keydown\",onKeydown);};},[isCanvas,findParentForm,handleSubmit]);// --- Auto-clear status ---\nuseEffect(()=>{if(status===\"success\"||status===\"error\"){// On canvas keep error visible so user sees the issue\nif(isCanvas&&status===\"error\")return;const timer=setTimeout(()=>{setStatus(\"idle\");setStatusMessage(\"\");},5e3);return()=>clearTimeout(timer);}},[status,isCanvas]);// --- Render ---\nconst containerStyle={position:\"relative\",width:\"100%\",...style};if(isCanvas){return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsx(CanvasBadge,{configured:setupDone,error:status===\"error\"?statusMessage:undefined})});}// Hidden in preview — CSS :has() hides the Framer wrapper\nreturn /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`div:has(> .formsplugin-hide-mailerlite) { display: none; }`}),/*#__PURE__*/_jsx(\"div\",{ref:containerRef,className:\"formsplugin-hide-mailerlite\",style:containerStyle})]});}MailerLiteIntegrationControl.displayName=\"MailerLite Integration\";MailerLiteIntegrationControl.defaultProps={apiConfig:DEFAULT_API_CONFIG,fieldsConfig:DEFAULT_FIELDS_CONFIG,_meta:\"\",style:{}};addPropertyControls(MailerLiteIntegrationControl,{// ------------------------------------------------------------------\n// API Config\n// ------------------------------------------------------------------\napiConfig:{type:ControlType.Object,title:\"API Settings\",controls:{apiKey:{type:ControlType.String,title:\"API Key\",defaultValue:\"\",description:\"Your MailerLite API token.\",obscured:true},updateEnabled:{type:ControlType.Boolean,title:\"Update Existing\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\",description:\"Update existing subscribers if email already exists.\"},groupIds:{type:ControlType.Array,title:\"Groups\",description:'Optional. Add one or more MailerLite Group IDs to auto-assign new subscribers. Find the ID in the group\\'s URL (e.g. \"185244934057494195\").',defaultValue:[],control:{type:ControlType.String,placeholder:\"e.g. 185244934057494195\"}}}},// ------------------------------------------------------------------\n// Field Mappings\n// ------------------------------------------------------------------\nfieldsConfig:{type:ControlType.Object,title:\"Field Mappings\",controls:{mappings:{type:ControlType.Array,title:\"Mappings\",description:\"Map form field names to MailerLite subscriber fields. One mapping must target email.\",defaultValue:[{formFieldName:\"email\",mailerliteField:\"email\"}],control:{type:ControlType.Object,controls:{formFieldName:{type:ControlType.String,title:\"Form Field\",defaultValue:\"\",description:\"The name attribute of your form field.\"},mailerliteField:{type:ControlType.String,title:\"ML Field\",defaultValue:\"\",description:\"MailerLite field name (email, name, last_name, company, etc).\"}}}}}},// ------------------------------------------------------------------\n// Hidden Meta\n// ------------------------------------------------------------------\n_meta:{type:ControlType.String,defaultValue:\"\",hidden(){return true;}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MailerLiteIntegrationControl\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicWidth\":\"220\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"40\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MailerLiteIntegrationControl.map"],"mappings":"yOA2BG,SAAS,EAAW,EAAK,CAAC,GAAU,IAAS,OAAY,MAAM,EAAE,CAAC,GAAG,CAAC,IAAM,EAAO,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAO,EAAI,EAAE,CAAC,IAAI,IAAM,KAAO,EAAK,CAAC,IAAM,EAAM,EAAO,IAAI,EAAI,CAAI,IAAQ,MAAM,IAAQ,KAAI,EAAI,GAAK,GAAQ,OAAO,OAAU,CAAC,MAAM,EAAE,EAGvQ,SAAS,EAAY,EAAI,CAAC,GAAG,OAAO,aAAe,IAAY,OAAO,KAAK,GAAG,CAAC,IAAM,EAAI,aAAa,QAAQ,EAAI,CAAqB,OAAhB,EAAuB,KAAK,MAAM,EAAI,CAA3B,UAAkC,CAAC,OAAO,MAAO,SAAS,EAAa,EAAI,EAAM,CAAI,YAAO,aAAe,KAAmB,GAAG,CAAC,aAAa,QAAQ,EAAI,KAAK,UAAU,EAAM,CAAC,MAAO,GAO1T,SAAwB,EAAqB,EAAM,CAAC,GAAK,CAAC,OAAK,UAAU,YAAU,SAAS,eAAa,GAAG,cAAY,GAAG,WAAS,GAAG,oBAAkB,GAAK,eAAa,GAAK,gBAAc,GAAK,iBAAe,GAAM,kBAAgB,GAAM,gBAAc,GAAM,iBAAe,GAAM,SAAO,EAAY,EAAS,EAAa,SAAS,GAAG,EAAa,OAI/U,EAAUA,MAAY,CAAC,GAAG,IAAO,UAAU,MAAM,EAAE,CAAC,IAAM,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