{"version":3,"file":"SmashhouseData.d8dOxK_V.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/AtVijFCKNhOmh2aV2j2Y/4dxcGnY2bAeCh95F32us/SmashhouseData.js"],"sourcesContent":["/*\n * Smashhouse — Data  (shared code, not a component)\n *\n * A small registry for the CMS bridges other than the menu: \"Smashhouse Location Item\" and\n * \"Smashhouse FAQ Item\" register their row here; \"Smashhouse Locations\", \"Smashhouse FAQ\" and\n * \"Smashhouse Contact\" read them. Also holds the demo rows they show without a Collection List.\n */import{useEffect,useState}from\"react\";const stores={location:new Map,faq:new Map};const versions={location:0,faq:0};const listeners={location:new Set,faq:new Set};const queued={location:false,faq:false};function notify(kind){if(typeof window===\"undefined\"||queued[kind])return;queued[kind]=true;Promise.resolve().then(()=>{queued[kind]=false;listeners[kind].forEach(fn=>fn());});}/** Called by the bridge items during render; only real changes notify. */export function registerRow(kind,row){if(!row.key)return;const store=stores[kind];const previous=store.get(row.key);if(previous&&JSON.stringify(previous)===JSON.stringify(row))return;store.set(row.key,row);versions[kind]++;notify(kind);}export function unregisterRow(kind,key){if(!stores[kind].delete(key))return;versions[kind]++;notify(kind);}function useRows(kind){const[,setVersion]=useState(versions[kind]);useEffect(()=>{const update=()=>setVersion(versions[kind]);listeners[kind].add(update);update();return()=>{listeners[kind].delete(update);};},[kind]);return Array.from(stores[kind].values());}export const useLocations=()=>useRows(\"location\");export const useFaqs=()=>useRows(\"faq\");/** CMS formatted text or plain text → lines of plain text (paragraphs and line breaks split it). */export function toLines(value){if(typeof value!==\"string\"||!value.trim())return[];const text=value.replace(/<br\\s*\\/?>/gi,\"\\n\").replace(/<\\/(p|div|li|h\\d)>/gi,\"\\n\").replace(/<[^>]+>/g,\"\").replace(/&nbsp;/g,\" \").replace(/&amp;/g,\"&\").replace(/&lt;/g,\"<\").replace(/&gt;/g,\">\").replace(/&quot;/g,'\"').replace(/&#39;/g,\"'\");return text.split(/\\n+/).map(line=>line.trim()).filter(Boolean);}/* ------------------------------------------------------------------ *//* Opening hours                                                      *//* ------------------------------------------------------------------ */const DAYS=[\"sun\",\"mon\",\"tue\",\"wed\",\"thu\",\"fri\",\"sat\"];/** Which line of the hours covers a weekday (0 = Sunday), or -1. Understands \"Mon–Thu\", \"Fri-Sat\", \"Sun\", \"Daily\". */export function lineForDay(hours,day){for(let i=0;i<hours.length;i++){const head=hours[i].toLowerCase();if(/^(daily|every ?day|mon\\S*\\s*[–-]\\s*sun)/.test(head))return i;const range=head.match(/^([a-z]{3})[a-z]*\\s*[–-]\\s*([a-z]{3})/);if(range){const a=DAYS.indexOf(range[1]);const b=DAYS.indexOf(range[2]);if(a>=0&&b>=0){const inside=a<=b?day>=a&&day<=b:day>=a||day<=b;if(inside)return i;continue;}}const single=head.match(/^([a-z]{3})/);if(single&&DAYS.indexOf(single[1])===day)return i;}return-1;}/** Open right now? null when the hours cannot be read. Times like \"11:30–23:00\" or \"12:00-02:00\" (past midnight). */export function openNow(hours,now){const minutes=now.getHours()*60+now.getMinutes();const check=(day,shift)=>{const i=lineForDay(hours,day);if(i<0)return null;const m=hours[i].match(/(\\d{1,2})[:.](\\d{2})\\s*[–-]\\s*(\\d{1,2})[:.](\\d{2})/);if(!m)return/closed/i.test(hours[i])?false:null;const open=+m[1]*60+ +m[2];let close=+m[3]*60+ +m[4];if(close<=open)close+=24*60;const t=minutes+shift;return t>=open&&t<close;};const today=check(now.getDay(),0);/* still open from yesterday's late shift? */const yesterday=check((now.getDay()+6)%7,24*60);if(today===null&&yesterday===null)return null;return!!today||!!yesterday;}/* ------------------------------------------------------------------ *//* Demo rows (same as the template's CMS)                              *//* ------------------------------------------------------------------ */export const DEMO_LOCATIONS=[{key:\"williamsburg\",name:\"Williamsburg\",slug:\"williamsburg\",area:\"Brooklyn\",address:\"48 Ember Lane, Brooklyn, NY 11211\",phone:\"+1 (718) 555-0148\",note:\"The original. Twelve stools, one flat-top, a line on Fridays.\",hours:[\"Mon–Thu 11:30–23:00\",\"Fri–Sat 11:30–02:00\",\"Sun 12:00–22:00\"],map:\"https://maps.google.com/?q=Williamsburg+Brooklyn\",photo:\"\"},{key:\"east-village\",name:\"East Village\",slug:\"east-village\",area:\"Manhattan\",address:\"212 Grill Street, New York, NY 10009\",phone:\"+1 (212) 555-0193\",note:\"Late kitchen. The only one open till 3 on weekends.\",hours:[\"Mon–Thu 12:00–00:00\",\"Fri–Sat 12:00–03:00\",\"Sun 12:00–23:00\"],map:\"https://maps.google.com/?q=East+Village+Manhattan\",photo:\"\"},{key:\"fort-greene\",name:\"Fort Greene\",slug:\"fort-greene\",area:\"Brooklyn\",address:\"9 Sesame Court, Brooklyn, NY 11205\",phone:\"+1 (718) 555-0176\",note:\"Biggest room, a garden out back and space for groups up to 20.\",hours:[\"Mon–Thu 11:30–22:00\",\"Fri–Sat 11:30–00:00\",\"Sun 11:00–21:00\"],map:\"https://maps.google.com/?q=Fort+Greene+Brooklyn\",photo:\"\"}];export const DEMO_FAQS=[{key:\"allergens\",topic:\"Food\",question:\"Do you have an allergen list?\",answer:[\"Yes. Every burger is listed with its 14 major allergens on our allergens page, and the team at the counter can walk you through it. Everything is cooked on shared grills, so we cannot promise zero cross-contact.\"]},{key:\"gluten-free\",topic:\"Food\",question:\"Can I get a gluten-free bun?\",answer:[\"Any burger can come on a gluten-free bun or wrapped in lettuce for no extra charge. Our fries share a fryer with the chicken, so they are not gluten-free.\"]},{key:\"doneness\",topic:\"Food\",question:\"Can I order my burger medium-rare?\",answer:[\"Smash patties are too thin to cook to a temperature, so they come one way: crusty and cooked through. The Classic patty can be cooked medium on request.\"]},{key:\"sauce-recipe\",topic:\"Food\",question:\"What is in the house sauce?\",answer:[\"Mayo, mustard, chopped pickles and a few things we keep to ourselves. It contains egg and mustard. We sell it by the jar at the counter.\"]},{key:\"delivery\",topic:\"Orders\",question:\"Do you deliver?\",answer:[\"Yes, within two miles of each location through the order button at the top of the site. Burgers travel in vented boxes so the buns stay toasted.\"]},{key:\"order-ahead\",topic:\"Orders\",question:\"Can I order ahead and pick up?\",answer:[\"Order online, pick a time, and your bag waits on the shelf by the door with your name on it. No line, no waiting.\"]},{key:\"catering\",topic:\"Orders\",question:\"Do you cater events?\",answer:[\"From 20 to 300 people. We bring a grill, a crew and the full menu. Send us the date and headcount through the contact page and we reply within a day.\"]},{key:\"reservations\",topic:\"Visits\",question:\"Can I book a table?\",answer:[\"We do not take reservations. Order at the counter and grab any free seat. Groups of 10 or more can book the garden at Fort Greene.\"]},{key:\"kids\",topic:\"Visits\",question:\"Is it kid-friendly?\",answer:[\"Very. There are high chairs at every location, a kids menu with the Shorty, and crayons at the counter.\"]},{key:\"dogs\",topic:\"Visits\",question:\"Can I bring my dog?\",answer:[\"Dogs are welcome in the Fort Greene garden and on the Williamsburg sidewalk seats. Water bowls are on us.\"]}];\nexport const __FramerMetadata__ = {\"exports\":{\"useFaqs\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useLocations\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"toLines\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"registerRow\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"DEMO_LOCATIONS\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"lineForDay\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"FaqEntry\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"LocationEntry\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"openNow\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"DEMO_FAQS\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"unregisterRow\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SmashhouseData.map"],"mappings":"yHAM8M,SAAS,EAAO,EAAK,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