{
  "version": 3,
  "sources": ["ssg:https://framer.com/m/framer/store.js@^1.0.0", "ssg:https://framerusercontent.com/modules/AsR2zTpd29xVqN9ZQcm7/tuXbHvrYvRrQjcawi37G/FormOverride.js"],
  "sourcesContent": ["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map", "import{jsx as _jsx}from\"react/jsx-runtime\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const useStore=createStore({checkInDate:null,checkOutDate:null,adultCount:1});export function setWeekCount(Component){return props=>{const counter=303;const startDate=\"2024-07-08\";const calculateWeeksPassed=startDate=>{const currentDate=new Date().getTime();const fromDate=new Date(startDate).getTime();const toDate=currentDate;const differenceInMs=Math.abs(fromDate-toDate);return Math.round(differenceInMs/(7*24*60*60*1e3));};const weeksPassed=calculateWeeksPassed(startDate);const newCounter=counter+weeksPassed;const textValue=newCounter.toString();return /*#__PURE__*/_jsx(Component,{...props,text:textValue});};}export function setCheckIn(Component){return props=>{const[store,setStore]=useStore();const handleChange=event=>{const nextDay=new Date(event.target.value);nextDay.setDate(nextDay.getDate()+1);const formattedNextDay=nextDay.toISOString().split(\"T\")[0];setStore({checkInDate:event.target.value,checkOutDate:formattedNextDay});};return /*#__PURE__*/_jsx(Component,{...props,onChange:handleChange});};}export function setCheckOut(Component){return props=>{const[store,setStore]=useStore();const handleChange=event=>{setStore({checkOutDate:event.target.value});};return /*#__PURE__*/_jsx(Component,{...props,defaultValue:store.checkOutDate||\"\",onChange:handleChange});};}export function setGuestCount(Component){return props=>{const[store,setStore]=useStore();const handleChange=event=>{setStore({adultCount:event.target.value});};return /*#__PURE__*/_jsx(Component,{...props,onChange:handleChange});};}export function submitForm(Component){return props=>{const[store]=useStore();const handleClick=event=>{event.preventDefault();const{checkInDate,checkOutDate,adultCount}=store;const today=new Date;const tomorrow=new Date(today);tomorrow.setDate(tomorrow.getDate()+1);const params=new URLSearchParams({checkIn:checkInDate||today.toISOString().split(\"T\")[0],checkOut:checkOutDate||tomorrow.toISOString().split(\"T\")[0],adultCount,language:\"EN\",adultCountRoom1:adultCount});const targetUrl=\"https://alavya.barboon.net/search-result?\"+params.toString();window.open(targetUrl,\"_blank\");};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick});};}\nexport const __FramerMetadata__ = {\"exports\":{\"setCheckIn\":{\"type\":\"reactHoc\",\"name\":\"setCheckIn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setWeekCount\":{\"type\":\"reactHoc\",\"name\":\"setWeekCount\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setCheckOut\":{\"type\":\"reactHoc\",\"name\":\"setCheckOut\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setGuestCount\":{\"type\":\"reactHoc\",\"name\":\"setGuestCount\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"submitForm\":{\"type\":\"reactHoc\",\"name\":\"submitForm\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormOverride.map"],
  "mappings": "+GAAqF,SAASA,EAAYC,EAAO,CACjH,IAAMC,EAAUC,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAGF,CAAM,CAAC,CAAC,CAAC,EACjDG,EAAaC,GAAU,CAC1B,OAAOA,GAAW,aAAYA,EAASA,EAASH,EAAU,KAAK,GAAGA,EAAU,MAAM,OAAO,OAAO,CAAC,GAAGA,EAAU,MAAM,GAAGG,CAAQ,CAAC,CAAE,EACjIC,EAAW,OAAOL,GAAS,SAAS,OAAO,OAAO,CAAC,GAAGA,CAAM,CAAC,EAAEA,EAC7DM,EAAa,IAAI,IACjBC,EAAcH,GAAU,CAC3B,OAAOA,GAAW,aAAYA,EAASA,EAASC,CAAU,GAAGA,EAAW,OAAOD,GAAW,SAAS,OAAO,OAAO,CAAC,GAAGC,EAAW,GAAGD,CAAQ,CAAC,EAAEA,EACjJE,EAAa,QAAQE,GAAQA,EAAOH,CAAU,CAAC,CAAE,EACjD,SAASI,GAAU,CACnB,GAAK,CAACC,EAAMC,CAAQ,EAAEC,EAASP,CAAU,EAIzC,OAFAQ,EAAU,KACVP,EAAa,IAAIK,CAAQ,EAAQ,IAAIL,EAAa,OAAOK,CAAQ,GAAI,CAAC,CAAC,EACpEG,EAAe,IAAI,IAAMA,EAAe,EAAQ,CAACb,EAAU,MAAME,CAAY,GAC1E,CAACO,EAAMH,CAAa,CAAG,CAAC,OAAOE,CAAS,CCfkE,IAAMM,EAASC,EAAY,CAAC,YAAY,KAAK,aAAa,KAAK,WAAW,C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,CAAC,WAAWC,EAAM,OAAO,KAAK,CAAC,CAAE,CAAoE,CAAC,CAAE,CAAE,CAAQ,SAASM,EAAWjB,EAAU,CAAC,OAAOC,GAAO,CAAC,GAAK,CAACQ,CAAK,EAAEZ,EAAS,EAA0f,OAAoBU,EAAKP,EAAU,CAAC,GAAGC,EAAM,QAAnhBU,GAAO,CAACA,EAAM,eAAe,EAAE,GAAK,CAAC,YAAAO,EAAY,aAAAC,EAAa,WAAAC,CAAU,EAAEX,EAAYY,EAAM,IAAI,KAAWC,EAAS,IAAI,KAAKD,CAAK,EAAEC,EAAS,QAAQA,EAAS,QAAQ,EAAE,CAAC,EAA6M,IAAMC,EAAU,4CAA9M,IAAI,gBAAgB,CAAC,QAAQL,GAAaG,EAAM,YAAY,EAAE,MAAM,GAAG,EAAE,CAAC,EAAE,SAASF,GAAcG,EAAS,YAAY,EAAE,MAAM,GAAG,EAAE,CAAC,EAAE,WAAAF,EAAW,SAAS,KAAK,gBAAgBA,CAAU,CAAC,EAAqE,SAAS,EAAEI,EAAO,KAAKD,EAAU,QAAQ,CAAE,CAAkE,CAAC,CAAE,CAAE",
  "names": ["createStore", "state1", "dataStore", "Data", "setDataStore", "newState", "storeState", "storeSetters", "setStoreState", "setter", "useStore", "state", "setState", "ye", "ue", "useObserveData", "useStore", "createStore", "setWeekCount", "Component", "props", "textValue", "startDate", "currentDate", "fromDate", "differenceInMs", "p", "setCheckIn", "store", "setStore", "event", "nextDay", "formattedNextDay", "setCheckOut", "handleChange", "setGuestCount", "submitForm", "checkInDate", "checkOutDate", "adultCount", "today", "tomorrow", "targetUrl", "window"]
}
