{"version":3,"file":"AddNewsletterIframeTitle.CPVR62ME.mjs","names":["useRef","useCallback"],"sources":["https:/framerusercontent.com/modules/usVvIulBloR6rAsKNPZe/DMF89e5PGo8jIVLUhvsw/AddNewsletterIframeTitle.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback,useEffect,useRef}from\"react\";// User request: Create a code override named AddNewsletterIframeTitle for the existing canvas Embed instance used by the STILL Letters subscription form. It must leave the existing embed source, dimensions, design, MailerLite behavior, localization behavior, and iframe contents untouched. At runtime, locate the iframe rendered inside the wrapped element and set its title attribute exactly to \"STILL Letters subscription form\"; continue to work if the iframe is inserted after initial render. Use a minimal, safe React override with cleanup. This is an accessibility-only change; expose no controls.\nexport function AddNewsletterIframeTitle(Component){return /*#__PURE__*/forwardRef(function AddNewsletterIframeTitleOverride(props,ref){const rootRef=useRef(null);const applyIframeTitle=useCallback(()=>{const root=rootRef.current;if(!root)return;const iframe=root instanceof HTMLIFrameElement?root:root.querySelector(\"iframe\");if(!iframe)return;const isUkrainian=window.location.pathname.startsWith(\"/uk/\");const expectedTitle=isUkrainian?\"Форма підписки на Листи STILL\":\"STILL Letters subscription form\";if(iframe.getAttribute(\"title\")!==expectedTitle){iframe.setAttribute(\"title\",expectedTitle);}if(iframe.getAttribute(\"aria-label\")!==expectedTitle){iframe.setAttribute(\"aria-label\",expectedTitle);}},[]);useEffect(()=>{applyIframeTitle();const root=rootRef.current;if(!root||typeof window===\"undefined\")return;const observer=new MutationObserver(()=>{applyIframeTitle();});observer.observe(root,{childList:true,subtree:true});return()=>{observer.disconnect();};},[applyIframeTitle]);const setRefs=useCallback(node=>{rootRef.current=node;if(typeof ref===\"function\"){ref(node);}else if(ref&&typeof ref===\"object\"){ref.current=node;}},[ref]);return /*#__PURE__*/_jsx(Component,{ref:setRefs,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"AddNewsletterIframeTitle\":{\"type\":\"reactHoc\",\"name\":\"AddNewsletterIframeTitle\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AddNewsletterIframeTitle.map"],"mappings":"gJACA,SAAgB,EAAyB,EAAU,CAAC,OAAoB,EAAW,SAA0C,EAAM,EAAI,CAAC,IAAM,EAAQA,EAAO,IAAI,EAAQ,EAAiBC,MAAgB,CAAC,IAAM,EAAK,EAAQ,QAAQ,GAAG,CAAC,EAAK,OAAO,IAAM,EAAO,aAAgB,kBAAkB,EAAK,EAAK,cAAc,QAAQ,EAAE,GAAG,CAAC,EAAO,OAAqE,IAAM,EAAlD,EAAO,SAAS,SAAS,WAAW,MAAsC,EAAE,gCAAgC,kCAAqC,EAAO,aAAa,OAAO,IAAI,GAAe,EAAO,aAAa,QAAQ,CAAa,EAAM,EAAO,aAAa,YAAY,IAAI,GAAe,EAAO,aAAa,aAAa,CAAa,CAAG,EAAE,CAAC,CAAC,EAAqb,OAAnb,MAAc,CAAC,EAAiB,EAAE,IAAM,EAAK,EAAQ,QAAQ,GAAG,CAAC,GAAa,IAAS,OAAY,OAAO,IAAM,EAAS,IAAI,qBAAqB,CAAC,EAAiB,CAAE,CAAC,EAAuD,OAArD,EAAS,QAAQ,EAAK,CAAC,UAAU,GAAK,QAAQ,EAAI,CAAC,MAAY,CAAC,EAAS,WAAW,CAAE,CAAE,EAAE,CAAC,CAAgB,CAAC,EAAkL,EAAK,EAAU,CAAC,IAAlLA,EAAY,GAAM,CAAC,EAAQ,QAAQ,EAAQ,OAAO,GAAM,WAAY,EAAI,CAAI,EAAW,GAAK,OAAO,GAAM,WAAU,EAAI,QAAQ,EAAM,EAAE,CAAC,CAAG,CAAiD,EAAE,GAAG,CAAK,CAAC,CAAE,CAAC,CAAE,qBAD1oC,IAA2D"}