{"version":3,"file":"AppStateOverride.AtlDIaAl.mjs","names":[],"sources":["https:/framerusercontent.com/modules/lFJ71z6aXx7R90728AQ5/u7A0heNpI0pLUDrYvKml/AppStateOverride.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const useStore=createStore({selectedOrderMethod:\"Pickup\",isOpen:false});const getCookie=name=>{if(typeof document===\"undefined\")return\"{}\";let value=`; ${document.cookie}`;const parts=value.split(`; ${name}=`);if(parts.length===2)return parts.pop().split(\";\").shift();return\"{}\";};export const getLfgDefaults=()=>{try{return JSON.parse(getCookie(\"lfg_defaults\"));}catch(e){}return{};};const isReturningGuest=()=>{const defaults=getLfgDefaults();if(defaults===null||defaults===void 0?void 0:defaults.locationSlug){return true;}return false;};export function withOnClick(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,onClick:()=>{if(!(props===null||props===void 0?void 0:props.title))return;console.log(\"Desired method (props.title)=\",props===null||props===void 0?void 0:props.title);console.log(\"Current method (store.selectedOrderMethod)=\",store===null||store===void 0?void 0:store.selectedOrderMethod);if(props.title==store.selectedOrderMethod){return;}setStore({...store,selectedOrderMethod:props.title});},selectedOrderMethod:store.selectedOrderMethod,setOrderMethod:val=>setStore({...store,selectedOrderMethod:val})});};}export function withTextOverride(Component){return props=>{const[store,setStore]=useStore();let _text=\"Enter your zipcode\";if(store.selectedOrderMethod==\"Delivery\"){_text=\"Enter your address\";}return /*#__PURE__*/_jsx(Component,{...props,text:_text});};}export function getVariant(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,variant:store.selectedOrderMethod});};}/**\n * Used in the UI that picks the order method\n */export function getVariantAndDisplay(Component){return props=>{const[store,setStore]=useStore();const returning=isReturningGuest();console.log(\"Variant (store.selectedOrderMethod)=\",store===null||store===void 0?void 0:store.selectedOrderMethod);return /*#__PURE__*/_jsx(Component,{...props,variant:store.selectedOrderMethod,style:{display:returning?\"none\":\"default\"}});};}/** REMOVE AFTER CONFIRMING NOT USED */export function withSelectedOrderMethod(Component){return props=>{const[store,setStore]=useStore();const setOrderMethod=orderMethod=>{setStore({...store,selectedOrderMethod:orderMethod});};return /*#__PURE__*/_jsx(Component,{...props,selectedOrderMethod:store.selectedOrderMethod,setOrderMethod:setOrderMethod});};}/**\n * Used in the zip code and delivery address input\n */export function withSelectedOrderMethodAndDisplay(Component){return props=>{const[store,setStore]=useStore();const setOrderMethod=orderMethod=>{setStore({...store,selectedOrderMethod:orderMethod});};return /*#__PURE__*/_jsx(Component,{...props,selectedOrderMethod:store.selectedOrderMethod,setOrderMethod:setOrderMethod});};}export function withOnOpen(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,onClick:()=>{setTimeout(()=>{window.scrollTo(0,-50);window.top.scroll(0,-50);window.scroll(0,-50);},1,true);setTimeout(()=>{setStore({...store,isOpen:true});},10,true);}});};}export function withOnOpenVariant(Component){return props=>{const[store,setStore]=useStore();const returning=isReturningGuest();if(returning){return null;}return /*#__PURE__*/_jsx(Component,{...props,onClick:()=>{setTimeout(()=>{if(typeof window!==\"undefined\"){window.scrollTo(0,-50);window.top.scroll(0,-50);window.scroll(0,-50);}},1,true);setTimeout(()=>{setStore({...store,isOpen:true});},10,true);}});};}export function withMobileOrderMethod(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,isOpen:store.isOpen,setIsOpen:val=>setStore({...store,isOpen:val}),selectedOrderMethod:store.selectedOrderMethod,setOrderMethod:val=>{setStore({...store,selectedOrderMethod:val});}});};}export function withNavigateVariant(Component){return props=>{const defaults=getLfgDefaults();let link=\"http://order.localkitchens.com/\";let show=false;if(defaults===null||defaults===void 0?void 0:defaults.locationSlug){show=true;link+=`store/${defaults===null||defaults===void 0?void 0:defaults.locationSlug}/popular`;if(defaults===null||defaults===void 0?void 0:defaults.orderType){var _defaults_orderType;let isDelivery=(defaults===null||defaults===void 0?void 0:(_defaults_orderType=defaults.orderType)===null||_defaults_orderType===void 0?void 0:_defaults_orderType.toLowerCase())===\"delivery\";link+=`?is-delivery=${isDelivery?\"true\":\"false\"}`;}}if(!show){return null;}return /*#__PURE__*/_jsx(Component,{...props,href:link});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withNavigateVariant\":{\"type\":\"reactHoc\",\"name\":\"withNavigateVariant\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withOnOpenVariant\":{\"type\":\"reactHoc\",\"name\":\"withOnOpenVariant\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getVariant\":{\"type\":\"reactHoc\",\"name\":\"getVariant\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getVariantAndDisplay\":{\"type\":\"reactHoc\",\"name\":\"getVariantAndDisplay\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSelectedOrderMethodAndDisplay\":{\"type\":\"reactHoc\",\"name\":\"withSelectedOrderMethodAndDisplay\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSelectedOrderMethod\":{\"type\":\"reactHoc\",\"name\":\"withSelectedOrderMethod\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTextOverride\":{\"type\":\"reactHoc\",\"name\":\"withTextOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getLfgDefaults\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMobileOrderMethod\":{\"type\":\"reactHoc\",\"name\":\"withMobileOrderMethod\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withOnOpen\":{\"type\":\"reactHoc\",\"name\":\"withOnOpen\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withOnClick\":{\"type\":\"reactHoc\",\"name\":\"withOnClick\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AppStateOverride.map"],"mappings":"4JAIkhC,SAAgB,EAAsB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAM,GAAU,GAAU,CAAC,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,OAAO,EAAM,OAAO,UAAU,GAAK,EAAS,CAAC,GAAG,EAAM,OAAO,EAAI,CAAC,CAAC,oBAAoB,EAAM,oBAAoB,eAAe,GAAK,CAAC,EAAS,CAAC,GAAG,EAAM,oBAAoB,EAAI,CAAC,EAAG,CAAC,EAAI,SAAgB,EAAoB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAS,GAAgB,CAAK,EAAK,kCAAsC,EAAK,GAAM,GAAG,GAAmD,eAAc,EAAK,GAAK,GAAM,SAAS,GAAmD,aAAa,UAAa,GAAmD,WAAU,CAAyB,IAAI,EAAY,GAAwE,WAA2E,aAAa,GAAI,WAAW,GAAM,gBAAgB,EAAW,OAAO,UAAmC,OAAnB,EAAuC,EAAK,EAAU,CAAC,GAAG,EAAM,KAAK,EAAK,CAAC,CAA9D,iCAJ38D,IAAqE,CAAM,EAAS,EAAY,CAAC,oBAAoB,SAAS,OAAO,GAAM,CAAC,CAAO,EAAU,GAAM,CAAC,GAAG,OAAO,SAAW,IAAY,MAAM,KAAsC,IAAM,EAA7B,KAAK,SAAS,SAA2B,MAAM,KAAK,EAAK,GAAG,CAA2D,OAAvD,EAAM,SAAS,EAAS,EAAM,KAAK,CAAC,MAAM,IAAI,CAAC,OAAO,CAAO,MAAoB,MAAmB,CAAC,GAAG,CAAC,OAAO,KAAK,MAAM,EAAU,eAAe,CAAC,MAAU,EAAE,MAAM,EAAE"}