{"version":3,"file":"Query_Select.DEfMQmmE.mjs","names":["useRef","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/mnXGfHdgnDdo5eP5dVBz/GqaSInyJxTb5wZuykQ3a/Query_Select.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";export function SelectFromQuery(props){const rootRef=useRef(null);useEffect(()=>{const root=rootRef.current;if(!root)return;// Find the actual <select> inside Framer’s Select component\nconst select=root.querySelector(\"select\");if(!select)return;// Example: read value from URL query string\nif(typeof window===\"undefined\")return;const url=new URL(window.location.href);const valueFromQuery=url.searchParams.get(\"ev\");if(!valueFromQuery)return;// Check if this value exists in the options by value\nconst hasOption=Array.from(select?.options)?.some(option=>option.value===valueFromQuery);if(!hasOption)return;// Only update if different\nif(select.value!==valueFromQuery){select.value=valueFromQuery;// Fire a real \"change\" event so Framer/Form sees it as user input\nconst event=new Event(\"change\",{bubbles:true});select.dispatchEvent(event);}},[]);// Attach the ref to the component instance on the canvas\nreturn{ref:rootRef};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withSelectFromQuery(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...SelectFromQuery(props)});};}withSelectFromQuery.displayName=\"SelectFromQuery\";\nexport const __FramerMetadata__ = {\"exports\":{\"withSelectFromQuery\":{\"type\":\"reactHoc\",\"name\":\"withSelectFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SelectFromQuery\":{\"type\":\"override\",\"name\":\"SelectFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Query_Select.map"],"mappings":"gMAA+E,SAAgB,EAAgB,EAAM,CAAC,IAAM,EAAQA,EAAO,KAAK,CAMhJ,OANiJ,MAAc,CAAC,IAAM,EAAK,EAAQ,QAAQ,GAAG,CAAC,EAAK,OACpM,IAAM,EAAO,EAAK,cAAc,SAAS,CACzC,GAD6C,CAAC,GACpC,IAAS,OAAY,OAA+C,IAAM,EAApC,IAAI,IAAI,EAAO,SAAS,KAAK,CAA0B,aAAa,IAAI,KAAK,CAAK,MAClH,MAAM,KAAK,GAAQ,QAAQ,EAAE,KAAK,GAAQ,EAAO,QAAQ,EAAe,EACrF,EAAO,QAAQ,EAAe,CAAC,EAAO,MAAM,EAC/C,IAAM,EAAM,IAAI,MAAM,SAAS,CAAC,QAAQ,GAAK,CAAC,CAAC,EAAO,cAAc,EAAM,GAAI,EAAE,CAAC,CAC3E,CAAC,IAAI,EAAQ,CAAqJ,SAAgB,EAAoB,EAAE,CAAC,MAAO,KAAQ,EAA+BC,EAAwC,CAAQC,EAAK,EAAE,CAAC,GAAG,EAAM,GAAG,EAAgB,EAAM,CAAC,CAAC,uBAN9S,IAAoC,IAMyF,CAAqL,EAAoB,YAAY"}