{"version":3,"file":"Template_Form.CcFhdVKF.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/W1B34XHnxKhSGBBQ6mrT/kDmnBuAx3fFt79cELwo5/Template_Form.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const useStore=createStore({theme:\"system\"});const changeTheme=theme=>{const htmlElement=document.getElementsByTagName(\"html\")[0];const bodyElement=document.getElementsByTagName(\"body\")[0];htmlElement.setAttribute(\"toggle-theme\",theme);bodyElement.setAttribute(\"toggle-theme\",theme);localStorage.setItem(\"theme\",theme);const event=new Event(\"themeChange\");window.dispatchEvent(event);};export function AutoThemeIframe(props){const[store,setStore]=useStore();const[iframeSrc,setIframeSrc]=useState(props.src);// Update iframe source based on the current theme\nuseEffect(()=>{const savedTheme=localStorage.getItem(\"theme\");if(savedTheme){setStore({theme:savedTheme});changeTheme(savedTheme);}else{if(store.theme!==\"dark\"&&store.theme!==\"light\"){const mediaQuery=window.matchMedia(\"(prefers-color-scheme: dark)\");const newTheme=mediaQuery.matches?\"dark\":\"light\";setStore({theme:newTheme});changeTheme(newTheme);}else{changeTheme(store.theme);}}const mediaQuery=window.matchMedia(\"(prefers-color-scheme: dark)\");const handleChange=e=>{const newTheme=e.matches?\"dark\":\"light\";setStore({theme:newTheme});changeTheme(newTheme);};mediaQuery.addListener(handleChange);return()=>mediaQuery.removeListener(handleChange);},[store.theme,setStore]);// Update iframe source dynamically when the theme changes\nuseEffect(()=>{const newSrc=`${props.src}?theme=${store.theme}`;setIframeSrc(newSrc);},[store.theme,props.src]);const iframeStyle={width:\"100%\",height:props.height,border:\"none\",overflow:\"hidden\"};return /*#__PURE__*/_jsx(\"iframe\",{src:iframeSrc,style:iframeStyle,scrolling:\"no\"});}// Add property controls for customization in Framer\naddPropertyControls(AutoThemeIframe,{src:{type:ControlType.String,title:\"Form URL\",defaultValue:\"https://my.nativeforms.com/MTQttkSo1jZm4UW4Q2U11Db\"},height:{type:ControlType.String,title:\"Height\",defaultValue:\"400px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"AutoThemeIframe\":{\"type\":\"reactComponent\",\"name\":\"AutoThemeIframe\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Template_Form.map"],"mappings":"mPAA4kB,SAAgB,EAAgB,EAAM,CAAC,GAAK,CAAC,EAAM,GAAU,GAAU,CAAM,CAAC,EAAU,GAAcA,EAAS,EAAM,IAAI,CAEhgB,OADrM,MAAc,CAAC,IAAM,EAAW,aAAa,QAAQ,QAAQ,CAAC,GAAG,EAAY,EAAS,CAAC,MAAM,EAAW,CAAC,CAAC,EAAY,EAAW,SAAU,EAAM,QAAQ,QAAQ,EAAM,QAAQ,QAAQ,CAAoE,IAAM,EAAxD,EAAO,WAAW,+BAA+B,CAA2B,QAAQ,OAAO,QAAQ,EAAS,CAAC,MAAM,EAAS,CAAC,CAAC,EAAY,EAAS,MAAO,EAAY,EAAM,MAAM,CAAG,IAAM,EAAW,EAAO,WAAW,+BAA+B,CAAO,EAAa,GAAG,CAAC,IAAM,EAAS,EAAE,QAAQ,OAAO,QAAQ,EAAS,CAAC,MAAM,EAAS,CAAC,CAAC,EAAY,EAAS,EAAwC,OAArC,EAAW,YAAY,EAAa,KAAW,EAAW,eAAe,EAAa,EAAG,CAAC,EAAM,MAAM,EAAS,CAAC,CACnqB,MAAc,CAAkD,EAApC,GAAG,EAAM,IAAI,SAAS,EAAM,QAA4B,EAAG,CAAC,EAAM,MAAM,EAAM,IAAI,CAAC,CAA0G,EAAK,SAAS,CAAC,IAAI,EAAU,MAApH,CAAC,MAAM,OAAO,OAAO,EAAM,OAAO,OAAO,OAAO,SAAS,SAAS,CAAoE,UAAU,KAAK,CAAC,0BAF7O,IAAsC,IAAoD,IAAqE,CAAM,EAAS,EAAY,CAA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