{"version":3,"file":"Layout.20S7DMFa.mjs","names":["useState","LocalizationProvider","Layout","ConnectedLocaleSelector"],"sources":["https:/framerusercontent.com/modules/I0I85jnJ258zUruJIsbN/PdDDZGzHv3MxbodwzLMJ/Layout.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{Layout,fetchLayout}from\"https://cdn.zapier.com/packages/marketing-ui/1.19.1/index.js\";import{ConnectedLocaleSelector}from\"https://cdn.zapier.com/packages/marketing-ui/1.19.1/localization.js\";import{LocalizationProvider}from\"https://cdn.zapier.com/packages/marketing-localization/0.1.4/react.js\";const stylesheetURL=\"https://cdn.zapier.com/packages/marketing-ui/1.19.1/styles.css\";export function withLayout(Component){return props=>{const[layoutData,setLayoutData]=useState(null);const[sitewideLocales,setSitewideLocales]=useState([]);useEffect(()=>{if(!document.querySelector(`link[href=\"${stylesheetURL}\"]`)){const link=document.createElement(\"link\");link.rel=\"stylesheet\";link.href=stylesheetURL;document.head.appendChild(link);}fetchLayout({origin:\"https://zapier.com\"}).then(setLayoutData);fetch(\"https://zapier.com/api/localization/locales\").then(r=>r.ok?r.json():{locales:[]}).then(d=>setSitewideLocales(d.locales??[])).catch(()=>{});},[]);if(!layoutData)return null;return /*#__PURE__*/_jsx(LocalizationProvider,{config:{domain:\"zapier.com\"},sitewideLocales:sitewideLocales,children:/*#__PURE__*/_jsx(Layout,{...layoutData,localeSelector:/*#__PURE__*/_jsx(ConnectedLocaleSelector,{}),children:/*#__PURE__*/_jsx(Component,{...props})})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withLayout\":{\"type\":\"reactHoc\",\"name\":\"withLayout\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Layout.map"],"mappings":"6OAAod,SAAgB,EAAW,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAW,GAAeA,EAAS,KAAK,CAAM,CAAC,EAAgB,GAAoBA,EAAS,EAAE,CAAC,CAAwb,OAAvb,MAAc,CAAC,GAAG,CAAC,SAAS,cAAc,cAAc,EAAc,IAAI,CAAC,CAAC,IAAM,EAAK,SAAS,cAAc,OAAO,CAAC,EAAK,IAAI,aAAa,EAAK,KAAK,EAAc,SAAS,KAAK,YAAY,EAAK,CAAE,EAAY,CAAC,OAAO,qBAAqB,CAAC,CAAC,KAAK,EAAc,CAAC,MAAM,8CAA8C,CAAC,KAAK,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,EAAmB,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,UAAU,GAAG,EAAG,EAAE,CAAC,CAAK,EAA2C,EAAKC,EAAqB,CAAC,OAAO,CAAC,OAAO,aAAa,CAAiB,kBAAgB,SAAsB,EAAKC,EAAO,CAAC,GAAG,EAAW,eAA4B,EAAKC,EAAwB,EAAE,CAAC,CAAC,SAAsB,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAnR,yBAAt/B,IAAsC,IAA6F,IAAyG,IAAwG,CAAM,EAAc"}